diff -r cad71a31b7fc -r e36f3802f733 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 Wed Sep 01 12:29:17 2010 +0100 @@ -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