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 typedef bool (*tts_config_supported_engine_cb)(const char* engine_id, const char* engine_name, const char* setting, void* user_data);
51 typedef bool (*tts_config_supported_voice_cb)(const char* engine_id, const char* language, int type, void* user_data);
53 typedef void (*tts_config_engine_changed_cb)(const char* engine_id, const char* setting,
54 const char* language, int voice_type, bool auto_voice, bool need_credential, void* user_data);
56 typedef void (*tts_config_voice_changed_cb)(const char* before_language, int before_voice_type,
57 const char* current_language, int current_voice_type,
58 bool auto_voice, void* user_data);
60 typedef void (*tts_config_speech_rate_changed_cb)(int value, void* user_data);
62 typedef void (*tts_config_pitch_changed_cb)(int value, void* user_data);
64 typedef void (*tts_config_bg_volume_ratio_changed_cb)(double value, void* user_data);
66 typedef void (*tts_config_screen_reader_changed_cb)(bool value);
69 int tts_config_mgr_initialize(int uid);
71 int tts_config_mgr_finalize(int uid);
74 int tts_config_mgr_set_callback(int uid,
75 tts_config_engine_changed_cb engine_cb,
76 tts_config_voice_changed_cb voice_cb,
77 tts_config_speech_rate_changed_cb speech_cb,
78 tts_config_pitch_changed_cb pitch_cb,
79 tts_config_bg_volume_ratio_changed_cb bg_volume_ratio_cb,
82 int tts_config_mgr_unset_callback(int uid);
84 /* Only for screen reader option */
85 int tts_config_set_screen_reader_callback(int uid, tts_config_screen_reader_changed_cb callback);
87 int tts_config_unset_screen_reader_callback(int uid);
90 int tts_config_mgr_get_engine_list(tts_config_supported_engine_cb callback, void* user_data);
92 int tts_config_mgr_get_engine(char** engine);
94 int tts_config_mgr_set_engine(const char* engine);
96 int tts_config_mgr_get_voice_list(const char* engine_id, tts_config_supported_voice_cb callback, void* user_data);
98 int tts_config_mgr_get_voice(char** language, int* type);
100 int tts_config_mgr_set_voice(const char* language, int type);
102 int tts_config_mgr_get_auto_voice(bool* value);
104 int tts_config_mgr_set_auto_voice(bool value);
106 int tts_config_mgr_get_speech_rate(int* value);
108 int tts_config_mgr_set_speech_rate(int value);
110 int tts_config_mgr_get_pitch(int* value);
112 int tts_config_mgr_set_pitch(int value);
114 int tts_config_mgr_get_bg_volume_ratio(double *value);
115 int tts_config_mgr_set_bg_volume_ratio(double value);
117 bool tts_config_check_default_engine_is_valid(const char* engine);
119 bool tts_config_check_default_voice_is_valid(const char* language, int type);
121 char* tts_config_get_message_path(int mode, int pid);
123 int tts_config_mgr_get_max_text_size(unsigned int* size);
130 #endif /* __TTS_CONFIG_MANAGER_H_ */