|
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: Send commmand handler |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __GLXCOMMANDHANDLERUPLSEND_H__ |
|
22 #define __GLXCOMMANDHANDLERUPLSEND_H__ |
|
23 |
|
24 |
|
25 // EXTERNAL INCLUDES |
|
26 |
|
27 #include <TSendingCapabilities.h> |
|
28 |
|
29 // INTERNAL INCLUDES |
|
30 #include "glxmedialistcommandhandler.h" |
|
31 |
|
32 |
|
33 // FORWARD DECLARATIONS |
|
34 class MGlxMediaListProvider; |
|
35 class CGlxUiUtility; |
|
36 class CGlxDefaultAttributeContext; |
|
37 class CMessageData; |
|
38 class CGlxMedia; |
|
39 class CSendUi; |
|
40 |
|
41 |
|
42 // CLASS DECLARATION |
|
43 /** |
|
44 * Command handler that enables the send plugin |
|
45 * class CGlxCommandHandlerSend |
|
46 * @author Loughlin Spollen |
|
47 * @internal reviewed 07/06/2007 by Alex Birkett |
|
48 */ |
|
49 |
|
50 NONSHARABLE_CLASS (CGlxCommandHandlerSend) : public CGlxMediaListCommandHandler, |
|
51 public MGlxMediaListObserver |
|
52 { |
|
53 public: // Constructors and destructor |
|
54 /** |
|
55 * Two-phased constructor. |
|
56 * @param aMediaListProvider pointer to media list owner |
|
57 * @param aHasToolbarItem Whether Command Should be toolbar item (ETrue - if toolbar item) |
|
58 * @return pointer to CGlxCommandHandlerSend object |
|
59 */ |
|
60 IMPORT_C static CGlxCommandHandlerSend* NewL( |
|
61 MGlxMediaListProvider* aMediaListProvider, TBool aHasToolbarItem ); |
|
62 |
|
63 /** |
|
64 * Destructor. |
|
65 */ |
|
66 IMPORT_C ~CGlxCommandHandlerSend(); |
|
67 |
|
68 protected: |
|
69 /* |
|
70 * |
|
71 */ |
|
72 void PopulateToolbarL(); |
|
73 |
|
74 private: |
|
75 /** |
|
76 * Symbian 2nd phase constructor |
|
77 */ |
|
78 void ConstructL(); |
|
79 |
|
80 /** |
|
81 * C++ default constructor. |
|
82 * @param aMediaListProvider pointer to media list owner |
|
83 * @ref CGlxMediaListCommandHandler |
|
84 */ |
|
85 CGlxCommandHandlerSend(MGlxMediaListProvider* aMediaListProvider, TBool aHasToolbarItem ); |
|
86 |
|
87 |
|
88 private: // From CGlxMediaListCommandHandler |
|
89 /** |
|
90 * Execute the command, if applicable. |
|
91 * @param aCommand The command to handle |
|
92 * @param aList List of media items |
|
93 * @return ETrue if command was handled, EFalse otherwise |
|
94 * @ref CGlxMediaListCommandHandler::DoExecuteL |
|
95 */ |
|
96 TBool DoExecuteL (TInt aCommandId, MGlxMediaList& aList); |
|
97 |
|
98 /** |
|
99 * Called when the owning view is activated |
|
100 * @param aViewId The ID of the view |
|
101 * @ref CGlxMediaListCommandHandler::ActivateL |
|
102 */ |
|
103 void DoActivateL (TInt aViewId); |
|
104 |
|
105 /** |
|
106 * Called when the owning view is deactivated |
|
107 */ |
|
108 void Deactivate(); |
|
109 |
|
110 /** |
|
111 * @ref CGlxMediaListCommandHandler::OfferKeyEventL |
|
112 */ |
|
113 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType); |
|
114 |
|
115 private: // From MGlxMediaListObserver |
|
116 |
|
117 /** |
|
118 * not implemented |
|
119 * @ref MGlxMediaListObserver::HandleItemAddedL |
|
120 */ |
|
121 void HandleItemAddedL(TInt /*aStartIndex*/, TInt /*aEndIndex*/, |
|
122 MGlxMediaList* /*aList*/){}; |
|
123 /** |
|
124 * not implemented |
|
125 * @ref MGlxMediaListObserver::HandleMediaL |
|
126 */ |
|
127 void HandleMediaL(TInt /*aListIndex*/, MGlxMediaList* /*aList*/){}; |
|
128 |
|
129 /** |
|
130 * not implemented |
|
131 * @ref MGlxMediaListObserver::HandleItemRemovedL |
|
132 */ |
|
133 void HandleItemRemovedL(TInt /*aStartIndex*/, TInt /*aEndIndex*/, |
|
134 MGlxMediaList* /*aList*/){}; |
|
135 |
|
136 /** |
|
137 * not implemented |
|
138 * @ref MGlxMediaListObserver::HandleItemModifiedL |
|
139 */ |
|
140 void HandleItemModifiedL(const RArray<TInt>& /*aItemIndexes*/, |
|
141 MGlxMediaList* /*aList*/){}; |
|
142 |
|
143 /** |
|
144 * not implemented |
|
145 * @ref MGlxMediaListObserver::HandleAttributesAvailableL |
|
146 */ |
|
147 void HandleAttributesAvailableL(TInt /*aItemIndex*/, |
|
148 const RArray<TMPXAttribute>& /*aAttributes*/, |
|
149 MGlxMediaList* /*aList*/){}; |
|
150 |
|
151 /** |
|
152 * is implemented - used to trigger an update of the visible state send |
|
153 * active palette item |
|
154 * @ref MGlxMediaListObserver::HandleFocusChangedL |
|
155 */ |
|
156 void HandleFocusChangedL(NGlxListDefs::TFocusChangeType aType, TInt aNewIndex, |
|
157 TInt aOldIndex, MGlxMediaList* aList); |
|
158 |
|
159 /** |
|
160 * not implemented |
|
161 * @ref MGlxMediaListObserver::HandleItemSelectedL |
|
162 */ |
|
163 void HandleItemSelectedL(TInt /*aIndex*/, TBool /*aSelected*/, |
|
164 MGlxMediaList* /*aList*/){}; |
|
165 |
|
166 /** |
|
167 * not implemented |
|
168 * @ref MGlxMediaListObserver::HandleMessageL |
|
169 */ |
|
170 void HandleMessageL(const CMPXMessage& /*aMessage*/, |
|
171 MGlxMediaList* /*aList*/){}; |
|
172 |
|
173 private: // methods local to class |
|
174 /** |
|
175 * Retrieve the currently selected items file name and path |
|
176 * @return The currently selected items filename and path |
|
177 */ |
|
178 CMessageData* SelectedFilesLC(); |
|
179 |
|
180 /** |
|
181 * Determine if the media item is of a valid type (ie video or image) |
|
182 * @return ETrue if a valid type otherwise EFalse |
|
183 */ |
|
184 TBool IsValidTypeL(const CGlxMedia& aMedia); |
|
185 |
|
186 |
|
187 /** |
|
188 * Read the selected items uri and use it to send the items |
|
189 */ |
|
190 void SendSelectedItemsL(); |
|
191 |
|
192 /** |
|
193 * Load the resource file |
|
194 */ |
|
195 void LoadRscFileL(); |
|
196 |
|
197 /** |
|
198 * Return the static capabilities for sending a media item |
|
199 */ |
|
200 TSendingCapabilities Capabilities(); |
|
201 |
|
202 private: // data |
|
203 |
|
204 // Not owned - Provider of media list |
|
205 MGlxMediaListProvider* iMediaListProvider; |
|
206 |
|
207 // ID of owning view |
|
208 TInt iViewId; |
|
209 |
|
210 // Not owned - HUI utility |
|
211 CGlxUiUtility* iUiUtility; |
|
212 |
|
213 // Not owned - Attribute context |
|
214 CGlxDefaultAttributeContext* iAttributeContext; |
|
215 |
|
216 // Owned - the Send pop-up list, message creation and sending services |
|
217 CSendUi* iSendUi; |
|
218 |
|
219 // Array of Send Plugins uids that should not be used |
|
220 TBool iFilterOutPlugin; |
|
221 |
|
222 // The resource file offset |
|
223 TInt iResourceOffset; |
|
224 |
|
225 }; |
|
226 |
|
227 #endif //__GLXCOMMANDHANDLERUPLSEND_H__ |