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 __TTS_CONFIG_MANAGER_H_
16 #define __TTS_CONFIG_MANAGER_H_
26 TTS_CONFIG_ERROR_NONE = 0, /**< Success, No error */
27 TTS_CONFIG_ERROR_OUT_OF_MEMORY = -ENOMEM, /**< Out of Memory */
28 TTS_CONFIG_ERROR_IO_ERROR = -EIO, /**< I/O error */
29 TTS_CONFIG_ERROR_INVALID_PARAMETER = -EINVAL, /**< Invalid parameter */
30 TTS_CONFIG_ERROR_INVALID_STATE = -0x0100021, /**< Invalid state */
31 TTS_CONFIG_ERROR_INVALID_VOICE = -0x0100022, /**< Invalid voice */
32 TTS_CONFIG_ERROR_ENGINE_NOT_FOUND = -0x0100023, /**< No available TTS-engine */
33 TTS_CONFIG_ERROR_OPERATION_FAILED = -0x0100024, /**< Operation failed */
34 TTS_CONFIG_ERROR_NOT_SUPPORTED_FEATURE = -0x0100025 /**< Not supported feature of current engine */
38 TTS_CONFIG_SPEED_AUTO = 0, /**< Speed from settings */
39 TTS_CONFIG_SPEED_MIN = 1, /**< Min value */
40 TTS_CONFIG_SPEED_VERY_SLOW = 2, /**< Very slow */
41 TTS_CONFIG_SPEED_SLOW = 5, /**< Slow */
42 TTS_CONFIG_SPEED_NORMAL = 8, /**< Normal */
43 TTS_CONFIG_SPEED_FAST = 11, /**< Fast */
44 TTS_CONFIG_SPEED_VERY_FAST = 14, /**< Very fast */
45 TTS_CONFIG_SPEED_MAX = 15 /**< Max value */
49 TTS_CONFIG_CLIENT_TYPE_DEFAULT = 0x1,
50 TTS_CONFIG_CLIENT_TYPE_SETTING = 0x2,
51 TTS_CONFIG_CLIENT_TYPE_SERVER = 0x4,
52 TTS_CONFIG_CLIENT_TYPE_INTERRUPT = 0x8
53 } tts_config_client_type_e;
56 typedef bool (*tts_config_supported_engine_cb)(const char* engine_id, const char* engine_name, const char* setting, void* user_data);
58 typedef bool (*tts_config_supported_voice_cb)(const char* engine_id, const char* language, int type, void* user_data);
60 typedef void (*tts_config_engine_changed_cb)(const char* engine_id, const char* setting,
61 const char* language, int voice_type, bool auto_voice, bool need_credential, void* user_data);
63 typedef void (*tts_config_voice_changed_cb)(const char* before_language, int before_voice_type,
64 const char* current_language, int current_voice_type,
65 bool auto_voice, void* user_data);
67 typedef void (*tts_config_speech_rate_changed_cb)(int value, void* user_data);
69 typedef void (*tts_config_pitch_changed_cb)(int value, void* user_data);
71 typedef void (*tts_config_bg_volume_ratio_changed_cb)(double value, void* user_data);
73 typedef void (*tts_config_screen_reader_changed_cb)(bool value, void* user_data);
76 int tts_config_mgr_initialize(unsigned int uid, tts_config_client_type_e client_type);
78 int tts_config_mgr_finalize(unsigned int uid, tts_config_client_type_e client_type);
81 int tts_config_mgr_set_callback(unsigned int uid,
82 tts_config_engine_changed_cb engine_cb,
83 tts_config_voice_changed_cb voice_cb,
84 tts_config_speech_rate_changed_cb speech_cb,
85 tts_config_pitch_changed_cb pitch_cb,
86 tts_config_bg_volume_ratio_changed_cb bg_volume_ratio_cb,
89 /* Only for screen reader option */
90 int tts_config_mgr_set_screen_reader_callback(unsigned int uid, tts_config_screen_reader_changed_cb callback, void* user_data);
92 int tts_config_mgr_unset_screen_reader_callback(unsigned int uid);
95 int tts_config_mgr_get_engine_list(tts_config_supported_engine_cb callback, void* user_data);
97 int tts_config_mgr_get_engine(char** engine);
99 int tts_config_mgr_set_engine(const char* engine);
101 int tts_config_mgr_get_voice_list(const char* engine_id, tts_config_supported_voice_cb callback, void* user_data);
103 int tts_config_mgr_get_voice(char** language, int* type);
105 int tts_config_mgr_set_voice(const char* language, int type);
107 int tts_config_mgr_get_auto_voice(bool* value);
109 int tts_config_mgr_set_auto_voice(bool value);
111 int tts_config_mgr_get_speech_rate(int* value);
113 int tts_config_mgr_set_speech_rate(int value);
115 int tts_config_mgr_get_pitch(int* value);
117 int tts_config_mgr_set_pitch(int value);
119 int tts_config_mgr_get_bg_volume_ratio(double *value);
120 int tts_config_mgr_set_bg_volume_ratio(double value);
122 bool tts_config_check_default_engine_is_valid(const char* engine);
124 bool tts_config_check_default_voice_is_valid(const char* language, int type);
126 int tts_config_mgr_get_max_text_size(unsigned int* size);
128 int tts_config_mgr_get_instant_reprepare_client(unsigned int *uid);
130 int tts_config_mgr_set_instant_reprepare_client(const unsigned int uid);
137 #endif /* __TTS_CONFIG_MANAGER_H_ */