|
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: ImumMboxSettingsUtils.h |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CIMUMMBOXSETTINGSUTILS_H |
|
20 #define CIMUMMBOXSETTINGSUTILS_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <ImumInternalApi.h> // CImumInternalApi |
|
25 #include <ImumInSettingsData.h> // CImumInSettingsData |
|
26 #include <ImumInSettingsDataCollection.h> // CImumInSettingsDataCollection |
|
27 #include <miutset.h> // CImBaseEmailSettings |
|
28 #include <imapset.h> // CImImap4Settings |
|
29 #include <pop3set.h> // CImPop3Settings |
|
30 #include <smtpset.h> // CImSmtpSettings |
|
31 |
|
32 // CONSTANTS |
|
33 // MACROS |
|
34 // DATA TYPES |
|
35 // FUNCTION PROTOTYPES |
|
36 // FORWARD DECLARATIONS |
|
37 // CLASS DECLARATION |
|
38 |
|
39 /** |
|
40 * |
|
41 * @lib |
|
42 * @since Series60 3.0 |
|
43 */ |
|
44 class ImumMboxSettingsUtils |
|
45 { |
|
46 public: // Constructors and destructor |
|
47 public: // New functions |
|
48 |
|
49 /** |
|
50 * |
|
51 * @since S60 3.2 |
|
52 */ |
|
53 static void SetLoginInformationL( |
|
54 CImumInternalApi& aMailboxApi, |
|
55 const TDesC8& aUserName, |
|
56 const TDesC8& aPassword, |
|
57 const TBool aPasswordTemporary, |
|
58 const TMsvId aServiceId ); |
|
59 |
|
60 /** |
|
61 * |
|
62 * @since S60 3.2 |
|
63 */ |
|
64 static void GetLoginInformationL( |
|
65 CImumInternalApi& aMailboxApi, |
|
66 TDes8& aUserName, |
|
67 TDes8& aPassword, |
|
68 TBool& aPasswordTemporary, |
|
69 const TMsvId aServiceId ); |
|
70 |
|
71 /** |
|
72 * Get login information from settings. This is a performance optimization |
|
73 * to avoid loading settings if they are available already. |
|
74 * @since S60 3.2 |
|
75 */ |
|
76 static void GetLoginInformationL( |
|
77 const CImumInSettingsData& aAccountSettings, |
|
78 TUid aMtmUid, |
|
79 TDes8& aUserName, |
|
80 TDes8& aPassword, |
|
81 TBool& aPasswordTemporary ); |
|
82 |
|
83 /** |
|
84 * |
|
85 * |
|
86 * @since S60 3.2 |
|
87 * @param aEmailApi |
|
88 * @param aMailboxId |
|
89 * @param aAttributeKey |
|
90 * @param aConnectionIndex |
|
91 * @return |
|
92 */ |
|
93 template<class T> |
|
94 inline static T QuickLoadL( |
|
95 CImumInternalApi& aEmailApi, |
|
96 const TMsvId aMailboxId, |
|
97 const TUint aAttributeKey, |
|
98 const TInt aConnectionIndex = KErrNotFound ); |
|
99 |
|
100 /** |
|
101 * |
|
102 * @since S60 3.2 |
|
103 * @param aSettings |
|
104 * @param aAttributeKey |
|
105 * @return |
|
106 */ |
|
107 template<class T> |
|
108 inline static T QuickGetL( |
|
109 const CImumInSettingsData& aSettings, |
|
110 const TUint aAttributeKey, |
|
111 const TInt aConnectionIndex = KErrNotFound ); |
|
112 |
|
113 /** |
|
114 * |
|
115 * @since S60 3.2 |
|
116 * @param |
|
117 * @return |
|
118 */ |
|
119 static TBool IsImap4( |
|
120 const CImumInSettingsData& aSettings ); |
|
121 |
|
122 /** |
|
123 * |
|
124 * |
|
125 * @since S60 v3.2 |
|
126 * @param |
|
127 * @return |
|
128 */ |
|
129 static TBool ValidateSettingsL( |
|
130 CImumInternalApi& aMailboxApi, |
|
131 const TMsvId aMailboxId ); |
|
132 |
|
133 /** |
|
134 * Updates last connect info for mailbox |
|
135 * |
|
136 * @since S60 v3.2 |
|
137 * @param aMailboxId: id of the mailbox |
|
138 * @param aSuccessful: ETrue, if successfully connected, EFalse otherwise |
|
139 */ |
|
140 static void SetLastUpdateInfoL( |
|
141 CImumInternalApi& aEmailApi, |
|
142 TMsvId aMailboxId, |
|
143 const TBool& aSuccessful ); |
|
144 |
|
145 public: // Functions from base classes |
|
146 |
|
147 protected: // Constructors |
|
148 protected: // New virtual functions |
|
149 protected: // New functions |
|
150 protected: // Functions from base classes |
|
151 |
|
152 private: // New virtual functions |
|
153 private: // New functions |
|
154 private: // Functions from base classes |
|
155 |
|
156 public: // Data |
|
157 protected: // Data |
|
158 private: // Data |
|
159 }; |
|
160 |
|
161 #include "ImumMboxSettingsUtils.inl" |
|
162 |
|
163 #endif // CIMUMMBOXSETTINGSUTILS_H |
|
164 |
|
165 // End of File |