menucontentsrv/srvinc/mcsrunningappswgmonitor.h
changeset 0 79c6a41cd166
child 1 844b978f8d5e
equal deleted inserted replaced
-1:000000000000 0:79c6a41cd166
       
     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:  
       
    15 *
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef __MCSRUNNINGAPPSWGMONITOR_H__
       
    21 #define __MCSRUNNINGAPPSWGMONITOR_H__
       
    22 
       
    23 #include <w32std.h>
       
    24 #include <WidgetRegistryConstants.h>
       
    25 
       
    26 #include "menuengoperation.h"
       
    27 
       
    28 
       
    29 //Forward declatations
       
    30 class CMenuEng;
       
    31 class MMcsRunningAppsHandler;
       
    32 class CApaWindowGroupName;
       
    33 
       
    34 /*
       
    35  * Windows Group change monitor. 
       
    36  * It cooperates with CMcsRunningAppsHandler. If any application was 
       
    37  * launched or closed it passes an array with currently running applications 
       
    38  * UIDs to CMcsRunningAppsHandler
       
    39  */
       
    40 NONSHARABLE_CLASS( CMcsRunningAppsWgMonitor ): public CActive, MMenuEngOperation
       
    41     {
       
    42     public:
       
    43 	/**
       
    44 	*   Factory method.
       
    45 	*/
       
    46     static CMcsRunningAppsWgMonitor* NewL( 
       
    47         CMenuEng& aEng, MMcsRunningAppsHandler* aRunningAppsHandler,
       
    48         TInt aPriority = EPriorityStandard );
       
    49 
       
    50     /**
       
    51     *   Destructor.
       
    52     */
       
    53     ~CMcsRunningAppsWgMonitor();
       
    54 
       
    55         
       
    56 private:
       
    57 	/**
       
    58 	*   Constructor.
       
    59 	*/
       
    60 	CMcsRunningAppsWgMonitor( 
       
    61 	    CMenuEng& aEng, MMcsRunningAppsHandler* aRunningAppsHandler,
       
    62 	    TInt aPriority );
       
    63 
       
    64 	/**
       
    65 	 * 2nd phase constructor
       
    66 	 */
       
    67 	void ConstructL();
       
    68 
       
    69 private:    // from MMenuEngOperation
       
    70 
       
    71     /**
       
    72     * Execute engine operation:
       
    73     * Do the application scan and update menu accordingly.
       
    74     */
       
    75     void RunMenuEngOperationL();
       
    76 
       
    77     /**
       
    78     * Error handling: ignore error.
       
    79     * @param aErr Error code.
       
    80     */
       
    81     void CompletedMenuEngOperation( TInt aErr );
       
    82     
       
    83 private:    
       
    84     /**
       
    85     *   It is called if an event is received from the windowserver.
       
    86     */
       
    87     void RunL();
       
    88     
       
    89     /**
       
    90     * Error handling: ignore error.
       
    91     * @param aErr Error code.
       
    92     */
       
    93     TInt RunError( TInt aError );
       
    94 
       
    95     /**
       
    96      *   Provides Active object safe cancellation
       
    97     */
       
    98     void DoCancel();
       
    99     
       
   100     /**
       
   101     *   It activates the object, requests an event from the windowserver.
       
   102     */
       
   103     void Start();
       
   104     
       
   105     /*
       
   106      * Fills iRunningApps array with UIDs of currently running applications
       
   107      * and passes this array to CMcsRunningAppsHandler
       
   108     */
       
   109     void UpdateRunningApplicationsL();
       
   110 
       
   111     /**
       
   112      *   Updates the list of the running widgets.
       
   113      */
       
   114     void UpdateWidgetTaskListL( );
       
   115     
       
   116 private://data
       
   117     /*
       
   118     * engine. not own
       
   119     */
       
   120     CMenuEng& iEng ; ///< Engine.
       
   121 
       
   122     /**
       
   123     *   The events can be received via this session.
       
   124     */
       
   125     RWsSession iWsSession;
       
   126     
       
   127     /**
       
   128     *   Seesion to widget registry. own
       
   129     */
       
   130     RWidgetRegistryClientSession iWidgetSession;
       
   131 
       
   132     /*
       
   133      * own 
       
   134      */
       
   135     RArray<TUid> iRunningApps;
       
   136     
       
   137     /*
       
   138      * not own
       
   139      */
       
   140     MMcsRunningAppsHandler* iRunningAppsHandler;
       
   141     
       
   142     /*
       
   143      * own 
       
   144      */
       
   145     RWindowGroup iWg;
       
   146     
       
   147     /*
       
   148      * own 
       
   149      */    
       
   150     CApaWindowGroupName* iWgName;
       
   151     
       
   152     /*
       
   153      * 
       
   154      */
       
   155     TBool iOperationInProgress;
       
   156     };
       
   157     
       
   158  
       
   159 	
       
   160 #endif // __MCSRUNNINGAPPSWGMONITOR_H__