|
1 /* |
|
2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CATASKLIST_H |
|
19 #define CATASKLIST_H |
|
20 |
|
21 // INCLUDES |
|
22 |
|
23 #include<w32std.h> |
|
24 #include<apgtask.h> |
|
25 |
|
26 // CLASS DECLARATION |
|
27 |
|
28 /** |
|
29 * Class for finding out about running applications. |
|
30 * |
|
31 * This is a modification of the original CAknTaskList class, which |
|
32 * differs in that it does not discriminate applications based on their |
|
33 * window group priority. |
|
34 */ |
|
35 class CCaTaskList : public CBase |
|
36 { |
|
37 public: |
|
38 |
|
39 /** |
|
40 * Factory function |
|
41 * @param aWsSession an open session to the window server, often from CEikonEnv::WsSession() |
|
42 * @return a new fully constructed instance of CCaTaskList |
|
43 */ |
|
44 static CCaTaskList* NewL( RWsSession& aWsSession ); |
|
45 |
|
46 /** |
|
47 * Factory function |
|
48 * @param aWsSession an open session to the window server, often from CEikonEnv::WsSession() |
|
49 * @return a new fully constructed instance of CCaTaskList, which is on the cleanup stack |
|
50 */ |
|
51 |
|
52 static CCaTaskList* NewLC( RWsSession& aWsSession ); |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 ~CCaTaskList(); |
|
57 |
|
58 /** |
|
59 * Refresh the window group array |
|
60 */ |
|
61 void UpdateListL(); |
|
62 |
|
63 /** |
|
64 * Accessor for the window group array |
|
65 * @return an array containing the window groups of running applications. |
|
66 */ |
|
67 const RArray<RWsSession::TWindowGroupChainInfo>& WgArray() const; |
|
68 |
|
69 /** |
|
70 * Find an application with the requested UID 3, which is running as a root application |
|
71 * @param aAppUid the UID 3 of the target application. |
|
72 * @return a TApaTask which refers to the running instance of the application. |
|
73 * if the application is not running, the TApaTask's Exists() function will return EFalse. |
|
74 */ |
|
75 TApaTask FindRootApp( TUid aAppUid ) const; |
|
76 |
|
77 /** |
|
78 * Query whether an application's window group is running as a root application. |
|
79 * @param aWgId the window group identifier of the target application. |
|
80 * @return ETrue if this window group is running as a root window group. |
|
81 */ |
|
82 TBool IsRootWindowGroup( TInt aWgId ) const; |
|
83 |
|
84 private: |
|
85 |
|
86 CCaTaskList( RWsSession& aWsSession ); |
|
87 |
|
88 void ConstructL(); |
|
89 |
|
90 private: |
|
91 |
|
92 RWsSession& iWs; |
|
93 |
|
94 RArray<RWsSession::TWindowGroupChainInfo> iWgs; |
|
95 |
|
96 }; |
|
97 |
|
98 #endif |