Support API for set/get cursor position
[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
48 enum {
49         APP_TYPE_SELECT_MODE = 1,
50         APP_TYPE_STT,
51         APP_TYPE_EMOTICON,
52         APP_TYPE_REPLY,
53         APP_TYPE_HANDWRITING,
54         APP_TYPE_KEYBOARD,
55         APP_TYPE_DRAWING,
56         APP_TYPE_RECORDING,
57 };
58
59 enum {
60         REPLY_APP_NORMAL = 0,
61         REPLY_APP_CONTROL,
62 };
63
64 enum {
65     MIME_TYPE_ALL = 0,
66     MIME_TYPE_IMAGE,
67     MIME_TYPE_AUDIO,
68     MIME_TYPE_TEXT,
69 };
70
71 typedef enum {
72    TIZEN_PROFILE_UNKNOWN = 0,
73    TIZEN_PROFILE_MOBILE = 0x1,
74    TIZEN_PROFILE_WEARABLE = 0x2,
75    TIZEN_PROFILE_TV = 0x4,
76    TIZEN_PROFILE_IVI = 0x8,
77    TIZEN_PROFILE_COMMON = 0x10,
78 } tizen_profile_t;
79 extern tizen_profile_t _get_tizen_profile();
80 #if !defined(_TV)
81 #define _TV (_get_tizen_profile() == TIZEN_PROFILE_TV)
82 #endif
83 #if !defined(_MOBILE)
84 #define _MOBILE (_get_tizen_profile() == TIZEN_PROFILE_MOBILE)
85 #endif
86 #if !defined(_WEARABLE)
87 #define _WEARABLE (_get_tizen_profile() == TIZEN_PROFILE_WEARABLE)
88 #endif
89
90 typedef struct appdata{
91         Evas_Object* win_main;
92         Evas_Object* layout_main;
93         Evas_Object* conform;
94         Evas_Object* naviframe;
95         Evas_Object* genlist;
96         Eext_Circle_Surface *circle_surface;
97
98         app_control_h source_app_control;
99         int app_type;
100         int mime_type;
101         int reply_type;
102         char* res_path;
103         char* shared_res_path;
104 } App_Data;
105
106
107 typedef enum
108 {
109         GESTURE_MODE_DEFAULT,
110         GESTURE_MODE_START,
111         GESTURE_MODE_FREEZE,
112         GESTURE_MODE_END,
113 } Gesture_Mode_Type;
114
115 struct _InputKeyboardData
116 {
117         char *guide_text;
118         char *default_text;
119         char *return_key_type;
120         int max_text_length;
121         int cursor_position_set;
122 };
123 typedef struct _InputKeyboardData InputKeyboardData;
124
125 struct _InputTypeData
126 {
127         char **input_type_array;
128         int input_type_array_len;
129 };
130 typedef struct _InputTypeData InputTypeData;
131
132 void _app_terminate(void* user_data);
133 void reply_to_sender_by_callback_for_back();
134 void reply_to_sender_by_callback(const char *value, const char *type, const char *path[], const char *cursor_pos);
135 char* get_resource_path();
136 char* get_shared_resource_path();
137 void show_gl_focus(Eina_Bool bVisible);
138 void show_popup_toast(const char *text, bool check_img);
139 void _back_to_genlist_for_selector();
140 void set_source_caller_app_id(app_control_h app_control);
141
142 #endif