|
1 /* |
|
2 * Copyright (c) 2007 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: FreestyleEmailUi attachments list control class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef FREESTYLEMAILUI_SENDATTACHMENTSLISTCONTROL_H_ |
|
21 #define FREESTYLEMAILUI_SENDATTACHMENTSLISTCONTROL_H_ |
|
22 |
|
23 #include <MsgAttachmentUtils.h> |
|
24 |
|
25 // LOCAL INCLUDES |
|
26 #include "FreestyleEmailUiAttachmentsListModel.h" |
|
27 #include "fsccontactactionmenudefines.h" |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CFSEmailUiSendAttachmentsListVisualiser; |
|
31 class CFSEmailUiSendAttachmentsListModel; |
|
32 class CFreestyleEmailUiAppUi; |
|
33 class CGulIcon; |
|
34 class CFscContactActionService; |
|
35 class CFscContactActionMenu; |
|
36 class CFSEmailUiSendAttachmentsListModelItem; |
|
37 class CAknWaitNote; |
|
38 |
|
39 /** |
|
40 * CFsGenericListAppUi application UI class. |
|
41 * Interacts with the user through the UI and request message processing |
|
42 * from the handler class |
|
43 */ |
|
44 // <cmail> |
|
45 class CFreestyleEmailUiSendAttachmentsListControl |
|
46 : public CAlfControl, public MFsActionMenuPositionGiver, public MMGFetchVerifier |
|
47 { |
|
48 // </cmail> |
|
49 public: |
|
50 |
|
51 /** |
|
52 * Two-phased constructor. |
|
53 * |
|
54 * @param aEnv Reference to the ALF environment. |
|
55 */ |
|
56 static CFreestyleEmailUiSendAttachmentsListControl* NewL( |
|
57 CAlfEnv& aEnv, |
|
58 CFSEmailUiSendAttachmentsListVisualiser* aVisualiser, |
|
59 CFreestyleEmailUiAppUi* aAppUi ); |
|
60 |
|
61 /** |
|
62 * Two-phased constructor. |
|
63 * |
|
64 * @param aEnv Reference to the ALF environment. |
|
65 */ |
|
66 static CFreestyleEmailUiSendAttachmentsListControl* NewLC( |
|
67 CAlfEnv& aEnv, |
|
68 CFSEmailUiSendAttachmentsListVisualiser* aVisualiser, |
|
69 CFreestyleEmailUiAppUi* aAppUi ); |
|
70 |
|
71 |
|
72 /** |
|
73 * Virtual destructor. |
|
74 */ |
|
75 virtual ~CFreestyleEmailUiSendAttachmentsListControl(); |
|
76 |
|
77 // <cmail> |
|
78 public: // from MMGFetchVerifier |
|
79 TBool VerifySelectionL( const MDesCArray* aSelectedFiles ); |
|
80 // </cmail> |
|
81 |
|
82 public: // new methods |
|
83 |
|
84 /** |
|
85 * OfferEventL |
|
86 * From ALF |
|
87 */ |
|
88 TBool OfferEventL( const TAlfEvent& aEvent ); |
|
89 |
|
90 /** |
|
91 * AppendAttachmentToListL |
|
92 * Adds new attachment to list and email body |
|
93 * @param aType Type of attachment to add |
|
94 * |
|
95 * @return ETrue if attachment was added. |
|
96 * EFalse if user cancelled or operation failed. |
|
97 */ |
|
98 TBool AppendAttachmentToListL(MsgAttachmentUtils::TMsgAttachmentFetchType aType = MsgAttachmentUtils::EUnknown); |
|
99 |
|
100 /** |
|
101 * AppendFileToModelL |
|
102 * Adds new file to list model |
|
103 */ |
|
104 void AppendFileToModelL( |
|
105 const TFSMailMsgId aPartId, |
|
106 const TDesC& aFileName, |
|
107 TInt aSize, |
|
108 TFileType aFileType = EUnidentifiedType, |
|
109 TBool aReadOnly = EFalse, |
|
110 TBool aRemoteFile = EFalse ); |
|
111 |
|
112 /** |
|
113 * TotalAttachmentSize |
|
114 * Return total size of a attachments in the model |
|
115 */ |
|
116 TInt TotalAttachmentSize() const; |
|
117 |
|
118 /** |
|
119 * RemoveAttachmentFromListL |
|
120 * removes item by given index |
|
121 * or |
|
122 * removes currently highlighted item from model |
|
123 */ |
|
124 void RemoveAttachmentFromListL( const TInt aIndex = -1 ); |
|
125 |
|
126 /** |
|
127 * RemoveAllAttachmentsL |
|
128 * Removes all items from model |
|
129 */ |
|
130 void RemoveAllAttachmentsL(); |
|
131 |
|
132 /** |
|
133 * OpenHighlightedFileL |
|
134 */ |
|
135 void OpenHighlightedFileL(); |
|
136 |
|
137 /** |
|
138 * Model |
|
139 * Retuns pointer to list model |
|
140 */ |
|
141 CFSEmailUiSendAttachmentsListModel* Model(); |
|
142 |
|
143 /** |
|
144 * DeleteModel |
|
145 * Deletes model, used from visualiser because of alf dest sequence |
|
146 */ |
|
147 void DeleteModel(); |
|
148 |
|
149 //<cmail> touch |
|
150 /** |
|
151 * Helper class for setting msk up to date. |
|
152 */ |
|
153 void SetMskL(); |
|
154 |
|
155 /** |
|
156 * ShowActionMenu |
|
157 * Displays popup menu when user hits right with joystick |
|
158 * and handles selected command |
|
159 */ |
|
160 void ShowActionMenuL( CFSEmailUiSendAttachmentsListModelItem* aItem ); |
|
161 //</cmail> |
|
162 |
|
163 |
|
164 public: // methods from base classes |
|
165 |
|
166 /** |
|
167 * From CCoeControl |
|
168 */ |
|
169 void HandleCommandL( TInt aCommand ); |
|
170 |
|
171 // <cmail> |
|
172 /** |
|
173 * From MFsActionMenuPositionGiver |
|
174 */ |
|
175 TPoint ActionMenuPosition(); |
|
176 // </cmail> |
|
177 |
|
178 private: // constructors |
|
179 |
|
180 /** |
|
181 * Constructor. |
|
182 * |
|
183 * @param aEnv Reference to the ALF environment. |
|
184 * @param aVisualiser Reference to visualiser for command handling. |
|
185 */ |
|
186 CFreestyleEmailUiSendAttachmentsListControl( |
|
187 CFSEmailUiSendAttachmentsListVisualiser* aVisualiser, |
|
188 CFreestyleEmailUiAppUi* aAppUi ); |
|
189 |
|
190 /** |
|
191 * Two-phased constructor. |
|
192 */ |
|
193 void ConstructL(CAlfEnv& aEnv); |
|
194 |
|
195 private: // methods used internally |
|
196 |
|
197 /** |
|
198 * LoadModelContentL |
|
199 * Loads draft email attachments to model |
|
200 */ |
|
201 void LoadModelContentL(); |
|
202 |
|
203 //<cmail> touch |
|
204 /** |
|
205 * ShowActionMenu |
|
206 * Displays popup menu when user hits right with joystick |
|
207 * and handles selected command |
|
208 */ |
|
209 //void ShowActionMenuL( CFSEmailUiSendAttachmentsListModelItem* aItem ); |
|
210 //</cmail> touch |
|
211 |
|
212 /** |
|
213 * FileDrmProtectedL |
|
214 */ |
|
215 TBool FileDrmProtectedL( RFile& aFile ); |
|
216 |
|
217 /** |
|
218 * FileDrmProtectedL |
|
219 */ |
|
220 TBool FileDrmProtectedL( const TDesC& aFilePath ); |
|
221 |
|
222 private: // data |
|
223 |
|
224 // Visualizer. Not owned. |
|
225 CFSEmailUiSendAttachmentsListVisualiser* iVisualiser; |
|
226 |
|
227 // Model. Owned. |
|
228 CFSEmailUiSendAttachmentsListModel* iModel; |
|
229 |
|
230 // AppUi. Not owned. |
|
231 CFreestyleEmailUiAppUi* iAppUi; |
|
232 |
|
233 // Contact action service. Owned. |
|
234 CFscContactActionService* iService; |
|
235 |
|
236 // Wait note for long running operations. Owns itself. |
|
237 CAknWaitDialog* iWaitNote; |
|
238 }; |
|
239 |
|
240 #endif /*FREESTYLEMAILUI_SENDATTACHMENTSLISTCONTROL_H_*/ |