|
1 /* |
|
2 * Copyright (c) 2002-2005 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 for settings |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef MCASETTINGS_H |
|
20 #define MCASETTINGS_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "PublicEngineDefinitions.h" |
|
24 |
|
25 #include <e32std.h> |
|
26 #include <e32property.h> |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class MCASettingsObserver; |
|
30 class CIMPSSAPSettings; |
|
31 |
|
32 |
|
33 // Default nick name |
|
34 _LIT( KCADefaultNick, "IMDefaultNick" ); |
|
35 // Table of userId specific Aliases |
|
36 _LIT( KCAOwnAlias, "IMOwnAlias" ); |
|
37 // Authorize IM presence |
|
38 _LIT( KCAAuthIMPr, "IMAuthIMPr" ); |
|
39 // Receive instant messages |
|
40 _LIT( KCAReceiveIMessages, "IMReceiveIMessages" ); |
|
41 // Receive invitations |
|
42 _LIT( KCAReceiveInvitations, "IMReceiveInvitations" ); |
|
43 // Message flow |
|
44 _LIT( KCAMsgFlow, "IMMsgFlow" ); |
|
45 // Auto update |
|
46 _LIT( KCAAutoUpd, "IMAutoUpd" ); |
|
47 // Auto update |
|
48 _LIT( KCAFriendsListOrdering, "IMFriendsListOrdering" ); |
|
49 // Order alphabetically |
|
50 _LIT( KCAOrderAlpha, "IMOrderAlpha" ); |
|
51 |
|
52 // Show first login done |
|
53 _LIT( KCAFirstLoginDone, "IMFistLoginDone" ); |
|
54 // Default screen name in use |
|
55 _LIT( KCADefaultScreenNameInUse, "IMDefaultScreenNameInUse" ); |
|
56 // Automatic presence update |
|
57 _LIT( KCAAutomaticPresenceUpdate, "IMAutomaticPresenceUpdate" ); |
|
58 // Update selected contacts |
|
59 _LIT( KCAUpdateSelectedContacts, "IMUpdateSelectedContacts" ); |
|
60 // Show history |
|
61 _LIT( KCAShowHistory, "IMUpdateSelectedContacts" ); |
|
62 // Show offline friends |
|
63 _LIT( KCAShowOffline, "IMShowOffline" ); |
|
64 // Show timestamps |
|
65 _LIT( KCAShowTimeStamps, "IMShowTimeStamps" ); |
|
66 |
|
67 // |
|
68 |
|
69 // CLASS DECLARATION |
|
70 |
|
71 /** |
|
72 * Interface for internal settings handler. |
|
73 * |
|
74 * |
|
75 * @lib CAEngine.lib |
|
76 * @since 1.2 |
|
77 */ |
|
78 class MCASettings |
|
79 { |
|
80 public: // Setting enums. Don't change the base enums! |
|
81 |
|
82 // enumerations for setting items' values |
|
83 // (authorize presence, receive imessages, receive invitations) |
|
84 enum TCASettingValues |
|
85 { |
|
86 EAll = 0, |
|
87 EFriends, |
|
88 ENobody |
|
89 }; |
|
90 |
|
91 // enumerations for friends list ordering setting items' values |
|
92 enum TCAFriendsListOrdering |
|
93 { |
|
94 EAlphabetical = 0, |
|
95 EPresence |
|
96 }; |
|
97 |
|
98 // boolean setting items |
|
99 enum TCASettingFlags |
|
100 { |
|
101 EFlagsBase = 1, |
|
102 |
|
103 EFirstLoginDone, |
|
104 EDefaultScreenNameInUse, |
|
105 EAutomaticPresenceUpdate, |
|
106 EUpdateSelectedContacts, |
|
107 EShowHistory, |
|
108 EShowOffline, |
|
109 EShowTimeStamps |
|
110 }; |
|
111 |
|
112 // integer setting items |
|
113 enum TCASettingIntegers |
|
114 { |
|
115 EIntegersBase = 1000, |
|
116 |
|
117 EAuthorizeIMPresence, |
|
118 EReceiveIMessages, |
|
119 EReceiveInvitations, |
|
120 EMessageFlowSettingLevel, |
|
121 EFriendsListOrdering |
|
122 }; |
|
123 |
|
124 // string setting items |
|
125 enum TCASettingStrings // For strings add max length to enum value |
|
126 { |
|
127 EStringsLengthShift = 8, |
|
128 EStringsEnumMask = 0xff, |
|
129 EStringsLengthMask = 0xffff00, |
|
130 EStringsBase = 0x1000000, |
|
131 EDefaultScreenNameBase = 0x1000001, |
|
132 EOwnWVUserIDBase = 0x1000002, |
|
133 EOwnAliasBase = 0x1000003, |
|
134 EServiceAddressBase = 0x1000004, |
|
135 EStatusMsgOnlineBase = 0x1000005, |
|
136 EStatusMsgAwayBase = 0x1000006, |
|
137 EStatusMsgBusyBase = 0x1000007, |
|
138 |
|
139 EDefaultScreenName = EDefaultScreenNameBase |
|
140 + ( KWScreenNameMaxLength << EStringsLengthShift ), |
|
141 |
|
142 EOwnWVUserID = EOwnWVUserIDBase |
|
143 + ( KWVUserIDMaxLength << EStringsLengthShift ), |
|
144 |
|
145 EOwnAlias = EOwnAliasBase |
|
146 + ( KWScreenNameMaxLength << EStringsLengthShift ), |
|
147 |
|
148 EServiceAddress = EServiceAddressBase + |
|
149 ( KWVUserIDMaxLength << EStringsLengthShift ), |
|
150 |
|
151 EStatusMsgOnline = EStatusMsgOnlineBase + |
|
152 ( RProperty::KMaxPropertySize << EStringsLengthShift ), |
|
153 |
|
154 EStatusMsgAway = EStatusMsgAwayBase + |
|
155 ( RProperty::KMaxPropertySize << EStringsLengthShift ), |
|
156 EStatusMsgBusy = EStatusMsgBusyBase + |
|
157 ( RProperty::KMaxPropertySize << EStringsLengthShift ) |
|
158 }; |
|
159 |
|
160 public: |
|
161 |
|
162 /** |
|
163 * Adds settings observer to the observer list. |
|
164 * @param aObserver specifies the observer. |
|
165 */ |
|
166 virtual void AddObserverL( const MCASettingsObserver* aObserver ) = 0; |
|
167 |
|
168 /** |
|
169 * Removes the observer from the list. |
|
170 * @param aObserver specifies the observer that gets removed. |
|
171 */ |
|
172 virtual void RemoveObserver( |
|
173 const MCASettingsObserver* aObserver ) = 0; |
|
174 |
|
175 /** |
|
176 * Retrieves value. |
|
177 * @param aSetting specifies the wanted setting. |
|
178 * @return Boolean value. |
|
179 */ |
|
180 virtual TBool Value( TCASettingFlags aSetting, |
|
181 CIMPSSAPSettings* aSap = NULL ) = 0; |
|
182 |
|
183 /** |
|
184 * Retrieves value. |
|
185 * @param aSetting specifies the wanted setting. |
|
186 * @return Integer value. |
|
187 */ |
|
188 virtual TInt Value( TCASettingIntegers aSetting, |
|
189 CIMPSSAPSettings* aSap = NULL ) = 0; |
|
190 |
|
191 /** |
|
192 * Retrieves value. |
|
193 * Ownership is transferred to caller!!! |
|
194 * @param aSetting specifies the wanted setting. |
|
195 * @return String value. |
|
196 */ |
|
197 virtual HBufC* ValueL( TCASettingStrings aSetting, |
|
198 CIMPSSAPSettings* aSap = NULL ) = 0; |
|
199 |
|
200 /** |
|
201 * Sets a value. |
|
202 * @param aSetting specifies the wanted setting. |
|
203 * @param aValue specifies the value we want to store. |
|
204 * @param aIgnoreRollback Don't perform rollback operation on these |
|
205 * errors |
|
206 * NULL if rollback is wanted in every error situation. |
|
207 */ |
|
208 virtual void SetValueL( TCASettingFlags aSetting, TBool aValue, |
|
209 RArray<TInt>* aIgnoreRollback = NULL, |
|
210 CIMPSSAPSettings* aSap = NULL ) = 0; |
|
211 |
|
212 /** |
|
213 * Sets a value. |
|
214 * @param aSetting specifies the wanted setting. |
|
215 * @param aValue specifies the value we want to store. |
|
216 * @param aIgnoreRollback Don't perform rollback operation on these |
|
217 * errors |
|
218 * NULL if rollback is wanted in every error situation. |
|
219 */ |
|
220 virtual void SetValueL( TCASettingIntegers aSetting, TInt aValue, |
|
221 RArray<TInt>* aIgnoreRollback = NULL, |
|
222 CIMPSSAPSettings* aSap = NULL ) = 0; |
|
223 |
|
224 /** |
|
225 * Sets a value. |
|
226 * @param aSetting specifies the wanted setting. |
|
227 * @param aValue specifies the value we want to store. |
|
228 * @param aIgnoreRollback Don't perform rollback operation on |
|
229 * these errors |
|
230 * NULL if rollback is wanted in every error situation. |
|
231 */ |
|
232 virtual void SetValueL( TCASettingStrings aSetting, const TDesC& aValue, |
|
233 RArray<TInt>* aIgnoreRollback = NULL, |
|
234 CIMPSSAPSettings* aSap = NULL ) = 0; |
|
235 |
|
236 /** |
|
237 * Flushes data from memory to persistent storage |
|
238 */ |
|
239 virtual void FlushData() = 0; |
|
240 |
|
241 /** |
|
242 * Sets the default sap |
|
243 */ |
|
244 virtual void SetDefaultSapL( CIMPSSAPSettings* aSap ) = 0; |
|
245 |
|
246 /** |
|
247 * Retrieves the own alias value. |
|
248 * Ownership is transferred! |
|
249 * @return current alias value |
|
250 */ |
|
251 virtual HBufC* OwnAliasL() = 0; |
|
252 |
|
253 /** |
|
254 * Sets the new alias attribute. |
|
255 * @param aAlias new alias attribute. |
|
256 */ |
|
257 virtual void SetOwnAliasL( const TDesC& aAlias ) = 0; |
|
258 |
|
259 protected: |
|
260 |
|
261 /** |
|
262 * Destructor. |
|
263 */ |
|
264 virtual ~MCASettings() {}; |
|
265 }; |
|
266 |
|
267 #endif // MCASETTINGS_H |
|
268 |
|
269 // End of File |