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