b75ade7dc5c407b4530dd2b886bb814c43ff9a3c
[platform/core/uifw/stt.git] / server / sttd_main.h
1 /*
2 *  Copyright (c) 2011-2014 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_MAIN_H_
16 #define __STTD_MAIN_H_
17
18 #include <dlog.h>
19 #include <errno.h>
20 #include <glib.h>
21 #include <stdio.h>
22 #include <stdlib.h>
23 #include <string.h>
24 #include <tizen.h>
25 #include <unistd.h>
26
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 /*
33 * STT Daemon Define
34 */
35
36 #define TAG_STTD "sttd"
37
38 /* for debug message */
39 //#define CLIENT_DATA_DEBUG
40
41 typedef enum {
42         STTD_ERROR_NONE                         = TIZEN_ERROR_NONE,             /**< Successful */
43         STTD_ERROR_OUT_OF_MEMORY                = TIZEN_ERROR_OUT_OF_MEMORY,    /**< Out of Memory */
44         STTD_ERROR_IO_ERROR                     = TIZEN_ERROR_IO_ERROR,         /**< I/O error */
45         STTD_ERROR_INVALID_PARAMETER            = TIZEN_ERROR_INVALID_PARAMETER,/**< Invalid parameter */
46         STTD_ERROR_TIMED_OUT                    = TIZEN_ERROR_TIMED_OUT,        /**< No answer from the daemon */
47         STTD_ERROR_RECORDER_BUSY                = TIZEN_ERROR_RESOURCE_BUSY,    /**< Device or resource busy */
48         STTD_ERROR_OUT_OF_NETWORK               = TIZEN_ERROR_NETWORK_DOWN,     /**< Network is down */
49         STTD_ERROR_PERMISSION_DENIED            = TIZEN_ERROR_PERMISSION_DENIED,/**< Permission denied */
50         STTD_ERROR_NOT_SUPPORTED                = TIZEN_ERROR_NOT_SUPPORTED,    /**< STT NOT supported */
51         STTD_ERROR_INVALID_STATE                = TIZEN_ERROR_STT | 0x01,       /**< Invalid state */
52         STTD_ERROR_INVALID_LANGUAGE             = TIZEN_ERROR_STT | 0x02,       /**< Invalid language */
53         STTD_ERROR_ENGINE_NOT_FOUND             = TIZEN_ERROR_STT | 0x03,       /**< No available engine  */    
54         STTD_ERROR_OPERATION_FAILED             = TIZEN_ERROR_STT | 0x04,       /**< Operation failed  */
55         STTD_ERROR_NOT_SUPPORTED_FEATURE        = TIZEN_ERROR_STT | 0x05,       /**< Not supported feature of current engine */
56         STTD_ERROR_NO_SPEECH                    = TIZEN_ERROR_STT | 0x06        /**< No speech while recording */
57 } stt_error_e;
58
59 typedef enum {
60         STTD_RESULT_STATE_DONE          = 0,                    /**< Sync state change */
61         STTD_RESULT_STATE_NOT_DONE      = 1                     /**< Async state change */
62 } sttd_result_state_e;
63
64 typedef struct {
65         char* engine_id;
66         char* engine_name;
67         char* ug_name;
68 } engine_s;
69
70 #ifdef __cplusplus
71 }
72 #endif
73
74 #endif  /* __STTD_MAIN_H_ */