Merge with Tizen 2.3
[platform/core/uifw/tts.git] / server / ttsd_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 __TTSD_MAIN_H_
16 #define __TTSD_MAIN_H_
17
18 #include <stdio.h>
19 #include <stdbool.h>
20 #include <stdlib.h>
21 #include <tizen.h>
22 #include <unistd.h>
23 #include <string.h>
24 #include <glib.h>
25 #include <dlog.h>
26 #include <errno.h>
27
28 #include "ttsp.h"
29 #include "tts_defs.h"
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35 /* for debug message */
36 #define DATA_DEBUG
37 #define ENGINE_AGENT_DEBUG
38
39 typedef enum {
40         TTSD_ERROR_NONE                 = TIZEN_ERROR_NONE,             /**< Successful */
41         TTSD_ERROR_OUT_OF_MEMORY        = TIZEN_ERROR_OUT_OF_MEMORY,    /**< Out of Memory */
42         TTSD_ERROR_IO_ERROR             = TIZEN_ERROR_IO_ERROR,         /**< I/O error */
43         TTSD_ERROR_INVALID_PARAMETER    = TIZEN_ERROR_INVALID_PARAMETER,/**< Invalid parameter */
44         TTSD_ERROR_OUT_OF_NETWORK       = TIZEN_ERROR_NETWORK_DOWN,     /**< Out of network */
45         TTSD_ERROR_TIMED_OUT            = TIZEN_ERROR_TIMED_OUT,        /**< No answer from the daemon */
46         TTSD_ERROR_PERMISSION_DENIED    = TIZEN_ERROR_PERMISSION_DENIED,/**< Permission denied */
47         TTSD_ERROR_NOT_SUPPORTED        = TIZEN_ERROR_NOT_SUPPORTED,    /**< TTS NOT supported */
48         TTSD_ERROR_INVALID_STATE        = TIZEN_ERROR_TTS | 0x01,       /**< Invalid state */
49         TTSD_ERROR_INVALID_VOICE        = TIZEN_ERROR_TTS | 0x02,       /**< Invalid voice */
50         TTSD_ERROR_ENGINE_NOT_FOUND     = TIZEN_ERROR_TTS | 0x03,       /**< No available engine */
51         TTSD_ERROR_OPERATION_FAILED     = TIZEN_ERROR_TTS | 0x04,       /**< Operation failed */
52         TTSD_ERROR_AUDIO_POLICY_BLOCKED = TIZEN_ERROR_TTS | 0x05        /**< Audio policy blocked */
53 }ttsd_error_e;
54
55 typedef enum {
56         TTSD_MODE_DEFAULT = 0,          /**< Default mode for normal application */
57         TTSD_MODE_NOTIFICATION,         /**< Notification mode */
58         TTSD_MODE_SCREEN_READER         /**< Screen reader mode */
59 }ttsd_mode_e;
60
61 typedef enum {
62         TTSD_INTERRUPTED_PAUSED = 0,    /**< Current state change 'Pause' */
63         TTSD_INTERRUPTED_STOPPED        /**< Current state change 'Ready' */
64 }ttsd_interrupted_code_e;
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         int type;
75 }voice_s;
76
77 /* get daemon mode : default, notification or screen reader */
78 ttsd_mode_e ttsd_get_mode();
79
80 /* Get log tag : default, notification, screen reader */
81 const char* get_tag();
82
83 #ifdef __cplusplus
84 }
85 #endif
86
87 #endif  /* __TTSD_MAIN_H_ */