commsconfig/cscengine/inc/cscengecommonitor.h
branchRCL_3
changeset 22 d38647835c2e
parent 0 a4daefaec16c
equal deleted inserted replaced
21:f742655b05bf 22:d38647835c2e
       
     1 /*
       
     2 * Copyright (c) 2007-2009 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:  For monitoring ecom events.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CSCENGECOMMONITOR_H
       
    20 #define C_CSCENGECOMMONITOR_H
       
    21 
       
    22 #include <ecom/ecom.h>
       
    23 
       
    24 class MCSCEngEcomObserver;
       
    25 
       
    26 /**
       
    27  * An instance of CCSCEngEcomMonitor
       
    28  * For monitoring ecom events.
       
    29  *
       
    30  * @lib cscengine.lib
       
    31  * @since Series 60 3.2
       
    32  */
       
    33 NONSHARABLE_CLASS( CCSCEngEcomMonitor ) : public CActive
       
    34     {    
       
    35     public:
       
    36         
       
    37         /**
       
    38          * Two-phased constructor.
       
    39          *
       
    40          * @param aObserver for Ecom observer
       
    41          */ 
       
    42         static CCSCEngEcomMonitor* NewL( MCSCEngEcomObserver& aObserver );
       
    43 
       
    44 
       
    45         /**
       
    46          * Destructor.
       
    47          */
       
    48         virtual ~CCSCEngEcomMonitor();
       
    49     
       
    50     protected:      
       
    51 
       
    52         // from base class CActive
       
    53     
       
    54         /**
       
    55          * @see CActive.
       
    56          */
       
    57         void RunL();
       
    58 
       
    59 
       
    60         /**
       
    61          * @see CActive.
       
    62          */
       
    63         void DoCancel();
       
    64      
       
    65     private:
       
    66 
       
    67         CCSCEngEcomMonitor( MCSCEngEcomObserver& aObserver );
       
    68 
       
    69         void ConstructL();
       
    70         
       
    71         
       
    72         /**
       
    73          * Starts monitoring about ECom notifications.
       
    74          *
       
    75          * @since S60 v3.2
       
    76          */
       
    77         void StartMonitoring();
       
    78                 
       
    79         /**
       
    80          * Frees memory allocated by array in case of leave.
       
    81          *
       
    82          * @since S60 v3.2
       
    83          * @param aArray for array to be freed
       
    84          */
       
    85         static void ResetAndDestroy( TAny* aArray );
       
    86               
       
    87     private:  // data
       
    88     
       
    89         /**
       
    90          * Reference to ECom observer.
       
    91          */
       
    92         MCSCEngEcomObserver& iObserver;
       
    93     
       
    94         /**
       
    95          * Handle to ECom session.
       
    96          * Own.
       
    97          */
       
    98         REComSession iEcomSession;
       
    99         
       
   100 #ifdef _DEBUG
       
   101     friend class UT_CSCEngEcomMonitor;
       
   102 #endif
       
   103     };
       
   104 
       
   105 #endif // C_CSCENGECOMMONITOR_H