sl@0: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @test sl@0: @internalComponent sl@0: */ sl@0: sl@0: #include sl@0: #include sl@0: sl@0: #include "t_pseudoappeng.h" sl@0: #include "t_pseudoappview.h" sl@0: sl@0: /** sl@0: * Private constructor, does nothing sl@0: * sl@0: */ sl@0: CPseudoAppView::CPseudoAppView() sl@0: { sl@0: } sl@0: sl@0: /** sl@0: * Standard 2 phase construction, constructs a View object sl@0: * @return pointer to the CPseudoAppView sl@0: * @param aRect - rectangle coordinate defining control's extent sl@0: */ sl@0: CPseudoAppView* CPseudoAppView::NewL(const TRect& aRect) sl@0: { sl@0: CPseudoAppView* self = new(ELeave) CPseudoAppView(); sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(aRect); sl@0: CleanupStack::Pop(); sl@0: return self; sl@0: } sl@0: sl@0: /** sl@0: * sl@0: * Destructor sl@0: */ sl@0: CPseudoAppView::~CPseudoAppView() sl@0: { sl@0: delete iPseudoText; sl@0: iPseudoText = NULL; sl@0: delete iEng; sl@0: iEng = NULL; sl@0: } sl@0: sl@0: /** sl@0: * constructL method sl@0: * @param aRect - rectangle coordinate defining control's extent sl@0: * sl@0: */ sl@0: void CPseudoAppView::ConstructL(const TRect& aRect) sl@0: { sl@0: CreateWindowL(); sl@0: SetRect(aRect); sl@0: sl@0: Window().SetBackgroundColor(KRgbBlack); sl@0: iEng = CTPseudoAppEng::NewL(iEikonEnv->WsSession(), *(CCoeEnv::Static()->ScreenDevice()), Window()); sl@0: sl@0: ActivateL(); sl@0: } sl@0: sl@0: /** sl@0: * sl@0: * Draws the text on the screen sl@0: * sl@0: */ sl@0: void CPseudoAppView::Draw(const TRect& /*aRect*/) const sl@0: { sl@0: if(iEng->Drawing()) sl@0: { sl@0: return; sl@0: } sl@0: sl@0: TRAPD(err,iEng->StartDrawingL()); sl@0: if(err) sl@0: { sl@0: RDebug::Print(_L("StartDrawingL() trapped with error %d\n"), err); sl@0: User::Exit(0); sl@0: } sl@0: } sl@0: sl@0: void CPseudoAppView::RotateL() sl@0: { sl@0: iEng->RotateL(); sl@0: }