Change source file permissions to 0644
[platform/core/uifw/inputdelegator.git] / inc / w-input-selector.h
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef __W_INPUT_SELECTOR_H_
18 #define __W_INPUT_SELECTOR_H_
19
20 #if !defined(PACKAGE)
21 #define PACKAGE "org.tizen.inputdelegator"
22 #endif
23
24 #ifdef _
25 #undef _
26 #endif
27
28 #define _(str) gettext(str)
29
30 #define APP_EDJ_FILE_WEARABLE "edje/wearable/w-input-selector.edj"
31 #define STT_EDJ_FILE_WEARABLE "edje/wearable/w-input-stt.edj"
32
33 #define APP_EDJ_FILE_MOBILE "edje/mobile/w-input-selector.edj"
34 #define STT_EDJ_FILE_MOBILE "edje/mobile/w-input-stt.edj"
35
36 #define APP_EDJ_FILE_TV "edje/tv/w-input-selector.edj"
37 #define STT_EDJ_FILE_TV "edje/tv/w-input-stt.edj"
38
39 #define LOCALEDIR       "/usr/apps/org.tizen.inputdelegator/res/locale"
40 #define RESOURCEDIR "/usr/apps/org.tizen.inputdelegator/res/"
41
42
43 #include <app_control.h>
44 #include <Elementary.h>
45 #include <Evas.h>
46 #include <efl_extension.h>
47 #include <string>
48
49 using namespace std;
50
51 enum {
52         APP_TYPE_SELECT_MODE = 1,
53         APP_TYPE_STT,
54         APP_TYPE_EMOTICON,
55         APP_TYPE_REPLY,
56         APP_TYPE_HANDWRITING,
57         APP_TYPE_KEYBOARD,
58         APP_TYPE_DRAWING,
59         APP_TYPE_RECORDING,
60 };
61
62 enum {
63         REPLY_APP_NORMAL = 0,
64         REPLY_APP_CONTROL,
65 };
66
67 enum {
68     MIME_TYPE_ALL = 0,
69     MIME_TYPE_IMAGE,
70     MIME_TYPE_AUDIO,
71     MIME_TYPE_TEXT,
72 };
73
74 typedef enum {
75    TIZEN_PROFILE_UNKNOWN = 0,
76    TIZEN_PROFILE_MOBILE = 0x1,
77    TIZEN_PROFILE_WEARABLE = 0x2,
78    TIZEN_PROFILE_TV = 0x4,
79    TIZEN_PROFILE_IVI = 0x8,
80    TIZEN_PROFILE_COMMON = 0x10,
81 } tizen_profile_t;
82 extern tizen_profile_t _get_tizen_profile();
83 #if !defined(_TV)
84 #define _TV (_get_tizen_profile() == TIZEN_PROFILE_TV)
85 #endif
86 #if !defined(_MOBILE)
87 #define _MOBILE (_get_tizen_profile() == TIZEN_PROFILE_MOBILE)
88 #endif
89 #if !defined(_WEARABLE)
90 #define _WEARABLE (_get_tizen_profile() == TIZEN_PROFILE_WEARABLE)
91 #endif
92
93 typedef struct appdata{
94         Evas_Object* win_main;
95         Evas_Object* layout_main;
96         Evas_Object* conform;
97         Evas_Object* naviframe;
98         Evas_Object* genlist;
99         Eext_Circle_Surface *circle_surface;
100
101         app_control_h source_app_control;
102         int app_type;
103         int mime_type;
104         int reply_type;
105         char* res_path;
106         char* shared_res_path;
107 } App_Data;
108
109
110 typedef enum
111 {
112         GESTURE_MODE_DEFAULT,
113         GESTURE_MODE_START,
114         GESTURE_MODE_FREEZE,
115         GESTURE_MODE_END,
116 } Gesture_Mode_Type;
117
118 struct _InputKeyboardData
119 {
120         string guide_text;
121         string default_text;
122         string return_key_type;
123         int max_text_length;
124         int cursor_position_set;
125 };
126 typedef struct _InputKeyboardData InputKeyboardData;
127
128 struct _InputTypeData
129 {
130         char **input_type_array;
131         int input_type_array_len;
132 };
133 typedef struct _InputTypeData InputTypeData;
134
135 struct _InputTemplateData
136 {
137         char **input_template_array;
138         int input_template_array_len;
139 };
140 typedef struct _InputTemplateData InputTemplateData;
141
142 void _app_terminate(void* user_data);
143 void reply_to_sender_by_callback_for_back();
144 void reply_to_sender_by_callback(const char *value, const char *type, const char *path[], const char *cursor_pos);
145 char* get_resource_path();
146 char* get_shared_resource_path();
147 void show_gl_focus(Eina_Bool bVisible);
148 void show_popup_toast(const char *text, bool check_img);
149 void _back_to_genlist_for_selector();
150 void set_source_caller_app_id(app_control_h app_control);
151
152 #endif