check null before use when dbus close connection
[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_domain(int pid, const char* domain);
70
71 int vcd_engine_get_nlu_base_info(int pid, const char* key, char** value);
72
73 int vcd_engine_set_private_data(int pid, const char* key, const char* data);
74
75 int vcd_engine_get_private_data(int pid, const char* key, char** data);
76
77 int vcd_engine_process_text(int pid, const char* text);
78
79 int vcd_engine_process_list_event(int pid, const char* event);
80
81 int vcd_engine_process_haptic_event(int pid, const char* event);
82
83 /* for engine service */
84 int vcd_engine_agent_get_foreach_command(vce_cmd_h vce_command, vce_command_cb callback, void* user_data);
85
86 int vcd_engine_agent_get_command_count(vce_cmd_h vce_command);
87
88 int vcd_engine_agent_get_audio_type(char** audio_type);
89
90 int vcd_engine_agent_set_private_data(const char* key, const char* data);
91
92 int vcd_engine_agent_get_private_data(const char* key, char** data);
93
94 int vcd_engine_agent_start_recording();
95
96 int vcd_engine_agent_stop_recording();
97
98 int vcd_engine_agent_set_private_data_set_cb(vce_private_data_set_cb callback_func);
99
100 int vcd_engine_agent_set_private_data_requested_cb(vce_private_data_requested_cb callback_func);
101
102 int vcd_engine_agent_set_nlu_base_info_requested_cb(vce_nlu_base_info_requested_cb callback_func);
103
104
105 #ifdef __cplusplus
106 }
107 #endif
108
109 #endif /* __VCD_ENGINE_AGENT_H_ */
110
111