callcontinuity/vcc/inc/cvccdtmfprovider.h
branchRCL_3
changeset 22 d38647835c2e
parent 0 a4daefaec16c
equal deleted inserted replaced
21:f742655b05bf 22:d38647835c2e
       
     1 /*
       
     2 * Copyright (c) 2008 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:   Sends and receives DTMF tones
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CVCCDTMFPROVIDER_H
       
    21 #define CVCCDTMFPROVIDER_H
       
    22 
       
    23 
       
    24 #include <mccpdtmfprovider.h>
       
    25 #include <mccpdtmfobserver.h>
       
    26 
       
    27 class CConvergedCallProvider;
       
    28 class CVccDirector;
       
    29 
       
    30 /**
       
    31  *  DTMF provider.
       
    32  *  Contains DTMF providers from call providers and forward all requests between
       
    33  *  them and CCE
       
    34  *
       
    35  *  @lib vccperformer.lib
       
    36  *  @since S60 v3.2
       
    37  */
       
    38 NONSHARABLE_CLASS( CVccDtmfProvider ) : public MCCPDTMFProvider,
       
    39 						                public MCCPDTMFObserver
       
    40     {
       
    41 
       
    42 public:
       
    43 
       
    44     /**
       
    45 	 * Two-phased constructor.
       
    46      * @param aProviders Service providers
       
    47      * @param aObserver
       
    48      * @param aDirector Reference to Director object 
       
    49 	 */
       
    50 	static CVccDtmfProvider* NewL(
       
    51 	        RPointerArray<CConvergedCallProvider>& aProviders, 
       
    52 	        const MCCPDTMFObserver& aObserver,
       
    53 	        CVccDirector& aDirector );
       
    54     
       
    55     /**
       
    56     * Destructor.
       
    57     */
       
    58     virtual ~CVccDtmfProvider(); 
       
    59 
       
    60   // From MCCPDTMFObserver
       
    61 
       
    62  	/**
       
    63 	* HandleDTMFEvents.
       
    64 	* @since S60 3.2
       
    65 	* @param aEvent Event type
       
    66 	* @param aError Error code
       
    67 	* @param aTone Character
       
    68 	*/
       
    69 	void HandleDTMFEvent( const MCCPDTMFObserver::TCCPDtmfEvent aEvent,
       
    70 	                               const TInt aError,
       
    71 	                               const TChar aTone ) const;
       
    72 	                               
       
    73 	// From MCCPDTMFProvider
       
    74 
       
    75 	/**
       
    76  	* Cancels asynchronous DTMF string sending.
       
    77  	* @return KErrNone request was started successfully
       
    78  	* @return KErrNotFound nothing found to cancel.
       
    79  	* @since Series 60 3.2
       
    80  	*/
       
    81  	TInt CancelDtmfStringSending();
       
    82 
       
    83  	/**
       
    84  	* Starts the transmission of a single DTMF tone across a connected and active call.
       
    85  	* @since S60 3.2
       
    86  	* @param aTone tone to be played.
       
    87  	* @return KErrNone request was started successfully
       
    88  	* @return KErrArgument if the specified tone contains illegal dtmf character
       
    89  	* @return in case of an error system wide error code
       
    90  	*/
       
    91  	TInt StartDtmfTone( const TChar aTone );
       
    92 
       
    93  	/**
       
    94  	* Stops playing current DTMF tone.
       
    95  	* @since S60 3.2
       
    96  	* @return KErrNone request was started successfully
       
    97     * @return KErrNotReady not ready to perform the requested action.
       
    98  	*/
       
    99  	TInt StopDtmfTone();
       
   100 
       
   101  	/**
       
   102  	* Plays DTMF string.
       
   103  	* @since S60 3.2
       
   104  	* @param aString String to be played.
       
   105  	* @return KErrNone request was started successfully
       
   106  	* @return KErrArgument if the specified string contains illegal dtmf characters
       
   107  	*/
       
   108  	TInt SendDtmfToneString( const TDesC& aString );
       
   109 
       
   110  	/**
       
   111  	* Continue or cancel sending DTMF string which was stopped with 'w'-character
       
   112  	* in string.
       
   113  	* @since S60 3.2
       
   114  	* @param aContinue ETrue if sending of the DTMF string should continue,
       
   115  	* EFalse if the rest of the DTMF string is to be discarded.
       
   116  	* @return KErrNone request was started successfully
       
   117  	* @return KErrNotFound no send existed which to continue
       
   118  	*/
       
   119  	TInt ContinueDtmfStringSending( const TBool aContinue );
       
   120  	
       
   121 	/**
       
   122 	* Add an observer for DTMF related events.
       
   123 	* Currently CCE will set only one observer.
       
   124 	* @since S60 v3.2
       
   125 	* @param aObserver Observer to add.
       
   126 	* @leave system error if observer adding fails
       
   127 	*/
       
   128 	void AddObserverL( const MCCPDTMFObserver& aObserver );
       
   129 	
       
   130 	/**
       
   131 	* Remove an observer.
       
   132 	* @since S60 v3.2
       
   133 	* @param aObserver Observer to remove.
       
   134 	* @return KErrNone if removed succesfully. 
       
   135 	* @return KErrNotFound if observer was not found.
       
   136 	*/
       
   137 	TInt RemoveObserver( const MCCPDTMFObserver& aObserver );
       
   138 	
       
   139 private:
       
   140 
       
   141     /** 
       
   142      * C++ constructor
       
   143      * @param aObserver Reference to DTMF observer
       
   144      * @param aDirector Reference to Director
       
   145      */
       
   146     CVccDtmfProvider( const MCCPDTMFObserver& aObserver, CVccDirector& aDirector );
       
   147 
       
   148     /** 
       
   149      * Symbian second-phase constructor
       
   150      */
       
   151     void ConstructL();
       
   152 
       
   153 private: // data
       
   154 
       
   155 	/**
       
   156 	* DTMF event observers.
       
   157 	* Own.
       
   158 	*/
       
   159 	RPointerArray<MCCPDTMFObserver> iObservers;
       
   160 	
       
   161 	/**
       
   162 	* DTMF providers.
       
   163 	* Own
       
   164 	*/
       
   165 	RPointerArray<MCCPDTMFProvider> iProviders;
       
   166 	
       
   167 	/**
       
   168 	 * VCC director
       
   169 	 * Not own.
       
   170 	 */
       
   171 	CVccDirector* iDirector;
       
   172 	
       
   173     friend class T_CVccDTMFProvider;
       
   174     };
       
   175 
       
   176 #endif // CVCCDTMFPROVIDER_H