Clear data when AUDIO_POLICY_BLOCKED is occurred
[platform/core/uifw/tts.git] / server / ttsd_server.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 __TTSD_SERVER_CORE_H_
16 #define __TTSD_SERVER_CORE_H_
17
18 #include <glib.h>
19 #include <Ecore.h>
20
21 #include "ttse.h"
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 /**
28 * Server APIs
29 */
30 int ttsd_initialize(ttse_request_callback_s *callback);
31
32 int ttsd_finalize();
33
34 Eina_Bool ttsd_cleanup_client(void *data);
35
36 Eina_Bool ttsd_get_daemon_exist();
37
38 int ttsd_send_result(ttse_result_event_e event, const void* data, unsigned int data_size, ttse_audio_type_e audio_type, int rate, void* user_data);
39 int ttsd_send_error(ttse_error_e error, const char* msg);
40
41 int ttsd_set_private_data_set_cb(ttse_private_data_set_cb callback);
42 int ttsd_set_private_data_requested_cb(ttse_private_data_requested_cb callback);
43
44 /*
45 * Server API for client
46 */
47
48 int ttsd_server_initialize(int pid, int uid, bool* credential_needed);
49
50 int ttsd_server_finalize(int uid);
51
52 int ttsd_server_get_support_voices(int uid, GList** voice_list);
53
54 int ttsd_server_get_current_voice(int uid, char** language, int* voice_type);
55
56 int ttsd_server_add_queue(int uid, const char* text, const char* lang, int voice_type, int speed, int utt_id, const char* credential);
57
58 int ttsd_server_play(int uid, const char* credential);
59
60 int ttsd_server_stop(int uid);
61
62 int ttsd_server_pause(int uid, int* utt_id);
63
64 int ttsd_server_set_private_data(int uid, const char* key, const char* data);
65
66 int ttsd_server_get_private_data(int uid, const char* key, char** data);
67
68 int ttsd_server_play_pcm(int uid);
69
70 int ttsd_server_stop_pcm(int uid);
71
72 int ttsd_server_add_pcm(int uid, int event, void* data, int data_size, int audio_type, int rate);
73
74 #ifdef __cplusplus
75 }
76 #endif
77
78 #endif /* __TTSD_SERVER_CORE_H_ */