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.
15 #ifndef __STT_CONFIG_MANAGER_H_
16 #define __STT_CONFIG_MANAGER_H_
25 STT_CONFIG_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
26 STT_CONFIG_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of Memory */
27 STT_CONFIG_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< I/O error */
28 STT_CONFIG_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER,/**< Invalid parameter */
29 STT_CONFIG_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED,/**< Permission denied */
30 STT_CONFIG_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< STT NOT supported */
31 STT_CONFIG_ERROR_INVALID_STATE = TIZEN_ERROR_STT | 0x01, /**< Invalid state */
32 STT_CONFIG_ERROR_INVALID_LANGUAGE = TIZEN_ERROR_STT | 0x02, /**< Invalid language */
33 STT_CONFIG_ERROR_ENGINE_NOT_FOUND = TIZEN_ERROR_STT | 0x03, /**< No available engine */
34 STT_CONFIG_ERROR_OPERATION_FAILED = TIZEN_ERROR_STT | 0x04, /**< Operation failed */
38 STT_CONFIG_TYPE_OPTION_SILENCE_DETECTION
41 typedef bool (*stt_config_supported_engine_cb)(const char* engine_id, const char* engine_name, const char* setting, bool support_silence, void* user_data);
43 typedef bool (*stt_config_supported_langauge_cb)(const char* engine_id, const char* language, void* user_data);
45 typedef void (*stt_config_engine_changed_cb)(const char* engine_id, const char* setting, const char* language, bool support_silence, bool need_credential, void* user_data);
47 typedef void (*stt_config_lang_changed_cb)(const char* before_language, const char* current_language, void* user_data);
49 typedef void (*stt_config_bool_changed_cb)(stt_config_type_e type, bool bool_value, void* user_data);
51 typedef bool (*stt_config_result_time_cb)(int index, int event, const char* text, long start_time, long end_time, void* user_data);
54 int stt_config_mgr_initialize(unsigned int uid);
56 int stt_config_mgr_finalize(unsigned int uid);
59 int stt_config_mgr_set_callback(unsigned int uid, stt_config_engine_changed_cb engine_cb, stt_config_lang_changed_cb lang_cb, stt_config_bool_changed_cb bool_cb, void* user_data);
61 int stt_config_mgr_unset_callback(unsigned int uid);
64 int stt_config_mgr_get_engine_list(stt_config_supported_engine_cb callback, void* user_data);
66 int stt_config_mgr_get_engine(char** engine);
68 int stt_config_mgr_set_engine(const char* engine);
70 int stt_config_mgr_get_engine_agreement(const char* engine, char** agreement);
72 int stt_config_mgr_get_language_list(const char* engine_id, stt_config_supported_langauge_cb callback, void* user_data);
74 int stt_config_mgr_get_default_language(char** language);
76 int stt_config_mgr_set_default_language(const char* language);
78 int stt_config_mgr_get_auto_language(bool* value);
80 int stt_config_mgr_set_auto_language(bool value);
82 int stt_config_mgr_get_silence_detection(bool* value);
84 int stt_config_mgr_set_silence_detection(bool value);
86 bool stt_config_check_default_engine_is_valid(const char* engine);
88 bool stt_config_check_default_language_is_valid(const char* language);
91 int stt_config_mgr_reset_time_info();
93 int stt_config_mgr_add_time_info(int index, int event, const char* text, long start_time, long end_time);
95 int stt_config_mgr_foreach_time_info(stt_config_result_time_cb callback, void* user_data);
98 int stt_config_mgr_save_time_info_file();
100 int stt_config_mgr_remove_time_info_file();
107 #endif /* __STT_CONFIG_MANAGER_H_ */