upload tizen1.0 source
[platform/core/uifw/tts.git] / server / ttsd_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 __TTSD_MAIN_H_
16 #define __TTSD_MAIN_H_
17
18 #include <stdio.h>
19 #include <stdbool.h>
20 #include <stdlib.h>
21 #include <unistd.h>
22 #include <string.h>
23 #include <glib.h>
24 #include <dlog.h>
25 #include <errno.h>
26
27 #include "ttsp.h"
28 #include "tts_defs.h"
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 /* TTS Daemon Define */ 
35 #define TAG_TTSD "ttsd"
36
37 #define ENGINE_DIRECTORY_DEFAULT                "/usr/lib/voice/tts/1.0/engine"
38 #define ENGINE_DIRECTORY_DEFAULT_SETTING        "/usr/lib/voice/tts/1.0/setting"
39
40 #define ENGINE_DIRECTORY_DOWNLOAD               "/opt/apps/voice/tts/1.0/engine"
41 #define ENGINE_DIRECTORY_DOWNLOAD_SETTING       "/opt/apps/voice/tts/1.0/setting"
42
43 /* for debug message */
44 #define DATA_DEBUG
45
46 typedef enum {
47         TTSD_ERROR_NONE                 = 0,            /**< Success, No error */
48         TTSD_ERROR_OUT_OF_MEMORY        = -ENOMEM,      /**< Out of Memory */
49         TTSD_ERROR_IO_ERROR             = -EIO,         /**< I/O error */
50         TTSD_ERROR_INVALID_PARAMETER    = -EINVAL,      /**< Invalid parameter */
51         TTSD_ERROR_OUT_OF_NETWORK       = -ENETDOWN,    /**< Out of network */
52         TTSD_ERROR_INVALID_STATE        = -0x0100021,   /**< Invalid state */
53         TTSD_ERROR_INVALID_VOICE        = -0x0100022,   /**< Invalid voice */
54         TTSD_ERROR_ENGINE_NOT_FOUND     = -0x0100023,   /**< No available TTS-engine  */
55         TTSD_ERROR_TIMED_OUT            = -0x0100024,   /**< No answer from TTS daemon */
56         TTSD_ERROR_OPERATION_FAILED     = -0x0100025,   /**< TTS daemon failed  */
57 }ttsd_error_e;
58
59
60 typedef enum {
61         TTSD_INTERRUPTED_PAUSED = 0,    /**< Current state change 'Pause' */
62         TTSD_INTERRUPTED_STOPPED        /**< Current state change 'Ready' */
63 }ttsd_interrupted_code_e;
64
65
66 typedef struct {
67         char* engine_id;
68         char* engine_name;
69         char* ug_name;
70 }engine_s;
71
72 typedef struct {
73         char* language;
74         ttsp_voice_type_e type;
75 }voice_s;
76
77 typedef struct {
78         char* key;
79         char* value;
80 }engine_setting_s;
81
82 #ifdef __cplusplus
83 }
84 #endif
85
86 #endif  /* __TTSD_MAIN_H_ */