Fix prevent issue and change license file
[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         /* state */
44         tts_state_e     before_state;
45         tts_state_e     current_state;
46
47         /* semaphore */
48         int             cb_ref_count;
49
50         /* callback data */
51         int             utt_id;
52         int             reason;
53 }tts_client_s;
54
55 int tts_client_new(tts_h* tts);
56
57 int tts_client_destroy(tts_h tts);
58
59 tts_client_s* tts_client_get(tts_h tts);
60
61 tts_client_s* tts_client_get_by_uid(const int uid);
62
63 int tts_client_get_size();
64
65 int tts_client_use_callback(tts_client_s* client);
66
67 int tts_client_not_use_callback(tts_client_s* client);
68
69 #ifdef __cplusplus
70 }
71 #endif
72
73 #endif /* __TTS_CLIENT_H_ */