phoneengine/audiohandling/inc/cpegsmaudiodata.h
changeset 37 ba76fc04e6c2
child 51 f39ed5e045e0
equal deleted inserted replaced
36:2eacb6118286 37:ba76fc04e6c2
       
     1 /*
       
     2 * Copyright (c) 2002-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:  This file contains the header file of the class CPEGsmAudioDatar, 
       
    15 *                which is an GSM specific interface class to audio properties of the system
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef CPEGSMAUDIODATA_H
       
    21 #define CPEGSMAUDIODATA_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include "cpeaudiodata.h"
       
    25 #include <pevirtualengine.h>
       
    26 #include <e32base.h>
       
    27 #include <mccedtmfobserver.h>
       
    28 
       
    29 // CONSTANTS
       
    30 // None.
       
    31 
       
    32 // MACROS
       
    33 // None.
       
    34 
       
    35 
       
    36 // DATA TYPES
       
    37 // None.
       
    38 
       
    39 
       
    40 // FUNCTION PROTOTYPES
       
    41 // None.
       
    42 
       
    43 
       
    44 // FORWARD DECLARATIONS
       
    45 class CPEAudioInbandTonePlayer;
       
    46 class CPEAudioFactory;
       
    47 class MPEClientInformation;
       
    48 
       
    49 // CLASS DECLARATION
       
    50 
       
    51 /**
       
    52 *  This file contains the header file of the class CPEGsmAudioData, 
       
    53 *
       
    54 *  @lib Audiohandling.lib
       
    55 *  @since Series60_2.7
       
    56 */
       
    57 class CPEGsmAudioData : public CPEAudioData,
       
    58                         public MCCEDtmfObserver
       
    59     {
       
    60     public:  // Constructors and destructor
       
    61 
       
    62         /**
       
    63         * Two-phased constructor.
       
    64         */
       
    65         IMPORT_C static CPEGsmAudioData* NewL( MPEPhoneModelInternal& aPhoneModel,
       
    66                                                RFs& aFsSession );                                  
       
    67            
       
    68                                                
       
    69         /**
       
    70         * Two-phased constructor for testing purposes
       
    71         */        
       
    72         IMPORT_C static CPEGsmAudioData* NewL( MPEPhoneModelInternal& aPhoneModel,
       
    73                                                RFs& aFsSession,
       
    74                                                CPEAudioFactory& aAudioFactory );                          
       
    75         
       
    76         /**
       
    77         * Destructor.
       
    78         */
       
    79         IMPORT_C virtual ~CPEGsmAudioData();
       
    80         
       
    81     public: // From MCCEDtmfObserver
       
    82                                        
       
    83         /**
       
    84         * All the occurred DTMF events are notified through this interface
       
    85         *
       
    86         * @since S60 3.2
       
    87         * @param aEvent Event code
       
    88         * @param aError Error code
       
    89         * @param aTone tone 
       
    90         * @return none
       
    91         */
       
    92         IMPORT_C void HandleDTMFEvent( const MCCEDtmfObserver::TCCEDtmfEvent aEvent, 
       
    93                                        const TInt aError, 
       
    94                                        const TChar aTone );
       
    95 
       
    96     public: // New functions
       
    97 
       
    98         /**
       
    99         * Plays the given dtmf tone
       
   100         * @since Series60_2.7
       
   101         * @param  aTone, dtmf tone to be played
       
   102         * @param  aVolume, dtmf tones volume
       
   103         * @return None.  
       
   104         */
       
   105         IMPORT_C void PlayDtmfTone( const TChar& aTone ) const; 
       
   106 
       
   107         /**
       
   108         * Stops the playing of dtmf tone
       
   109         * @since Series60_2.7
       
   110         * @param  None.
       
   111         * @return None.  
       
   112         */
       
   113         IMPORT_C void StopDtmfTonePlay(); 
       
   114 
       
   115         /**
       
   116         * Plays given tone.
       
   117         * @since Series60_2.7
       
   118         * @param aToneName Tone sequence's name to be played.
       
   119         * @return None.
       
   120         */
       
   121         IMPORT_C void PlayInbandTone();
       
   122 
       
   123         /**
       
   124         * Stops the playing of inband tone
       
   125         * @since Series60_2.7
       
   126         * @param  None.
       
   127         * @return None.  
       
   128         */
       
   129         IMPORT_C void StopInbandTonePlay(); 
       
   130 
       
   131     protected:  // From CPEAudioData
       
   132         
       
   133         void DoHandleVolumeChange( TInt aVolume, TBool aSendMsg=EFalse );
       
   134     
       
   135     private:
       
   136         /**
       
   137         * C++ default constructor.
       
   138         */
       
   139         CPEGsmAudioData( MPEPhoneModelInternal& aPhoneModel,
       
   140                          RFs& aFsSession );
       
   141 
       
   142         /**
       
   143         * By default Symbian 2nd phase constructor is private.
       
   144         */
       
   145         void ConstructL(CPEAudioFactory& aAudioFactory);
       
   146 
       
   147         /**
       
   148         * Checks if a DTMF tone may be played locally
       
   149         * The check is performed to prevent local play of dtmf tones sent by SAT application
       
   150         * during a SAT originated call
       
   151         *
       
   152         * @return ETrue: local play is allowed,
       
   153         *         EFalse: local play is not allowed
       
   154         */
       
   155         TBool DtmfLocalPlayAllowed() const;
       
   156 
       
   157     private:    //Data
       
   158     
       
   159         // CPEAudioDtmfTonePlayer is called to play the dtmf tones
       
   160         CPEAudioDtmfTonePlayer* iDtmfTonePlayer;
       
   161         // CPEAudioInbandTonePlayer is called to play the inband tones
       
   162         CPEAudioInbandTonePlayer* iInbandTonePlayer;
       
   163         // handle to a file server session
       
   164         RFs& iFsSession;
       
   165 
       
   166     };
       
   167 
       
   168 #endif      //CPEGSMAUDIODATA_H  
       
   169             
       
   170 // End of File