|
1 /* |
|
2 * Copyright (c) 2002-2004,2008 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: CenRepListener listens to given Central Repository setting id and notifies its |
|
15 * observer if there is any change. Observer is given as a parameter on |
|
16 * initialising the listener. Observer must implement MhspsCenRepObserver-interface. |
|
17 * CenRepListener is asynchronous object that deploys a client-side handle |
|
18 * on Central Repository Server. CenRepListener is intended to be used by any object |
|
19 * that wants listen Central Repository changes. |
|
20 * |
|
21 * |
|
22 */ |
|
23 |
|
24 |
|
25 #ifndef __ChspsCENREPLISTENER_H__ |
|
26 #define __ChspsCENREPLISTENER_H__ |
|
27 |
|
28 #include <s32file.h> |
|
29 |
|
30 class CRepository; |
|
31 |
|
32 /** |
|
33 * @ingroup group_hspsserver |
|
34 * MhspsCenRepObserver is used to listen to the changes in the Central Repository. |
|
35 * |
|
36 * @lib hspsThemeServer.exe |
|
37 * @since S60 5.0 |
|
38 */ |
|
39 class MhspsCenRepObserver |
|
40 { |
|
41 public: |
|
42 virtual void HandleCenRepChangeL( const TUint32 aId ) = 0; |
|
43 }; |
|
44 |
|
45 /** |
|
46 * @ingroup group_hspsserver |
|
47 * ChspsCenRepListener is used to listen to the changes in the Central Repository. |
|
48 * |
|
49 * @lib hspsThemeServer.exe |
|
50 * @since S60 5.0 |
|
51 */ |
|
52 class ChspsCenRepListener : public CActive |
|
53 { |
|
54 public: // Constructors and destructor |
|
55 |
|
56 /** |
|
57 * NewL |
|
58 * Two-phased constructor. |
|
59 */ |
|
60 static ChspsCenRepListener* NewL( |
|
61 MhspsCenRepObserver& aObserver, |
|
62 const TUid& aRepositoryUid ); |
|
63 /** |
|
64 * ~ChspsCenRepListener |
|
65 * Destructor. |
|
66 */ |
|
67 virtual ~ChspsCenRepListener(); |
|
68 |
|
69 public: |
|
70 |
|
71 /** |
|
72 * Setup |
|
73 * Sets up the Central Repository change listener for setting aId. |
|
74 * @since S60 3.1 |
|
75 * @return void |
|
76 */ |
|
77 void Setup( TUint32 aId ); |
|
78 |
|
79 /** |
|
80 * SetupAll |
|
81 * Sets up the Central Repository change listener for all settings. |
|
82 * @since S60 3.1 |
|
83 * @return void |
|
84 */ |
|
85 void SetupAll(); |
|
86 |
|
87 protected: // Functions from base classes |
|
88 |
|
89 /** |
|
90 * From CActive Called when asynchronous request has completed |
|
91 * RunL |
|
92 * @since S60 3.1 |
|
93 */ |
|
94 void RunL(); |
|
95 |
|
96 /** |
|
97 * DoCancel |
|
98 * From CActive Called when asynchronous request was cancelled |
|
99 * @since S60 3.1 |
|
100 */ |
|
101 void DoCancel(); |
|
102 |
|
103 private: |
|
104 |
|
105 /** |
|
106 * ConstructL |
|
107 * By default Symbian 2nd phase constructor is private. |
|
108 */ |
|
109 void ConstructL(); |
|
110 |
|
111 /** |
|
112 * ChspsCenRepListener |
|
113 * C++ default constructor. |
|
114 */ |
|
115 ChspsCenRepListener( MhspsCenRepObserver& aObserver, |
|
116 const TUid& aRepositoryUid ); |
|
117 |
|
118 private: // Data |
|
119 |
|
120 // Observer which is called when RunL occurs |
|
121 MhspsCenRepObserver& iObserver; |
|
122 // Pointer to Central Repository |
|
123 CRepository* iRepository; |
|
124 // Uid of the accessed Central Repository |
|
125 TUid iRepositoryUid; |
|
126 }; |
|
127 |
|
128 |
|
129 #endif // __ChspsCENREPLISTENER_H__ |
|
130 |
|
131 // End of File |