Fix bug on resume tts and add code for file message(IPC)
[platform/core/uifw/tts.git] / client / tts_client.h
1 /*
2 *  Copyright (c) 2012, 2013 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 <pthread.h>
19 #include "tts.h"
20 #include "tts_main.h"
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 typedef struct {
27         /* base info */
28         tts_h   tts;
29         int     pid; 
30         int     uid;                    /*<< unique id = pid + handle */
31         int     current_utt_id;
32
33         /* callback info */
34         tts_state_changed_cb            state_changed_cb;
35         void*                           state_changed_user_data;
36         tts_utterance_started_cb        utt_started_cb;
37         void*                           utt_started_user_data;
38         tts_utterance_completed_cb      utt_completeted_cb;
39         void*                           utt_completed_user_data;
40         tts_error_cb                    error_cb;
41         void*                           error_user_data;
42
43         /* mode & state */
44         tts_mode_e      mode;
45         tts_state_e     before_state;
46         tts_state_e     current_state;
47
48         /* semaphore */
49         int             cb_ref_count;
50
51         /* callback data */
52         int             utt_id;
53         int             reason;
54 }tts_client_s;
55
56 int tts_client_new(tts_h* tts);
57
58 int tts_client_destroy(tts_h tts);
59
60 tts_client_s* tts_client_get(tts_h tts);
61
62 tts_client_s* tts_client_get_by_uid(const int uid);
63
64 int tts_client_get_size();
65
66 int tts_client_use_callback(tts_client_s* client);
67
68 int tts_client_not_use_callback(tts_client_s* client);
69
70 int tts_client_get_use_callback(tts_client_s* client);
71
72 int tts_client_get_connected_client_count();
73
74 #ifdef __cplusplus
75 }
76 #endif
77
78 #endif /* __TTS_CLIENT_H_ */