KNewStuff

core/downloadmanager.h
1 /*
2  Copyright (C) 2010 Frederik Gladhorn <[email protected]>
3  Copyright (C) 2016 Dan Leinir Turthra Jensen <[email protected]>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #ifndef KNSCORE_DownloadManager_H
20 #define KNSCORE_DownloadManager_H
21 
22 #include "knewstuffcore_export.h"
23 #include "entryinternal.h"
24 
25 namespace KNSCore
26 {
27 class DownloadManagerPrivate;
34 class KNEWSTUFFCORE_EXPORT DownloadManager : public QObject
35 {
36  Q_OBJECT
37 
38 public:
39  enum SortOrder {
40  Newest,
41  Alphabetical,
42  Rating,
43  Downloads
44  };
45 
53  explicit DownloadManager(QObject *parent = nullptr);
54 
61  explicit DownloadManager(const QString &configFile, QObject *parent = nullptr);
62 
66  ~DownloadManager();
67 
71  void search(int page = 0, int pageSize = 100);
72 
77  void checkForUpdates();
78 
85  void checkForInstalled();
86 
91  void installEntry(const EntryInternal &entry);
92 
97  void uninstallEntry(const EntryInternal &entry);
98 
104  void setSearchTerm(const QString &searchTerm);
105 
112  void setSearchOrder(SortOrder order);
113 
121  void fetchEntryById(const QString &id);
122 
123 Q_SIGNALS:
129  void searchResult(const EntryInternal::List &entries);
130 
136  void entryStatusChanged(const EntryInternal &entry);
137 
141  void errorFound(const QString &errorMessage);
142 
143 public Q_SLOTS:
144  void slotProvidersLoaded();
145 
146 private:
147  DownloadManagerPrivate *const d;
148  Q_DISABLE_COPY(DownloadManager)
149 };
150 
151 }
152 
153 #endif
Rating
KNewStuff update checker.
Contains the core functionality for handling interaction with NewStuff providers. ...
KCALUTILS_EXPORT QString errorMessage(const KCalendarCore::Exception &exception)
KNewStuff data entry container.
Definition: entryinternal.h:60
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun Aug 9 2020 22:43:40 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.