|
1 /* |
|
2 * Copyright (c) 2007-2007 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: CCenRepHandler class declaration. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CENREPHANDLER_H |
|
20 #define C_CENREPHANDLER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 #include "cenrepattributes.h" |
|
25 |
|
26 class CRepository; |
|
27 class MCFContextInterface; |
|
28 // class CCenRepSourcePluginTester; |
|
29 |
|
30 /** |
|
31 * Handler class for listening CenRep variables changes |
|
32 * |
|
33 * @lib CenRepSourcePlugIn.dll |
|
34 * @since S60 5.0 |
|
35 */ |
|
36 |
|
37 NONSHARABLE_CLASS( CCenRepHandler ) : public CActive |
|
38 { |
|
39 |
|
40 public: |
|
41 |
|
42 /** |
|
43 * Two-phased constructor. |
|
44 * |
|
45 * @since S60 5.0 |
|
46 * @param aCF Interface for contexts |
|
47 * @param aSettings Sensor source settings |
|
48 * @param aIndex Index of RContextSourceSettingArray item |
|
49 */ |
|
50 static CCenRepHandler* NewL( MCFContextInterface& aCF, |
|
51 CCFContextSourceSettingArray& aSettings, |
|
52 TInt aIndex ); |
|
53 |
|
54 virtual ~CCenRepHandler(); |
|
55 |
|
56 protected: |
|
57 |
|
58 private: |
|
59 |
|
60 CCenRepHandler(); |
|
61 |
|
62 void ConstructL( MCFContextInterface& aCF, CCFContextSourceSettingArray& aSettings, TInt aIndex); |
|
63 |
|
64 void QueryAndUpdateContext(); |
|
65 |
|
66 // from base class CActive |
|
67 |
|
68 /** |
|
69 * From CActive |
|
70 * Handles RunL's leave cases |
|
71 * |
|
72 * @since S60 5.0 |
|
73 * @param aError Error code of leave |
|
74 * @return KErrNone |
|
75 */ |
|
76 TInt RunError( TInt aError ); |
|
77 |
|
78 /** |
|
79 * From CActive |
|
80 * Handles an active object's request completion event. |
|
81 * |
|
82 * @since S60 5.0 |
|
83 * @param |
|
84 * @return void |
|
85 */ |
|
86 void RunL(); |
|
87 |
|
88 /** |
|
89 * From CActive |
|
90 * Notifies CenRep to cancel listening key changes |
|
91 * |
|
92 * @since S60 5.0 |
|
93 * @param |
|
94 * @return void |
|
95 */ |
|
96 void DoCancel(); |
|
97 |
|
98 public: // Data |
|
99 |
|
100 protected: // Data |
|
101 |
|
102 private: // Data |
|
103 |
|
104 // Own: Pointer to a Central repository object |
|
105 CRepository *iCrep; |
|
106 |
|
107 // Own: Pointer to a attribute handler object |
|
108 CCenRepAttributes* iCenRepAttributes; |
|
109 |
|
110 // Own: Pointer to a test class |
|
111 // CCenRepSourcePluginTester* iTester; |
|
112 |
|
113 // Central repository key |
|
114 TInt iKey; |
|
115 |
|
116 }; |
|
117 |
|
118 #endif // C_CENREPHANDLER_H |