Tizen 2.1 base
[apps/native/sample/SpeechApp.git] / project / inc / SpeechAppTtsForm.h
1 //
2 // Tizen C++ SDK
3 // Copyright (c) 2012 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://www.tizenopensource.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 #ifndef _SPEECH_APP_TTS_FORM_H_
19 #define _SPEECH_APP_TTS_FORM_H_
20
21 #include <FBase.h>
22 #include <FUi.h>
23 #include <FUix.h>
24
25 class SpeechAppTtsForm
26         : public Tizen::Ui::Controls::Form
27         , public Tizen::Ui::IActionEventListener
28         , public Tizen::Ui::Controls::IFormBackEventListener
29         , public Tizen::Ui::Scenes::ISceneEventListener
30         , public Tizen::Uix::Speech::ITextToSpeechEventListener
31 {
32
33 public:
34         SpeechAppTtsForm(void);
35         virtual ~SpeechAppTtsForm(void);
36         bool Initialize();
37         result OnInitializing(void);
38         result OnTerminating(void);
39
40         void ShowMsgBox(void);
41
42         virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
43         virtual void OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs);
44         virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);
45
46         virtual void OnTextToSpeechInitialized(void);
47         virtual void OnTextToSpeechStatusChanged(Tizen::Uix::Speech::TextToSpeechStatus status);
48         virtual void OnTextToSpeechErrorOccurred(Tizen::Uix::Speech::TextToSpeechError error);
49         virtual void OnTextToSpeechCompleted(void);
50
51         virtual void OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs);
52         virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId);
53
54 protected:
55         static const int ID_BUTTON_SPEAK = 101;
56         static const int ID_BUTTON_PAUSE = 102;
57         static const int ID_BUTTON_RESUME = 103;
58         static const int ID_BUTTON_STOP = 104;
59         static const int ID_BUTTON_APPEND_MODE_CHECKED = 105;
60         static const int ID_BUTTON_APPEND_MODE_UNCHECKED = 106;
61         static const RequestId REQUEST_ID_EXIT = 1001;
62
63 private:
64         Tizen::Uix::Speech::TextToSpeech* __pTts;
65         Tizen::Uix::Speech::TextToSpeechRequestMode __requestMode;
66         Tizen::Locales::Locale __sttLocale;
67
68         Tizen::Ui::Controls::Button* __pButtonSpeak;
69         Tizen::Ui::Controls::Button* __pButtonPause;
70         Tizen::Ui::Controls::Button* __pButtonResume;
71         Tizen::Ui::Controls::Button* __pButtonStop;
72 };
73
74 #endif