Attica::ProviderManager

Attica::ProviderManager Class Reference

#include <providermanager.h>

Inheritance diagram for 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)
 

Public Member Functions

 ProviderManager (const ProviderFlags &flags=NoFlags)
 
void addProviderFile (const QUrl &file)
 
void addProviderFileToDefaultProviders (const QUrl &url)
 
void addProviderFromXml (const QString &providerXml)
 
void clear ()
 
bool contains (const QString &provider) const
 
bool contains (const QUrl &provider) const
 
QList< QUrldefaultProviderFiles ()
 
void loadDefaultProviders ()
 
Provider providerByUrl (const QUrl &url) const
 
QList< QUrlproviderFiles () const
 
Provider providerFor (const QUrl &url) const
 
QList< Providerproviders () const
 
void removeProviderFileFromDefaultProviders (const QUrl &url)
 
void setAuthenticationSuppressed (bool suppressed)
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo ()
 
void dumpObjectInfo () const const
 
void dumpObjectTree ()
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_DISABLE_COPY (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
qobject_cast (QObject *object)
 
qobject_cast (const QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
QThreadthread () const const
 

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 *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
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, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &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
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 

Detailed Description

Attica ProviderManager.

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 55 of file providermanager.h.

Member Function Documentation

void ProviderManager::addProviderFileToDefaultProviders ( const QUrl url)

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
urlthe url of the provider file

Definition at line 110 of file providermanager.cpp.

void ProviderManager::addProviderFromXml ( const QString providerXml)

Parse a xml file containing a provider description.

Definition at line 154 of file providermanager.cpp.

void ProviderManager::clear ( )

Remove all providers and provider files that have been loaded.

Definition at line 83 of file providermanager.cpp.

bool ProviderManager::contains ( const QString provider) const
Deprecated:
Since 5.23, use contains(const QUrl&)

Definition at line 253 of file providermanager.cpp.

bool Attica::ProviderManager::contains ( const QUrl provider) const
Returns
whether there's a provider with base url provider
QList< QUrl > ProviderManager::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 100 of file providermanager.cpp.

void ProviderManager::loadDefaultProviders ( )

Load available providers from configuration.

Definition at line 73 of file providermanager.cpp.

Provider ProviderManager::providerByUrl ( const QUrl url) const
Returns
the provider with url base url.

Definition at line 242 of file providermanager.cpp.

Provider ProviderManager::providerFor ( const QUrl url) const
Returns
the provider for a given provider url.

Definition at line 237 of file providermanager.cpp.

QList< Provider > ProviderManager::providers ( ) const
Returns
all loaded providers

Definition at line 247 of file providermanager.cpp.

void ProviderManager::setAuthenticationSuppressed ( bool  suppressed)

Suppresses the authentication, so that the application can take care of authenticating itself.

Definition at line 78 of file providermanager.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jul 13 2020 23:01:13 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.