|
1 /* |
|
2 * Copyright (c) 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: central repository notifier class definition |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef _CCMCENREPNOTIFIER_H |
|
20 #define _CCMCENREPNOTIFIER_H |
|
21 |
|
22 // Include Files |
|
23 #include <d32dbms.h> |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class CRepository; |
|
27 class CCmScheduler; |
|
28 |
|
29 |
|
30 // CLASS DECLARATION |
|
31 |
|
32 /** |
|
33 * Comms database notifier class for scheduler |
|
34 * @lib cmscheduler.lib |
|
35 * @since S60 5.1 |
|
36 */ |
|
37 class CCmCenrepNotifier : public CActive |
|
38 { |
|
39 public: // Constructors and destructor |
|
40 |
|
41 /** |
|
42 * Two-phased constructor. |
|
43 */ |
|
44 static CCmCenrepNotifier* NewL( CCmScheduler& aSheduler ); |
|
45 |
|
46 /** |
|
47 * Destructor. |
|
48 */ |
|
49 virtual ~CCmCenrepNotifier(); |
|
50 |
|
51 /** |
|
52 * Reads current profile from central repository |
|
53 * |
|
54 * @since S60 5.1 |
|
55 * @param aProfile, reference of current profile |
|
56 * @return TInt, error code |
|
57 */ |
|
58 TInt GetCurrentProfile( TInt& aProfile ); |
|
59 |
|
60 protected: // From CActive |
|
61 |
|
62 /** |
|
63 * Called when request completes |
|
64 * |
|
65 * @since S60 5.1 |
|
66 */ |
|
67 void RunL(); |
|
68 |
|
69 /** |
|
70 * Called when request is cancelled |
|
71 * |
|
72 * @since S60 5.1 |
|
73 */ |
|
74 void DoCancel(); |
|
75 |
|
76 /** |
|
77 * Called when RunL leaves |
|
78 * |
|
79 * @since S60 5.1 |
|
80 */ |
|
81 TInt RunError(TInt aError); |
|
82 |
|
83 private: // Constructors |
|
84 |
|
85 /** |
|
86 * Default constructor. |
|
87 */ |
|
88 CCmCenrepNotifier( CCmScheduler& aSheduler ); |
|
89 |
|
90 /** |
|
91 * Two-phased constructor. |
|
92 */ |
|
93 void ConstructL(); |
|
94 |
|
95 /** |
|
96 * Initiates asyncronous notification request to database |
|
97 * |
|
98 * @since S60 5.1 |
|
99 */ |
|
100 void RequestNotification(); |
|
101 |
|
102 private: |
|
103 |
|
104 /** |
|
105 * Database to be monitored |
|
106 */ |
|
107 CRepository* iRepository; // owned |
|
108 |
|
109 /** |
|
110 * Change observer |
|
111 */ |
|
112 CCmScheduler& iScheduler; // not owned |
|
113 }; |
|
114 |
|
115 #endif // _CCMCENREPNOTIFIER_H |