Change internal function to static
[platform/core/uifw/tts.git] / common / tts_config_parser.h
1 /*
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.
12 */
13
14
15 #ifndef __TTS_CONFIG_PARSER_H_
16 #define __TTS_CONFIG_PARSER_H_
17
18 #include <glib.h>
19 #include <libxml/parser.h>
20 #include <stdbool.h>
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 typedef enum {
27         TTS_CONFIG_VOICE_TYPE_MALE = 1,         /**< Male */
28         TTS_CONFIG_VOICE_TYPE_FEMALE = 2,       /**< Female */
29         TTS_CONFIG_VOICE_TYPE_CHILD = 3,        /**< Child */
30         TTS_CONFIG_VOICE_TYPE_USER_DEFINED = 4  /**< Engine defined */
31 } tts_config_voice_type_e;
32
33 typedef struct {
34         char*   language;
35         int     type;
36 } tts_config_voice_s;
37
38 typedef struct {
39         char*   name;
40         char*   uuid;
41         char*   setting;
42         GSList* voices;
43         bool    pitch_support;
44         bool    need_credential;
45         unsigned int    text_size;
46 } tts_engine_info_s;
47
48 typedef struct {
49         char*   engine_id;
50         char*   setting;
51         bool    auto_voice;
52         char*   language;
53         int     type;
54         int     speech_rate;
55         int     pitch;
56         bool    credential;
57         double bg_volume_ratio;
58 } tts_config_s;
59
60
61 /* Get engine information */
62 int tts_parser_get_engine_info(const char* path, tts_engine_info_s** engine_info);
63
64 int tts_parser_free_engine_info(tts_engine_info_s* engine_info);
65
66
67 int tts_parser_load_config(tts_config_s** config_info);
68
69 int tts_parser_unload_config(tts_config_s* config_info);
70
71 int tts_parser_set_engine(const char* engine_id, const char* setting, const char* language, int type);
72
73 int tts_parser_set_voice(const char* language, int type);
74
75 int tts_parser_set_auto_voice(bool value);
76
77 int tts_parser_set_speech_rate(int value);
78
79 int tts_parser_set_pitch(int value);
80
81 int tts_parser_set_bg_volume_ratio(double value);
82
83 int tts_parser_find_config_changed(char** engine, char**setting, bool* auto_voice, char** language, int* voice_type, 
84                                    int* speech_rate, int* pitch, double* bg_volume_ratio);
85
86 int tts_parser_copy_xml(const char* original, const char* destination);
87
88 int tts_parser_reset();
89
90 #ifdef __cplusplus
91 }
92 #endif
93
94 #endif /* __TTS_CONFIG_PARSER_H_ */