Change source file permissions to 0644
[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 *bottom_button; //bottom button
69         SttStateVal state;
70         char *kbd_lang;
71         Ecore_Timer *setup_timer;
72         Ecore_Timer *start_timer;
73         Ecore_Timer *refresh_timer;
74         Ecore_Timer *textblock_timer;
75         Ecore_Timer *power_unlock_timer;
76
77         std::vector<std::string> stt_results;
78         char *partial_result;
79         int result_type;
80
81         int disclaimer;
82
83         MoreOption* mo;
84
85         is::stt::SttFeedback *sttfeedback;
86         is::stt::SttManager *sttmanager;
87
88         is::ui::WInputSttMicEffect *ieffect;
89         is::ui::MicEffector *effector;
90 };
91
92 typedef enum _Feedback_Type{
93         FEEDBACK_RECORDING = 0,
94         FEEDBACK_PROCESSING,
95 }Feedback_Type;
96
97
98 void set_animation_state(VoiceData *ud);
99 // STT functions
100 bool _app_stt_initialize(VoiceData *user_data);
101
102
103 #if 0
104 void (*send_processed_string)(char *, int);
105 #endif
106
107 #ifdef __cplusplus
108         }
109 #endif
110
111 #endif /* W_INPUT_STT_ENGINE_H_ */