KNewStuff
provider.cpp
Go to the documentation of this file.00001 /* 00002 This file is part of KNewStuff2. 00003 Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org> 00004 Copyright (c) 2003 - 2007 Josef Spillner <spillner@kde.org> 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Lesser General Public 00008 License as published by the Free Software Foundation; either 00009 version 2.1 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Lesser General Public License for more details. 00015 00016 You should have received a copy of the GNU Lesser General Public 00017 License along with this library. If not, see <http://www.gnu.org/licenses/>. 00018 */ 00019 00020 #include "provider.h" 00021 00022 #include <kdebug.h> 00023 #include <kio/job.h> 00024 00025 using namespace KNS; 00026 00027 class ProviderPrivate 00028 { 00029 public: 00030 ProviderPrivate() {} 00031 }; 00032 00033 Provider::Provider() 00034 : d(0) 00035 { 00036 } 00037 00038 Provider::~Provider() 00039 { 00040 //qDeleteAll(mFeeds); 00041 //delete d; 00042 } 00043 00044 void Provider::addDownloadUrlFeed(const QString& feedtype, Feed *feed) 00045 { 00046 mFeeds[feedtype] = feed; 00047 // FIXME: check for "blessed" feed types? 00048 } 00049 00050 Feed *Provider::downloadUrlFeed(const QString& feedtype) const 00051 { 00052 if (mFeeds.contains(feedtype)) { 00053 return mFeeds[feedtype]; 00054 } else { 00055 return NULL; 00056 } 00057 } 00058 00059 void Provider::setName(const KTranslatable &name) 00060 { 00061 mName = name; 00062 } 00063 00064 KTranslatable Provider::name() const 00065 { 00066 return mName; 00067 } 00068 00069 void Provider::setIcon(const KUrl &url) 00070 { 00071 mIcon = url; 00072 } 00073 00074 KUrl Provider::icon() const 00075 { 00076 return mIcon; 00077 } 00078 00079 void Provider::setUploadUrl(const KUrl &url) 00080 { 00081 mUploadUrl = url; 00082 } 00083 00084 KUrl Provider::uploadUrl() const 00085 { 00086 return mUploadUrl; 00087 } 00088 00089 void Provider::setNoUploadUrl(const KUrl &url) 00090 { 00091 mNoUploadUrl = url; 00092 } 00093 00094 KUrl Provider::noUploadUrl() const 00095 { 00096 return mNoUploadUrl; 00097 } 00098 00099 void Provider::setWebAccess(const KUrl &url) 00100 { 00101 mWebAccess = url; 00102 } 00103 00104 KUrl Provider::webAccess() const 00105 { 00106 return mWebAccess; 00107 } 00108 00109 void Provider::setWebService(const KUrl &url) 00110 { 00111 mWebService = url; 00112 } 00113 00114 KUrl Provider::webService() const 00115 { 00116 return mWebService; 00117 } 00118 00119 QStringList Provider::feeds() const 00120 { 00121 return mFeeds.keys(); 00122 } 00123