|
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: ImumCreatorPredefinedMailbox.h |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef IMUMCREATORPREDEFINEDMAILBOX_H |
|
21 #define IMUMCREATORPREDEFINEDMAILBOX_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <centralrepository.h> // CRepository |
|
26 #include <ImumInternalApi.h> // CImumInternalApi |
|
27 |
|
28 #include "Imas.hrh" // KImas -constants |
|
29 |
|
30 // CONSTANTS |
|
31 // MACROS |
|
32 // DATA TYPES |
|
33 // FUNCTION PROTOTYPES |
|
34 // FORWARD DECLARATIONS |
|
35 class CImumInternalApiImpl; |
|
36 class CImumInSettingsData; |
|
37 class MImumInSettingsDataCollection; |
|
38 |
|
39 // CLASS DECLARATION |
|
40 |
|
41 /** |
|
42 * ?one_line_short_description. |
|
43 * ?other_description_lines |
|
44 * |
|
45 * @lib ?library |
|
46 * @since S60 3.0 |
|
47 */ |
|
48 NONSHARABLE_CLASS( CImumCreatorPredefinedMailbox ) : public CBase |
|
49 { |
|
50 public: // Constructors and destructor |
|
51 static CImumCreatorPredefinedMailbox* NewL( |
|
52 CImumInternalApi& aMailboxApi ); |
|
53 static CImumCreatorPredefinedMailbox* NewLC( |
|
54 CImumInternalApi& aMailboxApi ); |
|
55 virtual ~CImumCreatorPredefinedMailbox(); |
|
56 |
|
57 public: // New functions |
|
58 TBool DefinePredefinedMailboxL( |
|
59 const TUint aMailbox, |
|
60 CImumInSettingsData& aSettings ); |
|
61 public: // Functions from base classes |
|
62 |
|
63 protected: // New virtual functions |
|
64 protected: // New functions |
|
65 protected: // Functions from base classes |
|
66 |
|
67 private: // Constructors |
|
68 CImumCreatorPredefinedMailbox( CImumInternalApi& aMailboxApi ); |
|
69 void ConstructL(); |
|
70 |
|
71 private: // New virtual functions |
|
72 private: // New functions |
|
73 void ReadSMTPParameters(); |
|
74 void ReadPOP3Parameters(); |
|
75 void ReadIMAP4Parameters(); |
|
76 |
|
77 void CreateIMAP4MailboxL( CImumInSettingsData& aSettings ); |
|
78 void CreatePOP3MailboxL( CImumInSettingsData& aSettings ); |
|
79 void CreateGeneralSettingsL( CImumInSettingsData& aSettings ); |
|
80 |
|
81 void CreateSMTPSettingsL( CImumInSettingsData& aSettings ); |
|
82 void CreateIMAP4SettingsL( CImumInSettingsData& aSettings ); |
|
83 void CreatePOP3SettingsL( CImumInSettingsData& aSettings ); |
|
84 |
|
85 void ClearFields( const TUint aMailbox = 0 ); |
|
86 |
|
87 /** |
|
88 * |
|
89 * @since S60 3.1 |
|
90 */ |
|
91 TBool ReadAndCreate(); |
|
92 |
|
93 /** |
|
94 * Forms the key based on the id and fetches the string |
|
95 * @since S60 3.1 |
|
96 * @param aId, Id of the key |
|
97 * @param aString, String to be updated |
|
98 * @return KErrNone, when the key can be used |
|
99 */ |
|
100 TInt GetKey( |
|
101 TUint32 aId, |
|
102 TDes& aString ); |
|
103 |
|
104 /** |
|
105 * Forms the key based on the id and fetches the integer |
|
106 * @since S60 3.1 |
|
107 * @param aId, Id of the key |
|
108 * @param aString, String to be updated |
|
109 * @return KErrNone, when the key can be used |
|
110 */ |
|
111 TInt GetKey( |
|
112 TUint32 aId, |
|
113 TInt& aInt ); |
|
114 |
|
115 /** |
|
116 * |
|
117 * |
|
118 * @since S60 v3.2 |
|
119 * @return |
|
120 */ |
|
121 TBool ProtocolOk(); |
|
122 |
|
123 /** |
|
124 * |
|
125 * |
|
126 * @since S60 v3.2 |
|
127 * @return |
|
128 */ |
|
129 TBool CompulsoryFilled(); |
|
130 |
|
131 /** |
|
132 * |
|
133 * |
|
134 * @since S60 v3.2 |
|
135 */ |
|
136 void FixSettings(); |
|
137 |
|
138 /** |
|
139 * |
|
140 * |
|
141 * @since S60 v3.2 |
|
142 * @param |
|
143 * @return |
|
144 * @leave |
|
145 */ |
|
146 void FillInLoginInfoL( |
|
147 const TDesC& aUsername, |
|
148 const TDesC& aPassword, |
|
149 MImumInSettingsDataCollection& aConnectionSettings ) const; |
|
150 |
|
151 /** |
|
152 * Convert Security values from keys_imum.xls format to match values in |
|
153 * ImumDaSettingsKeys.h. "Off" to "SSL" and vice versa. |
|
154 * |
|
155 * @since S60 v3.2 |
|
156 * @param aSecurity, conversion result is returned via aSecurity. |
|
157 */ |
|
158 void DoSecurityConversion( TInt& aSecurity ) const; |
|
159 |
|
160 /** |
|
161 * Determines the default port number based on security and |
|
162 * mail transfer protocol settings |
|
163 * |
|
164 * @since S60 v3.2 |
|
165 * @param aSecurity, Security protocol used |
|
166 * @param aProtocol, Mail transfer protocol used |
|
167 * @return Port number |
|
168 */ |
|
169 TInt GetDefaultSecurityPort( |
|
170 const TInt aSecurity, |
|
171 const TInt aProtocol ); |
|
172 |
|
173 |
|
174 private: // Functions from base classes |
|
175 |
|
176 public: // Data |
|
177 protected: // Data |
|
178 private: // Data |
|
179 |
|
180 // Message Server Session |
|
181 CImumInternalApi& iMailboxApi; |
|
182 // Central Repository Session |
|
183 CRepository* iCenRepSession; |
|
184 // The current mailbox index |
|
185 TUint iMailbox; |
|
186 // Compulsory field: Mailbox name |
|
187 RBuf iMailboxName; |
|
188 // Compulsory field: Sending server |
|
189 RBuf iMailboxSndServer; |
|
190 // Compulsory field: Receiving server |
|
191 RBuf iMailboxRcvServer; |
|
192 // Compulsory field: Access point |
|
193 TInt iMailboxAccessPoint; |
|
194 // Compulsory field: Protocol |
|
195 TInt iMailboxProtocol; |
|
196 // Compulsory field: Receiving port number |
|
197 TInt iMailboxRcvPort; |
|
198 // Compulsory field: Sending port number |
|
199 TInt iMailboxSndPort; |
|
200 // Optional field: Email address |
|
201 RBuf iMailboxEmailAddress; |
|
202 // Optional field: Fill CC field with own email address |
|
203 TInt iMailboxFillCC; |
|
204 // Optional field: Send message delay (immediately/next connection) |
|
205 TInt iMailboxMessageSend; |
|
206 // Optional field: Sending server security option |
|
207 TInt iMailboxSndSecurity; |
|
208 // Optional field: APop setting |
|
209 TInt iMailboxAPop; |
|
210 // Optional field: Receiving server security option |
|
211 TInt iMailboxRcvSecurity; |
|
212 // Optional field: Download settings |
|
213 TInt iMailboxFetchStates; |
|
214 // Optional field: Number of headers to be fetched |
|
215 TInt iMailboxHeaderCount; |
|
216 // Optional field: Username to receiving mailbox server |
|
217 RBuf iMailboxRcvUsername; |
|
218 // Optional field: Password to receiving mailbox server |
|
219 RBuf iMailboxRcvPassword; |
|
220 // Optional field: Username to sending mailbox server |
|
221 RBuf iMailboxSndUsername; |
|
222 // Optional field: Password to sending mailbox server |
|
223 RBuf iMailboxSndPassword; |
|
224 // Optional field: OMA Email Notifications |
|
225 TInt iMailboxOmaEmnEnabled; |
|
226 }; |
|
227 |
|
228 #endif // IMUMCREATORPREDEFINEDMAILBOX_H |
|
229 |
|
230 // End of File |