#include <contextpropertyinfo.h>
Public Types | |
enum | ResolutionStrategy { LastValue } |
Signals | |
void | providerChanged (const QString &newProvider) |
DEPRECATED, use changed() signal. | |
void | providerDBusTypeChanged (QDBusConnection::BusType newBusType) |
DEPRECATED, use changed() signal. | |
void | typeChanged (const QString &newType) |
DEPRECATED, use changed() signal. | |
void | existsChanged (bool exists) |
DEPRECATED, use changed() signal. | |
void | providedChanged (bool provided) |
DEPRECATED, use changed() signal. | |
void | pluginChanged (QString plugin, QString constructionString) |
DEPRECATED, use changed() signal. | |
void | changed (QString key) |
Emitted when any of the key parameters/data changes. | |
Public Member Functions | |
ContextPropertyInfo (const QString &key, QObject *parent=0) | |
Constructs a new ContextPropertyInfo for key with the given parent. | |
virtual | ~ContextPropertyInfo () |
Destroys the object. | |
QString | key () const |
Returns the full name of the introspected key. | |
QString | doc () const |
Returns the doc (documentation) for the introspected key. | |
QString | type () const |
Returns the old-style type name for the introspected key. To be deprecated soon. | |
ContextTypeInfo | typeInfo () const |
Returns the advanced type info for the introspected key. | |
bool | exists () const |
DEPRECATED Returns true if the key exists in the registry. | |
bool | declared () const |
Returns true if the key is declared in the registry (it "exists"). | |
bool | provided () const |
Returns true if the key is provided by someone. | |
bool | deprecated () const |
Returns true if the key is deprecated. | |
QString | providerDBusName () const |
DEPRECATED Returns the dbus name of the provider supplying this property/key. | |
QDBusConnection::BusType | providerDBusType () const |
DEPRECATED Returns the bus type of the provider supplying this property/key. | |
QString | plugin () const |
DEPRECATED Returns the name of the plugin supplying this property. | |
QString | constructionString () const |
DEPRECATED Returns the construction parameter for the Provider supplying this property This function is deprecated, use providers() instead. | |
virtual const QList < ContextProviderInfo > | providers () const |
Returns a list of providers that provide this key. | |
ResolutionStrategy | resolutionStrategy () const |
Returns resolution strategy for this property. | |
Protected Member Functions | |
virtual void | connectNotify (const char *signal) |
Called when people connect to signals. | |
Private Slots | |
void | onKeyChanged (const QString &key) |
This slot is connected to the keyChanged signal of the actual infobackend instance. | |
Private Member Functions | |
QString | providerDBusName_i () const |
DEPRECATED Returns the dbus name of the provider supplying this property/key. | |
QDBusConnection::BusType | providerDBusType_i () const |
QString | plugin_i () const |
QString | constructionString_i () const |
Private Attributes | |
QString | keyName |
The name of the key his ContextPropertyInfo represents. | |
QString | cachedDoc |
Only for binary compatibility; this member cannot be removed. | |
ContextTypeInfo | cachedTypeInfo |
Only for binary compatibility; this member cannot be removed. | |
bool | cachedDeclared |
Only for binary compatibility; this member cannot be removed. | |
QList< ContextProviderInfo > | cachedProviders |
Cached list of providers for this key. | |
QMutex | cacheLock |
Lock for the cache. | |
Friends | |
class | ContextPropertyInfoUnitTest |
This class is used to obtain information about a given key in the context registry. The information can be provided either from xml files or from a cdb database. It's possible to query the type, the provider and the documentation of the given key/property.
ContextPropertyInfo::ContextPropertyInfo | ( | const QString & | key, | |
QObject * | parent = 0 | |||
) | [explicit] |
Constructs a new ContextPropertyInfo for key with the given parent.
The object can be used to perform introspection on the given key.
key | The full name of the key. |
virtual ContextPropertyInfo::~ContextPropertyInfo | ( | ) | [inline, virtual] |
Destroys the object.
QString ContextPropertyInfo::key | ( | ) | const |
Returns the full name of the introspected key.
QString ContextPropertyInfo::doc | ( | ) | const |
Returns the doc (documentation) for the introspected key.
QString ContextPropertyInfo::type | ( | ) | const |
Returns the old-style type name for the introspected key. To be deprecated soon.
ContextTypeInfo ContextPropertyInfo::typeInfo | ( | ) | const |
Returns the advanced type info for the introspected key.
bool ContextPropertyInfo::exists | ( | ) | const |
DEPRECATED Returns true if the key exists in the registry.
This function is deprecated, use declared() instead.
bool ContextPropertyInfo::declared | ( | ) | const |
Returns true if the key is declared in the registry (it "exists").
bool ContextPropertyInfo::provided | ( | ) | const |
Returns true if the key is provided by someone.
bool ContextPropertyInfo::deprecated | ( | ) | const |
Returns true if the key is deprecated.
QString ContextPropertyInfo::providerDBusName | ( | ) | const |
DEPRECATED Returns the dbus name of the provider supplying this property/key.
This function is maintained for backwards compatibility. Use providers() instead.
QDBusConnection::BusType ContextPropertyInfo::providerDBusType | ( | ) | const |
DEPRECATED Returns the bus type of the provider supplying this property/key.
Ie. if it's a session bus or a system bus. This function is maintained for backwards compatibility. Use providers() instead.
QString ContextPropertyInfo::plugin | ( | ) | const |
DEPRECATED Returns the name of the plugin supplying this property.
This function is deprecated, use providers() instead.
QString ContextPropertyInfo::constructionString | ( | ) | const |
DEPRECATED Returns the construction parameter for the Provider supplying this property This function is deprecated, use providers() instead.
const QList< ContextProviderInfo > ContextPropertyInfo::providers | ( | ) | const [virtual] |
Returns a list of providers that provide this key.
ContextPropertyInfo::ResolutionStrategy ContextPropertyInfo::resolutionStrategy | ( | ) | const |
Returns resolution strategy for this property.
Resolution strategy defines how values are computed in relation to multiple providers being present for one property.
void ContextPropertyInfo::connectNotify | ( | const char * | _signal | ) | [protected, virtual] |
Called when people connect to signals.
Used to emit deprecation warnings when people connect to deprecated signals.
QString ContextPropertyInfo::providerDBusName_i | ( | ) | const [private] |
DEPRECATED Returns the dbus name of the provider supplying this property/key.
This function is maintained for backwards compatibility. Use providers() instead.
QDBusConnection::BusType ContextPropertyInfo::providerDBusType_i | ( | ) | const [private] |
QString ContextPropertyInfo::plugin_i | ( | ) | const [private] |
QString ContextPropertyInfo::constructionString_i | ( | ) | const [private] |
void ContextPropertyInfo::onKeyChanged | ( | const QString & | key | ) | [private, slot] |
This slot is connected to the keyChanged signal of the actual infobackend instance.
It's executed on every change to any of the keys. We first check if the data concerns us. Next we update the cached values and fire the actual signals.
void ContextPropertyInfo::providerChanged | ( | const QString & | newProvider | ) | [signal] |
DEPRECATED, use changed() signal.
Emitted when the provider of the key changes. The newProvider contains the name of the new provider. This is a strict signal - it's emitted only when there was an actual change in the value.
newProvider | The DBus name of the new provider. |
void ContextPropertyInfo::providerDBusTypeChanged | ( | QDBusConnection::BusType | newBusType | ) | [signal] |
DEPRECATED, use changed() signal.
Emitted when the bus type of provider of the key changes. The newBusType is the type of new bus This is a strict signal - it's emitted only when there was an actual change in the value.
newBusType | The DBus bus type of the provider. |
void ContextPropertyInfo::typeChanged | ( | const QString & | newType | ) | [signal] |
DEPRECATED, use changed() signal.
Emitted when the key type changes. The newType is the new type of the introspected key. This is a strict signal - it's emitted only when there was an actual change in the value.
newType | The new type of the key. |
void ContextPropertyInfo::existsChanged | ( | bool | exists | ) | [signal] |
DEPRECATED, use changed() signal.
Emitted when the key existance in the registry changes. The exists is the new state of the introspected key. This is a strict signal - it's emitted only when there was an actual change in the state. Using this signal you can wait (watch) for various keys to become available.
exists | The new state of the key. |
void ContextPropertyInfo::providedChanged | ( | bool | provided | ) | [signal] |
DEPRECATED, use changed() signal.
Emitted when the key gets a provider or loses a provider. The provided is the new state of the introspected key. This is a strict signal - it's emitted only when there was an actual change in the state. Using this signal you can wait (watch) for various keys to become available.
provided | The new state of the key. |
void ContextPropertyInfo::pluginChanged | ( | QString | plugin, | |
QString | constructionString | |||
) | [signal] |
DEPRECATED, use changed() signal.
Emitted when the libcontextsubscriber plugin providing the key changes, or the construction parameter to give to the plugin changes.. The plugin is the name of the new plugin providing the key and the constructionString is the new construction parameter to give to the plugin.
void ContextPropertyInfo::changed | ( | QString | key | ) | [signal] |
Emitted when any of the key parameters/data changes.
This is not a strict signal - it might be emitted even when no actual change happened.
friend class ContextPropertyInfoUnitTest [friend] |
QString ContextPropertyInfo::keyName [private] |
The name of the key his ContextPropertyInfo represents.
QString ContextPropertyInfo::cachedDoc [private] |
Only for binary compatibility; this member cannot be removed.
Only for binary compatibility; this member cannot be removed.
bool ContextPropertyInfo::cachedDeclared [private] |
Only for binary compatibility; this member cannot be removed.
QList<ContextProviderInfo> ContextPropertyInfo::cachedProviders [private] |
Cached list of providers for this key.
QMutex ContextPropertyInfo::cacheLock [mutable, private] |
Lock for the cache.