39 |
39 |
40 // CONSTANTS |
40 // CONSTANTS |
41 const TInt KInfoTooltipDelay = 0; // time (milliseconds) delay when showing the tooltip |
41 const TInt KInfoTooltipDelay = 0; // time (milliseconds) delay when showing the tooltip |
42 const TInt KInfoTooltipDisplayTime = 5000; // maximum time (milliseconds) the tooltip is displayed |
42 const TInt KInfoTooltipDisplayTime = 5000; // maximum time (milliseconds) the tooltip is displayed |
43 const TInt KExplTxtGranularity = 6; |
43 const TInt KExplTxtGranularity = 6; |
|
44 const TUint32 KToolbarExtensionBgColor = 0x00000000; |
|
45 const TInt KToolBarExtensionBgAlpha = 0x7F; |
44 |
46 |
45 // ================= MEMBER FUNCTIONS ======================= |
47 // ================= MEMBER FUNCTIONS ======================= |
46 |
48 |
47 // --------------------------------------------------------------------------- |
49 // --------------------------------------------------------------------------- |
48 // CCamInfoListBoxContainer::NewL |
50 // CCamInfoListBoxContainer::NewL |
53 CAknView& aView, |
55 CAknView& aView, |
54 CCamAppController& aController, |
56 CCamAppController& aController, |
55 TInt aListBoxResource, |
57 TInt aListBoxResource, |
56 TInt aSummaryResource, |
58 TInt aSummaryResource, |
57 TInt aSettingValue, |
59 TInt aSettingValue, |
58 TInt aTitleResource ) |
60 TInt aTitleResource, |
|
61 TBool aSkinnedBackGround ) |
59 { |
62 { |
60 CCamInfoListBoxContainer* self = |
63 CCamInfoListBoxContainer* self = |
61 new( ELeave ) CCamInfoListBoxContainer( aController, |
64 new( ELeave ) CCamInfoListBoxContainer( aController, |
62 aView, |
65 aView, |
63 aSettingValue ); |
66 aSettingValue, |
|
67 aSkinnedBackGround ); |
64 CleanupStack::PushL( self ); |
68 CleanupStack::PushL( self ); |
65 self->ConstructL( aRect, aListBoxResource, aSummaryResource, aTitleResource); |
69 self->ConstructL( aRect, aListBoxResource, aSummaryResource, aTitleResource); |
66 CleanupStack::Pop( self ); |
70 CleanupStack::Pop( self ); |
67 return self; |
71 return self; |
68 } |
72 } |
140 // might not include statuspane area. calculating area self will |
144 // might not include statuspane area. calculating area self will |
141 // go around the problem |
145 // go around the problem |
142 |
146 |
143 // Construct the listbox |
147 // Construct the listbox |
144 iListBox = new( ELeave ) CCamInfoListBox( this, iController ); |
148 iListBox = new( ELeave ) CCamInfoListBox( this, iController ); |
145 iListBox->ConstructL( iController, this, iTitleArray, iDescArray, aListBoxResource ); |
149 iListBox->ConstructL( iController, this, iTitleArray, iDescArray, aListBoxResource, |
|
150 iSkinnedBackGround ); |
146 iListBox->DisableSingleClick( ETrue ); |
151 iListBox->DisableSingleClick( ETrue ); |
147 |
152 |
148 // Highlight the currently active setting value |
153 // Highlight the currently active setting value |
149 iListBox->InitializeL( iSettingValue ); |
154 iListBox->InitializeL( iSettingValue ); |
150 |
155 |
250 // C++ constructor |
255 // C++ constructor |
251 // --------------------------------------------------------------------------- |
256 // --------------------------------------------------------------------------- |
252 // |
257 // |
253 CCamInfoListBoxContainer::CCamInfoListBoxContainer( CCamAppController& aController, |
258 CCamInfoListBoxContainer::CCamInfoListBoxContainer( CCamAppController& aController, |
254 CAknView& aView, |
259 CAknView& aView, |
255 TInt aSettingValue ) |
260 TInt aSettingValue, |
|
261 TBool aSkinnedBackGround ) |
256 : CCamContainerBase( aController, aView ), iSettingValue( aSettingValue ), |
262 : CCamContainerBase( aController, aView ), iSettingValue( aSettingValue ), |
257 iTooltipController(NULL), |
263 iTooltipController(NULL), |
258 iShowTooltip(EFalse), |
264 iShowTooltip(EFalse), |
259 iTooltipIndex(-1), |
265 iTooltipIndex(-1), |
260 iActivateOnTouchRelease(EFalse) |
266 iActivateOnTouchRelease(EFalse), |
|
267 iSkinnedBackGround(aSkinnedBackGround) |
261 |
268 |
262 { |
269 { |
263 } |
270 } |
264 |
271 |
265 |
272 |
327 PRINT(_L("Camera => CCamInfoListBoxContainer::Draw") ) |
334 PRINT(_L("Camera => CCamInfoListBoxContainer::Draw") ) |
328 |
335 |
329 CWindowGc& gc = SystemGc(); |
336 CWindowGc& gc = SystemGc(); |
330 if ( CamUtility::IsNhdDevice() ) |
337 if ( CamUtility::IsNhdDevice() ) |
331 { |
338 { |
|
339 TRgb color; |
|
340 if( iSkinnedBackGround ) |
|
341 { |
332 MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
342 MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
333 AknsDrawUtils::Background( skin, iBgContext, gc, aRect ); |
343 AknsDrawUtils::Background( skin, iBgContext, gc, aRect ); |
334 // draw the title text |
344 // draw the title text |
335 TRgb color; |
|
336 AknsUtils::GetCachedColor( skin, color, KAknsIIDQsnTextColors, |
345 AknsUtils::GetCachedColor( skin, color, KAknsIIDQsnTextColors, |
337 EAknsCIQsnTextColorsCG6 ); |
346 EAknsCIQsnTextColorsCG6 ); |
|
347 } |
|
348 else |
|
349 { |
|
350 // Fill control with transparency bg colour |
|
351 gc.SetPenStyle( CGraphicsContext::ENullPen ); |
|
352 gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha ); |
|
353 color = TRgb( 0,0 ); |
|
354 gc.SetBrushColor( color ); |
|
355 gc.SetBrushStyle( CGraphicsContext::ESolidBrush ); |
|
356 gc.DrawRect( aRect ); |
|
357 gc.SetBrushColor( color ); |
|
358 gc.DrawRect( iTitleTextRectLayout.TextRect() ); |
|
359 // Reset the brush after use (otherwise anything drawn |
|
360 // after the viewfinder will also show viewfinder frames) |
|
361 |
|
362 gc.SetBrushColor( TRgb( KToolbarExtensionBgColor, KToolBarExtensionBgAlpha ) ); |
|
363 gc.SetBrushStyle( CGraphicsContext::ESolidBrush ); |
|
364 gc.DrawRect( TRect( iLayoutAreaRect.iTl.iX, |
|
365 iLayoutAreaRect.iTl.iY, |
|
366 iLayoutAreaRect.iBr.iX, |
|
367 iTitleTextRectLayout.TextRect().iBr.iY ) ); |
|
368 |
|
369 gc.SetBrushStyle( CGraphicsContext::ENullBrush ); |
|
370 |
|
371 |
|
372 CCamAppUi* appUi = static_cast<CCamAppUi*>( iEikonEnv->AppUi() ); |
|
373 appUi->StatusPane()->MakeVisible( EFalse ); |
|
374 |
|
375 color = TRgb( KRgbWhite ); |
|
376 } |
338 iTitleTextRectLayout.DrawText( gc, *iListboxTitle, ETrue, color ); |
377 iTitleTextRectLayout.DrawText( gc, *iListboxTitle, ETrue, color ); |
339 } |
378 } |
340 else |
379 else |
341 { |
380 { |
342 TRAP_IGNORE( DrawSummaryTextL( gc ) ); |
381 TRAP_IGNORE( DrawSummaryTextL( gc ) ); |
428 RDebug::Print(_L("CCamInfoListBoxContainer::HandlePointerEventL iType=%d iPosition=(%d, %d)"), |
467 RDebug::Print(_L("CCamInfoListBoxContainer::HandlePointerEventL iType=%d iPosition=(%d, %d)"), |
429 aPointerEvent.iType, |
468 aPointerEvent.iType, |
430 aPointerEvent.iPosition.iX, |
469 aPointerEvent.iPosition.iX, |
431 aPointerEvent.iPosition.iY ); |
470 aPointerEvent.iPosition.iY ); |
432 iListBox->HandlePointerEventL(aPointerEvent); |
471 iListBox->HandlePointerEventL(aPointerEvent); |
|
472 if( !iController.IsViewFinding() && !iSkinnedBackGround ) |
|
473 { |
|
474 ReserveAndStartVF(); |
|
475 } |
433 /*TInt oldListItemIndex = -1; |
476 /*TInt oldListItemIndex = -1; |
434 TInt newListItemIndex = -1; |
477 TInt newListItemIndex = -1; |
435 TBool handleItemActivation = EFalse; |
478 TBool handleItemActivation = EFalse; |
436 |
479 |
437 if ( iListBox ) |
480 if ( iListBox ) |
663 { |
706 { |
664 iListboxLayoutRect.LayoutRect( wholeListboxLayoutRect.Rect(), |
707 iListboxLayoutRect.LayoutRect( wholeListboxLayoutRect.Rect(), |
665 AknLayoutScalable_Apps::main_cset_list_pane( 1 ) ); |
708 AknLayoutScalable_Apps::main_cset_list_pane( 1 ) ); |
666 } |
709 } |
667 |
710 |
|
711 if( !iSkinnedBackGround ) |
|
712 { |
|
713 iTitleTextRectLayout.LayoutText( iLayoutAreaRect, AknLayoutScalable_Apps::main_cset_text_pane_t1( 0 ) ); |
|
714 } |
|
715 else |
|
716 { |
668 iTitleTextRectLayout.LayoutText( iLayoutAreaRect, |
717 iTitleTextRectLayout.LayoutText( iLayoutAreaRect, |
669 AknLayoutScalable_Apps::main_cam_set_pane_t1( 3 ) ); |
718 AknLayoutScalable_Apps::main_cam_set_pane_t1( 3 ) ); |
|
719 } |
670 |
720 |
671 return wholeListboxLayoutRect.Rect(); |
721 return wholeListboxLayoutRect.Rect(); |
672 } |
722 } |
673 |
723 |
674 // -------------------------------------------------------------------------- |
724 // -------------------------------------------------------------------------- |