phonecmdhandler/phonecmdhnlr/inc/PhoneHandlerCallBase.h
changeset 0 ff3b6d0fd310
child 19 7d48bed6ce0c
equal deleted inserted replaced
-1:000000000000 0:ff3b6d0fd310
       
     1 /*
       
     2 * Copyright (c) 2002-2005 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: Declaration of CPhoneHandlerCallBase class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPHONEHANDLERCALLBASE
       
    20 #define CPHONEHANDLERCALLBASE
       
    21 
       
    22 //  INCLUDES
       
    23 #include "PhoneHandlerService.h"
       
    24 #include "PhoneHandlerObserver.h"
       
    25 #include <e32base.h>
       
    26 #include <RPhCltServer.h>
       
    27 
       
    28 // CONSTANTS
       
    29 
       
    30 // MACROS
       
    31 
       
    32 // DATA TYPES
       
    33 
       
    34 // FUNCTION PROTOTYPES
       
    35 
       
    36 // FORWARD DECLARATIONS
       
    37 
       
    38 // CLASS DECLARATION
       
    39 class CPhoneHandlerActive;
       
    40 class CPhCltCommandHandler;
       
    41 
       
    42 /**
       
    43 *  Base class for services.
       
    44 *
       
    45 *  @lib PhoneCmdHandler
       
    46 *  @since S60 3.1
       
    47 */
       
    48 NONSHARABLE_CLASS( CPhoneHandlerCallBase ) : public CBase,
       
    49 											 public MPhoneHandlerService, 
       
    50 											 public MPhoneHandlerObserver
       
    51     {
       
    52     protected:  // Constructors and destructor
       
    53         
       
    54         /**
       
    55         * C++ default constructor.
       
    56         */
       
    57         CPhoneHandlerCallBase();
       
    58         
       
    59         /**
       
    60         * Destructor.
       
    61         */
       
    62         virtual ~CPhoneHandlerCallBase();
       
    63 
       
    64     public: // New functions
       
    65     
       
    66     public: // Functions from base classes
       
    67     
       
    68     	/**
       
    69         * From MPhoneHandlerService. Starts to process an asynchronous request.
       
    70         * @since Series 60 3.1
       
    71         * @param 
       
    72         * @return 
       
    73         */
       
    74         virtual void Process() = 0;
       
    75     
       
    76         /**
       
    77         * From MPhoneHandlerService. Deletes service object.
       
    78         * @since Series 60 3.1
       
    79         * @param 
       
    80         * @return 
       
    81         */
       
    82         virtual void Delete() = 0;
       
    83     
       
    84     	/**
       
    85         * From MPhoneHandlerObserver. Notifies when asynchronous request has
       
    86         * been completed.
       
    87         * @since S60 3.1
       
    88         * @param aError Result code of request processing.
       
    89         * @return void
       
    90         */
       
    91         virtual void RequestCompleted( const TInt aError ) = 0;
       
    92 	        
       
    93     protected:  // New functions
       
    94         
       
    95         /**
       
    96         * Initializes service that executes call handling key presses.
       
    97         * @since S60 3.1
       
    98         * @param void
       
    99         * @return void
       
   100         */
       
   101         void LoadServiceL();
       
   102         
       
   103         /**
       
   104         * Increments state parameter of service.
       
   105         * @since S60 3.1
       
   106         * @param void
       
   107         * @return void
       
   108         */
       
   109         void NextState();
       
   110 		
       
   111 		/**
       
   112         * Called when service isn't running (e.g. when it's completed).
       
   113         * @since S60 3.1
       
   114         * @param void
       
   115         * @return void
       
   116         */
       
   117 		void IdleState();
       
   118 		
       
   119 		/**
       
   120         * Returns an active object's TRequestStatus for asynchronous calls.
       
   121         * @since S60 3.1
       
   122         * @param void
       
   123         * @return void
       
   124         */
       
   125 		TRequestStatus& GetStatus();
       
   126 		
       
   127 		/**
       
   128         * Activates an active object for asynchronous calls.
       
   129         * @since S60 3.1
       
   130         * @param void
       
   131         * @return void
       
   132         */
       
   133 		void Activate(); 	
       
   134 		
       
   135     protected:  // Functions from base classes
       
   136     
       
   137     private:
       
   138 
       
   139     public:     // Data
       
   140            
       
   141     protected:  // Data
       
   142        
       
   143        	// call handling service states 
       
   144         enum TPhoneHandlerServiceState
       
   145 		{
       
   146     	EPhoneHandlerStateIdle		= 0,
       
   147     	EPhoneHandlerState1			= 1,		   
       
   148     	EPhoneHandlerState2			= 2,
       
   149     	EPhoneHandlerState3			= 3
       
   150      	};
       
   151     	
       
   152     	// stores service state
       
   153     	TPhoneHandlerServiceState iState;
       
   154     	
       
   155     	// pointer to API providing call handling services
       
   156     	CPhCltCommandHandler* iCommandHandler; // owned
       
   157 
       
   158     private:    // Data
       
   159                         
       
   160         // Provides a handle to a dynamically loadable DLL.
       
   161         RLibrary iLibrary;
       
   162          
       
   163         // Client side remote class of phone server session 
       
   164         RPhCltServer iServer; 
       
   165         
       
   166         // active object for asynchronous requests
       
   167         CPhoneHandlerActive* iActive; // owned
       
   168                 
       
   169     public:     // Friend classes
       
   170         
       
   171     protected:  // Friend classes
       
   172         
       
   173     private:    // Friend classes
       
   174     
       
   175     };
       
   176 
       
   177 #endif      // CPHONEHANDLERCALLBASE   
       
   178             
       
   179 // End of File