summaryrefslogtreecommitdiff
path: root/src/lib/elementary/elm_entry_common.h
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2016-03-23 12:56:14 -0700
committerCedric BAIL <cedric@osg.samsung.com>2016-03-23 13:24:41 -0700
commitc2a1c49ab2042f559b28e840e54feb8494888e0e (patch)
treec6eb110b7c479499854eede9d0c3ab0a80c9a11a /src/lib/elementary/elm_entry_common.h
parent9340855597e7e465435c69b6278650346688da14 (diff)
elementary: move all legacy files to their expected new location.
Diffstat (limited to 'src/lib/elementary/elm_entry_common.h')
-rw-r--r--src/lib/elementary/elm_entry_common.h259
1 files changed, 259 insertions, 0 deletions
diff --git a/src/lib/elementary/elm_entry_common.h b/src/lib/elementary/elm_entry_common.h
new file mode 100644
index 0000000..01ececb
--- /dev/null
+++ b/src/lib/elementary/elm_entry_common.h
@@ -0,0 +1,259 @@
1/**
2 * @addtogroup Elm_Entry
3 *
4 * @{
5 */
6enum
7{
8 ELM_INPUT_PANEL_LAYOUT_NORMAL_VARIATION_NORMAL, /**< The plain normal layout @since 1.12 */
9 ELM_INPUT_PANEL_LAYOUT_NORMAL_VARIATION_FILENAME, /**< Filename layout. Symbols such as '/' should be disabled. @since 1.12 */
10 ELM_INPUT_PANEL_LAYOUT_NORMAL_VARIATION_PERSON_NAME /**< The name of a person. @since 1.12 */
11};
12
13enum
14{
15 ELM_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_NORMAL, /**< The plain normal number layout @since 1.8 */
16 ELM_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_SIGNED, /**< The number layout to allow a positive or negative sign at the start @since 1.8 */
17 ELM_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_DECIMAL, /**< The number layout to allow decimal point to provide fractional value @since 1.8 */
18 ELM_INPUT_PANEL_LAYOUT_NUMBERONLY_VARIATION_SIGNED_AND_DECIMAL /**< The number layout to allow decimal point and negative sign @since 1.8 */
19};
20
21enum
22{
23 ELM_INPUT_PANEL_LAYOUT_PASSWORD_VARIATION_NORMAL, /**< The normal password layout @since 1.12 */
24 ELM_INPUT_PANEL_LAYOUT_PASSWORD_VARIATION_NUMBERONLY /**< The password layout to allow only number @since 1.12 */
25};
26/**
27 * The info sent in the callback for the "anchor,clicked" signals emitted
28 * by entries.
29 */
30typedef struct _Elm_Entry_Anchor_Info Elm_Entry_Anchor_Info;
31
32/**
33 * The info sent in the callback for the "anchor,clicked" signals emitted
34 * by entries.
35 */
36struct _Elm_Entry_Anchor_Info
37{
38 const char *name; /**< The name of the anchor, as stated in its href */
39 int button; /**< The mouse button used to click on it */
40 Evas_Coord x, /**< Anchor geometry, relative to canvas */
41 y, /**< Anchor geometry, relative to canvas */
42 w, /**< Anchor geometry, relative to canvas */
43 h; /**< Anchor geometry, relative to canvas */
44};
45
46/**
47 * The info sent in the callback for "anchor,clicked" signals emitted by
48 * the Anchor_Hover widget.
49 */
50typedef struct _Elm_Entry_Anchor_Hover_Info Elm_Entry_Anchor_Hover_Info;
51
52/**
53 * Type of contextual item that can be added in to long press menu.
54 * @since 1.8
55 */
56typedef struct _Elm_Entry_Context_Menu_Item Elm_Entry_Context_Menu_Item;
57
58/**
59 * The info sent in the callback for "anchor,clicked" signals emitted by
60 * the Anchor_Hover widget.
61 */
62struct _Elm_Entry_Anchor_Hover_Info
63{
64 const Elm_Entry_Anchor_Info *anchor_info; /**< The actual anchor info. */
65 Evas_Object *hover; /**< The hover object to use for the popup */
66 struct
67 {
68 Evas_Coord x, y, w, h;
69 } hover_parent; /**< Geometry of the object used as parent by the
70 hover */
71 Eina_Bool hover_left : 1; /**< Hint indicating if there's space
72 for content on the left side of
73 the hover. Before calling the
74 callback, the widget will make the
75 necessary calculations to check
76 which sides are fit to be set with
77 content, based on the position the
78 hover is activated and its distance
79 to the edges of its parent object
80 */
81 Eina_Bool hover_right : 1; /**< Hint indicating content fits on
82 the right side of the hover.
83 See @ref hover_left */
84 Eina_Bool hover_top : 1; /**< Hint indicating content fits on top
85 of the hover. See @ref hover_left */
86 Eina_Bool hover_bottom : 1; /**< Hint indicating content fits
87 below the hover. See @ref
88 hover_left */
89};
90
91/**
92 * This callback type is used to provide items.
93 * If it returns an object handle other than NULL (it should create an
94 * object to do this), then this object is used to replace the current item.
95 * If not the next provider is called until one provides an item object, or the
96 * default provider in entry does.
97 * @param data The data specified as the last param when adding the provider
98 * @param entry The entry object
99 * @param text A pointer to the item href string in the text
100 * @return The object to be placed in the entry like an icon, or other element
101 * @see elm_entry_item_provider_append
102 * @see elm_entry_item_provider_prepend
103 * @see elm_entry_item_provider_remove
104 */
105typedef Evas_Object * (*Elm_Entry_Item_Provider_Cb)(void *data, Evas_Object * entry, const char *item);
106
107/**
108 * This callback type is used by entry filters to modify text.
109 * @param data The data specified as the last param when adding the filter
110 * @param entry The entry object
111 * @param text A pointer to the location of the text being filtered. The type of text is always markup. This data can be modified, but any additional allocations must be managed by the user.
112 * @see elm_entry_markup_filter_append
113 * @see elm_entry_markup_filter_prepend
114 * @see elm_entry_markup_filter_remove
115 */
116typedef void (*Elm_Entry_Filter_Cb)(void *data, Evas_Object *entry, char **text);
117
118/**
119 * This corresponds to Edje_Entry_Change_Info. Includes information about
120 * a change in the entry.
121 */
122typedef Edje_Entry_Change_Info Elm_Entry_Change_Info;
123
124/**
125 * This converts a markup (HTML-like) string into UTF-8.
126 *
127 * The returned string is a malloc'ed buffer and it should be freed when
128 * not needed anymore.
129 *
130 * @param s The string (in markup) to be converted
131 * @return The converted string (in UTF-8). It should be freed.
132 */
133EAPI char *elm_entry_markup_to_utf8(const char *s);
134
135/**
136 * This converts a UTF-8 string into markup (HTML-like).
137 *
138 * The returned string is a malloc'ed buffer and it should be freed when
139 * not needed anymore.
140 *
141 * @param s The string (in UTF-8) to be converted
142 * @return The converted string (in markup). It should be freed.
143 *
144 * For example, passing "<align=center>hello</align>&gt;" will return
145 * "&lt;align=center&gt;hello&lt;/align&gt; &amp;gt;". This is useful when you
146 * want to display "&" in label, entry, and some widgets which use textblock
147 * internally.
148 */
149EAPI char *elm_entry_utf8_to_markup(const char *s);
150
151
152
153/* pre-made filters for entries */
154
155/**
156 * Data for the elm_entry_filter_limit_size() entry filter.
157 */
158typedef struct _Elm_Entry_Filter_Limit_Size Elm_Entry_Filter_Limit_Size;
159
160/**
161 * Data for the elm_entry_filter_limit_size() entry filter.
162 */
163struct _Elm_Entry_Filter_Limit_Size
164{
165 int max_char_count; /**< The maximum number of characters allowed. */
166 int max_byte_count; /**< The maximum number of bytes allowed*/
167};
168
169/**
170 * Filter inserted text based on user defined character and byte limits
171 *
172 * Add this filter to an entry to limit the characters that it will accept
173 * based the contents of the provided #Elm_Entry_Filter_Limit_Size.
174 * The function works on the UTF-8 representation of the string, converting
175 * it from the set markup, thus not accounting for any format in it.
176 *
177 * The user must create an #Elm_Entry_Filter_Limit_Size structure and pass
178 * it as data when setting the filter. In it, it's possible to set limits
179 * by character count or bytes (any of them is disabled if 0), and both can
180 * be set at the same time. In that case, it first checks for characters,
181 * then bytes. The #Elm_Entry_Filter_Limit_Size structure must be alive and
182 * valid for as long as the entry is alive AND the elm_entry_filter_limit_size
183 * filter is set.
184 *
185 * The function will cut the inserted text in order to allow only the first
186 * number of characters that are still allowed. The cut is made in
187 * characters, even when limiting by bytes, in order to always contain
188 * valid ones and avoid half unicode characters making it in.
189 *
190 * This filter, like any others, does not apply when setting the entry text
191 * directly with elm_object_text_set().
192 */
193EAPI void elm_entry_filter_limit_size(void *data, Evas_Object *entry, char **text);
194
195/**
196 * Data for the elm_entry_filter_accept_set() entry filter.
197 */
198typedef struct _Elm_Entry_Filter_Accept_Set Elm_Entry_Filter_Accept_Set;
199
200/**
201 * Data for the elm_entry_filter_accept_set() entry filter.
202 */
203struct _Elm_Entry_Filter_Accept_Set
204{
205 const char *accepted; /**< Set of characters accepted in the entry. */
206 const char *rejected; /**< Set of characters rejected from the entry. */
207};
208
209/**
210 * Filter inserted text based on accepted or rejected sets of characters
211 *
212 * Add this filter to an entry to restrict the set of accepted characters
213 * based on the sets in the provided #Elm_Entry_Filter_Accept_Set.
214 * This structure contains both accepted and rejected sets, but they are
215 * mutually exclusive. This structure must be available for as long as
216 * the entry is alive AND the elm_entry_filter_accept_set is being used.
217 *
218 * The @c accepted set takes preference, so if it is set, the filter will
219 * only work based on the accepted characters, ignoring anything in the
220 * @c rejected value. If @c accepted is @c NULL, then @c rejected is used.
221 *
222 * In both cases, the function filters by matching utf8 characters to the
223 * raw markup text, so it can be used to remove formatting tags.
224 *
225 * This filter, like any others, does not apply when setting the entry text
226 * directly with elm_object_text_set()
227 */
228EAPI void elm_entry_filter_accept_set(void *data, Evas_Object *entry, char **text);
229
230/**
231 * Get the text of the contextual menu item of entry.
232 *
233 * @param item The item to get the label
234 * @return The text of contextual menu item
235 *
236 * @see elm_entry_context_menu_item_add()
237 * @since 1.8
238 */
239EAPI const char *elm_entry_context_menu_item_label_get(const Elm_Entry_Context_Menu_Item *item);
240
241/**
242 * Get the icon object packed in the contextual menu item of entry.
243 *
244 * @param item The item to get the icon from
245 * @param icon_file The image file path on disk used for the icon or standard
246 * icon name
247 * @param icon_group The edje group used if @p icon_file is an edje file. NULL
248 * if the icon is not an edje file
249 * @param icon_type The icon type
250 *
251 * @see elm_entry_context_menu_item_add()
252 * @since 1.8
253 */
254EAPI void elm_entry_context_menu_item_icon_get(const Elm_Entry_Context_Menu_Item *item, const char **icon_file, const char **icon_group, Elm_Icon_Type *icon_type);
255
256
257/**
258 * @}
259 */