Attica::ProviderManager

Search for usage in LXR

Attica::ProviderManager Class Reference

#include <Attica/ProviderManager>

Inheritance diagram for Attica::ProviderManager:

Public Types

enum  ProviderFlag { NoFlags = 0x0 , DisablePlugins = 0x1 }
 
typedef QFlags< ProviderFlag > ProviderFlags
 
- Public Types inherited from QObject
typedef  QObjectList
 

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 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)
 
QBindable< QStringbindableObjectName ()
 
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 () const const
 
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 QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isQuickItemType () const const
 
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_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_GADGET_EXPORT (EXPORT_MACRO)
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_MOC_INCLUDE Q_MOC_INCLUDE
 
 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
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setObjectName (QAnyStringView name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool setProperty (const char *name, QVariant &&value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds interval, 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 *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)
 
- 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 59 of file providermanager.h.

Member Typedef Documentation

◆ 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 65 of file providermanager.cpp.

◆ ~ProviderManager()

ProviderManager::~ProviderManager ( )
override

Definition at line 114 of file providermanager.cpp.

Member Function Documentation

◆ addProviderFile()

void ProviderManager::addProviderFile ( const QUrl & file)

Definition at line 130 of file providermanager.cpp.

◆ addProviderFileToDefaultProviders()

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 119 of file providermanager.cpp.

◆ addProviderFromXml()

void ProviderManager::addProviderFromXml ( const QString & providerXml)

Parse a xml file containing a provider description.

Definition at line 168 of file providermanager.cpp.

◆ clear()

void ProviderManager::clear ( )

Remove all providers and provider files that have been loaded.

Definition at line 92 of file providermanager.cpp.

◆ contains()

bool Attica::ProviderManager::contains ( const QUrl & provider) const
Returns
whether there's a provider with base url provider

◆ defaultProviderFiles()

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 109 of file providermanager.cpp.

◆ loadDefaultProviders()

void ProviderManager::loadDefaultProviders ( )

Load available providers from configuration.

Definition at line 72 of file providermanager.cpp.

◆ providerByUrl()

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

Definition at line 270 of file providermanager.cpp.

◆ providerFiles()

QList< QUrl > ProviderManager::providerFiles ( ) const

Definition at line 280 of file providermanager.cpp.

◆ providerFor()

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

Definition at line 265 of file providermanager.cpp.

◆ providers()

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

Definition at line 275 of file providermanager.cpp.

◆ removeProviderFileFromDefaultProviders()

void ProviderManager::removeProviderFileFromDefaultProviders ( const QUrl & url)

Definition at line 125 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 87 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-2024 The KDE developers.
Generated on Fri Oct 4 2024 12:05:20 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.