satengine/satserver/EventMonitors/inc/csatbrowserwsmonitor.h
changeset 33 8d5d7fcf9b59
child 51 12bc758d6a02
equal deleted inserted replaced
32:1f002146abb4 33:8d5d7fcf9b59
       
     1 /*
       
     2 * Copyright (c) 2002-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 browser window session termination.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CSATBROWSERWSMONITOR_H
       
    20 #define CSATBROWSERWSMONITOR_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <w32std.h>
       
    24 #include "CSatEventMonitorHandler.h"
       
    25 #include "msatbrowserthreadobserver.h"
       
    26 #include "msatbrowserwsobserver.h"
       
    27 
       
    28 // FORWARD DECLARATION
       
    29 class CSatBrowserThreadMonitor;
       
    30 class MSatBrowserWSObserver;
       
    31 
       
    32 // CLASS DECLARATION
       
    33 
       
    34 /**
       
    35  * Monitors browser termination.
       
    36  *
       
    37  * @lib EventMonitors.lib
       
    38  * @since Series 60 3.1
       
    39  */
       
    40 class CSatBrowserWSMonitor : public MSatBrowserThreadObserver,
       
    41                              public CActive
       
    42     {
       
    43 public:
       
    44 
       
    45     /**
       
    46      * Two-phased constructor.
       
    47      */
       
    48     static CSatBrowserWSMonitor* NewL();
       
    49 
       
    50     /**
       
    51      * Destructor.
       
    52      */
       
    53     virtual ~CSatBrowserWSMonitor();
       
    54 
       
    55     /**
       
    56      * From CSatEventMonitorHandler Starts event monitoring
       
    57      * @param Browser termination observer.
       
    58      * @return Error code indicating the status of starting the monitor
       
    59      */
       
    60     TInt StartMonitor(
       
    61         MSatBrowserWSObserver* aObserver );
       
    62 
       
    63     /**
       
    64      * This function is called when browser's thread has actually died.
       
    65      * @param aCause The cause for the browser termination.
       
    66      */
       
    67     void NotifyBrowserTerminated(
       
    68         const RSat::TBrowserTerminationCause aCause );
       
    69 
       
    70 // From base class CActive
       
    71 
       
    72     /**
       
    73      * From CSatEventMonitorHandler Cancels event monitoring
       
    74      */
       
    75     void DoCancelMonitor();
       
    76 
       
    77 protected:
       
    78 
       
    79 // From base class CActive
       
    80 
       
    81     /**
       
    82      * From CActive.
       
    83      */
       
    84     void RunL();
       
    85 
       
    86     /**
       
    87      * From CActive, implements the cancel protocol.
       
    88      */
       
    89     void DoCancel();
       
    90 
       
    91 private:
       
    92 
       
    93     /**
       
    94      * C++ default constructor.
       
    95      */
       
    96     CSatBrowserWSMonitor();
       
    97 
       
    98     /**
       
    99      * By default Symbian 2nd phase constructor is private.
       
   100      */
       
   101     void ConstructL();
       
   102 
       
   103     /**
       
   104      * Start to monitor Browser termination.
       
   105      */
       
   106     void Start();
       
   107 
       
   108     /**
       
   109      * Creates a window group and hides it from the UI.
       
   110      */
       
   111     void CreateWGL();
       
   112 
       
   113 private: // Data
       
   114 
       
   115     /**
       
   116      * Thread death monitor
       
   117      */
       
   118     CSatBrowserThreadMonitor* iThreadMonitor;
       
   119 
       
   120     /**
       
   121      * Indicates is window group created or not
       
   122      */
       
   123     TBool iWGCreated;
       
   124 
       
   125     /**
       
   126      * Browser termination observer.
       
   127      */
       
   128     MSatBrowserWSObserver* iObserver;
       
   129 
       
   130     /**
       
   131      * Window group
       
   132      */
       
   133     RWindowGroup iWg;
       
   134 
       
   135     /**
       
   136      * Window session
       
   137      */
       
   138     RWsSession iWsSession;
       
   139 
       
   140     };
       
   141 
       
   142 #endif // CSATBROWSERWSMONITOR_H