diff -r 000000000000 -r bf1d17376201 srsf/speechsynthesis/tsrc/texttospeech/inc/texttospeechengine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/srsf/speechsynthesis/tsrc/texttospeech/inc/texttospeechengine.h Thu Dec 17 08:46:30 2009 +0200 @@ -0,0 +1,96 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef TEXTTOSPEECHENGINE_H +#define TEXTTOSPEECHENGINE_H + +// INCLUDES + +#include +#include + +/** +* Application engine +*/ +class CTextToSpeechEngine : public CActive + { + public: // Constructors and destructor + + static CTextToSpeechEngine* NewL(); + + virtual ~CTextToSpeechEngine(); + + void InitAndPlayText( const TDesC& aText ); + void InitAndPlayTextToFile( const TDesC& aText, + const TFileName& aFileName ); + + void Play( ); + void PauseL(); + void StopL(); + + TInt VolumeL(); + void SetVolumeL( TInt aVolume ); + TInt MaxVolumeL(); + + TInt SpeakingRateL(); + void SetSpeakingRateL( TInt aRate ); + TInt MaxSpeakingRateL(); + + TVoice VoiceL(); + void SetVoiceL( const TVoice& aVoice ); + void GetLanguagesL( RArray& aLanguages ); + void GetVoicesL( RArray& aVoices, TLanguage aLanguage ); + + protected: // From CActive + + /** + * CActive::RunL + */ + void RunL(); + + /** + * CActive::DoCancel() + */ + void DoCancel(); + + private: + + CTextToSpeechEngine(); + + void ConstructL(); + + private: // Data + + enum TState + { + EIdle, + EPriming, + ESpeaking + }; + + RSpeechSynthesis iServer; + + TState iState; + + TFileName iFileName; + + }; + +#endif + +// End of File