aboutsummaryrefslogtreecommitdiff
path: root/libcontextsubscriber/doc/html/propertyhandle_8h-source.html
blob: f4154a318c6a7cf3fc2dde092d502e46703654e9 (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
<!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: propertyhandle.h Source File</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><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
<h1>propertyhandle.h</h1><a href="propertyhandle_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2008, 2009 Nokia Corporation.</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Contact: Marius Vollmer &lt;marius.vollmer@nokia.com&gt;</span>
<a name="l00005"></a>00005 <span class="comment"> *</span>
<a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or</span>
<a name="l00007"></a>00007 <span class="comment"> * modify it under the terms of the GNU Lesser General Public License</span>
<a name="l00008"></a>00008 <span class="comment"> * version 2.1 as published by the Free Software Foundation.</span>
<a name="l00009"></a>00009 <span class="comment"> *</span>
<a name="l00010"></a>00010 <span class="comment"> * This program is distributed in the hope that it will be useful, but</span>
<a name="l00011"></a>00011 <span class="comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00012"></a>00012 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span>
<a name="l00013"></a>00013 <span class="comment"> * Lesser General Public License for more details.</span>
<a name="l00014"></a>00014 <span class="comment"> *</span>
<a name="l00015"></a>00015 <span class="comment"> * You should have received a copy of the GNU Lesser General Public</span>
<a name="l00016"></a>00016 <span class="comment"> * License along with this program; if not, write to the Free Software</span>
<a name="l00017"></a>00017 <span class="comment"> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA</span>
<a name="l00018"></a>00018 <span class="comment"> * 02110-1301 USA</span>
<a name="l00019"></a>00019 <span class="comment"> *</span>
<a name="l00020"></a>00020 <span class="comment"> */</span>
<a name="l00021"></a>00021 
<a name="l00022"></a>00022 <span class="preprocessor">#ifndef PROPERTYHANDLE_H</span>
<a name="l00023"></a>00023 <span class="preprocessor"></span><span class="preprocessor">#define PROPERTYHANDLE_H</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span>
<a name="l00025"></a>00025 <span class="preprocessor">#include &lt;QObject&gt;</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &lt;QString&gt;</span>
<a name="l00027"></a>00027 <span class="preprocessor">#include &lt;QVariant&gt;</span>
<a name="l00028"></a>00028 <span class="preprocessor">#include &lt;QSet&gt;</span>
<a name="l00029"></a>00029 <span class="preprocessor">#include &lt;QReadWriteLock&gt;</span>
<a name="l00030"></a>00030 <span class="preprocessor">#include &lt;QMutex&gt;</span>
<a name="l00031"></a>00031 
<a name="l00032"></a>00032 <span class="keyword">class </span><a class="code" href="class_context_property_info.html" title="A class to introspect a context property details.">ContextPropertyInfo</a>;
<a name="l00033"></a>00033 
<a name="l00034"></a>00034 <span class="keyword">namespace </span>ContextSubscriber {
<a name="l00035"></a>00035 
<a name="l00036"></a>00036 <span class="keyword">class </span>Provider;
<a name="l00037"></a>00037 <span class="keyword">class </span>DBusNameListener;
<a name="l00038"></a>00038 
<a name="l00039"></a><a class="code" href="class_context_subscriber_1_1_property_handle.html">00039</a> <span class="keyword">class </span><a class="code" href="class_context_subscriber_1_1_property_handle.html" title="A common handle for a context property.">PropertyHandle</a> : <span class="keyword">public</span> QObject
<a name="l00040"></a>00040 {
<a name="l00041"></a>00041     Q_OBJECT
<a name="l00042"></a>00042 
<a name="l00043"></a>00043 <span class="keyword">public</span>:
<a name="l00044"></a>00044     <span class="keywordtype">void</span> <a class="code" href="class_context_subscriber_1_1_property_handle.html#0b12828c764b164dc276a84d46c2ae55" title="Increase the subscribeCount of this context property and subscribe to it through...">subscribe</a>();
<a name="l00045"></a>00045     <span class="keywordtype">void</span> <a class="code" href="class_context_subscriber_1_1_property_handle.html#d1e8961717be9c3a813096092d1837a4" title="Decrease the subscribeCount of this context property and unsubscribe from it through...">unsubscribe</a>();
<a name="l00046"></a>00046 
<a name="l00047"></a>00047     QString <a class="code" href="class_context_subscriber_1_1_property_handle.html#6d4c9e5006a080e7ae645ed15b1edb28">key</a>() <span class="keyword">const</span>;
<a name="l00048"></a>00048     QVariant <a class="code" href="class_context_subscriber_1_1_property_handle.html#bfeb2b16704e22adc33c31e162ef4e36">value</a>() <span class="keyword">const</span>;
<a name="l00049"></a>00049     <span class="keywordtype">bool</span> <a class="code" href="class_context_subscriber_1_1_property_handle.html#22f3af77b3cd883beeab47c5f4365169">isSubscribePending</a>() <span class="keyword">const</span>;
<a name="l00050"></a>00050     <span class="keyword">const</span> <a class="code" href="class_context_property_info.html" title="A class to introspect a context property details.">ContextPropertyInfo</a>* <a class="code" href="class_context_subscriber_1_1_property_handle.html#2626ff2603e1afcd8172008d5932006a">info</a>() <span class="keyword">const</span>;
<a name="l00051"></a>00051 
<a name="l00052"></a>00052     <span class="keyword">static</span> <a class="code" href="class_context_subscriber_1_1_property_handle.html" title="A common handle for a context property.">PropertyHandle</a>* <a class="code" href="class_context_subscriber_1_1_property_handle.html#7f70f0de00c9781d43c99ca5d7f87eb1">instance</a>(<span class="keyword">const</span> QString&amp; key);
<a name="l00053"></a>00053 
<a name="l00054"></a>00054     <span class="keywordtype">void</span> <a class="code" href="class_context_subscriber_1_1_property_handle.html#1d0a471cd063b862fcf09aafd4b125af" title="Used by the HandleSignalRouter to change the value of the property.">onValueChanged</a>();
<a name="l00055"></a>00055     <span class="keywordtype">void</span> <a class="code" href="class_context_subscriber_1_1_property_handle.html#1d4157822007d94fbdfa3af80a8fc758" title="Sets subscribePending to false.">setSubscribeFinished</a>();
<a name="l00056"></a>00056     <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_context_subscriber_1_1_property_handle.html#6001316d6491ca69ca5be43af4a36211">ignoreCommander</a>();
<a name="l00057"></a>00057     <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_context_subscriber_1_1_property_handle.html#3031c1cf5c5d3ccdcf91a2218c2e460e">setTypeCheck</a>(<span class="keywordtype">bool</span> typeCheck);
<a name="l00058"></a>00058 
<a name="l00059"></a>00059 signals:
<a name="l00060"></a>00060     <span class="keywordtype">void</span> <a class="code" href="class_context_subscriber_1_1_property_handle.html#0ceee4d69e18be36e726af552aaa58ba">valueChanged</a>();
<a name="l00061"></a>00061 
<a name="l00062"></a>00062 <span class="keyword">private</span> slots:
<a name="l00063"></a>00063     <span class="keywordtype">void</span> <a class="code" href="class_context_subscriber_1_1_property_handle.html#067242c57b142940ba02b1e5a74548d5" title="Decides who is the current provider of this property and sets up myProvider accordingly...">updateProvider</a>();
<a name="l00064"></a>00064 
<a name="l00065"></a>00065 <span class="keyword">private</span>:
<a name="l00066"></a>00066     <a class="code" href="class_context_subscriber_1_1_property_handle.html#1d523c4bc3538073f7f617456cd81a79">PropertyHandle</a>(<span class="keyword">const</span> QString&amp; key);
<a name="l00067"></a>00067 
<a name="l00068"></a><a class="code" href="class_context_subscriber_1_1_property_handle.html#da859c28e9320fcb89328cb5153a3d35">00068</a>     <a class="code" href="class_context_subscriber_1_1_provider.html" title="Connects to a group of properties via the help of a plugin.">Provider</a> *<a class="code" href="class_context_subscriber_1_1_property_handle.html#da859c28e9320fcb89328cb5153a3d35" title="Provider of this property.">myProvider</a>; 
<a name="l00069"></a><a class="code" href="class_context_subscriber_1_1_property_handle.html#aa914d9958d6a3f6b69d3b1446307cea">00069</a>     <a class="code" href="class_context_property_info.html" title="A class to introspect a context property details.">ContextPropertyInfo</a> *<a class="code" href="class_context_subscriber_1_1_property_handle.html#aa914d9958d6a3f6b69d3b1446307cea" title="Metadata for this property.">myInfo</a>; 
<a name="l00070"></a><a class="code" href="class_context_subscriber_1_1_property_handle.html#809f0eae9aef4ffec99f035b7e0e547f">00070</a>     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_context_subscriber_1_1_property_handle.html#809f0eae9aef4ffec99f035b7e0e547f" title="Number of subscribed ContextProperty objects subscribed to this property.">subscribeCount</a>; 
<a name="l00071"></a><a class="code" href="class_context_subscriber_1_1_property_handle.html#e7fb88f203671edb264655c06bc2e1f0">00071</a>     QMutex <a class="code" href="class_context_subscriber_1_1_property_handle.html#e7fb88f203671edb264655c06bc2e1f0">subscribeCountLock</a>;
<a name="l00072"></a><a class="code" href="class_context_subscriber_1_1_property_handle.html#584bab7e2a167ccf22f45a5cd3f46c16">00072</a>     <span class="keywordtype">bool</span> <a class="code" href="class_context_subscriber_1_1_property_handle.html#584bab7e2a167ccf22f45a5cd3f46c16" title="True when the subscription has been started, but hasn&amp;#39;t been finished yet (used...">subscribePending</a>; 
<a name="l00073"></a>00073 
<a name="l00074"></a><a class="code" href="class_context_subscriber_1_1_property_handle.html#ba3e2fbd0fc8a8ab0db60efe934f7d6d">00074</a>     QString <a class="code" href="class_context_subscriber_1_1_property_handle.html#ba3e2fbd0fc8a8ab0db60efe934f7d6d" title="Key of this property.">myKey</a>; 
<a name="l00075"></a><a class="code" href="class_context_subscriber_1_1_property_handle.html#d3d31e74ac2b7e1727ff0947895f4fc1">00075</a>     <span class="keyword">mutable</span> QReadWriteLock <a class="code" href="class_context_subscriber_1_1_property_handle.html#d3d31e74ac2b7e1727ff0947895f4fc1">valueLock</a>;
<a name="l00076"></a><a class="code" href="class_context_subscriber_1_1_property_handle.html#984638b2c34c7756fd17ff41de90a2df">00076</a>     QVariant <a class="code" href="class_context_subscriber_1_1_property_handle.html#984638b2c34c7756fd17ff41de90a2df" title="Current value of this property.">myValue</a>; 
<a name="l00077"></a><a class="code" href="class_context_subscriber_1_1_property_handle.html#8cb5a37f3a69e7019e9d7559e1e2993c">00077</a>     <span class="keyword">static</span> <a class="code" href="class_context_subscriber_1_1_d_bus_name_listener.html" title="Listens for changes in a specific service name on a D-Bus bus, optionally gets the...">DBusNameListener</a> *<a class="code" href="class_context_subscriber_1_1_property_handle.html#8cb5a37f3a69e7019e9d7559e1e2993c" title="Listener for ContextCommander&amp;#39;s (dis)appearance.">commanderListener</a>; 
<a name="l00078"></a><a class="code" href="class_context_subscriber_1_1_property_handle.html#cb7a882c3ef0423544754bd6fd5de7af">00078</a>     <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="class_context_subscriber_1_1_property_handle.html#cb7a882c3ef0423544754bd6fd5de7af" title="Whether the properties can be directed to ContextCommander.">commandingEnabled</a>; 
<a name="l00079"></a><a class="code" href="class_context_subscriber_1_1_property_handle.html#27312e770b51ebf5439e31361ceb46c4">00079</a>     <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="class_context_subscriber_1_1_property_handle.html#27312e770b51ebf5439e31361ceb46c4" title="Whether we check the type of the value received from the provider.">typeCheckEnabled</a>; 
<a name="l00080"></a>00080 };
<a name="l00081"></a>00081 
<a name="l00082"></a>00082 } <span class="comment">// end namespace</span>
<a name="l00083"></a>00083 
<a name="l00084"></a>00084 <span class="preprocessor">#endif</span>
</pre></div></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>