|
1 /* |
|
2 * Copyright (c) 2004 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: Active object for subscribing to Publish & Suscribe properties |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CAPPCONTROLLERPROPERTYHANDLER_H |
|
20 #define CAPPCONTROLLERPROPERTYHANDLER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <e32property.h> |
|
25 |
|
26 // FORWARDS |
|
27 class CVCApplicationControllerImpl; |
|
28 |
|
29 // CLASS DECLARATION |
|
30 |
|
31 /** |
|
32 * Active object for subscribing to Publish & Suscribe properties |
|
33 * @since 2.8 |
|
34 */ |
|
35 class CAppControllerPropertyHandler : public CActive |
|
36 { |
|
37 public: // Constructors and destructor |
|
38 /** |
|
39 * Symbian two-phased constructor. |
|
40 * @since 2.8 |
|
41 * @param aCategory Category of the property to watch |
|
42 * @param aKey Key UID of the property to watch |
|
43 * @param aCallback Callback to get notifications about changes |
|
44 */ |
|
45 static CAppControllerPropertyHandler* NewL( |
|
46 TUid aCategory, |
|
47 TUint aKey, |
|
48 CVCApplicationControllerImpl* aController ); |
|
49 |
|
50 // Destructor |
|
51 virtual ~CAppControllerPropertyHandler(); |
|
52 |
|
53 public: // New functions |
|
54 |
|
55 /** |
|
56 * Get current property value. |
|
57 * @since 2.8 |
|
58 * @return current (integer) value of this property |
|
59 */ |
|
60 TInt Value(); |
|
61 |
|
62 |
|
63 private: // Functions from base classes |
|
64 |
|
65 /** |
|
66 * From CActive. |
|
67 * Handle a change event. |
|
68 */ |
|
69 void RunL(); |
|
70 |
|
71 /** |
|
72 * From CActive. |
|
73 * Cancel the request to receive events. |
|
74 */ |
|
75 void DoCancel(); |
|
76 |
|
77 private: // New functions |
|
78 |
|
79 /** |
|
80 * Symbian OS 2nd phase constructor. |
|
81 */ |
|
82 void ConstructL(TUid aCategory, |
|
83 TUint aKey ); |
|
84 |
|
85 /** |
|
86 * C++ constructor. |
|
87 */ |
|
88 CAppControllerPropertyHandler(CVCApplicationControllerImpl* aController); |
|
89 |
|
90 private: // Data |
|
91 |
|
92 RProperty iProperty; |
|
93 TCallBack iCallback; |
|
94 TBool iRequestIssued; |
|
95 CVCApplicationControllerImpl* iController; |
|
96 }; |
|
97 |
|
98 #endif |
|
99 |
|
100 // End of File |