uifw/AvKon/src/AknTransparentCameraSettingPage.cpp
branchRCL_3
changeset 4 8ca85d2f0db7
parent 0 2f259fa3e83a
child 15 08e69e956a8c
equal deleted inserted replaced
0:2f259fa3e83a 4:8ca85d2f0db7
     1 /*
     1 /*
     2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    14 * Description: 
    14 * Description: 
    15 *  Support for transparent camera setting pages
    15 *  Support for transparent camera setting pages
    16 *
    16 *
    17 *
    17 *
    18 */
    18 */
    19 
       
    20 
    19 
    21 #include "AknTransparentCameraSettingPage.h"
    20 #include "AknTransparentCameraSettingPage.h"
    22 
    21 
    23 // For icon support
    22 // For icon support
    24 #include <barsread.h>
    23 #include <barsread.h>
   171 EXPORT_C void CAknTransparentCameraSettingPage::ConstructL()
   170 EXPORT_C void CAknTransparentCameraSettingPage::ConstructL()
   172     {
   171     {
   173     BaseConstructL( KAknSettingPageNoEmbeddedSoftKeys );
   172     BaseConstructL( KAknSettingPageNoEmbeddedSoftKeys );
   174     
   173     
   175     SetDrawBackground(EFalse);  // Enable transparent drawing
   174     SetDrawBackground(EFalse);  // Enable transparent drawing
       
   175     if( CAknEnv::Static()->TransparencyEnabled() )
       
   176         {
       
   177         // try to enable window transparency
       
   178         if ( Window().SetTransparencyAlphaChannel() == KErrNone )
       
   179             {
       
   180             Window().SetRequiredDisplayMode( EColor16MA );
       
   181             Window().SetBackgroundColor( ~0 );
       
   182             }
       
   183         }
   176     
   184     
   177     GenerateInternalArrayAndGiveToListBoxL();
   185     GenerateInternalArrayAndGiveToListBoxL();
   178     
   186     
   179     iExtension = CAknTransparentCameraSettingPageExtension::NewL( *this );
   187     iExtension = CAknTransparentCameraSettingPageExtension::NewL( *this );
   180 
   188 
   381             // it must be reverted back to represent the same item as
   389             // it must be reverted back to represent the same item as
   382             // the current selection in the setting page.
   390             // the current selection in the setting page.
   383             // Only in single click enabled applications.
   391             // Only in single click enabled applications.
   384             if ( iExtension &&
   392             if ( iExtension &&
   385                  iExtension->iFlags.IsSet(
   393                  iExtension->iFlags.IsSet(
   386                          CAknTransparentCameraSettingPageExtension::ESingleClickEnabled ) )
   394                      CAknTransparentCameraSettingPageExtension::ESingleClickEnabled ) &&
       
   395                  iCurrentSelectionIndex >= 0 &&
       
   396                  iCurrentSelectionIndex < ListBoxControl()->Model()->NumberOfItems() )
   387                 {
   397                 {
   388                 ListBoxControl()->View()->SetCurrentItemIndex(
   398                 ListBoxControl()->View()->SetCurrentItemIndex(
   389                     iCurrentSelectionIndex );
   399                     iCurrentSelectionIndex );
   390                 }
   400                 }
   391             break;
   401             break;
   542                                            gc,
   552                                            gc,
   543                                            parentRect.iTl,
   553                                            parentRect.iTl,
   544                                            parentRect,                                       
   554                                            parentRect,                                       
   545                                            KAknsDrawParamDefault);
   555                                            KAknsDrawParamDefault);
   546             }
   556             }
   547         else
       
   548             {
       
   549             gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
       
   550             gc.SetPenStyle(CGraphicsContext::ENullPen);
       
   551             gc.SetBrushColor(KRgbWhite);
       
   552             gc.DrawRect (bgRect);
       
   553             }
       
   554         }
   557         }
   555         
   558         
   556     // draw viewfinder if available
   559     // draw viewfinder if available
   557 	if(iExtension->iBackground)
   560 	if(iExtension->iBackground)
   558         {         
   561         {