aboutsummaryrefslogtreecommitdiff
path: root/libcontextprovider/doc/html/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'libcontextprovider/doc/html/index.html')
-rw-r--r--libcontextprovider/doc/html/index.html66
1 files changed, 66 insertions, 0 deletions
diff --git a/libcontextprovider/doc/html/index.html b/libcontextprovider/doc/html/index.html
new file mode 100644
index 00000000..6577e7a5
--- /dev/null
+++ b/libcontextprovider/doc/html/index.html
@@ -0,0 +1,66 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>libcontextprovider: Providing values for 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.6.1 -->
+<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>Providing values for Context properties</h1><p>This library implements the provider side of the ContextKit's D-Bus protocol. It has both a C++ and a C interface, so you can choose which you prefer. For the documentation of the C API, see <a class="el" href="capi.html">CApi</a>.</p>
+<p>The C++ interface consists mainly of the three classes: <a class="el" href="class_context_provider_1_1_service.html" title="A Service object is a proxy representing a service on D-Bus that implements the ContextKit...">Service</a>, <a class="el" href="class_context_provider_1_1_property.html" title="A Property object represents a context property, i.e., a key-value pair.">Property</a>, and <a class="el" href="class_context_provider_1_1_group.html" title="Groups the firstSubscriberAppeared and lastSubscriberDisappeared from multiple Property...">Group</a> in the namespace <a class="el" href="namespace_context_provider.html">ContextProvider</a>. They are declared in the <a class="el" href="namespace_context_provider.html">ContextProvider</a> header file.</p>
+<p>Thus, you would typically gain access to the classes like this</p>
+<div class="fragment"><pre class="fragment"><span class="preprocessor"> #include &lt;<a class="code" href="_context_provider.html">ContextProvider</a>&gt;</span>
+
+ <span class="keyword">using namespace </span>ContextProvider;
+
+ Service myService (...);
+</pre></div><p>If you prefer not to have generic names like "Service" in your code, you can of course skip the "using" declaration and refer to the classes as "ContextProvider::Service", etc. If that is too long, consider a namespace alias like this:</p>
+<div class="fragment"><pre class="fragment"><span class="preprocessor"> #include &lt;<a class="code" href="_context_provider.html">ContextProvider</a>&gt;</span>
+
+ <span class="keyword">namespace </span>CP = ContextProvider;
+
+ CP::Service myService (...);
+</pre></div><p>The basic pattern to use this library is to create a <a class="el" href="class_context_provider_1_1_service.html" title="A Service object is a proxy representing a service on D-Bus that implements the ContextKit...">Service</a> instance to represent you on D-Bus and then to add <a class="el" href="class_context_provider_1_1_property.html" title="A Property object represents a context property, i.e., a key-value pair.">Property</a> instances to it for the keys that you want to provide. Once this is done, you can call <a class="el" href="class_context_provider_1_1_property.html#a44c5ff15b11d53d2a44bc77cacb41314" title="Sets the property value to QVariant v.">Property::setValue()</a> and <a class="el" href="class_context_provider_1_1_property.html#aa65dc7374559b7a7d86034b8c9ef9807" title="Unsets the value.">Property::unsetValue()</a> at any time to change the value of the property.</p>
+<p>Communication with clients happens asynchronously and this library needs a running event loop for that.</p>
+<p>Thus, a simple provider might look like this:</p>
+<div class="fragment"><pre class="fragment"><span class="preprocessor"> #include &lt;<a class="code" href="_context_provider.html">ContextProvider</a>&gt;</span>
+
+ <span class="keyword">using namespace </span>ContextProvider;
+
+ <span class="keywordtype">void</span> main(<span class="keywordtype">int</span> <a class="code" href="contextc_8cpp.html#ad1447518f4372828b8435ae82e48499e">argc</a>, <span class="keywordtype">char</span> **<a class="code" href="contextc_8cpp.html#a34d7542664850bdf79197020d3e9532f">argv</a>)
+ {
+ QApplication <a class="code" href="contextc_8cpp.html#ab751c4ea835b01f1db167e4fbc8f042d">app</a>(argc, argv);
+
+ Service myService(QDBusConnection::SessionBus, <span class="stringliteral">&quot;com.example.simple&quot;</span>);
+ Property myProperty(myService, <span class="stringliteral">&quot;Example.Simple&quot;</span>);
+
+ <span class="comment">// set initial value of property</span>
+ myProperty.set(100);
+
+ <a class="code" href="contextc_8cpp.html#ab751c4ea835b01f1db167e4fbc8f042d">app</a>.exec();
+ }
+</pre></div><p>If you need to know when someone actually subscribes to one of your properties, you can connect to the firstSubscriberAppeared and lastSubscriberDisappeared signals of the <a class="el" href="class_context_provider_1_1_property.html" title="A Property object represents a context property, i.e., a key-value pair.">Property</a> instances. You can also use a <a class="el" href="class_context_provider_1_1_group.html" title="Groups the firstSubscriberAppeared and lastSubscriberDisappeared from multiple Property...">Group</a> if you are only interested in whether at least one of a set of <a class="el" href="class_context_provider_1_1_property.html" title="A Property object represents a context property, i.e., a key-value pair.">Property</a> objects is subscribed to.</p>
+<h2><a class="anchor" id="PropNames">
+Valid property names</a></h2>
+<p>Context FW maintains a list of core properties. If you are providing a core property, you need to name it as it is described in the core property list (e.g., Screen.TopEdge).</p>
+<p>If you want to provide a non-core property, its name must be a valid name for a D-Bus object path (e.g., /com/mycompany/screen/topedge). A valid D-Bus object path starts with / and contains zero or more elements separated by / . Each element must only contain the following characters: [A-Z][a-z][0-9]_ </p>
+</div>
+<hr size="1"/><address style="text-align: right;"><small>Generated on Fri Nov 27 10:22:57 2009 for libcontextprovider by&nbsp;
+<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
+</body>
+</html>