Deallocate memory before setting new value
[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
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 /*
28 * Constants & Structures
29 */
30
31 #define ENGINE_PATH_SIZE 256
32
33 /** Init engine agent */
34 int vcd_engine_agent_init();
35
36 /** Release engine agent */
37 int vcd_engine_agent_release();
38
39 bool vcd_engine_is_available_engine();
40
41 /** load current engine */
42 int vcd_engine_agent_load_current_engine(vce_request_callback_s* callback);
43
44 /** Unload current engine */
45 int vcd_engine_agent_unload_current_engine();
46
47
48 int vcd_engine_get_audio_format(const char* audio_id, vce_audio_type_e* types, int* rate, int* channels);
49
50 int vcd_engine_supported_langs(GList** lang_list);
51
52 int vcd_engine_get_current_language(char** lang);
53
54 int vcd_engine_set_current_language(const char* language);
55
56 int vcd_engine_set_commands();
57
58 /* normal recognition */
59 int vcd_engine_recognize_start(bool silence);
60
61 int vcd_engine_recognize_audio(const void* data, unsigned int length, vce_speech_detect_e* speech_detected);
62
63 int vcd_engine_recognize_stop();
64
65 int vcd_engine_recognize_cancel();
66
67 int vcd_engine_set_audio_type(const char* audio);
68
69 int vcd_engine_set_server_dialog(const char* app_id, const char* credential);
70
71 int vcd_engine_set_domain(int pid, const char* domain);
72
73 int vcd_engine_get_nlu_base_info(int pid, const char* key, char** value);
74
75 int vcd_engine_set_private_data(int pid, const char* key, const char* data);
76
77 int vcd_engine_get_private_data(int pid, const char* key, char** data);
78
79 int vcd_engine_send_specific_engine_request(const char* engine_app_id, const char* event, const char* request);
80
81 int vcd_engine_process_text(int pid, const char* text);
82
83 int vcd_engine_process_list_event(int pid, const char* event);
84
85 int vcd_engine_process_haptic_event(int pid, const char* event);
86
87 int vcd_engine_request_tts(int pid, int utt_id, const char* text, const char* language);
88
89 int vcd_engine_cancel_tts(int pid, int utt_id);
90
91 int vcd_engine_get_tts_audio_format(int* rate, int* channel, int* audio_type);
92
93
94 /* for engine service */
95 int vcd_engine_agent_get_foreach_command(vce_cmd_h vce_command, vce_command_cb callback, void* user_data);
96
97 int vcd_engine_agent_get_command_count(vce_cmd_h vce_command, int* count);
98
99 int vcd_engine_agent_get_audio_type(char** audio_type);
100
101 int vcd_engine_agent_set_private_data(const char* key, const char* data);
102
103 int vcd_engine_agent_get_private_data(const char* key, char** data);
104
105 int vcd_engine_agent_start_recording();
106
107 int vcd_engine_agent_stop_recording();
108
109 int vcd_engine_agent_set_private_data_set_cb(vce_private_data_set_cb callback_func);
110
111 int vcd_engine_agent_set_private_data_requested_cb(vce_private_data_requested_cb callback_func);
112
113 int vcd_engine_agent_set_nlu_base_info_requested_cb(vce_nlu_base_info_requested_cb callback_func);
114
115 int vcd_engine_agent_set_specific_engine_request_cb(vce_specific_engine_request_cb callback_func);
116
117 int vcd_engine_agent_set_request_tts_cb(vce_request_tts_cb callback_func, void* user_data);
118
119 int vcd_engine_agent_set_cancel_tts_cb(vce_cancel_tts_cb callback_func, void* user_data);
120
121 int vcd_engine_agent_set_get_tts_audio_format_cb(vce_tts_audio_format_request_cb callback_func, void* user_data);
122
123
124 #ifdef __cplusplus
125 }
126 #endif
127
128 #endif /* __VCD_ENGINE_AGENT_H_ */
129
130