Update contrib.
1 // Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Provide an alternative to the apgrfx to avoid a dependency on middleware
16 #include "apgrfxfacade.h"
18 TApaTaskFacade::TApaTaskFacade(RWsSession& aSession) :
19 iSession(aSession), iWgId(0)
23 TApaTaskFacade::~TApaTaskFacade()
27 TApaTaskFacade::TApaTaskFacade(const TApaTaskFacade& aTaskFacade) :
28 iSession(aTaskFacade.iSession), iWgId(aTaskFacade.iWgId)
32 void TApaTaskFacade::BringToForeground()
34 iSession.SetWindowGroupOrdinalPosition(iWgId, 0);
37 void TApaTaskFacade::SetWgId(TInt aWgId)
42 TApaTaskListFacade::TApaTaskListFacade(RWsSession& aSession) :
47 TApaTaskListFacade::~TApaTaskListFacade()
51 TApaTaskFacade TApaTaskListFacade::FindByPos(TInt aPos)
53 TApaTaskFacade task(iSession);
54 TRAP_IGNORE(FindByPosL(task, aPos));
58 void TApaTaskListFacade::FindByPosL(TApaTaskFacade& aTask,TInt aPos)
61 const TInt windowGroups=iSession.NumWindowGroups(0);
62 if (aPos < 0 || windowGroups < 0 || aPos > windowGroups)
68 CArrayFixFlat<TInt>* wgIdArray=new(ELeave) CArrayFixFlat<TInt>(windowGroups);
69 CleanupStack::PushL(wgIdArray);
70 User::LeaveIfError(iSession.WindowGroupList(0, wgIdArray));
71 wgId=(*wgIdArray)[aPos];
72 CleanupStack::PopAndDestroy(1);