Attica::ProviderManager
#include <Attica/ProviderManager>
Public Types | |
enum | ProviderFlag { NoFlags = 0x0 , DisablePlugins = 0x1 } |
typedef QFlags< ProviderFlag > | ProviderFlags |
Signals | |
void | authenticationCredentialsMissing (const Provider &provider) |
void | defaultProvidersLoaded () |
void | failedToLoad (const QUrl &provider, QNetworkReply::NetworkError error) |
void | providerAdded (const Attica::Provider &provider) |
Additional Inherited Members | |
Properties inherited from QObject | |
objectName | |
Static Public Member Functions inherited from QObject | |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
bool | disconnect (const QMetaObject::Connection &connection) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
Public Attributes inherited from QObject | |
typedef | QObjectList |
Protected Member Functions inherited from QObject | |
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
This class is the primary access to Attica's functions. Use the ProviderManager to load Open Collaboration Service providers, either the default system ones, or from XML or custom locations.
Provider Files
Provider files are defined here: http://www.freedesktop.org/wiki/Specifications/open-collaboration-services
Basic Use
See addProviderFileToDefaultProviders(const QUrl &url) for an example of what the provider file sohuld look like. You can add providers to the ProviderManager as either raw XML data using addProviderFromXml(const QString &providerXml), or from a file somewhere on the system through addProviderFile(const QUrl &file), or you can simply load the default providers provided by your system (which generally means KDE's provider opendesktop.org).
Importantly, to be able to detect when the ProviderManager is ready to manage things, before initialising it you will want to connect to the providerAdded(const Attica::Provider &provider) signal, which is fired every time a new provider is added to the manager.
If you manually add all providers from XML, you can expect this to happen immediately. This means that once you have added your providers that way, you can access them through the providers() function, which returns a list of all loaded Providers.
Once you have loaded a Provider, you can use its functions to access the services offered by that provider.
Definition at line 59 of file providermanager.h.
Member Typedef Documentation
◆ ProviderFlags
typedef QFlags< ProviderFlag > Attica::ProviderManager::ProviderFlags |
Definition at line 68 of file providermanager.h.
Member Enumeration Documentation
◆ ProviderFlag
enum Attica::ProviderManager::ProviderFlag |
Definition at line 64 of file providermanager.h.
Constructor & Destructor Documentation
◆ ProviderManager()
ProviderManager::ProviderManager | ( | const ProviderFlags & | flags = NoFlags | ) |
Definition at line 64 of file providermanager.cpp.
◆ ~ProviderManager()
|
override |
Definition at line 103 of file providermanager.cpp.
Member Function Documentation
◆ addProviderFile()
Definition at line 119 of file providermanager.cpp.
◆ addProviderFileToDefaultProviders()
Add a provider file to the default providers (xml that contains provider descriptions).
Provider files contain information about each provider:
<providers> <provider> <id>opendesktop</id> <location>https://api.opendesktop.org/v1/</location> <name>openDesktop.org</name> <icon></icon> <termsofuse>https://opendesktop.org/terms/</termsofuse> <register>https://opendesktop.org/usermanager/new.php</register> <services> <person ocsversion="1.3" > <friend ocsversion="1.3" > <message ocsversion="1.3" > <activity ocsversion="1.3" > <content ocsversion="1.3" > <fan ocsversion="1.3" > <knowledgebase ocsversion="1.3" > <event ocsversion="1.3" > </services> </provider> </providers>
- Parameters
-
url the url of the provider file
Definition at line 108 of file providermanager.cpp.
◆ addProviderFromXml()
Parse a xml file containing a provider description.
Definition at line 157 of file providermanager.cpp.
◆ clear()
void ProviderManager::clear | ( | ) |
Remove all providers and provider files that have been loaded.
Definition at line 81 of file providermanager.cpp.
◆ contains()
- Returns
- whether there's a provider with base url
provider
◆ defaultProviderFiles()
The list of provider files that get loaded by loadDefaultProviders.
Each of these files can contain multiple providers.
- Returns
- list of provider file urls
Definition at line 98 of file providermanager.cpp.
◆ loadDefaultProviders()
void ProviderManager::loadDefaultProviders | ( | ) |
Load available providers from configuration.
Definition at line 71 of file providermanager.cpp.
◆ providerByUrl()
- Returns
- the provider with
url
base url.
Definition at line 259 of file providermanager.cpp.
◆ providerFiles()
Definition at line 269 of file providermanager.cpp.
◆ providerFor()
- Returns
- the provider for a given provider
url
.
Definition at line 254 of file providermanager.cpp.
◆ providers()
- Returns
- all loaded providers
Definition at line 264 of file providermanager.cpp.
◆ removeProviderFileFromDefaultProviders()
Definition at line 114 of file providermanager.cpp.
◆ setAuthenticationSuppressed()
void ProviderManager::setAuthenticationSuppressed | ( | bool | suppressed | ) |
Suppresses the authentication, so that the application can take care of authenticating itself.
Definition at line 76 of file providermanager.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sun Feb 25 2024 18:46:19 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.