camerauis/cameraapp/generic/inc/CamCallStateAo.h
branchRCL_3
changeset 24 bac7acad7cb3
parent 0 1ddebce53859
equal deleted inserted replaced
23:61bc0f252b2b 24:bac7acad7cb3
       
     1 /*
       
     2 * Copyright (c) 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:  Listens for changes to the call state*
       
    15 */
       
    16 
       
    17 
       
    18 #ifndef CAMCALLSTATEAO_H
       
    19 #define CAMCALLSTATEAO_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <e32property.h>
       
    23 #include <ctsydomainpskeys.h>
       
    24 
       
    25 // CONSTANTS
       
    26 
       
    27 // MACROS
       
    28 
       
    29 // DATA TYPES
       
    30 
       
    31 // FUNCTION PROTOTYPES
       
    32 
       
    33 // FORWARD DECLARATIONS
       
    34 
       
    35 // CLASS DECLARATION
       
    36 
       
    37 /**
       
    38 *  
       
    39 *  Mix-in class specifying the callback interface to be used with CCamCallStateAo
       
    40 *
       
    41 *  @since 3.0
       
    42 */
       
    43 class MCamCallStateObserver
       
    44     {
       
    45     public:
       
    46         /**
       
    47         * Callback function, called when the call state changes
       
    48         * @since 3.0
       
    49         * @param aState The new call state
       
    50         * @param aError The error associated with request completion
       
    51         */    
       
    52         virtual void CallStateChanged( TPSCTsyCallState aState, TInt aError ) = 0;
       
    53     };
       
    54     
       
    55 
       
    56 /**
       
    57 *  Active Object class to watch the call state
       
    58 *
       
    59 *  @since 3.0
       
    60 */
       
    61 class CCamCallStateAo : public CActive
       
    62 
       
    63     {
       
    64     public:  // Constructors and destructor        
       
    65         /**
       
    66         * Two-phased constructor.
       
    67         * @since 3.0
       
    68         * @param aObserver The observer requesting callback on call events
       
    69         * @return Constructed instance of the class
       
    70         */
       
    71         static CCamCallStateAo* NewL( MCamCallStateObserver* aObserver );
       
    72             
       
    73         /**
       
    74         * Destructor.
       
    75         */
       
    76         ~CCamCallStateAo();
       
    77         
       
    78     protected:  // Functions from base classes        
       
    79         /**
       
    80         * From CActive
       
    81         * Cancels an outstanding request
       
    82         * @since 3.0
       
    83         */
       
    84     	void DoCancel();		
       
    85 
       
    86         /**
       
    87         * From CActive
       
    88         * Called on completion of a request
       
    89         * @since 3.0
       
    90         */
       
    91     	void RunL();
       
    92 
       
    93         /**
       
    94         * From CActive
       
    95         * Called when an error occurs during a request
       
    96         * @since 3.0
       
    97         * @param aError The Epoc-error code for the error.
       
    98         * @return KErrNone
       
    99         */
       
   100     	TInt RunError( TInt aError );    	        
       
   101     
       
   102     private:
       
   103         /**
       
   104         * C++ default constructor.
       
   105         * @since 3.0
       
   106         * @param aObserver The observer requesting callback on call events
       
   107         */
       
   108         CCamCallStateAo( MCamCallStateObserver* aObserver );
       
   109         
       
   110         /**
       
   111         * By default Symbian 2nd phase constructor is private.
       
   112         */
       
   113         void ConstructL();
       
   114     	
       
   115 
       
   116     public:     // Data
       
   117         // The observer to be notified on an event
       
   118         MCamCallStateObserver* iObserver;
       
   119 
       
   120         // Publish and Subscribe property handle
       
   121         RProperty iProperty;
       
   122     };
       
   123 
       
   124 #endif      // CAMCALLSTATEAO_H
       
   125             
       
   126 // End of File