aac4fc8882fb8fa2a345b9ac89ca16e0cb035f8d
[platform/core/uifw/voice-control.git] / server / vcd_engine_agent.h
1 /*
2 * Copyright (c) 2011-2015 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 __VCD_ENGINE_AGENT_H_
19 #define __VCD_ENGINE_AGENT_H_
20
21 #include "vcd_main.h"
22 #include "voice_control_plugin_engine.h"
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 /*
29 * Constants & Structures
30 */
31
32 #define ENGINE_PATH_SIZE 256
33
34 typedef void (*result_callback)(vcp_result_event_e event, int* result_id, int count, const char* all_result,
35                                                                 const char* non_fixed_result, const char* nlu_result, const char* msg, int* user_info, void *user_data);
36
37 typedef void (*asr_result_callback)(vcp_asr_result_event_e event, const char* asr_result, void *user_data);
38
39 typedef void (*nlg_result_callback)(const char* nlg_result, void *user_data);
40
41 #if 0
42 typedef void (*pre_result_callback)(vcp_pre_result_event_e event, const char* pre_result, void *user_data);
43
44 typedef void (*nlu_result_callback)(vcp_result_event_e event, const char* nlu_result, void *user_data);
45 #endif
46
47 typedef void (*error_callback)(vcp_error_e error, const char* msg, void *user_data);
48
49 typedef void (*silence_dectection_callback)(void *user_data);
50
51
52
53 /** Init engine agent */
54 //int vcd_engine_agent_init(pre_result_callback pre_result_cb, result_callback result_cb, nlu_result_callback nlu_result_cb, error_callback error_cb);
55 int vcd_engine_agent_init(asr_result_callback asr_result_cb, result_callback result_cb, nlg_result_callback nlg_result_cb, error_callback error_cb);
56
57 /** Release engine agent */
58 int vcd_engine_agent_release();
59
60 bool vcd_engine_is_available_engine();
61
62 /** Set current engine */
63 int vcd_engine_agent_initialize_current_engine();
64
65 /** load current engine */
66 int vcd_engine_agent_load_current_engine();
67
68 /** Unload current engine */
69 int vcd_engine_agent_unload_current_engine();
70
71 /** test for language list */
72 int vcd_print_enginelist();
73
74
75 int vcd_engine_get_audio_format(const char* audio_id, vcp_audio_type_e* types, int* rate, int* channels);
76
77 int vcd_engine_supported_langs(GList** lang_list);
78
79 int vcd_engine_get_current_language(char** lang);
80
81 int vcd_engine_set_current_language(const char* language);
82
83 int vcd_engine_set_commands();
84
85 /* normal recognition */
86 int vcd_engine_recognize_start(bool silence);
87
88 int vcd_engine_recognize_audio(const void* data, unsigned int length, vcp_speech_detect_e* speech_detected);
89
90 int vcd_engine_recognize_stop();
91
92 int vcd_engine_recognize_cancel();
93
94 int vcd_engine_set_audio_type(const char* audio);
95
96 int vcd_engine_set_domain(int pid, const char* domain);
97
98 int vcd_engine_get_nlu_base_info(int pid, const char* key, char** value);
99
100 // int vcd_engine_set_private_data(const char* data);
101 int vcd_engine_set_private_data(int pid, const char* key, const char* data);
102
103 // int vcd_engine_get_private_data(char** data);
104 int vcd_engine_get_private_data(int pid, const char* key, char** data);
105
106 int vcd_engine_process_text(int pid, const char* text);
107
108 int vcd_engine_process_list_event(int pid, const char* event);
109
110 int vcd_engine_process_haptic_event(int pid, const char* event);
111
112
113 #ifdef __cplusplus
114 }
115 #endif
116
117 #endif /* __VCD_ENGINE_AGENT_H_ */
118
119