idlehomescreen/widgetmanager/src/wmspbgcleaner.cpp
branchRCL_3
changeset 83 5456b4e8b3a8
parent 34 d05a55b217df
equal deleted inserted replaced
82:5f0182e07bfb 83:5456b4e8b3a8
       
     1 /*
       
     2 * Copyright (c) 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:
       
    15 * statuspane transparency handling implementation
       
    16 *
       
    17 */
       
    18 
       
    19 #include <e32base.h>
       
    20 #include <w32std.h>
       
    21 #include <AknUtils.h>
       
    22 
       
    23 #include "wmspbgcleaner.h"
       
    24 
       
    25 // CONSTANTS
       
    26 
       
    27 // ---------------------------------------------------------
       
    28 // CWmSpBgCleaner::NewL
       
    29 // ---------------------------------------------------------
       
    30 //
       
    31 CWmSpBgCleaner* CWmSpBgCleaner::NewL()
       
    32     {
       
    33     CWmSpBgCleaner* self = CWmSpBgCleaner::NewLC();
       
    34     CleanupStack::Pop(); // self;
       
    35     return self;
       
    36     }
       
    37 
       
    38 // ---------------------------------------------------------
       
    39 // CWmSpBgCleaner::NewLC
       
    40 // ---------------------------------------------------------
       
    41 //
       
    42 CWmSpBgCleaner* CWmSpBgCleaner::NewLC()
       
    43     {
       
    44     CWmSpBgCleaner* self = new ( ELeave ) CWmSpBgCleaner();
       
    45     CleanupStack::PushL(self);
       
    46     self->ConstructL();
       
    47     return self;
       
    48     }
       
    49 
       
    50 // ---------------------------------------------------------
       
    51 // CWmSpBgCleaner::CWmSpBgCleaner
       
    52 // ---------------------------------------------------------
       
    53 //
       
    54 CWmSpBgCleaner::CWmSpBgCleaner()
       
    55     {
       
    56     }
       
    57 
       
    58 // ---------------------------------------------------------
       
    59 // CWmSpBgCleaner::ConstructL
       
    60 // ---------------------------------------------------------
       
    61 //
       
    62 void CWmSpBgCleaner::ConstructL()
       
    63     {
       
    64     CreateWindowL();
       
    65     
       
    66     TRect statusPaneRect;
       
    67     AknLayoutUtils::LayoutMetricsRect(
       
    68         AknLayoutUtils::EStatusPane, statusPaneRect );
       
    69     
       
    70     SetRect( statusPaneRect );
       
    71     SetNonFocusing();
       
    72 
       
    73     Window().SetOrdinalPosition( -1 );
       
    74     Window().SetBackgroundColor( TRgb::Color16MA(0) );
       
    75     Window().SetVisible( ETrue );    
       
    76     
       
    77     ActivateL();
       
    78     }
       
    79 
       
    80 // ---------------------------------------------------------
       
    81 // CWmSpBgCleaner::~CWmSpBgCleaner
       
    82 // ---------------------------------------------------------
       
    83 //
       
    84 CWmSpBgCleaner::~CWmSpBgCleaner()
       
    85     {
       
    86     }
       
    87 
       
    88 // ---------------------------------------------------------
       
    89 // CWmSpBgCleaner::SizeChanged
       
    90 // ---------------------------------------------------------
       
    91 //
       
    92 void CWmSpBgCleaner::SizeChanged()
       
    93     {
       
    94     CCoeControl::SizeChanged();
       
    95     DrawDeferred();
       
    96     }
       
    97 
       
    98 // ---------------------------------------------------------
       
    99 // CWmSpBgCleaner::Draw
       
   100 // ---------------------------------------------------------
       
   101 //
       
   102 void CWmSpBgCleaner::Draw( const TRect& /*aRect*/ ) const
       
   103     {
       
   104     CWindowGc& gc = SystemGc();
       
   105     TRgb color( TRgb::Color16MA(0) );
       
   106     gc.SetPenColor( color );
       
   107     gc.SetBrushColor( color );    
       
   108     gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
       
   109     gc.SetPenStyle(CGraphicsContext::ESolidPen );
       
   110     gc.SetBrushStyle(CGraphicsContext::ESolidBrush );
       
   111     gc.Clear();
       
   112     }
       
   113 
       
   114 // ---------------------------------------------------------
       
   115 // CWmSpBgCleaner::HandleResourceChange
       
   116 // ---------------------------------------------------------
       
   117 //
       
   118 void CWmSpBgCleaner::HandleResourceChange( TInt aType )
       
   119     {
       
   120     CCoeControl::HandleResourceChange( aType );
       
   121     
       
   122     if ( KEikDynamicLayoutVariantSwitch == aType )
       
   123         {
       
   124         TRect statusPaneRect;
       
   125         AknLayoutUtils::LayoutMetricsRect(
       
   126             AknLayoutUtils::EStatusPane, statusPaneRect );
       
   127         SetRect( statusPaneRect );
       
   128         }
       
   129     }
       
   130 
       
   131 // End of file