sl@0: // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0: // All rights reserved.
sl@0: // This component and the accompanying materials are made available
sl@0: // under the terms of "Eclipse Public License v1.0"
sl@0: // which accompanies this distribution, and is available
sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0: //
sl@0: // Initial Contributors:
sl@0: // Nokia Corporation - initial contribution.
sl@0: //
sl@0: // Contributors:
sl@0: //
sl@0: // Description:
sl@0: //
sl@0: 
sl@0: 
sl@0: 
sl@0: /**
sl@0:  @file
sl@0:  @publishedPartner 
sl@0:  @released
sl@0: */
sl@0: 
sl@0: #ifndef TTONEDATA_H
sl@0: #define TTONEDATA_H
sl@0: 
sl@0: #include <e32base.h>
sl@0: 
sl@0: const TInt KMdaInfiniteDurationDTMFToneOnLength = -1;
sl@0: 
sl@0: /*
sl@0:  *  Includes information about tone type, data, length.
sl@0:  *  @lib ttonedata.lib
sl@0:  */
sl@0: class TToneData
sl@0: {
sl@0: public:
sl@0: 
sl@0: enum TToneType
sl@0: 	{
sl@0: 	/* Simple Tone */    
sl@0: 	ESimple = 0,
sl@0: 	/* Dual Tone */
sl@0: 	EDual = 1,
sl@0: 	/* TMF String Tone */
sl@0: 	EDtmfString = 2,
sl@0: 	/* Sequence */
sl@0: 	ESequence = 3,
sl@0: 	/* Fixed Sequence*/
sl@0: 	EFixedSequence = 4 
sl@0: 	};
sl@0: 
sl@0: 
sl@0: 	IMPORT_C TToneData();
sl@0: 
sl@0: 	/*
sl@0: 	 * Sets type of the tone. (Simple, Dual, Sequence etc.)
sl@0: 	 * 
sl@0: 	 * @param aType Type of the tone.
sl@0: 	 */
sl@0: 	IMPORT_C void SetType(TToneType aType);
sl@0: 
sl@0: 	/*
sl@0: 	 * Sets tone duration in micro seconds.
sl@0: 	 * 
sl@0: 	 * @param aDuration Tone duration in microseconds.
sl@0: 	 */
sl@0: 	IMPORT_C void SetDuration(TTimeIntervalMicroSeconds aDuration);
sl@0: 
sl@0: 	/*
sl@0: 	 * Sets tone one freqyency.
sl@0: 	 *
sl@0: 	 * @param aFrequencyOne Frequency of the tone one.
sl@0: 	 */
sl@0: 	IMPORT_C void SetFrequencyOne(TInt aFrequencyOne);
sl@0: 
sl@0: 	/*
sl@0: 	 * Sets tone two freqyency.
sl@0: 	 *
sl@0: 	 * @param aFrequencyOne Frequency of the tone two.
sl@0: 	 */
sl@0: 	IMPORT_C void SetFrequencyTwo(TInt aFrequencyTwo);
sl@0: 
sl@0: 	/*
sl@0: 	 * Sets tone sequence number.
sl@0: 	 *
sl@0: 	 * @param aSequenceNumber Number of the sequence.
sl@0: 	 */
sl@0: 	IMPORT_C void SetSequenceNumber(TInt aSequenceNumber);
sl@0: 
sl@0: 	/*
sl@0: 	 * Sets tone sequence data.
sl@0: 	 *
sl@0: 	 * @param aSequenceData Reference of the sequence data.
sl@0: 	 */
sl@0: 	IMPORT_C void SetSequenceData(TDesC8& aSequenceData);
sl@0: 
sl@0: 	/*
sl@0: 	 * Sets tone repeat count, if count is KMdaRepeatForever, tone will be repeated indefinitely.
sl@0: 	 *
sl@0: 	 * @param aRepeatCount Repeat count of the tone.
sl@0: 	 */
sl@0: 	IMPORT_C void SetRepeatCount(TInt aRepeatCount);
sl@0: 
sl@0: 	/*
sl@0: 	 * Sets tone trailing silence. 
sl@0: 	 * 
sl@0: 	 * @param aRepeatTrailingSilence An interval of silence which will be played after each tone. 
sl@0: 	 */
sl@0: 	IMPORT_C void SetRepeatTrailingSilence(TTimeIntervalMicroSeconds aRepeatTrailingSilence);
sl@0: 
sl@0: 	/*
sl@0: 	 * Defines the duration of tone on, tone off and tone pause to be used during the DTMF tone playback operation.
sl@0: 	 *
sl@0: 	 * @param aToneOnLength The period over which the tone will be played. If this is set to zero, then the tone is not played.
sl@0: 	 * @param aToneOffLength The period over which the no tone will be played.
sl@0: 	 * @param aPauseLength The period over which the tone playing will be paused.
sl@0: 	 */
sl@0: 	IMPORT_C void SetDtmfLengths(TTimeIntervalMicroSeconds32 aToneOnLength, TTimeIntervalMicroSeconds32 aToneOffLength, TTimeIntervalMicroSeconds32 aPauseLength);
sl@0: 
sl@0: 	/*
sl@0: 	 * Sets tone DTMF string.
sl@0: 	 *
sl@0: 	 * @param aDTMFString Reference of the DTMF string.
sl@0: 	 */
sl@0: 	IMPORT_C void SetDTMFString(TDesC& aDTMFString);
sl@0: 
sl@0: 	/*
sl@0: 	 * Gets tone type. (Simple, Dual, Sequence etc.)
sl@0: 	 *
sl@0: 	 * @param aType Type of the tone.
sl@0: 	 */
sl@0: 	IMPORT_C void GetType(TToneType& aType);
sl@0: 	
sl@0: 	/*
sl@0: 	 * Gets tone duration in micro seconds.
sl@0: 	 *
sl@0: 	 * @param aDuration Tone duration in microseconds.
sl@0: 	 */
sl@0: 	IMPORT_C void GetDuration(TTimeIntervalMicroSeconds& aDuration);
sl@0: 
sl@0: 	/*
sl@0: 	 * Gets frequency of the tone one.
sl@0: 	 *
sl@0: 	 * @return Frequency of the tone one.
sl@0: 	 */
sl@0: 	IMPORT_C TInt GetFrequencyOne();
sl@0: 	
sl@0: 	/*
sl@0: 	 * Gets frequency of the tone two.
sl@0: 	 *
sl@0: 	 * @return Frequency of the tone two.
sl@0: 	 */
sl@0: 	IMPORT_C TInt GetFrequencyTwo();
sl@0: 	
sl@0: 	/*
sl@0: 	 * Gets sequence number.
sl@0: 	 *
sl@0: 	 * @return Sequence number.
sl@0: 	 */
sl@0: 	IMPORT_C TInt GetSequenceNumber();
sl@0: 		  
sl@0: 	/*
sl@0: 	 * Gets sequence data of the tone.
sl@0: 	 * Client should not delete this pointer.
sl@0: 	 *
sl@0: 	 * @return Pointer to tone sequence data.
sl@0: 	 */
sl@0: 	IMPORT_C TDesC8* GetSequenceData();
sl@0: 			
sl@0: 	/*
sl@0: 	 * Gets tone repeat count.
sl@0: 	 *
sl@0: 	 * @return Repeat count.
sl@0: 	 */
sl@0: 	IMPORT_C TInt GetRepeatCount();
sl@0: 	
sl@0: 	/*
sl@0: 	 * Gets tone trailing silence duration.
sl@0: 	 *
sl@0: 	 * @param aRepeatTrailingSilence Trailing silence duration.
sl@0: 	 */
sl@0: 	IMPORT_C void GetRepeatTrailingSilence(TTimeIntervalMicroSeconds& aRepeatTrailingSilence);
sl@0: 			   
sl@0: 	/*
sl@0: 	 * Gets tone DTMF lengts duration.
sl@0: 	 *
sl@0: 	 * @param aToneOnLength The period over which the tone will be played.
sl@0: 	 * @param aToneOffLength The period over which the no tone will be played.
sl@0: 	 * @param aPauseLength The period over which the tone playing will be paused.
sl@0: 	 */
sl@0: 	IMPORT_C void GetDtmfLenghts(TTimeIntervalMicroSeconds32& aToneOnLength, TTimeIntervalMicroSeconds32& aToneOffLength, TTimeIntervalMicroSeconds32& aPauseLength);
sl@0: 
sl@0: 	/*
sl@0: 	 * Gets DTMF string of the tone.
sl@0: 	 * Client should not delete this pointer
sl@0: 	 *
sl@0: 	 * @return Pointer to tone DTMF string.
sl@0: 	 */
sl@0: 	IMPORT_C TDesC* GetDTMFString();
sl@0: 
sl@0: 	private: // data
sl@0: 
sl@0: 
sl@0: 	/* Type of the tone. */
sl@0: 
sl@0: 	TToneType iType;
sl@0: 
sl@0: 	
sl@0: 	/* Duration of the tone. */
sl@0: 	 
sl@0: 	TTimeIntervalMicroSeconds iDuration;
sl@0: 
sl@0: 	
sl@0: 	/* Frequency of the tone one. */
sl@0: 	 
sl@0: 	TInt iFrequencyOne;
sl@0: 
sl@0: 	
sl@0: 	/* Frequency of the tone two. */
sl@0: 	 
sl@0: 	TInt iFrequencyTwo;
sl@0: 
sl@0: 	
sl@0: 	/* Sequence number of the tone. */
sl@0: 	 
sl@0: 	TInt iSequenceNumber;
sl@0: 
sl@0: 	
sl@0: 	/* Repeat count of the tone. */
sl@0: 	 
sl@0: 	TInt iRepeatCount;
sl@0: 
sl@0: 	
sl@0: 	/* Repeat traingling silence of the tone. */
sl@0: 	 
sl@0: 	TTimeIntervalMicroSeconds iRepeatTrainglingSilence;
sl@0: 
sl@0: 	
sl@0: 	/* The period over which the tone will be played. */
sl@0: 	 
sl@0: 	TTimeIntervalMicroSeconds32 iToneOnLength;
sl@0: 
sl@0: 	
sl@0: 	/* The period over which the no tone will be played. */
sl@0: 	 
sl@0: 	TTimeIntervalMicroSeconds32 iToneOffLength;
sl@0: 
sl@0: 	
sl@0: 	/* The period over which the tone playing will be paused. */
sl@0: 	 
sl@0: 	TTimeIntervalMicroSeconds32 iPauseLength;
sl@0: 
sl@0: 	
sl@0: 	/* Pointer to data of the tone sequence.
sl@0: 	 * Not own.
sl@0: 	 */
sl@0: 	 
sl@0: 	TDesC8 *iSequenceData;
sl@0: 
sl@0: 	
sl@0: 	/* Pointer to string of the DTMF tone.
sl@0: 	 * Not own.
sl@0: 	 */
sl@0: 	 
sl@0: 	TDesC *iDTMFString;
sl@0: 	};
sl@0: 
sl@0: #endif // TTONEDATA_H