convergedconnectionhandler/cchclientapi/cchuinotif/inc/cchuicallstatelistener.h
changeset 0 a4daefaec16c
equal deleted inserted replaced
-1:000000000000 0:a4daefaec16c
       
     1 /*
       
     2 * Copyright (c) 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: CCH UI Call State Listener
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef C_CCHUICALLSTATELISTENER_H
       
    19 #define C_CCHUICALLSTATELISTENER_H
       
    20 
       
    21 
       
    22 #include <e32property.h>
       
    23 #include <e32base.h>
       
    24 
       
    25 class MCchUiCallStateObserver;
       
    26 
       
    27 
       
    28 /**
       
    29 *  Class for listening call state changes.
       
    30  *
       
    31  *  @code
       
    32  *    CCchUiCallStateListener listener =
       
    33  *        CCchUiCallStateListener::NewL( *this );
       
    34  *  @endcode
       
    35  *
       
    36  *  @lib cchuinotif.lib
       
    37  *  @since S60 v5.0
       
    38  */
       
    39 NONSHARABLE_CLASS( CCchUiCallStateListener ) : public CActive
       
    40     {
       
    41 
       
    42 public:
       
    43 
       
    44     /**
       
    45      * Two-phased constructor.
       
    46      * @param aObserver callback observer
       
    47      */
       
    48     static CCchUiCallStateListener* NewL( MCchUiCallStateObserver& aObserver );
       
    49 
       
    50     /**
       
    51      * Destructor.
       
    52      */
       
    53     virtual ~CCchUiCallStateListener();
       
    54 
       
    55 protected:
       
    56 
       
    57 // from base class CActive
       
    58 
       
    59     /**
       
    60      * From CActive
       
    61      * See base class.
       
    62      */
       
    63     void RunL();
       
    64 
       
    65     /**
       
    66      * From CActive
       
    67      * See base class.
       
    68      */
       
    69     void DoCancel();
       
    70 
       
    71 private:
       
    72 
       
    73     CCchUiCallStateListener( MCchUiCallStateObserver& aObserver );
       
    74 
       
    75     /**
       
    76      * Handle state change.
       
    77      *
       
    78      * @since S60 v5.0
       
    79      */
       
    80     void HandleChange();
       
    81 
       
    82     /**
       
    83      * Start listening call state changes.
       
    84      *
       
    85      * @since S60 v5.0
       
    86      */
       
    87     void IssueRequest();
       
    88 
       
    89 private: // data
       
    90 
       
    91     /*
       
    92      * Property handle used to get property value
       
    93      */
       
    94     RProperty iProperty;
       
    95 
       
    96     /**
       
    97      * Call state
       
    98      */
       
    99     TInt iCallState;
       
   100 
       
   101     /**
       
   102      * CCH UI call state observer for callbacks
       
   103      */
       
   104     MCchUiCallStateObserver& iObserver;
       
   105     
       
   106     // For unit testing
       
   107     friend class t_cchuicallstatelistener;
       
   108     
       
   109     };
       
   110 
       
   111 #endif // C_CCHUICALLSTATELISTENER_H