[ACR-1216][tts][Add tts_repeat()]
[platform/core/uifw/tts.git] / client / tts_client.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 __TTS_CLIENT_H_
16 #define __TTS_CLIENT_H_
17
18 #include <Ecore.h>
19
20 #include "tts.h"
21 #include "tts_config_mgr.h"
22 #include "tts_main.h"
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 typedef struct {
29         /* base info */
30         tts_h   tts;
31         int     pid; 
32         int     uid;                    /*<< unique id = pid + handle */
33         int     current_utt_id;
34
35         /* callback info */
36         tts_state_changed_cb            state_changed_cb;
37         void*                           state_changed_user_data;
38         tts_utterance_started_cb        utt_started_cb;
39         void*                           utt_started_user_data;
40         tts_utterance_completed_cb      utt_completeted_cb;
41         void*                           utt_completed_user_data;
42         tts_error_cb                    error_cb;
43         void*                           error_user_data;
44         tts_default_voice_changed_cb    default_voice_changed_cb;
45         void*                           default_voice_changed_user_data;
46         tts_engine_changed_cb           engine_changed_cb;
47         void*                           engine_changed_user_data;
48         tts_supported_voice_cb          supported_voice_cb;
49         void*                           supported_voice_user_data;
50
51         /* mode / state */
52         tts_mode_e      mode;
53         tts_state_e     before_state;
54         tts_state_e     current_state;
55
56         /* semaphore */
57         int             cb_ref_count;
58
59         /* callback data */
60         int             utt_id;
61         int             reason;
62         char*           err_msg;
63
64         /* connection */
65         Ecore_Timer*    conn_timer;
66
67         /* options */
68         char*           credential;
69         bool            credential_needed;
70         bool            internal;
71
72         /* repeatition */
73         char*           text_repeat;
74 } tts_client_s;
75
76 int tts_client_new(tts_h* tts);
77
78 int tts_client_destroy(tts_h tts);
79
80 tts_client_s* tts_client_get(tts_h tts);
81
82 tts_client_s* tts_client_get_by_uid(const int uid);
83
84 int tts_client_get_size();
85
86 int tts_client_use_callback(tts_client_s* client);
87
88 int tts_client_not_use_callback(tts_client_s* client);
89
90 int tts_client_get_use_callback(tts_client_s* client);
91
92 int tts_client_get_connected_client_count();
93
94 int tts_client_get_mode_client_count(tts_mode_e mode);
95
96 GList* tts_client_get_client_list();
97
98 #ifdef __cplusplus
99 }
100 #endif
101
102 #endif /* __TTS_CLIENT_H_ */