Add function to set/get private data
[platform/core/uifw/tts.git] / common / tts_config_parser.h
1 /*
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.
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 } tts_engine_info_s;
45
46 typedef struct {
47         char*   engine_id;
48         char*   setting;
49         bool    auto_voice;
50         char*   language;
51         int     type;
52         int     speech_rate;
53         int     pitch;
54 } tts_config_s;
55
56
57 /* Get engine information */
58 int tts_parser_get_engine_info(const char* path, tts_engine_info_s** engine_info);
59
60 int tts_parser_free_engine_info(tts_engine_info_s* engine_info);
61
62
63 int tts_parser_load_config(tts_config_s** config_info);
64
65 int tts_parser_unload_config(tts_config_s* config_info);
66
67 int tts_parser_set_engine(const char* engine_id, const char* setting, const char* language, int type);
68
69 int tts_parser_set_voice(const char* language, int type);
70
71 int tts_parser_set_auto_voice(bool value);
72
73 int tts_parser_set_speech_rate(int value);
74
75 int tts_parser_set_pitch(int value);
76
77 int tts_parser_find_config_changed(char** engine, char**setting, bool* auto_voice, char** language, int* voice_type, 
78                                    int* speech_rate, int* pitch);
79
80
81 #ifdef __cplusplus
82 }
83 #endif
84
85 #endif /* __TTS_CONFIG_PARSER_H_ */