Update IPC for service state and volume, Support recognition mode
[platform/core/uifw/voice-control.git] / common / vc_config_mgr.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_CONFIG_MANAGER_H_
19 #define __VC_CONFIG_MANAGER_H_
20
21 #include <stdbool.h>
22 #include <voice_control_common.h>
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 typedef enum {
29         VC_CONFIG_ERROR_NONE                    = TIZEN_ERROR_NONE,                     /**< Success, No error */
30         VC_CONFIG_ERROR_OUT_OF_MEMORY           = TIZEN_ERROR_OUT_OF_MEMORY,            /**< Out of Memory */
31         VC_CONFIG_ERROR_IO_ERROR                = TIZEN_ERROR_IO_ERROR,                 /**< I/O error */
32         VC_CONFIG_ERROR_INVALID_PARAMETER       = TIZEN_ERROR_INVALID_PARAMETER,        /**< Invalid parameter */
33         VC_CONFIG_ERROR_INVALID_STATE           = TIZEN_ERROR_VOICE_CONTROL | 0x011,    /**< Invalid state */
34         VC_CONFIG_ERROR_INVALID_LANGUAGE        = TIZEN_ERROR_VOICE_CONTROL | 0x012,    /**< Invalid voice */
35         VC_CONFIG_ERROR_ENGINE_NOT_FOUND        = TIZEN_ERROR_VOICE_CONTROL | 0x013,    /**< No available VC-engine  */
36         VC_CONFIG_ERROR_OPERATION_FAILED        = TIZEN_ERROR_VOICE_CONTROL | 0x014     /**< Operation failed  */
37 } vc_config_error_e;
38
39
40 typedef void (*vc_config_lang_changed_cb)(const char* before_lang, const char* current_lang);
41
42 typedef void (*vc_config_foreground_changed_cb)(int previous, int current);
43
44 typedef void (*vc_config_enabled_cb)(bool enable);
45
46
47 int vc_config_mgr_initialize(int uid);
48
49 int vc_config_mgr_finalize(int uid);
50
51
52 /* Set / Unset callback */
53 int vc_config_mgr_set_lang_cb(int uid, vc_config_lang_changed_cb lang_cb);
54
55 int vc_config_mgr_unset_lang_cb(int uid);
56
57 int vc_config_mgr_set_foreground_cb(int uid, vc_config_foreground_changed_cb foreground_cb);
58
59 int vc_config_mgr_unset_foreground_cb(int uid);
60
61 int vc_config_mgr_set_enabled_cb(int uid, vc_config_enabled_cb enabled_cb);
62
63 int vc_config_mgr_unset_enabled_cb(int uid);
64
65
66 int vc_config_mgr_get_auto_language(bool* value);
67
68 int vc_config_mgr_set_auto_language(bool value);
69
70 int vc_config_mgr_get_language_list(vc_supported_language_cb callback, void* user_data);
71
72 int vc_config_mgr_get_default_language(char** language);
73
74 int vc_config_mgr_set_default_language(const char* language);
75
76 int vc_config_mgr_get_enabled(bool* value);
77
78 int vc_config_mgr_set_enabled(bool value);
79
80
81 int vc_config_mgr_get_nonfixed_support(bool* value);
82
83 bool vc_config_check_default_language_is_valid(const char* language);
84
85 int vc_config_convert_error_code(vc_config_error_e code);
86
87
88 int vc_config_mgr_set_foreground(int pid, bool value);
89
90 int vc_config_mgr_get_foreground(int* pid);
91
92
93 #ifdef __cplusplus
94 }
95 #endif
96
97 #endif /* __VC_CONFIG_MANAGER_H_ */