1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Class to handle subscribtions from PS* |
|
15 */ |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __VCX_CONNUTILSUBSCRI_H |
|
21 #define __VCX_CONNUTILSUBSCRI_H |
|
22 |
|
23 #include <e32base.h> |
|
24 #include <e32property.h> |
|
25 |
|
26 class MConnUtilPubsubObserver; |
|
27 |
|
28 /** |
|
29 * This class defines operations listening modifications for the |
|
30 * property defined. |
|
31 * Notifies changes throught MConnUtilPubsubObserver interface. |
|
32 * |
|
33 */ |
|
34 NONSHARABLE_CLASS ( CVcxConnUtilSubscriber ) : public CActive |
|
35 { |
|
36 |
|
37 public: // constuct / destruct |
|
38 |
|
39 /** |
|
40 * Construction. |
|
41 * |
|
42 * @param aUid category for the property |
|
43 * @param aKey key id for the property |
|
44 * @param aType type of the key (at the moment only int is supported) |
|
45 * @param aObserver pointer to observer to who to notify about changes |
|
46 * |
|
47 * @return The newly constructed CVcxConnUtilPubSub |
|
48 */ |
|
49 static CVcxConnUtilSubscriber* NewL( const TUid aUid, |
|
50 const TUint32 aKey, |
|
51 RProperty::TType aType, |
|
52 MConnUtilPubsubObserver* aObserver ); |
|
53 |
|
54 /** |
|
55 * Destructor. |
|
56 * |
|
57 */ |
|
58 virtual ~CVcxConnUtilSubscriber(); |
|
59 |
|
60 /** |
|
61 * Returns a reference to property this |
|
62 * subscriber listens to. |
|
63 * |
|
64 * @return RProperty |
|
65 */ |
|
66 RProperty& Property(); |
|
67 |
|
68 /** |
|
69 * Start subscribing if not already started |
|
70 */ |
|
71 void Start(); |
|
72 |
|
73 |
|
74 private: // constuct |
|
75 |
|
76 /** |
|
77 * Constructor |
|
78 * |
|
79 */ |
|
80 CVcxConnUtilSubscriber( const TUid aUid, |
|
81 const TUint32 aKey, |
|
82 RProperty::TType aType, |
|
83 MConnUtilPubsubObserver* aObserver ); |
|
84 |
|
85 /** |
|
86 * Symbian 2nd phase construction |
|
87 * |
|
88 */ |
|
89 void ConstructL(); |
|
90 |
|
91 private: // from CActive |
|
92 |
|
93 /** |
|
94 * From CActive. Calles when value subscribed to changes |
|
95 * |
|
96 */ |
|
97 void RunL(); |
|
98 |
|
99 /** |
|
100 * From CActive. Cancels subscribtion |
|
101 * |
|
102 */ |
|
103 void DoCancel(); |
|
104 |
|
105 private: |
|
106 |
|
107 /** |
|
108 * ETrue if object is initialized and subscribtion starts |
|
109 */ |
|
110 TBool iInitialized; |
|
111 |
|
112 /** |
|
113 * Property to subscribe |
|
114 */ |
|
115 RProperty iProperty; |
|
116 |
|
117 /** |
|
118 * Category uid for the property |
|
119 */ |
|
120 const TUid iUid; |
|
121 |
|
122 /** |
|
123 * Key id for the property |
|
124 */ |
|
125 const TUint32 iKey; |
|
126 |
|
127 /** |
|
128 * type of the property |
|
129 */ |
|
130 RProperty::TType iKeyType; |
|
131 |
|
132 /** |
|
133 * Observer |
|
134 */ |
|
135 MConnUtilPubsubObserver* iObserver; |
|
136 }; |
|
137 |
|
138 #endif // __VCX_CONNUTILSUBSCRI_H |
|