/usr/include/knewstuff3/downloadmanager.h is in kdelibs5-dev 4:4.14.16-0ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | /*
Copyright (C) 2010 Frederik Gladhorn <gladhorn@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef KNEWSTUFF3_UI_DownloadManager_H
#define KNEWSTUFF3_UI_DownloadManager_H
#include "knewstuff_export.h"
#include "entry.h"
namespace KNS3
{
/**
* KNewStuff update checker.
* This class can be used to search for KNewStuff items
* without using the widgets and to look for updates of
* already installed items without showing the dialog.
* @since 4.5
*/
class KNEWSTUFF_EXPORT DownloadManager :public QObject
{
Q_OBJECT
public:
enum SortOrder {
Newest,
Alphabetical,
Rating,
Downloads
};
/**
* Create a DownloadManager
* It will try to find a appname.knsrc file (using KComponentData).
* Appname is the name of your application as provided in the about data->
*
* @param parent the parent of the dialog
*/
explicit DownloadManager(QObject * parent = 0);
/**
* Create a DownloadManager. Manually specifying the name of the .knsrc file.
*
* @param configFile the name of the configuration file
* @param parent
*/
explicit DownloadManager(const QString& configFile, QObject * parent = 0);
/**
* destructor
*/
~DownloadManager();
/**
Search for a list of entries. searchResult will be emitted with the requested list.
*/
void search(int page = 0, int pageSize = 100);
/**
Check for available updates.
Use searchResult to get notified as soon as an update has been found.
*/
void checkForUpdates();
/**
Installs or updates an entry
@param entry
*/
void installEntry(const KNS3::Entry& entry);
/**
* Uninstalls the given entry.
* @param entry The entry which will be uninstalled.
* @since 4.7
*/
void uninstallEntry(const KNS3::Entry& entry);
/**
Sets the search term to filter the results on the server.
Note that this function does not trigger a search. Use search after setting this.
@param searchTerm
*/
void setSearchTerm(const QString& searchTerm);
/**
Set the sort order of the results. This depends on the server.
Note that this function does not trigger a search. Use search after setting this.
@see SortOrder
@param order
*/
void setSearchOrder(SortOrder order);
Q_SIGNALS:
/**
Returns the search result.
This can be the list of updates after checkForUpdates or the result of a search.
@param entries the list of results. entries is empty when nothing was found.
*/
void searchResult(const KNS3::Entry::List& entries);
/**
The entry status has changed: emitted when the entry has been installed, updated or removed.
Use KNS3::Entry::status() to check the current status.
@param entry the item that has been updated.
*/
void entryStatusChanged(const KNS3::Entry& entry);
private:
Q_PRIVATE_SLOT( d, void _k_slotProvidersLoaded() )
Q_PRIVATE_SLOT( d, void _k_slotEntryStatusChanged(const KNS3::EntryInternal& entry) )
Q_PRIVATE_SLOT( d, void _k_slotEntriesLoaded(const KNS3::EntryInternal::List& entries) )
class Private;
Private *const d;
Q_DISABLE_COPY(DownloadManager)
};
}
#endif
|