60
|
1 |
/*
|
|
2 |
* Copyright (c) 2008-2009 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: Upload commmand handler
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef __GLXCOMMANDHANDLERUPLOAD_H__
|
|
19 |
#define __GLXCOMMANDHANDLERUPLOAD_H__
|
|
20 |
|
|
21 |
|
|
22 |
// EXTERNAL INCLUDES
|
|
23 |
#include "AiwServiceHandler.h" // AIW service handler
|
|
24 |
#include <centralrepository.h> // for checking the ShareOnline version
|
|
25 |
|
|
26 |
// INTERNAL INCLUDES
|
|
27 |
#include "glxmedialistcommandhandler.h" // for MediaListCommandHandler
|
|
28 |
#include <glxuiutility.h> // for UiUtility
|
|
29 |
|
|
30 |
// FORWARD DECLARATIONS
|
|
31 |
class MGlxMediaListProvider;
|
|
32 |
class CGlxDefaultAttributeContext;
|
|
33 |
class CGlxUploadCenRepWatcher;
|
|
34 |
class CSvgEngineInterfaceImpl;
|
|
35 |
|
|
36 |
// For upload icon change notification
|
|
37 |
class MGlxUploadIconObserver
|
|
38 |
{
|
|
39 |
public:
|
|
40 |
/**
|
|
41 |
* Handle upload icon changes
|
|
42 |
*/
|
|
43 |
virtual void HandleUploadIconChangedL( ) = 0;
|
|
44 |
};
|
|
45 |
|
|
46 |
/**
|
|
47 |
* Command handler that launches Upload AIW ShareOnline
|
|
48 |
* @class CGlxCommandHandlerUpload
|
|
49 |
* @author Abhijit S
|
|
50 |
*/
|
|
51 |
|
|
52 |
// CLASS DECLARATION
|
|
53 |
|
|
54 |
NONSHARABLE_CLASS (CGlxCommandHandlerUpload) : public CGlxMediaListCommandHandler,
|
|
55 |
public MGlxMediaListObserver, public MGlxUploadIconObserver
|
|
56 |
{
|
|
57 |
public: // Constructors and destructor
|
|
58 |
/**
|
|
59 |
* Two-phased constructor.
|
|
60 |
* @param aMediaListProvider pointer to media list owner
|
|
61 |
* @param aHasToolbarItem Whether Command Should be toolbar item (ETrue - if toolbar item)
|
|
62 |
* @return pointer to CGlxCommandHandlerUpload object
|
|
63 |
*/
|
|
64 |
IMPORT_C static CGlxCommandHandlerUpload* NewL(MGlxMediaListProvider*
|
|
65 |
aMediaListProvider, TBool aHasToolbarItem);
|
|
66 |
|
|
67 |
/**
|
|
68 |
* Destructor.
|
|
69 |
*/
|
|
70 |
IMPORT_C ~CGlxCommandHandlerUpload();
|
|
71 |
|
|
72 |
/**
|
|
73 |
* To set the Help Text for Upload button on toolbar
|
|
74 |
*/
|
|
75 |
void SetToolTipL();
|
|
76 |
|
|
77 |
|
|
78 |
public: // From MGlxMediaListObserver
|
|
79 |
void HandleItemAddedL(TInt aStartIndex, TInt aEndIndex,
|
|
80 |
MGlxMediaList* aList);
|
|
81 |
|
|
82 |
void HandleMediaL(TInt aListIndex, MGlxMediaList* aList);
|
|
83 |
|
|
84 |
void HandleItemRemovedL(TInt aStartIndex, TInt aEndIndex,
|
|
85 |
MGlxMediaList* aList);
|
|
86 |
void HandleItemModifiedL(const RArray<TInt>& aItemIndexes,
|
|
87 |
MGlxMediaList* aList);
|
|
88 |
void HandleAttributesAvailableL(TInt aItemIndex,
|
|
89 |
const RArray<TMPXAttribute>& aAttributes, MGlxMediaList* aList);
|
|
90 |
void HandleFocusChangedL(NGlxListDefs::TFocusChangeType aType,
|
|
91 |
TInt aNewIndex, TInt aOldIndex, MGlxMediaList* aList);
|
|
92 |
void HandleItemSelectedL(TInt aIndex, TBool aSelected, MGlxMediaList* aList);
|
|
93 |
void HandleMessageL(const CMPXMessage& aMessage, MGlxMediaList* aList);
|
|
94 |
void HandlePopulatedL(MGlxMediaList* aList);
|
|
95 |
|
|
96 |
public: // from MGlxUploadIconObserver
|
|
97 |
/**
|
|
98 |
* @ref MGlxUploadIconObserver::HandleUploadIconChangedL
|
|
99 |
*/
|
|
100 |
void HandleUploadIconChangedL( );
|
|
101 |
|
|
102 |
protected:
|
|
103 |
//@ref From CGlxCommandHandler
|
|
104 |
void PopulateToolbarL();
|
|
105 |
|
|
106 |
private:
|
|
107 |
/**
|
|
108 |
* Symbian 2nd phase constructor
|
|
109 |
*/
|
|
110 |
void ConstructL();
|
|
111 |
|
|
112 |
/**
|
|
113 |
* C++ default constructor.
|
|
114 |
* @param aMediaListProvider pointer to media list owner
|
|
115 |
* @param aHasToolbarItem Whether Command Should be toolbar item (ETrue - if toolbar item)
|
|
116 |
* @ref CGlxMediaListCommandHandler
|
|
117 |
*/
|
|
118 |
CGlxCommandHandlerUpload(MGlxMediaListProvider* aMediaListProvider, TBool aHasToolbarItem);
|
|
119 |
|
|
120 |
/**
|
|
121 |
* Gets the tooltip text or the Help Text from AIWServiceHandler
|
|
122 |
*/
|
|
123 |
void GetToolTipL(HBufC*& aToolTipText);
|
|
124 |
|
|
125 |
private: // From CGlxMediaListCommandHandler
|
|
126 |
/**
|
|
127 |
* Execute the command, if applicable.
|
|
128 |
* @param aCommand The command to handle
|
|
129 |
* @param aList List of media items
|
|
130 |
* @return ETrue if command was handled, EFalse otherwise
|
|
131 |
* @ref CGlxMediaListCommandHandler
|
|
132 |
*/
|
|
133 |
TBool DoExecuteL (TInt aCommandId, MGlxMediaList& aList);
|
|
134 |
|
|
135 |
/**
|
|
136 |
* Called when the owning view is activated
|
|
137 |
* @param aViewId The ID of the view
|
|
138 |
* @ref CGlxMediaListCommandHandler
|
|
139 |
*/
|
|
140 |
void DoActivateL (TInt aViewId);
|
|
141 |
|
|
142 |
/**
|
|
143 |
* Called when the owning view is deactivated
|
|
144 |
*/
|
|
145 |
void Deactivate();
|
|
146 |
|
|
147 |
private:
|
|
148 |
/**
|
|
149 |
* Retrieve the currently selected items file name and path
|
|
150 |
* @return The currently selected items filename and path
|
|
151 |
*/
|
|
152 |
|
|
153 |
void AppendSelectedFilesL(CAiwGenericParamList& aInputParams);
|
|
154 |
|
|
155 |
/**
|
|
156 |
* To check whether OneClickUpload is supported by the Shareonline
|
|
157 |
* application.
|
|
158 |
* NOTE: OneClickUpload is a feature of ShareOnline 4.3 and above. Hence this function
|
|
159 |
* ensures that the upload command works only if this version of ShareOnline is
|
|
160 |
* available in the build. Else, Upload will not work!
|
|
161 |
*/
|
|
162 |
void CheckVersionL();
|
|
163 |
|
|
164 |
/**
|
|
165 |
* To attach the aiw share interest resource to the servicehandler
|
|
166 |
*/
|
|
167 |
void InitializeOneClickUploadL();
|
|
168 |
|
|
169 |
/**
|
|
170 |
* To check whether its is fullscreen view
|
|
171 |
*/
|
|
172 |
TBool IsFullScreenViewL();
|
|
173 |
|
|
174 |
/**
|
|
175 |
* Disable/Enable the upload toolbar item
|
|
176 |
*/
|
|
177 |
void DisableUploadToolbarItem(TBool aDimmed);
|
|
178 |
|
|
179 |
/**
|
|
180 |
* Updates the selection count based on the mimetypes
|
|
181 |
*/
|
|
182 |
void UpdateSelectionCount(TInt aIndex, TBool aSelected, MGlxMediaList* aList);
|
|
183 |
|
|
184 |
/**
|
|
185 |
* Gets the Icon path and fileName from the cenrep
|
|
186 |
*/
|
|
187 |
void GetIconNameL(TDes& aUplaodIconName);
|
|
188 |
|
|
189 |
/**
|
|
190 |
* Decodes the Icon using the SVG Engine
|
|
191 |
*/
|
|
192 |
void DecodeIconL(const TDes& aUplaodIconName);
|
|
193 |
|
|
194 |
|
|
195 |
/**
|
|
196 |
* Updates the Toolbar upload icon based on the current selection
|
|
197 |
*/
|
|
198 |
void UpdateFSUploadIconL();
|
|
199 |
|
|
200 |
private: // data
|
|
201 |
|
|
202 |
//Cenrep watcher for monitoring the icon changes
|
|
203 |
CGlxUploadCenRepWatcher* iUploadCenRepWatcher;
|
|
204 |
|
|
205 |
// ID of owning view
|
|
206 |
TInt iViewId;
|
|
207 |
|
|
208 |
// True if ShareOnline versioned 4.3 and above is present in the build
|
|
209 |
TBool iUploadSupported;
|
|
210 |
|
|
211 |
// Not owned - Provider of media list
|
|
212 |
MGlxMediaListProvider* iMediaListProvider;
|
|
213 |
|
|
214 |
// Not owned - UI utility
|
|
215 |
CGlxUiUtility* iUiUtility;
|
|
216 |
|
|
217 |
// Owned - AIW Service Handler
|
|
218 |
CAiwServiceHandler* iServiceHandler;
|
|
219 |
|
|
220 |
//Keep the count of no. of images/videos selected
|
|
221 |
TInt iSelectedImageCount;
|
|
222 |
TInt iSelectedVideoCount;
|
|
223 |
|
|
224 |
//keep track of current icon used
|
|
225 |
enum TCenRepMonitors
|
|
226 |
{
|
|
227 |
EMonitorNone,
|
|
228 |
EImageMonitor,
|
|
229 |
EVideoMonitor,
|
|
230 |
EImageVideoMonitor
|
|
231 |
};
|
|
232 |
|
|
233 |
TCenRepMonitors iCurrentCenRepMonitor;
|
|
234 |
|
|
235 |
//Toolbar instance of current view
|
|
236 |
CAknToolbar* iToolbar;
|
|
237 |
|
|
238 |
//To check if we are in fullscreen
|
|
239 |
TBool iIsFullScreenView;
|
|
240 |
|
|
241 |
CSvgEngineInterfaceImpl* iSvgEngine;
|
|
242 |
};
|
|
243 |
|
|
244 |
#endif //__GLXCOMMANDHANDLERUPLOAD_H__
|