coreapplicationuis/SysAp/Inc/SysApTaskList.h
changeset 48 2222076f5c60
equal deleted inserted replaced
40:951aeeb3da43 48:2222076f5c60
       
     1 /*
       
     2 * Copyright (c) 2005 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: 
       
    15 *
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef SYSAPTASKLIST_H
       
    21 #define SYSAPTASKLIST_H
       
    22 
       
    23 // INCLUDES
       
    24 
       
    25 #include <w32std.h>
       
    26 #include <apgtask.h>
       
    27 
       
    28 // CLASS DECLARATION
       
    29 
       
    30 /**
       
    31 *  Class for finding out about running applications.
       
    32 *  This class specialises in locating and identifying root applications,
       
    33 *  those applications who do not have any parent window group.
       
    34 *  It can be used along-side TApaTaskList.
       
    35 *
       
    36 *  @since Series 60 3.0
       
    37 */
       
    38 class CSysApTaskList : public CBase
       
    39 	{
       
    40 public:
       
    41     /**
       
    42     * Factory function
       
    43     * @param aWsSession an open session to the window server, often from CEikonEnv::WsSession()
       
    44     * @return a new fully constructed instance of CSysApTaskList
       
    45     */
       
    46 	static CSysApTaskList* NewL(RWsSession& aWsSession);
       
    47     /**
       
    48     * Factory function
       
    49     * @param aWsSession an open session to the window server, often from CEikonEnv::WsSession()
       
    50     * @return a new fully constructed instance of CSysApTaskList, which is on the cleanup stack
       
    51     */
       
    52 	static CSysApTaskList* NewLC(RWsSession& aWsSession);
       
    53     /**
       
    54     * Destructor.
       
    55     */
       
    56 	~CSysApTaskList();
       
    57 	
       
    58 	/**
       
    59 	* Refresh the window group array
       
    60 	*/
       
    61 	void UpdateListL();
       
    62 	/**
       
    63 	* Accessor for the window group array
       
    64 	* @return an array containing the window groups of running applications.
       
    65 	*/
       
    66 	const RArray<RWsSession::TWindowGroupChainInfo>& WgArray() const;
       
    67 
       
    68 	/**
       
    69 	* Find an application with the requested UID 3, which is running as a root application
       
    70 	* @param aAppUid the UID 3 of the target application.
       
    71 	* @return a TApaTask which refers to the running instance of the application.
       
    72 	* if the application is not running, the TApaTask's Exists() function will return EFalse.
       
    73 	*/	
       
    74 	TApaTask FindRootApp(TUid aAppUid) const;
       
    75 	/**
       
    76 	* Query whether an application's window group is running as a root application.
       
    77 	* @param aWgId the window group identifier of the target application.
       
    78 	* @return ETrue if this window group is running as a root window group.
       
    79 	*/
       
    80 	TBool IsRootWindowGroup(TInt aWgId) const;
       
    81 	
       
    82 	/**
       
    83 	* Find the parent window group. If there is no parent, 0 is returned.
       
    84 	* @param aWgId the window group id that you want to find the parent of.
       
    85 	* @return The window group id of the parent, or 0 if there is no parent.
       
    86 	*/
       
    87 	TInt FindParentWgId(TInt aWgId) const;
       
    88 	/**
       
    89 	* Find the child window group. If there is no child, 0 is returned.
       
    90 	* @param aWgId the window group id that you want to find the child of.
       
    91 	* @return The window group id of the child, or 0 if there is no child.
       
    92 	*/
       
    93 	TInt FindChildWgId(TInt aWgId) const;
       
    94 	
       
    95 private:
       
    96 	CSysApTaskList(RWsSession& aWsSession);
       
    97 	void ConstructL();
       
    98 
       
    99 private:
       
   100 	RWsSession& iWs;
       
   101 	RArray<RWsSession::TWindowGroupChainInfo> iWgs;
       
   102 	};
       
   103 
       
   104 #endif