#include <infobackend.h>
Signals | |
void | keysChanged (const QStringList ¤tKeys) |
Emitted when key list changes. ContextRegistryInfo listens on that. | |
void | keysAdded (const QStringList &newKeys) |
Emitted when new keys are added. ContextRegistryInfo listens on that. | |
void | keysRemoved (const QStringList &removedKeys) |
Emitted when keys are removed. ContextRegistryInfo listens on that. | |
void | keyChanged (const QString &key) |
Emitted when key data/info changes. ContextPropertyInfo instances listen on that. | |
void | listChanged () |
Emitted when the key list changes. ContextRegistryInfo listens on that. | |
Public Member Functions | |
virtual QString | name () const =0 |
Returns the name of the backend, ie: 'xml'. | |
virtual QStringList | listKeys () const =0 |
Returns the list of all the keys in the registry. | |
virtual ContextTypeInfo | typeInfoForKey (QString key) const =0 |
Returns the type information for the given key. | |
virtual QString | docForKey (QString key) const =0 |
Returns the documentation for the given key name. | |
virtual bool | keyDeclared (QString key) const =0 |
Returns true if the given key exists. | |
virtual bool | keyDeprecated (QString key) const =0 |
Returns true if the given key is deprecated. | |
virtual const QList < ContextProviderInfo > | providersForKey (QString key) const =0 |
Returns a list of providers for the given key. | |
Static Public Member Functions | |
static InfoBackend * | instance (const QString &backendName="") |
Returns the actual singleton instance, creates it on first access. | |
static void | destroyInstance () |
Called before the application is destroyed. | |
Protected Member Functions | |
virtual void | connectNotify (const char *signal) |
Called each time we have a signal connection. Increases the connect count. | |
virtual void | disconnectNotify (const char *signal) |
Called each time we have a signal disconnection. Decreases the connect count. | |
Private Member Functions | |
InfoBackend (QObject *parent=0) | |
Constructs the object. The connectCount is 0 on start. | |
InfoBackend (const InfoBackend &) | |
Private constructor. Do not use. | |
void | checkAndEmitKeysAdded (const QStringList ¤tKeys, const QStringList &oldKeys) |
Given the currentKeys list of keys and the oldKeys list of keys, emit a signal containing the new keys (keys that are in currentKeys but are no in oldKeys). | |
void | checkAndEmitKeysRemoved (const QStringList ¤tKeys, const QStringList &oldKeys) |
Given the currentKeys list of keys and the oldKeys list of keys, emit a signal containing the removed keys (keys that are in oldKeys but are no in currentKeys). | |
void | checkAndEmitKeyChanged (const QStringList ¤tKeys, const QStringList &oldKeys) |
Given the currentKeys list of keys and the oldKeys list of keys, emit a keyChanged signal containing the union of those two lists. | |
InfoBackend & | operator= (const InfoBackend &) |
Private operator. Do not use. | |
Private Attributes | |
int | connectCount |
Number of connections to signals. Used to optimized signal emission when 0. | |
Static Private Attributes | |
static InfoBackend * | backendInstance = NULL |
Holds a pointer to the instance of the singleton. | |
Friends | |
class | InfoXmlBackend |
class | InfoCdbBackend |
class | InfoTestBackend |
class | InfoXmlBackendUnitTest |
class | InfoCdbBackendUnitTest |
class | InfoBackendUnitTest |
This class is not exported in the public API. It provides a list methods that need to be implemented by a concrete registry backend implementation. The InfoBackend instance is a singleton that is created on first access. This class (the instance of it) is used by ContextRegistryInfo and ContextPropertyInfo classes.
InfoBackend::InfoBackend | ( | QObject * | parent = 0 |
) | [private] |
Constructs the object. The connectCount is 0 on start.
InfoBackend::InfoBackend | ( | const InfoBackend & | ) | [private] |
Private constructor. Do not use.
InfoBackend * InfoBackend::instance | ( | const QString & | backendName = "" |
) | [static] |
Returns the actual singleton instance, creates it on first access.
Mutex-protected. ContextRegistryInfo and ContextPropertyInfo use this method to access the backend. The optional backendName specifies the backend to force, ie: 'xml' or 'cdb'.
void InfoBackend::destroyInstance | ( | ) | [static] |
Called before the application is destroyed.
Deletes the backend instance. This is to ensure that the QFileSystemWatcher in backends gets deleted before the application terminates (otherwise weird issues follow).
virtual QString InfoBackend::name | ( | ) | const [pure virtual] |
virtual QStringList InfoBackend::listKeys | ( | ) | const [pure virtual] |
Returns the list of all the keys in the registry.
Implemented in InfoCdbBackend, and InfoXmlBackend.
virtual ContextTypeInfo InfoBackend::typeInfoForKey | ( | QString | key | ) | const [pure virtual] |
virtual QString InfoBackend::docForKey | ( | QString | key | ) | const [pure virtual] |
Returns the documentation for the given key name.
Implemented in InfoCdbBackend, and InfoXmlBackend.
virtual bool InfoBackend::keyDeclared | ( | QString | key | ) | const [pure virtual] |
virtual bool InfoBackend::keyDeprecated | ( | QString | key | ) | const [pure virtual] |
virtual const QList<ContextProviderInfo> InfoBackend::providersForKey | ( | QString | key | ) | const [pure virtual] |
void InfoBackend::keysChanged | ( | const QStringList & | currentKeys | ) | [signal] |
Emitted when key list changes. ContextRegistryInfo listens on that.
void InfoBackend::keysAdded | ( | const QStringList & | newKeys | ) | [signal] |
Emitted when new keys are added. ContextRegistryInfo listens on that.
void InfoBackend::keysRemoved | ( | const QStringList & | removedKeys | ) | [signal] |
Emitted when keys are removed. ContextRegistryInfo listens on that.
void InfoBackend::keyChanged | ( | const QString & | key | ) | [signal] |
Emitted when key data/info changes. ContextPropertyInfo instances listen on that.
void InfoBackend::listChanged | ( | ) | [signal] |
Emitted when the key list changes. ContextRegistryInfo listens on that.
void InfoBackend::connectNotify | ( | const char * | signal | ) | [protected, virtual] |
Called each time we have a signal connection. Increases the connect count.
void InfoBackend::disconnectNotify | ( | const char * | signal | ) | [protected, virtual] |
Called each time we have a signal disconnection. Decreases the connect count.
void InfoBackend::checkAndEmitKeysAdded | ( | const QStringList & | currentKeys, | |
const QStringList & | oldKeys | |||
) | [private] |
Given the currentKeys list of keys and the oldKeys list of keys, emit a signal containing the new keys (keys that are in currentKeys but are no in oldKeys).
To be removed in future.
void InfoBackend::checkAndEmitKeysRemoved | ( | const QStringList & | currentKeys, | |
const QStringList & | oldKeys | |||
) | [private] |
Given the currentKeys list of keys and the oldKeys list of keys, emit a signal containing the removed keys (keys that are in oldKeys but are no in currentKeys).
To be removed in future.
void InfoBackend::checkAndEmitKeyChanged | ( | const QStringList & | currentKeys, | |
const QStringList & | oldKeys | |||
) | [private] |
Given the currentKeys list of keys and the oldKeys list of keys, emit a keyChanged signal containing the union of those two lists.
InfoBackend& InfoBackend::operator= | ( | const InfoBackend & | ) | [private] |
Private operator. Do not use.
friend class InfoXmlBackend [friend] |
friend class InfoCdbBackend [friend] |
friend class InfoTestBackend [friend] |
friend class InfoXmlBackendUnitTest [friend] |
friend class InfoCdbBackendUnitTest [friend] |
friend class InfoBackendUnitTest [friend] |
int InfoBackend::connectCount [private] |
Number of connections to signals. Used to optimized signal emission when 0.
InfoBackend * InfoBackend::backendInstance = NULL [static, private] |
Holds a pointer to the instance of the singleton.