|
1 /* |
|
2 * Copyright (c) 2002-2004 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: Declarations of the CMceSelectEmailDialog |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __MCESETTINGSEMAILSEL_H__ |
|
21 #define __MCESETTINGSEMAILSEL_H__ |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <msvapi.h> |
|
26 #include <MTMStore.h> |
|
27 #include <TSendingCapabilities.h> |
|
28 #include <e32hashtab.h> |
|
29 |
|
30 // CONSTANTS |
|
31 |
|
32 // MACROS |
|
33 |
|
34 // DATA TYPES |
|
35 |
|
36 // FUNCTION PROTOTYPES |
|
37 |
|
38 // FORWARD DECLARATIONS |
|
39 |
|
40 // CLASS DECLARATION |
|
41 |
|
42 |
|
43 /** |
|
44 * CMceSelectEmailDialog |
|
45 */ |
|
46 class CMceSettingsEmailSel : public CBase, public MMsvSessionObserver |
|
47 { |
|
48 public: // constructors and destructor |
|
49 |
|
50 /** |
|
51 * Two-phased constructor. |
|
52 */ |
|
53 static CMceSettingsEmailSel* NewL(); |
|
54 |
|
55 // Destructor |
|
56 ~CMceSettingsEmailSel(); |
|
57 |
|
58 |
|
59 // from MMsvSessionObserver |
|
60 void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3 ); |
|
61 |
|
62 public: // Methods |
|
63 |
|
64 IMPORT_C static TBool ShowSelectEmailDlgL( TMsvId& aSelectedService, TUid& aMtmType, |
|
65 TSendingCapabilities aRequiredCapabilities = KCapabilitiesForAllServices ); |
|
66 |
|
67 protected: // Methods |
|
68 |
|
69 private: // Methods |
|
70 |
|
71 // Fetch all email mtms |
|
72 void FilterEmailServicesL( |
|
73 CDesCArrayFlat& aListItems, |
|
74 CArrayFix<TUid>& aListItemUids ); |
|
75 |
|
76 // Constructor |
|
77 CMceSettingsEmailSel(); |
|
78 |
|
79 // |
|
80 TBool ShowSelectDlgL( TMsvId& aSelectedService, |
|
81 TUid& aMtmType, |
|
82 TSendingCapabilities aRequiredCapabilities ); |
|
83 |
|
84 // Load the resource for the dll module |
|
85 void LoadResourceL(); |
|
86 |
|
87 // Unload the resource for the dll module |
|
88 void UnLoadResource(); |
|
89 |
|
90 /** |
|
91 * By default Symbian 2nd phase constructor is private. |
|
92 */ |
|
93 void ConstructL(); |
|
94 |
|
95 // validate capabilities |
|
96 TBool QueryCapabilitiesAndValidateAccountL( TUid aMtmUid ); |
|
97 |
|
98 //Functions introduced for CMail changes |
|
99 |
|
100 /** |
|
101 * Function to Append the Cmail Boxes to the mail list |
|
102 */ |
|
103 void AppendCmailBoxesL(CArrayFix<TInt64 >* atimeItems, CMsvEntry* entry); |
|
104 |
|
105 /** |
|
106 * Function to Add the mail Boxes other than default to the mail list |
|
107 */ |
|
108 void AddOtherEmailBoxesL( CDesCArrayFlat& aListItems, |
|
109 CArrayFix<TUid>& aListItemUids, |
|
110 CMsvEntry* aEntry); |
|
111 |
|
112 /** |
|
113 * Function to check if the email entry is healthy or not |
|
114 * returns ETrue if healthy |
|
115 */ |
|
116 TBool IsMailBoxHealthyL(TMsvEntry entry); |
|
117 |
|
118 /** |
|
119 * Function to check if the entry is email entry or not |
|
120 * returns ETrue if email |
|
121 */ |
|
122 TBool IsEmailEntryL(TMsvEntry entry); |
|
123 |
|
124 /** |
|
125 * Function to get and show all mailboxes with cmail also |
|
126 * |
|
127 */ |
|
128 TBool ShowCmailSelectDlgL( TMsvId& aSelectedService, |
|
129 TUid& aMtmType, |
|
130 CDesCArrayFlat* aListItems, |
|
131 CArrayFix<TUid>* aListItemUids |
|
132 ); |
|
133 |
|
134 /** |
|
135 * Function to check if the mail box entry is valid to be |
|
136 * appended or not |
|
137 * returns ETrue if appendable |
|
138 */ |
|
139 TBool IsMailBoxAppendable(TMsvEntry aEntry , TUid* aUid); |
|
140 |
|
141 /** |
|
142 * Function to check if the mail box entry is already added or not |
|
143 * returns EFalse if already added |
|
144 */ |
|
145 TBool IfMailBoxAlreadyAdded(CDesCArrayFlat& aListItems, |
|
146 CDesCArrayFlat* aCmaillist, |
|
147 TMsvEntry aTentry); |
|
148 |
|
149 /** |
|
150 * Function to check if the mail box uid is already added or not |
|
151 * returns EFalse if already added |
|
152 */ |
|
153 TBool IfMailBoxUidAlreadyAdded(CArrayFix<TUid>* aListItemsUids, |
|
154 TMsvEntry aTentry); |
|
155 |
|
156 private: // Data |
|
157 |
|
158 CMsvSession* iMsvSessionPtr; |
|
159 |
|
160 CMtmStore* iMtmStore; |
|
161 |
|
162 TInt iResourceOffset; |
|
163 |
|
164 TSendingCapabilities iRequiredCapabilities; |
|
165 |
|
166 //Variables introduced for CMail changes |
|
167 |
|
168 /** |
|
169 * variable to know if CMail Feature is on or not |
|
170 */ |
|
171 TBool iEmailFramework; |
|
172 |
|
173 /** |
|
174 * Array to hold details of Cmail Mailboxes |
|
175 */ |
|
176 CDesCArrayFlat* iCmaillistItems; |
|
177 |
|
178 /** |
|
179 * Hash table to hold the mapping of cmail boxes with its position in TMsvEntry |
|
180 */ |
|
181 RHashMap<TInt64, TInt >* iCmailBoxes; |
|
182 |
|
183 /** |
|
184 * Array is used to map user selection to correct service in case of CMail |
|
185 */ |
|
186 CArrayFix<TUid>* iCmaillistItemUids ; |
|
187 |
|
188 /* |
|
189 * Variable to hold the default email box index |
|
190 */ |
|
191 TInt iDefaultIndex ; |
|
192 |
|
193 /* |
|
194 * Variable to hold the default email entry |
|
195 */ |
|
196 TMsvEntry iTentryDef; |
|
197 |
|
198 /* |
|
199 * Variable to hold the mtm pluginid in case of platform email application registered |
|
200 */ |
|
201 TInt iMtmPluginID; |
|
202 |
|
203 }; |
|
204 |
|
205 #endif // __MCESETTINGSEMAILSEL_H__ |