|
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: |
|
15 * Settings observer |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 #ifndef __MCESETTINGSSESSIONOBSERVER_H__ |
|
23 #define __MCESETTINGSSESSIONOBSERVER_H__ |
|
24 |
|
25 // INCLUDES |
|
26 |
|
27 #include <MuiuMsvSingleOpWatcher.h> |
|
28 #include "MceSettingsAccountManager.h" |
|
29 |
|
30 // CLASS DECLARATION |
|
31 |
|
32 |
|
33 // CLASS DECLARATION |
|
34 |
|
35 /** |
|
36 * Settings observer |
|
37 * |
|
38 */ |
|
39 |
|
40 class CMceSettingsSessionObserver : |
|
41 public CBase, |
|
42 public MMsvSessionObserver, |
|
43 public MMsvSingleOpWatcher, |
|
44 public MMceSettingsAccountManager |
|
45 { |
|
46 public: |
|
47 |
|
48 /** |
|
49 * Two-phased constructor. |
|
50 */ |
|
51 IMPORT_C static CMceSettingsSessionObserver* NewL( CMsvSession* aSession ); |
|
52 |
|
53 /** |
|
54 * Destructor |
|
55 */ |
|
56 IMPORT_C virtual ~CMceSettingsSessionObserver(); |
|
57 |
|
58 public: |
|
59 |
|
60 /** |
|
61 * from MMsvSessionObserver |
|
62 */ |
|
63 virtual void HandleSessionEventL( TMsvSessionEvent aEvent, |
|
64 TAny* aArg1, |
|
65 TAny* aArg2, |
|
66 TAny* aArg3 ); |
|
67 |
|
68 /** |
|
69 * from MMsvSingleOpWatcher |
|
70 */ |
|
71 virtual void OpCompleted( CMsvSingleOpWatcher& aOpWatcher, TInt aCompletionCode ); |
|
72 |
|
73 /** |
|
74 * From MMceSettingsAccountManager |
|
75 */ |
|
76 IMPORT_C TBool CreateNewAccountL( |
|
77 TUid aMessageType, |
|
78 TMsvId aOldServiceId ); |
|
79 |
|
80 /** |
|
81 * From MMceSettingsAccountManager |
|
82 */ |
|
83 IMPORT_C void EditAccountL( TMsvId aId ); |
|
84 |
|
85 /** |
|
86 * From MMceSettingsAccountManager |
|
87 */ |
|
88 IMPORT_C CUidNameArray* MtmAccountsL( TUid aType ); |
|
89 |
|
90 /** |
|
91 * From MMceSettingsAccountManager |
|
92 */ |
|
93 IMPORT_C TBool CanCreateNewAccountL( TUid aMtm ); |
|
94 |
|
95 /** |
|
96 * From MMceSettingsAccountManager |
|
97 */ |
|
98 IMPORT_C void DeleteAccountL( TMsvId aId ); |
|
99 |
|
100 /** |
|
101 * From MMceSettingsAccountManager |
|
102 */ |
|
103 IMPORT_C CMsvSession& Session(); |
|
104 |
|
105 /** |
|
106 * From MMceSettingsAccountManager |
|
107 */ |
|
108 IMPORT_C TBool IsPresent( TUid aMtm ) const; |
|
109 |
|
110 /** |
|
111 * From MMceAccountManager |
|
112 */ |
|
113 IMPORT_C THumanReadableName MtmName( TUid aType ) const; |
|
114 |
|
115 /** |
|
116 * From MMceAccountManager |
|
117 */ |
|
118 IMPORT_C void SetChangeMessageStore( TBool aChangeEnded ); |
|
119 |
|
120 public: |
|
121 |
|
122 /** |
|
123 * Returns mtm store pointer |
|
124 */ |
|
125 IMPORT_C CMtmStore* MtmStore() const; |
|
126 |
|
127 /** |
|
128 * Returns ui data registry pointer |
|
129 */ |
|
130 IMPORT_C CMtmUiDataRegistry* UiRegistry() const; |
|
131 |
|
132 private: |
|
133 |
|
134 /** |
|
135 * Default constructor |
|
136 */ |
|
137 CMceSettingsSessionObserver( CMsvSession* aSession ); |
|
138 |
|
139 /** |
|
140 * Symbian OS constructor |
|
141 */ |
|
142 void ConstructL(); |
|
143 |
|
144 /** |
|
145 * Check if free disk space goes under critical level, and leaves if it does |
|
146 */ |
|
147 void LeaveIfDiskSpaceUnderCriticalLevelL( TInt aBytesToWrite = 0 ) const; |
|
148 |
|
149 /** |
|
150 * Display possible error when operation is compeleted |
|
151 */ |
|
152 void DoOperationCompletedL( |
|
153 CMsvOperation* aOperation, |
|
154 TInt aCompletionCode ); |
|
155 |
|
156 /** |
|
157 * Cancels RequestFreeDiskSpace if leave happens |
|
158 * on DeleteAccountL |
|
159 * @param aAny: pointer to object. |
|
160 */ |
|
161 static void CancelFreeDiskSpaceRequest( TAny* aAny ); |
|
162 |
|
163 |
|
164 private: // Data |
|
165 CMsvSession* iSession; |
|
166 CMtmUiDataRegistry* iUiRegistry; |
|
167 CMtmStore* iMtmStore; |
|
168 CMsvEntry* iRootEntry; |
|
169 CMsvSingleOpWatcher* iRunningOperation; |
|
170 TBool iDeleteSession; |
|
171 |
|
172 }; |
|
173 |
|
174 #endif // MCESETTINGSSESSIONOBSERVER_H |
|
175 |
|
176 |
|
177 |
|
178 |
|
179 |