satengine/SatServer/EventMonitors/inc/CSatBrowserThreadMonitor.h
changeset 46 2fa1fa551b0b
parent 42 35488577e233
child 48 78df25012fda
equal deleted inserted replaced
42:35488577e233 46:2fa1fa551b0b
     1 /*
       
     2 * Copyright (c) 2002-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:  Monitors browser's thread death.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CSATBROWSERTHREADMONITOR_H
       
    20 #define CSATBROWSERTHREADMONITOR_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class MSatBrowserThreadObserver;
       
    27 
       
    28 // CLASS DECLARATION
       
    29 
       
    30 /**
       
    31 *  Monitors the terminating of the browser and informs the observer when
       
    32 *  the browser is terminated.
       
    33 *
       
    34 *  @lib EventMonitors.lib
       
    35 *  @since Series 60 3.0
       
    36 */
       
    37 
       
    38 class CSatBrowserThreadMonitor : public CActive
       
    39     {
       
    40     public: // Constructors and destructor
       
    41 
       
    42         /**
       
    43         * Two-phased constructor.
       
    44         * @param aThread The thread of the browser.
       
    45         */
       
    46         static CSatBrowserThreadMonitor* NewL(
       
    47             const RThread& aThread );
       
    48 
       
    49         /**
       
    50         * Destructor.
       
    51         */
       
    52         virtual ~CSatBrowserThreadMonitor();
       
    53 
       
    54     public: // New functions
       
    55 
       
    56         /**
       
    57         * Starts Browser termination monitor.
       
    58         * @param aObserver Observer for browser termination.
       
    59         */
       
    60         void StartMonitor(
       
    61             MSatBrowserThreadObserver* aObserver );
       
    62 
       
    63         /**
       
    64         * Cancels event monitoring
       
    65         */
       
    66         void DoCancelMonitor();
       
    67 
       
    68     protected: // Functions from base classes
       
    69 
       
    70         /**
       
    71         * From CActive, handles the request completion.
       
    72         */
       
    73         void RunL();
       
    74 
       
    75         /**
       
    76         * From CActive, implements the cancel protocol.
       
    77         */
       
    78         void DoCancel();
       
    79 
       
    80     private: // Constructors
       
    81 
       
    82         /**
       
    83         * C++ default constructor.
       
    84         * @param aMonitor Active object for the start of the browser.
       
    85         * @param aThread The thread of the browser.
       
    86         */
       
    87         CSatBrowserThreadMonitor(
       
    88             const RThread& aThread );
       
    89 
       
    90         /**
       
    91         * Fetch application exit cause.
       
    92         * @return Exit cause.
       
    93         */
       
    94         RSat::TBrowserTerminationCause ExitCause() const;
       
    95 
       
    96     private:
       
    97 
       
    98         /**
       
    99         * Starts browser termination monitor.
       
   100         */
       
   101         void Start();
       
   102 
       
   103     private: // Data
       
   104 
       
   105         // Active object for starting browser.
       
   106         MSatBrowserThreadObserver* iObserver;
       
   107 
       
   108         //  The thread of the browser.
       
   109         RThread iThread;
       
   110     };
       
   111 
       
   112 #endif      // CSATBROWSERTHREADMONITOR_H
       
   113 
       
   114 // End of File