satengine/SatServer/EventMonitors/inc/CSatEventMonitorHandler.h
changeset 46 2fa1fa551b0b
parent 42 35488577e233
child 48 78df25012fda
equal deleted inserted replaced
42:35488577e233 46:2fa1fa551b0b
     1 /*
       
     2 * Copyright (c) 2002-2006 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:  Base class for event monitors
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CSATEVENTMONITORHANDLER_H
       
    21 #define CSATEVENTMONITORHANDLER_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <etelsat.h>
       
    26 #include "MSatEventMonitor.h"
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class MSatEventMonitorUtils;
       
    30 
       
    31 
       
    32 // CLASS DECLARATION
       
    33 
       
    34 /**
       
    35 *  Base class for Event monitors. Responsible for
       
    36 *  starting and cancelling event monitoring and to inform
       
    37 *  Event observers of an event occurrence.
       
    38 *
       
    39 *  @lib EventMonitors.lib
       
    40 *  @since Series 60 3.0
       
    41 */
       
    42 class CSatEventMonitorHandler : public CBase,
       
    43                                 public MSatEventMonitor
       
    44     {
       
    45     public:  // Constructor and destructor
       
    46 
       
    47         /**
       
    48         * C++ default constructor.
       
    49         * @param aUtils Interface for Event monitor utils.
       
    50         */
       
    51         CSatEventMonitorHandler( MSatEventMonitorUtils& aUtils );
       
    52 
       
    53         /**
       
    54         * Destructor.
       
    55         */
       
    56         virtual ~CSatEventMonitorHandler();
       
    57 
       
    58     public: // From base class
       
    59 
       
    60         /**
       
    61         * From MSatEventMonitor Cancels event monitoring
       
    62         */
       
    63         IMPORT_C void CancelMonitor();
       
    64 
       
    65         /**
       
    66         * From MSatEventMonitor Updates monitors state.
       
    67         * This function call starts or cancels monitor
       
    68         * @param aEvents A list of events to be monitored. If this monitors event
       
    69         * is not on the list, this monitor is cancelled.
       
    70         * @return TInt An error code indicating update status
       
    71         */
       
    72         IMPORT_C TInt UpdateMonitor( TUint aEvents );
       
    73 
       
    74         /**
       
    75         * From MSatEventMonitor Checks is this event monitor monitoring
       
    76         * particular event.
       
    77         * @param aEvent Event to check against
       
    78         * @return ETrue if aEvent is the same event this is monitoring
       
    79         */
       
    80         IMPORT_C TBool IsMonitoringEvent( const TInt aEvent );
       
    81 
       
    82     protected: // New functions
       
    83 
       
    84         /**
       
    85         * Starts event monitoring
       
    86         * @return An error code indicating monitor start status
       
    87         */
       
    88         virtual TInt StartMonitor() = 0;
       
    89 
       
    90         /**
       
    91         * Cancels event monitoring
       
    92         */
       
    93         virtual void DoCancelMonitor() = 0;
       
    94 
       
    95         /**
       
    96         * Base class constructor
       
    97         * @param aEvent Monitor ID from the derived event monitor.
       
    98         */
       
    99         void BaseConstructL( MSatEventMonitor::TEvent aEvent );
       
   100 
       
   101         /**
       
   102         * Passes event information to SatEngine when monitored event occurs.
       
   103         * @param aIntArg An extra argument. Not all monitors use this.
       
   104         * @param aSecArg An extra argument. Used if needed.
       
   105         */
       
   106         void EventOccured(
       
   107             TInt aIntArg = -1,
       
   108             TInt aSecArg = -1
       
   109             );
       
   110 
       
   111     protected: // Data
       
   112 
       
   113         // Event container. Link to SatEngine
       
   114         MSatEventMonitorUtils& iEventUtils;
       
   115 
       
   116     private:
       
   117 
       
   118         // Derived monitor's event
       
   119         RSat::TEventList iEvent;
       
   120 
       
   121         // Indicates is derived monitor SimRemovalMonitor
       
   122         TBool iIsSimRemovalMonitor;
       
   123 
       
   124         // Indicaties is SimRemovalMonitor active
       
   125         TBool iSimRemovalMonitorActive;
       
   126 
       
   127     };
       
   128 
       
   129 #endif      // CSATEVENTMONITORHANDLER_H
       
   130 
       
   131 // End of File