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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
25 /** @internalTechnology */
26 static const TInt KApaSystemEventsWithPowerMgmtCapabilityStart = 100;
27 /** @internalTechnology */
28 static const TInt KApaSystemEventsWithPowerMgmtCapabilityEnd = 199;
30 /** Defines the event types that a TApaTask object can send to its window group.
32 The events are sent by TApaTask::SendSystemEvent() and are handled by CEikAppUi::HandleSystemEventL().
36 @see TApaTask::SendSystemEvent()
38 @see CCoeAppUi::HandleSystemEventL() */
41 /** The task is being closed. */
42 EApaSystemEventShutdown=1,
43 /** Reserved for future use. */
44 EApaSystemEventBackupStarting,
45 /** Reserved for future use. */
46 EApaSystemEventBackupComplete,
47 /** The task is being brought to the foreground. */
48 EApaSystemEventBroughtToForeground,
49 /** Close any tasks including system tasks.
50 Events in the range @c KApaSystemEventsWithPowerMgmtCapabilityStart to
51 @c KApaSystemEventsWithPowerMgmtCapabilityEnd requires capability PowerMgmt*/
52 EApaSystemEventSecureShutdown = KApaSystemEventsWithPowerMgmtCapabilityStart
60 #define KUidApaMessageSwitchOpenFile KUidApaMessageSwitchOpenFile16
66 #define KUidApaMessageSwitchCreateFile KUidApaMessageSwitchCreateFile16
72 #define KUidApaMessageSwitchOpenFileValue KUidApaMessageSwitchOpenFileValue16
78 #define KUidApaMessageSwitchCreateFileValue KUidApaMessageSwitchCreateFileValue16
80 #define KUidApaMessageSwitchOpenFile KUidApaMessageSwitchOpenFile8
81 #define KUidApaMessageSwitchCreateFile KUidApaMessageSwitchCreateFile8
82 #define KUidApaMessageSwitchOpenFileValue KUidApaMessageSwitchOpenFileValue8
83 #define KUidApaMessageSwitchCreateFileValue KUidApaMessageSwitchCreateFileValue8
89 const TInt KUidApaMessageSwitchOpenFileValue16=0x10003A39;
94 const TUid KUidApaMessageSwitchOpenFile16={KUidApaMessageSwitchOpenFileValue16};
99 const TInt KUidApaMessageSwitchCreateFileValue16=0x10003A3A;
104 const TUid KUidApaMessageSwitchCreateFile16={KUidApaMessageSwitchCreateFileValue16};
107 /** Application task.
109 A task is a running application. At any one time, for any given application,
110 there may be zero, one, or more tasks running on a device.
112 A task is identified by its association with the running application's window
115 An instance of the TApaTaskList class is used to find and access specific
126 IMPORT_C TApaTask(RWsSession& aWsSession);
127 IMPORT_C void SetWgId(TInt aWgId);
128 IMPORT_C TInt WgId() const;
129 IMPORT_C TBool Exists() const;
130 IMPORT_C TThreadId ThreadId() const;
131 IMPORT_C void BringToForeground();
132 IMPORT_C void SendToBackground();
133 IMPORT_C void EndTask();
134 IMPORT_C void KillTask();
135 IMPORT_C void SendKey(TInt aKeyCode,TInt aModifiers);
136 IMPORT_C void SendKey(const TKeyEvent& aKey);
137 IMPORT_C void SendSystemEvent(TApaSystemEvent aEvent);
138 IMPORT_C TInt SwitchOpenFile(const TDesC& aFilename);
139 IMPORT_C TInt SwitchCreateFile(const TDesC& aFilename);
140 IMPORT_C TInt SendMessage(TUid aUid, const TDesC8& aParams);
143 TInt CheckSwitchFile() const;
144 void SendSystemEvent(TApaSystemEvent aEvent, TEventCode aType);
146 RWsSession& iWsSession;
148 TInt iTApaTask_Reserved1;
152 /** Accesses tasks running on a device.
154 Tasks can be identified by document, application specific UID or by caption
157 Users of this class can also cycle through a set of tasks running a specific
158 application, bringing each one, in turn, into the foreground.
165 /** Defines the direction in which tasks are cycled to the foreground. This is used
166 by the CycleTasks() function.
168 @see TApaTaskList::CycleTasks() */
171 /** Cycles the task list forwards, i.e. the foreground task is moved to background,
172 bringing the next foremost task to the foreground. */
174 /** Cycles the list backwards, i.e. the task furthest from the foreground is brought
175 to the foreground, pushing what was the foremost task to the next ordinal
180 IMPORT_C TApaTaskList(RWsSession& aWsSession);
181 IMPORT_C TApaTask FindApp(const TDesC& aAppName);
182 IMPORT_C TApaTask FindDoc(const TDesC& aDocName);
183 IMPORT_C TApaTask FindByPos(TInt aPos);
184 IMPORT_C TApaTask FindApp(TUid aAppUid);
185 IMPORT_C TInt CycleTasks(TUid aAppUid,TCycleDirection aDirection=EForwards);
188 void FindByPosL(TApaTask& aTask,TInt aPos);
190 RWsSession& iWsSession;
191 TInt iTApaTaskList_Reserved1;