2 * Copyright (c) 2011-2014 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, 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_screen_reader_changed_cb)(bool value);
67 int tts_config_mgr_initialize(int uid);
69 int tts_config_mgr_finalize(int uid);
72 int tts_config_mgr_set_callback(int uid,
73 tts_config_engine_changed_cb engine_cb,
74 tts_config_voice_changed_cb voice_cb,
75 tts_config_speech_rate_changed_cb speech_cb,
76 tts_config_pitch_changed_cb pitch_cb,
79 int tts_config_mgr_unset_callback(int uid);
81 /* Only for screen reader option */
82 int tts_config_set_screen_reader_callback(int uid, tts_config_screen_reader_changed_cb callback);
84 int tts_config_unset_screen_reader_callback(int uid);
87 int tts_config_mgr_get_engine_list(tts_config_supported_engine_cb callback, void* user_data);
89 int tts_config_mgr_get_engine(char** engine);
91 int tts_config_mgr_set_engine(const char* engine);
93 int tts_config_mgr_get_voice_list(const char* engine_id, tts_config_supported_voice_cb callback, void* user_data);
95 int tts_config_mgr_get_voice(char** language, int* type);
97 int tts_config_mgr_set_voice(const char* language, int type);
99 int tts_config_mgr_get_auto_voice(bool* value);
101 int tts_config_mgr_set_auto_voice(bool value);
103 int tts_config_mgr_get_speech_rate(int* value);
105 int tts_config_mgr_set_speech_rate(int value);
107 int tts_config_mgr_get_pitch(int* value);
109 int tts_config_mgr_set_pitch(int value);
111 bool tts_config_check_default_engine_is_valid(const char* engine);
113 bool tts_config_check_default_voice_is_valid(const char* language, int type);
115 char* tts_config_get_message_path(int mode, int pid);
122 #endif /* __TTS_CONFIG_MANAGER_H_ */