Signals | Public Member Functions

ContextProvider::Property Class Reference

A Property object represents a context property, i.e., a key-value pair. More...

#include <ContextProvider>

List of all members.

Signals

void firstSubscriberAppeared (const QString &key)
 This is emitted when the first subscriber appears for this Property.
void lastSubscriberDisappeared (const QString &key)
 This is emitted when the last subscriber disappears for this Property.

Public Member Functions

 Property (Service &service, const QString &key, QObject *parent=0)
 Create a Property object on service for the key k.
 Property (const QString &key, QObject *parent=0)
 Create a Property object on the default service for the key k.
virtual ~Property ()
 Destructor.
QString key () const
 Returns the name of the key this Property represents.
bool isSet () const
 Returns true if the key is set (it's value is determined).
void setValue (const QVariant &v)
 Sets the property value to QVariant v.
QVariant value ()
 Returns the current value of the property.
void unsetValue ()
 Unsets the value.

Detailed Description

A Property object represents a context property, i.e., a key-value pair.

Every Property object is associated with a Service object. If you delete the Service object, the associated Property objects will turn invalid and you should not use them.


Constructor & Destructor Documentation

ContextProvider::Property::Property ( Service service,
const QString &  key,
QObject *  parent = 0 
) [explicit]

Create a Property object on service for the key k.

ContextProvider::Property::Property ( const QString &  k,
QObject *  parent = 0 
) [explicit]

Create a Property object on the default service for the key k.

The default service can be set with Service::setAsDefault().

ContextProvider::Property::~Property (  )  [virtual]

Destructor.


Member Function Documentation

void ContextProvider::Property::firstSubscriberAppeared ( const QString &  key  )  [signal]

This is emitted when the first subscriber appears for this Property.

It can be used e.g. to start the actual process of harvesting the data needed for this Property.

bool ContextProvider::Property::isSet (  )  const

Returns true if the key is set (it's value is determined).

QString ContextProvider::Property::key (  )  const

Returns the name of the key this Property represents.

void ContextProvider::Property::lastSubscriberDisappeared ( const QString &  key  )  [signal]

This is emitted when the last subscriber disappears for this Property.

It can be used e.g. to stop the process of harvesting the data needed for this Property (and save resources).

void ContextProvider::Property::setValue ( const QVariant &  v  ) 

Sets the property value to QVariant v.

void ContextProvider::Property::unsetValue (  ) 

Unsets the value.

This is equivalent to setting it to a null QVariant.

QVariant ContextProvider::Property::value (  ) 

Returns the current value of the property.

The returned QVariant is invalid if the key value is undetermined or the Property is invalid.


The documentation for this class was generated from the following files: