startupservices/Startup/src/startupview.cpp
branchRCL_3
changeset 63 c2c61fdca848
parent 62 924385140d98
equal deleted inserted replaced
62:924385140d98 63:c2c61fdca848
     1 /*
     1 /*
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2007,2008 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:  Implementation of CStartupView class
    14 * Description:  Implementation of CStartupView class
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 
    19 #include <aknappui.h>
       
    20 #include <AknsBasicBackgroundControlContext.h> // Skin support
       
    21 #include <AknsDrawUtils.h> // Skin support
    20 
    22 
    21 #include "startupview.h"
    23 #include "startupview.h"
    22 #include "StartupDefines.h"
    24 #include "StartupDefines.h"
    23 
    25 
    24 // ======== MEMBER FUNCTIONS ========
    26 // ======== MEMBER FUNCTIONS ========
    48 // ---------------------------------------------------------------------------
    50 // ---------------------------------------------------------------------------
    49 //
    51 //
    50 CStartupView::~CStartupView()
    52 CStartupView::~CStartupView()
    51     {
    53     {
    52     TRACES("CStartupView::~CStartupView()");
    54     TRACES("CStartupView::~CStartupView()");
    53     
    55     delete iBgContext;
    54     TRACES("CStartupView::~CStartupView(): End");
    56     TRACES("CStartupView::~CStartupView(): End");
    55     }
    57     }
    56 
    58 
    57 
    59 
    58 // ---------------------------------------------------------------------------
    60 // ---------------------------------------------------------------------------
    90 //
    92 //
    91 // ---------------------------------------------------------------------------
    93 // ---------------------------------------------------------------------------
    92 void CStartupView::SizeChanged()
    94 void CStartupView::SizeChanged()
    93     {
    95     {
    94     TRACES("CStartupView::SizeChanged()");
    96     TRACES("CStartupView::SizeChanged()");
       
    97 
       
    98     if (iBgContext)
       
    99     	{
       
   100     	iBgContext->SetRect( Rect() );
       
   101     	}
       
   102     
    95     if ( iComponent )
   103     if ( iComponent )
    96         {
   104         {
    97         iComponent->SetRect( Rect() );
   105         iComponent->SetRect( Rect() );
    98         }
   106         }
    99 
   107 
   134 void CStartupView::Draw( const TRect& aRect ) const
   142 void CStartupView::Draw( const TRect& aRect ) const
   135     {
   143     {
   136     TRACES("CStartupView::Draw()");
   144     TRACES("CStartupView::Draw()");
   137 
   145 
   138     CWindowGc& gc = SystemGc();
   146     CWindowGc& gc = SystemGc();
   139  
   147     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
   140     gc.SetPenStyle( CGraphicsContext::ENullPen );
   148     gc.SetPenStyle( CGraphicsContext::ENullPen );
   141     gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
   149     gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
   142     gc.SetClippingRect( aRect );
   150     
   143     gc.SetBrushColor( KRgbWhite );
   151     // Draw skin background
   144     gc.Clear();
   152     if ( !AknsDrawUtils::Background( skin, iBgContext, gc, aRect ) )
       
   153         {
       
   154         // If Skin is missing, clear with default color
       
   155         gc.SetClippingRect( aRect );
       
   156         gc.SetBrushColor( KRgbWhite );
       
   157         gc.Clear();
       
   158         }
       
   159 
   145     TRACES("CStartupView::Draw(): End");
   160     TRACES("CStartupView::Draw(): End");
   146     }
   161     }
       
   162 
   147 
   163 
   148 // ---------------------------------------------------------------------------
   164 // ---------------------------------------------------------------------------
   149 // CStartupView::CStartupView
   165 // CStartupView::CStartupView
   150 //
   166 //
   151 // ---------------------------------------------------------------------------
   167 // ---------------------------------------------------------------------------
   154     {
   170     {
   155     TRACES("CStartupView::CStartupView()");
   171     TRACES("CStartupView::CStartupView()");
   156     TRACES("CStartupView::CStartupView(): End");
   172     TRACES("CStartupView::CStartupView(): End");
   157     }
   173     }
   158 
   174 
       
   175 
   159 // ---------------------------------------------------------------------------
   176 // ---------------------------------------------------------------------------
   160 // CStartupView::ConstructL
   177 // CStartupView::ConstructL
   161 //
   178 //
   162 // ---------------------------------------------------------------------------
   179 // ---------------------------------------------------------------------------
   163 //
   180 //
   164 void CStartupView::ConstructL( const TRect& aRect )
   181 void CStartupView::ConstructL( const TRect& aRect )
   165     {
   182     {
   166     TRACES("CStartupView::ConstructL()");
   183     TRACES("CStartupView::ConstructL()");
       
   184 
       
   185     iAvkonAppUi->StatusPane()->MakeVisible( EFalse );
   167     CreateWindowL();
   186     CreateWindowL();
   168     SetRect( aRect );
   187     SetRect( aRect );
   169 
   188 
   170 	// Create background drawing context    
   189 	// Create background drawing context    
   171     TRect bgrect(aRect.Size());
   190     TRect bgrect(aRect.Size());
       
   191     iBgContext = CAknsBasicBackgroundControlContext::NewL( 
       
   192             KAknsIIDQsnBgScreen,
       
   193     		bgrect, EFalse );
       
   194 
   172     ActivateL();
   195     ActivateL();
       
   196 
   173     TRACES("CStartupView::ConstructL(): End");
   197     TRACES("CStartupView::ConstructL(): End");
   174     }
   198     }