|
1 /* |
|
2 * Copyright (c) 2007-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: Still image Post-capture view class for Camera application* |
|
15 */ |
|
16 |
|
17 |
|
18 // INCLUDE FILES |
|
19 |
|
20 #include "CamAppUiBase.h" |
|
21 #include "CamAppController.h" |
|
22 #include "CamStillPostCaptureView.h" |
|
23 #include "CamPostCaptureContainer.h" |
|
24 #include "CamLogger.h" |
|
25 #include "CamAppUi.h" |
|
26 #include <eikmenub.h> |
|
27 #include <StringLoader.h> |
|
28 #include <AknQueryDialog.h> |
|
29 #include <AiwCommon.hrh> |
|
30 #include <akntoolbar.h> |
|
31 #include "CamUtility.h" |
|
32 |
|
33 #include "Cam.hrh" |
|
34 |
|
35 #include <cameraapp.rsg> |
|
36 #include <vgacamsettings.rsg> |
|
37 |
|
38 #include <sendnorm.rsg> |
|
39 #include <sendui.h> |
|
40 #ifndef __WINS__ |
|
41 //#include <SFIUtilsAppInterface.h> |
|
42 |
|
43 #include <aknnotewrappers.h> // CAknInformationNote |
|
44 #endif |
|
45 |
|
46 #include "camactivepalettehandler.h" |
|
47 #include "camoneclickuploadutility.h" |
|
48 #include "CameraUiConfigManager.h" |
|
49 #include "OstTraceDefinitions.h" |
|
50 #ifdef OST_TRACE_COMPILER_IN_USE |
|
51 #include "CamStillPostCaptureViewTraces.h" |
|
52 #endif |
|
53 |
|
54 |
|
55 //CONSTANTS |
|
56 _LIT( KCamImageMimeType, "image/jpeg" ); |
|
57 |
|
58 // ========================= MEMBER FUNCTIONS ================================ |
|
59 |
|
60 |
|
61 // --------------------------------------------------------------------------- |
|
62 // CCamStillPostCaptureView::NewLC |
|
63 // Symbian OS two-phased constructor |
|
64 // --------------------------------------------------------------------------- |
|
65 // |
|
66 CCamStillPostCaptureView* CCamStillPostCaptureView::NewLC( CCamAppController& aController ) |
|
67 { |
|
68 CCamStillPostCaptureView* self = |
|
69 new( ELeave ) CCamStillPostCaptureView( aController ); |
|
70 |
|
71 CleanupStack::PushL( self ); |
|
72 self->ConstructL(); |
|
73 |
|
74 return self; |
|
75 } |
|
76 |
|
77 // --------------------------------------------------------------------------- |
|
78 // CCamStillPostCaptureView destructor |
|
79 // |
|
80 // --------------------------------------------------------------------------- |
|
81 // |
|
82 CCamStillPostCaptureView::~CCamStillPostCaptureView() |
|
83 { |
|
84 } |
|
85 |
|
86 // --------------------------------------------------------------------------- |
|
87 // CCamStillPostCaptureView::Id |
|
88 // Returns UID of view |
|
89 // --------------------------------------------------------------------------- |
|
90 // |
|
91 TUid CCamStillPostCaptureView::Id() const |
|
92 { |
|
93 return TUid::Uid( ECamViewIdStillPostCapture ); |
|
94 } |
|
95 |
|
96 // ----------------------------------------------------------------------------- |
|
97 // CCamStillPostCaptureView::HandleCommandL |
|
98 // Handle commands |
|
99 // ----------------------------------------------------------------------------- |
|
100 // |
|
101 void CCamStillPostCaptureView::HandleCommandL( TInt aCommand ) |
|
102 { |
|
103 PRINT1( _L("Camera => CCamStillPostCaptureView::HandleCommandL (%d)"), aCommand ) |
|
104 switch ( aCommand ) |
|
105 { |
|
106 case EAknSoftkeySelect: |
|
107 { |
|
108 CCamAppUiBase* appUi = static_cast<CCamAppUiBase*>( AppUi() ); |
|
109 if ( ECamImageCaptureTimeLapse == appUi->CurrentBurstMode() ) |
|
110 { |
|
111 CCamPostCaptureViewBase::HandleCommandL( aCommand ); |
|
112 } |
|
113 // In post-capture select key is disabled when embedded |
|
114 else if ( !iEmbedded ) |
|
115 { |
|
116 CEikMenuBar* menuBar = MenuBar(); |
|
117 if ( menuBar ) |
|
118 { |
|
119 menuBar->SetMenuTitleResourceId( ROID(R_CAM_STILL_POST_CAPTURE_OK_MENUBAR_ID)); |
|
120 menuBar->TryDisplayMenuBarL(); |
|
121 menuBar->SetMenuTitleResourceId( ROID(R_CAM_STILL_POST_CAPTURE_MENUBAR_ID)); |
|
122 } |
|
123 CCamPostCaptureViewBase::HandleCommandL( aCommand ); |
|
124 } |
|
125 else |
|
126 { |
|
127 AppUi()->HandleCommandL( ECamCmdSelect ); |
|
128 } |
|
129 } |
|
130 break; |
|
131 case ECamCmdDeleteSequence: |
|
132 { |
|
133 if ( DisplayDeleteSequenceNoteL() ) |
|
134 { |
|
135 HandleCommandL( ECamCmdNewPhoto ); |
|
136 } |
|
137 } |
|
138 break; |
|
139 case ECamCmdSendToCallerMultimedia: |
|
140 { |
|
141 #ifndef __WINS__ |
|
142 DoInCallSendL(); |
|
143 #endif |
|
144 } |
|
145 break; |
|
146 case ECamCmdQuickSend: |
|
147 { |
|
148 /*#ifndef __WINS__ |
|
149 if( iSFIUtils->IsCLIValidL() ) |
|
150 { |
|
151 DoInCallSendL(); |
|
152 } |
|
153 else |
|
154 #endif // __WINS__*/ |
|
155 //{ |
|
156 DoSendAsL(); |
|
157 //} |
|
158 } |
|
159 break; |
|
160 |
|
161 case ECamCmdRenameImage: |
|
162 { |
|
163 CCamAppUi* appUi = static_cast<CCamAppUi*>( AppUi() );; |
|
164 QueryRenameL( ECamControllerImage ); |
|
165 // inform the Media gallery of name change |
|
166 TRAPD( ignore, |
|
167 appUi->HandleControllerEventL( ECamEventMediaFileChanged, KErrNone ) ); |
|
168 if ( ignore ) |
|
169 { |
|
170 // Do nothing (removes build warning) |
|
171 } |
|
172 break; |
|
173 } |
|
174 |
|
175 case ECamCmdPrint: |
|
176 { |
|
177 PRINT( _L("Camera => CCamStillPostCaptureView::HandleCommandL PRINT")) |
|
178 |
|
179 CAiwGenericParamList& inParams = iAiwServiceHandler->InParamListL(); |
|
180 CAiwGenericParamList& outParams = iAiwServiceHandler->OutParamListL(); |
|
181 // Add file path to AIW parameters |
|
182 TAiwVariant variant( iController.CurrentFullFileName() ); |
|
183 TAiwGenericParam param( EGenericParamFile, variant ); |
|
184 inParams.AppendL( param ); |
|
185 |
|
186 iAiwServiceHandler->ExecuteServiceCmdL( KAiwCmdPrint, inParams, outParams ); |
|
187 // we are 'embedding' Edit & Print apps |
|
188 static_cast<CCamAppUiBase*>( AppUi() ) ->SetEmbedding( ETrue ); |
|
189 } |
|
190 break; |
|
191 case ECamCmdPrintPlugin: |
|
192 { |
|
193 // we are 'embedding' Edit & Print apps |
|
194 PRINT( _L("Camera => CCamStillPostCaptureView::HandleCommandL ECamCmdPrintPlugin")) |
|
195 static_cast<CCamAppUiBase*>( AppUi() ) ->SetEmbedding( ETrue ); |
|
196 } |
|
197 break; |
|
198 |
|
199 case ECamCmdPrintIntent: |
|
200 { |
|
201 // we are 'embedding' Edit & Print apps |
|
202 PRINT( _L("Camera => CCamStillPostCaptureView::HandleCommandL ECamCmdPrintIntent")) |
|
203 static_cast<CCamAppUiBase*>( AppUi() ) ->SetEmbedding( ETrue ); |
|
204 } |
|
205 break; |
|
206 |
|
207 default: |
|
208 { |
|
209 // Handle AIW commands |
|
210 TInt aiwServiceCmd = iAiwServiceHandler->ServiceCmdByMenuCmd( aCommand ); |
|
211 if ( aiwServiceCmd != KAiwCmdNone ) |
|
212 { |
|
213 PRINT( _L("CCamStillPostCaptureView::HandleCommandL AIW command enabling prevention of timeout") ); |
|
214 |
|
215 CAiwGenericParamList& inParams = iAiwServiceHandler->InParamListL(); |
|
216 CAiwGenericParamList& outParams = iAiwServiceHandler->OutParamListL(); |
|
217 // Add file path to AIW parameters |
|
218 TAiwVariant variant( iController.CurrentFullFileName() ); |
|
219 TAiwGenericParam param( EGenericParamFile, variant ); |
|
220 inParams.AppendL( param ); |
|
221 |
|
222 TCamOrientation orientation = static_cast<CCamAppUiBase*>( AppUi() )->CamOrientation(); |
|
223 |
|
224 // Don't add the mime type if uploading, since Share client |
|
225 // will figure it out from the file |
|
226 if ( aiwServiceCmd != KAiwCmdUpload ) |
|
227 { |
|
228 // Set as contact call image needs image MIME type as AIW param |
|
229 // Set as wall paper requires MIME type also. |
|
230 TAiwVariant variant2( KCamImageMimeType ); |
|
231 TAiwGenericParam param2( EGenericParamMIMEType, variant2 ); |
|
232 inParams.AppendL( param2 ); |
|
233 } |
|
234 |
|
235 iAiwServiceHandler->ExecuteMenuCmdL( aCommand, inParams, outParams, 0, this ); |
|
236 PRINT( _L("CCamStillPostCaptureView::HandleCommandL AIW command") ); |
|
237 |
|
238 // To let camera draw the captured image after assigning an image |
|
239 // to contact from postcapture view, don't set iEmbedding to ETrue |
|
240 // when assign an image to contact from postcapture view. |
|
241 if ( ECamCmdEditVideo != aCommand ) |
|
242 { |
|
243 // We are 'embedding' Edit & Print apps |
|
244 static_cast<CCamAppUiBase*>( AppUi() ) ->SetEmbedding( ETrue ); |
|
245 } |
|
246 } |
|
247 else |
|
248 { |
|
249 CCamPostCaptureViewBase::HandleCommandL( aCommand ); |
|
250 } |
|
251 } |
|
252 } |
|
253 } |
|
254 |
|
255 |
|
256 // ----------------------------------------------------------------------------- |
|
257 // CCamStillPostCaptureView::DoActivateL |
|
258 // Activates the view |
|
259 // ----------------------------------------------------------------------------- |
|
260 // |
|
261 void CCamStillPostCaptureView::DoActivateL( |
|
262 const TVwsViewId& aPreViewId, |
|
263 TUid aCustomMessageId, |
|
264 const TDesC8& aCustomMessage ) |
|
265 { |
|
266 OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMSTILLPOSTCAPTUREVIEW_DOACTIVATEL, "e_CCamStillPostCaptureView_DoActivateL 1" ); |
|
267 PRINT( _L("Camera => CCamStillPostCaptureView::DoActivateL")) |
|
268 PERF_EVENT_START_L2( EPerfEventStillPostCaptureViewActivation ); |
|
269 CCamAppUi* appUi = static_cast<CCamAppUi*>( AppUi() ); |
|
270 |
|
271 TBool timeLapseOn = (ECamImageCaptureTimeLapse == appUi->CurrentBurstMode()); |
|
272 |
|
273 // Ensure the correct menu is used for the current mode. |
|
274 CEikMenuBar* menuBar = MenuBar(); |
|
275 if ( menuBar ) |
|
276 { |
|
277 if ( timeLapseOn ) |
|
278 { |
|
279 menuBar->SetMenuTitleResourceId( |
|
280 ROID(R_CAM_TIMELAPSE_POST_CAPTURE_MENUBAR_ID)); |
|
281 } |
|
282 else |
|
283 { |
|
284 menuBar->SetMenuTitleResourceId( |
|
285 ROID(R_CAM_STILL_POST_CAPTURE_MENUBAR_ID)); |
|
286 } |
|
287 } |
|
288 if ( iController.IsTouchScreenSupported() ) |
|
289 { |
|
290 if ( appUi->IsSecondCameraEnabled() ) |
|
291 { |
|
292 if ( iOneClickUploadUtility->OneClickUploadSupported() ) |
|
293 { |
|
294 TInt resourceId = appUi->IsQwerty2ndCamera()? |
|
295 R_CAM_STILL_POSTCAPTURE_TOOLBAR_LANDSCAPE_UPLOAD: |
|
296 R_CAM_STILL_POSTCAPTURE_TOOLBAR_PORTRAIT_UPLOAD; |
|
297 CreateAndSetToolbarL( resourceId ); |
|
298 } |
|
299 else |
|
300 { |
|
301 TInt resourceId = appUi->IsQwerty2ndCamera()? |
|
302 R_CAM_STILL_POSTCAPTURE_TOOLBAR_LANDSCAPE: |
|
303 R_CAM_STILL_POSTCAPTURE_TOOLBAR_PORTRAIT; |
|
304 CreateAndSetToolbarL( resourceId ); |
|
305 } |
|
306 } |
|
307 else |
|
308 { |
|
309 if ( iOneClickUploadUtility->OneClickUploadSupported() ) |
|
310 { |
|
311 CreateAndSetToolbarL( |
|
312 R_CAM_STILL_POSTCAPTURE_TOOLBAR_UPLOAD ); |
|
313 } |
|
314 else |
|
315 { |
|
316 CreateAndSetToolbarL( |
|
317 R_CAM_STILL_POSTCAPTURE_TOOLBAR ); |
|
318 } |
|
319 } |
|
320 } |
|
321 |
|
322 CCamPostCaptureViewBase::DoActivateL( |
|
323 aPreViewId, aCustomMessageId, aCustomMessage ); |
|
324 |
|
325 PERF_EVENT_END_L2( EPerfEventStillPostCaptureViewActivation ); |
|
326 iAiwServiceHandler->Reset(); |
|
327 // attach interest for PRINT from Active Toolbar |
|
328 iAiwServiceHandler->AttachL( R_CAM_MOVE_TO_STILL_IMAGE_INTEREST_AT ); |
|
329 |
|
330 iAiwServiceHandler->AttachMenuL( ROID(R_CAM_STILL_POST_CAPTURE_MENU_ID), |
|
331 R_CAM_MOVE_TO_STILL_IMAGE_INTEREST ); |
|
332 |
|
333 iAiwServiceHandler->AttachMenuL( ROID( R_CAM_STILL_POST_CAPTURE_MENU_ID), |
|
334 R_CAM_SHARE_ON_OVI_INTEREST ); |
|
335 |
|
336 iAiwServiceHandler->AttachMenuL( ROID( R_CAM_STILL_POST_CAPTURE_MENU_ID), |
|
337 R_CAM_SET_AS_CALL_IMAGE_INTEREST ); |
|
338 OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMSTILLPOSTCAPTUREVIEW_DOACTIVATEL, "e_CCamStillPostCaptureView_DoActivateL 0" ); |
|
339 } |
|
340 |
|
341 |
|
342 // ----------------------------------------------------------------------------- |
|
343 // CCamStillPostCaptureView::DisplayDeleteNoteL() |
|
344 // Display the delete confirmation note |
|
345 // ----------------------------------------------------------------------------- |
|
346 // |
|
347 TBool CCamStillPostCaptureView::DisplayDeleteNoteL() |
|
348 { |
|
349 // Display the delete confirmation note |
|
350 TInt err = KErrNone; |
|
351 HBufC* confirmationText; |
|
352 confirmationText = StringLoader::LoadLC( R_CAM_STILL_POST_CAPTURE_DELETE_NOTE_TEXT ); |
|
353 CAknQueryDialog* confirmationDialog = new( ELeave )CAknQueryDialog( *confirmationText ); |
|
354 CleanupStack::PopAndDestroy( confirmationText ); |
|
355 if ( confirmationDialog->ExecuteLD( R_CAM_STILL_POST_CAPTURE_DELETE_NOTE ) ) |
|
356 { |
|
357 if ( iEmbedded ) |
|
358 { |
|
359 //To prevent sofkeys blinking when capturing, we need to blank |
|
360 //the softkeys here |
|
361 BlankSoftkeysL(); |
|
362 Cba()->DrawNow(); |
|
363 } |
|
364 err = iController.DeleteCurrentFile(); |
|
365 if ( err ) |
|
366 { |
|
367 User::Leave( err ); |
|
368 } |
|
369 return ETrue; |
|
370 } |
|
371 else |
|
372 { |
|
373 return EFalse; |
|
374 } |
|
375 } |
|
376 |
|
377 // ----------------------------------------------------------------------------- |
|
378 // CCamStillPostCaptureView::DisplayDeleteSequenceNoteL() |
|
379 // Display the delete confirmation note for a sequence of images |
|
380 // ----------------------------------------------------------------------------- |
|
381 // |
|
382 TBool CCamStillPostCaptureView::DisplayDeleteSequenceNoteL() |
|
383 { |
|
384 // Display the delete sequence confirmation note |
|
385 HBufC* confirmationText; |
|
386 |
|
387 confirmationText = StringLoader::LoadLC( R_CAM_BURST_DELETE_MULTIPLE_NOTE_TEXT, iController.TimeLapseImageCount() ); |
|
388 |
|
389 // Create the dialog with the text, and show it to the user |
|
390 CAknQueryDialog* confirmationDialog = new( ELeave )CAknQueryDialog( *confirmationText ); |
|
391 CleanupStack::PopAndDestroy( confirmationText ); |
|
392 |
|
393 if ( confirmationDialog->ExecuteLD( R_CAM_BURST_DELETE_MULTIPLE_NOTE ) ) |
|
394 { |
|
395 iController.DeleteTimeLapseFiles(); |
|
396 return ETrue; |
|
397 } |
|
398 else |
|
399 { |
|
400 return EFalse; |
|
401 } |
|
402 } |
|
403 |
|
404 // --------------------------------------------------------------------------- |
|
405 // CCamStillPostCaptureView::CCamStillPostCaptureView |
|
406 // C++ constructor |
|
407 // --------------------------------------------------------------------------- |
|
408 // |
|
409 CCamStillPostCaptureView::CCamStillPostCaptureView( CCamAppController& aController ) |
|
410 : CCamPostCaptureViewBase( aController ) |
|
411 { |
|
412 } |
|
413 |
|
414 // --------------------------------------------------------------------------- |
|
415 // CCamStillPostCaptureView::ConstructL |
|
416 // Symbian OS 2nd phase constructor |
|
417 // --------------------------------------------------------------------------- |
|
418 // |
|
419 void CCamStillPostCaptureView::ConstructL() |
|
420 { |
|
421 BaseConstructL( ROID(R_CAM_STILL_POST_CAPTURE_VIEW_ID)); |
|
422 CCamPostCaptureViewBase::ConstructL(); |
|
423 |
|
424 iAiwServiceHandler->AttachMenuL( ROID( R_CAM_STILL_POST_CAPTURE_MENU_ID), R_CAM_SHARE_ON_OVI_INTEREST ); |
|
425 iRockerKeyPress = EFalse; |
|
426 } |
|
427 |
|
428 |
|
429 // --------------------------------------------------------------------------- |
|
430 // CCamStillPostCaptureView::DoDeactivate |
|
431 // Deactivate this view |
|
432 // --------------------------------------------------------------------------- |
|
433 // |
|
434 void CCamStillPostCaptureView::DoDeactivate() |
|
435 { |
|
436 CCamPostCaptureViewBase::DoDeactivate(); |
|
437 } |
|
438 |
|
439 // --------------------------------------------------------------------------- |
|
440 // CCamStillPostCaptureView::SetTitlePaneTextL |
|
441 // Set the view's title text |
|
442 // --------------------------------------------------------------------------- |
|
443 // |
|
444 void CCamStillPostCaptureView::SetTitlePaneTextL() |
|
445 { |
|
446 TBool titleAlwaysShowsFileName = EFalse; |
|
447 |
|
448 CCamAppUiBase* appUi = static_cast<CCamAppUiBase*>( AppUi() ); |
|
449 if ( appUi->CamOrientation() == ECamOrientationViewMode || |
|
450 titleAlwaysShowsFileName ) |
|
451 { |
|
452 appUi->SetTitleL( iController.CurrentImageName() ); |
|
453 } |
|
454 } |
|
455 |
|
456 |
|
457 // --------------------------------------------------------------------------- |
|
458 // CCamStillPostCaptureView::ProcessCommandL |
|
459 // Handling ECamCmdToggleActiveToolbar from any of the PostCaptureView's |
|
460 // either Image/Video. |
|
461 // --------------------------------------------------------------------------- |
|
462 // |
|
463 void CCamStillPostCaptureView::ProcessCommandL( TInt aCommand ) |
|
464 { |
|
465 CCamAppUi* appUi = static_cast<CCamAppUi*>( AppUi() ); |
|
466 TCamOrientation orientation = appUi->CamOrientation(); |
|
467 if( orientation == ECamOrientationCamcorder || |
|
468 orientation == ECamOrientationCamcorderLeft || |
|
469 orientation == ECamOrientationPortrait ) |
|
470 { |
|
471 if ( aCommand == ECamCmdToggleActiveToolbar ) |
|
472 { |
|
473 CCamPostCaptureViewBase::HandleCommandL( aCommand ); |
|
474 } |
|
475 else |
|
476 { |
|
477 CAknView::ProcessCommandL( aCommand ); |
|
478 } |
|
479 } |
|
480 else |
|
481 { |
|
482 if ( aCommand == EAknSoftkeyContextOptions && !iRockerKeyPress ) |
|
483 { |
|
484 iRockerKeyPress = ETrue; |
|
485 MenuBar()->SetContextMenuTitleResourceId( ROID(R_CAM_STILL_POST_CAPTURE_MENUBAR_ID) ); |
|
486 // Here we launch the Context Options by Hiding Help and Exit |
|
487 // Check DynInitMenuPaneL() method and search for iRockerKeyPress for more details |
|
488 MenuBar()->SetMenuType( CEikMenuBar::EMenuContext ); |
|
489 MenuBar()->TryDisplayMenuBarL(); |
|
490 // Here we again set back the type of menu to "Options" when pressed LSK |
|
491 MenuBar()->SetMenuType( CEikMenuBar::EMenuOptions ); |
|
492 } |
|
493 else |
|
494 { |
|
495 CAknView::ProcessCommandL( aCommand ); |
|
496 } |
|
497 } |
|
498 // CALL THE BASE CLASS |
|
499 |
|
500 } |
|
501 |
|
502 // --------------------------------------------------------------------------- |
|
503 // CCamStillPostCaptureView::DynInitMenuPaneL |
|
504 // Changes MenuPane dynamically |
|
505 // --------------------------------------------------------------------------- |
|
506 // |
|
507 void CCamStillPostCaptureView::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ) |
|
508 { |
|
509 CCamPostCaptureViewBase::DynInitMenuPaneL( aResourceId, aMenuPane ); |
|
510 |
|
511 if ( iAiwServiceHandler && iAiwServiceHandler->IsAiwMenu( aResourceId ) ) |
|
512 { |
|
513 CAiwGenericParamList& paramList = iAiwServiceHandler->InParamListL(); |
|
514 TAiwVariant variant( iController.CurrentFullFileName() ); |
|
515 TAiwGenericParam param( EGenericParamFile, variant ); |
|
516 paramList.AppendL( param ); |
|
517 |
|
518 // Set as contact call image needs image MIME type as AIW param |
|
519 TCamOrientation orientation = static_cast<CCamAppUiBase*>( AppUi() )->CamOrientation(); |
|
520 |
|
521 TAiwVariant variant2( KCamImageMimeType ); |
|
522 TAiwGenericParam param2( EGenericParamMIMEType, variant2 ); |
|
523 paramList.AppendL( param2 ); |
|
524 |
|
525 iAiwServiceHandler->InitializeMenuPaneL( |
|
526 *aMenuPane, |
|
527 aResourceId, |
|
528 ECamCmdAIWCommands, |
|
529 paramList ); |
|
530 } |
|
531 |
|
532 if ( iAiwServiceHandler ) |
|
533 { |
|
534 // handle any AIW menu cascades |
|
535 if ( iAiwServiceHandler->HandleSubmenuL( *aMenuPane ) ) |
|
536 { |
|
537 return; |
|
538 } |
|
539 } |
|
540 |
|
541 if ( aResourceId == ROID( R_CAM_STILL_POST_CAPTURE_MENU_ID ) || |
|
542 aResourceId == ROID( R_CAM_STILL_POST_CAPTURE_OK_MENU_ID ) ) |
|
543 { |
|
544 TBool showSend = ETrue; |
|
545 TBool showSendToCaller = EFalse; |
|
546 |
|
547 /*#ifndef __WINS__ |
|
548 if ( iSFIUtils->IsCLIValidL() ) |
|
549 { |
|
550 showSend = EFalse; |
|
551 showSendToCaller = ETrue; |
|
552 } |
|
553 #endif*/ |
|
554 |
|
555 TCamOrientation orientation = |
|
556 static_cast<CCamAppUiBase*>( AppUi() )->CamOrientation(); |
|
557 |
|
558 if ( orientation == ECamOrientationCamcorder || |
|
559 orientation == ECamOrientationCamcorderLeft || |
|
560 orientation == ECamOrientationPortrait ) |
|
561 { |
|
562 showSend = EFalse; |
|
563 showSendToCaller = EFalse; |
|
564 } |
|
565 |
|
566 TInt itemPos = 0; |
|
567 if ( aMenuPane->MenuItemExists( ECamCmdSendToCallerMultimedia, itemPos ) ) |
|
568 { |
|
569 aMenuPane->SetItemDimmed( |
|
570 ECamCmdSendToCallerMultimedia, !showSendToCaller ); |
|
571 } |
|
572 |
|
573 if ( aMenuPane->MenuItemExists( ECamCmdSend, itemPos ) ) |
|
574 { |
|
575 aMenuPane->SetItemDimmed( |
|
576 ECamCmdSend, !showSend ); |
|
577 } |
|
578 |
|
579 /* |
|
580 * MSK : ContextOptions --> We just hide Help and Exit from the Options Menu when |
|
581 * the MSK is pressed in the postcapture still view |
|
582 * iRockerKeyPress represents MSK key event in still postcapture view |
|
583 */ |
|
584 if ( aMenuPane->MenuItemExists( EAknCmdHelp, itemPos ) && |
|
585 aMenuPane->MenuItemExists( ECamCmdInternalExit, itemPos ) ) |
|
586 { |
|
587 if ( iRockerKeyPress ) |
|
588 { // We hide Help and Exit |
|
589 aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue ); |
|
590 aMenuPane->SetItemDimmed( ECamCmdInternalExit, ETrue ); |
|
591 iRockerKeyPress = EFalse; |
|
592 } |
|
593 else |
|
594 { // We show Help and Exit |
|
595 aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse ); |
|
596 aMenuPane->SetItemDimmed( ECamCmdInternalExit, EFalse ); |
|
597 } |
|
598 } |
|
599 } |
|
600 } |
|
601 |
|
602 // --------------------------------------------------------------------------- |
|
603 // CCamStillPostCaptureView::HandleNotifyL |
|
604 // Handles any notification caused by asynchronous ExecuteCommandL |
|
605 // or event. |
|
606 // --------------------------------------------------------------------------- |
|
607 // |
|
608 TInt CCamStillPostCaptureView::HandleNotifyL( |
|
609 TInt /*aCmdId*/, |
|
610 TInt aEventId, |
|
611 CAiwGenericParamList& /*aEventParamList*/, |
|
612 const CAiwGenericParamList& /*aInParamList*/ ) |
|
613 { |
|
614 //AIW fails to assign. eg. the contact is locked for being used now. |
|
615 if ( aEventId == KAiwEventError && iController.IsAppUiAvailable() ) |
|
616 { |
|
617 CCamAppUi* appUi = static_cast<CCamAppUi*>( AppUi() ); |
|
618 TRAP_IGNORE( appUi->HandleCameraErrorL( KErrInUse ) ); |
|
619 } |
|
620 return 0; |
|
621 } |
|
622 |
|
623 |
|
624 // --------------------------------------------------------------------------- |
|
625 // CCamStillPostCaptureView::DynInitToolbarL |
|
626 // Dynamically initialize toolbar contents |
|
627 // --------------------------------------------------------------------------- |
|
628 // |
|
629 void CCamStillPostCaptureView::DynInitToolbarL( TInt aResourceId, |
|
630 CAknToolbar* aToolbar ) |
|
631 { |
|
632 PRINT2( _L("Camera => CCamStillPostCaptureView::DynInitToolbarL(%d, 0x%X)" ), aResourceId, aToolbar ); |
|
633 (void)aResourceId; //remove compiler warning |
|
634 |
|
635 if( iEmbedded && aToolbar && iController.IsTouchScreenSupported() ) |
|
636 { |
|
637 // HideItem will not do anything if a button for the given |
|
638 // command ID is not found. |
|
639 aToolbar->HideItem( ECamCmdSend, ETrue, EFalse ); |
|
640 aToolbar->HideItem( ECamCmdPhotos, ETrue, EFalse ); |
|
641 aToolbar->HideItem( ECamCmdOneClickUpload, ETrue, EFalse ); |
|
642 aToolbar->HideItem( ECamCmdDelete, ETrue, EFalse ); |
|
643 } |
|
644 |
|
645 PRINT2( _L("Camera <= CCamStillPostCaptureView::DynInitToolbarL(%d, 0x%X)" ), aResourceId, aToolbar ); |
|
646 } |
|
647 |
|
648 // End of File |