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: #include sl@0: #include sl@0: sl@0: #include "t_pseudoappeng.h" sl@0: #include "t_pseudoappview.h" sl@0: #include "t_pseudoapp.h" sl@0: #include "t_pseudoappui.h" sl@0: sl@0: // sl@0: // CPseudoAppUi sl@0: // sl@0: sl@0: /** sl@0: * constructL method that creates the AppView object sl@0: * sl@0: */ sl@0: void CPseudoAppUi::ConstructL() sl@0: { sl@0: RDebug::Print(_L("Create App Framework\n")); sl@0: sl@0: BaseConstructL(); sl@0: #ifndef T_PSEUDOAPP1 sl@0: iAppView = CPseudoAppView::NewL(ClientRect()); sl@0: #else sl@0: // t_pseudoapp1 is used in a test that displays two animations on one screen. sl@0: // Window dimensions and positions chosen such that both animations are visible. sl@0: TSize sz = ClientRect().Size(); sl@0: TRect rect(sz.iWidth/2, sz.iHeight/2, sz.iWidth, sz.iHeight); sl@0: iAppView = CPseudoAppView::NewL(rect); sl@0: #endif //T_PSEUDOAPP1 sl@0: sl@0: //Detect screen rotations sl@0: iCoeEnv->RootWin().EnableScreenChangeEvents(); sl@0: } sl@0: sl@0: /** sl@0: * Destructor sl@0: * sl@0: */ sl@0: CPseudoAppUi::~CPseudoAppUi() sl@0: { sl@0: delete iAppView; sl@0: } sl@0: sl@0: /** sl@0: * Handles the Menu events sl@0: * @param aCommand - command to be passed based on the menu item sl@0: * selected by the user sl@0: * sl@0: */ sl@0: void CPseudoAppUi::HandleCommandL(TInt aCommand) sl@0: { sl@0: switch (aCommand) sl@0: { sl@0: case EEikCmdExit: sl@0: { sl@0: Exit(); sl@0: break; sl@0: } sl@0: default: sl@0: { sl@0: User::Leave(KErrAbort); sl@0: break; sl@0: } sl@0: } sl@0: } sl@0: sl@0: /** sl@0: * Handles system events sl@0: * @param aEvent - event that has to be handled by the function sl@0: * sl@0: */ sl@0: void CPseudoAppUi::HandleSystemEventL(const TWsEvent& aEvent) sl@0: { sl@0: switch (*(TApaSystemEvent*)(aEvent.EventData())) sl@0: { sl@0: case EApaSystemEventBroughtToForeground: sl@0: RProcess::Rendezvous(KErrNone); sl@0: break; sl@0: default: sl@0: break; sl@0: } sl@0: } sl@0: sl@0: void CPseudoAppUi::HandleScreenDeviceChangedL() sl@0: { sl@0: //The function called after a screen rotation event occurs sl@0: //Only rotation of one screen supported sl@0: iAppView->RotateL(); sl@0: } sl@0: sl@0: