Add multi-user support
[platform/core/uifw/stt.git] / server / sttd_main.h
1 /*
2 *  Copyright (c) 2012, 2013 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 /* For multi-user support */
28 #include <tzplatform_config.h>
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 /*
35 * STT Daemon Define
36 */
37
38 #define TAG_STTD "sttd"
39
40 #define BASE_DIRECTORY_DEFAULT                  "/usr/lib/voice/stt/1.0/"
41 #define ENGINE_DIRECTORY_DEFAULT                "/usr/lib/voice/stt/1.0/engine"
42 #define ENGINE_DIRECTORY_DEFAULT_SETTING        "/usr/lib/voice/stt/1.0/setting"
43
44 #define CONFIG_DIRECTORY                        tzplatform_mkpath(TZ_USER_HOME, ".voice")
45
46 #define ENGINE_DIRECTORY_DOWNLOAD               tzplatform_mkpath(TZ_USER_HOME, ".voice/stt/1.0/engine")
47 #define ENGINE_DIRECTORY_DOWNLOAD_SETTING       tzplatform_mkpath(TZ_USER_HOME, ".voice/stt/1.0/setting")
48
49 /* for debug message */
50 #define RECORDER_DEBUG
51 #define CLIENT_DATA_DEBUG
52
53 typedef enum {
54         STTD_ERROR_NONE                 = 0,                    /**< Successful */
55         STTD_ERROR_OUT_OF_MEMORY        = -ENOMEM,              /**< Out of Memory */
56         STTD_ERROR_IO_ERROR             = -EIO,                 /**< I/O error */
57         STTD_ERROR_INVALID_PARAMETER    = -EINVAL,              /**< Invalid parameter */
58         STTD_ERROR_TIMED_OUT            = -ETIMEDOUT,           /**< No answer from the daemon */
59         STTD_ERROR_RECORDER_BUSY        = -EBUSY,               /**< Busy recorder */
60         STTD_ERROR_OUT_OF_NETWORK       = -ENETDOWN,            /**< Out of network */
61         STTD_ERROR_INVALID_STATE        = -0x0100000 | 0x31,    /**< Invalid state */
62         STTD_ERROR_INVALID_LANGUAGE     = -0x0100000 | 0x32,    /**< Invalid language */
63         STTD_ERROR_ENGINE_NOT_FOUND     = -0x0100000 | 0x33,    /**< No available engine  */    
64         STTD_ERROR_OPERATION_FAILED     = -0x0100000 | 0x34,    /**< Operation failed  */
65         STTD_ERROR_NOT_SUPPORTED_FEATURE= -0x0100000 | 0x35     /**< Not supported feature of current engine */
66 }stt_error_e;
67
68 typedef struct {
69         char* engine_id;
70         char* engine_name;
71         char* ug_name;
72 }engine_s;
73
74 typedef struct {
75         char* key;
76         char* value;
77 }engine_setting_s;
78
79 #ifdef __cplusplus
80 }
81 #endif
82
83 #endif  /* __STTD_MAIN_H_ */