KNSCore::Provider Class
Base Provider class. This class is deprecated since 6.9. We strongly advise against using it in new code. More...
- Header:
#include <KNewStuff/Provider> - CMake:
find_package(KF6 REQUIRED COMPONENTS NewStuff)
target_link_libraries(mytarget PRIVATE KF6::NewStuff) - Inherits: QObject
- Status: Deprecated since 6.9
List of all members, including inherited members
Deprecated members
Public Types
Properties
Public Functions
- Provider()
- void becomeFan(const KNSCore::Entry &)
- QString contactEmail() const
- QStringList downloadTagFilter() const
- QUrl host() const
- QUrl icon() const
- QString id() const
- bool isInitialized() const
- void loadBasics()
- void loadComments(const KNSCore::Entry &, int, int)
- void loadEntries(const KNSCore::Provider::SearchRequest &request)
- void loadEntryDetails(const KNSCore::Entry &)
- void loadPayloadLink(const KNSCore::Entry &entry, int linkId)
- void loadPerson(const QString &)
- QString name() const
- void setCachedEntries(const KNSCore::Entry::List &cachedEntries)
- void setContactEmail(const QString &contactEmail)
- void setDownloadTagFilter(const QStringList &downloadTagFilter)
- void setHost(const QUrl &host)
- bool setProviderXML(const QDomElement &xmldata)
- void setSupportsSsl(bool supportsSsl)
- void setTagFilter(const QStringList &tagFilter)
- void setVersion(const QString &version)
- void setWebsite(const QUrl &website)
- bool supportsSsl() const
- QStringList tagFilter() const
- bool userCanBecomeFan()
- bool userCanVote()
- QString version() const
- void vote(const KNSCore::Entry &, uint)
- QUrl website() const
Signals
- void basicsLoaded()
- void categoriesMetadataLoded(const QList<KNSCore::Provider::CategoryMetadata> &categories)
- void commentsLoaded(const QList<std::shared_ptr<KNSCore::Comment>> comments)
- void downloadTagFilterChanged()
- 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 &)
- void tagFilterChanged()
Protected Functions
This class is deprecated since 6.9. We strongly advise against using it in new code.
Detailed Description
This class provides accessors for the provider object.
Note: This class should not be used directly by the application. This class is the base class and will be instantiated for static website providers.
Use ProviderBase to implement providers (only in-tree supported). Use ProviderCore to manage instances of base.
Member Type Documentation
enum Provider::Filter
KNSCore::Provider::Filter
| Constant | |
|---|---|
KNSCore::Provider::None |
0 |
KNSCore::Provider::Installed |
1 |
KNSCore::Provider::Updates |
2 |
KNSCore::Provider::ExactEntryId |
3 |
enum Provider::SortMode
| Constant | |
|---|---|
KNSCore::Provider::Newest |
0 |
KNSCore::Provider::Alphabetical |
1 |
KNSCore::Provider::Rating |
2 |
KNSCore::Provider::Downloads |
3 |
Property Documentation
contactEmail : QString
Access functions:
QStringcontactEmail() constvoidsetContactEmail(constQString&contactEmail)
Notifier signal:
voidbasicsLoaded()
host : QUrl
Access functions:
Notifier signal:
voidbasicsLoaded()
supportsSsl : bool
Access functions:
boolsupportsSsl() constvoidsetSupportsSsl(boolsupportsSsl)
Notifier signal:
voidbasicsLoaded()
version : QString
Access functions:
QStringversion() constvoidsetVersion(constQString&version)
Notifier signal:
voidbasicsLoaded()
website : QUrl
Access functions:
QUrlwebsite() constvoidsetWebsite(constQUrl&website)
Notifier signal:
voidbasicsLoaded()
Member Function Documentation
Provider::Provider()
Constructor.
[signal] void Provider::basicsLoaded()
Fired when the provider's basic information has been fetched and updated
Note: Notifier signal for properties contactEmail, host, supportsSsl, version, and website.
[virtual] void Provider::becomeFan(const KNSCore::Entry &)
[signal] void Provider::categoriesMetadataLoded(const QList<KNSCore::Provider::CategoryMetadata> &categories)
[signal] void Provider::commentsLoaded(const QList<std::shared_ptr<KNSCore::Comment>> comments)
Fired when new comments have been loaded
comments The list of newly loaded comments, in a depth-first order
QString Provider::contactEmail() const
Returns The general contact email for this provider.
Note: Getter function for property contactEmail.
See also setContactEmail()
QStringList Provider::downloadTagFilter() const
Returns the tag filter used for downloads by this provider.
See also EngineBase::setDownloadTagFilter
[signal] void Provider::downloadTagFilterChanged()
[signal] void Provider::entryDetailsLoaded(const KNSCore::Entry &)
QUrl Provider::host() const
Note: Getter function for property host.
See also setHost()
[virtual] QUrl Provider::icon() const
Returns the icon URL for this provider.
See also setIcon()
[pure virtual] QString Provider::id() const
A unique Id for this provider (the url in most cases)
[pure virtual] bool Provider::isInitialized() const
[virtual] void Provider::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()
[virtual] void Provider::loadComments(const KNSCore::Entry &, int, int)
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.
See also commentsLoaded
[pure virtual] void Provider::loadEntries(const KNSCore::Provider::SearchRequest &request)
Loads the given search and return given page
request defines the search parameters
Note: the engine connects to loadingFinished() signal to get the result
[virtual] void Provider::loadEntryDetails(const KNSCore::Entry &)
[pure virtual] void Provider::loadPayloadLink(const KNSCore::Entry &entry, int linkId)
[virtual] void Provider::loadPerson(const QString &)
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.
[signal] void Provider::loadingFailed(const KNSCore::Provider::SearchRequest &)
[signal] void Provider::loadingFinished(const KNSCore::Provider::SearchRequest &, const KNSCore::Entry::List &)
[virtual] QString Provider::name() const
Returns the common name of the provider.
See also setName()
[signal] void Provider::payloadLinkLoaded(const KNSCore::Entry &)
[signal] void Provider::personLoaded(const std::shared_ptr<KNSCore::Author> author)
Fired when the details of a person have been loaded
author The person we've just loaded data for
[signal] void Provider::providerInitialized(KNSCore::Provider *)
[signal] void Provider::searchPresetsLoaded(const QList<KNSCore::Provider::SearchPreset> &presets)
Fires when the provider has loaded search presets. These represent interesting searches for the user, such as recommendations.
[pure virtual] void Provider::setCachedEntries(const KNSCore::Entry::List &cachedEntries)
void Provider::setContactEmail(const QString &contactEmail)
Sets the general contact email address for this provider.
contactEmail The general contact email for this provider
Note: Setter function for property contactEmail.
See also contactEmail()
void Provider::setDownloadTagFilter(const QStringList &downloadTagFilter)
Sets the tag filter used for download items by this provider
downloadTagFilter The new list of filters
See also downloadTagFilter(), EngineBase::setDownloadTagFilter
void Provider::setHost(const QUrl &host)
Sets the host used for this provider to host.
Note: Setter function for property host.
See also host()
[protected] void Provider::setIcon(const QUrl &icon)
See also icon()
[protected] void Provider::setName(const QString &name)
See also name()
[pure virtual] bool Provider::setProviderXML(const QDomElement &xmldata)
Sets the provider xmldata to initialize the provider. The Provider needs to have it's ID set in this function and cannot change it from there on.
Returns true if successful, or false if the XML data is invalid
void Provider::setSupportsSsl(bool supportsSsl)
Sets whether or not the provider supports SSL connections.
supportsSsl True if the server supports SSL connections, false if not
Note: Setter function for property supportsSsl.
See also supportsSsl()
void Provider::setTagFilter(const QStringList &tagFilter)
Sets the tag filter used for entries by this provider.
tagFilter The new list of filters
See also tagFilter(), EngineBase::setTagFilter
void Provider::setVersion(const QString &version)
Sets the version.
Note: Setter function for property version.
See also version()
void Provider::setWebsite(const QUrl &website)
Sets the website URL.
Note: Setter function for property website.
See also website()
[signal] void Provider::signalError(const QString &)
[signal] void Provider::signalErrorCode(KNSCore::ErrorCode::ErrorCode errorCode, const QString &message, const QVariant &metadata)
[signal] void Provider::signalInformation(const QString &)
bool Provider::supportsSsl() const
Returns True if the server supports SSL connections, false if not
Note: Getter function for property supportsSsl.
See also setSupportsSsl()
QStringList Provider::tagFilter() const
Returns the tag filter used for downloads by this provider.
See also EngineBase::setTagFilter
[signal] void Provider::tagFilterChanged()
[virtual] bool Provider::userCanBecomeFan()
[virtual] bool Provider::userCanVote()
QString Provider::version() const
Note: Getter function for property version.
See also setVersion()
[virtual] void Provider::vote(const KNSCore::Entry &, uint)
QUrl Provider::website() const
Note: Getter function for property website.
See also setWebsite()