check null before use when dbus close connection
[platform/core/uifw/voice-control.git] / server / vcd_dbus.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_DBUS_h__
19 #define __VCD_DBUS_h__
20
21 #include "vcd_main.h"
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 typedef enum {
28         VCD_CLIENT_TYPE_NORMAL,
29         VCD_CLIENT_TYPE_WIDGET,
30         VCD_CLIENT_TYPE_MANAGER
31 } vcd_client_type_e;
32
33 int vcd_dbus_open_connection();
34
35 int vcd_dbus_close_connection();
36
37 int vcd_check_dbus_connection();
38
39 int vcdc_send_hello(int pid, vcd_client_type_e type);
40
41 int vcdc_send_show_tooltip(int pid, bool show);
42
43 int vcdc_send_set_volume(int manger_pid, float volume);
44
45 int vcdc_send_result(int pid, int manager_pid, int cmd_type);
46
47 int vcdc_send_asr_result(int pid, int event, const char* asr_result, int cmd_type, bool* is_consumed);
48
49 int vcdc_send_pre_result_to_manager(int manager_pid, int event, const char* pre_result);
50
51 int vcdc_send_result_to_manager(int manger_pid, int result_type);
52
53 int vcdc_send_speech_detected(int manger_pid);
54
55 int vcdc_send_error_signal(int reason, char *err_msg);
56
57 int vcdc_send_error_signal_to_manager(int manager_pid, int reason, char *err_msg);
58
59 int vcdc_send_service_state(vcd_state_e state);
60
61 int vcdc_send_dialog(int manger_pid, int pid, const char* disp_text, const char* utt_text, int continuous);
62
63 int vcdc_send_manager_pid(int manager_pid);
64
65 int vcdc_send_request_set_private_data(int pid, const char* key, const char* data);
66
67 int vcdc_send_request_get_private_data(int pid, const char* key, char** data);
68
69 #ifdef __cplusplus
70 }
71 #endif
72
73 #endif  /* __VCD_DBUS_h__ */