musichomescreen/mcpmusicplayer/inc/applicationmonitor.h
changeset 0 ff3acec5bc43
child 2 b70d77332e66
equal deleted inserted replaced
-1:000000000000 0:ff3acec5bc43
       
     1 /*
       
     2 * Copyright (c) 2008-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:  Monitors an application for exit event.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_APPLICATIONMONITOR_H
       
    20 #define C_APPLICATIONMONITOR_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 class MApplicationMonitorObserver;
       
    25 class RThread;
       
    26 
       
    27 /**
       
    28  *  Application monitor class
       
    29  *
       
    30  *  @since S60 5.0
       
    31  */
       
    32 NONSHARABLE_CLASS( CApplicationMonitor ) : public CActive
       
    33     {
       
    34 
       
    35 public:
       
    36 
       
    37     /**
       
    38     * Two-phased constructor
       
    39     */
       
    40     static CApplicationMonitor* NewL( MApplicationMonitorObserver& aObserver);
       
    41 
       
    42     /**
       
    43     * Virtual destructor
       
    44     */
       
    45     virtual ~CApplicationMonitor();
       
    46 
       
    47     /**
       
    48     * Start monitoring a particular Application
       
    49     * @param aApplication to monitor
       
    50     * @param aRootAppIndication ETrue for RootApp and EFalse EmbeddedApp
       
    51     */
       
    52     void StartL(  TUid aAppUid , TBool aRootAppIndication = ETrue);
       
    53    
       
    54 protected:
       
    55         
       
    56     /**
       
    57     * From CActive
       
    58     */
       
    59     void RunL();
       
    60     
       
    61     /**
       
    62     * From CActive
       
    63     */
       
    64     void DoCancel();
       
    65 
       
    66     /**
       
    67     *  From CActive
       
    68     */
       
    69     TInt RunError(TInt aError);    
       
    70             
       
    71 private:
       
    72     
       
    73     /**
       
    74     * Private constructor
       
    75     */
       
    76     CApplicationMonitor( MApplicationMonitorObserver& aObserver);
       
    77 
       
    78     /**
       
    79     * 2nd phased constructor
       
    80     */
       
    81     void ConstructL();
       
    82 
       
    83 private: // data
       
    84     MApplicationMonitorObserver&  iObserver;
       
    85     RThread iThread; 
       
    86     };
       
    87 
       
    88 #endif // C_APPLICATIONMONITOR_H