Changeset View
Changeset View
Standalone View
Standalone View
src/core/engine.h
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Line(s) | |||||
53 | * | 53 | * | ||
54 | * @see KNSCore::Engine | 54 | * @see KNSCore::Engine | ||
55 | * @see KNSCore::ItemsModel | 55 | * @see KNSCore::ItemsModel | ||
56 | * @see KNSCore::QuestionListener | 56 | * @see KNSCore::QuestionListener | ||
57 | */ | 57 | */ | ||
58 | namespace KNSCore | 58 | namespace KNSCore | ||
59 | { | 59 | { | ||
60 | class Cache; | 60 | class Cache; | ||
61 | class CommentsModel; | ||||
61 | class Installation; | 62 | class Installation; | ||
62 | 63 | | |||
63 | /** | 64 | /** | ||
64 | * KNewStuff engine. | 65 | * KNewStuff engine. | ||
65 | * An engine keeps track of data which is available locally and remote | 66 | * An engine keeps track of data which is available locally and remote | ||
66 | * and offers high-level synchronization calls as well as upload and download | 67 | * and offers high-level synchronization calls as well as upload and download | ||
67 | * primitives using an underlying GHNS protocol. | 68 | * primitives using an underlying GHNS protocol. | ||
68 | */ | 69 | */ | ||
Show All 18 Lines | 73 | public: | |||
87 | * about the initialization. | 88 | * about the initialization. | ||
88 | * | 89 | * | ||
89 | * @param configfile KNewStuff2 configuration file (*.knsrc) | 90 | * @param configfile KNewStuff2 configuration file (*.knsrc) | ||
90 | * @return \b true if any valid configuration was found, \b false otherwise | 91 | * @return \b true if any valid configuration was found, \b false otherwise | ||
91 | */ | 92 | */ | ||
92 | bool init(const QString &configfile); | 93 | bool init(const QString &configfile); | ||
93 | 94 | | |||
94 | /** | 95 | /** | ||
96 | * The name as defined by the knsrc file | ||||
97 | * @return The name associated with the engine's configuration file | ||||
98 | * @since 5.61 | ||||
99 | */ | ||||
100 | QString name() const; | ||||
101 | | ||||
102 | /** | ||||
95 | * Installs an entry's payload file. This includes verification, if | 103 | * Installs an entry's payload file. This includes verification, if | ||
96 | * necessary, as well as decompression and other steps according to the | 104 | * necessary, as well as decompression and other steps according to the | ||
97 | * application's *.knsrc file. | 105 | * application's *.knsrc file. | ||
98 | * | 106 | * | ||
99 | * @param entry Entry to be installed | 107 | * @param entry Entry to be installed | ||
100 | * | 108 | * | ||
101 | * @see signalInstallationFinished | 109 | * @see signalInstallationFinished | ||
102 | * @see signalInstallationFailed | 110 | * @see signalInstallationFailed | ||
Show All 35 Lines | |||||
138 | * Note: This will automatically launch a search, which means | 146 | * Note: This will automatically launch a search, which means | ||
139 | * you do not need to call requestData manually. | 147 | * you do not need to call requestData manually. | ||
140 | * | 148 | * | ||
141 | * @see KNSCore::Provider::SearchRequest | 149 | * @see KNSCore::Provider::SearchRequest | ||
142 | * @param mode The order you want search results to come back in. | 150 | * @param mode The order you want search results to come back in. | ||
143 | */ | 151 | */ | ||
144 | void setSortMode(Provider::SortMode mode); | 152 | void setSortMode(Provider::SortMode mode); | ||
145 | /** | 153 | /** | ||
154 | * The sort mode set on the current request | ||||
155 | * @see setFilter(Provider::SortMode) | ||||
ahiemstra: I assume you mean setSortMode here? | |||||
156 | * @since 5.61 | ||||
157 | */ | ||||
158 | Provider::SortMode sortMode() const; | ||||
159 | /** | ||||
146 | * Set a filter for results (defaults to none), which will allow you | 160 | * Set a filter for results (defaults to none), which will allow you | ||
147 | * to show only installed entries, installed entries which have updates, | 161 | * to show only installed entries, installed entries which have updates, | ||
148 | * or a specific item with a specified ID. The latter further requires | 162 | * or a specific item with a specified ID. The latter further requires | ||
149 | * the search term to be the exact ID of the entry you wish to retrieve. | 163 | * the search term to be the exact ID of the entry you wish to retrieve. | ||
150 | * | 164 | * | ||
151 | * Note: This will automatically launch a search, which means | 165 | * Note: This will automatically launch a search, which means | ||
152 | * you do not need to call requestData manually. | 166 | * you do not need to call requestData manually. | ||
153 | * | 167 | * | ||
154 | * @see fetchEntryById(QString) | 168 | * @see fetchEntryById(QString) | ||
155 | * @see setSearchTerm(QString) | 169 | * @see setSearchTerm(QString) | ||
156 | * @param filter The type of results you wish to see | 170 | * @param filter The type of results you wish to see | ||
157 | */ | 171 | */ | ||
158 | void setFilter(Provider::Filter filter); | 172 | void setFilter(Provider::Filter filter); | ||
173 | /** | ||||
174 | * The result filter set on the current request | ||||
175 | * @see setFilter(Provider::Filter) | ||||
176 | * @since 5.61 | ||||
177 | */ | ||||
178 | Provider::Filter filter() const; | ||||
159 | 179 | | |||
160 | /** | 180 | /** | ||
161 | * Set the categories that will be included in searches | 181 | * Set the categories that will be included in searches | ||
162 | * | 182 | * | ||
163 | * Note: This will automatically launch a search, which means | 183 | * Note: This will automatically launch a search, which means | ||
164 | * you do not need to call requestData manually. | 184 | * you do not need to call requestData manually. | ||
165 | * | 185 | * | ||
166 | * @see KNSCore::Engine::categories() | 186 | * @see KNSCore::Engine::categories() | ||
167 | * @param categories A list of strings of categories | 187 | * @param categories A list of strings of categories | ||
168 | */ | 188 | */ | ||
169 | void setCategoriesFilter(const QStringList &categories); | 189 | void setCategoriesFilter(const QStringList &categories); | ||
170 | /** | 190 | /** | ||
171 | * Sets a string search term. | 191 | * Sets a string search term. | ||
172 | * | 192 | * | ||
173 | * Note: This will automatically launch a search, which means | 193 | * Note: This will automatically launch a search, which means | ||
174 | * you do not need to call requestData manually. | 194 | * you do not need to call requestData manually. | ||
175 | * | 195 | * | ||
176 | * @param searchString The search term you wish to search for | 196 | * @param searchString The search term you wish to search for | ||
177 | */ | 197 | */ | ||
178 | void setSearchTerm(const QString &searchString); | 198 | void setSearchTerm(const QString &searchString); | ||
199 | /** | ||||
200 | * The search term for the current search (empty if none is set) | ||||
201 | * @return The current search term | ||||
202 | * @since 5.61 | ||||
203 | */ | ||||
204 | QString searchTerm() const; | ||||
179 | void reloadEntries(); | 205 | void reloadEntries(); | ||
180 | void requestMoreData(); | 206 | void requestMoreData(); | ||
181 | void requestData(int page, int pageSize); | 207 | void requestData(int page, int pageSize); | ||
182 | 208 | | |||
183 | /** | 209 | /** | ||
184 | * Set a filter for results, which filters out all entries which do not match | 210 | * Set a filter for results, which filters out all entries which do not match | ||
185 | * the filter, as applied to the tags for the entry. This filters only on the | 211 | * the filter, as applied to the tags for the entry. This filters only on the | ||
186 | * tags specified for the entry itself. To filter the downloadlinks, use | 212 | * tags specified for the entry itself. To filter the downloadlinks, use | ||
▲ Show 20 Lines • Show All 231 Lines • ▼ Show 20 Line(s) | |||||
418 | * then the engine will also look in the systemwide config location (usually /etc/xdg | 444 | * then the engine will also look in the systemwide config location (usually /etc/xdg | ||
419 | * on linux). If disabled, this fallback location will not be searched. | 445 | * on linux). If disabled, this fallback location will not be searched. | ||
420 | * | 446 | * | ||
421 | * @param enableFallback Whether or not the fallback discovery should be enabled | 447 | * @param enableFallback Whether or not the fallback discovery should be enabled | ||
422 | * @since 5.57 | 448 | * @since 5.57 | ||
423 | */ | 449 | */ | ||
424 | void setConfigLocationFallback(bool enableFallback); | 450 | void setConfigLocationFallback(bool enableFallback); | ||
425 | 451 | | |||
452 | /** | ||||
453 | * The Provider instance with the passed ID | ||||
454 | * | ||||
455 | * @param providerId The ID of the Provider to fetch | ||||
456 | * @return The Provider with the passed ID, or null if non such Provider exists | ||||
457 | * @since 5.61 | ||||
458 | */ | ||||
459 | QSharedPointer<Provider> provider(const QString &providerId) const; | ||||
460 | | ||||
461 | /** | ||||
462 | * This function will return an instance of a model which contains comments for | ||||
463 | * the entry passed to it. The model may be empty (if there are no comments for | ||||
464 | * the entry, which also covers situations where the entry's provider does not | ||||
465 | * support commenting) | ||||
466 | * | ||||
467 | * @param entry The entry to fetch comments for | ||||
468 | * @return A model which contains the comments for the specified entry | ||||
469 | * @since 5.61 | ||||
470 | */ | ||||
471 | CommentsModel* commentsForEntry(const KNSCore::EntryInternal &entry); | ||||
pino: BIC change, you cannot add virtual functions in a public class | |||||
leinir: That shouldn't be virtual anyway, not sure why i did that... | |||||
472 | | ||||
426 | Q_SIGNALS: | 473 | Q_SIGNALS: | ||
427 | /** | 474 | /** | ||
428 | * Indicates a message to be added to the ui's log, or sent to a messagebox | 475 | * Indicates a message to be added to the ui's log, or sent to a messagebox | ||
429 | */ | 476 | */ | ||
430 | void signalMessage(const QString &message); | 477 | void signalMessage(const QString &message); | ||
431 | 478 | | |||
432 | void signalProvidersLoaded(); | 479 | void signalProvidersLoaded(); | ||
433 | void signalEntriesLoaded(const KNSCore::EntryInternal::List &entries); | 480 | void signalEntriesLoaded(const KNSCore::EntryInternal::List &entries); | ||
▲ Show 20 Lines • Show All 110 Lines • Show Last 20 Lines |
I assume you mean setSortMode here?