aboutsummaryrefslogtreecommitdiff
path: root/libcontextsubscriber/doc/html/class_context_subscriber_1_1_i_provider_plugin.html
blob: 86b1e17b2af7952a4543668e773ee6008ee73eb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
<!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: ContextSubscriber::IProviderPlugin Class Reference</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><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 class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="classes.html"><span>Class&nbsp;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="namespace_context_subscriber.html">ContextSubscriber</a>::<a class="el" href="class_context_subscriber_1_1_i_provider_plugin.html">IProviderPlugin</a>
  </div>
</div>
<div class="contents">
<h1>ContextSubscriber::IProviderPlugin Class Reference</h1><!-- doxytag: class="ContextSubscriber::IProviderPlugin" -->Interface for provider plugins.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="iproviderplugin_8h-source.html">iproviderplugin.h</a>&gt;</code>
<p>

<p>
<a href="class_context_subscriber_1_1_i_provider_plugin-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Signals</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_context_subscriber_1_1_i_provider_plugin.html#236ba3dcfb3fd566fffb89e05855dbf8">ready</a> ()</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_context_subscriber_1_1_i_provider_plugin.html#2b38e3432ffbe7006ffcbe696e4331dd">failed</a> (QString error)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_context_subscriber_1_1_i_provider_plugin.html#68cf30909195fcadb259056ad8a8d9ba">subscribeFinished</a> (QString key)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_context_subscriber_1_1_i_provider_plugin.html#e62e69b51185cb0437230916cc306548">subscribeFailed</a> (QString failedKey, QString error)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_context_subscriber_1_1_i_provider_plugin.html#3a106b2d49454337f9269b2ffb07647e">valueChanged</a> (QString key, QVariant value)</td></tr>

<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_context_subscriber_1_1_i_provider_plugin.html#96f3f5ea81859ddfef63c0e064cba365">subscribe</a> (QSet&lt; QString &gt; keys)=0</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_context_subscriber_1_1_i_provider_plugin.html#9a5410b5898e5d1efde167752696f2f5">unsubscribe</a> (QSet&lt; QString &gt; keys)=0</td></tr>

</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Interface for provider plugins. 
<p>
Note: this interface is private, currently it is not advised to use it and create ContextKit subscriber plugins on your own, we can and will change this interface anytime in the future even between small bugfix releases.<p>
Every <a class="el" href="class_context_subscriber_1_1_provider.html" title="Connects to a group of properties via the help of a plugin.">Provider</a> instance contains exactly one plugin (pointer) with this interface which is constructed on initialization time and never change after that. This way the concrete protocol (dbus, shared memory, etc.) between the library and the provider is abstracted.<p>
The <a class="el" href="class_context_subscriber_1_1_provider.html" title="Connects to a group of properties via the help of a plugin.">Provider</a> instance communicates need for subscribe and unsubscribe calls (on the wire) using the <code>subscribe</code> and <code>unsubscribe</code> methods.<p>
When the plugin is constructed, it should emit the signal <a class="el" href="class_context_subscriber_1_1_i_provider_plugin.html#236ba3dcfb3fd566fffb89e05855dbf8">ready()</a> when it is ready to take in subscriptions. However, the signal <a class="el" href="class_context_subscriber_1_1_i_provider_plugin.html#236ba3dcfb3fd566fffb89e05855dbf8">ready()</a> should not be emitted in the plugin constructor. If the plugin is able to take in subscriptions immediately, you can use QMetaObject::invokeMethod with QueuedConnection to emit the signal when the main loop is entered the next time.<p>
The plugin can fail or became ready again anytime because of things happening on the wire inside the plugin (socket closed, dbus service appears/disappears). Whenever the plugin has new information about this it should emit the signal <code>ready</code> or <code>failed</code> accordingly.<p>
When the plugin is ready, it has to be able to handle <code>subscribe</code> and <code>unsubscribe</code> function calls. Also, after emitting <code>ready</code> it should be in a state where it is not subscribed to anything on the wire, since immediately after <code>ready</code> is emitted, the provider will place a subscribe call with all of the properties that should be subscribed.<p>
Subscription failures or successes can be signaled with emitting <code>subscribeFailed</code> and <code>subscribeFinished</code>.<p>
At last, but not least, the plugin can emit <code>valueChanged</code>, when it has a new value for any property. It is not required to only signal new values, the library takes care of keeping the old value and only emit change signals to the upper layers if the new value is really new.<p>
An implementation of this interface doesn't have to care about threads at all, all of the methods, starting from the constructor will be only called from inside the Qt event loop of the main thread. This means that neither the constructor nor the <code>subscribe</code>, <code>unsubscribe</code> calls should block. They have to finish as soon as possible and signal the results later via signals. <hr><h2>Member Function Documentation</h2>
<a class="anchor" name="2b38e3432ffbe7006ffcbe696e4331dd"></a><!-- doxytag: member="ContextSubscriber::IProviderPlugin::failed" ref="2b38e3432ffbe7006ffcbe696e4331dd" args="(QString error)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ContextSubscriber::IProviderPlugin::failed           </td>
          <td>(</td>
          <td class="paramtype">QString&nbsp;</td>
          <td class="paramname"> <em>error</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [signal]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

<p>Reimplemented in <a class="el" href="class_context_subscriber_1_1_context_kit_plugin.html#659b0f0fcb7a740975fadc55c670bbf7">ContextSubscriber::ContextKitPlugin</a>.</p>

</div>
</div><p>
<a class="anchor" name="236ba3dcfb3fd566fffb89e05855dbf8"></a><!-- doxytag: member="ContextSubscriber::IProviderPlugin::ready" ref="236ba3dcfb3fd566fffb89e05855dbf8" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ContextSubscriber::IProviderPlugin::ready           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [signal]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

<p>Reimplemented in <a class="el" href="class_context_subscriber_1_1_context_kit_plugin.html#cb1ad4d2dafa9c137acff2a84916686f">ContextSubscriber::ContextKitPlugin</a>.</p>

</div>
</div><p>
<a class="anchor" name="96f3f5ea81859ddfef63c0e064cba365"></a><!-- doxytag: member="ContextSubscriber::IProviderPlugin::subscribe" ref="96f3f5ea81859ddfef63c0e064cba365" args="(QSet&lt; QString &gt; keys)=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void ContextSubscriber::IProviderPlugin::subscribe           </td>
          <td>(</td>
          <td class="paramtype">QSet&lt; QString &gt;&nbsp;</td>
          <td class="paramname"> <em>keys</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

<p>Implemented in <a class="el" href="class_context_subscriber_1_1_context_kit_plugin.html#a45ae69058525f998ed5eb0c275cac75">ContextSubscriber::ContextKitPlugin</a>.</p>

</div>
</div><p>
<a class="anchor" name="e62e69b51185cb0437230916cc306548"></a><!-- doxytag: member="ContextSubscriber::IProviderPlugin::subscribeFailed" ref="e62e69b51185cb0437230916cc306548" args="(QString failedKey, QString error)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ContextSubscriber::IProviderPlugin::subscribeFailed           </td>
          <td>(</td>
          <td class="paramtype">QString&nbsp;</td>
          <td class="paramname"> <em>failedKey</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">QString&nbsp;</td>
          <td class="paramname"> <em>error</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [signal]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

<p>Reimplemented in <a class="el" href="class_context_subscriber_1_1_context_kit_plugin.html#803a4bf54f2017025bc314fc14702513">ContextSubscriber::ContextKitPlugin</a>.</p>

</div>
</div><p>
<a class="anchor" name="68cf30909195fcadb259056ad8a8d9ba"></a><!-- doxytag: member="ContextSubscriber::IProviderPlugin::subscribeFinished" ref="68cf30909195fcadb259056ad8a8d9ba" args="(QString key)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ContextSubscriber::IProviderPlugin::subscribeFinished           </td>
          <td>(</td>
          <td class="paramtype">QString&nbsp;</td>
          <td class="paramname"> <em>key</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [signal]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

<p>Reimplemented in <a class="el" href="class_context_subscriber_1_1_context_kit_plugin.html#4a3fcd522bbb2cc67c5821bcf15ed3d4">ContextSubscriber::ContextKitPlugin</a>.</p>

</div>
</div><p>
<a class="anchor" name="9a5410b5898e5d1efde167752696f2f5"></a><!-- doxytag: member="ContextSubscriber::IProviderPlugin::unsubscribe" ref="9a5410b5898e5d1efde167752696f2f5" args="(QSet&lt; QString &gt; keys)=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void ContextSubscriber::IProviderPlugin::unsubscribe           </td>
          <td>(</td>
          <td class="paramtype">QSet&lt; QString &gt;&nbsp;</td>
          <td class="paramname"> <em>keys</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

<p>Implemented in <a class="el" href="class_context_subscriber_1_1_context_kit_plugin.html#4936904e1483e3f06c86e10d65a39e50">ContextSubscriber::ContextKitPlugin</a>.</p>

</div>
</div><p>
<a class="anchor" name="3a106b2d49454337f9269b2ffb07647e"></a><!-- doxytag: member="ContextSubscriber::IProviderPlugin::valueChanged" ref="3a106b2d49454337f9269b2ffb07647e" args="(QString key, QVariant value)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ContextSubscriber::IProviderPlugin::valueChanged           </td>
          <td>(</td>
          <td class="paramtype">QString&nbsp;</td>
          <td class="paramname"> <em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">QVariant&nbsp;</td>
          <td class="paramname"> <em>value</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [signal]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

<p>Reimplemented in <a class="el" href="class_context_subscriber_1_1_context_kit_plugin.html#5603631c4a9e7f6a4cbe05af6dfe5c48">ContextSubscriber::ContextKitPlugin</a>.</p>

</div>
</div><p>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="iproviderplugin_8h-source.html">iproviderplugin.h</a><li><a class="el" href="mocs_8cpp.html">mocs.cpp</a></ul>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Wed Sep 30 10:24:18 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>