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