KNewStuff
downloadmanager.h
Go to the documentation of this file.
00001 /* 00002 Copyright (C) 2010 Frederik Gladhorn <gladhorn@kde.org> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Lesser General Public 00006 License as published by the Free Software Foundation; either 00007 version 2.1 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Lesser General Public License for more details. 00013 00014 You should have received a copy of the GNU Lesser General Public 00015 License along with this library. If not, see <http://www.gnu.org/licenses/>. 00016 */ 00017 00018 #ifndef KNEWSTUFF3_UI_DownloadManager_H 00019 #define KNEWSTUFF3_UI_DownloadManager_H 00020 00021 #include "knewstuff_export.h" 00022 #include "entry.h" 00023 00024 namespace KNS3 00025 { 00026 00034 class KNEWSTUFF_EXPORT DownloadManager :public QObject 00035 { 00036 Q_OBJECT 00037 00038 public: 00039 enum SortOrder { 00040 Newest, 00041 Alphabetical, 00042 Rating, 00043 Downloads 00044 }; 00045 00053 explicit DownloadManager(QObject * parent = 0); 00054 00061 explicit DownloadManager(const QString& configFile, QObject * parent = 0); 00062 00066 ~DownloadManager(); 00067 00071 void search(int page = 0, int pageSize = 100); 00072 00077 void checkForUpdates(); 00078 00083 void installEntry(const KNS3::Entry& entry); 00084 00090 void setSearchTerm(const QString& searchTerm); 00091 00098 void setSearchOrder(SortOrder order); 00099 00100 Q_SIGNALS: 00106 void searchResult(const KNS3::Entry::List& entries); 00107 00113 void entryStatusChanged(const KNS3::Entry& entry); 00114 00115 private: 00116 Q_PRIVATE_SLOT( d, void _k_slotProvidersLoaded() ) 00117 Q_PRIVATE_SLOT( d, void _k_slotEntryStatusChanged(const KNS3::EntryInternal& entry) ) 00118 Q_PRIVATE_SLOT( d, void _k_slotEntriesLoaded(const KNS3::EntryInternal::List& entries) ) 00119 class Private; 00120 Private *const d; 00121 Q_DISABLE_COPY(DownloadManager) 00122 }; 00123 00124 } 00125 00126 #endif
KDE 4.6 API Reference