aboutsummaryrefslogtreecommitdiff
path: root/libcontextsubscriber/doc/html/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'libcontextsubscriber/doc/html/index.html')
-rw-r--r--libcontextsubscriber/doc/html/index.html54
1 files changed, 54 insertions, 0 deletions
diff --git a/libcontextsubscriber/doc/html/index.html b/libcontextsubscriber/doc/html/index.html
new file mode 100644
index 00000000..b16377f0
--- /dev/null
+++ b/libcontextsubscriber/doc/html/index.html
@@ -0,0 +1,54 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+<title>libcontextsubscriber: Context Properties</title>
+<link href="tabs.css" rel="stylesheet" type="text/css">
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.5.8 -->
+<div class="navigation" id="top">
+ <div class="tabs">
+ <ul>
+ <li class="current"><a href="index.html"><span>Main&nbsp;Page</span></a></li>
+ <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
+ <li><a href="namespaces.html"><span>Namespaces</span></a></li>
+ <li><a href="annotated.html"><span>Classes</span></a></li>
+ <li><a href="files.html"><span>Files</span></a></li>
+ </ul>
+ </div>
+</div>
+<div class="contents">
+<h1>Context Properties</h1>
+<p>
+The Context Framework allows you to access system- and session-wide named values. Examples are context properties like the current geographical location. You can receive notifications about changes to these values, and you can also easily subscribe and unsubscribe from change notifications to help with managing power consumption. <h2><a class="anchor" name="Overview">
+Overview</a></h2>
+The Context Properties are key/value pairs. The keys are strings and the values are QVariants.<p>
+Key are arranged in a hierarchical namespace like in this example of two contextual properties<p>
+<div class="fragment"><pre class="fragment"> Screen.TopEdge = <span class="stringliteral">"left"</span>
+ Screen.IsCovered = <span class="keyword">false</span>
+</pre></div><p>
+Although the key names can be considered to form a tree (with "Screen" at the root) there is no semantic relationship between parent and child nodes in the tree: the key "Screen" is unrelated to "Screen.TopEdge". In particular, change notifications do not travel up the tree.<p>
+The <a class="el" href="introspection.html">Introspection</a> section describes in detail how to get a list of existing keys and examine their capabilities.<p>
+Programmers access the key/value pairs through instances of the <a class="el" href="class_context_property.html" title="The ContextProperty class allows access to keys and their values.">ContextProperty</a> class. These instances allow applications to access the values and receive change notifications.<p>
+Example: <div class="fragment"><pre class="fragment"> <a class="code" href="class_context_property.html" title="The ContextProperty class allows access to keys and their values.">ContextProperty</a> *topEdge = <span class="keyword">new</span> <a class="code" href="class_context_property.html" title="The ContextProperty class allows access to keys and their values.">ContextProperty</a>(<span class="stringliteral">"Screen.TopEdge"</span>);
+ QObject::connect(topEdge, SIGNAL(valueChanged()),
+ <span class="keyword">this</span>, SLOT(topEdgeChanged()));
+</pre></div><p>
+In your edgeUpChanged method you are able to retrieve the value of the property: <div class="fragment"><pre class="fragment"> qWarning() &lt;&lt; <span class="stringliteral">"The edge "</span> &lt;&lt; topEdge-&gt;<a class="code" href="class_context_property.html#9853332036f43724b65162acc432753a" title="Returns the current value, or the value def if the current value is null.">value</a>() &lt;&lt; <span class="stringliteral">" is up"</span>;
+</pre></div><p>
+Creating a <a class="el" href="class_context_property.html" title="The ContextProperty class allows access to keys and their values.">ContextProperty</a> instance for a key causes the program to 'subscribe' to this key. The values for some keys might be expensive to determine, so you should only subscribe to those keys that you are currently interested in. You can temporarily unsubscribe from a key without destroying the <a class="el" href="class_context_property.html" title="The ContextProperty class allows access to keys and their values.">ContextProperty</a> instance by using the unsubscribe() member function. Later, you can resume the subscription by calling the subscribe() member function.<p>
+<div class="fragment"><pre class="fragment"> <span class="keywordtype">void</span> onScreenBlank ()
+ {
+ topEdge-&gt;<a class="code" href="class_context_property.html#fa0ef21efe3c1c5d2b5936cda8feb350" title="Unsubscribes from the context property, if it is currently subscribed.">unsubscribe</a>();
+ }
+
+ <span class="keywordtype">void</span> onScreenUnblank ()
+ {
+ topEdge-&gt;<a class="code" href="class_context_property.html#5e6f52ce5ba6e7d07240ce84c2cc7326" title="Starts subscribtion to the context property, if it isn&amp;#39;t subscribed already.">subscribe</a>();
+ }
+</pre></div><p>
+All the context properties can be used anytime, not depending on whether the provider of the property is installed or running. If the system/provider cannot provide you with a value, the value of the context property will be null. If for some reason you are interested in property metadata (such as a key's current provider, availability, etc.) you should consult the <a class="el" href="introspection.html">Introspection</a> API. </div>
+<hr size="1"><address style="text-align: right;"><small>Generated on Fri Oct 23 08:59:23 2009 for libcontextsubscriber by&nbsp;
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>
+</body>
+</html>