1 /* |
|
2 * Copyright (c) 2007-2010 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: Control for displaying remaining images/videos in Navi Pane |
|
15 * |
|
16 * Copyright © 2007-2008 Nokia. All rights reserved. |
|
17 * This material, including documentation and any related computer |
|
18 * programs, is protected by copyright controlled by Nokia. All |
|
19 * rights are reserved. Copying, including reproducing, storing, |
|
20 * adapting or translating, any or all of this material requires the |
|
21 * prior written consent of Nokia. This material also contains |
|
22 * confidential information which may not be disclosed to others |
|
23 * without the prior written consent of Nokia. |
|
24 |
|
25 * |
|
26 * |
|
27 */ |
|
28 |
|
29 |
|
30 // INCLUDE FILES |
|
31 #include <eiklabel.h> |
|
32 #include <eikapp.h> // For CEikApplication |
|
33 #include <eikenv.h> |
|
34 #include <AknsUtils.h> |
|
35 #include <AknsDrawUtils.h> |
|
36 #include <aknconsts.h> |
|
37 #include <StringLoader.h> // StringLoader |
|
38 #include <e32base.h> |
|
39 #include <barsread.h> // TResourceReader |
|
40 #include <AknBidiTextUtils.h> |
|
41 #include <cameraapp.mbg> |
|
42 #include <AknLayoutFont.h> |
|
43 #include <AknsFrameBackgroundControlContext.h> |
|
44 #include <aknlayoutscalable_apps.cdl.h> |
|
45 #include <aknnavide.h> |
|
46 #include <layoutmetadata.cdl.h> |
|
47 |
|
48 #include "CamNaviCounterModel.h" |
|
49 #include "CamAppUi.h" |
|
50 #include "CamUtility.h" |
|
51 #include "CamSelfTimer.h" |
|
52 |
|
53 #include <cameraapp.rsg> |
|
54 #include <vgacamsettings.rsg> |
|
55 |
|
56 #include "CamLogger.h" |
|
57 #include "CamDecorator.h" |
|
58 #include "camtextitem.h" |
|
59 #include "CameraUiConfigManager.h" |
|
60 #include "OstTraceDefinitions.h" |
|
61 #ifdef OST_TRACE_COMPILER_IN_USE |
|
62 #include "CamNaviCounterModelTraces.h" |
|
63 #endif |
|
64 |
|
65 |
|
66 // CONSTANTS |
|
67 const TInt KMaxRemainingImagesShown = 9999; |
|
68 const TInt KCamDefaultCapturedImagesTextLen = 30; |
|
69 _LIT( KNumberFormat, "%04d" ); |
|
70 _LIT( KTimeLapseImageFormat, "%04d/%04d" ); |
|
71 |
|
72 const TAknsItemID KNaviPaneMajorColour = KAknsIIDQsnComponentColors; |
|
73 const TInt KNaviPaneMinorColour = EAknsCIQsnComponentColorsCG2; |
|
74 |
|
75 // Sequence mode related constants that define the amount of pictures taken |
|
76 // with sequence mode. |
|
77 const TInt KShortBurstCount = 18; // number of images captured during burst |
|
78 |
|
79 // ========================= MEMBER FUNCTIONS ================================ |
|
80 |
|
81 // --------------------------------------------------------- |
|
82 // CCamNaviCounterModel::NewL |
|
83 // Factory construction function |
|
84 // --------------------------------------------------------- |
|
85 // |
|
86 CCamNaviCounterModel* |
|
87 CCamNaviCounterModel::NewL( CCamAppController& aController ) |
|
88 { |
|
89 CCamNaviCounterModel* self = |
|
90 new( ELeave ) CCamNaviCounterModel( aController ); |
|
91 CleanupStack::PushL( self ); |
|
92 self->ConstructL(); |
|
93 CleanupStack::Pop( self ); |
|
94 return self; |
|
95 } |
|
96 |
|
97 // Destructor |
|
98 CCamNaviCounterModel::~CCamNaviCounterModel() |
|
99 { |
|
100 iController.RemoveControllerObserver( this ); |
|
101 |
|
102 delete iVideoTextItem; |
|
103 delete iPhotoTextItem; |
|
104 |
|
105 delete iSequenceImageTextItem; |
|
106 delete iSequenceCapturedTextItem; |
|
107 delete iTimeLapseCountdownTextItem; |
|
108 |
|
109 CCamNaviCounterModel::UnloadResourceData(); |
|
110 |
|
111 delete iMpeg4Icon; |
|
112 delete iMpeg4IconMask; |
|
113 delete i3GPIcon; |
|
114 delete i3GPIconMask; |
|
115 |
|
116 CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi()); |
|
117 if ( appUi ) |
|
118 { |
|
119 if ( !iController.IsInShutdownMode() ) |
|
120 { |
|
121 appUi->RemoveBurstModeObserver( this ); |
|
122 } |
|
123 delete iSequenceIcon; |
|
124 delete iSequenceMask; |
|
125 } |
|
126 |
|
127 delete iSelfTimerIcon; |
|
128 delete iSelfTimerMask; |
|
129 |
|
130 // If not shutting down, deregister from SelfTimer observers. |
|
131 // If we try to deregister when shutting down, the object has already been |
|
132 // deleted |
|
133 if ( !iController.IsInShutdownMode() && appUi ) |
|
134 { |
|
135 // ...Remove self as an observer of the self timer. |
|
136 CCamSelfTimer* selftimer = appUi->SelfTimer(); |
|
137 if ( selftimer ) |
|
138 { |
|
139 selftimer->RemoveObserver( this ); |
|
140 } |
|
141 } |
|
142 |
|
143 #ifdef PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR |
|
144 delete iGenericIcon; |
|
145 delete iGenericMask; |
|
146 #endif // PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR |
|
147 |
|
148 delete iAudioMuteIcon; |
|
149 delete iAudioMuteMask; |
|
150 |
|
151 |
|
152 #ifdef PRODUCT_SUPPORTS_NAVIPANE_MODE_SUBTITLE |
|
153 delete iSubtitlePhotoIcon; |
|
154 delete iSubtitlePhotoMask; |
|
155 delete iSubtitleVideoIcon; |
|
156 delete iSubtitleVideoMask; |
|
157 #endif // PRODUCT_SUPPORTS_NAVIPANE_MODE_SUBTITLE |
|
158 |
|
159 delete iTimeFormat; |
|
160 delete iCountDownText; |
|
161 delete iObserverHandler; |
|
162 } |
|
163 |
|
164 // ----------------------------------------------------------------------------- |
|
165 // CCamNaviCounterModel::LoadResourceDataL() |
|
166 // Reads in all information needed from resources |
|
167 // ----------------------------------------------------------------------------- |
|
168 // |
|
169 void CCamNaviCounterModel::LoadResourceDataL() |
|
170 { |
|
171 OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMNAVICOUNTERMODEL_LOADRESOURCEDATAL, "e_CCamNaviCounterModel_LoadResourceDataL 1" ); |
|
172 |
|
173 PRINT( _L("Camera => CCamNaviCounterModel::LoadResourceDataL") ); |
|
174 |
|
175 // Read the time format resource |
|
176 PRINT( _L("Camera <> construct timeformat..") ); |
|
177 delete iTimeFormat; |
|
178 iTimeFormat = NULL; |
|
179 if ( !Layout_Meta_Data::IsLandscapeOrientation() ) |
|
180 { |
|
181 iTimeFormat = CEikonEnv::Static()->AllocReadResourceL( R_QTN_TIME_DURAT_MIN_SEC_WITH_ZERO ); |
|
182 } |
|
183 else |
|
184 { |
|
185 iTimeFormat = CEikonEnv::Static()->AllocReadResourceL( R_QTN_TIME_DURAT_LONG ); |
|
186 } |
|
187 |
|
188 CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() ); |
|
189 |
|
190 delete iPhotoTextItem; |
|
191 iPhotoTextItem = NULL; |
|
192 iPhotoTextItem = CCamTextItem::NewL(); |
|
193 |
|
194 delete iVideoTextItem; |
|
195 iVideoTextItem = NULL; |
|
196 iVideoTextItem = CCamTextItem::NewL(); |
|
197 |
|
198 delete iSequenceImageTextItem; |
|
199 iSequenceImageTextItem = NULL; |
|
200 iSequenceImageTextItem = CCamTextItem::NewL(); |
|
201 |
|
202 delete iTimeLapseCountdownTextItem; |
|
203 iTimeLapseCountdownTextItem = NULL; |
|
204 iTimeLapseCountdownTextItem = CCamTextItem::NewL(); |
|
205 |
|
206 delete iSequenceCapturedTextItem; |
|
207 iSequenceCapturedTextItem = NULL; |
|
208 iSequenceCapturedTextItem = CCamTextItem::NewL(); |
|
209 |
|
210 iCamOrientation = appUi->CamOrientation(); |
|
211 |
|
212 if ( Layout_Meta_Data::IsLandscapeOrientation() || CamUtility::IsNhdDevice() ) |
|
213 { |
|
214 TSize screenSize; |
|
215 AknLayoutUtils::LayoutMetricsSize( AknLayoutUtils::EScreen, screenSize ); |
|
216 iExtent = TRect( TPoint(), screenSize ); |
|
217 } |
|
218 else |
|
219 { |
|
220 TRect screenRect; |
|
221 AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, screenRect ); |
|
222 iExtent = screenRect; |
|
223 } |
|
224 |
|
225 if ( CamUtility::IsNhdDevice() ) |
|
226 { |
|
227 TouchLayoutL(); |
|
228 } |
|
229 else |
|
230 { |
|
231 if ( !Layout_Meta_Data::IsLandscapeOrientation() ) |
|
232 { |
|
233 NonTouchLayoutSecondaryL(); |
|
234 } |
|
235 else |
|
236 { |
|
237 NonTouchLayoutL(); |
|
238 } |
|
239 } |
|
240 |
|
241 iVidPostStorageIconRect = iVidPreStorageIconRect; |
|
242 |
|
243 |
|
244 if ( iController.UiConfigManagerPtr() && |
|
245 iController.UiConfigManagerPtr()->IsLocationSupported() ) |
|
246 { |
|
247 iLocationIconVisible = (/*TCamLocationId::ECamLocationOn*/1 == iController.IntegerSettingValue( ECamSettingItemRecLocation )); |
|
248 // If location setting is on, then the decoration should be wider to fit the location icon |
|
249 if ( iLocationIconVisible ) |
|
250 { |
|
251 iPhotoPrecapDecorator = CCamDecorator::NewL( iController, R_CAM_STILL_PRECAP_NAVICOUNTER_DECORATIONS_CAMCORDER_LOCATION ); |
|
252 } |
|
253 else |
|
254 { |
|
255 iPhotoPrecapDecorator = CCamDecorator::NewL( iController, R_CAM_STILL_PRECAP_NAVICOUNTER_DECORATIONS_CAMCORDER ); |
|
256 } |
|
257 } |
|
258 else |
|
259 { |
|
260 iPhotoPrecapDecorator = CCamDecorator::NewL( iController, R_CAM_STILL_PRECAP_NAVICOUNTER_DECORATIONS_CAMCORDER ); |
|
261 } |
|
262 |
|
263 iVideoPrecapDecorator = CCamDecorator::NewL( iController, R_CAM_VIDEO_PRECAP_NAVICOUNTER_DECORATIONS_CAMCORDER ); |
|
264 |
|
265 iPhotoPostcapDecorator = CCamDecorator::NewL( iController, R_CAM_STILL_POSTCAP_NAVICOUNTER_DECORATIONS_CAMCORDER ); |
|
266 iVideoPostcapDecorator = CCamDecorator::NewL( iController, R_CAM_VIDEO_POSTCAP_NAVICOUNTER_DECORATIONS_CAMCORDER ); |
|
267 |
|
268 iSequenceInCaptureDecorator = CCamDecorator::NewL( iController, R_CAM_TIMELAPSE_IN_CAPTURE_NAVICOUNTER_DECORATIONS ); |
|
269 iTimeLapsePostCaptureDecorator = CCamDecorator::NewL( iController, R_CAM_TIMELAPSE_POST_CAPTURE_NAVICOUNTER_DECORATIONS ); |
|
270 |
|
271 TFileName resFileName; |
|
272 CamUtility::ResourceFileName( resFileName ); |
|
273 TPtrC resname = resFileName; |
|
274 |
|
275 // Create component bitmaps |
|
276 TSize size = iVidPostStorageIconRect.Rect().Size(); |
|
277 TCamOrientation orientation = appUi->CamOrientation(); |
|
278 |
|
279 AknIconUtils::CreateIconL( iPhoneIcon, |
|
280 iPhoneIconMask, |
|
281 resname, |
|
282 EMbmCameraappQgn_indi_cam4_memory_phone, |
|
283 EMbmCameraappQgn_indi_cam4_memory_phone_mask ); |
|
284 |
|
285 AknIconUtils::SetSize( iPhoneIcon, size ); |
|
286 |
|
287 AknIconUtils::CreateIconL( iMMCIcon, |
|
288 iMMCIconMask, |
|
289 resname, |
|
290 EMbmCameraappQgn_indi_cam4_memory_mmc, |
|
291 EMbmCameraappQgn_indi_cam4_memory_mmc_mask ); |
|
292 |
|
293 AknIconUtils::SetSize( iMMCIcon, size ); |
|
294 |
|
295 if ( orientation != ECamOrientationCamcorder && orientation != ECamOrientationCamcorderLeft ) |
|
296 { |
|
297 AknIconUtils::CreateIconL( iMassStorageIcon, |
|
298 iMassStorageIconMask, |
|
299 resname, |
|
300 EMbmCameraappQgn_indi_cam4_memory_mass, |
|
301 EMbmCameraappQgn_indi_cam4_memory_mass_mask ); |
|
302 } |
|
303 else |
|
304 { |
|
305 AknIconUtils::CreateIconL( iMassStorageIcon, |
|
306 iMassStorageIconMask, |
|
307 resname, |
|
308 EMbmCameraappQgn_indi_cam4_memory_mass, |
|
309 EMbmCameraappQgn_indi_cam4_memory_mass_mask ); |
|
310 } |
|
311 |
|
312 AknIconUtils::SetSize( iMassStorageIcon, size ); |
|
313 PRINT( _L("Camera <= CCamNaviCounterModel::LoadResourceDataL") ); |
|
314 OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMNAVICOUNTERMODEL_LOADRESOURCEDATAL, "e_CCamNaviCounterModel_LoadResourceDataL 0" ); |
|
315 |
|
316 } |
|
317 |
|
318 // ----------------------------------------------------------------------------- |
|
319 // CCamNaviCounterModel::UnloadResourceData() |
|
320 // Frees all dynamic resources allocated in LoadResourceDataL |
|
321 // ----------------------------------------------------------------------------- |
|
322 // |
|
323 void CCamNaviCounterModel::UnloadResourceData() |
|
324 { |
|
325 #ifdef PRODUCT_SUPPORTS_NAVIPANE_MODE_SUBTITLE |
|
326 delete iSubtitleVideoText; |
|
327 iSubtitleVideoText = NULL; |
|
328 delete iSubtitlePhotoText; |
|
329 iSubtitlePhotoText = NULL; |
|
330 #endif // PRODUCT_SUPPORTS_NAVIPANE_MODE_SUBTITLE |
|
331 |
|
332 delete iPhotoPrecapDecorator; |
|
333 iPhotoPrecapDecorator = NULL; |
|
334 delete iVideoPrecapDecorator; |
|
335 iVideoPrecapDecorator = NULL; |
|
336 delete iPhotoPostcapDecorator; |
|
337 iPhotoPostcapDecorator = NULL; |
|
338 delete iVideoPostcapDecorator; |
|
339 iVideoPostcapDecorator = NULL; |
|
340 delete iSequenceInCaptureDecorator; |
|
341 iSequenceInCaptureDecorator = NULL; |
|
342 delete iTimeLapsePostCaptureDecorator; |
|
343 iTimeLapsePostCaptureDecorator = NULL; |
|
344 |
|
345 delete iPhoneIcon; |
|
346 iPhoneIcon = NULL; |
|
347 delete iPhoneIconMask; |
|
348 iPhoneIconMask = NULL; |
|
349 delete iMMCIcon; |
|
350 iMMCIcon = NULL; |
|
351 delete iMMCIconMask; |
|
352 iMMCIconMask = NULL; |
|
353 delete iMassStorageIcon; |
|
354 iMassStorageIcon = NULL; |
|
355 delete iMassStorageIconMask; |
|
356 iMassStorageIconMask = NULL; |
|
357 } |
|
358 |
|
359 // ----------------------------------------------------------------------------- |
|
360 // CCamNaviCounterModel::ReloadResourceDataL() |
|
361 // Refreshes all resource-based information stored in the class |
|
362 // ----------------------------------------------------------------------------- |
|
363 // |
|
364 void CCamNaviCounterModel::ReloadResourceDataL() |
|
365 { |
|
366 OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMNAVICOUNTERMODEL_RELOADRESOURCEDATAL, "e_CCamNaviCounterModel_ReloadResourceDataL 1" ); |
|
367 UnloadResourceData(); |
|
368 LoadResourceDataL(); |
|
369 OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMNAVICOUNTERMODEL_RELOADRESOURCEDATAL, "e_CCamNaviCounterModel_ReloadResourceDataL 0" ); |
|
370 } |
|
371 |
|
372 // --------------------------------------------------------- |
|
373 // CCamNaviCounterModel::UpdateCounter |
|
374 // Update counter |
|
375 // --------------------------------------------------------- |
|
376 // |
|
377 void CCamNaviCounterModel::UpdateCounter() |
|
378 { |
|
379 PRINT( _L("Camera => CCamNaviCounterModel::UpdateCounter") ); |
|
380 |
|
381 const TInt imagesLeft = Min( |
|
382 iController.ImagesRemaining( ECamMediaStorageCurrent, iBurstActive ), |
|
383 KMaxRemainingImagesShown ); |
|
384 iCounterText.Format( KNumberFormat, imagesLeft ); |
|
385 |
|
386 if ( iPhotoTextItem ) |
|
387 { |
|
388 TRAP_IGNORE( iPhotoTextItem->SetTextL( iCounterText ) ); |
|
389 } |
|
390 |
|
391 PRINT( _L("Camera <= CCamNaviCounterModel::UpdateCounter") ); |
|
392 } |
|
393 |
|
394 // --------------------------------------------------------- |
|
395 // CCamNaviCounterModel::UpdateTimeLapseCountdownL |
|
396 // Update the counter for remaining time until the next capture |
|
397 // --------------------------------------------------------- |
|
398 // |
|
399 void CCamNaviCounterModel::UpdateTimeLapseCountdownL() |
|
400 { |
|
401 // Get the actual remaining time till next capture |
|
402 TTime time ( iController.TimeLapseCountdown().Int64() ); |
|
403 // The format function always rounds down to the next whole number of seconds |
|
404 // so add on 0.5 secs to force round up if closer to the next higher whole number of seconds |
|
405 // This gives a countdown from max to 1, to get a countdown from max-1 to 0 remove this |
|
406 const TTimeIntervalMicroSeconds KHalfSecInMicroSecs = TInt64( 500000 ); |
|
407 time += KHalfSecInMicroSecs; |
|
408 |
|
409 TBuf<15> timebuf; |
|
410 // use 00:00 format as normal in secondary cam |
|
411 // but long format for primary cam. 2nd cam uses sharing quality. With primary cam sharing |
|
412 // we just use the same layout for sharing and other qualities. |
|
413 HBufC* timeFormat; |
|
414 if ( ECamActiveCameraSecondary == iController.ActiveCamera() ) |
|
415 { |
|
416 timeFormat = CEikonEnv::Static()->AllocReadResourceLC( R_QTN_TIME_DURAT_MIN_SEC_WITH_ZERO ); |
|
417 } |
|
418 else |
|
419 { |
|
420 timeFormat = CEikonEnv::Static()->AllocReadResourceLC( R_QTN_TIME_DURAT_LONG ); |
|
421 } |
|
422 time.FormatL( timebuf, *timeFormat ); |
|
423 CleanupStack::PopAndDestroy( timeFormat ); |
|
424 |
|
425 delete iCountDownText; |
|
426 iCountDownText = NULL; |
|
427 iCountDownText = StringLoader::LoadL( R_CAM_TIMELAPSE_COUNTDOWN_TIME, timebuf ); |
|
428 } |
|
429 |
|
430 // --------------------------------------------------------- |
|
431 // CCamNaviCounterModel::UpdateSequenceImageCount |
|
432 // Update the counter of captured and remaining images for |
|
433 // timelapse and burst during capture |
|
434 // --------------------------------------------------------- |
|
435 // |
|
436 void CCamNaviCounterModel::UpdateSequenceImageCount() |
|
437 { |
|
438 PRINT( _L("Camera => CCamNaviCounterModel::UpdateSequenceImageCount" ) ) |
|
439 TInt imagesLeft = iController.ImagesRemaining( ECamMediaStorageCurrent, iBurstActive ); |
|
440 TInt showLeft = Min( imagesLeft, KMaxRemainingImagesShown ); |
|
441 TInt showCaptured = 0; |
|
442 |
|
443 if ( ECamImageCaptureTimeLapse == iImageMode ) |
|
444 { |
|
445 // Use the count of captured images |
|
446 showCaptured = iController.TimeLapseImageCount(); |
|
447 } |
|
448 else if ( ECamImageCaptureBurst == iImageMode ) |
|
449 { |
|
450 // Use the count of burst capture moments |
|
451 showCaptured = iController.CurrentCapturedCount(); |
|
452 // The images have not been saved yet so the remaining count does not account |
|
453 // for the ones already captured. Reduce the remaining count by the captured count. |
|
454 // Commented out - The burst images are saved immediately after capturing. |
|
455 // However, we cannot know if all the previous images have already been saved |
|
456 // so this number is not 100% accurate. |
|
457 // showLeft -= showCaptured; |
|
458 if( ( iOriginalValueForEachBurst > 0 ) && ( iCounterNeedUpdate ) ) |
|
459 { |
|
460 iOriginalValueForEachBurst--; |
|
461 } |
|
462 if( ( iController.SequenceCaptureInProgress() ) ) |
|
463 { |
|
464 if( !iController.IsRemainingImageStored() ) |
|
465 { |
|
466 iOriginalValueForEachBurst = showLeft; |
|
467 iController.SetRemainingImageStored(); |
|
468 } |
|
469 iCounterText.Format( KNumberFormat, iOriginalValueForEachBurst ); |
|
470 } |
|
471 else |
|
472 iCounterText.Format( KNumberFormat, iController.ImagesRemaining( ECamMediaStorageCurrent, iBurstActive ) ); |
|
473 showLeft = iOriginalValueForEachBurst; |
|
474 } |
|
475 else |
|
476 { |
|
477 // no action |
|
478 } |
|
479 |
|
480 // show only the KShortBurstCount value if there is enough space to take all |
|
481 // pictures, otherwise display the number of images that can be shown |
|
482 TInt showSequenceMax = Min( showLeft, KShortBurstCount ); |
|
483 iSequenceImageText.Format( KTimeLapseImageFormat, showCaptured, showSequenceMax ); |
|
484 } |
|
485 |
|
486 // --------------------------------------------------------- |
|
487 // CCamNaviCounterModel::UpdateRecordTimeAvailableL |
|
488 // Update record time remaining |
|
489 // --------------------------------------------------------- |
|
490 // |
|
491 void CCamNaviCounterModel::UpdateRecordTimeAvailableL() |
|
492 { |
|
493 PRINT( _L("Camera => CCamNaviCounterModel::UpdateRecordTimeAvailableL" ) ) |
|
494 // Get the total remaining record time from the controller |
|
495 TTime time ( iController.RecordTimeRemaining().Int64() ); |
|
496 HBufC* timeFormat; |
|
497 |
|
498 // Use 00:00 format in secondary cam |
|
499 if ( ECamActiveCameraSecondary == iController.ActiveCamera() ) |
|
500 { |
|
501 timeFormat = CEikonEnv::Static()->AllocReadResourceLC( R_QTN_TIME_DURAT_MIN_SEC_WITH_ZERO ); |
|
502 } |
|
503 // Use 0:00:00 format in primary cam |
|
504 else |
|
505 { |
|
506 timeFormat = CEikonEnv::Static()->AllocReadResourceLC( R_QTN_TIME_DURAT_LONG ); |
|
507 } |
|
508 |
|
509 time.FormatL( iRemainingTimeText, *timeFormat ); |
|
510 if ( iVideoTextItem ) |
|
511 { |
|
512 iVideoTextItem->SetTextL( iRemainingTimeText ); |
|
513 } |
|
514 CleanupStack::PopAndDestroy( timeFormat ); |
|
515 PRINT( _L("Camera <= CCamNaviCounterModel::UpdateRecordTimeAvailableL" ) ) |
|
516 } |
|
517 |
|
518 // --------------------------------------------------------- |
|
519 // CCamNaviCounterModel::SetCaptureModeL |
|
520 // Set capture mode (defines which counter to use) |
|
521 // --------------------------------------------------------- |
|
522 // |
|
523 void |
|
524 CCamNaviCounterModel::SetCaptureModeL( TCamCameraMode aMode, |
|
525 TCamImageCaptureMode aImageMode ) |
|
526 { |
|
527 iMode = aMode; |
|
528 iImageMode = aImageMode; |
|
529 |
|
530 TInt key = ( ECamControllerVideo == iMode ) |
|
531 ? ECamSettingItemVideoMediaStorage |
|
532 : ECamSettingItemPhotoMediaStorage; |
|
533 |
|
534 // Get the total remaining record time from the controller |
|
535 iStorageLocation = |
|
536 static_cast<TCamMediaStorage>( iController.IntegerSettingValue( key ) ); |
|
537 |
|
538 if (ECamMediaStorageMassStorage ==iStorageLocation) |
|
539 { |
|
540 iStorageLocation = iController.ExistMassStorage()?ECamMediaStorageMassStorage:ECamMediaStoragePhone; |
|
541 } |
|
542 } |
|
543 |
|
544 // --------------------------------------------------------- |
|
545 // CCamNaviCounterModel::HandleSelfTimerEvent |
|
546 // Handle an event from CCamSelfTimer. |
|
547 // --------------------------------------------------------- |
|
548 // |
|
549 void CCamNaviCounterModel::HandleSelfTimerEvent( TCamSelfTimerEvent aEvent, TInt aCountDown ) |
|
550 { |
|
551 switch ( aEvent ) |
|
552 { |
|
553 case ECamSelfTimerEventTimerOn: |
|
554 { |
|
555 iSelfTimerText.Num( TInt64( aCountDown ) ); |
|
556 iDrawSelfTimer = ETrue; |
|
557 } |
|
558 break; |
|
559 case ECamSelfTimerEventTimerOff: |
|
560 { |
|
561 iDrawSelfTimer = EFalse; |
|
562 } |
|
563 break; |
|
564 default: |
|
565 break; |
|
566 } |
|
567 } |
|
568 |
|
569 // --------------------------------------------------------- |
|
570 // CCamNaviCounterModel::CCamNaviCounterModel |
|
571 // C++ constructor |
|
572 // --------------------------------------------------------- |
|
573 // |
|
574 CCamNaviCounterModel::CCamNaviCounterModel( CCamAppController& aController ) |
|
575 : iController( aController ) |
|
576 { |
|
577 } |
|
578 |
|
579 // --------------------------------------------------------- |
|
580 // CCamNaviCounterModel::ConstructL |
|
581 // Symbian OS 2nd phase constructor |
|
582 // --------------------------------------------------------- |
|
583 // |
|
584 void CCamNaviCounterModel::ConstructL() |
|
585 { |
|
586 OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMNAVICOUNTERMODEL_CONSTRUCTL, "e_CCamNaviCounterModel_ConstructL 1" ); |
|
587 PRINT( _L("Camera => CCamNaviCounterModel::ConstructL") ); |
|
588 iExtent = TRect(0, 0, 0, 0); |
|
589 |
|
590 UpdateCounter(); |
|
591 iController.AddControllerObserverL( this ); |
|
592 |
|
593 PRINT( _L("Camera <> Load resource data..") ); |
|
594 |
|
595 LoadResourceDataL(); |
|
596 |
|
597 TFileName resFileName; |
|
598 CamUtility::ResourceFileName( resFileName ); |
|
599 TPtrC resname = resFileName; |
|
600 |
|
601 #ifdef PRODUCT_SUPPORTS_POST_CAPTURE_INDICATORS |
|
602 AknIconUtils::CreateIconL( iMpeg4Icon, |
|
603 iMpeg4IconMask, |
|
604 resname, |
|
605 EMbmCameraappQgn_prop_cam4_codec_mp4, |
|
606 EMbmCameraappQgn_prop_cam4_codec_mp4_mask ); |
|
607 |
|
608 AknIconUtils::CreateIconL( i3GPIcon, |
|
609 i3GPIconMask, |
|
610 resname, |
|
611 EMbmCameraappQgn_prop_cam4_codec_3gp, |
|
612 EMbmCameraappQgn_prop_cam4_codec_3gp_mask ); |
|
613 #endif |
|
614 |
|
615 // wait for engine to initialise video recorder |
|
616 iVideoInitialised = EFalse; |
|
617 |
|
618 PRINT( _L("Camera <> construct navi self timer..") ); |
|
619 ConstructNaviSelfTimerL( resname ); |
|
620 |
|
621 |
|
622 PRINT( _L("Camera <> construct navi sequence..") ); |
|
623 ConstructNaviSequenceL( resname ); |
|
624 |
|
625 #ifdef PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR |
|
626 PRINT( _L("Camera <> construct generic setup..") ); |
|
627 ConstructNaviGenericSetupL( resname ); |
|
628 #endif |
|
629 |
|
630 PRINT( _L("Camera <> construct navi audio mute..") ); |
|
631 ConstructNaviAudioMuteL( resname ); |
|
632 |
|
633 #ifdef PRODUCT_SUPPORTS_NAVIPANE_MODE_SUBTITLE |
|
634 PRINT( _L("Camera <> construct navi subtitle..") ); |
|
635 ConstructNaviModeSubtitleL( resname ); |
|
636 #endif // PRODUCT_SUPPORTS_NAVIPANE_MODE_SUBTITLE |
|
637 |
|
638 CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() ); |
|
639 iBurstActive = appUi->IsBurstEnabled(); |
|
640 #if defined( PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE ) |
|
641 iDrawSequence = iBurstActive; |
|
642 #endif // PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE |
|
643 |
|
644 PRINT( _L("Camera <> construct observer handler..") ); |
|
645 iObserverHandler = CCamObserverHandler::NewL(); |
|
646 |
|
647 if ( iController.UiConfigManagerPtr() && |
|
648 iController.UiConfigManagerPtr()->IsLocationSupported() ) |
|
649 { |
|
650 iLocationIconVisible = (/*TCamLocationId::ECamLocationOn*/1 == iController.IntegerSettingValue( ECamSettingItemRecLocation )); |
|
651 } |
|
652 PRINT( _L("Camera <= CCamNaviCounterModel::ConstructL") ); |
|
653 OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMNAVICOUNTERMODEL_CONSTRUCTL, "e_CCamNaviCounterModel_ConstructL 0" ); |
|
654 } |
|
655 |
|
656 // --------------------------------------------------------- |
|
657 // CCamNaviCounterModel::Draw |
|
658 // Draw the control |
|
659 // --------------------------------------------------------- |
|
660 // |
|
661 void |
|
662 CCamNaviCounterModel::DrawNaviCtr( CBitmapContext& aGc, |
|
663 const CCoeControl* aControl ) const |
|
664 { |
|
665 DrawCounter( aGc, aControl ); |
|
666 } |
|
667 |
|
668 // --------------------------------------------------------- |
|
669 // CCamNaviCounterModel::DrawCounter |
|
670 // Draw the control |
|
671 // --------------------------------------------------------- |
|
672 // |
|
673 void |
|
674 CCamNaviCounterModel::DrawCounter( CBitmapContext& aGc, |
|
675 const CCoeControl* /*aControl*/ ) const |
|
676 { |
|
677 PRINT_FRQ( _L("Camera => CCamNaviCounterModel::DrawCounter" )) |
|
678 MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
|
679 |
|
680 CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() ); |
|
681 const TCamViewState& viewState( appUi->CurrentViewState() ); |
|
682 |
|
683 |
|
684 // ------------------------------------------------------- |
|
685 // Precapture state |
|
686 if ( ECamViewStatePreCapture == viewState ) |
|
687 { |
|
688 TBool inSequence = iController.SequenceCaptureInProgress(); |
|
689 TBool inTimeLapse = inSequence && (ECamImageCaptureTimeLapse == iImageMode); |
|
690 TBool inBurst = inSequence && (ECamImageCaptureBurst == iImageMode); |
|
691 |
|
692 TBool stillCapturing = ECamImageCaptureSingle == iImageMode |
|
693 && iController.IsProcessingCapture(); |
|
694 |
|
695 |
|
696 // Audio mute icon should be drawn even though courtesy UI applies. |
|
697 if ( iMode == ECamControllerVideo ) |
|
698 { |
|
699 DrawNaviAudioMute( aGc ); |
|
700 } |
|
701 // these are drawn when sequence capture is in progress and |
|
702 // should be drawn even when courtesy stuff is off |
|
703 if ( inTimeLapse || inBurst ) |
|
704 { |
|
705 iSequenceInCaptureDecorator->Draw( aGc, iExtent ); |
|
706 } |
|
707 else |
|
708 { |
|
709 // To prevent Lint warning |
|
710 } |
|
711 // Draw the navipane sequence icon if current performing a timelapse or burst capture |
|
712 if ( inTimeLapse || inBurst ) |
|
713 { |
|
714 DrawNaviSequence( aGc ); |
|
715 } |
|
716 if ( inTimeLapse && iController.TimeLapseSupported() ) |
|
717 { |
|
718 // Draw the captured images and captured remaining text |
|
719 DrawSequenceImageText( skin, aGc ); |
|
720 // Draw the timelapse countdown counter |
|
721 DrawTimeLapseCountdown( skin, aGc ); |
|
722 } |
|
723 else if ( inBurst ) |
|
724 { |
|
725 // Draw the captured images and captured remaining text |
|
726 DrawSequenceImageText( skin, aGc ); |
|
727 } |
|
728 |
|
729 if ( appUi && ( appUi->DrawPreCaptureCourtesyUI() || |
|
730 ( !appUi->DrawPreCaptureCourtesyUI() && appUi->IsSecondCameraEnabled() ) ) ) |
|
731 { |
|
732 |
|
733 if ( !inTimeLapse && !inBurst && !iController.IsProcessingCapture() ) |
|
734 { |
|
735 // Draw the icon for storage location (Phone/MediaCard) |
|
736 DrawStorageIcon( aGc ); |
|
737 } |
|
738 |
|
739 #ifdef PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE |
|
740 if ( iDrawSequence ) |
|
741 { |
|
742 DrawNaviSequence( aGc ); |
|
743 } |
|
744 #endif // PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE |
|
745 |
|
746 |
|
747 #ifdef PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR |
|
748 DrawNaviGenericSetup( aGc ); |
|
749 #endif // PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR |
|
750 |
|
751 if ( iMode == ECamControllerVideo ) |
|
752 { |
|
753 // only draw remaining time when engine has initialised video |
|
754 if ( iVideoInitialised && iVideoTextItem && !iController.IsProcessingCapture() ) |
|
755 { |
|
756 iVideoTextItem->Draw( aGc ); |
|
757 } |
|
758 } |
|
759 else if ( !stillCapturing && iPhotoTextItem && !inBurst) |
|
760 { |
|
761 iPhotoTextItem->Draw( aGc ); |
|
762 } |
|
763 else |
|
764 { |
|
765 // To prevent Lint warning |
|
766 } |
|
767 } |
|
768 } |
|
769 |
|
770 // ------------------------------------------------------- |
|
771 // Post capture state |
|
772 else if ( ECamViewStatePostCapture == viewState |
|
773 || ECamViewStateBurstThumbnail == viewState ) |
|
774 { |
|
775 if ( appUi->DrawPostCaptureCourtesyUI() ) |
|
776 { |
|
777 |
|
778 TRAP_IGNORE( DrawCurrentFileSizeL( skin, aGc ) ); |
|
779 |
|
780 #ifdef PRODUCT_SUPPORTS_POST_CAPTURE_INDICATORS |
|
781 // Draw the icon for storage location (Phone/MediaCard) |
|
782 DrawStorageIcon( aGc ); |
|
783 |
|
784 if ( iMode == ECamControllerVideo ) |
|
785 { |
|
786 // Draw the video file type indicator |
|
787 DrawVideoFileTypeIndicator( aGc ); |
|
788 } |
|
789 #endif // PRODUCT_SUPPORTS_POST_CAPTURE_INDICATORS |
|
790 |
|
791 if ( appUi->CurrentBurstMode() == ECamImageCaptureTimeLapse ) |
|
792 { |
|
793 // Draw images captured text background |
|
794 PRINT( _L("Camera <> Drawing timelapse postcapture decorator.. #######################") ); |
|
795 iTimeLapsePostCaptureDecorator->Draw( aGc, iExtent ); |
|
796 // Draw images capture text |
|
797 TRAP_IGNORE( DrawImagesCapturedTextL( skin, aGc ) ); |
|
798 } |
|
799 |
|
800 } |
|
801 } |
|
802 // ------------------------------------------------------- |
|
803 // otherwise, do nothing |
|
804 else |
|
805 { |
|
806 // empty statement to remove Lint error, MISRA required rule 60 |
|
807 } |
|
808 // ------------------------------------------------------- |
|
809 |
|
810 DrawNaviSelfTimer( aGc, skin ); |
|
811 |
|
812 #ifdef PRODUCT_SUPPORTS_NAVIPANE_MODE_SUBTITLE |
|
813 DrawNaviModeSubtitle( aGc, skin ); |
|
814 #endif // PRODUCT_SUPPORTS_NAVIPANE_MODE_SUBTITLE |
|
815 |
|
816 PRINT_FRQ( _L("Camera <= CCamNaviCounterModel::DrawCounter" )) |
|
817 } |
|
818 |
|
819 |
|
820 // --------------------------------------------------------- |
|
821 // CCamNaviCounterModel::DrawCounter |
|
822 // Draw the control |
|
823 // --------------------------------------------------------- |
|
824 // |
|
825 void |
|
826 CCamNaviCounterModel::DrawCounterToBitmaps( CFbsBitGc& aBmpGc, |
|
827 CFbsBitGc& aBmpMaskGc ) const |
|
828 { |
|
829 PRINT( _L("Camera => CCamNaviCounterModel::DrawCounterToBitmaps" )) |
|
830 |
|
831 CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() ); |
|
832 // Draw bitmaps to use in the real navi pane in the settings views |
|
833 if ( appUi->CurrentViewState() == ECamViewStateSettings ) |
|
834 { |
|
835 DrawStorageIconToBitmap( aBmpGc, aBmpMaskGc ); |
|
836 const CFont* font = AknLayoutUtils::FontFromId(EAknLogicalFontSecondaryFont); |
|
837 // TRgb color = layoutText.Color(); |
|
838 TRgb color = KRgbWhite; |
|
839 // Color is not updated if it not found from the skin |
|
840 MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
|
841 AknsUtils::GetCachedColor( skin, color, KNaviPaneMajorColour, KNaviPaneMinorColour ); |
|
842 aBmpGc.SetPenColor(color); |
|
843 aBmpGc.UseFont(font); |
|
844 if ( iMode == ECamControllerVideo ) |
|
845 { |
|
846 |
|
847 TBufC<KMaxTextLength> buf( iRemainingTimeText ); |
|
848 TPtr pointer = buf.Des(); |
|
849 AknTextUtils::LanguageSpecificNumberConversion( pointer ); |
|
850 aBmpGc.DrawText( buf, TPoint( 35, font->HeightInPixels()) ); |
|
851 } |
|
852 else |
|
853 { |
|
854 TBufC<KMaxTextLength> buf( iCounterText ); |
|
855 TPtr pointer = buf.Des(); |
|
856 AknTextUtils::LanguageSpecificNumberConversion( pointer ); |
|
857 aBmpGc.DrawText( buf, TPoint( 35, font->HeightInPixels()) ); |
|
858 } |
|
859 aBmpGc.DiscardFont(); |
|
860 |
|
861 aBmpMaskGc.SetPenColor(KRgbBlack); |
|
862 aBmpMaskGc.UseFont(font); |
|
863 if ( iMode == ECamControllerVideo ) |
|
864 { |
|
865 TBufC<KMaxTextLength> buf( iRemainingTimeText ); |
|
866 TPtr pointer = buf.Des(); |
|
867 AknTextUtils::LanguageSpecificNumberConversion( pointer ); |
|
868 aBmpMaskGc.DrawText( buf, TPoint( 35,font->HeightInPixels()) ); |
|
869 |
|
870 } |
|
871 else |
|
872 { |
|
873 |
|
874 TBufC<KMaxTextLength> buf( iCounterText ); |
|
875 TPtr pointer = buf.Des(); |
|
876 AknTextUtils::LanguageSpecificNumberConversion( pointer ); |
|
877 aBmpMaskGc.DrawText( buf, TPoint( 35,font->HeightInPixels()) ); |
|
878 |
|
879 } |
|
880 aBmpMaskGc.DiscardFont(); |
|
881 } |
|
882 PRINT( _L("Camera <= CCamNaviCounterModel::DrawCounterToBitmaps" )) |
|
883 } |
|
884 |
|
885 // --------------------------------------------------------- |
|
886 // CCamNaviCounterModel::DrawStorageIconToBitmap |
|
887 // Draw the icon for the media storage location |
|
888 // --------------------------------------------------------- |
|
889 // |
|
890 void |
|
891 CCamNaviCounterModel::DrawStorageIconToBitmap( CFbsBitGc& aBmpGc, |
|
892 CFbsBitGc& aBmpMaskGc ) const |
|
893 { |
|
894 CFbsBitmap* icon = NULL; |
|
895 CFbsBitmap* mask = NULL; |
|
896 if ( iStorageLocation == ECamMediaStoragePhone ) |
|
897 { |
|
898 icon = iPhoneIcon; |
|
899 mask = iPhoneIconMask; |
|
900 } |
|
901 else if ( iStorageLocation == ECamMediaStorageMassStorage ) |
|
902 { |
|
903 icon = iMassStorageIcon; |
|
904 mask = iMassStorageIconMask; |
|
905 } |
|
906 else |
|
907 { |
|
908 icon = iMMCIcon; |
|
909 mask = iMMCIconMask; |
|
910 } |
|
911 // Should use layout |
|
912 aBmpGc.BitBlt(TPoint(0,0), icon); |
|
913 aBmpMaskGc.BitBlt(TPoint(0,0), mask); |
|
914 } |
|
915 |
|
916 // --------------------------------------------------------- |
|
917 // CCamNaviCounterModel::DrawStorageIcon |
|
918 // Draw the icon for the media storage location |
|
919 // --------------------------------------------------------- |
|
920 // |
|
921 void |
|
922 CCamNaviCounterModel::DrawStorageIcon( CBitmapContext& aGc ) const |
|
923 { |
|
924 CFbsBitmap* icon = NULL; |
|
925 CFbsBitmap* mask = NULL; |
|
926 if ( iStorageLocation == ECamMediaStoragePhone ) |
|
927 { |
|
928 icon = iPhoneIcon; |
|
929 mask = iPhoneIconMask; |
|
930 } |
|
931 else if ( iStorageLocation == ECamMediaStorageMassStorage ) |
|
932 { |
|
933 icon = iMassStorageIcon; |
|
934 mask = iMassStorageIconMask; |
|
935 } |
|
936 else |
|
937 { |
|
938 icon = iMMCIcon; |
|
939 mask = iMMCIconMask; |
|
940 } |
|
941 |
|
942 if ( iMode == ECamControllerVideo ) |
|
943 { |
|
944 CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() ); |
|
945 |
|
946 // Postcapture state |
|
947 if ( appUi->CurrentViewState() == ECamViewStatePostCapture ) |
|
948 { |
|
949 aGc.BitBltMasked( iVidPostStorageIconRect.Rect().iTl, icon, icon->SizeInPixels(), mask, ETrue ); |
|
950 } |
|
951 else |
|
952 { |
|
953 aGc.BitBltMasked( iVidPreStorageIconRect.Rect().iTl, icon, icon->SizeInPixels(), mask, ETrue ); |
|
954 } |
|
955 } |
|
956 else |
|
957 { |
|
958 aGc.BitBltMasked( iImgStorageIconRect.Rect().iTl, icon, icon->SizeInPixels(), mask, ETrue ); |
|
959 } |
|
960 } |
|
961 |
|
962 // --------------------------------------------------------- |
|
963 // CCamNaviCounterModel::DrawVideoFileTypeIndicator |
|
964 // Draw the icon for the video file type indicator |
|
965 // --------------------------------------------------------- |
|
966 // |
|
967 void CCamNaviCounterModel::DrawVideoFileTypeIndicator( CBitmapContext& aGc ) const |
|
968 { |
|
969 CFbsBitmap* icon = NULL; |
|
970 CFbsBitmap* mask = NULL; |
|
971 |
|
972 CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() ); |
|
973 if ( appUi && appUi->DrawPreCaptureCourtesyUI() ) |
|
974 { |
|
975 TCamVideoFileType fileType = static_cast< TCamVideoFileType > |
|
976 ( iController.IntegerSettingValue( ECamSettingItemVideoFileType ) ); |
|
977 |
|
978 if ( fileType == ECamVideoMpeg4 ) |
|
979 { |
|
980 icon = iMpeg4Icon; |
|
981 mask = iMpeg4IconMask; |
|
982 } |
|
983 |
|
984 // Otherwise display the H263 icon. |
|
985 else |
|
986 { |
|
987 icon = i3GPIcon; |
|
988 mask = i3GPIconMask; |
|
989 } |
|
990 |
|
991 aGc.BitBltMasked( iVideoFileTypeIconRect.Rect().iTl, icon, icon->SizeInPixels(), mask, ETrue ); |
|
992 } |
|
993 } |
|
994 |
|
995 // --------------------------------------------------------- |
|
996 // CCamNaviCounterModel::DrawText |
|
997 // Draw the counter text (photo mode) |
|
998 // --------------------------------------------------------- |
|
999 // |
|
1000 void |
|
1001 CCamNaviCounterModel::DrawText( MAknsSkinInstance* /* aSkin */, |
|
1002 const TDesC& /* aText */, |
|
1003 CBitmapContext& /* aGc */ ) const |
|
1004 { |
|
1005 PRINT( _L("camera <> CCamNaviCounterModel::DrawText() not implemented" ) ); |
|
1006 } |
|
1007 |
|
1008 // --------------------------------------------------------- |
|
1009 // CCamNaviCounterModel::DrawTimeLapseCountdown |
|
1010 // Draw the timelapse image counter text (captured and remaining images) |
|
1011 // --------------------------------------------------------- |
|
1012 // |
|
1013 void CCamNaviCounterModel::DrawTimeLapseCountdown( MAknsSkinInstance* /*aSkin*/, |
|
1014 CBitmapContext& aGc ) const |
|
1015 { |
|
1016 PRINT( _L("Camera => CCamNaviCounterModel::DrawTimeLapseCountdown") ); |
|
1017 if( iCountDownText ) |
|
1018 { |
|
1019 TBufC<32> buf( *iCountDownText ); // 00:00:00 as Unicode, 32 should be enough |
|
1020 TPtr pointer = buf.Des(); |
|
1021 AknTextUtils::LanguageSpecificNumberConversion( pointer ); |
|
1022 if ( iTimeLapseCountdownTextItem ) |
|
1023 { |
|
1024 TRAP_IGNORE( iTimeLapseCountdownTextItem->SetTextL( buf ) ); |
|
1025 iTimeLapseCountdownTextItem->Draw( aGc ); |
|
1026 } |
|
1027 } |
|
1028 else |
|
1029 { |
|
1030 PRINT( _L("Camera <> CCamNaviCounterModel::DrawTimeLapseCountdown .. [WARNING] no countdown text!") ); |
|
1031 } |
|
1032 PRINT( _L("Camera <= CCamNaviCounterModel::DrawTimeLapseCountdown") ); |
|
1033 } |
|
1034 |
|
1035 // --------------------------------------------------------- |
|
1036 // CCamNaviCounterModel::DrawSequenceImageText |
|
1037 // Draw the captured and remaining image count during timelapse capture |
|
1038 // --------------------------------------------------------- |
|
1039 // |
|
1040 void CCamNaviCounterModel::DrawSequenceImageText( MAknsSkinInstance* /*aSkin*/, |
|
1041 CBitmapContext& aGc ) const |
|
1042 { |
|
1043 PRINT1( _L("CCamNaviCounterModel::DrawSequenceImageText %S" ), &iSequenceImageText ) |
|
1044 |
|
1045 if ( iSequenceImageTextItem ) |
|
1046 { |
|
1047 TRAP_IGNORE( iSequenceImageTextItem->SetTextL( iSequenceImageText ) ); |
|
1048 iSequenceImageTextItem->Draw( aGc ); |
|
1049 } |
|
1050 } |
|
1051 |
|
1052 // --------------------------------------------------------- |
|
1053 // CCamNaviCounterModel::DrawImagesCapturedTextL |
|
1054 // Draw the count of images captured in timelapse postcapture view |
|
1055 // --------------------------------------------------------- |
|
1056 // |
|
1057 void CCamNaviCounterModel::DrawImagesCapturedTextL( |
|
1058 MAknsSkinInstance* /*aSkin*/, |
|
1059 CBitmapContext& aGc ) const |
|
1060 { |
|
1061 // Draw count of captured images |
|
1062 const TInt imagesCaptured = iController.TimeLapseImageCount(); |
|
1063 HBufC* capturedImagesText = StringLoader::LoadLC( R_CAM_TIMELAPSE_IMAGES_CAPTURED, imagesCaptured ); |
|
1064 |
|
1065 HBufC* buf = HBufC::NewLC( KCamDefaultCapturedImagesTextLen ); |
|
1066 if ( capturedImagesText->Length() > buf->Length() ) |
|
1067 { |
|
1068 buf->ReAlloc( capturedImagesText->Length() ); |
|
1069 } |
|
1070 |
|
1071 buf = capturedImagesText; |
|
1072 TPtr pointer = buf->Des(); |
|
1073 AknTextUtils::LanguageSpecificNumberConversion( pointer ); |
|
1074 |
|
1075 if ( iSequenceCapturedTextItem ) |
|
1076 { |
|
1077 iSequenceCapturedTextItem->SetTextL( *buf ); |
|
1078 iSequenceCapturedTextItem->Draw( aGc ); |
|
1079 } |
|
1080 |
|
1081 CleanupStack::PopAndDestroy( buf ); |
|
1082 CleanupStack::PopAndDestroy( capturedImagesText ); |
|
1083 } |
|
1084 |
|
1085 #ifdef PRODUCT_SUPPORTS_NAVIPANE_FILENAME |
|
1086 // --------------------------------------------------------- |
|
1087 // CCamNaviCounterModel::DrawCurrentFileName |
|
1088 // Draw the file name |
|
1089 // --------------------------------------------------------- |
|
1090 // |
|
1091 void |
|
1092 CCamNaviCounterModel::DrawCurrentFileName( MAknsSkinInstance* aSkin, |
|
1093 CBitmapContext& aGc ) const |
|
1094 { |
|
1095 TAknLayoutText layoutText; |
|
1096 if ( iMode == ECamControllerVideo ) |
|
1097 { |
|
1098 layoutText = iVideoNameLayout; |
|
1099 } |
|
1100 else |
|
1101 { |
|
1102 layoutText = iPhotoNameLayout; |
|
1103 } |
|
1104 // Draw counter text |
|
1105 TRgb color = layoutText.Color(); |
|
1106 |
|
1107 // Color is not updated if it not found from the skin |
|
1108 AknsUtils::GetCachedColor( aSkin, color, |
|
1109 KNaviPaneMajorColour, KNaviPaneMinorColour ); |
|
1110 |
|
1111 |
|
1112 layoutText.DrawText( aGc, iController.CurrentImageName() , ETrue, KRgbWhite ); |
|
1113 } |
|
1114 #endif // PRODUCT_SUPPORTS_NAVIPANE_FILENAME |
|
1115 |
|
1116 |
|
1117 // --------------------------------------------------------- |
|
1118 // CCamNaviCounterModel::DrawCurrentFileSizeL |
|
1119 // Draw the file size |
|
1120 // --------------------------------------------------------- |
|
1121 // |
|
1122 |
|
1123 void |
|
1124 CCamNaviCounterModel::DrawCurrentFileSizeL( MAknsSkinInstance* aSkin, |
|
1125 CBitmapContext& aGc ) const |
|
1126 { |
|
1127 TAknLayoutText layoutText; |
|
1128 if ( iMode == ECamControllerVideo ) |
|
1129 { |
|
1130 layoutText = iVideoSizeLayout; |
|
1131 } |
|
1132 else |
|
1133 { |
|
1134 layoutText = iPhotoSizeLayout; |
|
1135 } |
|
1136 // Draw counter text |
|
1137 TRgb color = layoutText.Color(); |
|
1138 |
|
1139 // Color is not updated if it not found from the skin |
|
1140 AknsUtils::GetCachedColor( aSkin, color, |
|
1141 KNaviPaneMajorColour, KNaviPaneMinorColour ); |
|
1142 |
|
1143 // Show the filename or burst name (if burst mode) |
|
1144 |
|
1145 //START: NOT DISPLAYING FILESIZE |
|
1146 /* |
|
1147 CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() ); |
|
1148 TInt size = 0; |
|
1149 |
|
1150 // Get the filesize |
|
1151 if ( appUi->CurrentViewState() == ECamViewStatePostCapture ) |
|
1152 { |
|
1153 TPtrC filename = iController.CurrentFullFileName(); |
|
1154 size = iController.FileSize( filename ); |
|
1155 } |
|
1156 else if ( appUi->CurrentViewState() == ECamViewStateBurstThumbnail ) |
|
1157 { |
|
1158 } |
|
1159 // otherwise, do nothing |
|
1160 else |
|
1161 { |
|
1162 // empty statement to remove Lint error, MISRA required rule 60 |
|
1163 } |
|
1164 */ |
|
1165 //END: NOT DISPLAYING FILESIZE |
|
1166 |
|
1167 if ( iMode == ECamControllerVideo ) |
|
1168 { |
|
1169 // Draw the file size string |
|
1170 TBuf <15> timebuf; |
|
1171 TBuf <30> fullbuf; |
|
1172 |
|
1173 // Generate the string for video length (time) |
|
1174 TTimeIntervalMicroSeconds interval = iController.RecordTimeElapsed(); |
|
1175 TTime time( interval.Int64() ); |
|
1176 time.FormatL( timebuf, *iTimeFormat ); |
|
1177 aGc.SetBrushColor( KRgbWhite ); |
|
1178 TBufC<KMaxTextLength> buf( timebuf ); |
|
1179 TPtr pointer = buf.Des(); |
|
1180 AknTextUtils::LanguageSpecificNumberConversion( pointer ); |
|
1181 layoutText.DrawText( aGc, pointer, EFalse, KRgbBlack ); |
|
1182 } |
|
1183 |
|
1184 // START: NOT DISPLAYING FILESIZE |
|
1185 /* |
|
1186 else |
|
1187 { |
|
1188 if ( size > 0 ) |
|
1189 { |
|
1190 // Draw the file size string |
|
1191 HBufC* fileSizeStr = StringLoader::LoadLC( R_QTN_SIZE_KB, size / KKilo ); |
|
1192 layoutText.DrawText( aGc, fileSizeStr->Des() , ETrue, KRgbWhite ); |
|
1193 CleanupStack::PopAndDestroy( fileSizeStr ); |
|
1194 } |
|
1195 } |
|
1196 */ |
|
1197 // END: NOT DISPLAYING FILESIZE |
|
1198 |
|
1199 } |
|
1200 |
|
1201 |
|
1202 // ---------------------------------------------------- |
|
1203 // CCamNaviCounterModel::BurstModeActiveL |
|
1204 // Notification that the burst mode has been activated/deactivated |
|
1205 // ---------------------------------------------------- |
|
1206 // |
|
1207 // burst mode icon is displayed in either the navipane or sidepane |
|
1208 void CCamNaviCounterModel::BurstModeActiveL( TBool aActive, TBool /*aStillModeActive*/ ) |
|
1209 { |
|
1210 #ifdef PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE |
|
1211 // Update internal state, and trigger a redraw |
|
1212 iDrawSequence = aActive; |
|
1213 DrawDeferred(); |
|
1214 #endif // PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE |
|
1215 |
|
1216 // update remaining images |
|
1217 iBurstActive = aActive; |
|
1218 UpdateCounter(); |
|
1219 } |
|
1220 |
|
1221 |
|
1222 // --------------------------------------------------------- |
|
1223 // CCamNaviCounterModel::ForceNaviPaneUpdate |
|
1224 // Force update of navi-pane (i.e after dismissal of MMC removed error note) |
|
1225 // --------------------------------------------------------- |
|
1226 // |
|
1227 void CCamNaviCounterModel::ForceNaviPaneUpdate() |
|
1228 { |
|
1229 PRINT( _L("Camera => CCamNaviCounterModel::ForceNaviPaneUpdate" )) |
|
1230 // update counters |
|
1231 // get current storage location |
|
1232 TInt key = ( ECamControllerVideo == iMode ) |
|
1233 ? ECamSettingItemVideoMediaStorage |
|
1234 : ECamSettingItemPhotoMediaStorage; |
|
1235 |
|
1236 if ( static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() )->IsMMCRemovedNotePending() ) |
|
1237 { |
|
1238 PRINT( _L("Camera <> CCamNaviCounterModel::ForceNaviPaneUpdate pend") ) |
|
1239 iStorageLocation = |
|
1240 static_cast<TCamMediaStorage>( |
|
1241 iController.IntegerSettingValueUnfiltered( key ) ); |
|
1242 } |
|
1243 else |
|
1244 { |
|
1245 PRINT( _L("Camera <> CCamNaviCounterModel::ForceNaviPaneUpdate yyy") ) |
|
1246 iStorageLocation = |
|
1247 static_cast<TCamMediaStorage>( |
|
1248 iController.IntegerSettingValue( key ) ); |
|
1249 } |
|
1250 |
|
1251 if (ECamMediaStorageMassStorage ==iStorageLocation) |
|
1252 { |
|
1253 iStorageLocation = iController.ExistMassStorage()?ECamMediaStorageMassStorage:ECamMediaStoragePhone; |
|
1254 } |
|
1255 UpdateCounter(); |
|
1256 |
|
1257 TRAP_IGNORE( UpdateRecordTimeAvailableL() ); |
|
1258 PRINT( _L("Camera <= CCamNaviCounterModel::ForceNaviPaneUpdate" )) |
|
1259 } |
|
1260 |
|
1261 |
|
1262 // --------------------------------------------------------- |
|
1263 // CCamNaviCounterModel::HandleControllerEventL |
|
1264 // Handle an event from CCamAppController. |
|
1265 // --------------------------------------------------------- |
|
1266 // |
|
1267 void |
|
1268 CCamNaviCounterModel::HandleControllerEventL( TCamControllerEvent aEvent, |
|
1269 TInt /* aError */ ) |
|
1270 { |
|
1271 PRINT1( _L("Camera => CCamNaviCounterModel::HandleControllerEventL %d" ), aEvent ) |
|
1272 CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() ); |
|
1273 iCounterNeedUpdate = EFalse; |
|
1274 |
|
1275 switch( aEvent ) |
|
1276 { |
|
1277 // ----------------------------------------------------- |
|
1278 // If this is a capture complete event, or the image quality or save |
|
1279 // location has changed... |
|
1280 // case ECamEventCaptureComplete: |
|
1281 case ECamEventVideoQualityChanged: |
|
1282 case ECamEventImageQualityChanged: |
|
1283 case ECamEventSaveLocationChanged: |
|
1284 { |
|
1285 if( iMode == ECamControllerVideo ) |
|
1286 { |
|
1287 UpdateRecordTimeAvailableL(); |
|
1288 } |
|
1289 else |
|
1290 { |
|
1291 UpdateCounter(); |
|
1292 } |
|
1293 |
|
1294 if ( ECamEventSaveLocationChanged == aEvent ) |
|
1295 { |
|
1296 TCamSettingItemIds storageId = (ECamControllerVideo == iMode) |
|
1297 ? ECamSettingItemVideoMediaStorage |
|
1298 : ECamSettingItemPhotoMediaStorage; |
|
1299 |
|
1300 // update location |
|
1301 if ( appUi->IsMMCRemovedNotePending() ) |
|
1302 { |
|
1303 iStorageLocation = static_cast< TCamMediaStorage > |
|
1304 ( iController.IntegerSettingValueUnfiltered( storageId ) ); |
|
1305 } |
|
1306 else |
|
1307 { |
|
1308 iStorageLocation = static_cast< TCamMediaStorage > |
|
1309 ( iController.IntegerSettingValue( storageId ) ); |
|
1310 } |
|
1311 //CreateNaviBitmapsL( ETrue ); |
|
1312 |
|
1313 if (ECamMediaStorageMassStorage ==iStorageLocation) |
|
1314 { |
|
1315 iStorageLocation = iController.ExistMassStorage()?ECamMediaStorageMassStorage:ECamMediaStoragePhone; |
|
1316 } |
|
1317 } |
|
1318 BroadcastEvent( ECamObserverEventNaviModelUpdated ); |
|
1319 break; |
|
1320 } |
|
1321 // ----------------------------------------------------- |
|
1322 case ECamEventLocationSettingChanged: |
|
1323 { |
|
1324 iLocationIconVisible = (/*TCamLocationId::ECamLocationOn*/1 == iController.IntegerSettingValue( ECamSettingItemRecLocation )); |
|
1325 // We reload the resource data so that the control is drawn correctly |
|
1326 ReloadResourceDataL(); |
|
1327 //BroadcastEvent( ECamObserverEventNaviModelUpdated ); |
|
1328 break; |
|
1329 } |
|
1330 // ----------------------------------------------------- |
|
1331 case ECamEventEngineStateChanged: |
|
1332 { |
|
1333 if( ECamControllerVideo == iMode ) |
|
1334 { |
|
1335 // wait until engine has initialised video before updating time remaining |
|
1336 if ( !iVideoInitialised ) |
|
1337 { |
|
1338 // <CAMERAAPP_CAPI_V2_MIGRATION/> |
|
1339 // if ( iController.EngineState() == ECamEngineVideoCapturePrepared ) |
|
1340 if ( iController.CameraState() == ECamCameraPreparedVideo ) |
|
1341 { |
|
1342 iVideoInitialised = ETrue; |
|
1343 } |
|
1344 } |
|
1345 if ( iVideoInitialised ) |
|
1346 { |
|
1347 UpdateRecordTimeAvailableL(); |
|
1348 if ( iController.IsViewFinding() ) |
|
1349 { |
|
1350 BroadcastEvent( ECamObserverEventNaviModelUpdated ); |
|
1351 } |
|
1352 } |
|
1353 } |
|
1354 else |
|
1355 { |
|
1356 // exited from video mode |
|
1357 iVideoInitialised = EFalse; |
|
1358 } |
|
1359 break; |
|
1360 } |
|
1361 |
|
1362 // ----------------------------------------------------- |
|
1363 case ECamEventSaveComplete: |
|
1364 case ECamEventRecordComplete: |
|
1365 { |
|
1366 if( ECamControllerVideo == iMode ) |
|
1367 { |
|
1368 UpdateRecordTimeAvailableL(); |
|
1369 } |
|
1370 else |
|
1371 { |
|
1372 switch( iImageMode ) |
|
1373 { |
|
1374 case ECamImageCaptureBurst: |
|
1375 case ECamImageCaptureTimeLapse: |
|
1376 // Sequence: captured / remaining |
|
1377 UpdateSequenceImageCount(); |
|
1378 break; |
|
1379 default: |
|
1380 // Remaining images |
|
1381 UpdateCounter(); |
|
1382 break; |
|
1383 } |
|
1384 } |
|
1385 // no broadcast if in burst and all snapshots have not been received |
|
1386 if( !( iMode == ECamControllerImage && |
|
1387 iImageMode == ECamImageCaptureBurst && |
|
1388 !iController.AllSnapshotsReceived()) ) |
|
1389 { |
|
1390 BroadcastEvent( ECamObserverEventNaviModelUpdated ); |
|
1391 } |
|
1392 break; |
|
1393 } |
|
1394 case ECamEventAudioMuteStateChanged: |
|
1395 { |
|
1396 if ( appUi->IsDirectViewfinderActive() ) |
|
1397 { |
|
1398 appUi->HandleCommandL( ECamCmdRedrawScreen ); |
|
1399 } |
|
1400 //Remaining Recording time is updated before drawing |
|
1401 //CreateNaviBitmapsL( ETrue ); |
|
1402 break; |
|
1403 } |
|
1404 // ----------------------------------------------------- |
|
1405 case ECamEventCounterUpdated: |
|
1406 { |
|
1407 if( iController.SequenceCaptureInProgress() |
|
1408 && ( ECamImageCaptureTimeLapse == iImageMode |
|
1409 || ECamImageCaptureBurst == iImageMode ) ) |
|
1410 { |
|
1411 // UpdateCounter; |
|
1412 iCounterNeedUpdate = ETrue; |
|
1413 UpdateSequenceImageCount(); |
|
1414 if ( ECamImageCaptureTimeLapse == iImageMode ) |
|
1415 { |
|
1416 // Update remaining time till next capture |
|
1417 UpdateTimeLapseCountdownL(); |
|
1418 } |
|
1419 if( iController.AllSnapshotsReceived() ) |
|
1420 { |
|
1421 PRINT( _L("CCamNaviCounterModel BroadcastEvent( ECamObserverEventNaviModelUpdated )" ) ) |
|
1422 BroadcastEvent( ECamObserverEventNaviModelUpdated ); |
|
1423 } |
|
1424 } |
|
1425 break; |
|
1426 } |
|
1427 // ----------------------------------------------------- |
|
1428 default: |
|
1429 { |
|
1430 break; |
|
1431 } |
|
1432 // ----------------------------------------------------- |
|
1433 } |
|
1434 } |
|
1435 |
|
1436 // --------------------------------------------------------- |
|
1437 // CCamNaviCounterModel::ConstructNaviSelfTimerL |
|
1438 // Creating the member variables required for showing the |
|
1439 // self timer state in the navipane |
|
1440 // --------------------------------------------------------- |
|
1441 // |
|
1442 void CCamNaviCounterModel::ConstructNaviSelfTimerL( TPtrC& aResname ) |
|
1443 { |
|
1444 CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() ); |
|
1445 |
|
1446 // Setup self timer icon. |
|
1447 // ...Create the icon |
|
1448 TSize size = iSelfTimerIconRect.Rect().Size(); |
|
1449 AknIconUtils::CreateIconL( iSelfTimerIcon, |
|
1450 iSelfTimerMask, |
|
1451 aResname, |
|
1452 EMbmCameraappQgn_indi_cam4_selftimer, |
|
1453 EMbmCameraappQgn_indi_cam4_selftimer_mask ); |
|
1454 AknIconUtils::SetSize( iSelfTimerIcon, size ); |
|
1455 |
|
1456 // ...Add self as an observer of the self timer. |
|
1457 CCamSelfTimer* selftimer = appUi->SelfTimer(); |
|
1458 if ( selftimer ) |
|
1459 { |
|
1460 selftimer->AddObserverL( this ); |
|
1461 } |
|
1462 } |
|
1463 |
|
1464 // --------------------------------------------------------- |
|
1465 // CCamNaviCounterModel::DrawNaviSelfTimer |
|
1466 // Draw the self timer icon |
|
1467 // --------------------------------------------------------- |
|
1468 // |
|
1469 void |
|
1470 CCamNaviCounterModel::DrawNaviSelfTimer( CBitmapContext& aGc, |
|
1471 MAknsSkinInstance* /*aSkin*/ ) const |
|
1472 { |
|
1473 // Draw self timer icons, if set to on. |
|
1474 if ( iDrawSelfTimer ) |
|
1475 { |
|
1476 if ( CamUtility::IsNhdDevice() ) |
|
1477 { |
|
1478 aGc.SetBrushColor( KRgbWhite ); |
|
1479 aGc.SetBrushStyle( CGraphicsContext::ENullBrush ); |
|
1480 iSelfTimerTextLayout.DrawText( aGc, iSelfTimerText, EFalse, KRgbBlack ); |
|
1481 |
|
1482 aGc.BitBltMasked( iSelfTimerIconRect.Rect().iTl, iSelfTimerIcon, |
|
1483 iSelfTimerIcon->SizeInPixels(), iSelfTimerMask, ETrue ); |
|
1484 } |
|
1485 else |
|
1486 { |
|
1487 aGc.SetBrushColor( KRgbBlack ); |
|
1488 aGc.SetBrushStyle( CGraphicsContext::ENullBrush ); |
|
1489 iSelfTimerTextLayout.DrawText( aGc, iSelfTimerText, EFalse, KRgbWhite ); |
|
1490 |
|
1491 aGc.BitBltMasked( iSelfTimerIconRect.Rect().iTl, iSelfTimerIcon, |
|
1492 iSelfTimerIcon->SizeInPixels(), iSelfTimerMask, ETrue ); |
|
1493 } |
|
1494 } |
|
1495 } |
|
1496 |
|
1497 // --------------------------------------------------------- |
|
1498 // CCamNaviCounterModel::ConstructNaviSequenceL |
|
1499 // Creating the member variables required for showing the |
|
1500 // sequence capture state in the navipane |
|
1501 // --------------------------------------------------------- |
|
1502 // |
|
1503 void CCamNaviCounterModel::ConstructNaviSequenceL( TPtrC& aResname ) |
|
1504 { |
|
1505 // Setup sequence icon. |
|
1506 // ...Create the icon |
|
1507 TSize size = iSequenceIconRect.Rect().Size(); |
|
1508 AknIconUtils::CreateIconL( iSequenceIcon, |
|
1509 iSequenceMask, |
|
1510 aResname, |
|
1511 EMbmCameraappQgn_indi_cam4_sequence_burst, |
|
1512 EMbmCameraappQgn_indi_cam4_sequence_burst_mask ); |
|
1513 AknIconUtils::SetSize( iSequenceIcon, size ); |
|
1514 |
|
1515 CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() ); |
|
1516 |
|
1517 // ...Add self as an observer of burst mode |
|
1518 appUi->AddBurstModeObserverL( this ); |
|
1519 } |
|
1520 |
|
1521 |
|
1522 // --------------------------------------------------------- |
|
1523 // CCamNaviCounterModel::DrawNaviSequence |
|
1524 // Draw the sequence capture icon |
|
1525 // --------------------------------------------------------- |
|
1526 // |
|
1527 void CCamNaviCounterModel::DrawNaviSequence( CBitmapContext& aGc ) const |
|
1528 { |
|
1529 aGc.BitBltMasked( iSequenceIconRect.Rect().iTl, iSequenceIcon, |
|
1530 iSequenceIcon->SizeInPixels(), iSequenceMask, ETrue); |
|
1531 } |
|
1532 |
|
1533 #ifdef PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR |
|
1534 // --------------------------------------------------------- |
|
1535 // CCamNaviCounterModel::ConstructNaviGenericSetupL |
|
1536 // Creating the member variables required for showing the |
|
1537 // generic setup state in the navipane |
|
1538 // --------------------------------------------------------- |
|
1539 // |
|
1540 void CCamNaviCounterModel::ConstructNaviGenericSetupL( TPtrC& aResname ) |
|
1541 { |
|
1542 // Setup generic setup icon. |
|
1543 // ...Create the icon |
|
1544 TSize size = iGenericIconRect.Rect().Size(); |
|
1545 AknIconUtils::CreateIconL( iGenericIcon, |
|
1546 iGenericMask, |
|
1547 aResname, |
|
1548 EMbmCameraappQgn_indi_lcam_generic, |
|
1549 EMbmCameraappQgn_indi_lcam_generic_mask ); |
|
1550 AknIconUtils::SetSize( iGenericIcon, size ); |
|
1551 } |
|
1552 |
|
1553 // --------------------------------------------------------- |
|
1554 // CCamNaviCounterModel::DrawNaviGenericSetup |
|
1555 // Draw the generic setup icon |
|
1556 // --------------------------------------------------------- |
|
1557 // |
|
1558 void CCamNaviCounterModel::DrawNaviGenericSetup( CBitmapContext& aGc ) const |
|
1559 { |
|
1560 if ( ( iMode == ECamControllerVideo && !iController.VideoSceneDefaultsAreSet() ) || |
|
1561 ( iMode != ECamControllerVideo && !iController.PhotoSceneDefaultsAreSet() ) ) |
|
1562 { |
|
1563 aGc.BitBltMasked( iGenericIconRect.Rect().iTl, iGenericIcon, |
|
1564 iGenericIcon->SizeInPixels(), iGenericMask, ETrue); |
|
1565 } |
|
1566 } |
|
1567 #endif // PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR |
|
1568 |
|
1569 |
|
1570 |
|
1571 |
|
1572 // --------------------------------------------------------- |
|
1573 // CCamNaviCounterModel::ConstructNaviAudioMuteL |
|
1574 // Creating the member variables required for showing the |
|
1575 // audio mute state in the navipane |
|
1576 // --------------------------------------------------------- |
|
1577 // |
|
1578 void CCamNaviCounterModel::ConstructNaviAudioMuteL( TPtrC& aResname ) |
|
1579 { |
|
1580 // Setup generic setup icon. |
|
1581 |
|
1582 // ...Create the icon |
|
1583 TSize size = iAudioMuteIconRect.Rect().Size(); |
|
1584 AknIconUtils::CreateIconL( iAudioMuteIcon, |
|
1585 iAudioMuteMask, |
|
1586 aResname, |
|
1587 EMbmCameraappQgn_indi_vid4_audio_mute, |
|
1588 EMbmCameraappQgn_indi_vid4_audio_mute_mask ); |
|
1589 AknIconUtils::SetSize( iAudioMuteIcon, size ); |
|
1590 } |
|
1591 |
|
1592 |
|
1593 // --------------------------------------------------------- |
|
1594 // CCamNaviCounterModel::DrawNaviAudioMute |
|
1595 // Draw the audio mute icon |
|
1596 // --------------------------------------------------------- |
|
1597 // |
|
1598 void CCamNaviCounterModel::DrawNaviAudioMute( CBitmapContext& aGc ) const |
|
1599 { |
|
1600 TCamSettingsOnOff audio = static_cast< TCamSettingsOnOff > |
|
1601 ( iController.IntegerSettingValue( ECamSettingItemVideoAudioRec ) ); |
|
1602 |
|
1603 // If the current mode is in video and the audio has been |
|
1604 // muted, display the audio mute indicator. |
|
1605 if ( ( ECamSettOff == audio ) && ( iMode == ECamControllerVideo ) ) |
|
1606 { |
|
1607 // Draw icon |
|
1608 aGc.BitBltMasked( iAudioMuteIconRect.Rect().iTl, iAudioMuteIcon, |
|
1609 iAudioMuteIcon->SizeInPixels(), iAudioMuteMask, ETrue); |
|
1610 } |
|
1611 } |
|
1612 |
|
1613 |
|
1614 |
|
1615 |
|
1616 #ifdef PRODUCT_SUPPORTS_NAVIPANE_MODE_SUBTITLE |
|
1617 // --------------------------------------------------------- |
|
1618 // CCamNaviCounterModel::ConstructNaviModeSubtitleL |
|
1619 // Creating the member variables required for showing the |
|
1620 // current mode in the navipane |
|
1621 // --------------------------------------------------------- |
|
1622 // |
|
1623 void CCamNaviCounterModel::ConstructNaviModeSubtitleL( TPtrC& aResname ) |
|
1624 { |
|
1625 // Setup generic setup icon. |
|
1626 |
|
1627 // ...Create the icon (photo icon) |
|
1628 TSize size = iSubtitlePhotoRect.Rect().Size(); |
|
1629 AknIconUtils::CreateIconL( iSubtitlePhotoIcon, |
|
1630 iSubtitlePhotoMask, |
|
1631 aResname, |
|
1632 EMbmCameraappQgn_indi_cam_photomode, |
|
1633 EMbmCameraappQgn_indi_cam_photomode_mask ); |
|
1634 AknIconUtils::SetSize( iSubtitlePhotoIcon, size ); |
|
1635 |
|
1636 // ...Create the icon (video icon) |
|
1637 size = iSubtitlePhotoRect.Rect().Size(); |
|
1638 AknIconUtils::CreateIconL( iSubtitleVideoIcon, |
|
1639 iSubtitleVideoMask, |
|
1640 aResname, |
|
1641 EMbmCameraappQgn_indi_cam_videomode, |
|
1642 EMbmCameraappQgn_indi_cam_videomode_mask ); |
|
1643 AknIconUtils::SetSize( iSubtitleVideoIcon, size ); |
|
1644 } |
|
1645 |
|
1646 // --------------------------------------------------------- |
|
1647 // CCamNaviCounterModel::DrawNaviModeSubtitle |
|
1648 // Draw the subtitle text and icon |
|
1649 // --------------------------------------------------------- |
|
1650 // |
|
1651 void CCamNaviCounterModel::DrawNaviModeSubtitle( CBitmapContext& aGc, MAknsSkinInstance* aSkin ) const |
|
1652 { |
|
1653 CWindowGc& gc = SystemGc(); |
|
1654 // Set drawing colour |
|
1655 TRgb color = iSelfTimerTextLayout.Color(); |
|
1656 // ...Color is not updated if it not found from the skin |
|
1657 AknsUtils::GetCachedColor( aSkin, color, |
|
1658 KNaviPaneMajorColour, KNaviPaneMinorColour ); |
|
1659 |
|
1660 if ( iMode == ECamControllerVideo ) |
|
1661 { |
|
1662 |
|
1663 iSubtitleVideoTextLayout.DrawText( gc, iSubtitleVideoText->Des(), ETrue, KRgbWhite ); |
|
1664 aGc.BitBltMasked( iSubtitleVideoRect.Rect().iTl, iSubtitleVideoIcon, |
|
1665 iSubtitleVideoIcon->SizeInPixels(), iSubtitleVideoMask, ETrue); |
|
1666 } |
|
1667 else |
|
1668 { |
|
1669 |
|
1670 iSubtitlePhotoTextLayout.DrawText( gc, iSubtitlePhotoText->Des(), ETrue, KRgbWhite ); |
|
1671 aGc.BitBltMasked( iSubtitlePhotoRect.Rect().iTl, iSubtitlePhotoIcon, |
|
1672 iSubtitlePhotoIcon->SizeInPixels(), iSubtitlePhotoMask, ETrue); |
|
1673 } |
|
1674 } |
|
1675 #endif // PRODUCT_SUPPORTS_NAVIPANE_MODE_SUBTITLE |
|
1676 |
|
1677 |
|
1678 |
|
1679 // --------------------------------------------------------- |
|
1680 // CCamNaviCounterModel::SetExtentL |
|
1681 // Sets where the navicounter should be rendered |
|
1682 // --------------------------------------------------------- |
|
1683 // |
|
1684 void CCamNaviCounterModel::SetExtentL( TRect aExtent ) |
|
1685 { |
|
1686 if ( aExtent != iExtent ) |
|
1687 { |
|
1688 iExtent = aExtent; |
|
1689 } |
|
1690 } |
|
1691 |
|
1692 // --------------------------------------------------------- |
|
1693 // CCamNaviCounterModel::RegisterObserverL |
|
1694 // Registers an observer |
|
1695 // --------------------------------------------------------- |
|
1696 // |
|
1697 void CCamNaviCounterModel::RegisterObserverL(MCamObserver* aObserver) |
|
1698 { |
|
1699 iObserverHandler->RegisterObserverL(aObserver); |
|
1700 } |
|
1701 |
|
1702 // --------------------------------------------------------- |
|
1703 // CCamNaviCounterModel::DeregisterObserver |
|
1704 // Deregisters an observer |
|
1705 // --------------------------------------------------------- |
|
1706 // |
|
1707 void CCamNaviCounterModel::DeregisterObserver(MCamObserver* aObserver) |
|
1708 { |
|
1709 iObserverHandler->DeregisterObserver(aObserver); |
|
1710 } |
|
1711 |
|
1712 // --------------------------------------------------------- |
|
1713 // CCamNaviCounterModel::BroadcastEvent |
|
1714 // Broadcasts an event code to all observers |
|
1715 // --------------------------------------------------------- |
|
1716 // |
|
1717 void CCamNaviCounterModel::BroadcastEvent(TCamObserverEvent aEvent) |
|
1718 { |
|
1719 iObserverHandler->BroadcastEvent(aEvent); |
|
1720 } |
|
1721 |
|
1722 // --------------------------------------------------------------------------- |
|
1723 // CCamNaviCounterModel::CreateNaviBitmapsL |
|
1724 // Set up the memory icon and counter in the navipane |
|
1725 // --------------------------------------------------------------------------- |
|
1726 // |
|
1727 void CCamNaviCounterModel::CreateNaviBitmapsL( const TBool aDrawIcons ) |
|
1728 { |
|
1729 PRINT( _L("Camera => CCamNaviCounterModel::CreateNaviBitmapsL") ); |
|
1730 CCamAppUi* camAppUi = ( CCamAppUi* )iAvkonAppUiBase; |
|
1731 if ( camAppUi && camAppUi->SettingsLaunchedFromCamera() ) |
|
1732 { |
|
1733 CEikStatusPane* sp = camAppUi->StatusPane(); |
|
1734 |
|
1735 TUid npUid ; |
|
1736 npUid.iUid = EEikStatusPaneUidNavi; |
|
1737 CAknNavigationControlContainer* naviPane = |
|
1738 ( CAknNavigationControlContainer* )sp->ControlL( npUid ); |
|
1739 |
|
1740 // dispose of old decorator and bitmaps |
|
1741 if( iNaviDec ) |
|
1742 { |
|
1743 // do we need to pop it off the navi pane stack first? |
|
1744 delete iNaviDec; |
|
1745 iNaviDec = NULL; |
|
1746 iNaviBitmap = NULL; |
|
1747 iNaviBitmapMask = NULL; |
|
1748 } |
|
1749 |
|
1750 if( iNaviBitmap ) |
|
1751 { |
|
1752 delete iNaviBitmap; |
|
1753 iNaviBitmap = NULL; |
|
1754 } |
|
1755 |
|
1756 iNaviBitmap = new ( ELeave ) CFbsBitmap(); |
|
1757 User::LeaveIfError( iNaviBitmap->Create( TSize(250,20), EColor64K ) ); |
|
1758 CFbsBitmapDevice* bmpDevice = NULL; |
|
1759 bmpDevice = CFbsBitmapDevice::NewL( iNaviBitmap ); |
|
1760 CleanupStack::PushL( bmpDevice ); |
|
1761 CFbsBitGc* bmpGc = NULL; |
|
1762 User::LeaveIfError( bmpDevice->CreateContext( bmpGc ) ); |
|
1763 CleanupStack::PushL( bmpGc ); |
|
1764 |
|
1765 if( iNaviBitmapMask ) |
|
1766 { |
|
1767 delete iNaviBitmapMask; |
|
1768 iNaviBitmapMask = NULL; |
|
1769 } |
|
1770 iNaviBitmapMask = new ( ELeave ) CFbsBitmap(); |
|
1771 User::LeaveIfError( iNaviBitmapMask->Create( TSize(250,20), EColor64K ) ); |
|
1772 CFbsBitmapDevice* bmpMaskDevice = NULL; |
|
1773 bmpMaskDevice = CFbsBitmapDevice::NewL( iNaviBitmapMask ); |
|
1774 CleanupStack::PushL( bmpMaskDevice ); |
|
1775 CFbsBitGc* bmpMaskGc = NULL; |
|
1776 User::LeaveIfError( bmpMaskDevice->CreateContext( bmpMaskGc ) ); |
|
1777 CleanupStack::PushL( bmpMaskGc ); |
|
1778 |
|
1779 if ( aDrawIcons ) |
|
1780 { |
|
1781 if ( iMode == ECamControllerVideo ) |
|
1782 { |
|
1783 UpdateRecordTimeAvailableL(); |
|
1784 } |
|
1785 DrawCounterToBitmaps( *bmpGc, *bmpMaskGc ); |
|
1786 } |
|
1787 // Create the new decorator and push on to navi stack |
|
1788 iNaviDec = naviPane->CreateNavigationImageL( iNaviBitmap, |
|
1789 iNaviBitmapMask ); |
|
1790 CleanupStack::PopAndDestroy( bmpMaskGc ); |
|
1791 CleanupStack::PopAndDestroy( bmpMaskDevice ); |
|
1792 CleanupStack::PopAndDestroy( bmpGc ); |
|
1793 CleanupStack::PopAndDestroy( bmpDevice ); |
|
1794 naviPane->PushL( *iNaviDec ); |
|
1795 } |
|
1796 PRINT( _L("Camera <= CCamNaviCounterModel::CreateNaviBitmapsL") ); |
|
1797 } |
|
1798 |
|
1799 // --------------------------------------------------------------------------- |
|
1800 // CCamNaviCounterModel::NonTouchLayoutL |
|
1801 // --------------------------------------------------------------------------- |
|
1802 void CCamNaviCounterModel::NonTouchLayoutL() |
|
1803 { |
|
1804 TInt variant = 0; |
|
1805 |
|
1806 TInt cba = AknLayoutUtils::CbaLocation() == |
|
1807 AknLayoutUtils::EAknCbaLocationLeft? |
|
1808 AknLayoutUtils::EAknCbaLocationLeft : 0; |
|
1809 |
|
1810 TAknLayoutRect camIndicatorPane; |
|
1811 camIndicatorPane.LayoutRect( iExtent, |
|
1812 AknLayoutScalable_Apps::cam6_indi_pane( variant )); |
|
1813 |
|
1814 iImgStorageIconRect.LayoutRect( camIndicatorPane.Rect(), |
|
1815 AknLayoutScalable_Apps::cam6_indi_pane_g2( cba ) ); |
|
1816 |
|
1817 iPhotoTextItem->SetLayoutL( camIndicatorPane.Rect(), |
|
1818 AknLayoutScalable_Apps::cam6_indi_pane_t1( cba ) ); |
|
1819 |
|
1820 TAknLayoutRect vidIndicatorPane; |
|
1821 vidIndicatorPane.LayoutRect( iExtent, |
|
1822 AknLayoutScalable_Apps::vid6_indi_pane( cba ) ); |
|
1823 |
|
1824 iVidPreStorageIconRect.LayoutRect( vidIndicatorPane.Rect(), |
|
1825 AknLayoutScalable_Apps::vid6_indi_pane_g3( cba ) ); |
|
1826 |
|
1827 iVideoTextLayout.LayoutText( vidIndicatorPane.Rect(), |
|
1828 AknLayoutScalable_Apps::vid6_indi_pane_t1( cba ) ); |
|
1829 |
|
1830 iVideoTextItem->SetLayoutL( vidIndicatorPane.Rect(), |
|
1831 AknLayoutScalable_Apps::vid6_indi_pane_t1( cba ) ); |
|
1832 |
|
1833 TAknLayoutRect vidProgressPane; |
|
1834 vidProgressPane.LayoutRect( iExtent, |
|
1835 AknLayoutScalable_Apps::vid6_indi_pane( cba ) ); |
|
1836 |
|
1837 iSequenceImageTextItem->SetLayoutL( |
|
1838 vidProgressPane.Rect(), |
|
1839 AknLayoutScalable_Apps::vid6_indi_pane_t4( 2 ) ); |
|
1840 |
|
1841 iTimeLapseCountdownTextItem->SetLayoutL( |
|
1842 vidProgressPane.Rect(), |
|
1843 AknLayoutScalable_Apps::vid6_indi_pane_t4( 2 ) ); |
|
1844 |
|
1845 iSequenceCapturedTextItem->SetLayoutL( |
|
1846 vidProgressPane.Rect(), |
|
1847 AknLayoutScalable_Apps::vid6_indi_pane_t4( 2 ) ); |
|
1848 |
|
1849 |
|
1850 // ...Load layout rect for self timer image. |
|
1851 TAknLayoutRect timerParent; |
|
1852 timerParent.LayoutRect( iExtent, |
|
1853 AknLayoutScalable_Apps::cam6_timer_pane( cba ) ); |
|
1854 iSelfTimerIconRect.LayoutRect( timerParent.Rect(), |
|
1855 AknLayoutScalable_Apps::cam6_timer_pane_g1( cba ) ); |
|
1856 iSelfTimerTextLayout.LayoutText( timerParent.Rect(), |
|
1857 AknLayoutScalable_Apps::cam6_timer_pane_t1( cba ) ); |
|
1858 |
|
1859 iVideoSizeLayout.LayoutText( vidProgressPane.Rect(), |
|
1860 AknLayoutScalable_Apps::vid6_indi_pane_t4( 2 ) ); // Magic: layout Opt2 |
|
1861 iPhotoSizeLayout = iVideoSizeLayout; |
|
1862 |
|
1863 // ...Load layout rect for sequence image. |
|
1864 iSequenceIconRect.LayoutRect( iExtent, |
|
1865 AknLayoutScalable_Apps::cam6_mode_pane_g2( cba ) ); |
|
1866 |
|
1867 iAudioMuteIconRect.LayoutRect( iExtent, |
|
1868 AknLayoutScalable_Apps::cam6_mode_pane_g2( cba ) ); |
|
1869 |
|
1870 } |
|
1871 |
|
1872 // --------------------------------------------------------------------------- |
|
1873 // CCamNaviCounterModel::NonTouchLayoutSecondaryL |
|
1874 // --------------------------------------------------------------------------- |
|
1875 void CCamNaviCounterModel::NonTouchLayoutSecondaryL() |
|
1876 { |
|
1877 // Magic numbers used for layout variation |
|
1878 TAknLayoutRect camIndicatorPane; |
|
1879 camIndicatorPane.LayoutRect( iExtent, |
|
1880 AknLayoutScalable_Apps::cam6_indi_pane( 3 )); |
|
1881 |
|
1882 iImgStorageIconRect.LayoutRect( camIndicatorPane.Rect(), |
|
1883 AknLayoutScalable_Apps::cam6_indi_pane_g2( 2 ) ); |
|
1884 |
|
1885 iPhotoTextItem->SetLayoutL( camIndicatorPane.Rect(), |
|
1886 AknLayoutScalable_Apps::cam6_indi_pane_t1( 4 ) ); |
|
1887 |
|
1888 TAknLayoutRect vidIndicatorPane; |
|
1889 vidIndicatorPane.LayoutRect( iExtent, |
|
1890 AknLayoutScalable_Apps::vid6_indi_pane( 3 ) ); |
|
1891 |
|
1892 iVidPreStorageIconRect.LayoutRect( vidIndicatorPane.Rect(), |
|
1893 AknLayoutScalable_Apps::vid6_indi_pane_g3( 2 ) ); |
|
1894 |
|
1895 iVideoTextLayout.LayoutText( vidIndicatorPane.Rect(), |
|
1896 AknLayoutScalable_Apps::vid6_indi_pane_t1( 1 ) ); |
|
1897 |
|
1898 iVideoTextItem->SetLayoutL( vidIndicatorPane.Rect(), |
|
1899 AknLayoutScalable_Apps::vid6_indi_pane_t1( 1 ) ); |
|
1900 |
|
1901 iVideoSizeLayout.LayoutText( vidIndicatorPane.Rect(), |
|
1902 AknLayoutScalable_Apps::vid6_indi_pane_t1( 1 ) ); |
|
1903 iPhotoSizeLayout = iVideoSizeLayout; |
|
1904 |
|
1905 iAudioMuteIconRect.LayoutRect( iExtent, |
|
1906 AknLayoutScalable_Apps::cam6_mode_pane_g1( 0 ) ); |
|
1907 |
|
1908 } |
|
1909 |
|
1910 // --------------------------------------------------------------------------- |
|
1911 // CCamNaviCounterModel::TouchLayoutL |
|
1912 // --------------------------------------------------------------------------- |
|
1913 void CCamNaviCounterModel::TouchLayoutL() |
|
1914 { |
|
1915 TInt variant = 0; // portrait |
|
1916 TInt indicatorVariant = 1; |
|
1917 if ( Layout_Meta_Data::IsLandscapeOrientation() ) |
|
1918 { |
|
1919 // Landscape layout variant |
|
1920 variant = 1; // landscape |
|
1921 indicatorVariant = 0; |
|
1922 } |
|
1923 |
|
1924 TAknLayoutRect camIndicatorPane; |
|
1925 camIndicatorPane.LayoutRect( iExtent, |
|
1926 AknLayoutScalable_Apps::cam4_indicators_pane( variant ) ); |
|
1927 |
|
1928 iImgStorageIconRect.LayoutRect( camIndicatorPane.Rect(), |
|
1929 AknLayoutScalable_Apps::cam4_indicators_pane_g2( indicatorVariant ) ); |
|
1930 |
|
1931 iPhotoTextItem->SetLayoutL( camIndicatorPane.Rect(), |
|
1932 AknLayoutScalable_Apps::cam4_indicators_pane_t1( indicatorVariant ) ); |
|
1933 |
|
1934 TAknLayoutRect vidIndicatorPane; |
|
1935 vidIndicatorPane.LayoutRect( iExtent, |
|
1936 AknLayoutScalable_Apps::vid4_progress_pane( variant ) );// vid4_indicators_pane should be used |
|
1937 |
|
1938 iVidPreStorageIconRect.LayoutRect( vidIndicatorPane.Rect(), |
|
1939 AknLayoutScalable_Apps::vid4_indicators_pane_g3( indicatorVariant ) ); |
|
1940 |
|
1941 #ifdef PRODUCT_SUPPORTS_POST_CAPTURE_INDICATORS |
|
1942 iVideoFileTypeIconRect.LayoutRect( vidIndicatorPane.Rect(), |
|
1943 AknLayoutScalable_Apps::vid4_indicators_pane_g2( indicatorVariant ) ); |
|
1944 #endif |
|
1945 |
|
1946 iVideoTextLayout.LayoutText( vidIndicatorPane.Rect(), |
|
1947 AknLayoutScalable_Apps::vid4_indicators_pane_t1( indicatorVariant ) ); |
|
1948 |
|
1949 iVideoTextItem->SetLayoutL( vidIndicatorPane.Rect(), |
|
1950 AknLayoutScalable_Apps::vid4_indicators_pane_t1( indicatorVariant ) ); |
|
1951 |
|
1952 |
|
1953 TAknLayoutRect vidProgressPane; |
|
1954 vidProgressPane.LayoutRect( |
|
1955 iExtent, |
|
1956 AknLayoutScalable_Apps::vid4_progress_pane( variant ) ); |
|
1957 |
|
1958 iSequenceImageTextItem->SetLayoutL( |
|
1959 vidProgressPane.Rect(), |
|
1960 AknLayoutScalable_Apps::vid4_progress_pane_t3() ); |
|
1961 |
|
1962 iTimeLapseCountdownTextItem->SetLayoutL( |
|
1963 vidProgressPane.Rect(), |
|
1964 AknLayoutScalable_Apps::vid4_progress_pane_t3() ); |
|
1965 |
|
1966 iSequenceCapturedTextItem->SetLayoutL( |
|
1967 vidProgressPane.Rect(), |
|
1968 AknLayoutScalable_Apps::vid4_progress_pane_t3() ); |
|
1969 |
|
1970 |
|
1971 // ...Load layout rect for self timer image. |
|
1972 iSelfTimerIconRect.LayoutRect( iExtent, |
|
1973 AknLayoutScalable_Apps::main_camera4_pane_g5( variant ) ); |
|
1974 iSelfTimerTextLayout.LayoutText( iExtent, |
|
1975 AknLayoutScalable_Apps::main_camera4_pane_t1( variant ) ); |
|
1976 |
|
1977 #ifdef PRODUCT_SUPPORTS_NAVIPANE_MODE_SUBTITLE |
|
1978 if ( !AknLayoutUtils::LayoutMirrored() ) |
|
1979 { |
|
1980 iSubtitlePhotoTextLayout.LayoutText( iExtent, |
|
1981 ROID(R_CAM_SUBTITLE_PHOTOMODE_TEXT_LAYOUT_ID)); |
|
1982 iSubtitleVideoTextLayout.LayoutText( iExtent, |
|
1983 ROID(R_CAM_SUBTITLE_VIDEOMODE_TEXT_LAYOUT_ID)); |
|
1984 iSubtitlePhotoRect.LayoutRect( iExtent, |
|
1985 ROID(R_CAM_SUBTITLE_PHOTOMODE_ICON_RECT_ID)); |
|
1986 iSubtitleVideoRect.LayoutRect( iExtent, |
|
1987 ROID(R_CAM_SUBTITLE_VIDEOMODE_ICON_RECT_ID)); |
|
1988 } |
|
1989 else |
|
1990 { |
|
1991 iSubtitlePhotoTextLayout.LayoutText( iExtent, |
|
1992 ROID(R_CAM_SUBTITLE_PHOTOMODE_TEXT_LAYOUT_AH_ID)); |
|
1993 iSubtitleVideoTextLayout.LayoutText( iExtent, |
|
1994 ROID(R_CAM_SUBTITLE_VIDEOMODE_TEXT_LAYOUT_AH_ID)); |
|
1995 iSubtitlePhotoRect.LayoutRect( iExtent, |
|
1996 ROID(R_CAM_SUBTITLE_PHOTOMODE_ICON_RECT_AH_ID)); |
|
1997 iSubtitleVideoRect.LayoutRect( iExtent, |
|
1998 ROID(R_CAM_SUBTITLE_VIDEOMODE_ICON_RECT_AH_ID)); |
|
1999 } |
|
2000 |
|
2001 // ...Read the strings from the resource |
|
2002 iSubtitleVideoText = iCoeEnv->AllocReadResourceAsDes16L( |
|
2003 ROID(R_CAM_STILL_PRE_CAPTURE_SUBTITLE_TEXT_VIDEO_ID)); |
|
2004 iSubtitlePhotoText = iCoeEnv->AllocReadResourceAsDes16L( |
|
2005 ROID(R_CAM_STILL_PRE_CAPTURE_SUBTITLE_TEXT_PHOTO_ID)); |
|
2006 #endif // PRODUCT_SUPPORTS_NAVIPANE_MODE_SUBTITLE |
|
2007 |
|
2008 #ifdef PRODUCT_SUPPORTS_NAVIPANE_FILENAME |
|
2009 if ( !AknLayoutUtils::LayoutMirrored() ) |
|
2010 { |
|
2011 iPhotoNameLayout.LayoutText( iExtent, |
|
2012 ROID(R_CAM_POST_CAPTURE_IMAGE_NAME_LAYOUT_ID)); |
|
2013 iVideoNameLayout.LayoutText( iExtent, |
|
2014 ROID(R_CAM_POST_CAPTURE_VIDEO_NAME_LAYOUT_ID)); |
|
2015 } |
|
2016 else |
|
2017 { |
|
2018 iPhotoNameLayout.LayoutText( iExtent, |
|
2019 ROID(R_CAM_POST_CAPTURE_IMAGE_NAME_LAYOUT_AH_ID)); |
|
2020 iVideoNameLayout.LayoutText( iExtent, |
|
2021 ROID(R_CAM_POST_CAPTURE_VIDEO_NAME_LAYOUT_AH_ID)); |
|
2022 } |
|
2023 |
|
2024 #endif // PRODUCT_SUPPORTS_NAVIPANE_FILENAME |
|
2025 |
|
2026 |
|
2027 iVideoSizeLayout.LayoutText( vidProgressPane.Rect(), |
|
2028 AknLayoutScalable_Apps::vid4_progress_pane_t3( indicatorVariant )); |
|
2029 |
|
2030 if ( !AknLayoutUtils::LayoutMirrored() ) |
|
2031 { |
|
2032 iPhotoSizeLayout.LayoutText( iExtent, |
|
2033 ROID(R_CAM_POST_CAPTURE_IMAGE_SIZE_LAYOUT_ID)); |
|
2034 } |
|
2035 else |
|
2036 { |
|
2037 iPhotoSizeLayout.LayoutText( iExtent, |
|
2038 ROID(R_CAM_POST_CAPTURE_IMAGE_SIZE_LAYOUT_AH_ID)); |
|
2039 } |
|
2040 |
|
2041 // ...Load layout rect for sequence image. |
|
2042 iSequenceIconRect.LayoutRect( iExtent, |
|
2043 AknLayoutScalable_Apps::main_camera4_pane_g2( variant ) ); |
|
2044 |
|
2045 #ifdef PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR |
|
2046 if ( !AknLayoutUtils::LayoutMirrored() ) |
|
2047 { |
|
2048 iGenericIconRect.LayoutRect( iExtent, |
|
2049 ROID(R_CAM_GENERIC_SETUP_ICON_RECT_ID)); |
|
2050 } |
|
2051 else |
|
2052 { |
|
2053 iGenericIconRect.LayoutRect( iExtent, |
|
2054 ROID(R_CAM_GENERIC_SETUP_ICON_RECT_AH_ID)); |
|
2055 } |
|
2056 #endif // PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR |
|
2057 |
|
2058 |
|
2059 CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() ); |
|
2060 if ( appUi->IsSecondCameraEnabled() && !appUi->IsQwerty2ndCamera() ) |
|
2061 { |
|
2062 TRect mainPaneRect; |
|
2063 AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, |
|
2064 mainPaneRect ); |
|
2065 iAudioMuteIconRect.LayoutRect( |
|
2066 mainPaneRect, |
|
2067 AknLayoutScalable_Apps::main_video4_pane_g2( variant ) ); |
|
2068 } |
|
2069 else |
|
2070 { |
|
2071 iAudioMuteIconRect.LayoutRect( |
|
2072 iExtent, |
|
2073 AknLayoutScalable_Apps::main_video4_pane_g2( variant ) ); |
|
2074 } |
|
2075 } |
|
2076 |
|
2077 // End of File |
|