uifw/AvKon/akncompamode/src/akncompaclearer.cpp
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 2008 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:  Control to clear screen
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <AknUtils.h>
       
    20 #include <AknsSkinInstance.h>
       
    21 #include <AknsDrawUtils.h>
       
    22 #include <AknsBasicBackgroundControlContext.h>
       
    23 
       
    24 #include "akncompaclearer.h"
       
    25 
       
    26 // --------------------------------------------------------------------------
       
    27 //
       
    28 // --------------------------------------------------------------------------
       
    29 CAknCompaClearer* CAknCompaClearer::NewLC()
       
    30 {
       
    31     CAknCompaClearer* self = new (ELeave) CAknCompaClearer();
       
    32     CleanupStack::PushL(self);
       
    33     self->ConstructL();
       
    34     return self;
       
    35 }
       
    36 
       
    37 // --------------------------------------------------------------------------
       
    38 //
       
    39 // --------------------------------------------------------------------------
       
    40 CAknCompaClearer::~CAknCompaClearer()
       
    41     {
       
    42     delete iBgContext;
       
    43     }
       
    44 
       
    45 // --------------------------------------------------------------------------
       
    46 //
       
    47 // --------------------------------------------------------------------------
       
    48 void CAknCompaClearer::Draw(const TRect& /*aRect*/) const
       
    49     {
       
    50     AknsDrawUtils::Background(AknsUtils::SkinInstance(), iBgContext,
       
    51         this, SystemGc(), AknLayout::screen().Rect());
       
    52     }
       
    53 
       
    54 // --------------------------------------------------------------------------
       
    55 //
       
    56 // --------------------------------------------------------------------------
       
    57 void CAknCompaClearer::ConstructL()
       
    58     {
       
    59     CreateWindowL();
       
    60 
       
    61     TRect rect = AknLayout::screen().Rect();
       
    62     SetRect(rect);
       
    63 
       
    64     iBgContext = CAknsBasicBackgroundControlContext::NewL(
       
    65         KAknsIIDQsnBgScreen, rect, EFalse); 
       
    66 
       
    67     ActivateL();
       
    68     DrawNow();
       
    69     iCoeEnv->WsSession().Flush();
       
    70     }