1 // Copyright (c) 1997-2009 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.
25 //gmahe. This is used in the below enum.
26 /** @internalTechnology */
27 static const TInt KApaSystemEventsWithPowerMgmtCapabilityStart = 100;
29 /** @internalTechnology */
30 static const TInt KApaSystemEventsWithPowerMgmtCapabilityEnd = 199;
33 /** Defines the event types that a TApaTask object can send to its window group.
35 The events are sent by TApaTask::SendSystemEvent() and are handled by CEikAppUi::HandleSystemEventL().
39 @see TApaTask::SendSystemEvent()
41 @see CCoeAppUi::HandleSystemEventL() */
44 /** The task is being closed. */
45 EApaSystemEventShutdown=1,
46 /** Reserved for future use. */
47 EApaSystemEventBackupStarting,
48 /** Reserved for future use. */
49 EApaSystemEventBackupComplete,
50 /** The task is being brought to the foreground. */
51 EApaSystemEventBroughtToForeground,
52 /** Close any tasks including system tasks.
53 Events in the range @c KApaSystemEventsWithPowerMgmtCapabilityStart to
54 @c KApaSystemEventsWithPowerMgmtCapabilityEnd requires capability PowerMgmt*/
55 EApaSystemEventSecureShutdown = KApaSystemEventsWithPowerMgmtCapabilityStart
63 #define KUidApaMessageSwitchOpenFile KUidApaMessageSwitchOpenFile16
69 #define KUidApaMessageSwitchCreateFile KUidApaMessageSwitchCreateFile16
75 #define KUidApaMessageSwitchOpenFileValue KUidApaMessageSwitchOpenFileValue16
81 #define KUidApaMessageSwitchCreateFileValue KUidApaMessageSwitchCreateFileValue16
83 #define KUidApaMessageSwitchOpenFile KUidApaMessageSwitchOpenFile8
84 #define KUidApaMessageSwitchCreateFile KUidApaMessageSwitchCreateFile8
85 #define KUidApaMessageSwitchOpenFileValue KUidApaMessageSwitchOpenFileValue8
86 #define KUidApaMessageSwitchCreateFileValue KUidApaMessageSwitchCreateFileValue8
92 const TInt KUidApaMessageSwitchOpenFileValue16=0x10003A39;
97 const TUid KUidApaMessageSwitchOpenFile16={KUidApaMessageSwitchOpenFileValue16};
102 const TInt KUidApaMessageSwitchCreateFileValue16=0x10003A3A;
107 const TUid KUidApaMessageSwitchCreateFile16={KUidApaMessageSwitchCreateFileValue16};
110 /** Application task.
112 A task is a running application. At any one time, for any given application,
113 there may be zero, one, or more tasks running on a device.
115 A task is identified by its association with the running application's window
118 An instance of the TApaTaskList class is used to find and access specific
129 IMPORT_C TApaTask(RWsSession& aWsSession);
130 IMPORT_C void SetWgId(TInt aWgId);
131 IMPORT_C TInt WgId() const;
132 IMPORT_C TBool Exists() const;
133 IMPORT_C TThreadId ThreadId() const;
134 IMPORT_C void BringToForeground();
135 IMPORT_C void SendToBackground();
136 IMPORT_C void EndTask();
137 IMPORT_C void KillTask();
138 IMPORT_C void SendKey(TInt aKeyCode,TInt aModifiers);
139 IMPORT_C void SendKey(const TKeyEvent& aKey);
140 IMPORT_C void SendSystemEvent(TApaSystemEvent aEvent);
141 IMPORT_C TInt SwitchOpenFile(const TDesC& aFilename);
142 IMPORT_C TInt SwitchCreateFile(const TDesC& aFilename);
143 IMPORT_C TInt SendMessage(TUid aUid, const TDesC8& aParams);
146 TInt CheckSwitchFile() const;
147 void SendSystemEvent(TApaSystemEvent aEvent, TEventCode aType);
149 RWsSession& iWsSession;
151 TInt iTApaTask_Reserved1;
155 /** Accesses tasks running on a device.
157 Tasks can be identified by document, application specific UID or by caption
160 Users of this class can also cycle through a set of tasks running a specific
161 application, bringing each one, in turn, into the foreground.
168 /** Defines the direction in which tasks are cycled to the foreground. This is used
169 by the CycleTasks() function.
171 @see TApaTaskList::CycleTasks() */
174 /** Cycles the task list forwards, i.e. the foreground task is moved to background,
175 bringing the next foremost task to the foreground. */
177 /** Cycles the list backwards, i.e. the task furthest from the foreground is brought
178 to the foreground, pushing what was the foremost task to the next ordinal
183 IMPORT_C TApaTaskList(RWsSession& aWsSession);
184 IMPORT_C TApaTask FindApp(const TDesC& aAppName);
185 IMPORT_C TApaTask FindDoc(const TDesC& aDocName);
186 IMPORT_C TApaTask FindByPos(TInt aPos);
187 IMPORT_C TApaTask FindApp(TUid aAppUid);
188 IMPORT_C TInt CycleTasks(TUid aAppUid,TCycleDirection aDirection=EForwards);
191 void FindByPosL(TApaTask& aTask,TInt aPos);
193 RWsSession& iWsSession;
194 TInt iTApaTaskList_Reserved1;