startupservices/Startup/src/startupview.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 31 Aug 2010 15:24:25 +0300
branchRCL_3
changeset 19 924385140d98
parent 0 2e3d3ce01487
child 20 c2c61fdca848
permissions -rw-r--r--
Revision: 201033 Kit: 201035

/*
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  Implementation of CStartupView class
*
*/




#include "startupview.h"
#include "StartupDefines.h"

// ======== MEMBER FUNCTIONS ========

// ---------------------------------------------------------------------------
// CStartupView::NewL
//
// ---------------------------------------------------------------------------
//
CStartupView* CStartupView::NewL( const TRect& aRect )
    {
    TRACES("CStartupView::NewL()");

    CStartupView* self = new( ELeave ) CStartupView;
    CleanupStack::PushL( self );
    self->ConstructL( aRect );
    CleanupStack::Pop( self );

    TRACES("CStartupView::NewL(): End");
    return self;
    }


// ---------------------------------------------------------------------------
// CStartupView::~CStartupView
//
// ---------------------------------------------------------------------------
//
CStartupView::~CStartupView()
    {
    TRACES("CStartupView::~CStartupView()");
    
    TRACES("CStartupView::~CStartupView(): End");
    }


// ---------------------------------------------------------------------------
// CStartupView::SetComponent
//
// ---------------------------------------------------------------------------
//
void CStartupView::SetComponent( CCoeControl& aComponent )
    {
    TRACES("CStartupView::SetComponent()");

    iComponent = &aComponent;

    TRACES("CStartupView::SetComponent(): End");
    }


// ---------------------------------------------------------------------------
// CStartupView::RemoveComponent
//
// ---------------------------------------------------------------------------
//
void CStartupView::RemoveComponent()
    {
    TRACES("CStartupView::RemoveComponent()");

    iComponent = NULL;

    TRACES("CStartupView::RemoveComponent(): End");
    }


// ---------------------------------------------------------------------------
// CStartupView::SizeChanged
//
// ---------------------------------------------------------------------------
void CStartupView::SizeChanged()
    {
    TRACES("CStartupView::SizeChanged()");
    if ( iComponent )
        {
        iComponent->SetRect( Rect() );
        }

    DrawNow();

    TRACES("CStartupView::SizeChanged(): End");
    }


// ---------------------------------------------------------------------------
// CStartupView::CountComponentControls
//
// ---------------------------------------------------------------------------
//
TInt CStartupView::CountComponentControls() const
    {
    if ( iComponent ) return 1;
    return 0;
    }


// ---------------------------------------------------------------------------
// CStartupView::ComponentControl
//
// ---------------------------------------------------------------------------
//
CCoeControl* CStartupView::ComponentControl( TInt /*aIndex*/ ) const
    {
    return iComponent;
    }


// ---------------------------------------------------------------------------
// CStartupView::Draw
//
// ---------------------------------------------------------------------------
//
void CStartupView::Draw( const TRect& aRect ) const
    {
    TRACES("CStartupView::Draw()");

    CWindowGc& gc = SystemGc();
 
    gc.SetPenStyle( CGraphicsContext::ENullPen );
    gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
    gc.SetClippingRect( aRect );
    gc.SetBrushColor( KRgbWhite );
    gc.Clear();
    TRACES("CStartupView::Draw(): End");
    }

// ---------------------------------------------------------------------------
// CStartupView::CStartupView
//
// ---------------------------------------------------------------------------
//
CStartupView::CStartupView()
    {
    TRACES("CStartupView::CStartupView()");
    TRACES("CStartupView::CStartupView(): End");
    }

// ---------------------------------------------------------------------------
// CStartupView::ConstructL
//
// ---------------------------------------------------------------------------
//
void CStartupView::ConstructL( const TRect& aRect )
    {
    TRACES("CStartupView::ConstructL()");
    CreateWindowL();
    SetRect( aRect );

	// Create background drawing context    
    TRect bgrect(aRect.Size());
    ActivateL();
    TRACES("CStartupView::ConstructL(): End");
    }