64
|
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 |
TBool IsAttachmentAddingLocked() const;
|
|
91 |
|
|
92 |
/**
|
|
93 |
* AppendAttachmentToListL
|
|
94 |
* Adds new attachment to list and email body
|
|
95 |
* @param aType Type of attachment to add
|
|
96 |
*
|
|
97 |
* @return ETrue if attachment was added.
|
|
98 |
* EFalse if user cancelled or operation failed.
|
|
99 |
*/
|
|
100 |
TBool AppendAttachmentToListL(MsgAttachmentUtils::TMsgAttachmentFetchType aType = MsgAttachmentUtils::EUnknown);
|
|
101 |
|
|
102 |
/**
|
|
103 |
* AppendFileToModelL
|
|
104 |
* Adds new file to list model
|
|
105 |
*/
|
|
106 |
void AppendFileToModelL(
|
|
107 |
const TFSMailMsgId aPartId,
|
|
108 |
const TDesC& aFileName,
|
|
109 |
TInt aSize,
|
|
110 |
TFileType aFileType = EUnidentifiedType,
|
|
111 |
TBool aReadOnly = EFalse,
|
|
112 |
TBool aRemoteFile = EFalse );
|
|
113 |
|
|
114 |
/**
|
|
115 |
* TotalAttachmentSize
|
|
116 |
* Return total size of a attachments in the model
|
|
117 |
*/
|
|
118 |
TInt TotalAttachmentSize() const;
|
|
119 |
|
|
120 |
/**
|
|
121 |
* RemoveAttachmentFromListL
|
|
122 |
* removes item by given index
|
|
123 |
* or
|
|
124 |
* removes currently highlighted item from model
|
|
125 |
*/
|
|
126 |
void RemoveAttachmentFromListL( const TInt aIndex = -1 );
|
|
127 |
|
|
128 |
/**
|
|
129 |
* RemoveAllAttachmentsL
|
|
130 |
* Removes all items from model
|
|
131 |
*/
|
|
132 |
void RemoveAllAttachmentsL();
|
|
133 |
|
|
134 |
/**
|
|
135 |
* OpenHighlightedFileL
|
|
136 |
*/
|
|
137 |
void OpenHighlightedFileL();
|
|
138 |
|
|
139 |
/**
|
|
140 |
* Model
|
|
141 |
* Retuns pointer to list model
|
|
142 |
*/
|
|
143 |
CFSEmailUiSendAttachmentsListModel* Model();
|
|
144 |
|
|
145 |
/**
|
|
146 |
* DeleteModel
|
|
147 |
* Deletes model, used from visualiser because of alf dest sequence
|
|
148 |
*/
|
|
149 |
void DeleteModel();
|
|
150 |
|
|
151 |
//<cmail> touch
|
|
152 |
/**
|
|
153 |
* Helper class for setting msk up to date.
|
|
154 |
*/
|
|
155 |
void SetMskL();
|
|
156 |
|
|
157 |
/**
|
|
158 |
* ShowActionMenu
|
|
159 |
* Displays popup menu when user hits right with joystick
|
|
160 |
* and handles selected command
|
|
161 |
*/
|
|
162 |
void ShowActionMenuL( CFSEmailUiSendAttachmentsListModelItem* aItem );
|
|
163 |
//</cmail>
|
|
164 |
|
|
165 |
|
|
166 |
public: // methods from base classes
|
|
167 |
|
|
168 |
/**
|
|
169 |
* From CCoeControl
|
|
170 |
*/
|
|
171 |
void HandleCommandL( TInt aCommand );
|
|
172 |
|
|
173 |
// <cmail>
|
|
174 |
/**
|
|
175 |
* From MFsActionMenuPositionGiver
|
|
176 |
*/
|
|
177 |
TPoint ActionMenuPosition();
|
|
178 |
// </cmail>
|
|
179 |
|
|
180 |
private: // constructors
|
|
181 |
|
|
182 |
/**
|
|
183 |
* Constructor.
|
|
184 |
*
|
|
185 |
* @param aEnv Reference to the ALF environment.
|
|
186 |
* @param aVisualiser Reference to visualiser for command handling.
|
|
187 |
*/
|
|
188 |
CFreestyleEmailUiSendAttachmentsListControl(
|
|
189 |
CFSEmailUiSendAttachmentsListVisualiser* aVisualiser,
|
|
190 |
CFreestyleEmailUiAppUi* aAppUi );
|
|
191 |
|
|
192 |
/**
|
|
193 |
* Two-phased constructor.
|
|
194 |
*/
|
|
195 |
void ConstructL(CAlfEnv& aEnv);
|
|
196 |
|
|
197 |
private: // methods used internally
|
|
198 |
|
|
199 |
/**
|
|
200 |
* LoadModelContentL
|
|
201 |
* Loads draft email attachments to model
|
|
202 |
*/
|
|
203 |
void LoadModelContentL();
|
|
204 |
|
|
205 |
//<cmail> touch
|
|
206 |
/**
|
|
207 |
* ShowActionMenu
|
|
208 |
* Displays popup menu when user hits right with joystick
|
|
209 |
* and handles selected command
|
|
210 |
*/
|
|
211 |
//void ShowActionMenuL( CFSEmailUiSendAttachmentsListModelItem* aItem );
|
|
212 |
//</cmail> touch
|
|
213 |
|
|
214 |
/**
|
|
215 |
* FileDrmProtectedL
|
|
216 |
*/
|
|
217 |
TBool FileDrmProtectedL( RFile& aFile );
|
|
218 |
|
|
219 |
/**
|
|
220 |
* FileDrmProtectedL
|
|
221 |
*/
|
|
222 |
TBool FileDrmProtectedL( const TDesC& aFilePath );
|
|
223 |
|
|
224 |
private: // data
|
|
225 |
|
|
226 |
// Visualizer. Not owned.
|
|
227 |
CFSEmailUiSendAttachmentsListVisualiser* iVisualiser;
|
|
228 |
|
|
229 |
// Model. Owned.
|
|
230 |
CFSEmailUiSendAttachmentsListModel* iModel;
|
|
231 |
|
|
232 |
// AppUi. Not owned.
|
|
233 |
CFreestyleEmailUiAppUi* iAppUi;
|
|
234 |
|
|
235 |
// Contact action service. Owned.
|
|
236 |
CFscContactActionService* iService;
|
|
237 |
|
|
238 |
// Wait note for long running operations. Owns itself.
|
|
239 |
CAknWaitDialog* iWaitNote;
|
|
240 |
|
|
241 |
// adding attachment locked
|
|
242 |
TBool iAttachmentAddingLocked;
|
|
243 |
|
|
244 |
};
|
|
245 |
|
|
246 |
#endif /*FREESTYLEMAILUI_SENDATTACHMENTSLISTCONTROL_H_*/
|