Add function to set/get private data
[platform/core/uifw/tts.git] / server / ttsd_engine_agent.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 __TTSD_ENGINE_AGENT_H_
16 #define __TTSD_ENGINE_AGENT_H_
17
18 #include "ttsd_main.h"
19 #include "ttsd_player.h"
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24
25 typedef int (*synth_result_callback)(ttsp_result_event_e event, const void* data, unsigned int data_size, 
26                                      ttsp_audio_type_e audio_type, int rate, void *user_data);
27
28 /*
29 * tts Engine Agent Interfaces
30 */
31
32 /** Init engine agent */
33 int ttsd_engine_agent_init(synth_result_callback result_cb);
34
35 /** Release engine agent */
36 int ttsd_engine_agent_release();
37
38 /** Set current engine */
39 int ttsd_engine_agent_initialize_current_engine();
40
41 /** load current engine */
42 int ttsd_engine_agent_load_current_engine();
43
44 /** Unload current engine */
45 int ttsd_engine_agent_unload_current_engine();
46
47 /** Get state of current engine to need network */
48 bool ttsd_engine_agent_need_network();
49
50 bool ttsd_engine_select_valid_voice(const char* lang, int type, char** out_lang, int* out_type);
51
52 bool ttsd_engine_agent_is_same_engine(const char* engine_id);
53
54 /** Get/Set app option */
55 int ttsd_engine_agent_set_default_engine(const char* engine_id);
56
57 int ttsd_engine_agent_set_default_voice(const char* language, int vctype);
58
59 int ttsd_engine_agent_set_default_speed(int speed);
60
61 int ttsd_engine_agent_set_default_pitch(int pitch);
62
63 int ttsd_engine_set_private_data(const char* key, const char* data);
64
65 int ttsd_engine_get_private_data(const char* key, char** data);
66
67 /*
68 * TTS Engine Interfaces for client
69 */
70
71 int ttsd_engine_load_voice(const char* lang, int vctype);
72
73 int ttsd_engine_unload_voice(const char* lang, int vctype);
74
75 int ttsd_engine_start_synthesis(const char* lang, int vctype, const char* text, int speed, void* user_param);
76
77 int ttsd_engine_cancel_synthesis();
78
79 int ttsd_engine_get_voice_list(GList** voice_list);
80
81 int ttsd_engine_get_default_voice(char** lang, int* vctype);
82
83
84
85 #ifdef __cplusplus
86 }
87 #endif
88
89 #endif /* __TTSD_ENGINE_AGENT_H_ */