Merge with Tizen 2.3
[platform/core/uifw/stt.git] / common / stt_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 __STT_CONFIG_PARSER_H_
16 #define __STT_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 struct {
27         char*   name;
28         char*   uuid;
29         char*   setting;
30         char*   agreement;
31         GSList* languages;
32         bool    support_silence_detection;
33 }stt_engine_info_s;
34
35 typedef struct {
36         char*   engine_id;
37         char*   setting;
38         bool    auto_lang;
39         char*   language;
40         bool    silence_detection;
41 }stt_config_s;
42
43 typedef struct {
44         int     index;
45         int     event;
46         char*   text;
47         long    start_time;
48         long    end_time;
49 }stt_result_time_info_s;
50
51 /* Get engine information */
52 int stt_parser_get_engine_info(const char* path, stt_engine_info_s** engine_info);
53
54 int stt_parser_free_engine_info(stt_engine_info_s* engine_info);
55
56
57 int stt_parser_load_config(stt_config_s** config_info);
58
59 int stt_parser_unload_config(stt_config_s* config_info);
60
61 int stt_parser_set_engine(const char* engine_id, const char* setting, const char* language, bool silence);
62
63 int stt_parser_set_language(const char* language);
64
65 int stt_parser_set_auto_lang(bool value);
66
67 int stt_parser_set_silence_detection(bool value);
68
69 int stt_parser_find_config_changed(char** engine, char** setting, int* auto_lang, char** language, int* silence);
70
71
72 /* Time info */
73 int stt_parser_set_time_info(GSList* time_list);
74
75 int stt_parser_get_time_info(GSList** time_list);
76
77 int stt_parser_clear_time_info();
78
79
80 #ifdef __cplusplus
81 }
82 #endif
83
84 #endif /* __STT_CONFIG_PARSER_H_ */