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