libcontextsubscriber is a replacement library for DuiValueSpace which is deprecated.

DuiValueSpace, the old subscription library providing the keys, is deprecated. This library is a replacement for it, providing better API and better implementation while maintaining the same core ideas and structure.

A quick look

The following code for creating a handle for a context property:

    DuiValueSpaceItem topEdge("Context.Screen.TopEdge");
    QObject::connect(&topEdge, SIGNAL(valueChanged()),
                     this, SLOT(topEdgeChanged()));

becomes:

    ContextProperty topEdge("Screen.TopEdge");
    QObject::connect(&topEdge, SIGNAL(valueChanged()),
                     this, SLOT(topEdgeChanged()));

The following code for listing the available context keys:

    DuiValueSpaceItem::listKeys();

becomes:

    ContextRegistryInfo::instance()->listKeys();

The Context. prefix

In DuiValueSpace and accompanying packages, the properties used to have a "Context." prefix. For example:

    Context.Screen.TopEdge
    Context.Screen.IsCovered

This 'Context.' has been dropped now from libcontextsubscriber and all the provider packages. Providers now explicitly provide properties with keys like:

    Screen.TopEdge
    Screen.IsCovered

For compatibility reasons the 'Context.' prefix is still supported in newer releases of DuiValueSpace. The DuiValueSpace library transparently adds the 'Context.' prefix to all access functions.

A call to:

    DuiValueSpaceItem topEdge("Context.Screen.TopEdge");

...is internally in DuiValueSpace converted to actual Screen.TopEdge wire access. This mechanism has been introduced to make the DuiValueSpace and libcontextsubscriber libraries parallel-installable.

It's expected that all DuiValueSpace clients migrate to libcontextsubscriber eventually and DuiValueSpace library will be removed.

Warning:
When migrating to libcontextsubscriber make sure to remove the 'Context.' from you key access paths.

Generated on Sun Apr 21 16:11:51 2013 for libcontextsubscriber by  doxygen 1.5.6