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