Add unit tests for VC manager APIs
[platform/core/uifw/voice-control.git] / server / vcd_main.h
1 /*
2 * Copyright (c) 2011-2015 Samsung Electronics Co., Ltd All Rights Reserved
3 *
4 * Licensed under the Apache License, Version 2.0 (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://www.apache.org/licenses/LICENSE-2.0
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 __VCD_MAIN_H_
19 #define __VCD_MAIN_H_
20
21 #include <Ecore.h>
22 #include <dlog.h>
23 #include <errno.h>
24 #include <glib.h>
25 #include <stdio.h>
26 #include <stdbool.h>
27 #include <stdlib.h>
28 #include <string.h>
29 #include <tizen.h>
30 #include <unistd.h>
31
32 #include "vc_defs.h"
33
34 #include "vce.h"
35 #include "voice_control_common.h"
36
37
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41
42 /*
43 * Daemon Define
44 */
45
46 #define TAG_VCD "vcd"
47
48 /* for debug message */
49 /* #define RECORDER_DEBUG */
50 #define CLIENT_DATA_DEBUG
51 /* #define COMMAND_DATA_DEBUG */
52
53 typedef enum {
54         VCD_ERROR_NONE                  = TIZEN_ERROR_NONE,                     /**< Successful */
55         VCD_ERROR_OUT_OF_MEMORY         = TIZEN_ERROR_OUT_OF_MEMORY,            /**< Out of Memory */
56         VCD_ERROR_IO_ERROR              = TIZEN_ERROR_IO_ERROR,                 /**< I/O error */
57         VCD_ERROR_INVALID_PARAMETER     = TIZEN_ERROR_INVALID_PARAMETER,        /**< Invalid parameter */
58         VCD_ERROR_TIMED_OUT             = TIZEN_ERROR_TIMED_OUT,                /**< No answer from service */
59         VCD_ERROR_RECORDER_BUSY         = TIZEN_ERROR_RESOURCE_BUSY,            /**< Busy recorder */
60         VCD_ERROR_PERMISSION_DENIED     = TIZEN_ERROR_PERMISSION_DENIED,        /**< Permission denied */
61         VCD_ERROR_NOT_SUPPORTED         = TIZEN_ERROR_NOT_SUPPORTED,            /**< VC NOT supported */
62         VCD_ERROR_INVALID_STATE         = TIZEN_ERROR_VOICE_CONTROL | 0x011,    /**< Invalid state */
63         VCD_ERROR_INVALID_LANGUAGE      = TIZEN_ERROR_VOICE_CONTROL | 0x012,    /**< Invalid language */
64         VCD_ERROR_ENGINE_NOT_FOUND      = TIZEN_ERROR_VOICE_CONTROL | 0x013,    /**< No available engine */
65         VCD_ERROR_OPERATION_FAILED      = TIZEN_ERROR_VOICE_CONTROL | 0x014,    /**< Operation failed */
66         VCD_ERROR_OPERATION_REJECTED    = TIZEN_ERROR_VOICE_CONTROL | 0x015,    /**< Operation rejected */
67         VCD_ERROR_SERVICE_RESET         = TIZEN_ERROR_VOICE_CONTROL | 0x018     /**< Daemon Service reset */
68 } vcd_error_e;
69
70 typedef enum {
71         VCD_STATE_NONE = 0,
72         VCD_STATE_READY = 1,
73         VCD_STATE_RECORDING = 2,
74         VCD_STATE_PROCESSING = 3,
75         VCD_STATE_SYNTHESIZING = 4,
76         VCD_STATE_UPDATING = 5
77 } vcd_state_e;
78
79 typedef enum {
80         VCD_AUDIO_STREAMING_EVENT_FAIL = -1,            /**< Failed */
81         VCD_AUDIO_STREAMING_EVENT_START = 1,            /**< Start event */
82         VCD_AUDIO_STREAMING_EVENT_CONTINUE = 2, /**< Continue event */
83         VCD_AUDIO_STREAMING_EVENT_FINISH = 3            /**< Finish event */
84 } vcd_audio_streaming_event_e;
85
86 typedef enum {
87         VCD_AUDIO_STREAMING_MODE_VC_SERVICE = 0,                        /**< Use audio recording from vc service */
88         VCD_AUDIO_STREAMING_MODE_MULTI_ASSISTANT = 1,   /**< Use audio streaming from multi-assistant */
89         VCD_AUDIO_STREAMING_MODE_OUTSIDE = 2,                   /**< Use audio streaming from outside */
90 } vcd_audio_streaming_mode_e;
91
92 typedef enum {
93         VCD_SYSTEM_VOLUME_EVENT_CHANGE,
94         VCD_SYSTEM_VOLUME_EVENT_RECOVER
95 } vcd_system_volume_event_e;
96
97 struct vce_cmd_s {
98         int index;
99 };
100
101
102 #ifdef __cplusplus
103 }
104 #endif
105
106 #endif  /* __VCD_MAIN_H_ */