|
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: Implementation of Command Binding Class's |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #include <e32base.h> // Base class for all classes to be instantiated on the heap |
|
22 #include <ExifModify.h> //For CExifModify |
|
23 #include "glxdetailsboundcommand.hrh" |
|
24 #include "glxdetailsboundcommand.h" // Handles user commands |
|
25 #include <glxmetadatadialog.rsg> |
|
26 #include <glxuiutilities.rsg> |
|
27 #include <glxuiutilities.rsg> |
|
28 #include <glxcommandhandleraddtocontainer.h> // For CGlxCommandHandlerAddToContainer |
|
29 #include <glxcommandhandlers.hrh> // for command handler id |
|
30 #include <glxdrmutility.h> //For launching DRM details pane |
|
31 #include <glxmedialist.h> // Interface for reading lists of media items |
|
32 #include <glxcommandfactory.h> //for command factory |
|
33 #include <mpxcommandgeneraldefs.h> // Content ID identifying general category of content provided |
|
34 #include <glxtextentrypopup.h> //for testing |
|
35 #include <glxgeneraluiutilities.h> // General utilties class definition |
|
36 #include <StringLoader.h> // Class provides methods to load and format resource strings |
|
37 #include <glxlog.h> // Logging |
|
38 #include <glxtracer.h> |
|
39 #include <glxviewbase.rsg> |
|
40 #include "glxuiutility.h" |
|
41 #include <glxscreenfurniture.h> |
|
42 /** Error Id EMPY-7MKDHP **/ |
|
43 #include "mglxmetadatadialogobserver.h" //for call back to dailog |
|
44 |
|
45 |
|
46 //CONSTANTS |
|
47 const TInt KMaxMediaPopupTitleLength = 0x100; |
|
48 |
|
49 // ---------------------------------------------------------------------------- |
|
50 // CGlxTitleBoundCommand::NewL |
|
51 // ---------------------------------------------------------------------------- |
|
52 // |
|
53 EXPORT_C CGlxTitleBoundCommand* CGlxTitleBoundCommand::NewL() |
|
54 { |
|
55 TRACER("CGlxTitleBoundCommand::NewL"); |
|
56 CGlxTitleBoundCommand* self = CGlxTitleBoundCommand::NewLC(); |
|
57 CleanupStack::Pop( self ); |
|
58 return self; |
|
59 } |
|
60 |
|
61 // ---------------------------------------------------------------------------- |
|
62 // CGlxTitleBoundCommand::NewLC |
|
63 // ---------------------------------------------------------------------------- |
|
64 // |
|
65 CGlxTitleBoundCommand* CGlxTitleBoundCommand::NewLC() |
|
66 { |
|
67 TRACER("CGlxTitleBoundCommand::NewLC"); |
|
68 CGlxTitleBoundCommand* self = new ( ELeave ) CGlxTitleBoundCommand; |
|
69 CleanupStack::PushL( self ); |
|
70 return self; |
|
71 } |
|
72 |
|
73 CGlxTitleBoundCommand::~CGlxTitleBoundCommand() |
|
74 { |
|
75 |
|
76 } |
|
77 // ---------------------------------------------------------------------------- |
|
78 // CGlxTitleBoundCommand::OfferCommandL |
|
79 // ---------------------------------------------------------------------------- |
|
80 // |
|
81 TBool CGlxTitleBoundCommand::OfferCommandL( TInt aCommandId , MGlxMediaList& aMedialist ) |
|
82 { |
|
83 TRACER("CGlxTitleBoundCommand::OfferCommandL"); |
|
84 TBool consumed = EFalse; |
|
85 iMedialist = &aMedialist; |
|
86 const CGlxMedia* media = iMedialist->Item(0).Properties(); |
|
87 if( media ) |
|
88 { |
|
89 if ( aCommandId == KGlxEditBoundMenuCommandId && media->IsSupported( KMPXMediaGeneralTitle)) |
|
90 { |
|
91 ///@todo - remove popup when editable template is avaliable |
|
92 //Popup for testing |
|
93 HBufC* textBuf = HBufC::NewLC( KMaxMediaPopupTitleLength ); |
|
94 (textBuf->Des()).Copy((media->ValueText(KMPXMediaGeneralTitle))); |
|
95 TPtr textPtr = textBuf->Des(); |
|
96 /// bug fix - EMPY-7MCKD6 |
|
97 TBuf<KMaxMediaPopupTitleLength> titleText(*textBuf); |
|
98 /// bug fix - EMPY-7MCKD6 |
|
99 ///@todo - remove literal for popup title when resource string is avaliable |
|
100 HBufC *buf = StringLoader::LoadLC(R_GLX_METADATA_VIEW_TITLE_NSERIES); |
|
101 CGlxTextEntryPopup* popup = CGlxTextEntryPopup::NewL( *buf, textPtr ); |
|
102 CleanupStack::PopAndDestroy(buf); |
|
103 if ( popup->ExecuteLD() == EEikBidOk ) |
|
104 { |
|
105 // Text entry was successful |
|
106 /// bug fix - EMPY-7MCKD6 |
|
107 //Compare if there is any change in the entry |
|
108 if(0 != (titleText.Compare(*textBuf))) |
|
109 /// bug fix - EMPY-7MCKD6 |
|
110 ModifyTitleL( *textBuf ); |
|
111 } |
|
112 CleanupStack::PopAndDestroy( textBuf ); |
|
113 consumed = ETrue; |
|
114 } |
|
115 } |
|
116 return consumed; |
|
117 } |
|
118 |
|
119 // ---------------------------------------------------------------------------- |
|
120 // CGlxTitleBoundCommand::InitMenuL |
|
121 // ---------------------------------------------------------------------------- |
|
122 // |
|
123 void CGlxTitleBoundCommand::InitMenuL( CEikMenuPane& aMenu ) const |
|
124 { |
|
125 TRACER("CGlxTitleBoundCommand::InitMenuL"); |
|
126 aMenu.SetItemTextL( KGlxEditBoundMenuCommandId, R_GLX_METADATA_VIEW_OPTIONS_EDIT ); |
|
127 aMenu.SetItemDimmed( KGlxEditBoundMenuCommandId, EFalse ); |
|
128 } |
|
129 |
|
130 // ---------------------------------------------------------------------------- |
|
131 // CGlxTitleBoundCommand::HideLocationMenuItem |
|
132 // ---------------------------------------------------------------------------- |
|
133 // |
|
134 void CGlxTitleBoundCommand::HideLocationMenuItem( CEikMenuPane& aMenu ) const |
|
135 { |
|
136 TRACER("CGlxTitleBoundCommand::HideLocationMenuItem"); |
|
137 aMenu.SetItemDimmed( EGlxCmdAiwBase, ETrue ); |
|
138 } |
|
139 |
|
140 // ----------------------------------------------------------------------------- |
|
141 // CGlxDescriptionBoundCommand::ModifyTitleL |
|
142 // ----------------------------------------------------------------------------- |
|
143 // |
|
144 void CGlxTitleBoundCommand::ModifyTitleL(const TDesC& aData ) |
|
145 { |
|
146 TRACER("CGlxTitleBoundCommand::ModifyTitleL"); |
|
147 |
|
148 if( iMedialist->Count() > 0 ) |
|
149 { |
|
150 iMedialist->SetFocusL(NGlxListDefs::EAbsolute,0);//set focus to first item |
|
151 CMPXCollectionPath* path = iMedialist->PathLC(); |
|
152 CMPXCommand* command = TGlxCommandFactory::RenameCommandLC(aData,*path); |
|
153 |
|
154 command->SetTObjectValueL<TAny*>(KMPXCommandGeneralSessionId, static_cast<TAny*>(this)); |
|
155 |
|
156 iMedialist->CommandL(*command); |
|
157 |
|
158 CleanupStack::PopAndDestroy(command); |
|
159 CleanupStack::PopAndDestroy(path); |
|
160 } |
|
161 } |
|
162 |
|
163 // ---------------------------------------------------------------------------- |
|
164 // CGlxTitleBoundCommand::Close |
|
165 // ---------------------------------------------------------------------------- |
|
166 // |
|
167 void CGlxTitleBoundCommand::Close() |
|
168 { |
|
169 delete this; |
|
170 } |
|
171 |
|
172 // ---------------------------------------------------------------------------- |
|
173 // CGlxTitleBoundCommand::ChangeMskL |
|
174 // ---------------------------------------------------------------------------- |
|
175 // |
|
176 void CGlxTitleBoundCommand::ChangeMskL() |
|
177 { |
|
178 TRACER("CGlxTitleBoundCommand::ChangeMskL"); |
|
179 |
|
180 CGlxUiUtility* uiUtility = CGlxUiUtility::UtilityL(); |
|
181 uiUtility->ScreenFurniture()->ModifySoftkeyIdL(CEikButtonGroupContainer::EMiddleSoftkeyPosition, |
|
182 EAknSoftkeySelect,R_GLX_METADATA_MSK_EDIT); |
|
183 if ( uiUtility ) |
|
184 { |
|
185 uiUtility->Close(); |
|
186 } |
|
187 } |
|
188 |
|
189 // ---------------------------------------------------------------------------- |
|
190 // CGlxTitleBoundCommand::SetDetailsDailogObserver |
|
191 // ---------------------------------------------------------------------------- |
|
192 // |
|
193 void CGlxTitleBoundCommand::SetDetailsDailogObserver( MGlxMetadataDialogObserver& /*aObserver*/ ) |
|
194 { |
|
195 |
|
196 } |
|
197 |
|
198 // ---------------------------------------------------------------------------- |
|
199 // CGlxTagsBoundCommand::NewL |
|
200 // ---------------------------------------------------------------------------- |
|
201 // |
|
202 EXPORT_C CGlxTagsBoundCommand* CGlxTagsBoundCommand::NewL() |
|
203 { |
|
204 TRACER("CGlxTagsBoundCommand::NewL"); |
|
205 CGlxTagsBoundCommand* self = CGlxTagsBoundCommand::NewLC(); |
|
206 self->ConstructL(); |
|
207 CleanupStack::Pop( self ); |
|
208 return self; |
|
209 } |
|
210 |
|
211 // ---------------------------------------------------------------------------- |
|
212 // CGlxTagsBoundCommand::NewLC |
|
213 // ---------------------------------------------------------------------------- |
|
214 // |
|
215 CGlxTagsBoundCommand* CGlxTagsBoundCommand::NewLC() |
|
216 { |
|
217 TRACER("CGlxTagsBoundCommand::NewLC"); |
|
218 CGlxTagsBoundCommand* self = new ( ELeave ) CGlxTagsBoundCommand; |
|
219 CleanupStack::PushL( self ); |
|
220 return self; |
|
221 } |
|
222 |
|
223 // ---------------------------------------------------------------------------- |
|
224 // CGlxTagsBoundCommand::ConstructL |
|
225 // ---------------------------------------------------------------------------- |
|
226 // |
|
227 void CGlxTagsBoundCommand::ConstructL() |
|
228 { |
|
229 TRACER("CGlxTagsBoundCommand::ConstructL"); |
|
230 //create command handler |
|
231 iAddToTag = CGlxCommandHandlerAddToContainer::NewL(this, EGlxCmdAddTag, EFalse); |
|
232 } |
|
233 |
|
234 // ---------------------------------------------------------------------------- |
|
235 // CGlxTagsBoundCommand::~CGlxTagsBoundCommand |
|
236 // ---------------------------------------------------------------------------- |
|
237 // |
|
238 CGlxTagsBoundCommand::~CGlxTagsBoundCommand() |
|
239 { |
|
240 if(iAddToTag) |
|
241 { |
|
242 delete iAddToTag; |
|
243 } |
|
244 } |
|
245 |
|
246 // ---------------------------------------------------------------------------- |
|
247 // CGlxTagsBoundCommand::OfferCommandL |
|
248 // ---------------------------------------------------------------------------- |
|
249 // |
|
250 TBool CGlxTagsBoundCommand::OfferCommandL( TInt aCommandId , MGlxMediaList& aMedialist) |
|
251 { |
|
252 TRACER("CGlxTagsBoundCommand::OfferCommandL"); |
|
253 SetMediaList(&aMedialist); |
|
254 TBool consumed = EFalse; |
|
255 if ( aCommandId == KGlxEditBoundMenuCommandId ) |
|
256 { |
|
257 iAddToTag->ExecuteL(EGlxCmdAddTag); |
|
258 consumed = ETrue; |
|
259 } |
|
260 return consumed; |
|
261 } |
|
262 |
|
263 // ---------------------------------------------------------------------------- |
|
264 // CGlxTagsBoundCommand::InitMenuL |
|
265 // ---------------------------------------------------------------------------- |
|
266 // |
|
267 void CGlxTagsBoundCommand::InitMenuL( CEikMenuPane& aMenu ) const |
|
268 { |
|
269 TRACER("CGlxTagsBoundCommand::InitMenuL"); |
|
270 aMenu.SetItemTextL( KGlxEditBoundMenuCommandId, R_GLX_METADATA_VIEW_OPTIONS_EDIT ); |
|
271 aMenu.SetItemDimmed( KGlxEditBoundMenuCommandId, EFalse ); |
|
272 } |
|
273 |
|
274 // ---------------------------------------------------------------------------- |
|
275 // CGlxTagsBoundCommand::HideLocationMenuItem |
|
276 // ---------------------------------------------------------------------------- |
|
277 // |
|
278 void CGlxTagsBoundCommand::HideLocationMenuItem( CEikMenuPane& aMenu ) const |
|
279 { |
|
280 TRACER("CGlxTagsBoundCommand::HideLocationMenuItem"); |
|
281 aMenu.SetItemDimmed( EGlxCmdAiwBase, ETrue ); |
|
282 } |
|
283 |
|
284 // ---------------------------------------------------------------------------- |
|
285 // CGlxTagsBoundCommand::Close |
|
286 // ---------------------------------------------------------------------------- |
|
287 // |
|
288 void CGlxTagsBoundCommand::Close() |
|
289 { |
|
290 delete this; |
|
291 } |
|
292 |
|
293 // ---------------------------------------------------------------------------- |
|
294 // CGlxTagsBoundCommand::ChangeMskL |
|
295 // ---------------------------------------------------------------------------- |
|
296 // |
|
297 void CGlxTagsBoundCommand::ChangeMskL() |
|
298 { |
|
299 TRACER("CGlxTagsBoundCommand::ChangeMskL"); |
|
300 |
|
301 CGlxUiUtility* uiUtility = CGlxUiUtility::UtilityL(); |
|
302 uiUtility->ScreenFurniture()->ModifySoftkeyIdL(CEikButtonGroupContainer::EMiddleSoftkeyPosition, |
|
303 EAknSoftkeySelect,R_GLX_METADATA_MSK_ADD); |
|
304 if ( uiUtility ) |
|
305 { |
|
306 uiUtility->Close(); |
|
307 } |
|
308 } |
|
309 |
|
310 // ---------------------------------------------------------------------------- |
|
311 // CGlxTagsBoundCommand::SetDetailsDailogObserver |
|
312 // ---------------------------------------------------------------------------- |
|
313 // |
|
314 void CGlxTagsBoundCommand::SetDetailsDailogObserver( MGlxMetadataDialogObserver& /*aObserver*/ ) |
|
315 { |
|
316 |
|
317 } |
|
318 |
|
319 |
|
320 // ---------------------------------------------------------------------------- |
|
321 // CGlxTagsBoundCommand::SetMediaList |
|
322 // ---------------------------------------------------------------------------- |
|
323 // |
|
324 void CGlxTagsBoundCommand::SetMediaList(MGlxMediaList* aMedialist) |
|
325 { |
|
326 TRACER("CGlxTagsBoundCommand::SetMediaList"); |
|
327 iMedialist = aMedialist; |
|
328 } |
|
329 |
|
330 // ---------------------------------------------------------------------------- |
|
331 // CGlxTagsBoundCommand::MediaList |
|
332 // ---------------------------------------------------------------------------- |
|
333 // |
|
334 MGlxMediaList& CGlxTagsBoundCommand::MediaList() |
|
335 { |
|
336 TRACER("CGlxTagsBoundCommand::MediaList"); |
|
337 return *iMedialist; |
|
338 } |
|
339 |
|
340 // ---------------------------------------------------------------------------- |
|
341 // CGlxDescriptionBoundCommand::NewL |
|
342 // ---------------------------------------------------------------------------- |
|
343 // |
|
344 EXPORT_C CGlxDescriptionBoundCommand* CGlxDescriptionBoundCommand::NewL() |
|
345 { |
|
346 TRACER("CGlxDescriptionBoundCommand::NewL"); |
|
347 CGlxDescriptionBoundCommand* self = CGlxDescriptionBoundCommand::NewLC(); |
|
348 CleanupStack::Pop( self ); |
|
349 return self; |
|
350 } |
|
351 |
|
352 // ---------------------------------------------------------------------------- |
|
353 // CGlxDescriptionBoundCommand::NewLC |
|
354 // ---------------------------------------------------------------------------- |
|
355 // |
|
356 CGlxDescriptionBoundCommand* CGlxDescriptionBoundCommand::NewLC() |
|
357 { |
|
358 TRACER("CGlxDescriptionBoundCommand::NewLC"); |
|
359 CGlxDescriptionBoundCommand* self = new ( ELeave ) CGlxDescriptionBoundCommand; |
|
360 CleanupStack::PushL( self ); |
|
361 return self; |
|
362 } |
|
363 |
|
364 CGlxDescriptionBoundCommand::~CGlxDescriptionBoundCommand() |
|
365 { |
|
366 |
|
367 } |
|
368 |
|
369 // ---------------------------------------------------------------------------- |
|
370 // CGlxDescriptionBoundCommand::OfferCommandL |
|
371 // ---------------------------------------------------------------------------- |
|
372 // |
|
373 TBool CGlxDescriptionBoundCommand::OfferCommandL( TInt aCommandId , MGlxMediaList& aMedialist ) |
|
374 { |
|
375 TRACER("CGlxDescriptionBoundCommand::OfferCommandL"); |
|
376 TBool consumed = EFalse; |
|
377 iMedialist = &aMedialist; |
|
378 const CGlxMedia* media = iMedialist->Item(0).Properties(); |
|
379 if ( aCommandId == KGlxEditBoundMenuCommandId ) |
|
380 { |
|
381 ///@todo - remove popup when editable template is avaliable |
|
382 //Popup for testing |
|
383 HBufC* textBuf = HBufC::NewLC( KMaxMediaPopupTitleLength ); |
|
384 (textBuf->Des()).Copy((media->ValueText(KMPXMediaGeneralComment))); |
|
385 TPtr textPtr = textBuf->Des(); |
|
386 /// bug fix - EMPY-7MCKD6 |
|
387 TBuf<KMaxMediaPopupTitleLength> descText(*textBuf); |
|
388 /// bug fix - EMPY-7MCKD6 |
|
389 ///@todo - remove literal for popup title when resource string is avaliable |
|
390 |
|
391 HBufC *buf = StringLoader::LoadLC(R_GLX_METADATA_VIEW_DESCRIPTION_NSERIES); |
|
392 CGlxTextEntryPopup* popup = CGlxTextEntryPopup::NewL( *buf, textPtr ); |
|
393 CleanupStack::PopAndDestroy(buf); |
|
394 |
|
395 |
|
396 if ( popup->ExecuteLD() == EEikBidOk ) |
|
397 { |
|
398 // Text entry was successful |
|
399 /// bug fix - EMPY-7MCKD6 |
|
400 //Compare if there is any change in the entry |
|
401 if(0 != (descText.Compare(*textBuf))) |
|
402 /// bug fix - EMPY-7MCKD6 |
|
403 ModifyDescriptionL( *textBuf ); |
|
404 } |
|
405 CleanupStack::PopAndDestroy( textBuf ); |
|
406 consumed = ETrue; |
|
407 } |
|
408 return consumed; |
|
409 } |
|
410 |
|
411 // ---------------------------------------------------------------------------- |
|
412 // CGlxDescriptionBoundCommand::InitMenuL |
|
413 // ---------------------------------------------------------------------------- |
|
414 // |
|
415 void CGlxDescriptionBoundCommand::InitMenuL( CEikMenuPane& aMenu ) const |
|
416 { |
|
417 TRACER("CGlxDescriptionBoundCommand::InitMenuL"); |
|
418 aMenu.SetItemTextL( KGlxEditBoundMenuCommandId, R_GLX_METADATA_VIEW_OPTIONS_EDIT ); |
|
419 aMenu.SetItemDimmed( KGlxEditBoundMenuCommandId, EFalse ); |
|
420 } |
|
421 |
|
422 // ---------------------------------------------------------------------------- |
|
423 // CGlxDescriptionBoundCommand::HideLocationMenuItem |
|
424 // ---------------------------------------------------------------------------- |
|
425 // |
|
426 void CGlxDescriptionBoundCommand::HideLocationMenuItem( CEikMenuPane& aMenu ) const |
|
427 { |
|
428 TRACER("CGlxDescriptionBoundCommand::HideLocationMenuItem"); |
|
429 aMenu.SetItemDimmed( EGlxCmdAiwBase, ETrue ); |
|
430 } |
|
431 |
|
432 // ---------------------------------------------------------------------------- |
|
433 // CGlxDescriptionBoundCommand::Close |
|
434 // ---------------------------------------------------------------------------- |
|
435 // |
|
436 void CGlxDescriptionBoundCommand::Close() |
|
437 { |
|
438 delete this; |
|
439 } |
|
440 |
|
441 // ---------------------------------------------------------------------------- |
|
442 // CGlxDescriptionBoundCommand::ChangeMskL |
|
443 // ---------------------------------------------------------------------------- |
|
444 // |
|
445 void CGlxDescriptionBoundCommand::ChangeMskL() |
|
446 { |
|
447 TRACER("CGlxDescriptionBoundCommand::ChangeMskL"); |
|
448 |
|
449 CGlxUiUtility* uiUtility = CGlxUiUtility::UtilityL(); |
|
450 uiUtility->ScreenFurniture()->ModifySoftkeyIdL(CEikButtonGroupContainer::EMiddleSoftkeyPosition, |
|
451 EAknSoftkeySelect,R_GLX_METADATA_MSK_EDIT); |
|
452 if ( uiUtility ) |
|
453 { |
|
454 uiUtility->Close(); |
|
455 } |
|
456 } |
|
457 |
|
458 // ---------------------------------------------------------------------------- |
|
459 // CGlxDescriptionBoundCommand::SetDetailsDailogObserver |
|
460 // ---------------------------------------------------------------------------- |
|
461 // |
|
462 void CGlxDescriptionBoundCommand::SetDetailsDailogObserver( MGlxMetadataDialogObserver& /*aObserver*/ ) |
|
463 { |
|
464 |
|
465 } |
|
466 |
|
467 |
|
468 // ----------------------------------------------------------------------------- |
|
469 // CGlxDescriptionBoundCommand::ModifyDescriptionL |
|
470 // ----------------------------------------------------------------------------- |
|
471 // |
|
472 void CGlxDescriptionBoundCommand::ModifyDescriptionL(const TDesC& aData ) |
|
473 { |
|
474 TRACER("CGlxDescriptionBoundCommand::ModifyDescriptionL"); |
|
475 if( iMedialist->Count() > 0 ) |
|
476 { |
|
477 iMedialist->SetFocusL(NGlxListDefs::EAbsolute,0);//set focus to first item |
|
478 CMPXCollectionPath* path = iMedialist->PathLC(); |
|
479 CMPXCommand* command = TGlxCommandFactory::SetDescriptionCommandLC(aData,*path); |
|
480 command->SetTObjectValueL<TAny*>(KMPXCommandGeneralSessionId, static_cast<TAny*>(this)); |
|
481 |
|
482 iMedialist->CommandL(*command); |
|
483 CleanupStack::PopAndDestroy(command); |
|
484 CleanupStack::PopAndDestroy(path); |
|
485 } |
|
486 } |
|
487 |
|
488 // ---------------------------------------------------------------------------- |
|
489 // CGlxLocationBoundCommand::NewL |
|
490 // ---------------------------------------------------------------------------- |
|
491 // |
|
492 EXPORT_C CGlxLocationBoundCommand* CGlxLocationBoundCommand::NewL() |
|
493 { |
|
494 TRACER("CGlxLocationBoundCommand::NewL"); |
|
495 CGlxLocationBoundCommand* self = CGlxLocationBoundCommand::NewLC(); |
|
496 CleanupStack::Pop( self ); |
|
497 return self; |
|
498 } |
|
499 |
|
500 // ---------------------------------------------------------------------------- |
|
501 // CGlxLocationBoundCommand::NewLC |
|
502 // ---------------------------------------------------------------------------- |
|
503 // |
|
504 CGlxLocationBoundCommand* CGlxLocationBoundCommand::NewLC() |
|
505 { |
|
506 TRACER("CGlxLocationBoundCommand::NewLC"); |
|
507 CGlxLocationBoundCommand* self = new ( ELeave ) CGlxLocationBoundCommand; |
|
508 CleanupStack::PushL( self ); |
|
509 return self; |
|
510 } |
|
511 |
|
512 CGlxLocationBoundCommand::~CGlxLocationBoundCommand() |
|
513 { |
|
514 iDialogObserver = NULL ; |
|
515 } |
|
516 |
|
517 // ---------------------------------------------------------------------------- |
|
518 // CGlxLocationBoundCommand::OfferCommandL |
|
519 // ---------------------------------------------------------------------------- |
|
520 // |
|
521 TBool CGlxLocationBoundCommand::OfferCommandL( TInt aCommandId , MGlxMediaList& aMedialist ) |
|
522 { |
|
523 TRACER("CGlxLocationBoundCommand::OfferCommandL"); |
|
524 iMedialist = &aMedialist; |
|
525 TBool consumed = EFalse; |
|
526 //iAppUi = static_cast< CAknAppUi* >( CCoeEnv::Static()->AppUi() ); |
|
527 if ( aCommandId == KGlxEditBoundMenuCommandId ) |
|
528 { |
|
529 iOnNaviKeySelect = ETrue; |
|
530 //iAppUi->ProcessCommandL( EGlxCmdOptions ); |
|
531 //iOnNaviKeySelect = EFalse; |
|
532 |
|
533 /** Error Id ESWG-7LSE3W **/ |
|
534 //get the media item |
|
535 const TGlxMedia& media = iMedialist->Item( 0 ); |
|
536 // Test to see if the coordinate is present |
|
537 TCoordinate coordinate; |
|
538 TBool isSupported = media.GetCoordinate(coordinate); |
|
539 if(!isSupported) |
|
540 { |
|
541 HBufC *buf = StringLoader::LoadLC(R_GLX_METADATA_NOTE_INFO_NO_LOCATION); |
|
542 GlxGeneralUiUtilities::ShowInfoNoteL(*buf,ETrue); |
|
543 CleanupStack::PopAndDestroy(buf); |
|
544 consumed = ETrue; |
|
545 } |
|
546 else |
|
547 { |
|
548 /** Error Id EMPY-7MKDHP **/ |
|
549 /** Show menu pane options **/ |
|
550 if(iDialogObserver) |
|
551 { |
|
552 TRAP_IGNORE(iDialogObserver->OnLocationEditL()); |
|
553 } |
|
554 } |
|
555 } |
|
556 else |
|
557 { |
|
558 iOnNaviKeySelect = EFalse; |
|
559 } |
|
560 if ( aCommandId == KGlxDeleteBoundMenuCommandId ) |
|
561 { |
|
562 RemoveLocationL(); |
|
563 consumed = ETrue; |
|
564 } |
|
565 return consumed; |
|
566 } |
|
567 |
|
568 // ---------------------------------------------------------------------------- |
|
569 // CGlxLocationBoundCommand::InitMenuL |
|
570 // ---------------------------------------------------------------------------- |
|
571 // |
|
572 void CGlxLocationBoundCommand::InitMenuL( CEikMenuPane& aMenu ) const |
|
573 { |
|
574 TRACER("CGlxLocationBoundCommand::InitMenuL"); |
|
575 aMenu.SetItemTextL( EGlxCmdAiwShowMap, R_GLX_METADATA_SHOW_ON_MAP_OPTIONS_VIEW ); |
|
576 aMenu.SetItemDimmed( EGlxCmdAiwShowMap, EFalse ); |
|
577 aMenu.SetItemTextL( KGlxDeleteBoundMenuCommandId, R_GLX_METADATA_VIEW_OPTIONS_DELETE ); |
|
578 aMenu.SetItemDimmed( KGlxDeleteBoundMenuCommandId, EFalse ); |
|
579 if( iOnNaviKeySelect ) |
|
580 { |
|
581 aMenu.SetItemDimmed( EAknCmdHelp, ETrue ); |
|
582 } |
|
583 } |
|
584 |
|
585 // ---------------------------------------------------------------------------- |
|
586 // CGlxLocationBoundCommand::HideLocationMenuItem |
|
587 // ---------------------------------------------------------------------------- |
|
588 // |
|
589 void CGlxLocationBoundCommand::HideLocationMenuItem(CEikMenuPane& /*aMenu*/) const |
|
590 { |
|
591 TRACER("CGlxLocationBoundCommand::HideLocationMenuItem"); |
|
592 } |
|
593 |
|
594 // ---------------------------------------------------------------------------- |
|
595 // CGlxLocationBoundCommand::Close |
|
596 // ---------------------------------------------------------------------------- |
|
597 // |
|
598 void CGlxLocationBoundCommand::Close() |
|
599 { |
|
600 delete this; |
|
601 } |
|
602 |
|
603 // ---------------------------------------------------------------------------- |
|
604 // CGlxLocationBoundCommand::ChangeMskL |
|
605 // ---------------------------------------------------------------------------- |
|
606 // |
|
607 void CGlxLocationBoundCommand::ChangeMskL() |
|
608 { |
|
609 TRACER("CGlxLocationBoundCommand::ChangeMskL"); |
|
610 |
|
611 CGlxUiUtility* uiUtility = CGlxUiUtility::UtilityL(); |
|
612 uiUtility->ScreenFurniture()->ModifySoftkeyIdL(CEikButtonGroupContainer::EMiddleSoftkeyPosition, |
|
613 EAknSoftkeySelect,R_GLX_METADATA_MSK_BLANK); |
|
614 if ( uiUtility ) |
|
615 { |
|
616 uiUtility->Close(); |
|
617 } |
|
618 } |
|
619 |
|
620 // ----------------------------------------------------------------------------- |
|
621 // CGlxLocationBoundCommand::RemoveLocationL |
|
622 // ----------------------------------------------------------------------------- |
|
623 // |
|
624 void CGlxLocationBoundCommand::RemoveLocationL() |
|
625 { |
|
626 TRACER("CGlxLocationBoundCommand::RemoveLocationL"); |
|
627 |
|
628 // get the media item |
|
629 const TGlxMedia& media = iMedialist->Item( 0 ); |
|
630 |
|
631 // Test to see if the coordinate is present |
|
632 TCoordinate coordinate; |
|
633 TBool isSupported = media.GetCoordinate(coordinate); |
|
634 |
|
635 if( !isSupported ) |
|
636 { |
|
637 HBufC *buf = StringLoader::LoadLC(R_GLX_METADATA_NOTE_INFO_NO_LOCATION); |
|
638 GlxGeneralUiUtilities::ShowInfoNoteL(*buf,ETrue); |
|
639 CleanupStack::PopAndDestroy(buf); |
|
640 } |
|
641 else |
|
642 { |
|
643 HBufC *buf = StringLoader::LoadLC(R_GLX_METADATA_NOTE_DELETE_LOCATION); |
|
644 TBool response = GlxGeneralUiUtilities::ConfirmQueryL(R_GLX_QUERY_YES_NO,*buf); |
|
645 CleanupStack::PopAndDestroy(buf); |
|
646 |
|
647 if( response ) |
|
648 { |
|
649 //user selected yes, so delete location |
|
650 //send command for delete location after successfull removal of command remove this pane |
|
651 if( iMedialist->Count() > 0 ) |
|
652 { |
|
653 iMedialist->SetFocusL(NGlxListDefs::EAbsolute,0);//set focus to first item |
|
654 |
|
655 // Deleting location information from image file |
|
656 |
|
657 RFs rFs; |
|
658 User::LeaveIfError( rFs.Connect() ); |
|
659 CleanupClosePushL( rFs ); |
|
660 RFile rFile; |
|
661 |
|
662 User::LeaveIfError( rFile.Open(rFs,iMedialist->Item(0).Uri(),EFileWrite )); |
|
663 CleanupClosePushL( rFile ); |
|
664 |
|
665 TInt imageFileSize = 0; // Image File Size |
|
666 User::LeaveIfError( rFile.Size( imageFileSize ) ); |
|
667 HBufC8* imageData = HBufC8::NewL( imageFileSize ); //Actual Image Data |
|
668 CleanupStack::PushL( imageData ); |
|
669 |
|
670 TPtr8 myImagePtr = imageData->Des(); |
|
671 TInt readError = rFile.Read( myImagePtr ); |
|
672 if ( readError != KErrNone ) |
|
673 { |
|
674 User::Leave( KErrGeneral ); |
|
675 } |
|
676 |
|
677 //CExifModify Interface class for modifying existing Exif v2.2 (or prior) |
|
678 //file format or creating Exif v2.2 file format using valid Jpeg image |
|
679 CExifModify* exifWriter = CExifModify::NewL( imageData->Des(), CExifModify::EModify, CExifModify::ENoJpegParsing ); |
|
680 CleanupStack::PushL( exifWriter ); |
|
681 //Removes the specified IFD structure and all its tags from the Exif data |
|
682 exifWriter->DeleteIfd ( EIfdGps ); |
|
683 |
|
684 HBufC8* modifiedExif = exifWriter->WriteDataL( imageData->Des() ); //Modified Image Data |
|
685 CleanupStack::PushL( modifiedExif ); |
|
686 |
|
687 const TUint32 fileSize = modifiedExif->Des().Length(); //Size of Modified File |
|
688 TInt oldSize; |
|
689 rFile.Size( oldSize ); |
|
690 // set position to begin of file & write the Modified data (Without Location Information) |
|
691 TInt pos = 0; |
|
692 User::LeaveIfError( rFile.Seek( ESeekStart, pos ) ); |
|
693 User::LeaveIfError( rFile.Write( modifiedExif->Des(), fileSize ) ); |
|
694 |
|
695 TTime lastModified; |
|
696 lastModified.UniversalTime(); |
|
697 |
|
698 User::LeaveIfError( rFile.SetModified( lastModified ) ); //Change the Modified Time |
|
699 |
|
700 CleanupStack::PopAndDestroy( modifiedExif); |
|
701 CleanupStack::PopAndDestroy( exifWriter); |
|
702 CleanupStack::PopAndDestroy( imageData ); |
|
703 CleanupStack::PopAndDestroy( &rFile ); |
|
704 CleanupStack::PopAndDestroy( &rFs ); |
|
705 |
|
706 // Deleting location information from MDS database |
|
707 |
|
708 CMPXCollectionPath* path = iMedialist->PathLC(); |
|
709 CMPXCommand* command = TGlxCommandFactory::DeleteLocationCommandLC(*path); |
|
710 |
|
711 command->SetTObjectValueL<TAny*>(KMPXCommandGeneralSessionId, static_cast<TAny*>(this)); |
|
712 |
|
713 iMedialist->CommandL(*command); |
|
714 |
|
715 CleanupStack::PopAndDestroy(command); |
|
716 CleanupStack::PopAndDestroy(path); |
|
717 } |
|
718 } |
|
719 } |
|
720 } |
|
721 |
|
722 // ----------------------------------------------------------------------------- |
|
723 // CGlxLocationBoundCommand::SetDetailsDailogObserver |
|
724 // ----------------------------------------------------------------------------- |
|
725 // |
|
726 void CGlxLocationBoundCommand::SetDetailsDailogObserver(MGlxMetadataDialogObserver& aObserver) |
|
727 { |
|
728 /** Error Id EMPY-7MKDHP **/ |
|
729 iDialogObserver = &aObserver ; |
|
730 } |
|
731 |
|
732 // ---------------------------------------------------------------------------- |
|
733 // CGlxAlbumsBoundCommand::NewL |
|
734 // ---------------------------------------------------------------------------- |
|
735 // |
|
736 EXPORT_C CGlxAlbumsBoundCommand* CGlxAlbumsBoundCommand::NewL() |
|
737 { |
|
738 TRACER("CGlxAlbumsBoundCommand::NewL"); |
|
739 CGlxAlbumsBoundCommand* self = CGlxAlbumsBoundCommand::NewLC(); |
|
740 self->ConstructL(); |
|
741 CleanupStack::Pop( self ); |
|
742 return self; |
|
743 } |
|
744 |
|
745 // ---------------------------------------------------------------------------- |
|
746 // CGlxAlbumsBoundCommand::NewLC |
|
747 // ---------------------------------------------------------------------------- |
|
748 // |
|
749 CGlxAlbumsBoundCommand* CGlxAlbumsBoundCommand::NewLC() |
|
750 { |
|
751 TRACER("CGlxAlbumsBoundCommand::NewLC"); |
|
752 CGlxAlbumsBoundCommand* self = new ( ELeave ) CGlxAlbumsBoundCommand; |
|
753 CleanupStack::PushL( self ); |
|
754 return self; |
|
755 } |
|
756 |
|
757 // ---------------------------------------------------------------------------- |
|
758 // CGlxAlbumsBoundCommand::ConstructL |
|
759 // ---------------------------------------------------------------------------- |
|
760 // |
|
761 void CGlxAlbumsBoundCommand::ConstructL() |
|
762 { |
|
763 TRACER("CGlxAlbumsBoundCommand::ConstructL"); |
|
764 //create command handler |
|
765 iAddToAlbum= CGlxCommandHandlerAddToContainer::NewL(this, EGlxCmdAddToAlbum, EFalse ); |
|
766 } |
|
767 |
|
768 // ---------------------------------------------------------------------------- |
|
769 // CGlxAlbumsBoundCommand::~CGlxAlbumsBoundCommand |
|
770 // ---------------------------------------------------------------------------- |
|
771 // |
|
772 CGlxAlbumsBoundCommand::~CGlxAlbumsBoundCommand() |
|
773 { |
|
774 if(iAddToAlbum) |
|
775 { |
|
776 delete iAddToAlbum; |
|
777 } |
|
778 } |
|
779 |
|
780 // ---------------------------------------------------------------------------- |
|
781 // CGlxAlbumsBoundCommand::OfferCommandL |
|
782 // ---------------------------------------------------------------------------- |
|
783 // |
|
784 TBool CGlxAlbumsBoundCommand::OfferCommandL( TInt aCommandId , MGlxMediaList& aMedialist) |
|
785 { |
|
786 TRACER("CGlxAlbumsBoundCommand::OfferCommandL"); |
|
787 SetMediaList(&aMedialist); |
|
788 TBool consumed = EFalse; |
|
789 if ( aCommandId == KGlxEditBoundMenuCommandId ) |
|
790 { |
|
791 iAddToAlbum->ExecuteL(EGlxCmdAddToAlbum); |
|
792 consumed = ETrue; |
|
793 } |
|
794 return consumed; |
|
795 } |
|
796 |
|
797 // ---------------------------------------------------------------------------- |
|
798 // CGlxAlbumsBoundCommand::InitMenuL |
|
799 // ---------------------------------------------------------------------------- |
|
800 // |
|
801 void CGlxAlbumsBoundCommand::InitMenuL( CEikMenuPane& aMenu ) const |
|
802 { |
|
803 TRACER("CGlxAlbumsBoundCommand::InitMenuL"); |
|
804 aMenu.SetItemTextL( KGlxEditBoundMenuCommandId, R_GLX_METADATA_VIEW_OPTIONS_EDIT ); |
|
805 aMenu.SetItemDimmed( KGlxEditBoundMenuCommandId, EFalse ); |
|
806 } |
|
807 |
|
808 // ---------------------------------------------------------------------------- |
|
809 // CGlxAlbumsBoundCommand::HideLocationMenuItem |
|
810 // ---------------------------------------------------------------------------- |
|
811 // |
|
812 void CGlxAlbumsBoundCommand::HideLocationMenuItem( CEikMenuPane& aMenu ) const |
|
813 { |
|
814 TRACER("CGlxAlbumsBoundCommand::HideLocationMenuItem"); |
|
815 aMenu.SetItemDimmed( EGlxCmdAiwBase, ETrue ); |
|
816 } |
|
817 |
|
818 // ---------------------------------------------------------------------------- |
|
819 // CGlxAlbumsBoundCommand::Close |
|
820 // ---------------------------------------------------------------------------- |
|
821 // |
|
822 void CGlxAlbumsBoundCommand::Close() |
|
823 { |
|
824 delete this; |
|
825 } |
|
826 |
|
827 // ---------------------------------------------------------------------------- |
|
828 // CGlxAlbumsBoundCommand::ChangeMskL |
|
829 // ---------------------------------------------------------------------------- |
|
830 // |
|
831 void CGlxAlbumsBoundCommand::ChangeMskL() |
|
832 { |
|
833 TRACER("CGlxAlbumsBoundCommand::ChangeMskL"); |
|
834 |
|
835 CGlxUiUtility* uiUtility = CGlxUiUtility::UtilityL(); |
|
836 uiUtility->ScreenFurniture()->ModifySoftkeyIdL(CEikButtonGroupContainer::EMiddleSoftkeyPosition, |
|
837 EAknSoftkeySelect,R_GLX_METADATA_MSK_ADD); |
|
838 if ( uiUtility ) |
|
839 { |
|
840 uiUtility->Close(); |
|
841 } |
|
842 } |
|
843 |
|
844 // ---------------------------------------------------------------------------- |
|
845 // CGlxAlbumsBoundCommand::SetDetailsDailogObserver |
|
846 // ---------------------------------------------------------------------------- |
|
847 // |
|
848 void CGlxAlbumsBoundCommand::SetDetailsDailogObserver( MGlxMetadataDialogObserver& /*aObserver*/ ) |
|
849 { |
|
850 |
|
851 } |
|
852 |
|
853 |
|
854 // ---------------------------------------------------------------------------- |
|
855 // CGlxAlbumsBoundCommand::SetMediaList |
|
856 // ---------------------------------------------------------------------------- |
|
857 // |
|
858 void CGlxAlbumsBoundCommand::SetMediaList(MGlxMediaList* aMedialist) |
|
859 { |
|
860 TRACER("CGlxAlbumsBoundCommand::SetMediaList"); |
|
861 iMedialist = aMedialist; |
|
862 } |
|
863 |
|
864 // ---------------------------------------------------------------------------- |
|
865 // CGlxAlbumsBoundCommand::MediaList |
|
866 // ---------------------------------------------------------------------------- |
|
867 // |
|
868 MGlxMediaList& CGlxAlbumsBoundCommand::MediaList() |
|
869 { |
|
870 TRACER("CGlxAlbumsBoundCommand::MediaList"); |
|
871 return *iMedialist; |
|
872 } |
|
873 |
|
874 // ---------------------------------------------------------------------------- |
|
875 // CGlxResolutionBoundCommand::NewL |
|
876 // ---------------------------------------------------------------------------- |
|
877 // |
|
878 EXPORT_C CGlxResolutionBoundCommand* CGlxResolutionBoundCommand::NewL() |
|
879 { |
|
880 TRACER("CGlxResolutionBoundCommand::NewL"); |
|
881 CGlxResolutionBoundCommand* self = CGlxResolutionBoundCommand::NewLC(); |
|
882 CleanupStack::Pop( self ); |
|
883 return self; |
|
884 } |
|
885 |
|
886 // ---------------------------------------------------------------------------- |
|
887 // CGlxResolutionBoundCommand::NewLC |
|
888 // ---------------------------------------------------------------------------- |
|
889 // |
|
890 CGlxResolutionBoundCommand* CGlxResolutionBoundCommand::NewLC() |
|
891 { |
|
892 TRACER("CGlxResolutionBoundCommand::NewLC"); |
|
893 CGlxResolutionBoundCommand* self = new ( ELeave ) CGlxResolutionBoundCommand; |
|
894 CleanupStack::PushL( self ); |
|
895 return self; |
|
896 } |
|
897 |
|
898 CGlxResolutionBoundCommand::~CGlxResolutionBoundCommand() |
|
899 { |
|
900 |
|
901 } |
|
902 |
|
903 // ---------------------------------------------------------------------------- |
|
904 // CGlxResolutionBoundCommand::OfferCommandL |
|
905 // ---------------------------------------------------------------------------- |
|
906 // |
|
907 TBool CGlxResolutionBoundCommand::OfferCommandL( TInt /*aCommandId*/ , MGlxMediaList& /*aMedialist*/ ) |
|
908 { |
|
909 TRACER("CGlxResolutionBoundCommand::OfferCommandL"); |
|
910 return ETrue; |
|
911 } |
|
912 |
|
913 // ---------------------------------------------------------------------------- |
|
914 // CGlxResolutionBoundCommand::InitMenuL |
|
915 // ---------------------------------------------------------------------------- |
|
916 // |
|
917 void CGlxResolutionBoundCommand::InitMenuL( CEikMenuPane& /*aMenu*/ ) const |
|
918 { |
|
919 // no implementation |
|
920 } |
|
921 |
|
922 // ---------------------------------------------------------------------------- |
|
923 // CGlxResolutionBoundCommand::HideLocationMenuItem |
|
924 // ---------------------------------------------------------------------------- |
|
925 // |
|
926 void CGlxResolutionBoundCommand::HideLocationMenuItem( CEikMenuPane& aMenu ) const |
|
927 { |
|
928 TRACER("CGlxResolutionBoundCommand::HideLocationMenuItem"); |
|
929 aMenu.SetItemDimmed( EGlxCmdAiwBase, ETrue ); |
|
930 } |
|
931 |
|
932 // ---------------------------------------------------------------------------- |
|
933 // CGlxResolutionBoundCommand::Close |
|
934 // ---------------------------------------------------------------------------- |
|
935 // |
|
936 void CGlxResolutionBoundCommand::Close() |
|
937 { |
|
938 delete this; |
|
939 } |
|
940 |
|
941 // ---------------------------------------------------------------------------- |
|
942 // CGlxResolutionBoundCommand::ChangeMskL |
|
943 // ---------------------------------------------------------------------------- |
|
944 // |
|
945 void CGlxResolutionBoundCommand::ChangeMskL() |
|
946 { |
|
947 TRACER("CGlxResolutionBoundCommand::ChangeMskL"); |
|
948 |
|
949 CGlxUiUtility* uiUtility = CGlxUiUtility::UtilityL(); |
|
950 uiUtility->ScreenFurniture()->ModifySoftkeyIdL(CEikButtonGroupContainer::EMiddleSoftkeyPosition, |
|
951 EAknSoftkeyEmpty,R_GLX_METADATA_MSK_BLANK); |
|
952 if ( uiUtility ) |
|
953 { |
|
954 uiUtility->Close(); |
|
955 } |
|
956 } |
|
957 |
|
958 // ---------------------------------------------------------------------------- |
|
959 // CGlxResolutionBoundCommand::SetDetailsDailogObserver |
|
960 // ---------------------------------------------------------------------------- |
|
961 // |
|
962 void CGlxResolutionBoundCommand::SetDetailsDailogObserver( MGlxMetadataDialogObserver& /*aObserver*/ ) |
|
963 { |
|
964 |
|
965 } |
|
966 |
|
967 // ---------------------------------------------------------------------------- |
|
968 // CGlxUsageRightsBoundCommand::NewL( |
|
969 // ---------------------------------------------------------------------------- |
|
970 // |
|
971 EXPORT_C CGlxUsageRightsBoundCommand* CGlxUsageRightsBoundCommand::NewL() |
|
972 { |
|
973 TRACER("CGlxUsageRightsBoundCommand::NewL"); |
|
974 CGlxUsageRightsBoundCommand* self = CGlxUsageRightsBoundCommand::NewLC(); |
|
975 CleanupStack::Pop( self ); |
|
976 return self; |
|
977 } |
|
978 |
|
979 // ---------------------------------------------------------------------------- |
|
980 // CGlxUsageRightsBoundCommand::NewLC |
|
981 // ---------------------------------------------------------------------------- |
|
982 // |
|
983 CGlxUsageRightsBoundCommand* CGlxUsageRightsBoundCommand::NewLC() |
|
984 { |
|
985 TRACER("CGlxUsageRightsBoundCommand::NewLC"); |
|
986 CGlxUsageRightsBoundCommand* self = new ( ELeave ) CGlxUsageRightsBoundCommand; |
|
987 CleanupStack::PushL( self ); |
|
988 return self; |
|
989 } |
|
990 |
|
991 CGlxUsageRightsBoundCommand::~CGlxUsageRightsBoundCommand() |
|
992 { |
|
993 |
|
994 } |
|
995 |
|
996 // ---------------------------------------------------------------------------- |
|
997 // CGlxUsageRightsBoundCommand::OfferCommandL |
|
998 // ---------------------------------------------------------------------------- |
|
999 // |
|
1000 TBool CGlxUsageRightsBoundCommand::OfferCommandL( TInt aCommandId , MGlxMediaList& aMedialist) |
|
1001 { |
|
1002 TRACER("CGlxUsageRightsBoundCommand::OfferCommandL"); |
|
1003 SetMediaList(&aMedialist); |
|
1004 TBool consumed = EFalse; |
|
1005 if ( aCommandId == KGlxViewBoundMenuCommandId || aCommandId == KGlxEditBoundMenuCommandId ) |
|
1006 { |
|
1007 LaunchDRMViewL(); |
|
1008 consumed = ETrue; |
|
1009 } |
|
1010 return consumed; |
|
1011 } |
|
1012 |
|
1013 // ---------------------------------------------------------------------------- |
|
1014 // CGlxUsageRightsBoundCommand::InitMenuL |
|
1015 // ---------------------------------------------------------------------------- |
|
1016 // |
|
1017 void CGlxUsageRightsBoundCommand::InitMenuL( CEikMenuPane& aMenu ) const |
|
1018 { |
|
1019 TRACER("CGlxUsageRightsBoundCommand::InitMenuL"); |
|
1020 aMenu.SetItemTextL( KGlxViewBoundMenuCommandId, R_GLX_METADATA_VIEW_OPTIONS_VIEW ); |
|
1021 aMenu.SetItemDimmed( KGlxViewBoundMenuCommandId, EFalse ); |
|
1022 } |
|
1023 |
|
1024 // ---------------------------------------------------------------------------- |
|
1025 // CGlxUsageRightsBoundCommand::HideLocationMenuItem |
|
1026 // ---------------------------------------------------------------------------- |
|
1027 // |
|
1028 void CGlxUsageRightsBoundCommand::HideLocationMenuItem( CEikMenuPane& aMenu ) const |
|
1029 { |
|
1030 TRACER("CGlxUsageRightsBoundCommand::HideLocationMenuItem"); |
|
1031 aMenu.SetItemDimmed( EGlxCmdAiwBase, ETrue ); |
|
1032 } |
|
1033 |
|
1034 // ---------------------------------------------------------------------------- |
|
1035 // CGlxUsageRightsBoundCommand::Close |
|
1036 // ---------------------------------------------------------------------------- |
|
1037 // |
|
1038 void CGlxUsageRightsBoundCommand::Close() |
|
1039 { |
|
1040 delete this; |
|
1041 } |
|
1042 |
|
1043 // ---------------------------------------------------------------------------- |
|
1044 // CGlxUsageRightsBoundCommand::ChangeMskL |
|
1045 // ---------------------------------------------------------------------------- |
|
1046 // |
|
1047 void CGlxUsageRightsBoundCommand::ChangeMskL() |
|
1048 { |
|
1049 TRACER("CGlxUsageRightsBoundCommand::ChangeMskL"); |
|
1050 |
|
1051 CGlxUiUtility* uiUtility = CGlxUiUtility::UtilityL(); |
|
1052 uiUtility->ScreenFurniture()->ModifySoftkeyIdL(CEikButtonGroupContainer::EMiddleSoftkeyPosition, |
|
1053 EAknSoftkeySelect,R_GLX_METADATA_MSK_BLANK); |
|
1054 if ( uiUtility ) |
|
1055 { |
|
1056 uiUtility->Close(); |
|
1057 } |
|
1058 } |
|
1059 |
|
1060 // ---------------------------------------------------------------------------- |
|
1061 // CGlxUsageRightsBoundCommand::SetDetailsDailogObserver |
|
1062 // ---------------------------------------------------------------------------- |
|
1063 // |
|
1064 void CGlxUsageRightsBoundCommand::SetDetailsDailogObserver( MGlxMetadataDialogObserver& /*aObserver*/ ) |
|
1065 { |
|
1066 |
|
1067 } |
|
1068 |
|
1069 // ---------------------------------------------------------------------------- |
|
1070 // CGlxUsageRightsBoundCommand::SetMediaList |
|
1071 // ---------------------------------------------------------------------------- |
|
1072 // |
|
1073 void CGlxUsageRightsBoundCommand::SetMediaList(MGlxMediaList* aMedialist) |
|
1074 { |
|
1075 TRACER("CGlxUsageRightsBoundCommand::SetMediaList"); |
|
1076 iMedialist = aMedialist; |
|
1077 } |
|
1078 |
|
1079 // ---------------------------------------------------------------------------- |
|
1080 // CGlxUsageRightsBoundCommand::MediaList |
|
1081 // ---------------------------------------------------------------------------- |
|
1082 // |
|
1083 MGlxMediaList& CGlxUsageRightsBoundCommand::MediaList() |
|
1084 { |
|
1085 return *iMedialist; |
|
1086 } |
|
1087 |
|
1088 // ----------------------------------------------------------------------------- |
|
1089 // LaunchDRMViewL |
|
1090 // ----------------------------------------------------------------------------- |
|
1091 // |
|
1092 void CGlxUsageRightsBoundCommand::LaunchDRMViewL() |
|
1093 { |
|
1094 TRACER("CGlxUsageRightsBoundCommand::LaunchDRMViewL"); |
|
1095 CGlxDRMUtility* drmUtility = CGlxDRMUtility::InstanceL(); |
|
1096 CleanupClosePushL(*drmUtility); |
|
1097 TInt count = MediaList().Count(); |
|
1098 if( count > 0) |
|
1099 { |
|
1100 const CGlxMedia* media = MediaList().Item(0).Properties(); |
|
1101 const TDesC& uri = media->ValueText(KMPXMediaGeneralUri); |
|
1102 drmUtility->ShowDRMDetailsPaneL(uri); |
|
1103 } |
|
1104 CleanupStack::PopAndDestroy(drmUtility); |
|
1105 } |
|
1106 |
|
1107 // ---------------------------------------------------------------------------- |
|
1108 // CGlxDurationBoundCommand::NewL |
|
1109 // ---------------------------------------------------------------------------- |
|
1110 // |
|
1111 EXPORT_C CGlxDurationBoundCommand* CGlxDurationBoundCommand::NewL() |
|
1112 { |
|
1113 TRACER("CGlxDurationBoundCommand::NewL"); |
|
1114 CGlxDurationBoundCommand* self = CGlxDurationBoundCommand::NewLC(); |
|
1115 CleanupStack::Pop( self ); |
|
1116 return self; |
|
1117 } |
|
1118 |
|
1119 // ---------------------------------------------------------------------------- |
|
1120 // CGlxDurationBoundCommand::NewLC |
|
1121 // ---------------------------------------------------------------------------- |
|
1122 // |
|
1123 CGlxDurationBoundCommand* CGlxDurationBoundCommand::NewLC() |
|
1124 { |
|
1125 TRACER("CGlxDurationBoundCommand::NewLC"); |
|
1126 CGlxDurationBoundCommand* self = new ( ELeave ) CGlxDurationBoundCommand; |
|
1127 CleanupStack::PushL( self ); |
|
1128 return self; |
|
1129 } |
|
1130 |
|
1131 CGlxDurationBoundCommand::~CGlxDurationBoundCommand() |
|
1132 { |
|
1133 |
|
1134 } |
|
1135 // ---------------------------------------------------------------------------- |
|
1136 // CGlxDurationBoundCommand::OfferCommandL |
|
1137 // ---------------------------------------------------------------------------- |
|
1138 // |
|
1139 TBool CGlxDurationBoundCommand::OfferCommandL( TInt /*aCommandId*/ , MGlxMediaList& /*aMedialist*/ ) |
|
1140 { |
|
1141 TRACER("CGlxDurationBoundCommand::OfferCommandL"); |
|
1142 return ETrue; |
|
1143 } |
|
1144 |
|
1145 // ---------------------------------------------------------------------------- |
|
1146 // CGlxDurationBoundCommand::InitMenuL |
|
1147 // ---------------------------------------------------------------------------- |
|
1148 // |
|
1149 void CGlxDurationBoundCommand::InitMenuL( CEikMenuPane& /*aMenu*/ ) const |
|
1150 { |
|
1151 // no implementation |
|
1152 } |
|
1153 |
|
1154 // ---------------------------------------------------------------------------- |
|
1155 // CGlxDurationBoundCommand::HideLocationMenuItem |
|
1156 // ---------------------------------------------------------------------------- |
|
1157 // |
|
1158 void CGlxDurationBoundCommand::HideLocationMenuItem( CEikMenuPane& aMenu ) const |
|
1159 { |
|
1160 TRACER("CGlxDurationBoundCommand::HideLocationMenuItem"); |
|
1161 aMenu.SetItemDimmed( EGlxCmdAiwBase, ETrue ); |
|
1162 } |
|
1163 |
|
1164 // ---------------------------------------------------------------------------- |
|
1165 // CGlxDurationBoundCommand::Close |
|
1166 // ---------------------------------------------------------------------------- |
|
1167 // |
|
1168 void CGlxDurationBoundCommand::Close() |
|
1169 { |
|
1170 delete this; |
|
1171 } |
|
1172 |
|
1173 // ---------------------------------------------------------------------------- |
|
1174 // CGlxDurationBoundCommand::ChangeMskL |
|
1175 // ---------------------------------------------------------------------------- |
|
1176 // |
|
1177 void CGlxDurationBoundCommand::ChangeMskL() |
|
1178 { |
|
1179 TRACER("CGlxDurationBoundCommand::ChangeMskL"); |
|
1180 |
|
1181 CGlxUiUtility* uiUtility = CGlxUiUtility::UtilityL(); |
|
1182 uiUtility->ScreenFurniture()->ModifySoftkeyIdL(CEikButtonGroupContainer::EMiddleSoftkeyPosition, |
|
1183 EAknSoftkeyEmpty,R_GLX_METADATA_MSK_BLANK); |
|
1184 |
|
1185 if ( uiUtility ) |
|
1186 { |
|
1187 uiUtility->Close(); |
|
1188 } |
|
1189 } |
|
1190 |
|
1191 // ---------------------------------------------------------------------------- |
|
1192 // CGlxDurationBoundCommand::SetDetailsDailogObserver |
|
1193 // ---------------------------------------------------------------------------- |
|
1194 // |
|
1195 void CGlxDurationBoundCommand::SetDetailsDailogObserver( MGlxMetadataDialogObserver& /*aObserver*/ ) |
|
1196 { |
|
1197 |
|
1198 } |
|
1199 |
|
1200 |
|
1201 // ---------------------------------------------------------------------------- |
|
1202 // CGlxDateAndTimeBoundCommand::NewL |
|
1203 // ---------------------------------------------------------------------------- |
|
1204 // |
|
1205 EXPORT_C CGlxDateAndTimeBoundCommand* CGlxDateAndTimeBoundCommand::NewL() |
|
1206 { |
|
1207 TRACER("CGlxDateAndTimeBoundCommand::NewL"); |
|
1208 CGlxDateAndTimeBoundCommand* self = CGlxDateAndTimeBoundCommand::NewLC(); |
|
1209 CleanupStack::Pop( self ); |
|
1210 return self; |
|
1211 } |
|
1212 |
|
1213 // ---------------------------------------------------------------------------- |
|
1214 // CGlxDateAndTimeBoundCommand::NewLC |
|
1215 // ---------------------------------------------------------------------------- |
|
1216 // |
|
1217 CGlxDateAndTimeBoundCommand* CGlxDateAndTimeBoundCommand::NewLC() |
|
1218 { |
|
1219 TRACER("CGlxDateAndTimeBoundCommand::NewLC"); |
|
1220 CGlxDateAndTimeBoundCommand* self = new ( ELeave ) CGlxDateAndTimeBoundCommand; |
|
1221 CleanupStack::PushL( self ); |
|
1222 return self; |
|
1223 } |
|
1224 |
|
1225 CGlxDateAndTimeBoundCommand::~CGlxDateAndTimeBoundCommand() |
|
1226 { |
|
1227 |
|
1228 } |
|
1229 // ---------------------------------------------------------------------------- |
|
1230 // CGlxDateAndTimeBoundCommand::OfferCommandL |
|
1231 // ---------------------------------------------------------------------------- |
|
1232 // |
|
1233 TBool CGlxDateAndTimeBoundCommand::OfferCommandL( TInt /*aCommandId*/ , MGlxMediaList& /*aMedialist*/ ) |
|
1234 { |
|
1235 TRACER("CGlxDateAndTimeBoundCommand::OfferCommandL"); |
|
1236 return ETrue; |
|
1237 } |
|
1238 |
|
1239 // ---------------------------------------------------------------------------- |
|
1240 // CGlxDateAndTimeBoundCommand::InitMenuL |
|
1241 // ---------------------------------------------------------------------------- |
|
1242 // |
|
1243 void CGlxDateAndTimeBoundCommand::InitMenuL( CEikMenuPane& /*aMenu*/ ) const |
|
1244 { |
|
1245 // no implementation |
|
1246 } |
|
1247 |
|
1248 // ---------------------------------------------------------------------------- |
|
1249 // CGlxDateAndTimeBoundCommand::HideLocationMenuItem |
|
1250 // ---------------------------------------------------------------------------- |
|
1251 // |
|
1252 void CGlxDateAndTimeBoundCommand::HideLocationMenuItem( CEikMenuPane& aMenu ) const |
|
1253 { |
|
1254 TRACER("CGlxDateAndTimeBoundCommand::HideLocationMenuItem"); |
|
1255 aMenu.SetItemDimmed( EGlxCmdAiwBase, ETrue ); |
|
1256 } |
|
1257 |
|
1258 // ---------------------------------------------------------------------------- |
|
1259 // CGlxDateAndTimeBoundCommand::Close |
|
1260 // ---------------------------------------------------------------------------- |
|
1261 // |
|
1262 void CGlxDateAndTimeBoundCommand::Close() |
|
1263 { |
|
1264 delete this; |
|
1265 } |
|
1266 |
|
1267 // ---------------------------------------------------------------------------- |
|
1268 // CGlxDateAndTimeBoundCommand::ChangeMskL |
|
1269 // ---------------------------------------------------------------------------- |
|
1270 // |
|
1271 void CGlxDateAndTimeBoundCommand::ChangeMskL() |
|
1272 { |
|
1273 TRACER("CGlxDateAndTimeBoundCommand::ChangeMskL"); |
|
1274 |
|
1275 CGlxUiUtility* uiUtility = CGlxUiUtility::UtilityL(); |
|
1276 uiUtility->ScreenFurniture()->ModifySoftkeyIdL(CEikButtonGroupContainer::EMiddleSoftkeyPosition, |
|
1277 EAknSoftkeyEmpty,R_GLX_METADATA_MSK_BLANK); |
|
1278 if ( uiUtility ) |
|
1279 { |
|
1280 uiUtility->Close(); |
|
1281 } |
|
1282 } |
|
1283 |
|
1284 // ---------------------------------------------------------------------------- |
|
1285 // CGlxDateAndTimeBoundCommand::SetDetailsDailogObserver |
|
1286 // ---------------------------------------------------------------------------- |
|
1287 // |
|
1288 void CGlxDateAndTimeBoundCommand::SetDetailsDailogObserver( MGlxMetadataDialogObserver& /*aObserver*/ ) |
|
1289 { |
|
1290 |
|
1291 } |
|
1292 |
|
1293 // ---------------------------------------------------------------------------- |
|
1294 // CGlxFileSizeBoundCommand::NewL |
|
1295 // ---------------------------------------------------------------------------- |
|
1296 // |
|
1297 EXPORT_C CGlxFileSizeBoundCommand* CGlxFileSizeBoundCommand::NewL() |
|
1298 { |
|
1299 TRACER("CGlxFileSizeBoundCommand::NewL"); |
|
1300 CGlxFileSizeBoundCommand* self = CGlxFileSizeBoundCommand::NewLC(); |
|
1301 CleanupStack::Pop( self ); |
|
1302 return self; |
|
1303 } |
|
1304 |
|
1305 // ---------------------------------------------------------------------------- |
|
1306 // CGlxFileSizeBoundCommand::NewLC |
|
1307 // ---------------------------------------------------------------------------- |
|
1308 // |
|
1309 CGlxFileSizeBoundCommand* CGlxFileSizeBoundCommand::NewLC() |
|
1310 { |
|
1311 TRACER("CGlxFileSizeBoundCommand::NewLC"); |
|
1312 CGlxFileSizeBoundCommand* self = new ( ELeave ) CGlxFileSizeBoundCommand; |
|
1313 CleanupStack::PushL( self ); |
|
1314 return self; |
|
1315 } |
|
1316 |
|
1317 CGlxFileSizeBoundCommand::~CGlxFileSizeBoundCommand() |
|
1318 { |
|
1319 |
|
1320 } |
|
1321 |
|
1322 // ---------------------------------------------------------------------------- |
|
1323 // CGlxFileSizeBoundCommand::OfferCommandL |
|
1324 // ---------------------------------------------------------------------------- |
|
1325 // |
|
1326 TBool CGlxFileSizeBoundCommand::OfferCommandL( TInt /*aCommandId*/ , MGlxMediaList& /*aMedialist*/ ) |
|
1327 { |
|
1328 TRACER("CGlxFileSizeBoundCommand::OfferCommandL"); |
|
1329 return ETrue; |
|
1330 } |
|
1331 |
|
1332 // ---------------------------------------------------------------------------- |
|
1333 // CGlxFileSizeBoundCommand::InitMenuL |
|
1334 // ---------------------------------------------------------------------------- |
|
1335 // |
|
1336 void CGlxFileSizeBoundCommand::InitMenuL( CEikMenuPane& /*aMenu*/ ) const |
|
1337 { |
|
1338 // no implementation |
|
1339 } |
|
1340 |
|
1341 // ---------------------------------------------------------------------------- |
|
1342 // CGlxFileSizeBoundCommand::HideLocationMenuItem |
|
1343 // ---------------------------------------------------------------------------- |
|
1344 // |
|
1345 void CGlxFileSizeBoundCommand::HideLocationMenuItem( CEikMenuPane& aMenu ) const |
|
1346 { |
|
1347 TRACER("CGlxFileSizeBoundCommand::HideLocationMenuItem"); |
|
1348 aMenu.SetItemDimmed( EGlxCmdAiwBase, ETrue ); |
|
1349 } |
|
1350 |
|
1351 // ---------------------------------------------------------------------------- |
|
1352 // CGlxFileSizeBoundCommand::Close |
|
1353 // ---------------------------------------------------------------------------- |
|
1354 // |
|
1355 void CGlxFileSizeBoundCommand::Close() |
|
1356 { |
|
1357 delete this; |
|
1358 } |
|
1359 |
|
1360 // ---------------------------------------------------------------------------- |
|
1361 // CGlxFileSizeBoundCommand::ChangeMskL |
|
1362 // ---------------------------------------------------------------------------- |
|
1363 // |
|
1364 void CGlxFileSizeBoundCommand::ChangeMskL() |
|
1365 { |
|
1366 TRACER("CGlxFileSizeBoundCommand::ChangeMskL"); |
|
1367 |
|
1368 CGlxUiUtility* uiUtility = CGlxUiUtility::UtilityL(); |
|
1369 uiUtility->ScreenFurniture()->ModifySoftkeyIdL(CEikButtonGroupContainer::EMiddleSoftkeyPosition, |
|
1370 EAknSoftkeyEmpty,R_GLX_METADATA_MSK_BLANK); |
|
1371 if ( uiUtility ) |
|
1372 { |
|
1373 uiUtility->Close(); |
|
1374 } |
|
1375 } |
|
1376 |
|
1377 // ---------------------------------------------------------------------------- |
|
1378 // CGlxFileSizeBoundCommand::SetDetailsDailogObserver |
|
1379 // ---------------------------------------------------------------------------- |
|
1380 // |
|
1381 void CGlxFileSizeBoundCommand::SetDetailsDailogObserver( MGlxMetadataDialogObserver& /*aObserver*/ ) |
|
1382 { |
|
1383 |
|
1384 } |
|
1385 |