Fix dbus delay when requesting hello
[platform/core/uifw/stt.git] / server / sttd_client_data.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 __STTD_CLIENT_DATA_H_
16 #define __STTD_CLIENT_DATA_H_
17
18 #include <glib.h>
19 #include <Ecore.h>
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24
25 typedef enum {
26         APP_STATE_CREATED       = 0,
27         APP_STATE_READY         = 1,
28         APP_STATE_RECORDING     = 2,
29         APP_STATE_PROCESSING    = 3
30 } app_state_e;
31
32 typedef struct {
33         int     pid;
34         int     uid;
35         char*   start_beep;
36         char*   stop_beep;
37
38         app_state_e     state;
39 /*      Ecore_Timer*    timer;  */
40
41         bool    app_agreed;
42 } client_info_s;
43
44 typedef struct {
45         int     index;
46         int     event;
47         char*   text;
48         long    start_time;
49         long    end_time;
50 } result_time_info_s;
51
52 typedef bool (*time_callback)(int index, int event, const char* text, long start_time, long end_time, void *user_data);
53
54
55 int sttd_client_add(int pid, int uid);
56
57 int sttd_client_delete(int uid);
58
59 int sttd_client_get_start_sound(int uid, char** filename);
60
61 int sttd_client_set_start_sound(int uid, const char* filename);
62
63 int sttd_client_get_stop_sound(int uid, char** filename);
64
65 int sttd_client_set_stop_sound(int uid, const char* filename);
66
67 int sttd_client_get_state(int uid, app_state_e* state);
68
69 int sttd_client_set_state(int uid, app_state_e state);
70
71 int sttd_client_get_ref_count();
72
73 int sttd_client_get_pid(int uid);
74
75 #if 0
76 int sttd_client_get_current_recording();
77
78 int sttd_client_get_current_thinking();
79
80 int sttd_cliet_set_timer(int uid, Ecore_Timer* timer);
81
82 int sttd_cliet_get_timer(int uid, Ecore_Timer** timer);
83 #endif
84
85 int sttd_client_get_list(int** uids, int* uid_count);
86
87 int stt_client_set_current_recognition(int uid);
88
89 int stt_client_get_current_recognition();
90
91 int stt_client_unset_current_recognition();
92
93
94 int stt_client_set_app_agreed(int uid);
95
96 bool stt_client_get_app_agreed(int uid);
97
98
99 #ifdef __cplusplus
100 }
101 #endif
102
103 #endif  /* __STTD_CLIENT_DATA_H_ */
104