mmshplugins/mmshaoplugin/inc/muspropertymonitor.h
changeset 22 496ad160a278
equal deleted inserted replaced
15:ccd8e69b5392 22:496ad160a278
       
     1 /*
       
     2 * Copyright (c) 2005-2007 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 the call.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef MUSAOCALLMONITOR_H
       
    21 #define MUSPROPERTYMONITOR_H
       
    22 
       
    23 #include "musunittesting.h"
       
    24 #include "mmuscallstateobserver.h"
       
    25 #include <etelmm.h>
       
    26 #include <e32base.h>
       
    27 #include <e32property.h>
       
    28 
       
    29 class CMusManager;
       
    30 
       
    31 /**
       
    32  * Monitor, which observes status of current cs call  
       
    33  *
       
    34  * @lib musaoplugin.dll
       
    35  */
       
    36 class CMusPropertyMonitor : public CActive
       
    37     {
       
    38 
       
    39     public: // constructors and destructor
       
    40 
       
    41         /**
       
    42          * Two-phased constructor. Leaves on failure.
       
    43          */
       
    44         static CMusPropertyMonitor* NewL( MMusCallStateObserver& aCallStateObserver );
       
    45 
       
    46         /**
       
    47          * Destructor.
       
    48          */
       
    49         ~CMusPropertyMonitor();
       
    50         
       
    51         
       
    52     public: // other public functions
       
    53         
       
    54         /*
       
    55          * Checks from P/S Keys about call state
       
    56          * @return EFalse if call state is ENoCall otherwise ETrue  
       
    57          */
       
    58         TBool IsCallConnected();
       
    59 
       
    60 
       
    61     private:
       
    62 
       
    63         /**
       
    64          * C++ constructor.
       
    65          */
       
    66         CMusPropertyMonitor( MMusCallStateObserver& aCallStateObserve );
       
    67 
       
    68         /**
       
    69          * Symbian 2nd-phase constructor.
       
    70          */
       
    71         void ConstructL();
       
    72 
       
    73 
       
    74     private:
       
    75 
       
    76         /**
       
    77          * Handles an active object's request completion event.
       
    78          */
       
    79         void RunL();
       
    80         
       
    81         /**
       
    82          * cancels of an outstanding request
       
    83          */        
       
    84         void DoCancel();
       
    85 
       
    86          /*
       
    87          * Handles a leave occurring in the request completion 
       
    88          * event handler RunL().
       
    89          * Always return KErrNone since it must handle this error
       
    90          * if it comes to this place.
       
    91          */
       
    92         TInt RunError( TInt aError );
       
    93 
       
    94 
       
    95 
       
    96     private:    
       
    97 
       
    98         /**
       
    99          * Instance of RProperty.
       
   100          */
       
   101         RProperty iPropertyEvent;    
       
   102      
       
   103         /*
       
   104          * Reference of callstate observer not owned
       
   105          */
       
   106         MMusCallStateObserver& iCallStateObserver;
       
   107 
       
   108         MUS_UNITTEST( UT_CMusPropertyMonitor )
       
   109 
       
   110     };
       
   111 
       
   112 #endif // MUSPROPERTYMONITOR_H