Add critical section to avoid thread safety issue
[platform/core/uifw/stt.git] / client / stt_dbus.h
1 /*
2 *  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
3 *  Licensed under the Apache License, Version 2.0 (the "License");
4 *  you may not use this file except in compliance with the License.
5 *  You may obtain a copy of the License at
6 *  http://www.apache.org/licenses/LICENSE-2.0
7 *  Unless required by applicable law or agreed to in writing, software
8 *  distributed under the License is distributed on an "AS IS" BASIS,
9 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 *  See the License for the specific language governing permissions and
11 *  limitations under the License.
12 */
13
14
15 #ifndef __STT_DBUS_H_
16 #define __STT_DBUS_H_
17
18 #include "stt.h"
19 #include "stt_main.h"
20 #include "stt_internal.h"
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 int stt_dbus_open_connection();
27
28 int stt_dbus_close_connection();
29
30
31 int stt_dbus_request_hello(int uid);
32
33 int stt_dbus_request_initialize(int uid, bool* silence_supported, bool* credential_needed);
34
35 int stt_dbus_request_finalize(int uid);
36
37 int stt_dbus_request_set_current_engine(int uid, const char* engine_id, bool* silence_supported, bool* credential_needed);
38
39 int stt_dbus_request_check_app_agreed(int uid, const char* appid, bool* value);
40
41 int stt_dbus_request_get_support_langs(int uid, stt_h stt, stt_supported_language_cb callback, void* user_data);
42
43 int stt_dbus_request_get_default_lang(int uid, char** language);
44
45 int stt_dbus_request_set_private_data(int uid, const char* key, const char* data);
46
47 int stt_dbus_request_get_private_data(int uid, const char* key, char** data);
48
49 int stt_dbus_request_is_recognition_type_supported(int uid, const char* type, bool* support);
50
51 int stt_dbus_request_set_start_sound(int uid, const char* file);
52
53 int stt_dbus_request_unset_start_sound(int uid);
54
55 int stt_dbus_request_set_stop_sound(int uid, const char* file);
56
57 int stt_dbus_request_unset_stop_sound(int uid);
58
59
60 int stt_dbus_request_start(int uid, const char* lang, const char* type, int silence, const char* appid, const char* credential);
61
62 int stt_dbus_request_stop(int uid);
63
64 int stt_dbus_request_cancel(int uid);
65
66 int stt_dbus_request_start_file(int uid, const char* lang, const char* type, int silence, const char* appid, const char* credential, const char* filepath, stt_audio_type_e audio_type, int sample_rate);
67
68 int stt_dbus_request_cancel_file(int uid);
69
70 #ifdef __cplusplus
71 }
72 #endif
73
74 #endif /* __STT_DBUS_H_ */