Update year information of license boilerplate
[platform/core/uifw/multi-assistant-service.git] / inc / multi_assistant_service_client.h
1 /*
2  * Copyright 2018-2019 Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.1 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://floralicense.org/license/
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17
18 #ifndef _MULTI_ASSISTANT_SERVICE_H_
19 #define _MULTI_ASSISTANT_SERVICE_H_
20
21 #include <dlog/dlog.h>
22
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 #define MAX_APPID_LEN 255
29
30 int mas_client_initialize(int pid);
31
32 int mas_client_deinitialize(int pid);
33
34 int mas_client_get_audio_format(int pid, int* rate, int* channel, int* audio_type);
35
36 int mas_client_get_audio_source_type(int pid, char** type);
37
38 int mas_client_request_speech_data(int pid);
39
40 int mas_client_send_asr_result(int pid, int event, char* asr_result);
41
42 int mas_client_send_result(int pid, char* display_text, char* utterance_text, char* result_json);
43
44 int mas_client_send_recognition_result(int pid, int result);
45
46 int mas_client_start_streaming_audio_data(int pid, int type);
47
48 int mas_client_stop_streaming_audio_data(int pid, int type);
49
50 int mas_client_update_voice_feedback_state(int pid, int state);
51
52 int mas_client_send_assistant_specific_command(int pid, const char *command);
53
54 int mas_client_set_background_volume(int pid, double ratio);
55
56 int mas_client_set_preprocessing_allow_mode(int pid, int mode, const char* appid);
57
58 int mas_client_send_preprocessing_result(int pid, bool result);
59
60 int mas_ui_client_initialize(int pid);
61
62 int mas_ui_client_deinitialize(int pid);
63
64 int mas_ui_client_change_assistant(const char* appid);
65
66 int mas_get_current_client_pid();
67
68 int mas_get_current_preprocessing_client_pid();
69
70 int mas_get_client_pid_by_wakeup_word(const char *wakeup_word);
71
72 int mas_get_client_pid_by_appid(const char *appid);
73
74 bool mas_get_client_custom_ui_option_by_appid(const char *appid);
75
76 const char* mas_get_client_appid_by_wakeup_word(const char *wakeup_word);
77
78 int mas_set_current_client_by_wakeup_word(const char *wakeup_word);
79
80 int mas_set_current_client_by_appid(const char *appid);
81
82 int mas_launch_client_by_wakeup_word(const char *wakeup_word);
83
84 int mas_prelaunch_default_assistant();
85
86 typedef enum {
87         CLIENT_LAUNCH_MODE_ACTIVATION,
88         CLIENT_LAUNCH_MODE_PRELAUNCH,
89 } CLIENT_LAUNCH_MODE;
90 int mas_launch_client_by_appid(const char *appid, CLIENT_LAUNCH_MODE launch_mode);
91
92 typedef enum {
93         PREPROCESSING_STATE_NONE,
94         PREPROCESSING_STATE_WAKEUP_PREPROCESS_ENABLED,
95         PREPROCESSING_STATE_WAKEUP_PREPROCESS_DISABLED,
96         PREPROCESSING_STATE_PREPROCESSING_UTTERANCE,
97         PREPROCESSING_STATE_PREPROCESSING_FOLLOW_UP,
98 } PREPROCESSING_STATE;
99
100 typedef enum {
101         PREPROCESSING_STATE_EVENT_ASSISTANT_ACTIVATED,
102         PREPROCESSING_STATE_EVENT_PREPROCESSING_ALLOW_MODE_CHANGED,
103         PREPROCESSING_STATE_EVENT_UTTERANCE_STREAMING_STARTED,
104         PREPROCESSING_STATE_EVENT_FOLLOW_UP_STREAMING_STARTED,
105         PREPROCESSING_STATE_EVENT_PREPROCESSING_SUCCEEDED,
106         PREPROCESSING_STATE_EVENT_PREPROCESSING_FAILED,
107 } PREPROCESSING_STATE_EVENT;
108
109 int mas_process_preprocessing_state_event(PREPROCESSING_STATE_EVENT event);
110
111
112 #ifdef __cplusplus
113 }
114 #endif
115
116 #endif /* _MULTI_ASSISTANT_SERVICE_H_ */