tizen beta release
[platform/core/uifw/stt.git] / server / sttd_main.h
1 /*
2 * Copyright (c) 2011 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 <stdio.h>
19 #include <stdbool.h>
20 #include <stdlib.h>
21 #include <string.h>
22 #include <unistd.h>
23 #include <glib.h>
24 #include <dlog.h>
25 #include <errno.h>
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 /*
32 * STT Daemon Define
33 */
34
35 #define TAG_STTD "sttd"
36
37 #define ENGINE_DIRECTORY "/usr/lib/voice/stt/1.0/engine"
38 #define ENGINE_DIRECTORY_DOWNLOAD "/opt/apps/voice/stt/engine"
39
40 /* for debug message */
41 #define RECORDER_DEBUG
42
43 typedef enum {
44         STTD_ERROR_NONE                 = 0,            /**< Successful */
45         STTD_ERROR_OUT_OF_MEMORY        = -ENOMEM,      /**< Out of Memory */
46         STTD_ERROR_IO_ERROR             = -EIO,         /**< I/O error */
47         STTD_ERROR_INVALID_PARAMETER    = -EINVAL,      /**< Invalid parameter */
48         STTD_ERROR_TIMED_OUT            = -ETIMEDOUT,   /**< No answer from the daemon */
49         STTD_ERROR_RECORDER_BUSY        = -EBUSY,       /**< Busy recorder */
50         STTD_ERROR_OUT_OF_NETWORK       = -ENETDOWN,    /**< Out of network */
51         STTD_ERROR_INVALID_STATE        = -0x0100031,   /**< Invalid state */
52         STTD_ERROR_INVALID_LANGUAGE     = -0x0100032,   /**< Invalid language */
53         STTD_ERROR_ENGINE_NOT_FOUND     = -0x0100033,   /**< No available engine  */    
54         STTD_ERROR_OPERATION_FAILED     = -0x0100034    /**< Operation failed  */
55 }stt_error_e;
56
57 typedef struct {
58         char* engine_id;
59         char* engine_name;
60         char* ug_name;
61 }engine_s;
62
63 typedef struct {
64         char* key;
65         char* value;
66 }engine_setting_s;
67
68 #ifdef __cplusplus
69 }
70 #endif
71
72 #endif  /* __STTD_MAIN_H_ */