telephonyserverplugins/simtsy/inc/CSimDtmf.h
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Contains definitions for classes that implement signal strength functionality.
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalAll
       
    21 */
       
    22 
       
    23 #ifndef CSimDtmf_H__
       
    24 #define CSimDtmf_H__
       
    25 
       
    26 #include <et_phone.h>
       
    27 #include "csimtimer.h"
       
    28 
       
    29 class CSimPhone;
       
    30 class CTestConfigSection;
       
    31 
       
    32 /**
       
    33  * Implements the RMobilePhone based functions that constitute the signal strength
       
    34  * functionality provided by the SIM TSY.
       
    35  */
       
    36 class CSimDtmf : public CBase, MTimerCallBack
       
    37 	{
       
    38 public:
       
    39 	static CSimDtmf* NewL(CSimPhone* aPhone);
       
    40 	CSimDtmf(CSimPhone* aPhone);
       
    41 	~CSimDtmf();
       
    42 	TInt GetDtmfCaps(TTsyReqHandle aReqHandle,TDes8* aPckg1);
       
    43 	TInt NotifyDtmfCapsChange(TTsyReqHandle aReqHandle,TDes8* aPckg1);
       
    44 	void NotifyDtmfCapsChangeCancel(TTsyReqHandle aReqHandle);
       
    45 	TInt SendDTMFTones(TTsyReqHandle aReqHandle,TDes* aPckg1);
       
    46 	TInt StartDTMFTone(TTsyReqHandle aReqHandle,TDes8* aPckg1);
       
    47 	TInt StopDTMFTone(TTsyReqHandle aReqHandle);
       
    48 	TInt NotifyStopInDTMFString(TTsyReqHandle aReqHandle);
       
    49 	void NotifyStopInDTMFStringCancel();
       
    50 	TInt ContinueDtmfStringSending(TTsyReqHandle aReqHandle,TDes8* aPckg1);
       
    51 	void SendDTMFTonesCancel();
       
    52 	void CallClosureCallback();
       
    53 	const CTestConfigSection* CfgFile();
       
    54 
       
    55 private:
       
    56 	void ConstructL();
       
    57 	enum TEvent
       
    58 		{
       
    59 		EEventStartDtmfString,
       
    60 		EEventStartDtmfTone,
       
    61 		EEventTimer,
       
    62 		EEventStopDtmfTone,
       
    63 		EEventContinueDtmf,
       
    64 		EEventTerminateDtmf,
       
    65 		EEventCallClosure
       
    66 		};
       
    67 	TInt ActionEvent(TEvent aEvent);
       
    68  	TInt ActionEvent(TEvent aEvent,const TChar& aTone);
       
    69  	TInt ProcessTone(const TChar& aTone,TBool aStartTimer);
       
    70 
       
    71 	void CompleteDtmfStringTx(TInt aStatus);
       
    72 	void CheckNotification();
       
    73 	TInt SetDtmfCall();
       
    74 	TBool CheckForActiveVoiceCall();
       
    75 	void TimerCallBack(TInt aId);
       
    76 
       
    77 private:
       
    78 	CSimPhone* iPhone;		//< Pointer to the parent phone class.
       
    79 	CSimTimer* iTimer;		//< Pointer to the owned timer class.
       
    80 	HBufC* iDtmfData;		//< Pointer to buffer holding string of DTMF characters.
       
    81 
       
    82 	TBool iNotifyStopChar;				//< Flag indicating that a DTMF Stop Notification is outstanding.
       
    83 	TTsyReqHandle iNotifyStopReqHandle;	//< The request handle associated with an outstanding DTMF Stop Notification.
       
    84 	enum TState
       
    85 		{
       
    86 		EIdle,
       
    87 		ETxTone,
       
    88 		EStopped
       
    89 		};
       
    90 	TState iState;						//< DTMF Tx engine state.
       
    91 	TBool iDtmfString;					//< Flag indicating that a DTMF string tx is ongoing.
       
    92 	TTsyReqHandle iDtmfStringReqPending;//< The request handle associated with an ongoing DTMF string transmission.
       
    93 	TInt iDtmfStringIndex;				//< The index of the next DTMF character to be processed when tx'ing a DTMF string.
       
    94 	};
       
    95 
       
    96 #endif