menucontentsrv/srvinc/mcsrunningappsfswmonitor.h
changeset 0 79c6a41cd166
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 __MCSRUNNINGAPPSFSWMONITOR_H__
       
    21 #define __MCSRUNNINGAPPSFSWMONITOR_H__
       
    22 
       
    23 #include <e32property.h>
       
    24 
       
    25 #include "menuengoperation.h"
       
    26 
       
    27 
       
    28 //Forward declatations
       
    29 class CMenuEng;
       
    30 class MMcsRunningAppsHandler;   
       
    31 
       
    32 /*
       
    33  * FSW hidden monitor. 
       
    34  * It cooperates with CMcsRunningAppsHandler. It updates FSW status for 
       
    35  * all applications and passes an array with FSW hidden applications 
       
    36  * UIDs to CMcsRunningAppsHandler
       
    37  */
       
    38 NONSHARABLE_CLASS( CMcsRunningAppsFswMonitor ): public CActive, MMenuEngOperation
       
    39     {
       
    40 public:
       
    41 	/**
       
    42 	*   Factory method.
       
    43 	*/
       
    44     static CMcsRunningAppsFswMonitor* NewL( 
       
    45         CMenuEng& aEng, MMcsRunningAppsHandler* aRunningAppsHandler,
       
    46         TInt aPriority = EPriorityStandard);
       
    47 
       
    48     /**
       
    49     *   Destructor.
       
    50     */
       
    51     ~CMcsRunningAppsFswMonitor();
       
    52    
       
    53     /**
       
    54     * Checks if aUid is present in iFswHiddenApps array
       
    55     * @param aUid uid of an application
       
    56     * @return FSW hidden value
       
    57     */
       
    58     TBool IsFswHidden( TUid aUid );
       
    59     
       
    60 private:
       
    61 	/**
       
    62 	*   Constructor.
       
    63 	*/
       
    64 	CMcsRunningAppsFswMonitor( 
       
    65 	    CMenuEng& aEng, MMcsRunningAppsHandler* aRunningAppsHandler,
       
    66 	    TInt aPriority );
       
    67 
       
    68 	/**
       
    69 	 * 2nd phase constructor
       
    70 	 */
       
    71 	void ConstructL();
       
    72 
       
    73 private:    // from MMenuEngOperation
       
    74 
       
    75     /**
       
    76     * Execute engine operation:
       
    77     * Do the scan 
       
    78     */
       
    79     void RunMenuEngOperationL();
       
    80 
       
    81     /**
       
    82     * Error handling: ignore error.
       
    83     * @param aErr Error code.
       
    84     */
       
    85     void CompletedMenuEngOperation( TInt aErr );
       
    86     
       
    87 private:    //from CActive    
       
    88     
       
    89     /**
       
    90     *   It is called if FSW status property changes
       
    91     */
       
    92     void RunL();
       
    93     
       
    94     /**
       
    95     * Error handling: ignore error.
       
    96     * @param aErr Error code.
       
    97     */
       
    98     TInt RunError( TInt aError );
       
    99 
       
   100     /**
       
   101     *   Provides Active object safe cancellation
       
   102     */
       
   103     void DoCancel();
       
   104     
       
   105 private:
       
   106     /**
       
   107     *   It activates the object, requests an event from the windowserver.
       
   108     */
       
   109     void Start();  
       
   110 
       
   111     
       
   112     /**
       
   113      * Fills iFswHiddenApps array with UIDs of FSW hidden applications
       
   114      * and passes this array to CMcsRunningAppsHandler
       
   115     */
       
   116     void UpdateFswHiddenApplicationsL();
       
   117 
       
   118     
       
   119 private://data
       
   120     /*
       
   121     * engine. not own
       
   122     */
       
   123     CMenuEng& iEng ; ///< Engine.
       
   124 
       
   125     /*
       
   126      * own 
       
   127      */
       
   128     RArray<TUid> iFswHiddenApps;
       
   129 
       
   130     /**
       
   131     * FSW status change listener property
       
   132     */
       
   133     RProperty iFSWStatusProperty;    
       
   134 
       
   135     /*
       
   136      * not own
       
   137      */
       
   138     MMcsRunningAppsHandler* iRunningAppsHandler;
       
   139     
       
   140     };
       
   141     
       
   142  
       
   143 	
       
   144 #endif // __MCSRUNNINGAPPSFSWMONITOR_H__