KNewStuff

downloadmanager.h
1 /*
2  SPDX-FileCopyrightText: 2010 Frederik Gladhorn <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-or-later
5 */
6 
7 #ifndef KNEWSTUFF3_UI_DownloadManager_H
8 #define KNEWSTUFF3_UI_DownloadManager_H
9 
10 #include "knewstuff_export.h"
11 #include "entry.h"
12 
13 #if KNEWSTUFF_ENABLE_DEPRECATED_SINCE(5, 29)
14 
15 namespace KNS3
16 {
17 class DownloadManagerPrivate;
26 class KNEWSTUFF_EXPORT DownloadManager : public QObject
27 {
28  Q_OBJECT
29 
30 public:
31  enum SortOrder {
32  Newest,
33  Alphabetical,
34  Rating,
35  Downloads
36  };
37 
46  KNEWSTUFF_DEPRECATED_VERSION(5, 29, "Use KNSCore::DownloadManager")
47  explicit DownloadManager(QObject *parent = nullptr);
48 
56  KNEWSTUFF_DEPRECATED_VERSION(5, 29, "Use KNSCore::DownloadManager")
57  explicit DownloadManager(const QString &configFile, QObject *parent = nullptr);
58 
62  ~DownloadManager();
63 
67  void search(int page = 0, int pageSize = 100);
68 
73  void checkForUpdates();
74 
81  void checkForInstalled();
82 
87  void installEntry(const KNS3::Entry &entry);
88 
94  void uninstallEntry(const KNS3::Entry &entry);
95 
101  void setSearchTerm(const QString &searchTerm);
102 
109  void setSearchOrder(SortOrder order);
110 
118  void fetchEntryById(const QString &id);
119 
120 Q_SIGNALS:
126  void searchResult(const KNS3::Entry::List &entries);
127 
133  void entryStatusChanged(const KNS3::Entry &entry);
134 
138  void errorFound(const QString &errorMessage);
139 
140 private:
141  Q_PRIVATE_SLOT(d, void _k_slotProvidersLoaded())
142  Q_PRIVATE_SLOT(d, void _k_slotEngineError(const QString &error))
143  Q_PRIVATE_SLOT(d, void _k_slotEntryStatusChanged(const KNSCore::EntryInternal &entry))
144  Q_PRIVATE_SLOT(d, void _k_slotEntriesLoaded(const KNSCore::EntryInternal::List &entries))
145  KNS3::DownloadManagerPrivate *const d;
146  Q_DISABLE_COPY(DownloadManager)
147 };
148 
149 }
150 
151 #endif // KNEWSTUFF_ENABLE_DEPRECATED_SINCE(5, 29)
152 
153 #endif
Rating
KNewStuff update checker.
KNewStuff information about changed entries.
Definition: entry.h:32
KCALUTILS_EXPORT QString errorMessage(const KCalendarCore::Exception &exception)
KNewStuff data entry container.
Definition: entryinternal.h:49
Definition: button.cpp:18
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue Aug 11 2020 22:43:23 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.