3b93185c7e143a903c7d8aff07728cadb693ab84
[platform/framework/native/uifw.git] / src / ui / inc / FUi_AccessibilityTtsPlayer.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://floralicense.org/license/
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @fileFUi_AccessibilityTtsPlayer.h
20  * @brief This is the header file for the _AccessibilityTtsPlayer class.
21  *
22  * This header file contains the declarations of the _AccessibilityTtsPlayer class.
23  *
24  */
25 #ifndef _FUI_INTERNAL_ACCESSIBILITY_TTS_PLAYER_H_
26 #define _FUI_INTERNAL_ACCESSIBILITY_TTS_PLAYER_H_
27
28 #include <FBaseResult.h>
29 #include <FUixSpeechTextToSpeechTypes.h>
30 #include <FUixSpeechITextToSpeechEventListener.h>
31 #include <FUiAccessibilityTypes.h>
32 #include <FUi_AccessibilityManager.h>
33
34 namespace Tizen { namespace Base
35 {
36 class String;
37 }} //namespace Tizen::Base
38
39 namespace Tizen { namespace Locales
40 {
41 class Locale;
42 }} //namespace Tizen::Locales
43
44 namespace Tizen { namespace Uix { namespace Speech
45 {
46 class TextToSpeech;
47 }}} //Tizen::Uix::Speech
48
49 namespace Tizen { namespace Ui
50 {
51 class _AccessibilityManager;
52
53 class _AccessibilityTtsPlayer
54         :public Tizen::Uix::Speech::ITextToSpeechEventListener
55 {
56 public:
57         virtual ~_AccessibilityTtsPlayer(void);
58         result ReadGrammar(const Tizen::Base::String& grammar, bool bInit = true);
59         result StopReading(void);
60
61         AccessibilityScreenReaderStatus GetStatus(void);
62         Tizen::Base::String GetCurrentGrammar(void);
63         void SetMode(_AccessibilityTtsMode mode);
64         void ApplyLocale(void);
65         void SetLocale(const Tizen::Base::String& localeString);
66 private:
67         _AccessibilityTtsPlayer(_AccessibilityManager& manager);
68         result Activate(void);
69         result Deactivate(void);
70
71         virtual void OnTextToSpeechInitialized(void);
72         virtual void OnTextToSpeechErrorOccurred (Tizen::Uix::Speech::TextToSpeechError error);
73         virtual void OnTextToSpeechStatusChanged (Tizen::Uix::Speech::TextToSpeechStatus status);
74         virtual void OnTextToSpeechCompleted(void);
75         void SetStatus(AccessibilityScreenReaderStatus status);
76         Tizen::Locales::Locale GetCurrentLocale(void);
77         
78 private:
79         _AccessibilityTtsPlayer(const _AccessibilityTtsPlayer& rhs);
80         _AccessibilityTtsPlayer& operator =(const _AccessibilityTtsPlayer& rhs);
81
82 private:
83         void* __handle;
84         Tizen::Uix::Speech::TextToSpeech* __pTts;
85         Tizen::Base::String __grammar;
86         Tizen::Base::String __localeString;
87         AccessibilityScreenReaderStatus __status;
88         Tizen::Uix::Speech::TextToSpeechRequestMode __ttsRequestMode;
89         _AccessibilityManager* __pManager;
90         friend class _AccessibilityManager;
91 }; //class _AccessibilityTtsPlayer
92 }} //Tizen::Ui
93
94 #endif //_FUI_INTERNAL_ACCESSIBILITY_TTS_PLAYER_H_
95