|
1 /* |
|
2 * Copyright (c) 2002 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: ImumMboxDefaultData.h |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CImumMboxDefaultData_H |
|
20 #define CImumMboxDefaultData_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <msvstd.h> |
|
24 |
|
25 #include "ImumInSettingsDataImpl.h" |
|
26 |
|
27 // CONSTANTS |
|
28 // MACROS |
|
29 // DATA TYPES |
|
30 // FUNCTION PROTOTYPES |
|
31 // FORWARD DECLARATIONS |
|
32 class CIMASCenRepControl; |
|
33 class CRepository; |
|
34 |
|
35 // CLASS DECLARATION |
|
36 |
|
37 /** |
|
38 * Container class for default data. |
|
39 * |
|
40 * This class implements functionality and stores all mailbox settings |
|
41 * related default data. The data is read from the Central Repository |
|
42 * and in case it fails, hardcoded values are used instead. |
|
43 * |
|
44 * This class also contains functionality to create copy of default data |
|
45 * settings and connection settings. This is used during the Settings |
|
46 * data object creation phase, when specified protocol data is cloned from |
|
47 * this object. |
|
48 * |
|
49 * Each protocol can and should have own specific set of default settings. |
|
50 * Currently supported protocols are Imap4, Pop3 and Smtp. |
|
51 * |
|
52 * @lib ImumUtils.lib |
|
53 * @since S60 3.0 |
|
54 * @see ImumInSettingsData.h |
|
55 * @see ImumDaSettingsDataKeys.h |
|
56 * @see ImumInSettingsDataKeys.h |
|
57 * @see ImumConsts.h |
|
58 */ |
|
59 NONSHARABLE_CLASS( CImumMboxDefaultData ) : public CImumInSettingsDataImpl |
|
60 { |
|
61 public: // Constructors and destructor |
|
62 |
|
63 /** |
|
64 * Creates object from CImumMboxDefaultData and leaves it to cleanup stack |
|
65 * |
|
66 * @since S60 v3.2 |
|
67 * @return, Constructed object |
|
68 */ |
|
69 static CImumMboxDefaultData* NewLC( CImumInternalApiImpl& aMailboxApi ); |
|
70 |
|
71 /** |
|
72 * Create object from CImumMboxDefaultData |
|
73 * |
|
74 * @since S60 v3.2 |
|
75 * @return, Constructed object |
|
76 */ |
|
77 static CImumMboxDefaultData* NewL( CImumInternalApiImpl& aMailboxApi ); |
|
78 |
|
79 /** |
|
80 * Destructor |
|
81 * |
|
82 * @since S60 v3.2 |
|
83 */ |
|
84 virtual ~CImumMboxDefaultData(); |
|
85 |
|
86 public: // New functions |
|
87 |
|
88 /** |
|
89 * Returns pointer to |
|
90 * |
|
91 * @since S60 v3.2 |
|
92 * @param |
|
93 */ |
|
94 const CImumInSettingsDataCollectionImpl* DefaultConnectionData( |
|
95 const TInt aIndex ) const; |
|
96 |
|
97 /** |
|
98 * Creates identical copy of general settings |
|
99 * |
|
100 * @since S60 v3.2 |
|
101 * @return New settings object |
|
102 * @leave |
|
103 */ |
|
104 CImumInSettingsDataArray* CloneSettingsL() const; |
|
105 |
|
106 /** |
|
107 * Creates identical copy of connection settings |
|
108 * |
|
109 * @since S60 v3.2 |
|
110 * @param aProtocol Protocol to be cloned |
|
111 * @return New connection settings object |
|
112 * @leave |
|
113 */ |
|
114 CImumInSettingsDataCollectionImpl* CloneConnectionSettingsL( |
|
115 const TUid& aProtocol ) const; |
|
116 |
|
117 public: // Functions from base classes |
|
118 |
|
119 /** |
|
120 * |
|
121 * @since S60 3.2 |
|
122 * @param |
|
123 * @return |
|
124 */ |
|
125 virtual MImumDaSettingsDataCollection& AddSetL( const TUid& aProtocol ); |
|
126 |
|
127 /** |
|
128 * |
|
129 * @since S60 3.2 |
|
130 * @param |
|
131 * @return |
|
132 */ |
|
133 virtual MImumInSettingsDataCollection& AddInSetL( const TUid& aProtocol ); |
|
134 |
|
135 /** |
|
136 * |
|
137 * @since S60 v3.2 |
|
138 * @param |
|
139 * @return |
|
140 */ |
|
141 virtual TInt Validate(); |
|
142 |
|
143 /** |
|
144 * |
|
145 * @since S60 v3.2 |
|
146 * @return |
|
147 */ |
|
148 virtual void Reset( const TUint aAttributeKey ); |
|
149 |
|
150 /** |
|
151 * |
|
152 * @since S60 v3.2 |
|
153 */ |
|
154 virtual void ResetAll(); |
|
155 |
|
156 /** |
|
157 * |
|
158 * @since S60 v3.2 |
|
159 * @param |
|
160 * @return |
|
161 */ |
|
162 virtual void Log() const; |
|
163 |
|
164 protected: // New virtual functions |
|
165 protected: // New functions |
|
166 protected: // Functions from base classes |
|
167 |
|
168 private: // Constructors |
|
169 |
|
170 /** |
|
171 * Default constructor for classCImumMboxDefaultData |
|
172 * |
|
173 * @since S60 v3.2 |
|
174 * @return, Constructed object |
|
175 */ |
|
176 CImumMboxDefaultData( CImumInternalApiImpl& aMailboxApi ); |
|
177 |
|
178 /** |
|
179 * Symbian 2-phase constructor |
|
180 * @since S60 v3.2 |
|
181 */ |
|
182 void ConstructL(); |
|
183 |
|
184 private: // New virtual functions |
|
185 private: // New functions |
|
186 |
|
187 |
|
188 /** |
|
189 * |
|
190 * |
|
191 * @since S60 v3.2 |
|
192 */ |
|
193 void ResetImap4Data(); |
|
194 |
|
195 /** |
|
196 * |
|
197 * |
|
198 * @since S60 v3.2 |
|
199 */ |
|
200 void ResetPop3Data(); |
|
201 |
|
202 /** |
|
203 * |
|
204 * |
|
205 * @since S60 v3.2 |
|
206 */ |
|
207 void ResetSmtpData(); |
|
208 |
|
209 /** |
|
210 * |
|
211 * |
|
212 * @since S60 v3.2 |
|
213 */ |
|
214 void ResetGeneralData(); |
|
215 |
|
216 /** |
|
217 * Update variated value from central repository |
|
218 * |
|
219 * @since S60 3.2 |
|
220 * @param aDefaultData |
|
221 * @param aSettingsKey |
|
222 * @param aCrKey |
|
223 * @param aDefaultValue |
|
224 */ |
|
225 template<class TDataType, class TSettingType> |
|
226 inline void UpdateData( |
|
227 TDataType& aDefaultData, |
|
228 const TUint aSettingsKey, |
|
229 const TUint32 aCRKey, |
|
230 const TSettingType& aDefaultValue ); |
|
231 |
|
232 /** |
|
233 * Update variated value from central repository |
|
234 * |
|
235 * @since S60 3.2 |
|
236 * @param aDefaultData |
|
237 * @param aSettingsKey |
|
238 * @param aCrKey |
|
239 * @param aDefaultValue |
|
240 */ |
|
241 template<class TDataType> |
|
242 inline void UpdateData( |
|
243 TDataType& aDefaultData, |
|
244 const TUint aSettingsKey, |
|
245 const TUint32 aCRKeyLow, |
|
246 const TUint32 aCRKeyHigh, |
|
247 const TInt64& aDefaultValue ); |
|
248 |
|
249 |
|
250 private: // Functions from base classes |
|
251 |
|
252 public: // Data |
|
253 protected: // Data |
|
254 private: // Data |
|
255 |
|
256 // Owned: |
|
257 CIMASCenRepControl* iCenRepControl; |
|
258 // Owned: |
|
259 CRepository* iImumRepository; |
|
260 }; |
|
261 |
|
262 #include "ImumMboxDefaultData.inl" |
|
263 |
|
264 #endif // CImumMboxDefaultData_H |
|
265 |
|
266 // End of File |