author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 14:09:54 +0300 | |
branch | RCL_3 |
changeset 67 | 756ad29ed18e |
parent 57 | 2c87b2808fd7 |
permissions | -rw-r--r-- |
54 | 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 |
* |
|
67
756ad29ed18e
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
16 |
* Copyright © 2007-2008 Nokia. All rights reserved. |
756ad29ed18e
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
17 |
* This material, including documentation and any related computer |
756ad29ed18e
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
18 |
* programs, is protected by copyright controlled by Nokia. All |
756ad29ed18e
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
19 |
* rights are reserved. Copying, including reproducing, storing, |
756ad29ed18e
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
20 |
* adapting or translating, any or all of this material requires the |
756ad29ed18e
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
21 |
* prior written consent of Nokia. This material also contains |
756ad29ed18e
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
22 |
* confidential information which may not be disclosed to others |
756ad29ed18e
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
23 |
* without the prior written consent of Nokia. |
756ad29ed18e
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
24 |
|
756ad29ed18e
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
25 |
* |
756ad29ed18e
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
26 |
* |
54 | 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 |
||
67
756ad29ed18e
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
212 |
if ( Layout_Meta_Data::IsLandscapeOrientation() || CamUtility::IsNhdDevice() ) |
54 | 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 |
||
67
756ad29ed18e
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
225 |
if ( CamUtility::IsNhdDevice() ) |
54 | 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()? |
|
541 |
ECamMediaStorageMassStorage: |
|
542 |
iController.IntegerSettingValue( ECamSettingItemRemovePhoneMemoryUsage )? |
|
543 |
ECamMediaStorageNone: |
|
544 |
ECamMediaStoragePhone; |
|
545 |
} |
|
546 |
} |
|
547 |
||
548 |
// --------------------------------------------------------- |
|
549 |
// CCamNaviCounterModel::HandleSelfTimerEvent |
|
550 |
// Handle an event from CCamSelfTimer. |
|
551 |
// --------------------------------------------------------- |
|
552 |
// |
|
553 |
void CCamNaviCounterModel::HandleSelfTimerEvent( TCamSelfTimerEvent aEvent, TInt aCountDown ) |
|
554 |
{ |
|
555 |
switch ( aEvent ) |
|
556 |
{ |
|
557 |
case ECamSelfTimerEventTimerOn: |
|
558 |
{ |
|
559 |
iSelfTimerText.Num( TInt64( aCountDown ) ); |
|
560 |
iDrawSelfTimer = ETrue; |
|
561 |
} |
|
562 |
break; |
|
563 |
case ECamSelfTimerEventTimerOff: |
|
564 |
{ |
|
565 |
iDrawSelfTimer = EFalse; |
|
566 |
} |
|
567 |
break; |
|
568 |
default: |
|
569 |
break; |
|
570 |
} |
|
571 |
} |
|
572 |
||
573 |
// --------------------------------------------------------- |
|
574 |
// CCamNaviCounterModel::CCamNaviCounterModel |
|
575 |
// C++ constructor |
|
576 |
// --------------------------------------------------------- |
|
577 |
// |
|
578 |
CCamNaviCounterModel::CCamNaviCounterModel( CCamAppController& aController ) |
|
579 |
: iController( aController ) |
|
580 |
{ |
|
581 |
} |
|
582 |
||
583 |
// --------------------------------------------------------- |
|
584 |
// CCamNaviCounterModel::ConstructL |
|
585 |
// Symbian OS 2nd phase constructor |
|
586 |
// --------------------------------------------------------- |
|
587 |
// |
|
588 |
void CCamNaviCounterModel::ConstructL() |
|
589 |
{ |
|
590 |
OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMNAVICOUNTERMODEL_CONSTRUCTL, "e_CCamNaviCounterModel_ConstructL 1" ); |
|
591 |
PRINT( _L("Camera => CCamNaviCounterModel::ConstructL") ); |
|
592 |
iExtent = TRect(0, 0, 0, 0); |
|
593 |
||
594 |
UpdateCounter(); |
|
595 |
iController.AddControllerObserverL( this ); |
|
596 |
||
597 |
PRINT( _L("Camera <> Load resource data..") ); |
|
598 |
||
599 |
LoadResourceDataL(); |
|
600 |
||
601 |
TFileName resFileName; |
|
602 |
CamUtility::ResourceFileName( resFileName ); |
|
603 |
TPtrC resname = resFileName; |
|
604 |
||
605 |
#ifdef PRODUCT_SUPPORTS_POST_CAPTURE_INDICATORS |
|
606 |
AknIconUtils::CreateIconL( iMpeg4Icon, |
|
607 |
iMpeg4IconMask, |
|
608 |
resname, |
|
609 |
EMbmCameraappQgn_prop_cam4_codec_mp4, |
|
610 |
EMbmCameraappQgn_prop_cam4_codec_mp4_mask ); |
|
611 |
||
612 |
AknIconUtils::CreateIconL( i3GPIcon, |
|
613 |
i3GPIconMask, |
|
614 |
resname, |
|
615 |
EMbmCameraappQgn_prop_cam4_codec_3gp, |
|
616 |
EMbmCameraappQgn_prop_cam4_codec_3gp_mask ); |
|
617 |
#endif |
|
618 |
||
619 |
// wait for engine to initialise video recorder |
|
620 |
iVideoInitialised = EFalse; |
|
621 |
||
622 |
PRINT( _L("Camera <> construct navi self timer..") ); |
|
623 |
ConstructNaviSelfTimerL( resname ); |
|
624 |
||
625 |
||
626 |
PRINT( _L("Camera <> construct navi sequence..") ); |
|
627 |
ConstructNaviSequenceL( resname ); |
|
628 |
||
629 |
#ifdef PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR |
|
630 |
PRINT( _L("Camera <> construct generic setup..") ); |
|
631 |
ConstructNaviGenericSetupL( resname ); |
|
632 |
#endif |
|
633 |
||
634 |
PRINT( _L("Camera <> construct navi audio mute..") ); |
|
635 |
ConstructNaviAudioMuteL( resname ); |
|
636 |
||
637 |
#ifdef PRODUCT_SUPPORTS_NAVIPANE_MODE_SUBTITLE |
|
638 |
PRINT( _L("Camera <> construct navi subtitle..") ); |
|
639 |
ConstructNaviModeSubtitleL( resname ); |
|
640 |
#endif // PRODUCT_SUPPORTS_NAVIPANE_MODE_SUBTITLE |
|
641 |
||
642 |
CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() ); |
|
643 |
iBurstActive = appUi->IsBurstEnabled(); |
|
644 |
#if defined( PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE ) |
|
645 |
iDrawSequence = iBurstActive; |
|
646 |
#endif // PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE |
|
647 |
||
648 |
PRINT( _L("Camera <> construct observer handler..") ); |
|
649 |
iObserverHandler = CCamObserverHandler::NewL(); |
|
650 |
||
651 |
if ( iController.UiConfigManagerPtr() && |
|
652 |
iController.UiConfigManagerPtr()->IsLocationSupported() ) |
|
653 |
{ |
|
654 |
iLocationIconVisible = (/*TCamLocationId::ECamLocationOn*/1 == iController.IntegerSettingValue( ECamSettingItemRecLocation )); |
|
655 |
} |
|
656 |
PRINT( _L("Camera <= CCamNaviCounterModel::ConstructL") ); |
|
657 |
OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMNAVICOUNTERMODEL_CONSTRUCTL, "e_CCamNaviCounterModel_ConstructL 0" ); |
|
658 |
} |
|
659 |
||
660 |
// --------------------------------------------------------- |
|
661 |
// CCamNaviCounterModel::Draw |
|
662 |
// Draw the control |
|
663 |
// --------------------------------------------------------- |
|
664 |
// |
|
665 |
void |
|
666 |
CCamNaviCounterModel::DrawNaviCtr( CBitmapContext& aGc, |
|
667 |
const CCoeControl* aControl ) const |
|
668 |
{ |
|
669 |
DrawCounter( aGc, aControl ); |
|
670 |
} |
|
671 |
||
672 |
// --------------------------------------------------------- |
|
673 |
// CCamNaviCounterModel::DrawCounter |
|
674 |
// Draw the control |
|
675 |
// --------------------------------------------------------- |
|
676 |
// |
|
677 |
void |
|
678 |
CCamNaviCounterModel::DrawCounter( CBitmapContext& aGc, |
|
679 |
const CCoeControl* /*aControl*/ ) const |
|
680 |
{ |
|
681 |
PRINT_FRQ( _L("Camera => CCamNaviCounterModel::DrawCounter" )) |
|
682 |
MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
|
683 |
||
684 |
CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() ); |
|
685 |
const TCamViewState& viewState( appUi->CurrentViewState() ); |
|
686 |
||
687 |
||
688 |
// ------------------------------------------------------- |
|
689 |
// Precapture state |
|
690 |
if ( ECamViewStatePreCapture == viewState ) |
|
691 |
{ |
|
692 |
TBool inSequence = iController.SequenceCaptureInProgress(); |
|
693 |
TBool inTimeLapse = inSequence && (ECamImageCaptureTimeLapse == iImageMode); |
|
694 |
TBool inBurst = inSequence && (ECamImageCaptureBurst == iImageMode); |
|
695 |
||
696 |
TBool stillCapturing = ECamImageCaptureSingle == iImageMode |
|
697 |
&& iController.IsProcessingCapture(); |
|
698 |
||
699 |
||
700 |
// Audio mute icon should be drawn even though courtesy UI applies. |
|
701 |
if ( iMode == ECamControllerVideo ) |
|
702 |
{ |
|
703 |
DrawNaviAudioMute( aGc ); |
|
704 |
} |
|
705 |
// these are drawn when sequence capture is in progress and |
|
706 |
// should be drawn even when courtesy stuff is off |
|
707 |
if ( inTimeLapse || inBurst ) |
|
708 |
{ |
|
709 |
iSequenceInCaptureDecorator->Draw( aGc, iExtent ); |
|
710 |
} |
|
711 |
else |
|
712 |
{ |
|
713 |
// To prevent Lint warning |
|
714 |
} |
|
715 |
// Draw the navipane sequence icon if current performing a timelapse or burst capture |
|
716 |
if ( inTimeLapse || inBurst ) |
|
717 |
{ |
|
718 |
DrawNaviSequence( aGc ); |
|
719 |
} |
|
720 |
if ( inTimeLapse && iController.TimeLapseSupported() ) |
|
721 |
{ |
|
722 |
// Draw the captured images and captured remaining text |
|
723 |
DrawSequenceImageText( skin, aGc ); |
|
724 |
// Draw the timelapse countdown counter |
|
725 |
DrawTimeLapseCountdown( skin, aGc ); |
|
726 |
} |
|
727 |
else if ( inBurst ) |
|
728 |
{ |
|
729 |
// Draw the captured images and captured remaining text |
|
730 |
DrawSequenceImageText( skin, aGc ); |
|
731 |
} |
|
732 |
||
733 |
if ( appUi && ( appUi->DrawPreCaptureCourtesyUI() || |
|
734 |
( !appUi->DrawPreCaptureCourtesyUI() && appUi->IsSecondCameraEnabled() ) ) ) |
|
735 |
{ |
|
736 |
||
737 |
if ( !inTimeLapse && !inBurst && !iController.IsProcessingCapture() ) |
|
738 |
{ |
|
739 |
// Draw the icon for storage location (Phone/MediaCard) |
|
740 |
DrawStorageIcon( aGc ); |
|
741 |
} |
|
742 |
||
743 |
#ifdef PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE |
|
744 |
if ( iDrawSequence ) |
|
745 |
{ |
|
746 |
DrawNaviSequence( aGc ); |
|
747 |
} |
|
748 |
#endif // PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE |
|
749 |
||
750 |
||
751 |
#ifdef PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR |
|
752 |
DrawNaviGenericSetup( aGc ); |
|
753 |
#endif // PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR |
|
754 |
||
755 |
if ( iMode == ECamControllerVideo ) |
|
756 |
{ |
|
757 |
// only draw remaining time when engine has initialised video |
|
758 |
if ( iVideoInitialised && iVideoTextItem && !iController.IsProcessingCapture() ) |
|
759 |
{ |
|
760 |
iVideoTextItem->Draw( aGc ); |
|
761 |
} |
|
762 |
} |
|
763 |
else if ( !stillCapturing && iPhotoTextItem && !inBurst) |
|
764 |
{ |
|
765 |
iPhotoTextItem->Draw( aGc ); |
|
766 |
} |
|
767 |
else |
|
768 |
{ |
|
769 |
// To prevent Lint warning |
|
770 |
} |
|
771 |
} |
|
772 |
} |
|
773 |
||
774 |
// ------------------------------------------------------- |
|
775 |
// Post capture state |
|
776 |
else if ( ECamViewStatePostCapture == viewState |
|
777 |
|| ECamViewStateBurstThumbnail == viewState ) |
|
778 |
{ |
|
779 |
if ( appUi->DrawPostCaptureCourtesyUI() ) |
|
780 |
{ |
|
781 |
||
782 |
TRAP_IGNORE( DrawCurrentFileSizeL( skin, aGc ) ); |
|
783 |
||
784 |
#ifdef PRODUCT_SUPPORTS_POST_CAPTURE_INDICATORS |
|
785 |
// Draw the icon for storage location (Phone/MediaCard) |
|
786 |
DrawStorageIcon( aGc ); |
|
787 |
||
788 |
if ( iMode == ECamControllerVideo ) |
|
789 |
{ |
|
790 |
// Draw the video file type indicator |
|
791 |
DrawVideoFileTypeIndicator( aGc ); |
|
792 |
} |
|
793 |
#endif // PRODUCT_SUPPORTS_POST_CAPTURE_INDICATORS |
|
794 |
||
795 |
if ( appUi->CurrentBurstMode() == ECamImageCaptureTimeLapse ) |
|
796 |
{ |
|
797 |
// Draw images captured text background |
|
798 |
PRINT( _L("Camera <> Drawing timelapse postcapture decorator.. #######################") ); |
|
799 |
iTimeLapsePostCaptureDecorator->Draw( aGc, iExtent ); |
|
800 |
// Draw images capture text |
|
801 |
TRAP_IGNORE( DrawImagesCapturedTextL( skin, aGc ) ); |
|
802 |
} |
|
803 |
||
804 |
} |
|
805 |
} |
|
806 |
// ------------------------------------------------------- |
|
807 |
// otherwise, do nothing |
|
808 |
else |
|
809 |
{ |
|
810 |
// empty statement to remove Lint error, MISRA required rule 60 |
|
811 |
} |
|
812 |
// ------------------------------------------------------- |
|
813 |
||
814 |
DrawNaviSelfTimer( aGc, skin ); |
|
815 |
||
816 |
#ifdef PRODUCT_SUPPORTS_NAVIPANE_MODE_SUBTITLE |
|
817 |
DrawNaviModeSubtitle( aGc, skin ); |
|
818 |
#endif // PRODUCT_SUPPORTS_NAVIPANE_MODE_SUBTITLE |
|
819 |
||
820 |
PRINT_FRQ( _L("Camera <= CCamNaviCounterModel::DrawCounter" )) |
|
821 |
} |
|
822 |
||
823 |
||
824 |
// --------------------------------------------------------- |
|
825 |
// CCamNaviCounterModel::DrawCounter |
|
826 |
// Draw the control |
|
827 |
// --------------------------------------------------------- |
|
828 |
// |
|
829 |
void |
|
830 |
CCamNaviCounterModel::DrawCounterToBitmaps( CFbsBitGc& aBmpGc, |
|
831 |
CFbsBitGc& aBmpMaskGc ) const |
|
832 |
{ |
|
833 |
PRINT( _L("Camera => CCamNaviCounterModel::DrawCounterToBitmaps" )) |
|
834 |
||
835 |
CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() ); |
|
836 |
// Draw bitmaps to use in the real navi pane in the settings views |
|
837 |
if ( appUi->CurrentViewState() == ECamViewStateSettings ) |
|
838 |
{ |
|
839 |
DrawStorageIconToBitmap( aBmpGc, aBmpMaskGc ); |
|
840 |
const CFont* font = AknLayoutUtils::FontFromId(EAknLogicalFontSecondaryFont); |
|
841 |
// TRgb color = layoutText.Color(); |
|
842 |
TRgb color = KRgbWhite; |
|
843 |
// Color is not updated if it not found from the skin |
|
844 |
MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
|
845 |
AknsUtils::GetCachedColor( skin, color, KNaviPaneMajorColour, KNaviPaneMinorColour ); |
|
846 |
aBmpGc.SetPenColor(color); |
|
847 |
aBmpGc.UseFont(font); |
|
848 |
if ( iMode == ECamControllerVideo ) |
|
849 |
{ |
|
850 |
||
851 |
TBufC<KMaxTextLength> buf( iRemainingTimeText ); |
|
852 |
TPtr pointer = buf.Des(); |
|
853 |
AknTextUtils::LanguageSpecificNumberConversion( pointer ); |
|
854 |
aBmpGc.DrawText( buf, TPoint( 35, font->HeightInPixels()) ); |
|
855 |
} |
|
856 |
else |
|
857 |
{ |
|
858 |
TBufC<KMaxTextLength> buf( iCounterText ); |
|
859 |
TPtr pointer = buf.Des(); |
|
860 |
AknTextUtils::LanguageSpecificNumberConversion( pointer ); |
|
861 |
aBmpGc.DrawText( buf, TPoint( 35, font->HeightInPixels()) ); |
|
862 |
} |
|
863 |
aBmpGc.DiscardFont(); |
|
864 |
||
865 |
aBmpMaskGc.SetPenColor(KRgbBlack); |
|
866 |
aBmpMaskGc.UseFont(font); |
|
867 |
if ( iMode == ECamControllerVideo ) |
|
868 |
{ |
|
869 |
TBufC<KMaxTextLength> buf( iRemainingTimeText ); |
|
870 |
TPtr pointer = buf.Des(); |
|
871 |
AknTextUtils::LanguageSpecificNumberConversion( pointer ); |
|
872 |
aBmpMaskGc.DrawText( buf, TPoint( 35,font->HeightInPixels()) ); |
|
873 |
||
874 |
} |
|
875 |
else |
|
876 |
{ |
|
877 |
||
878 |
TBufC<KMaxTextLength> buf( iCounterText ); |
|
879 |
TPtr pointer = buf.Des(); |
|
880 |
AknTextUtils::LanguageSpecificNumberConversion( pointer ); |
|
881 |
aBmpMaskGc.DrawText( buf, TPoint( 35,font->HeightInPixels()) ); |
|
882 |
||
883 |
} |
|
884 |
aBmpMaskGc.DiscardFont(); |
|
885 |
} |
|
886 |
PRINT( _L("Camera <= CCamNaviCounterModel::DrawCounterToBitmaps" )) |
|
887 |
} |
|
888 |
||
889 |
// --------------------------------------------------------- |
|
890 |
// CCamNaviCounterModel::DrawStorageIconToBitmap |
|
891 |
// Draw the icon for the media storage location |
|
892 |
// --------------------------------------------------------- |
|
893 |
// |
|
894 |
void |
|
895 |
CCamNaviCounterModel::DrawStorageIconToBitmap( CFbsBitGc& aBmpGc, |
|
896 |
CFbsBitGc& aBmpMaskGc ) const |
|
897 |
{ |
|
898 |
CFbsBitmap* icon = NULL; |
|
899 |
CFbsBitmap* mask = NULL; |
|
900 |
switch( iStorageLocation ) |
|
901 |
{ |
|
902 |
case ECamMediaStoragePhone: |
|
903 |
{ |
|
904 |
icon = iPhoneIcon; |
|
905 |
mask = iPhoneIconMask; |
|
906 |
} |
|
907 |
break; |
|
908 |
case ECamMediaStorageMassStorage: |
|
909 |
{ |
|
910 |
icon = iMassStorageIcon; |
|
911 |
mask = iMassStorageIconMask; |
|
912 |
} |
|
913 |
break; |
|
914 |
case ECamMediaStorageCard: |
|
915 |
{ |
|
916 |
icon = iMMCIcon; |
|
917 |
mask = iMMCIconMask; |
|
918 |
} |
|
919 |
break; |
|
920 |
case ECamMediaStorageNone: |
|
921 |
default: |
|
922 |
{ |
|
923 |
//TODO: Get icons when none is available |
|
924 |
} |
|
925 |
break; |
|
926 |
} |
|
927 |
// Should use layout |
|
928 |
aBmpGc.BitBlt(TPoint(0,0), icon); |
|
929 |
aBmpMaskGc.BitBlt(TPoint(0,0), mask); |
|
930 |
} |
|
931 |
||
932 |
// --------------------------------------------------------- |
|
933 |
// CCamNaviCounterModel::DrawStorageIcon |
|
934 |
// Draw the icon for the media storage location |
|
935 |
// --------------------------------------------------------- |
|
936 |
// |
|
937 |
void |
|
938 |
CCamNaviCounterModel::DrawStorageIcon( CBitmapContext& aGc ) const |
|
939 |
{ |
|
940 |
CFbsBitmap* icon = NULL; |
|
941 |
CFbsBitmap* mask = NULL; |
|
942 |
switch( iStorageLocation ) |
|
943 |
{ |
|
944 |
case ECamMediaStoragePhone: |
|
945 |
{ |
|
946 |
icon = iPhoneIcon; |
|
947 |
mask = iPhoneIconMask; |
|
948 |
} |
|
949 |
break; |
|
950 |
case ECamMediaStorageMassStorage: |
|
951 |
{ |
|
952 |
icon = iMassStorageIcon; |
|
953 |
mask = iMassStorageIconMask; |
|
954 |
} |
|
955 |
break; |
|
956 |
case ECamMediaStorageCard: |
|
957 |
{ |
|
958 |
icon = iMMCIcon; |
|
959 |
mask = iMMCIconMask; |
|
960 |
} |
|
961 |
break; |
|
962 |
case ECamMediaStorageNone: |
|
963 |
default: |
|
964 |
{ |
|
965 |
//TODO: Get icons when none is available |
|
966 |
} |
|
967 |
break; |
|
968 |
} |
|
969 |
||
970 |
if( icon == NULL || mask == NULL) |
|
971 |
{ |
|
972 |
return; |
|
973 |
} |
|
974 |
||
975 |
if ( iMode == ECamControllerVideo ) |
|
976 |
{ |
|
977 |
CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() ); |
|
978 |
||
979 |
// Postcapture state |
|
980 |
if ( appUi->CurrentViewState() == ECamViewStatePostCapture ) |
|
981 |
{ |
|
982 |
aGc.BitBltMasked( iVidPostStorageIconRect.Rect().iTl, icon, icon->SizeInPixels(), mask, ETrue ); |
|
983 |
} |
|
984 |
else |
|
985 |
{ |
|
986 |
aGc.BitBltMasked( iVidPreStorageIconRect.Rect().iTl, icon, icon->SizeInPixels(), mask, ETrue ); |
|
987 |
} |
|
988 |
} |
|
989 |
else |
|
990 |
{ |
|
991 |
aGc.BitBltMasked( iImgStorageIconRect.Rect().iTl, icon, icon->SizeInPixels(), mask, ETrue ); |
|
992 |
} |
|
993 |
} |
|
994 |
||
995 |
// --------------------------------------------------------- |
|
996 |
// CCamNaviCounterModel::DrawVideoFileTypeIndicator |
|
997 |
// Draw the icon for the video file type indicator |
|
998 |
// --------------------------------------------------------- |
|
999 |
// |
|
1000 |
void CCamNaviCounterModel::DrawVideoFileTypeIndicator( CBitmapContext& aGc ) const |
|
1001 |
{ |
|
1002 |
CFbsBitmap* icon = NULL; |
|
1003 |
CFbsBitmap* mask = NULL; |
|
1004 |
||
1005 |
CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() ); |
|
1006 |
if ( appUi && appUi->DrawPreCaptureCourtesyUI() ) |
|
1007 |
{ |
|
1008 |
TCamVideoFileType fileType = static_cast< TCamVideoFileType > |
|
1009 |
( iController.IntegerSettingValue( ECamSettingItemVideoFileType ) ); |
|
1010 |
||
1011 |
if ( fileType == ECamVideoMpeg4 ) |
|
1012 |
{ |
|
1013 |
icon = iMpeg4Icon; |
|
1014 |
mask = iMpeg4IconMask; |
|
1015 |
} |
|
1016 |
||
1017 |
// Otherwise display the H263 icon. |
|
1018 |
else |
|
1019 |
{ |
|
1020 |
icon = i3GPIcon; |
|
1021 |
mask = i3GPIconMask; |
|
1022 |
} |
|
1023 |
||
1024 |
aGc.BitBltMasked( iVideoFileTypeIconRect.Rect().iTl, icon, icon->SizeInPixels(), mask, ETrue ); |
|
1025 |
} |
|
1026 |
} |
|
1027 |
||
1028 |
// --------------------------------------------------------- |
|
1029 |
// CCamNaviCounterModel::DrawText |
|
1030 |
// Draw the counter text (photo mode) |
|
1031 |
// --------------------------------------------------------- |
|
1032 |
// |
|
1033 |
void |
|
1034 |
CCamNaviCounterModel::DrawText( MAknsSkinInstance* /* aSkin */, |
|
1035 |
const TDesC& /* aText */, |
|
1036 |
CBitmapContext& /* aGc */ ) const |
|
1037 |
{ |
|
1038 |
PRINT( _L("camera <> CCamNaviCounterModel::DrawText() not implemented" ) ); |
|
1039 |
} |
|
1040 |
||
1041 |
// --------------------------------------------------------- |
|
1042 |
// CCamNaviCounterModel::DrawTimeLapseCountdown |
|
1043 |
// Draw the timelapse image counter text (captured and remaining images) |
|
1044 |
// --------------------------------------------------------- |
|
1045 |
// |
|
1046 |
void CCamNaviCounterModel::DrawTimeLapseCountdown( MAknsSkinInstance* /*aSkin*/, |
|
1047 |
CBitmapContext& aGc ) const |
|
1048 |
{ |
|
1049 |
PRINT( _L("Camera => CCamNaviCounterModel::DrawTimeLapseCountdown") ); |
|
1050 |
if( iCountDownText ) |
|
1051 |
{ |
|
1052 |
TBufC<32> buf( *iCountDownText ); // 00:00:00 as Unicode, 32 should be enough |
|
1053 |
TPtr pointer = buf.Des(); |
|
1054 |
AknTextUtils::LanguageSpecificNumberConversion( pointer ); |
|
1055 |
if ( iTimeLapseCountdownTextItem ) |
|
1056 |
{ |
|
1057 |
TRAP_IGNORE( iTimeLapseCountdownTextItem->SetTextL( buf ) ); |
|
1058 |
iTimeLapseCountdownTextItem->Draw( aGc ); |
|
1059 |
} |
|
1060 |
} |
|
1061 |
else |
|
1062 |
{ |
|
1063 |
PRINT( _L("Camera <> CCamNaviCounterModel::DrawTimeLapseCountdown .. [WARNING] no countdown text!") ); |
|
1064 |
} |
|
1065 |
PRINT( _L("Camera <= CCamNaviCounterModel::DrawTimeLapseCountdown") ); |
|
1066 |
} |
|
1067 |
||
1068 |
// --------------------------------------------------------- |
|
1069 |
// CCamNaviCounterModel::DrawSequenceImageText |
|
1070 |
// Draw the captured and remaining image count during timelapse capture |
|
1071 |
// --------------------------------------------------------- |
|
1072 |
// |
|
1073 |
void CCamNaviCounterModel::DrawSequenceImageText( MAknsSkinInstance* /*aSkin*/, |
|
1074 |
CBitmapContext& aGc ) const |
|
1075 |
{ |
|
1076 |
PRINT1( _L("CCamNaviCounterModel::DrawSequenceImageText %S" ), &iSequenceImageText ) |
|
1077 |
||
1078 |
if ( iSequenceImageTextItem ) |
|
1079 |
{ |
|
1080 |
TRAP_IGNORE( iSequenceImageTextItem->SetTextL( iSequenceImageText ) ); |
|
1081 |
iSequenceImageTextItem->Draw( aGc ); |
|
1082 |
} |
|
1083 |
} |
|
1084 |
||
1085 |
// --------------------------------------------------------- |
|
1086 |
// CCamNaviCounterModel::DrawImagesCapturedTextL |
|
1087 |
// Draw the count of images captured in timelapse postcapture view |
|
1088 |
// --------------------------------------------------------- |
|
1089 |
// |
|
1090 |
void CCamNaviCounterModel::DrawImagesCapturedTextL( |
|
1091 |
MAknsSkinInstance* /*aSkin*/, |
|
1092 |
CBitmapContext& aGc ) const |
|
1093 |
{ |
|
1094 |
// Draw count of captured images |
|
1095 |
const TInt imagesCaptured = iController.TimeLapseImageCount(); |
|
1096 |
HBufC* capturedImagesText = StringLoader::LoadLC( R_CAM_TIMELAPSE_IMAGES_CAPTURED, imagesCaptured ); |
|
1097 |
||
1098 |
HBufC* buf = HBufC::NewLC( KCamDefaultCapturedImagesTextLen ); |
|
1099 |
if ( capturedImagesText->Length() > buf->Length() ) |
|
1100 |
{ |
|
1101 |
buf->ReAlloc( capturedImagesText->Length() ); |
|
1102 |
} |
|
1103 |
||
1104 |
buf = capturedImagesText; |
|
1105 |
TPtr pointer = buf->Des(); |
|
1106 |
AknTextUtils::LanguageSpecificNumberConversion( pointer ); |
|
1107 |
||
1108 |
if ( iSequenceCapturedTextItem ) |
|
1109 |
{ |
|
1110 |
iSequenceCapturedTextItem->SetTextL( *buf ); |
|
1111 |
iSequenceCapturedTextItem->Draw( aGc ); |
|
1112 |
} |
|
1113 |
||
1114 |
CleanupStack::PopAndDestroy( buf ); |
|
1115 |
CleanupStack::PopAndDestroy( capturedImagesText ); |
|
1116 |
} |
|
1117 |
||
1118 |
#ifdef PRODUCT_SUPPORTS_NAVIPANE_FILENAME |
|
1119 |
// --------------------------------------------------------- |
|
1120 |
// CCamNaviCounterModel::DrawCurrentFileName |
|
1121 |
// Draw the file name |
|
1122 |
// --------------------------------------------------------- |
|
1123 |
// |
|
1124 |
void |
|
1125 |
CCamNaviCounterModel::DrawCurrentFileName( MAknsSkinInstance* aSkin, |
|
1126 |
CBitmapContext& aGc ) const |
|
1127 |
{ |
|
1128 |
TAknLayoutText layoutText; |
|
1129 |
if ( iMode == ECamControllerVideo ) |
|
1130 |
{ |
|
1131 |
layoutText = iVideoNameLayout; |
|
1132 |
} |
|
1133 |
else |
|
1134 |
{ |
|
1135 |
layoutText = iPhotoNameLayout; |
|
1136 |
} |
|
1137 |
// Draw counter text |
|
1138 |
TRgb color = layoutText.Color(); |
|
1139 |
||
1140 |
// Color is not updated if it not found from the skin |
|
1141 |
AknsUtils::GetCachedColor( aSkin, color, |
|
1142 |
KNaviPaneMajorColour, KNaviPaneMinorColour ); |
|
1143 |
||
1144 |
||
1145 |
layoutText.DrawText( aGc, iController.CurrentImageName() , ETrue, KRgbWhite ); |
|
1146 |
} |
|
1147 |
#endif // PRODUCT_SUPPORTS_NAVIPANE_FILENAME |
|
1148 |
||
1149 |
||
1150 |
// --------------------------------------------------------- |
|
1151 |
// CCamNaviCounterModel::DrawCurrentFileSizeL |
|
1152 |
// Draw the file size |
|
1153 |
// --------------------------------------------------------- |
|
1154 |
// |
|
1155 |
||
1156 |
void |
|
1157 |
CCamNaviCounterModel::DrawCurrentFileSizeL( MAknsSkinInstance* aSkin, |
|
1158 |
CBitmapContext& aGc ) const |
|
1159 |
{ |
|
1160 |
TAknLayoutText layoutText; |
|
1161 |
if ( iMode == ECamControllerVideo ) |
|
1162 |
{ |
|
1163 |
layoutText = iVideoSizeLayout; |
|
1164 |
} |
|
1165 |
else |
|
1166 |
{ |
|
1167 |
layoutText = iPhotoSizeLayout; |
|
1168 |
} |
|
1169 |
// Draw counter text |
|
1170 |
TRgb color = layoutText.Color(); |
|
1171 |
||
1172 |
// Color is not updated if it not found from the skin |
|
1173 |
AknsUtils::GetCachedColor( aSkin, color, |
|
1174 |
KNaviPaneMajorColour, KNaviPaneMinorColour ); |
|
1175 |
||
1176 |
// Show the filename or burst name (if burst mode) |
|
1177 |
||
1178 |
//START: NOT DISPLAYING FILESIZE |
|
1179 |
/* |
|
1180 |
CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() ); |
|
1181 |
TInt size = 0; |
|
1182 |
||
1183 |
// Get the filesize |
|
1184 |
if ( appUi->CurrentViewState() == ECamViewStatePostCapture ) |
|
1185 |
{ |
|
1186 |
TPtrC filename = iController.CurrentFullFileName(); |
|
1187 |
size = iController.FileSize( filename ); |
|
1188 |
} |
|
1189 |
else if ( appUi->CurrentViewState() == ECamViewStateBurstThumbnail ) |
|
1190 |
{ |
|
1191 |
} |
|
1192 |
// otherwise, do nothing |
|
1193 |
else |
|
1194 |
{ |
|
1195 |
// empty statement to remove Lint error, MISRA required rule 60 |
|
1196 |
} |
|
1197 |
*/ |
|
1198 |
//END: NOT DISPLAYING FILESIZE |
|
1199 |
||
1200 |
if ( iMode == ECamControllerVideo ) |
|
1201 |
{ |
|
1202 |
// Draw the file size string |
|
1203 |
TBuf <15> timebuf; |
|
1204 |
TBuf <30> fullbuf; |
|
1205 |
||
1206 |
// Generate the string for video length (time) |
|
1207 |
TTimeIntervalMicroSeconds interval = iController.RecordTimeElapsed(); |
|
1208 |
TTime time( interval.Int64() ); |
|
1209 |
time.FormatL( timebuf, *iTimeFormat ); |
|
1210 |
aGc.SetBrushColor( KRgbWhite ); |
|
1211 |
TBufC<KMaxTextLength> buf( timebuf ); |
|
1212 |
TPtr pointer = buf.Des(); |
|
1213 |
AknTextUtils::LanguageSpecificNumberConversion( pointer ); |
|
1214 |
layoutText.DrawText( aGc, pointer, EFalse, KRgbBlack ); |
|
1215 |
} |
|
1216 |
||
1217 |
// START: NOT DISPLAYING FILESIZE |
|
1218 |
/* |
|
1219 |
else |
|
1220 |
{ |
|
1221 |
if ( size > 0 ) |
|
1222 |
{ |
|
1223 |
// Draw the file size string |
|
1224 |
HBufC* fileSizeStr = StringLoader::LoadLC( R_QTN_SIZE_KB, size / KKilo ); |
|
1225 |
layoutText.DrawText( aGc, fileSizeStr->Des() , ETrue, KRgbWhite ); |
|
1226 |
CleanupStack::PopAndDestroy( fileSizeStr ); |
|
1227 |
} |
|
1228 |
} |
|
1229 |
*/ |
|
1230 |
// END: NOT DISPLAYING FILESIZE |
|
1231 |
||
1232 |
} |
|
1233 |
||
1234 |
||
1235 |
// ---------------------------------------------------- |
|
1236 |
// CCamNaviCounterModel::BurstModeActiveL |
|
1237 |
// Notification that the burst mode has been activated/deactivated |
|
1238 |
// ---------------------------------------------------- |
|
1239 |
// |
|
1240 |
// burst mode icon is displayed in either the navipane or sidepane |
|
1241 |
void CCamNaviCounterModel::BurstModeActiveL( TBool aActive, TBool /*aStillModeActive*/ ) |
|
1242 |
{ |
|
1243 |
#ifdef PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE |
|
1244 |
// Update internal state, and trigger a redraw |
|
1245 |
iDrawSequence = aActive; |
|
1246 |
DrawDeferred(); |
|
1247 |
#endif // PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE |
|
1248 |
||
1249 |
// update remaining images |
|
1250 |
iBurstActive = aActive; |
|
1251 |
UpdateCounter(); |
|
1252 |
} |
|
1253 |
||
1254 |
||
1255 |
// --------------------------------------------------------- |
|
1256 |
// CCamNaviCounterModel::ForceNaviPaneUpdate |
|
1257 |
// Force update of navi-pane (i.e after dismissal of MMC removed error note) |
|
1258 |
// --------------------------------------------------------- |
|
1259 |
// |
|
1260 |
void CCamNaviCounterModel::ForceNaviPaneUpdate() |
|
1261 |
{ |
|
1262 |
PRINT( _L("Camera => CCamNaviCounterModel::ForceNaviPaneUpdate" )) |
|
1263 |
// update counters |
|
1264 |
// get current storage location |
|
1265 |
TInt key = ( ECamControllerVideo == iMode ) |
|
1266 |
? ECamSettingItemVideoMediaStorage |
|
1267 |
: ECamSettingItemPhotoMediaStorage; |
|
1268 |
||
1269 |
if ( static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() )->IsMMCRemovedNotePending() ) |
|
1270 |
{ |
|
1271 |
PRINT( _L("Camera <> CCamNaviCounterModel::ForceNaviPaneUpdate pend") ) |
|
1272 |
iStorageLocation = |
|
1273 |
static_cast<TCamMediaStorage>( |
|
1274 |
iController.IntegerSettingValueUnfiltered( key ) ); |
|
1275 |
} |
|
1276 |
else |
|
1277 |
{ |
|
1278 |
PRINT( _L("Camera <> CCamNaviCounterModel::ForceNaviPaneUpdate yyy") ) |
|
1279 |
iStorageLocation = |
|
1280 |
static_cast<TCamMediaStorage>( |
|
1281 |
iController.IntegerSettingValue( key ) ); |
|
1282 |
} |
|
1283 |
||
1284 |
if (ECamMediaStorageMassStorage ==iStorageLocation) |
|
1285 |
{ |
|
1286 |
TCamMediaStorage storage = iController.IntegerSettingValue( ECamSettingItemRemovePhoneMemoryUsage )? |
|
1287 |
ECamMediaStorageNone: |
|
1288 |
ECamMediaStoragePhone; |
|
1289 |
iStorageLocation = iController.ExistMassStorage()?ECamMediaStorageMassStorage:storage; |
|
1290 |
} |
|
1291 |
UpdateCounter(); |
|
1292 |
||
1293 |
TRAP_IGNORE( UpdateRecordTimeAvailableL() ); |
|
1294 |
PRINT( _L("Camera <= CCamNaviCounterModel::ForceNaviPaneUpdate" )) |
|
1295 |
} |
|
1296 |
||
1297 |
||
1298 |
// --------------------------------------------------------- |
|
1299 |
// CCamNaviCounterModel::HandleControllerEventL |
|
1300 |
// Handle an event from CCamAppController. |
|
1301 |
// --------------------------------------------------------- |
|
1302 |
// |
|
1303 |
void |
|
1304 |
CCamNaviCounterModel::HandleControllerEventL( TCamControllerEvent aEvent, |
|
1305 |
TInt /* aError */ ) |
|
1306 |
{ |
|
1307 |
PRINT1( _L("Camera => CCamNaviCounterModel::HandleControllerEventL %d" ), aEvent ) |
|
1308 |
CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() ); |
|
1309 |
iCounterNeedUpdate = EFalse; |
|
1310 |
||
1311 |
switch( aEvent ) |
|
1312 |
{ |
|
1313 |
// ----------------------------------------------------- |
|
1314 |
// If this is a capture complete event, or the image quality or save |
|
1315 |
// location has changed... |
|
1316 |
// case ECamEventCaptureComplete: |
|
1317 |
case ECamEventVideoQualityChanged: |
|
1318 |
case ECamEventImageQualityChanged: |
|
1319 |
case ECamEventSaveLocationChanged: |
|
1320 |
{ |
|
1321 |
if( iMode == ECamControllerVideo ) |
|
1322 |
{ |
|
1323 |
UpdateRecordTimeAvailableL(); |
|
1324 |
} |
|
1325 |
else |
|
1326 |
{ |
|
1327 |
UpdateCounter(); |
|
1328 |
} |
|
1329 |
||
1330 |
if ( ECamEventSaveLocationChanged == aEvent ) |
|
1331 |
{ |
|
1332 |
TCamSettingItemIds storageId = (ECamControllerVideo == iMode) |
|
1333 |
? ECamSettingItemVideoMediaStorage |
|
1334 |
: ECamSettingItemPhotoMediaStorage; |
|
1335 |
||
1336 |
// update location |
|
1337 |
if ( appUi->IsMMCRemovedNotePending() ) |
|
1338 |
{ |
|
1339 |
iStorageLocation = static_cast< TCamMediaStorage > |
|
1340 |
( iController.IntegerSettingValueUnfiltered( storageId ) ); |
|
1341 |
} |
|
1342 |
else |
|
1343 |
{ |
|
1344 |
iStorageLocation = static_cast< TCamMediaStorage > |
|
1345 |
( iController.IntegerSettingValue( storageId ) ); |
|
1346 |
} |
|
1347 |
//CreateNaviBitmapsL( ETrue ); |
|
1348 |
||
1349 |
if (ECamMediaStorageMassStorage ==iStorageLocation) |
|
1350 |
{ |
|
1351 |
TCamMediaStorage storage = iController.IntegerSettingValue( ECamSettingItemRemovePhoneMemoryUsage )? |
|
1352 |
ECamMediaStorageNone: |
|
1353 |
ECamMediaStoragePhone; |
|
1354 |
iStorageLocation = iController.ExistMassStorage()?ECamMediaStorageMassStorage:storage; |
|
1355 |
} |
|
1356 |
} |
|
1357 |
BroadcastEvent( ECamObserverEventNaviModelUpdated ); |
|
1358 |
break; |
|
1359 |
} |
|
1360 |
// ----------------------------------------------------- |
|
1361 |
case ECamEventLocationSettingChanged: |
|
1362 |
{ |
|
1363 |
iLocationIconVisible = (/*TCamLocationId::ECamLocationOn*/1 == iController.IntegerSettingValue( ECamSettingItemRecLocation )); |
|
1364 |
// We reload the resource data so that the control is drawn correctly |
|
1365 |
ReloadResourceDataL(); |
|
1366 |
//BroadcastEvent( ECamObserverEventNaviModelUpdated ); |
|
1367 |
break; |
|
1368 |
} |
|
1369 |
// ----------------------------------------------------- |
|
1370 |
case ECamEventEngineStateChanged: |
|
1371 |
{ |
|
1372 |
if( ECamControllerVideo == iMode ) |
|
1373 |
{ |
|
1374 |
// wait until engine has initialised video before updating time remaining |
|
1375 |
if ( !iVideoInitialised ) |
|
1376 |
{ |
|
1377 |
// <CAMERAAPP_CAPI_V2_MIGRATION/> |
|
1378 |
// if ( iController.EngineState() == ECamEngineVideoCapturePrepared ) |
|
1379 |
if ( iController.CameraState() == ECamCameraPreparedVideo ) |
|
1380 |
{ |
|
1381 |
iVideoInitialised = ETrue; |
|
1382 |
} |
|
1383 |
} |
|
1384 |
if ( iVideoInitialised ) |
|
1385 |
{ |
|
1386 |
UpdateRecordTimeAvailableL(); |
|
1387 |
if ( iController.IsViewFinding() ) |
|
1388 |
{ |
|
1389 |
BroadcastEvent( ECamObserverEventNaviModelUpdated ); |
|
1390 |
} |
|
1391 |
} |
|
1392 |
} |
|
1393 |
else |
|
1394 |
{ |
|
1395 |
// exited from video mode |
|
1396 |
iVideoInitialised = EFalse; |
|
1397 |
} |
|
1398 |
break; |
|
1399 |
} |
|
1400 |
||
1401 |
// ----------------------------------------------------- |
|
1402 |
case ECamEventSaveComplete: |
|
1403 |
case ECamEventRecordComplete: |
|
1404 |
{ |
|
1405 |
if( ECamControllerVideo == iMode ) |
|
1406 |
{ |
|
1407 |
UpdateRecordTimeAvailableL(); |
|
1408 |
} |
|
1409 |
else |
|
1410 |
{ |
|
1411 |
switch( iImageMode ) |
|
1412 |
{ |
|
1413 |
case ECamImageCaptureBurst: |
|
1414 |
case ECamImageCaptureTimeLapse: |
|
1415 |
// Sequence: captured / remaining |
|
1416 |
UpdateSequenceImageCount(); |
|
1417 |
break; |
|
1418 |
default: |
|
1419 |
// Remaining images |
|
1420 |
UpdateCounter(); |
|
1421 |
break; |
|
1422 |
} |
|
1423 |
} |
|
1424 |
// no broadcast if in burst and all snapshots have not been received |
|
1425 |
if( !( iMode == ECamControllerImage && |
|
1426 |
iImageMode == ECamImageCaptureBurst && |
|
1427 |
!iController.AllSnapshotsReceived()) ) |
|
1428 |
{ |
|
1429 |
BroadcastEvent( ECamObserverEventNaviModelUpdated ); |
|
1430 |
} |
|
1431 |
break; |
|
1432 |
} |
|
1433 |
case ECamEventAudioMuteStateChanged: |
|
1434 |
{ |
|
1435 |
if ( appUi->IsDirectViewfinderActive() ) |
|
1436 |
{ |
|
1437 |
appUi->HandleCommandL( ECamCmdRedrawScreen ); |
|
1438 |
} |
|
1439 |
//Remaining Recording time is updated before drawing |
|
1440 |
//CreateNaviBitmapsL( ETrue ); |
|
1441 |
break; |
|
1442 |
} |
|
1443 |
// ----------------------------------------------------- |
|
1444 |
case ECamEventCounterUpdated: |
|
1445 |
{ |
|
1446 |
if( iController.SequenceCaptureInProgress() |
|
1447 |
&& ( ECamImageCaptureTimeLapse == iImageMode |
|
1448 |
|| ECamImageCaptureBurst == iImageMode ) ) |
|
1449 |
{ |
|
1450 |
// UpdateCounter; |
|
1451 |
iCounterNeedUpdate = ETrue; |
|
1452 |
UpdateSequenceImageCount(); |
|
1453 |
if ( ECamImageCaptureTimeLapse == iImageMode ) |
|
1454 |
{ |
|
1455 |
// Update remaining time till next capture |
|
1456 |
UpdateTimeLapseCountdownL(); |
|
1457 |
} |
|
1458 |
if( iController.AllSnapshotsReceived() ) |
|
1459 |
{ |
|
1460 |
PRINT( _L("CCamNaviCounterModel BroadcastEvent( ECamObserverEventNaviModelUpdated )" ) ) |
|
1461 |
BroadcastEvent( ECamObserverEventNaviModelUpdated ); |
|
1462 |
} |
|
1463 |
} |
|
1464 |
break; |
|
1465 |
} |
|
1466 |
// ----------------------------------------------------- |
|
1467 |
default: |
|
1468 |
{ |
|
1469 |
break; |
|
1470 |
} |
|
1471 |
// ----------------------------------------------------- |
|
1472 |
} |
|
1473 |
} |
|
1474 |
||
1475 |
// --------------------------------------------------------- |
|
1476 |
// CCamNaviCounterModel::ConstructNaviSelfTimerL |
|
1477 |
// Creating the member variables required for showing the |
|
1478 |
// self timer state in the navipane |
|
1479 |
// --------------------------------------------------------- |
|
1480 |
// |
|
1481 |
void CCamNaviCounterModel::ConstructNaviSelfTimerL( TPtrC& aResname ) |
|
1482 |
{ |
|
1483 |
CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() ); |
|
1484 |
||
1485 |
// Setup self timer icon. |
|
1486 |
// ...Create the icon |
|
1487 |
TSize size = iSelfTimerIconRect.Rect().Size(); |
|
1488 |
AknIconUtils::CreateIconL( iSelfTimerIcon, |
|
1489 |
iSelfTimerMask, |
|
1490 |
aResname, |
|
1491 |
EMbmCameraappQgn_indi_cam4_selftimer, |
|
1492 |
EMbmCameraappQgn_indi_cam4_selftimer_mask ); |
|
1493 |
AknIconUtils::SetSize( iSelfTimerIcon, size ); |
|
1494 |
||
1495 |
// ...Add self as an observer of the self timer. |
|
1496 |
CCamSelfTimer* selftimer = appUi->SelfTimer(); |
|
1497 |
if ( selftimer ) |
|
1498 |
{ |
|
1499 |
selftimer->AddObserverL( this ); |
|
1500 |
} |
|
1501 |
} |
|
1502 |
||
1503 |
// --------------------------------------------------------- |
|
1504 |
// CCamNaviCounterModel::DrawNaviSelfTimer |
|
1505 |
// Draw the self timer icon |
|
1506 |
// --------------------------------------------------------- |
|
1507 |
// |
|
1508 |
void |
|
1509 |
CCamNaviCounterModel::DrawNaviSelfTimer( CBitmapContext& aGc, |
|
1510 |
MAknsSkinInstance* /*aSkin*/ ) const |
|
1511 |
{ |
|
1512 |
// Draw self timer icons, if set to on. |
|
1513 |
if ( iDrawSelfTimer ) |
|
1514 |
{ |
|
67
756ad29ed18e
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
57
diff
changeset
|
1515 |
if ( CamUtility::IsNhdDevice() ) |
54 | 1516 |
{ |
1517 |
aGc.SetBrushColor( KRgbWhite ); |
|
1518 |
aGc.SetBrushStyle( CGraphicsContext::ENullBrush ); |
|
1519 |
iSelfTimerTextLayout.DrawText( aGc, iSelfTimerText, EFalse, KRgbBlack ); |
|
1520 |
||
1521 |
aGc.BitBltMasked( iSelfTimerIconRect.Rect().iTl, iSelfTimerIcon, |
|
1522 |
iSelfTimerIcon->SizeInPixels(), iSelfTimerMask, ETrue ); |
|
1523 |
} |
|
1524 |
else |
|
1525 |
{ |
|
1526 |
aGc.SetBrushColor( KRgbBlack ); |
|
1527 |
aGc.SetBrushStyle( CGraphicsContext::ENullBrush ); |
|
1528 |
iSelfTimerTextLayout.DrawText( aGc, iSelfTimerText, EFalse, KRgbWhite ); |
|
1529 |
||
1530 |
aGc.BitBltMasked( iSelfTimerIconRect.Rect().iTl, iSelfTimerIcon, |
|
1531 |
iSelfTimerIcon->SizeInPixels(), iSelfTimerMask, ETrue ); |
|
1532 |
} |
|
1533 |
} |
|
1534 |
} |
|
1535 |
||
1536 |
// --------------------------------------------------------- |
|
1537 |
// CCamNaviCounterModel::ConstructNaviSequenceL |
|
1538 |
// Creating the member variables required for showing the |
|
1539 |
// sequence capture state in the navipane |
|
1540 |
// --------------------------------------------------------- |
|
1541 |
// |
|
1542 |
void CCamNaviCounterModel::ConstructNaviSequenceL( TPtrC& aResname ) |
|
1543 |
{ |
|
1544 |
// Setup sequence icon. |
|
1545 |
// ...Create the icon |
|
1546 |
TSize size = iSequenceIconRect.Rect().Size(); |
|
1547 |
AknIconUtils::CreateIconL( iSequenceIcon, |
|
1548 |
iSequenceMask, |
|
1549 |
aResname, |
|
1550 |
EMbmCameraappQgn_indi_cam4_sequence_burst, |
|
1551 |
EMbmCameraappQgn_indi_cam4_sequence_burst_mask ); |
|
1552 |
AknIconUtils::SetSize( iSequenceIcon, size ); |
|
1553 |
||
1554 |
CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() ); |
|
1555 |
||
1556 |
// ...Add self as an observer of burst mode |
|
1557 |
appUi->AddBurstModeObserverL( this ); |
|
1558 |
} |
|
1559 |
||
1560 |
||
1561 |
// --------------------------------------------------------- |
|
1562 |
// CCamNaviCounterModel::DrawNaviSequence |
|
1563 |
// Draw the sequence capture icon |
|
1564 |
// --------------------------------------------------------- |
|
1565 |
// |
|
1566 |
void CCamNaviCounterModel::DrawNaviSequence( CBitmapContext& aGc ) const |
|
1567 |
{ |
|
1568 |
aGc.BitBltMasked( iSequenceIconRect.Rect().iTl, iSequenceIcon, |
|
1569 |
iSequenceIcon->SizeInPixels(), iSequenceMask, ETrue); |
|
1570 |
} |
|
1571 |
||
1572 |
#ifdef PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR |
|
1573 |
// --------------------------------------------------------- |
|
1574 |
// CCamNaviCounterModel::ConstructNaviGenericSetupL |
|
1575 |
// Creating the member variables required for showing the |
|
1576 |
// generic setup state in the navipane |
|
1577 |
// --------------------------------------------------------- |
|
1578 |
// |
|
1579 |
void CCamNaviCounterModel::ConstructNaviGenericSetupL( TPtrC& aResname ) |
|
1580 |
{ |
|
1581 |
// Setup generic setup icon. |
|
1582 |
// ...Create the icon |
|
1583 |
TSize size = iGenericIconRect.Rect().Size(); |
|
1584 |
AknIconUtils::CreateIconL( iGenericIcon, |
|
1585 |
iGenericMask, |
|
1586 |
aResname, |
|
1587 |
EMbmCameraappQgn_indi_lcam_generic, |
|
1588 |
EMbmCameraappQgn_indi_lcam_generic_mask ); |
|
1589 |
AknIconUtils::SetSize( iGenericIcon, size ); |
|
1590 |
} |
|
1591 |
||
1592 |
// --------------------------------------------------------- |
|
1593 |
// CCamNaviCounterModel::DrawNaviGenericSetup |
|
1594 |
// Draw the generic setup icon |
|
1595 |
// --------------------------------------------------------- |
|
1596 |
// |
|
1597 |
void CCamNaviCounterModel::DrawNaviGenericSetup( CBitmapContext& aGc ) const |
|
1598 |
{ |
|
1599 |
if ( ( iMode == ECamControllerVideo && !iController.VideoSceneDefaultsAreSet() ) || |
|
1600 |
( iMode != ECamControllerVideo && !iController.PhotoSceneDefaultsAreSet() ) ) |
|
1601 |
{ |
|
1602 |
aGc.BitBltMasked( iGenericIconRect.Rect().iTl, iGenericIcon, |
|
1603 |
iGenericIcon->SizeInPixels(), iGenericMask, ETrue); |
|
1604 |
} |
|
1605 |
} |
|
1606 |
#endif // PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR |
|
1607 |
||
1608 |
||
1609 |
||
1610 |
||
1611 |
// --------------------------------------------------------- |
|
1612 |
// CCamNaviCounterModel::ConstructNaviAudioMuteL |
|
1613 |
// Creating the member variables required for showing the |
|
1614 |
// audio mute state in the navipane |
|
1615 |
// --------------------------------------------------------- |
|
1616 |
// |
|
1617 |
void CCamNaviCounterModel::ConstructNaviAudioMuteL( TPtrC& aResname ) |
|
1618 |
{ |
|
1619 |
// Setup generic setup icon. |
|
1620 |
||
1621 |
// ...Create the icon |
|
1622 |
TSize size = iAudioMuteIconRect.Rect().Size(); |
|
1623 |
AknIconUtils::CreateIconL( iAudioMuteIcon, |
|
1624 |
iAudioMuteMask, |
|
1625 |
aResname, |
|
1626 |
EMbmCameraappQgn_indi_vid4_audio_mute, |
|
1627 |
EMbmCameraappQgn_indi_vid4_audio_mute_mask ); |
|
1628 |
AknIconUtils::SetSize( iAudioMuteIcon, size ); |
|
1629 |
} |
|
1630 |
||
1631 |
||
1632 |
// --------------------------------------------------------- |
|
1633 |
// CCamNaviCounterModel::DrawNaviAudioMute |
|
1634 |
// Draw the audio mute icon |
|
1635 |
// --------------------------------------------------------- |
|
1636 |
// |
|
1637 |
void CCamNaviCounterModel::DrawNaviAudioMute( CBitmapContext& aGc ) const |
|
1638 |
{ |
|
1639 |
TCamSettingsOnOff audio = static_cast< TCamSettingsOnOff > |
|
1640 |
( iController.IntegerSettingValue( ECamSettingItemVideoAudioRec ) ); |
|
1641 |
||
1642 |
// If the current mode is in video and the audio has been |
|
1643 |
// muted, display the audio mute indicator. |
|
1644 |
if ( ( ECamSettOff == audio ) && ( iMode == ECamControllerVideo ) ) |
|
1645 |
{ |
|
1646 |
// Draw icon |
|
1647 |
aGc.BitBltMasked( iAudioMuteIconRect.Rect().iTl, iAudioMuteIcon, |
|
1648 |
iAudioMuteIcon->SizeInPixels(), iAudioMuteMask, ETrue); |
|
1649 |
} |
|
1650 |
} |
|
1651 |
||
1652 |
||
1653 |
||
1654 |
||
1655 |
#ifdef PRODUCT_SUPPORTS_NAVIPANE_MODE_SUBTITLE |
|
1656 |
// --------------------------------------------------------- |
|
1657 |
// CCamNaviCounterModel::ConstructNaviModeSubtitleL |
|
1658 |
// Creating the member variables required for showing the |
|
1659 |
// current mode in the navipane |
|
1660 |
// --------------------------------------------------------- |
|
1661 |
// |
|
1662 |
void CCamNaviCounterModel::ConstructNaviModeSubtitleL( TPtrC& aResname ) |
|
1663 |
{ |
|
1664 |
// Setup generic setup icon. |
|
1665 |
||
1666 |
// ...Create the icon (photo icon) |
|
1667 |
TSize size = iSubtitlePhotoRect.Rect().Size(); |
|
1668 |
AknIconUtils::CreateIconL( iSubtitlePhotoIcon, |
|
1669 |
iSubtitlePhotoMask, |
|
1670 |
aResname, |
|
1671 |
EMbmCameraappQgn_indi_cam_photomode, |
|
1672 |
EMbmCameraappQgn_indi_cam_photomode_mask ); |
|
1673 |
AknIconUtils::SetSize( iSubtitlePhotoIcon, size ); |
|
1674 |
||
1675 |
// ...Create the icon (video icon) |
|
1676 |
size = iSubtitlePhotoRect.Rect().Size(); |
|
1677 |
AknIconUtils::CreateIconL( iSubtitleVideoIcon, |
|
1678 |
iSubtitleVideoMask, |
|
1679 |
aResname, |
|
1680 |
EMbmCameraappQgn_indi_cam_videomode, |
|
1681 |
EMbmCameraappQgn_indi_cam_videomode_mask ); |
|
1682 |
AknIconUtils::SetSize( iSubtitleVideoIcon, size ); |
|
1683 |
} |
|
1684 |
||
1685 |
// --------------------------------------------------------- |
|
1686 |
// CCamNaviCounterModel::DrawNaviModeSubtitle |
|
1687 |
// Draw the subtitle text and icon |
|
1688 |
// --------------------------------------------------------- |
|
1689 |
// |
|
1690 |
void CCamNaviCounterModel::DrawNaviModeSubtitle( CBitmapContext& aGc, MAknsSkinInstance* aSkin ) const |
|
1691 |
{ |
|
1692 |
CWindowGc& gc = SystemGc(); |
|
1693 |
// Set drawing colour |
|
1694 |
TRgb color = iSelfTimerTextLayout.Color(); |
|
1695 |
// ...Color is not updated if it not found from the skin |
|
1696 |
AknsUtils::GetCachedColor( aSkin, color, |
|
1697 |
KNaviPaneMajorColour, KNaviPaneMinorColour ); |
|
1698 |
||
1699 |
if ( iMode == ECamControllerVideo ) |
|
1700 |
{ |
|
1701 |
||
1702 |
iSubtitleVideoTextLayout.DrawText( gc, iSubtitleVideoText->Des(), ETrue, KRgbWhite ); |
|
1703 |
aGc.BitBltMasked( iSubtitleVideoRect.Rect().iTl, iSubtitleVideoIcon, |
|
1704 |
iSubtitleVideoIcon->SizeInPixels(), iSubtitleVideoMask, ETrue); |
|
1705 |
} |
|
1706 |
else |
|
1707 |
{ |
|
1708 |
||
1709 |
iSubtitlePhotoTextLayout.DrawText( gc, iSubtitlePhotoText->Des(), ETrue, KRgbWhite ); |
|
1710 |
aGc.BitBltMasked( iSubtitlePhotoRect.Rect().iTl, iSubtitlePhotoIcon, |
|
1711 |
iSubtitlePhotoIcon->SizeInPixels(), iSubtitlePhotoMask, ETrue); |
|
1712 |
} |
|
1713 |
} |
|
1714 |
#endif // PRODUCT_SUPPORTS_NAVIPANE_MODE_SUBTITLE |
|
1715 |
||
1716 |
||
1717 |
||
1718 |
// --------------------------------------------------------- |
|
1719 |
// CCamNaviCounterModel::SetExtentL |
|
1720 |
// Sets where the navicounter should be rendered |
|
1721 |
// --------------------------------------------------------- |
|
1722 |
// |
|
1723 |
void CCamNaviCounterModel::SetExtentL( TRect aExtent ) |
|
1724 |
{ |
|
1725 |
if ( aExtent != iExtent ) |
|
1726 |
{ |
|
1727 |
iExtent = aExtent; |
|
1728 |
} |
|
1729 |
} |
|
1730 |
||
1731 |
// --------------------------------------------------------- |
|
1732 |
// CCamNaviCounterModel::RegisterObserverL |
|
1733 |
// Registers an observer |
|
1734 |
// --------------------------------------------------------- |
|
1735 |
// |
|
1736 |
void CCamNaviCounterModel::RegisterObserverL(MCamObserver* aObserver) |
|
1737 |
{ |
|
1738 |
iObserverHandler->RegisterObserverL(aObserver); |
|
1739 |
} |
|
1740 |
||
1741 |
// --------------------------------------------------------- |
|
1742 |
// CCamNaviCounterModel::DeregisterObserver |
|
1743 |
// Deregisters an observer |
|
1744 |
// --------------------------------------------------------- |
|
1745 |
// |
|
1746 |
void CCamNaviCounterModel::DeregisterObserver(MCamObserver* aObserver) |
|
1747 |
{ |
|
1748 |
iObserverHandler->DeregisterObserver(aObserver); |
|
1749 |
} |
|
1750 |
||
1751 |
// --------------------------------------------------------- |
|
1752 |
// CCamNaviCounterModel::BroadcastEvent |
|
1753 |
// Broadcasts an event code to all observers |
|
1754 |
// --------------------------------------------------------- |
|
1755 |
// |
|
1756 |
void CCamNaviCounterModel::BroadcastEvent(TCamObserverEvent aEvent) |
|
1757 |
{ |
|
1758 |
iObserverHandler->BroadcastEvent(aEvent); |
|
1759 |
} |
|
1760 |
||
1761 |
// --------------------------------------------------------------------------- |
|
1762 |
// CCamNaviCounterModel::CreateNaviBitmapsL |
|
1763 |
// Set up the memory icon and counter in the navipane |
|
1764 |
// --------------------------------------------------------------------------- |
|
1765 |
// |
|
1766 |
void CCamNaviCounterModel::CreateNaviBitmapsL( const TBool aDrawIcons ) |
|
1767 |
{ |
|
1768 |
PRINT( _L("Camera => CCamNaviCounterModel::CreateNaviBitmapsL") ); |
|
1769 |
CCamAppUi* camAppUi = ( CCamAppUi* )iAvkonAppUiBase; |
|
1770 |
if ( camAppUi && camAppUi->SettingsLaunchedFromCamera() ) |
|
1771 |
{ |
|
1772 |
CEikStatusPane* sp = camAppUi->StatusPane(); |
|
1773 |
||
1774 |
TUid npUid ; |
|
1775 |
npUid.iUid = EEikStatusPaneUidNavi; |
|
1776 |
CAknNavigationControlContainer* naviPane = |
|
1777 |
( CAknNavigationControlContainer* )sp->ControlL( npUid ); |
|
1778 |
||
1779 |
// dispose of old decorator and bitmaps |
|
1780 |
if( iNaviDec ) |
|
1781 |
{ |
|
1782 |
// do we need to pop it off the navi pane stack first? |
|
1783 |
delete iNaviDec; |
|
1784 |
iNaviDec = NULL; |
|
1785 |
iNaviBitmap = NULL; |
|
1786 |
iNaviBitmapMask = NULL; |
|
1787 |
} |
|
1788 |
||
1789 |
if( iNaviBitmap ) |
|
1790 |
{ |
|
1791 |
delete iNaviBitmap; |
|
1792 |
iNaviBitmap = NULL; |
|
1793 |
} |
|
1794 |
||
1795 |
iNaviBitmap = new ( ELeave ) CFbsBitmap(); |
|
1796 |
User::LeaveIfError( iNaviBitmap->Create( TSize(250,20), EColor64K ) ); |
|
1797 |
CFbsBitmapDevice* bmpDevice = NULL; |
|
1798 |
bmpDevice = CFbsBitmapDevice::NewL( iNaviBitmap ); |
|
1799 |
CleanupStack::PushL( bmpDevice ); |
|
1800 |
CFbsBitGc* bmpGc = NULL; |
|
1801 |
User::LeaveIfError( bmpDevice->CreateContext( bmpGc ) ); |
|
1802 |
CleanupStack::PushL( bmpGc ); |
|
1803 |
||
1804 |
if( iNaviBitmapMask ) |
|
1805 |
{ |
|
1806 |
delete iNaviBitmapMask; |
|
1807 |
iNaviBitmapMask = NULL; |
|
1808 |
} |
|
1809 |
iNaviBitmapMask = new ( ELeave ) CFbsBitmap(); |
|
1810 |
User::LeaveIfError( iNaviBitmapMask->Create( TSize(250,20), EColor64K ) ); |
|
1811 |
CFbsBitmapDevice* bmpMaskDevice = NULL; |
|
1812 |
bmpMaskDevice = CFbsBitmapDevice::NewL( iNaviBitmapMask ); |
|
1813 |
CleanupStack::PushL( bmpMaskDevice ); |
|
1814 |
CFbsBitGc* bmpMaskGc = NULL; |
|
1815 |
User::LeaveIfError( bmpMaskDevice->CreateContext( bmpMaskGc ) ); |
|
1816 |
CleanupStack::PushL( bmpMaskGc ); |
|
1817 |
||
1818 |
if ( aDrawIcons ) |
|
1819 |
{ |
|
1820 |
if ( iMode == ECamControllerVideo ) |
|
1821 |
{ |
|
1822 |
UpdateRecordTimeAvailableL(); |
|
1823 |
} |
|
1824 |
DrawCounterToBitmaps( *bmpGc, *bmpMaskGc ); |
|
1825 |
} |
|
1826 |
// Create the new decorator and push on to navi stack |
|
1827 |
iNaviDec = naviPane->CreateNavigationImageL( iNaviBitmap, |
|
1828 |
iNaviBitmapMask ); |
|
1829 |
CleanupStack::PopAndDestroy( bmpMaskGc ); |
|
1830 |
CleanupStack::PopAndDestroy( bmpMaskDevice ); |
|
1831 |
CleanupStack::PopAndDestroy( bmpGc ); |
|
1832 |
CleanupStack::PopAndDestroy( bmpDevice ); |
|
1833 |
naviPane->PushL( *iNaviDec ); |
|
1834 |
} |
|
1835 |
PRINT( _L("Camera <= CCamNaviCounterModel::CreateNaviBitmapsL") ); |
|
1836 |
} |
|
1837 |
||
1838 |
// --------------------------------------------------------------------------- |
|
1839 |
// CCamNaviCounterModel::NonTouchLayoutL |
|
1840 |
// --------------------------------------------------------------------------- |
|
1841 |
void CCamNaviCounterModel::NonTouchLayoutL() |
|
1842 |
{ |
|
1843 |
TInt variant = 0; |
|
1844 |
||
1845 |
TInt cba = AknLayoutUtils::CbaLocation() == |
|
1846 |
AknLayoutUtils::EAknCbaLocationLeft? |
|
1847 |
AknLayoutUtils::EAknCbaLocationLeft : 0; |
|
1848 |
||
1849 |
TAknLayoutRect camIndicatorPane; |
|
1850 |
camIndicatorPane.LayoutRect( iExtent, |
|
1851 |
AknLayoutScalable_Apps::cam6_indi_pane( variant )); |
|
1852 |
||
1853 |
iImgStorageIconRect.LayoutRect( camIndicatorPane.Rect(), |
|
1854 |
AknLayoutScalable_Apps::cam6_indi_pane_g2( cba ) ); |
|
1855 |
||
1856 |
iPhotoTextItem->SetLayoutL( camIndicatorPane.Rect(), |
|
1857 |
AknLayoutScalable_Apps::cam6_indi_pane_t1( cba ) ); |
|
1858 |
||
1859 |
TAknLayoutRect vidIndicatorPane; |
|
1860 |
vidIndicatorPane.LayoutRect( iExtent, |
|
1861 |
AknLayoutScalable_Apps::vid6_indi_pane( cba ) ); |
|
1862 |
||
1863 |
iVidPreStorageIconRect.LayoutRect( vidIndicatorPane.Rect(), |
|
1864 |
AknLayoutScalable_Apps::vid6_indi_pane_g3( cba ) ); |
|
1865 |
||
1866 |
iVideoTextLayout.LayoutText( vidIndicatorPane.Rect(), |
|
1867 |
AknLayoutScalable_Apps::vid6_indi_pane_t1( cba ) ); |
|
1868 |
||
1869 |
iVideoTextItem->SetLayoutL( vidIndicatorPane.Rect(), |
|
1870 |
AknLayoutScalable_Apps::vid6_indi_pane_t1( cba ) ); |
|
1871 |
||
1872 |
TAknLayoutRect vidProgressPane; |
|
1873 |
vidProgressPane.LayoutRect( iExtent, |
|
1874 |
AknLayoutScalable_Apps::vid6_indi_pane( cba ) ); |
|
1875 |
||
1876 |
iSequenceImageTextItem->SetLayoutL( |
|
1877 |
vidProgressPane.Rect(), |
|
1878 |
AknLayoutScalable_Apps::vid6_indi_pane_t4( 2 ) ); |
|
1879 |
||
1880 |
iTimeLapseCountdownTextItem->SetLayoutL( |
|
1881 |
vidProgressPane.Rect(), |
|
1882 |
AknLayoutScalable_Apps::vid6_indi_pane_t4( 2 ) ); |
|
1883 |
||
1884 |
iSequenceCapturedTextItem->SetLayoutL( |
|
1885 |
vidProgressPane.Rect(), |
|
1886 |
AknLayoutScalable_Apps::vid6_indi_pane_t4( 2 ) ); |
|
1887 |
||
1888 |
||
1889 |
// ...Load layout rect for self timer image. |
|
1890 |
TAknLayoutRect timerParent; |
|
1891 |
timerParent.LayoutRect( iExtent, |
|
1892 |
AknLayoutScalable_Apps::cam6_timer_pane( cba ) ); |
|
1893 |
iSelfTimerIconRect.LayoutRect( timerParent.Rect(), |
|
1894 |
AknLayoutScalable_Apps::cam6_timer_pane_g1( cba ) ); |
|
1895 |
iSelfTimerTextLayout.LayoutText( timerParent.Rect(), |
|
1896 |
AknLayoutScalable_Apps::cam6_timer_pane_t1( cba ) ); |
|
1897 |
||
1898 |
iVideoSizeLayout.LayoutText( vidProgressPane.Rect(), |
|
1899 |
AknLayoutScalable_Apps::vid6_indi_pane_t4( 2 ) ); // Magic: layout Opt2 |
|
1900 |
iPhotoSizeLayout = iVideoSizeLayout; |
|
1901 |
||
1902 |
// ...Load layout rect for sequence image. |
|
1903 |
iSequenceIconRect.LayoutRect( iExtent, |
|
1904 |
AknLayoutScalable_Apps::cam6_mode_pane_g2( cba ) ); |
|
1905 |
||
1906 |
iAudioMuteIconRect.LayoutRect( iExtent, |
|
1907 |
AknLayoutScalable_Apps::cam6_mode_pane_g2( cba ) ); |
|
1908 |
||
1909 |
} |
|
1910 |
||
1911 |
// --------------------------------------------------------------------------- |
|
1912 |
// CCamNaviCounterModel::NonTouchLayoutSecondaryL |
|
1913 |
// --------------------------------------------------------------------------- |
|
1914 |
void CCamNaviCounterModel::NonTouchLayoutSecondaryL() |
|
1915 |
{ |
|
1916 |
// Magic numbers used for layout variation |
|
1917 |
TAknLayoutRect camIndicatorPane; |
|
1918 |
camIndicatorPane.LayoutRect( iExtent, |
|
1919 |
AknLayoutScalable_Apps::cam6_indi_pane( 3 )); |
|
1920 |
||
1921 |
iImgStorageIconRect.LayoutRect( camIndicatorPane.Rect(), |
|
1922 |
AknLayoutScalable_Apps::cam6_indi_pane_g2( 2 ) ); |
|
1923 |
||
1924 |
iPhotoTextItem->SetLayoutL( camIndicatorPane.Rect(), |
|
1925 |
AknLayoutScalable_Apps::cam6_indi_pane_t1( 4 ) ); |
|
1926 |
||
1927 |
TAknLayoutRect vidIndicatorPane; |
|
1928 |
vidIndicatorPane.LayoutRect( iExtent, |
|
1929 |
AknLayoutScalable_Apps::vid6_indi_pane( 3 ) ); |
|
1930 |
||
1931 |
iVidPreStorageIconRect.LayoutRect( vidIndicatorPane.Rect(), |
|
1932 |
AknLayoutScalable_Apps::vid6_indi_pane_g3( 2 ) ); |
|
1933 |
||
1934 |
iVideoTextLayout.LayoutText( vidIndicatorPane.Rect(), |
|
1935 |
AknLayoutScalable_Apps::vid6_indi_pane_t1( 1 ) ); |
|
1936 |
||
1937 |
iVideoTextItem->SetLayoutL( vidIndicatorPane.Rect(), |
|
1938 |
AknLayoutScalable_Apps::vid6_indi_pane_t1( 1 ) ); |
|
1939 |
||
1940 |
iVideoSizeLayout.LayoutText( vidIndicatorPane.Rect(), |
|
1941 |
AknLayoutScalable_Apps::vid6_indi_pane_t1( 1 ) ); |
|
1942 |
iPhotoSizeLayout = iVideoSizeLayout; |
|
1943 |
||
1944 |
iAudioMuteIconRect.LayoutRect( iExtent, |
|
1945 |
AknLayoutScalable_Apps::cam6_mode_pane_g1( 0 ) ); |
|
1946 |
||
1947 |
} |
|
1948 |
||
1949 |
// --------------------------------------------------------------------------- |
|
1950 |
// CCamNaviCounterModel::TouchLayoutL |
|
1951 |
// --------------------------------------------------------------------------- |
|
1952 |
void CCamNaviCounterModel::TouchLayoutL() |
|
1953 |
{ |
|
1954 |
TInt variant = 0; // portrait |
|
1955 |
TInt indicatorVariant = 1; |
|
1956 |
if ( Layout_Meta_Data::IsLandscapeOrientation() ) |
|
1957 |
{ |
|
1958 |
// Landscape layout variant |
|
1959 |
variant = 1; // landscape |
|
1960 |
indicatorVariant = 0; |
|
1961 |
} |
|
1962 |
TInt secCamera = ECamActiveCameraSecondary == iController.ActiveCamera(); |
|
1963 |
||
1964 |
TAknLayoutRect camIndicatorPane; |
|
1965 |
camIndicatorPane.LayoutRect( iExtent, |
|
1966 |
AknLayoutScalable_Apps::cam4_indicators_pane( variant ) ); |
|
1967 |
||
1968 |
iImgStorageIconRect.LayoutRect( camIndicatorPane.Rect(), |
|
1969 |
AknLayoutScalable_Apps::cam4_indicators_pane_g2( indicatorVariant ) ); |
|
1970 |
||
1971 |
iPhotoTextItem->SetLayoutL( camIndicatorPane.Rect(), |
|
1972 |
AknLayoutScalable_Apps::cam4_indicators_pane_t1( secCamera ) ); |
|
1973 |
||
1974 |
TAknLayoutRect vidIndicatorPane; |
|
1975 |
vidIndicatorPane.LayoutRect( iExtent, |
|
1976 |
AknLayoutScalable_Apps::vid4_progress_pane( variant ) );// vid4_indicators_pane should be used |
|
1977 |
||
1978 |
iVidPreStorageIconRect.LayoutRect( vidIndicatorPane.Rect(), |
|
1979 |
AknLayoutScalable_Apps::vid4_indicators_pane_g3( indicatorVariant ) ); |
|
1980 |
||
1981 |
#ifdef PRODUCT_SUPPORTS_POST_CAPTURE_INDICATORS |
|
1982 |
iVideoFileTypeIconRect.LayoutRect( vidIndicatorPane.Rect(), |
|
1983 |
AknLayoutScalable_Apps::vid4_indicators_pane_g2( indicatorVariant ) ); |
|
1984 |
#endif |
|
1985 |
||
1986 |
iVideoTextLayout.LayoutText( vidIndicatorPane.Rect(), |
|
1987 |
AknLayoutScalable_Apps::vid4_indicators_pane_t1( indicatorVariant ) ); |
|
1988 |
||
1989 |
iVideoTextItem->SetLayoutL( vidIndicatorPane.Rect(), |
|
1990 |
AknLayoutScalable_Apps::vid4_indicators_pane_t1( indicatorVariant ) ); |
|
1991 |
||
1992 |
||
1993 |
TAknLayoutRect vidProgressPane; |
|
1994 |
vidProgressPane.LayoutRect( |
|
1995 |
iExtent, |
|
1996 |
AknLayoutScalable_Apps::vid4_progress_pane( variant ) ); |
|
1997 |
||
1998 |
iSequenceImageTextItem->SetLayoutL( |
|
1999 |
vidProgressPane.Rect(), |
|
2000 |
AknLayoutScalable_Apps::vid4_progress_pane_t3() ); |
|
2001 |
||
2002 |
iTimeLapseCountdownTextItem->SetLayoutL( |
|
2003 |
vidProgressPane.Rect(), |
|
2004 |
AknLayoutScalable_Apps::vid4_progress_pane_t3() ); |
|
2005 |
||
2006 |
iSequenceCapturedTextItem->SetLayoutL( |
|
2007 |
vidProgressPane.Rect(), |
|
2008 |
AknLayoutScalable_Apps::vid4_progress_pane_t3() ); |
|
2009 |
||
2010 |
||
2011 |
// ...Load layout rect for self timer image. |
|
2012 |
iSelfTimerIconRect.LayoutRect( iExtent, |
|
2013 |
AknLayoutScalable_Apps::main_camera4_pane_g5( variant ) ); |
|
2014 |
iSelfTimerTextLayout.LayoutText( iExtent, |
|
2015 |
AknLayoutScalable_Apps::main_camera4_pane_t1( variant ) ); |
|
2016 |
||
2017 |
#ifdef PRODUCT_SUPPORTS_NAVIPANE_MODE_SUBTITLE |
|
2018 |
if ( !AknLayoutUtils::LayoutMirrored() ) |
|
2019 |
{ |
|
2020 |
iSubtitlePhotoTextLayout.LayoutText( iExtent, |
|
2021 |
ROID(R_CAM_SUBTITLE_PHOTOMODE_TEXT_LAYOUT_ID)); |
|
2022 |
iSubtitleVideoTextLayout.LayoutText( iExtent, |
|
2023 |
ROID(R_CAM_SUBTITLE_VIDEOMODE_TEXT_LAYOUT_ID)); |
|
2024 |
iSubtitlePhotoRect.LayoutRect( iExtent, |
|
2025 |
ROID(R_CAM_SUBTITLE_PHOTOMODE_ICON_RECT_ID)); |
|
2026 |
iSubtitleVideoRect.LayoutRect( iExtent, |
|
2027 |
ROID(R_CAM_SUBTITLE_VIDEOMODE_ICON_RECT_ID)); |
|
2028 |
} |
|
2029 |
else |
|
2030 |
{ |
|
2031 |
iSubtitlePhotoTextLayout.LayoutText( iExtent, |
|
2032 |
ROID(R_CAM_SUBTITLE_PHOTOMODE_TEXT_LAYOUT_AH_ID)); |
|
2033 |
iSubtitleVideoTextLayout.LayoutText( iExtent, |
|
2034 |
ROID(R_CAM_SUBTITLE_VIDEOMODE_TEXT_LAYOUT_AH_ID)); |
|
2035 |
iSubtitlePhotoRect.LayoutRect( iExtent, |
|
2036 |
ROID(R_CAM_SUBTITLE_PHOTOMODE_ICON_RECT_AH_ID)); |
|
2037 |
iSubtitleVideoRect.LayoutRect( iExtent, |
|
2038 |
ROID(R_CAM_SUBTITLE_VIDEOMODE_ICON_RECT_AH_ID)); |
|
2039 |
} |
|
2040 |
||
2041 |
// ...Read the strings from the resource |
|
2042 |
iSubtitleVideoText = iCoeEnv->AllocReadResourceAsDes16L( |
|
2043 |
ROID(R_CAM_STILL_PRE_CAPTURE_SUBTITLE_TEXT_VIDEO_ID)); |
|
2044 |
iSubtitlePhotoText = iCoeEnv->AllocReadResourceAsDes16L( |
|
2045 |
ROID(R_CAM_STILL_PRE_CAPTURE_SUBTITLE_TEXT_PHOTO_ID)); |
|
2046 |
#endif // PRODUCT_SUPPORTS_NAVIPANE_MODE_SUBTITLE |
|
2047 |
||
2048 |
#ifdef PRODUCT_SUPPORTS_NAVIPANE_FILENAME |
|
2049 |
if ( !AknLayoutUtils::LayoutMirrored() ) |
|
2050 |
{ |
|
2051 |
iPhotoNameLayout.LayoutText( iExtent, |
|
2052 |
ROID(R_CAM_POST_CAPTURE_IMAGE_NAME_LAYOUT_ID)); |
|
2053 |
iVideoNameLayout.LayoutText( iExtent, |
|
2054 |
ROID(R_CAM_POST_CAPTURE_VIDEO_NAME_LAYOUT_ID)); |
|
2055 |
} |
|
2056 |
else |
|
2057 |
{ |
|
2058 |
iPhotoNameLayout.LayoutText( iExtent, |
|
2059 |
ROID(R_CAM_POST_CAPTURE_IMAGE_NAME_LAYOUT_AH_ID)); |
|
2060 |
iVideoNameLayout.LayoutText( iExtent, |
|
2061 |
ROID(R_CAM_POST_CAPTURE_VIDEO_NAME_LAYOUT_AH_ID)); |
|
2062 |
} |
|
2063 |
||
2064 |
#endif // PRODUCT_SUPPORTS_NAVIPANE_FILENAME |
|
2065 |
||
2066 |
||
2067 |
iVideoSizeLayout.LayoutText( vidProgressPane.Rect(), |
|
2068 |
AknLayoutScalable_Apps::vid4_progress_pane_t3( indicatorVariant )); |
|
2069 |
||
2070 |
if ( !AknLayoutUtils::LayoutMirrored() ) |
|
2071 |
{ |
|
2072 |
iPhotoSizeLayout.LayoutText( iExtent, |
|
2073 |
ROID(R_CAM_POST_CAPTURE_IMAGE_SIZE_LAYOUT_ID)); |
|
2074 |
} |
|
2075 |
else |
|
2076 |
{ |
|
2077 |
iPhotoSizeLayout.LayoutText( iExtent, |
|
2078 |
ROID(R_CAM_POST_CAPTURE_IMAGE_SIZE_LAYOUT_AH_ID)); |
|
2079 |
} |
|
2080 |
||
2081 |
// ...Load layout rect for sequence image. |
|
2082 |
iSequenceIconRect.LayoutRect( iExtent, |
|
2083 |
AknLayoutScalable_Apps::main_camera4_pane_g2( variant ) ); |
|
2084 |
||
2085 |
#ifdef PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR |
|
2086 |
if ( !AknLayoutUtils::LayoutMirrored() ) |
|
2087 |
{ |
|
2088 |
iGenericIconRect.LayoutRect( iExtent, |
|
2089 |
ROID(R_CAM_GENERIC_SETUP_ICON_RECT_ID)); |
|
2090 |
} |
|
2091 |
else |
|
2092 |
{ |
|
2093 |
iGenericIconRect.LayoutRect( iExtent, |
|
2094 |
ROID(R_CAM_GENERIC_SETUP_ICON_RECT_AH_ID)); |
|
2095 |
} |
|
2096 |
#endif // PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR |
|
2097 |
||
2098 |
||
2099 |
CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() ); |
|
2100 |
if ( appUi->IsSecondCameraEnabled() && !appUi->IsQwerty2ndCamera() ) |
|
2101 |
{ |
|
2102 |
TRect mainPaneRect; |
|
2103 |
AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, |
|
2104 |
mainPaneRect ); |
|
2105 |
iAudioMuteIconRect.LayoutRect( |
|
2106 |
mainPaneRect, |
|
2107 |
AknLayoutScalable_Apps::main_video4_pane_g2( variant ) ); |
|
2108 |
} |
|
2109 |
else |
|
2110 |
{ |
|
2111 |
iAudioMuteIconRect.LayoutRect( |
|
2112 |
iExtent, |
|
2113 |
AknLayoutScalable_Apps::main_video4_pane_g2( variant ) ); |
|
2114 |
} |
|
2115 |
} |
|
2116 |
||
2117 |
// End of File |