|
1 /* |
|
2 * Copyright (c) 2002-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: Provides notification service for changes in settings. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CRCSECHANGENOTIFIER_H |
|
21 #define CRCSECHANGENOTIFIER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <centralrepository.h> |
|
25 #include <e32base.h> |
|
26 #include <rcsedefaultdbnames.h> |
|
27 #include <mrcsebackupobserver.h> |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CRCSEBackupObserver; |
|
31 |
|
32 // CLASS DECLARATION |
|
33 |
|
34 /** |
|
35 * Provides notification service for any changes in storage. |
|
36 * |
|
37 * @lib RCSE.lib |
|
38 * @since S60 v3.0 |
|
39 */ |
|
40 class CRCSEChangeNotifier : public CBase, public MRCSEBackupObserver |
|
41 { |
|
42 public: // Constructors and destructor |
|
43 |
|
44 /** |
|
45 * Two-phased constructor. |
|
46 * |
|
47 * @param aName defines used notifier. aNames are defined |
|
48 * in RCSEDefaultDBNames.h. |
|
49 */ |
|
50 IMPORT_C static CRCSEChangeNotifier* NewL( const TDesC& aName ); |
|
51 |
|
52 /** |
|
53 * Destructor. |
|
54 */ |
|
55 IMPORT_C virtual ~CRCSEChangeNotifier(); |
|
56 |
|
57 public: // From base classes |
|
58 |
|
59 /** |
|
60 * Handle backup observer event |
|
61 * |
|
62 * @since S60 v3.0 |
|
63 */ |
|
64 void HandleBackupOperationEventL(); |
|
65 |
|
66 public: // New functions |
|
67 |
|
68 /** |
|
69 * Makes an asyncronous request for notification of changes in |
|
70 * VoIP profiles. The change can be anything from adding, deleting or |
|
71 * updating a profile. The request status > KErrNone in case of commit. |
|
72 * |
|
73 * @since S60 v3.0 |
|
74 * @param aStatus The request status object, |
|
75 */ |
|
76 IMPORT_C void NotifyChange( TRequestStatus& aStatus ); |
|
77 |
|
78 /** |
|
79 * Cancels outstanding notify request. |
|
80 * |
|
81 * @since S60 v3.0 |
|
82 */ |
|
83 IMPORT_C void CancelNotify(); |
|
84 |
|
85 private: |
|
86 |
|
87 /** |
|
88 * C++ default constructor. |
|
89 */ |
|
90 CRCSEChangeNotifier(); |
|
91 |
|
92 /** |
|
93 * By default Symbian 2nd phase constructor is private. |
|
94 * |
|
95 * @param aName used database identifier. |
|
96 */ |
|
97 void ConstructL( const TDesC& aName ); |
|
98 |
|
99 /** |
|
100 * Setup notifier to requested data source |
|
101 * |
|
102 * @since S60 v3.1 |
|
103 */ |
|
104 void SetNotifierL( TRequestStatus& aStatus ); |
|
105 |
|
106 |
|
107 private: // Data |
|
108 |
|
109 /** |
|
110 * Central Repository object. |
|
111 * Own. |
|
112 */ |
|
113 CRepository* iRepository; |
|
114 |
|
115 /** |
|
116 * Request status if notify request is made during backup |
|
117 * Own. |
|
118 */ |
|
119 TBuf<100> iName; |
|
120 |
|
121 /** |
|
122 * Request status if notify request is made during backup |
|
123 * No Own. |
|
124 */ |
|
125 TRequestStatus* iReqStatus; |
|
126 |
|
127 /** |
|
128 * Backup / Restore observer |
|
129 * Own. |
|
130 */ |
|
131 CRCSEBackupObserver* iBackupObserver; |
|
132 |
|
133 /** |
|
134 * Defines range of keys where notifications are requested. |
|
135 */ |
|
136 TUint32 iRange; |
|
137 |
|
138 /** |
|
139 * Indicates whether notifications requested or not. |
|
140 */ |
|
141 TBool iNotifyRequested; |
|
142 |
|
143 // For testing |
|
144 #ifdef TEST_EUNIT |
|
145 friend class UT_CRCSEChangeNotifier; |
|
146 #endif |
|
147 |
|
148 |
|
149 }; |
|
150 |
|
151 #endif // CRCSECHANGENOTIFIER_H |
|
152 |
|
153 // End of File |