camerauis/cameraapp/generic/src/CamCaptureSetupSlider.cpp
branchRCL_3
changeset 12 8c55c525d5d7
parent 1 f5ec9446e5bf
child 16 d486e5e3cc9a
equal deleted inserted replaced
11:792dfc98fb3b 12:8c55c525d5d7
    61 const TInt KEV0Ind = 4;
    61 const TInt KEV0Ind = 4;
    62 const TInt KEVMinus05Ind = 5;
    62 const TInt KEVMinus05Ind = 5;
    63 const TInt KEVMinus10Ind = 6;
    63 const TInt KEVMinus10Ind = 6;
    64 const TInt KEVMinus15Ind = 7;
    64 const TInt KEVMinus15Ind = 7;
    65 const TInt KEVMinus20Ind = 8;
    65 const TInt KEVMinus20Ind = 8;
       
    66 const TUint32 KToolbarExtensionBgColor = 0x00000000;
       
    67 const TInt KToolBarExtensionBgAlpha = 0x7F;
    66 
    68 
    67 
    69 
    68 
    70 
    69 
    71 
    70 // ============================ MEMBER FUNCTIONS ===============================
    72 // ============================ MEMBER FUNCTIONS ===============================
    81   delete iBitmap;
    83   delete iBitmap;
    82   delete iMask;
    84   delete iMask;
    83   PRINT( _L("Camera <= ~CCamSliderLegend") );
    85   PRINT( _L("Camera <= ~CCamSliderLegend") );
    84   }
    86   }
    85 
    87 
       
    88 CCamSliderLegend::CCamSliderLegend( TBool aFullySkinned )
       
    89 : iFullySkinned( aFullySkinned )
       
    90     {    
       
    91     }
       
    92 
    86 // ---------------------------------------------------------
    93 // ---------------------------------------------------------
    87 // CCamSliderLegend::Draw
    94 // CCamSliderLegend::Draw
    88 // Draws the legend 
    95 // Draws the legend 
    89 // ---------------------------------------------------------
    96 // ---------------------------------------------------------
    90 //
    97 //
    91 void CCamSliderLegend::Draw( CWindowGc& aGc ) const
    98 void CCamSliderLegend::Draw( CWindowGc& aGc ) const
    92     {
    99     {
    93     if ( iItem == ECamSliderLegendItemText )
   100     if ( iItem == ECamSliderLegendItemText )
    94         {
   101         {
    95         TRgb color;
   102         TRgb color;
       
   103         if( iFullySkinned )
       
   104             {
    96         MAknsSkinInstance* skin = AknsUtils::SkinInstance();
   105         MAknsSkinInstance* skin = AknsUtils::SkinInstance();
    97         AknsUtils::GetCachedColor( skin, color, KAknsIIDQsnTextColors,
   106         AknsUtils::GetCachedColor( skin, color, KAknsIIDQsnTextColors,
    98                                                 EAknsCIQsnTextColorsCG6 );
   107                                                 EAknsCIQsnTextColorsCG6 );
    99 
   108             }
       
   109         else
       
   110             {            
       
   111             color=KRgbWhite;
       
   112             }
   100         iPosition.DrawText( aGc, iText->Des(), ETrue, color );
   113         iPosition.DrawText( aGc, iText->Des(), ETrue, color );
   101         }
   114         }
   102     else
   115     else
   103         {
   116         {
   104         iIconRect.DrawImage( aGc, iBitmap, iMask );
   117         iIconRect.DrawImage( aGc, iBitmap, iMask );
   177 // might leave.
   190 // might leave.
   178 // -----------------------------------------------------------------------------
   191 // -----------------------------------------------------------------------------
   179 //
   192 //
   180 CCamCaptureSetupSlider::CCamCaptureSetupSlider( MCamSettingValueObserver* aObserver,
   193 CCamCaptureSetupSlider::CCamCaptureSetupSlider( MCamSettingValueObserver* aObserver,
   181                                                 TCamSettingItemIds aSettingType,
   194                                                 TCamSettingItemIds aSettingType,
   182                                                 TInt aSteps ) 
   195                                                 TInt aSteps,
   183 : iSettingObserver( aObserver ), iSettingType( aSettingType ), iSteps( aSteps )
   196                                                 TBool aFullySkinned ) 
       
   197 : iSettingObserver( aObserver ), iSettingType( aSettingType ), iSteps( aSteps ), iFullySkinned( aFullySkinned )
   184     {
   198     {
   185     }
   199     }
   186 
   200 
   187 
   201 
   188 /*
   202 /*
   303 // -----------------------------------------------------------------------------
   317 // -----------------------------------------------------------------------------
   304 //
   318 //
   305 CCamCaptureSetupSlider* CCamCaptureSetupSlider::NewL( const CCoeControl* aParent, 
   319 CCamCaptureSetupSlider* CCamCaptureSetupSlider::NewL( const CCoeControl* aParent, 
   306                                                       MCamSettingValueObserver* aObserver,
   320                                                       MCamSettingValueObserver* aObserver,
   307                                                       TCamSettingItemIds aSettingItem,
   321                                                       TCamSettingItemIds aSettingItem,
   308                                                       TInt aSteps )
   322                                                       TInt aSteps,
       
   323                                                       TBool aFullySkinned )
   309     {
   324     {
   310     CCamCaptureSetupSlider* self = 
   325     CCamCaptureSetupSlider* self = 
   311         new( ELeave ) CCamCaptureSetupSlider( aObserver, aSettingItem, aSteps );
   326         new( ELeave ) CCamCaptureSetupSlider( aObserver, aSettingItem, aSteps,
       
   327                 aFullySkinned );
       
   328     //ME:END    
   312     CleanupStack::PushL( self );
   329     CleanupStack::PushL( self );
   313     self->ConstructL( aParent );
   330     self->ConstructL( aParent );
   314     CleanupStack::Pop( self );
   331     CleanupStack::Pop( self );
   315     return self;
   332     return self;
   316     }
   333     }
   395 //
   412 //
   396 void CCamCaptureSetupSlider::Draw( const TRect& /*aRect*/ ) const
   413 void CCamCaptureSetupSlider::Draw( const TRect& /*aRect*/ ) const
   397     {
   414     {
   398     CWindowGc& gc = SystemGc();
   415     CWindowGc& gc = SystemGc();
   399 
   416 
   400     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
   417     if( iFullySkinned )
   401     MAknsControlContext *cc = AknsDrawUtils::ControlContext( iParentControl ); 
   418         {
   402     AknsDrawUtils::Background( skin, cc, iParentControl, gc, Rect() );
   419         MAknsSkinInstance* skin = AknsUtils::SkinInstance();
       
   420         MAknsControlContext *cc = AknsDrawUtils::ControlContext( iParentControl ); 
       
   421         AknsDrawUtils::Background( skin, cc, iParentControl, gc, Rect() );
       
   422         }
       
   423     else
       
   424         {
       
   425         gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
       
   426         gc.SetBrushColor( TRgb( KToolbarExtensionBgColor, KToolBarExtensionBgAlpha ) );
       
   427         gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
       
   428         gc.DrawRect( Rect() );            
       
   429         // Reset the brush after use (otherwise anything drawn
       
   430         // after the viewfinder will also show viewfinder frames)    
       
   431         gc.SetDrawMode( CGraphicsContext::EDrawModePEN );
       
   432         TSize penSize( 1, 1 );
       
   433         gc.SetPenSize( penSize );
       
   434         gc.SetPenStyle( CGraphicsContext::EDottedPen );
       
   435         gc.SetPenColor( KRgbWhite );
       
   436         gc.SetBrushStyle( CGraphicsContext::ENullBrush );
       
   437         gc.DrawRect( Rect() );                            
       
   438         }
   403     
   439     
   404     // STEP 1: Draw the legend text
   440     // STEP 1: Draw the legend text
   405     TInt count = iLegendArray.Count();
   441     TInt count = iLegendArray.Count();
   406     TInt i = 0;
   442     TInt i = 0;
   407     for ( i = 0; i < count; i++ )
   443     for ( i = 0; i < count; i++ )
   669     const TInt count = reader.ReadInt16();
   705     const TInt count = reader.ReadInt16();
   670     
   706     
   671     // Read all EV entries from the resource file and construct them with layout
   707     // Read all EV entries from the resource file and construct them with layout
   672     for ( TInt i = 0; i < count; i++ )
   708     for ( TInt i = 0; i < count; i++ )
   673         {
   709         {
   674         CCamSliderLegend* legend = new ( ELeave ) CCamSliderLegend;
   710         CCamSliderLegend* legend = new ( ELeave ) CCamSliderLegend( iFullySkinned );
   675         CleanupStack::PushL( legend );
   711         CleanupStack::PushL( legend );
   676         switch ( i )
   712         switch ( i )
   677             {
   713             {
   678             case KContrastPlusInd :
   714             case KContrastPlusInd :
   679 			    {
   715 			    {
   782     
   818     
   783     // Read all Contrast entries from the resource file 
   819     // Read all Contrast entries from the resource file 
   784     // and construct them with layout
   820     // and construct them with layout
   785     for ( TInt i = 0; i < count; i++ )
   821     for ( TInt i = 0; i < count; i++ )
   786         {
   822         {
   787         CCamSliderLegend* legend = new ( ELeave ) CCamSliderLegend;
   823         CCamSliderLegend* legend = new ( ELeave ) CCamSliderLegend( iFullySkinned );
   788         CleanupStack::PushL( legend );
   824         CleanupStack::PushL( legend );
   789         switch ( i )
   825         switch ( i )
   790             {
   826             {
   791             case KEVPlus20Ind :
   827             case KEVPlus20Ind :
   792 			    {
   828 			    {