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 visualiser definition
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
#ifndef __FREESTYLEEMAILUI_ATTACHMENTSLISTVISUALISER_H__
|
|
21 |
#define __FREESTYLEEMAILUI_ATTACHMENTSLISTVISUALISER_H__
|
|
22 |
|
|
23 |
// SYSTEM INCLUDES
|
|
24 |
//<cmail>
|
|
25 |
#include "fstreelistobserver.h"
|
|
26 |
#include "fsccontactactionmenudefines.h"
|
|
27 |
//</cmail>
|
|
28 |
|
|
29 |
// INTERNAL INCLUDES
|
|
30 |
#include "FreestyleEmailUiViewBase.h"
|
|
31 |
#include "FreestyleEmailUiAttachmentsListModel.h"
|
|
32 |
|
|
33 |
// FORWARD DECLARATIONS
|
|
34 |
class CAlfDeckLayout;
|
|
35 |
class CAlfAnchorLayout;
|
|
36 |
class CFsTreeList;
|
|
37 |
class CFsTreeVisualizerBase;
|
|
38 |
class CFreestyleEmailUiAttachmentsListControl;
|
|
39 |
class CFreestyleEmailUiAppUi;
|
|
40 |
class CFsControlBar;
|
|
41 |
class CFsTreePlainOneLineNodeVisualizer;
|
|
42 |
struct TAttachmentData;
|
|
43 |
|
|
44 |
|
|
45 |
/**
|
|
46 |
* Attachment list visualiser.
|
|
47 |
*/
|
|
48 |
// <cmail>
|
|
49 |
class CFSEmailUiAttachmentsListVisualiser : public CFsEmailUiViewBase,
|
|
50 |
public MFSEmailUiAttachmentsStatusObserver, public MFsTreeListObserver, public MFsActionMenuPositionGiver
|
|
51 |
{
|
|
52 |
// </cmail>
|
|
53 |
public: // constructors and destructor
|
|
54 |
|
|
55 |
/**
|
|
56 |
* Two-phased constructor.
|
|
57 |
*
|
|
58 |
* @param aEnv Reference to Alfred environment.
|
|
59 |
* @param aAppUi Pointer to app ui.
|
|
60 |
* @param aControlGroup Reference to visualiser's control group.
|
|
61 |
*/
|
|
62 |
static CFSEmailUiAttachmentsListVisualiser* NewL( CAlfEnv& aEnv,
|
|
63 |
CFreestyleEmailUiAppUi* aAppUi, CAlfControlGroup& aControlGroup );
|
|
64 |
|
|
65 |
/**
|
|
66 |
* @see CFSEmailUiAttachmentsListVisualiser::NewL
|
|
67 |
*/
|
|
68 |
static CFSEmailUiAttachmentsListVisualiser* NewLC( CAlfEnv& aEnv,
|
|
69 |
CFreestyleEmailUiAppUi* aAppUi, CAlfControlGroup& aControlGroup );
|
|
70 |
|
|
71 |
/** Destructor. */
|
|
72 |
virtual ~CFSEmailUiAttachmentsListVisualiser();
|
|
73 |
|
|
74 |
public: // from CAknView
|
|
75 |
|
|
76 |
// from base class MFsTreeListObserver
|
|
77 |
|
|
78 |
/** Handles events from the tree list. */
|
|
79 |
// <cmail> Touch
|
|
80 |
void TreeListEventL( const TFsTreeListEvent aEvent,
|
|
81 |
const TFsTreeItemId aId,
|
|
82 |
const TPoint& aPoint );
|
|
83 |
TPoint ActionMenuPosition();
|
|
84 |
// </cmail>
|
|
85 |
TUid Id() const;
|
|
86 |
// <cmail> Toolbar
|
|
87 |
/*void DoActivateL( const TVwsViewId& aPrevViewId, TUid aCustomMessageId,
|
|
88 |
const TDesC8& aCustomMessage );*/
|
|
89 |
// </cmail> Toolbar
|
|
90 |
void ChildDoDeactivate();
|
|
91 |
void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
|
|
92 |
|
|
93 |
public: // from CFsEmailUiViewBase
|
|
94 |
|
|
95 |
|
|
96 |
void HandleDynamicVariantSwitchL( TDynamicSwitchType aType );
|
|
97 |
void HandleDynamicVariantSwitchOnBackgroundL( TDynamicSwitchType aType );
|
|
98 |
|
|
99 |
void GetParentLayoutsL( RPointerArray<CAlfVisual>& aLayoutArray ) const;
|
|
100 |
|
|
101 |
public: // from MFSEmailUiAttachmentsStatusObserver
|
|
102 |
|
|
103 |
void DownloadStatusChangedL( TInt aIndex );
|
|
104 |
|
|
105 |
|
|
106 |
|
|
107 |
public: // new methods
|
|
108 |
|
|
109 |
// Mail list current model data
|
|
110 |
CFSEmailUiAttachmentsListModel* Model();
|
|
111 |
|
|
112 |
// Sets softkeys
|
|
113 |
void SetViewSoftkeysL( TInt aResourceId );
|
|
114 |
|
|
115 |
void CreateHeadersAndSeparatorsL();
|
|
116 |
void MoveItemToNodeL( TFsTreeItemId aItemId, TFsTreeItemId aTargetNodeId );
|
|
117 |
void SetMskL();
|
|
118 |
// Event handling forwarded from control
|
|
119 |
TBool OfferEventL( const TAlfEvent& aEvent );
|
|
120 |
void HandleCommandL( TInt aCommand );
|
|
121 |
|
|
122 |
void HandleMailBoxEventL( TFSMailEvent aEvent, TFSMailMsgId aMailbox,
|
|
123 |
TAny* aParam1, TAny* aParam2, TAny* aParam3 );
|
|
124 |
|
|
125 |
// <cmail> Toolbar
|
|
126 |
private: // from
|
|
127 |
|
|
128 |
/**
|
|
129 |
* @see CFsEmailUiViewBase::ChildDoActivateL
|
|
130 |
*/
|
|
131 |
void ChildDoActivateL( const TVwsViewId& aPrevViewId,
|
|
132 |
TUid aCustomMessageId,
|
|
133 |
const TDesC8& aCustomMessage );
|
|
134 |
|
|
135 |
/**
|
|
136 |
* @see CFsEmailUiViewBase::OfferToolbarEventL
|
|
137 |
*/
|
|
138 |
void OfferToolbarEventL( TInt aCommand );
|
|
139 |
|
|
140 |
/**
|
|
141 |
* @see CFsEmailUiViewBase::ToolbarResourceId
|
|
142 |
*/
|
|
143 |
TInt ToolbarResourceId() const;
|
|
144 |
// </cmail> Toolbar
|
|
145 |
|
|
146 |
private: // constructors
|
|
147 |
|
|
148 |
// C++ Constructor.
|
|
149 |
CFSEmailUiAttachmentsListVisualiser( CAlfEnv& aEnv,
|
|
150 |
CFreestyleEmailUiAppUi& aAppUi, CAlfControlGroup& aControlGroup );
|
|
151 |
// Second phase constructor.
|
|
152 |
void ConstructL();
|
|
153 |
|
|
154 |
private: // new methods
|
|
155 |
|
|
156 |
// Refresh list, recreates it from empty
|
|
157 |
void RefreshL( TPartData aPart );
|
|
158 |
|
|
159 |
void ReScaleUiL();
|
|
160 |
void ResetColorsL();
|
|
161 |
|
|
162 |
TBool IsCommandAvailableOnItem( TInt aCommandId, const TAttachmentData* aFocusedItem ) const;
|
|
163 |
HBufC* CreateSecondLineTextLC( const TAttachmentData& aAttachment ) const;
|
|
164 |
void TryToOpenItemL( TFsTreeItemId aId );
|
|
165 |
void RemoveAttachmentContentL( TFsTreeItemId aId );
|
|
166 |
|
|
167 |
// launches action menu
|
|
168 |
void LaunchActionMenuL();
|
|
169 |
|
|
170 |
void ShortcutCollapseExpandAllToggleL();
|
|
171 |
void GoToTopL();
|
|
172 |
void GoToBottomL();
|
|
173 |
|
|
174 |
void SetupTitlePaneTextL();
|
|
175 |
|
|
176 |
//<cmail> Not used anywhere anymore.
|
|
177 |
|
|
178 |
//</cmail>
|
|
179 |
CAlfControl* ViewerControl();
|
|
180 |
|
|
181 |
void DoFirstStartL();
|
|
182 |
void UpdateSize();
|
|
183 |
|
|
184 |
//<cmail> touch
|
|
185 |
void DoHandleActionL( );
|
|
186 |
//</cmail> touch
|
|
187 |
|
|
188 |
private: // data
|
|
189 |
|
|
190 |
// Reference to Alf environment
|
|
191 |
CAlfEnv& iEnv;
|
|
192 |
|
|
193 |
// Screen control
|
|
194 |
CFreestyleEmailUiAttachmentsListControl* iScreenControl;
|
|
195 |
|
|
196 |
CFSEmailUiAttachmentsListModel* iModel;
|
|
197 |
CFsTreeList* iAttachmentsList;
|
|
198 |
CAlfDeckLayout* iListLayout;
|
|
199 |
CAlfAnchorLayout* iAnchorLayout;
|
|
200 |
CFsTreeVisualizerBase* iAttachmentsTreeListVisualizer;
|
|
201 |
|
|
202 |
TFsTreeItemId iDownloadedNode;
|
|
203 |
TFsTreeItemId iNotDownloadedNode;
|
|
204 |
|
|
205 |
// <cmail> Prevent Download Manager opening with attachments
|
|
206 |
//TFsTreeItemId iDownloadManagerLink;
|
|
207 |
// </cmail>
|
|
208 |
|
|
209 |
//not owned
|
|
210 |
CFsTreePlainOneLineNodeVisualizer* iDownloadedVisualiser;
|
|
211 |
//not owned
|
|
212 |
CFsTreePlainOneLineNodeVisualizer* iNotDownloadedVisualiser;
|
|
213 |
|
|
214 |
// The text shown in the title pane when this view was activated
|
|
215 |
//<cmail> removed as not used anywhere.
|
|
216 |
|
|
217 |
//</cmail>
|
|
218 |
TBool iFirstStartCompleted;
|
|
219 |
// Flag for embedded message mode
|
|
220 |
TBool iEmbeddedMsgMode;
|
|
221 |
};
|
|
222 |
|
|
223 |
|
|
224 |
#endif
|