|
1 /* |
|
2 * Copyright (c) 2010 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 "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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef C_CPSPROPERTYOBSERVER_H |
|
19 #define C_CPSPROPERTYOBSERVER_H |
|
20 |
|
21 #include <e32base.h> |
|
22 #include <e32property.h> |
|
23 |
|
24 #include "aipspropertyobserver.h" |
|
25 |
|
26 /** |
|
27 * Publish and subscribe key observer |
|
28 * |
|
29 * @lib aiutils.lib |
|
30 * @since S60 3.2 |
|
31 */ |
|
32 |
|
33 NONSHARABLE_CLASS(CPSPropertyObserver) : public CActive, public MAiPSPropertyObserver |
|
34 { |
|
35 |
|
36 public: |
|
37 |
|
38 /** |
|
39 * Two-phased constructor. |
|
40 */ |
|
41 static CPSPropertyObserver* NewL ( TUid aCategory, TInt aKey ); |
|
42 |
|
43 /** |
|
44 * Destructor. |
|
45 */ |
|
46 ~CPSPropertyObserver(); |
|
47 |
|
48 /** |
|
49 * Release the observer |
|
50 */ |
|
51 void Release(); |
|
52 |
|
53 |
|
54 // from base class CActive |
|
55 protected: |
|
56 |
|
57 void RunL(); |
|
58 void DoCancel(); |
|
59 |
|
60 |
|
61 // New methods for test purposes |
|
62 public: |
|
63 |
|
64 void HandlePhoneEvent(); |
|
65 void HandleSystemEvent(); |
|
66 void SetCallBack( TCallBack aCallBack ); |
|
67 void DoEvent(); |
|
68 void SetOtherObserver( CPSPropertyObserver* aOther ); |
|
69 |
|
70 // from base class MAiPSPropertyObserver |
|
71 |
|
72 TInt Get(); |
|
73 |
|
74 TInt Get( TInt& aValue ); |
|
75 |
|
76 TInt Get( TDes8& aString ); |
|
77 |
|
78 TInt Get( TDes16& aString ); |
|
79 |
|
80 private: |
|
81 |
|
82 /** |
|
83 * By default Symbian 2nd phase constructor is private. |
|
84 */ |
|
85 void ConstructL(); |
|
86 |
|
87 /** |
|
88 * C++ default constructor. |
|
89 */ |
|
90 CPSPropertyObserver( TUid aCategory, |
|
91 TInt aKey ); |
|
92 |
|
93 private: |
|
94 |
|
95 /** |
|
96 * Callback member |
|
97 */ |
|
98 TCallBack iCallBack; |
|
99 |
|
100 /** |
|
101 * PS category id |
|
102 */ |
|
103 TUid iCategory; |
|
104 |
|
105 /** |
|
106 * PS key |
|
107 */ |
|
108 TInt iKey; |
|
109 |
|
110 /** |
|
111 * Property member |
|
112 */ |
|
113 RProperty iProperty; |
|
114 |
|
115 RTimer iTimer; |
|
116 TInt iCounter; |
|
117 |
|
118 CPSPropertyObserver* iOtherObserver; |
|
119 |
|
120 }; |
|
121 |
|
122 #endif // C_CPSPROPERTYOBSERVER_H |
|
123 |
|
124 // End of File. |