sl@0: // Copyright (c) 2006-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: #include "multiplesurfacesapp.h" sl@0: #include "cmultiplesurfaces.h" sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: sl@0: void CMultipleSurfacesAppUi::ConstructL() sl@0: { sl@0: // Create app framework sl@0: CEikAppUi::BaseConstructL(ENoAppResourceFile); sl@0: iAppView = new(ELeave) CMultipleSurfacesAppView(*this); sl@0: iAppView->ConstructL(ClientRect()); sl@0: AddToStackL(iAppView); sl@0: iAppView->ActivateL(); sl@0: } sl@0: sl@0: CMultipleSurfacesAppUi::~CMultipleSurfacesAppUi() sl@0: { sl@0: delete iMultipleSurfaces; sl@0: if (iAppView) sl@0: { sl@0: RemoveFromStack(iAppView); sl@0: delete iAppView; sl@0: } sl@0: } sl@0: sl@0: /** Process command parameters */ sl@0: TBool CMultipleSurfacesAppUi::ProcessCommandParametersL(CApaCommandLine &aCommandLine) sl@0: { sl@0: TPtrC childQueueName = aCommandLine.ExecutableName(); sl@0: iMultipleSurfaces = CMultipleSurfaces::NewL(CCoeEnv::Static()->WsSession(), sl@0: CCoeEnv::Static()->RootWin(), childQueueName, this, KParentQueueName()); sl@0: iMultipleSurfaces->Start(); sl@0: return CEikAppUi::ProcessCommandParametersL(aCommandLine); sl@0: } sl@0: sl@0: void CMultipleSurfacesAppUi::Terminate() sl@0: { sl@0: PrepareToExit(); sl@0: CActiveScheduler::Stop(); sl@0: } sl@0: sl@0: void CMultipleSurfacesAppUi::BringToFront() sl@0: { sl@0: RWindow window = iAppView->Window(); sl@0: RWsSession wsSession = iAppView->ControlEnv()->WsSession(); sl@0: wsSession.SetWindowGroupOrdinalPosition(window.WindowGroupId(), 0); sl@0: wsSession.Flush(); sl@0: wsSession.Finish(); sl@0: } sl@0: sl@0: sl@0: CMultipleSurfacesAppView::CMultipleSurfacesAppView(CMultipleSurfacesAppUi& aAppUi) : sl@0: CCoeControl(), iAppUi(aAppUi) sl@0: { sl@0: // empty sl@0: } sl@0: sl@0: void CMultipleSurfacesAppView::ConstructL(const TRect& aRect) sl@0: { sl@0: CreateWindowL(); sl@0: SetRect(aRect); sl@0: } sl@0: sl@0: CMultipleSurfacesAppView::~CMultipleSurfacesAppView() sl@0: { sl@0: // empty sl@0: } sl@0: sl@0: sl@0: CMultipleSurfacesAppDocument::CMultipleSurfacesAppDocument(CEikApplication& aApp) : CEikDocument(aApp) sl@0: { sl@0: // empty sl@0: } sl@0: sl@0: CEikAppUi* CMultipleSurfacesAppDocument::CreateAppUiL() sl@0: { sl@0: return new(ELeave) CMultipleSurfacesAppUi; sl@0: } sl@0: sl@0: sl@0: TUid CMultipleSurfacesApp::AppDllUid() const sl@0: { sl@0: return TUid::Uid(0x101FCABE); sl@0: } sl@0: sl@0: CApaDocument* CMultipleSurfacesApp::CreateDocumentL() sl@0: { sl@0: return new(ELeave) CMultipleSurfacesAppDocument(*this); sl@0: } sl@0: sl@0: LOCAL_C CApaApplication* NewApplication() sl@0: { sl@0: return new CMultipleSurfacesApp; sl@0: } sl@0: sl@0: GLDEF_C TInt E32Main() sl@0: { sl@0: return EikStart::RunApplication(NewApplication); sl@0: }