0cf85e1bfce8ff882f7a285a9de4fd583e961703
[platform/core/uifw/inputdelegator.git] / inc / w-input-stt-engine.h
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17
18 #ifndef W_INPUT_STT_ENGINE_H_
19 #define W_INPUT_STT_ENGINE_H_
20
21 #include <gmodule.h>
22 #include <vector>
23
24 #include "SttFeedback.h"
25 #include "SttManager.h"
26 #include "MoreOption.h"
27 #include "MicEffector.h"
28 #include "WInputSttMicEffect.h"
29
30 #ifdef __cplusplus
31 extern "C"{
32 #endif
33
34 #include <stt.h>
35
36
37 typedef enum _SttStateVal {
38         STT_STATE_VAL_INIT = 0,
39         STT_STATE_VAL_PREPARE_LISTENING,
40         STT_STATE_VAL_LISTENING,
41         STT_STATE_VAL_PREPARE_PROCESSING,
42         STT_STATE_VAL_PROCESSING,
43         STT_STATE_VAL_PREPARE_CANCEL,
44         STT_STATE_VAL_NOT_RECOGNISED,
45         STT_STATE_VAL_TERMINATING,
46         STT_STATE_VAL_MAX
47 } SttStateVal;
48
49 typedef struct _VoiceDimension VoiceDimension;
50 typedef struct _VoiceData VoiceData;
51
52 struct _VoiceDimension {
53         int x; // X position of voice area
54         int y; // Y position of voice area
55         int width; // Width of voice area
56         int height; // Height of voice area
57 };
58
59 struct _VoiceData
60 {
61         int voicefw_state; //0 means init failed else success
62         stt_h voicefw_handle; //Wonyoung Lee added
63         Evas_Object *naviframe; //main window
64         Evas_Object *layout_main; //layout
65         Evas_Object *progressbar; //progressbar
66         Evas_Object *scroller; //scroller
67         Evas_Object *main_entry; //entry
68         Evas_Object *mic_button; //MIC button
69         SttStateVal state;
70         char *kbd_lang;
71         Ecore_Timer *start_timer;
72         Ecore_Timer *refresh_timer;
73         Ecore_Timer *progressbar_timer;
74         Ecore_Timer *textblock_timer;
75         Ecore_Timer *guide_text_timer;
76         Ecore_Timer *btn_disabling_timer;
77         Ecore_Timer *power_unlock_timer;
78
79         std::vector<std::string> stt_results;
80         char *partial_result;
81         int result_type;
82
83         int disclaimer;
84
85         MoreOption* mo;
86
87         is::stt::SttFeedback *sttfeedback;
88         is::stt::SttManager *sttmanager;
89
90         is::ui::WInputSttMicEffect *ieffect;
91         is::ui::MicEffector *effector;
92 };
93
94 typedef enum _Feedback_Type{
95         FEEDBACK_RECORDING = 0,
96         FEEDBACK_PROCESSING,
97 }Feedback_Type;
98
99
100 void set_animation_state(VoiceData *ud);
101 // STT functions
102 bool _app_stt_initialize(VoiceData *user_data);
103
104
105 #if 0
106 void (*send_processed_string)(char *, int);
107 #endif
108
109 #ifdef __cplusplus
110         }
111 #endif
112
113 #endif /* W_INPUT_STT_ENGINE_H_ */