|
1 /* |
|
2 * Copyright (c) 2006 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: Interface class of settings data |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_IMUMDASETTINGSDATA_H |
|
21 #define C_IMUMDASETTINGSDATA_H |
|
22 |
|
23 #include <msvstd.h> // TMsvId |
|
24 #include <imumdasettingskeys.h> // Settings data keys |
|
25 |
|
26 class MImumDaSettingsDataCollection; |
|
27 |
|
28 /** |
|
29 * Settings data class for all mailbox settings |
|
30 * |
|
31 * This is an interface to mailbox settings data. To be able to create |
|
32 * a working mailbox, this class has to be filled with valid settings. |
|
33 * Valid settings contains: |
|
34 * - Connection settings for incoming (imap4/pop3) settings |
|
35 * - Incoming protocol must be specified |
|
36 * - Incoming server must be specified |
|
37 * - Connection settings for outgoing (smtp) settings |
|
38 * - Outgoing protocol must be specified |
|
39 * - Outgoing server must be specified |
|
40 * - Email address must be specified |
|
41 * - Name for the mailbox |
|
42 * |
|
43 * @lib imumda.lib |
|
44 * @since S60 v3.2 |
|
45 * @see from ImumDaSettingsKeys.h enum TConnectionKeySet for setting keys |
|
46 * @see from ImumDaErrorCodes.h enum TImumDaErrorCode for error codes |
|
47 * @see from ImumDaSettingsDataCollection.h class |
|
48 * CImumDaSettingsDataCollection for connection data class |
|
49 */ |
|
50 NONSHARABLE_CLASS( CImumDaSettingsData ) : public CBase |
|
51 { |
|
52 public: |
|
53 |
|
54 /** |
|
55 * Creates connection data set to settings. |
|
56 * |
|
57 * @since S60 v3.2 |
|
58 * @param aProtocol, The protocol of the connection settings |
|
59 * @return Reference to created connection settings. |
|
60 */ |
|
61 virtual MImumDaSettingsDataCollection& AddSetL( |
|
62 const TUid& aProtocol ) = 0; |
|
63 |
|
64 /** |
|
65 * Removes the connection data set from the settings data. |
|
66 * |
|
67 * @since S60 v3.2 |
|
68 * @param aIndex, Index to connection settings to be removed |
|
69 * @param aSettingsDataCollection, Connection settings to be removed |
|
70 * @leave EImumDaConnectionSetNotExist, if the item does not exist |
|
71 */ |
|
72 virtual void DelSetL( const TUint aIndex ) = 0; |
|
73 |
|
74 virtual void DelSetL( |
|
75 const MImumDaSettingsDataCollection& aSettingsDataCollection ) = 0; |
|
76 |
|
77 /** |
|
78 * Gets an access to connection data at position. |
|
79 * |
|
80 * @since S60 v3.2 |
|
81 * @param aIndex, Index to connection settings data. |
|
82 * @return Reference to connection settings at current index. |
|
83 */ |
|
84 virtual MImumDaSettingsDataCollection& GetSetL( |
|
85 const TUint aIndex ) const = 0; |
|
86 |
|
87 /** |
|
88 * Validates the settings data. |
|
89 * |
|
90 * @since S60 v3.2 |
|
91 * @return Result of the validation operation. |
|
92 */ |
|
93 virtual TInt Validate() = 0; |
|
94 |
|
95 /** |
|
96 * Sets the given value/text to the key |
|
97 * |
|
98 * @since S60 v3.2 |
|
99 * @param aAttributeKey, Id of the setting key |
|
100 * @param aValue/aText, Data to be stored |
|
101 * @return EImumDaNoError, when successful |
|
102 */ |
|
103 virtual TInt SetAttr( |
|
104 const TUint aAttributeKey, |
|
105 const TInt aValue ) = 0; |
|
106 |
|
107 virtual TInt SetAttr( |
|
108 const TUint aAttributeKey, |
|
109 const TInt64 aValue ) = 0; |
|
110 |
|
111 virtual TInt SetAttr( |
|
112 const TUint aAttributeKey, |
|
113 const TMsvId aValue ) = 0; |
|
114 |
|
115 virtual TInt SetAttr( |
|
116 const TUint aAttributeKey, |
|
117 const TDesC& aText ) = 0; |
|
118 |
|
119 virtual TInt SetAttr( |
|
120 const TUint aAttributeKey, |
|
121 const TDesC8& aText ) = 0; |
|
122 |
|
123 /** |
|
124 * Gets the required value/text from the key |
|
125 * |
|
126 * @since S60 v3.2 |
|
127 * @param aAttributeKey, Value of the setting key |
|
128 * @param aValue/aText, Data to be stored |
|
129 * @return EImumDaNoError, when successful |
|
130 */ |
|
131 virtual TInt GetAttr( |
|
132 const TUint aAttributeKey, |
|
133 TInt& aValue ) const = 0; |
|
134 |
|
135 virtual TInt GetAttr( |
|
136 const TUint aAttributeKey, |
|
137 TInt64& aValue ) const = 0; |
|
138 |
|
139 virtual TInt GetAttr( |
|
140 const TUint aAttributeKey, |
|
141 TMsvId& aId ) const = 0; |
|
142 |
|
143 virtual TInt GetAttr( |
|
144 const TUint aAttributeKey, |
|
145 TDes& aText ) const = 0; |
|
146 |
|
147 virtual TInt GetAttr( |
|
148 const TUint aAttributeKey, |
|
149 TDes8& aText ) const = 0; |
|
150 |
|
151 |
|
152 /** |
|
153 * Compares the content of the datas |
|
154 * |
|
155 * @since S60 v3.2 |
|
156 * @param aSettingsData |
|
157 * @return Result of the comparasion |
|
158 */ |
|
159 virtual TBool operator!=( |
|
160 const CImumDaSettingsData& aSettingsData ) const = 0; |
|
161 |
|
162 virtual TBool operator==( |
|
163 const CImumDaSettingsData& aSettingsData ) const = 0; |
|
164 |
|
165 /** |
|
166 * Gets an access to connection data at position. |
|
167 * |
|
168 * @since S60 v3.2 |
|
169 * @param aIndex, Index to connection settings data. |
|
170 * @return Reference to connection settings at current index. |
|
171 */ |
|
172 virtual MImumDaSettingsDataCollection& operator[]( |
|
173 const TUint aIndex ) const = 0; |
|
174 |
|
175 /** |
|
176 * Resets the default values to most of the settings |
|
177 * |
|
178 * @since S60 v3.2 |
|
179 * This method sets the default value to all settings in the class |
|
180 */ |
|
181 virtual void ResetAll() = 0; |
|
182 |
|
183 /** |
|
184 * Resets the default value of the single key |
|
185 * |
|
186 * @since S60 v3.2 |
|
187 * @param aAttributeKey, Id of the setting key |
|
188 */ |
|
189 virtual void Reset( const TUint aAttributeKey ) = 0; |
|
190 |
|
191 /** |
|
192 * Copies the content of the setting data |
|
193 * |
|
194 * @since S60 v3.2 |
|
195 * @param aSettingsData Collection data object to be copied |
|
196 * @return EImumDaNoError, when successful |
|
197 */ |
|
198 virtual TInt Copy( |
|
199 const CImumDaSettingsData& aSettingsData ) = 0; |
|
200 |
|
201 }; |
|
202 |
|
203 #endif // C_IMUMDASETTINGSDATA_H |