KNSCore::Provider
#include <provider.h>
![Inheritance graph](classKNSCore_1_1Provider__inherit__graph.png)
Classes | |
struct | CategoryMetadata |
struct | SearchPreset |
struct | SearchRequest |
Public Types | |
enum | Filter { None , Installed , Updates , ExactEntryId } |
typedef QList< Provider * > | List |
enum | SearchPresetTypes { NoPresetType = 0 , GoBack , Root , Start , Popular , Featured , Recommended , Shelf , Subscription , New , FolderUp , AllEntries } |
enum | SortMode { Newest , Alphabetical , Rating , Downloads } |
Properties | |
QString | contactEmail |
QUrl | host |
bool | supportsSsl |
QString | version |
QUrl | website |
![]() | |
objectName | |
Signals | |
void | basicsLoaded () |
void | categoriesMetadataLoded (const QList< KNSCore::Provider::CategoryMetadata > &categories) |
void | commentsLoaded (const QList< std::shared_ptr< KNSCore::Comment > > comments) |
void | entryDetailsLoaded (const KNSCore::Entry &) |
void | loadingFailed (const KNSCore::Provider::SearchRequest &) |
void | loadingFinished (const KNSCore::Provider::SearchRequest &, const KNSCore::Entry::List &) |
void | payloadLinkLoaded (const KNSCore::Entry &) |
void | personLoaded (const std::shared_ptr< KNSCore::Author > author) |
void | providerInitialized (KNSCore::Provider *) |
void | searchPresetsLoaded (const QList< KNSCore::Provider::SearchPreset > &presets) |
void | signalError (const QString &) |
void | signalErrorCode (KNSCore::ErrorCode::ErrorCode errorCode, const QString &message, const QVariant &metadata) |
void | signalInformation (const QString &) |
Protected Member Functions | |
void | setIcon (const QUrl &icon) |
void | setName (const QString &name) |
![]() | |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
bool | isSignalConnected (const QMetaMethod &signal) const const |
int | receivers (const char *signal) const const |
QObject * | sender () const const |
int | senderSignalIndex () const const |
virtual void | timerEvent (QTimerEvent *event) |
Detailed Description
KNewStuff Base Provider class.
This class provides accessors for the provider object. It should not be used directly by the application. This class is the base class and will be instantiated for static website providers.
Definition at line 40 of file provider.h.
Member Typedef Documentation
◆ List
typedef QList<Provider *> KNSCore::Provider::List |
Definition at line 49 of file provider.h.
Member Enumeration Documentation
◆ Filter
enum KNSCore::Provider::Filter |
Definition at line 59 of file provider.h.
◆ SearchPresetTypes
The SearchPresetTypes enum the preset type enum is a helper to identify the kind of label and icon the search preset should have if none are found.
- Since
- 5.83
Definition at line 116 of file provider.h.
◆ SortMode
enum KNSCore::Provider::SortMode |
Definition at line 51 of file provider.h.
Property Documentation
◆ contactEmail
|
readwrite |
Definition at line 46 of file provider.h.
◆ host
|
readwrite |
Definition at line 45 of file provider.h.
◆ supportsSsl
|
readwrite |
Definition at line 47 of file provider.h.
◆ version
|
readwrite |
Definition at line 43 of file provider.h.
◆ website
|
readwrite |
Definition at line 44 of file provider.h.
Constructor & Destructor Documentation
◆ Provider()
KNSCore::Provider::Provider | ( | ) |
Constructor.
Definition at line 67 of file provider.cpp.
◆ ~Provider()
|
overridedefault |
Destructor.
Member Function Documentation
◆ basicsLoaded
|
signal |
Fired when the provider's basic information has been fetched and updated.
- Since
- 5.85
◆ becomeFan()
Definition at line 310 of file provider.h.
◆ commentsLoaded
|
signal |
Fired when new comments have been loaded.
- Parameters
-
comments The list of newly loaded comments, in a depth-first order
- Since
- 5.63
◆ contactEmail()
QString KNSCore::Provider::contactEmail | ( | ) | const |
The general contact email for this provider.
- Returns
- The general contact email for this provider
- Since
- 5.85
Definition at line 160 of file provider.cpp.
◆ downloadTagFilter()
QStringList KNSCore::Provider::downloadTagFilter | ( | ) | const |
The tag filter used for downloads by this provider.
- Returns
- The list of filters
- See also
- Engine::setDownloadTagFilter(QStringList)
- Since
- 5.51
Definition at line 99 of file provider.cpp.
◆ host()
QUrl KNSCore::Provider::host | ( | ) | const |
- Since
- 5.85
Definition at line 146 of file provider.cpp.
◆ icon()
|
virtual |
Retrieves the icon URL for this provider.
- Returns
- icon URL
Definition at line 79 of file provider.cpp.
◆ id()
A unique Id for this provider (the url in most cases)
◆ loadBasics()
Request loading of the basic information for this provider.
The engine listens to the basicsLoaded() signal for the result, which is also the signal the respective properties listen to.
This is fired automatically on the first attempt to read one of the properties which contain this basic information, and you will not need to call it as a user of the class (just listen to the properties, which will update when the information has been fetched).
- Note
- Implementation detail: All subclasses should connect to this signal and point it at a slot which does the actual work, if they support fetching this basic information (if the information is set during construction, you will not need to worry about this).
- See also
- version()
- website()
- host();
- contactEmail()
- supportsSsl()
- Since
- 5.85
Definition at line 244 of file provider.h.
◆ loadComments()
|
inlinevirtual |
Request a loading of comments from this provider.
The engine listens to the commentsLoaded() signal for the result
- Note
- Implementation detail: All subclasses should connect to this signal and point it at a slot which does the actual work, if they support comments.
- Since
- 5.63
Definition at line 205 of file provider.h.
◆ loadEntries()
|
pure virtual |
load the given search and return given page
- Parameters
-
sortMode string to select the order in which the results are presented searchstring string to search with page page number to load
Note: the engine connects to loadingFinished() signal to get the result
◆ loadEntryDetails()
|
inlinevirtual |
Definition at line 191 of file provider.h.
◆ loadPerson()
Request loading of the details for a specific person with the given username.
The engine listens to the personLoaded() for the result
- Note
- Implementation detail: All subclasses should connect to this signal and point it at a slot which does the actual work, if they support comments.
- Since
- 5.63
Definition at line 218 of file provider.h.
◆ name()
|
virtual |
Retrieves the common name of the provider.
- Returns
- provider name
Definition at line 74 of file provider.cpp.
◆ personLoaded
|
signal |
Fired when the details of a person have been loaded.
- Parameters
-
author The person we've just loaded data for
- Since
- 5.63
◆ searchPresetsLoaded
|
signal |
Fires when the provider has loaded search presets.
These represent interesting searches for the user, such as recommendations.
- Since
- 5.83
◆ setContactEmail()
Sets the general contact email address for this provider.
- Parameters
-
contactEmail The general contact email for this provider
- Since
- 5.85
Definition at line 166 of file provider.cpp.
◆ setDownloadTagFilter()
void KNSCore::Provider::setDownloadTagFilter | ( | const QStringList & | downloadTagFilter | ) |
Set the tag filter used for download items by this provider.
- Parameters
-
downloadTagFilter The new list of filters
- See also
- Engine::setDownloadTagFilter(QStringList)
- Since
- 5.51
Definition at line 94 of file provider.cpp.
◆ setHost()
- Parameters
-
host The host used for this provider
- Since
- 5.85
Definition at line 152 of file provider.cpp.
◆ setIcon()
Definition at line 193 of file provider.cpp.
◆ setName()
Definition at line 188 of file provider.cpp.
◆ setProviderXML()
|
pure virtual |
Set the provider data xml, to initialize the provider.
The Provider needs to have it's ID set in this function and cannot change it from there on.
◆ setSupportsSsl()
void KNSCore::Provider::setSupportsSsl | ( | bool | supportsSsl | ) |
Set whether or not the provider supports SSL connections.
- Parameters
-
supportsSsl True if the server supports SSL connections, false if not
- Since
- 5.85
Definition at line 180 of file provider.cpp.
◆ setTagFilter()
void KNSCore::Provider::setTagFilter | ( | const QStringList & | tagFilter | ) |
Set the tag filter used for entries by this provider.
- Parameters
-
tagFilter The new list of filters
- See also
- Engine::setTagFilter(QStringList)
- Since
- 5.51
Definition at line 84 of file provider.cpp.
◆ setVersion()
- Since
- 5.85
Definition at line 124 of file provider.cpp.
◆ setWebsite()
- Since
- 5.85
Definition at line 138 of file provider.cpp.
◆ supportsSsl()
bool KNSCore::Provider::supportsSsl | ( | ) | const |
Whether or not the provider supports SSL connections.
- Returns
- True if the server supports SSL connections, false if not
- Since
- 5.85
Definition at line 174 of file provider.cpp.
◆ tagFilter()
QStringList KNSCore::Provider::tagFilter | ( | ) | const |
The tag filter used for downloads by this provider.
- Returns
- The list of filters
- See also
- Engine::setTagFilter(QStringList)
- Since
- 5.51
Definition at line 89 of file provider.cpp.
◆ userCanBecomeFan()
|
inlinevirtual |
Definition at line 306 of file provider.h.
◆ userCanVote()
|
inlinevirtual |
Definition at line 298 of file provider.h.
◆ version()
QString KNSCore::Provider::version | ( | ) | const |
- Since
- 5.85
Definition at line 118 of file provider.cpp.
◆ vote()
Definition at line 302 of file provider.h.
◆ website()
QUrl KNSCore::Provider::website | ( | ) | const |
- Since
- 5.85
Definition at line 132 of file provider.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jun 21 2024 11:58:34 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.