Revert "Fixed logic for stt unprepare"
[platform/core/uifw/voice-control.git] / client / vc_client.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 __VC_CLIENT_H_
19 #define __VC_CLIENT_H_
20
21 #include "vc_info_parser.h"
22 #include "vc_main.h"
23 #include "voice_control.h"
24 #include "voice_control_authority.h"
25
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 /*
32 * Common function
33 */
34 int vc_client_create(vc_h* vc);
35
36 int vc_client_destroy(vc_h vc);
37
38 bool vc_client_is_valid(vc_h vc);
39
40 bool vc_client_is_valid_by_uid(int uid);
41
42 int vc_client_get_handle(int uid, vc_h* vc);
43
44 /*
45 * set/get callback function
46 */
47 int vc_client_set_result_cb(vc_h vc, vc_result_cb callback, void* user_data);
48
49 int vc_client_get_result_cb(vc_h vc, vc_result_cb* callback, void** user_data);
50
51 int vc_client_set_service_state_changed_cb(vc_h vc, vc_service_state_changed_cb callback, void* user_data);
52
53 int vc_client_get_service_state_changed_cb(vc_h vc, vc_service_state_changed_cb* callback, void** user_data);
54
55 int vc_client_set_state_changed_cb(vc_h vc, vc_state_changed_cb callback, void* user_data);
56
57 int vc_client_get_state_changed_cb(vc_h vc, vc_state_changed_cb* callback, void** user_data);
58
59 int vc_client_set_current_lang_changed_cb(vc_h vc, vc_current_language_changed_cb callback, void* user_data);
60
61 int vc_client_get_current_lang_changed_cb(vc_h vc, vc_current_language_changed_cb* callback, void** user_data);
62
63 int vc_client_set_error_cb(vc_h vc, vc_error_cb callback, void* user_data);
64
65 int vc_client_get_error_cb(vc_h vc, vc_error_cb* callback, void** user_data);
66
67
68 /*
69 * set/get option
70 */
71 int vc_client_set_service_state(vc_h vc, vc_service_state_e state);
72
73 int vc_client_get_service_state(vc_h vc, vc_service_state_e* state);
74
75 int vc_client_set_client_state(vc_h vc, vc_state_e state);
76
77 int vc_client_get_client_state(vc_h vc, vc_state_e* state);
78
79 int vc_client_get_client_state_by_uid(int uid, vc_state_e* state);
80
81 int vc_client_get_before_state(vc_h vc, vc_state_e* state, vc_state_e* before_state);
82
83 int vc_client_set_invocation_name(vc_h vc, const char* invocation_name);
84
85 int vc_client_get_invocation_name(vc_h vc, char** invocation_name);
86
87 int vc_client_set_xid(vc_h vc, int xid);
88
89 int vc_client_get_xid(vc_h vc, int* xid);
90
91 int vc_client_set_is_foreground(vc_h vc, bool value);
92
93 int vc_client_get_is_foreground(vc_h vc, bool* value);
94
95 #if 0
96 int vc_client_set_exclusive_cmd(vc_h vc, bool value);
97
98 int vc_client_get_exclusive_cmd(vc_h vc, bool* value);
99 #endif
100
101 int vc_client_set_error(vc_h vc, int reason);
102
103 int vc_client_get_error(vc_h vc, int* reason);
104
105
106 /* utils */
107 int vc_client_get_count();
108
109 int vc_client_use_callback(vc_h vc);
110
111 int vc_client_not_use_callback(vc_h vc);
112
113 /* Authority */
114 int vc_client_set_auth_state_changed_cb(vc_h vc, vc_auth_state_changed_cb callback, void* user_data);
115
116 int vc_client_get_auth_state_changed_cb(vc_h vc, vc_auth_state_changed_cb* callback, void** user_data);
117
118 int vc_client_unset_auth_state_changed_cb(vc_h vc);
119
120 int vc_client_set_auth_state(vc_h vc, vc_auth_state_e state);
121
122 int vc_client_get_auth_state(vc_h vc, vc_auth_state_e* state);
123
124 int vc_client_get_before_auth_state(vc_h vc, vc_auth_state_e* before, vc_auth_state_e* current);
125
126 int vc_client_set_mgr_pid(vc_h vc, int mgr_pid);
127
128 int vc_client_get_mgr_pid(vc_h vc, int* mgr_pid);
129
130
131 #ifdef __cplusplus
132 }
133 #endif
134
135 #endif /* __VC_CLIENT_H_ */