summaryrefslogtreecommitdiff
path: root/src/lib/elementary/elm_widget.eo
diff options
context:
space:
mode:
authorAmitesh Singh <amitesh.sh@samsung.com>2018-01-08 13:55:35 +0900
committerAmitesh Singh <amitesh.sh@samsung.com>2018-01-08 21:28:10 +0900
commit44d3227beb8b2064aa98ddedc90b29b8e9580278 (patch)
treeffa9f6c39dac2eefe6b911c1c8af954716818b1d /src/lib/elementary/elm_widget.eo
parentade2c9ed520e20b7855b08df61077874e8d1d6c1 (diff)
widget: rename elm widget to Efl.Ui.Widget.
Diffstat (limited to 'src/lib/elementary/elm_widget.eo')
-rw-r--r--src/lib/elementary/elm_widget.eo617
1 files changed, 0 insertions, 617 deletions
diff --git a/src/lib/elementary/elm_widget.eo b/src/lib/elementary/elm_widget.eo
deleted file mode 100644
index a3bf4f1ca6..0000000000
--- a/src/lib/elementary/elm_widget.eo
+++ /dev/null
@@ -1,617 +0,0 @@
1function Efl.Ui.Scrollable_On_Show_Region {
2 [[Function pointer for on show region hook]]
3 params {
4 @in obj: Efl.Canvas.Object; [[Canvas object]]
5 @in region: Eina.Rect; [[Showed region]]
6 }
7};
8
9struct Efl.Ui.Widget.Focus_State {
10 [[All relevant fields needed for the current state of focus registeration]]
11 manager : Efl.Ui.Focus.Manager; [[The manager where the widget is registered in]]
12 parent : Efl.Ui.Focus.User; [[The parent the widget is using as logical parent]]
13 logical : bool; [[$true if this is registered as logical currently]]
14}
15
16/* ATTENTION: Rename to Efl.Ui.Widget is imminent. */
17abstract Elm.Widget (Efl.Canvas.Group, Efl.Access,
18 Efl.Access.Component, Efl.Ui.Focus.User, Efl.Part,
19 Efl.Ui.Focus.Object, Efl.Ui.Base, Efl.Ui.Cursor,
20 Efl.Ui.Translatable)
21{
22 [[Elementary widget abstract class]]
23 legacy_prefix: elm_widget;
24 eo_prefix: efl_ui_widget;
25 event_prefix: efl_ui_widget;
26 data: Efl_Ui_Widget_Data;
27 methods {
28 @property resize_object @protected {
29 [[This is the internal canvas object managed by a widget.
30
31 This property is protected as it is meant for widget implementations
32 only, to set and access the internal canvas object. Do use this
33 function unless you're implementing a widget.
34 ]]
35 set {
36 [[Sets the new resize object for this widget.]]
37 }
38 values {
39 sobj: Efl.Canvas.Object @nullable;
40 [[A canvas object (often a @Efl.Canvas.Layout object).]]
41 }
42 }
43 @property disabled {
44 [[Whether the widget is enabled (accepts and reacts to user inputs).
45
46 Each widget may handle the disabled state differently, but overall
47 disabled widgets shall not respond to any input events. This is
48 $false by default, meaning the widget is enabled.
49 ]]
50 set {
51 [[Enables or disables this widget.
52
53 Disabling a widget will disable all its children recursively,
54 but only this widget will be marked as disabled internally.
55 ]]
56 }
57 get {
58 [[Returns whether the widget is disabled.
59
60 This will return $true if any widget in the parent hierarchy
61 is disabled. Re-enabling that parent may in turn change the
62 disabled state of this widget.
63 ]]
64 }
65 values {
66 disabled: bool(false); [[$true if the widget is disabled.]]
67 }
68 }
69 @property style {
70 [[The widget style to use.
71
72 Styles define different look and feel for widgets, and may provide
73 different parts for layout-based widgets. Styles vary from widget
74 to widget and may be defined by other themes by means of extensions
75 and overlays.
76
77 The style can only be set before @Efl.Object.finalize, which means
78 at construction time of the object (inside $efl_add in C).
79 ]]
80 set @protected {
81 [[Can only be called during construction, before finalize.]]
82 return: Efl.Ui.Theme.Apply(0);
83 [[Whether the style was successfully applied or not, see
84 the values of @Efl.Ui.Theme.Apply for more information.]]
85 }
86 get {
87 [[Returns the current style of a widget.]]
88 }
89 values {
90 style: string;
91 [[Name of the style to use. Refer to each widget's documentation
92 for the available style names, or to the themes in use.]]
93 }
94 }
95 widget_event @protected {
96 [[Virtual function handling input events on the widget.
97
98 This method should return $true if the event has been processed.
99 Only key down, key up and pointer wheel events will be propagated
100 through this function.
101
102 It is common for the event to be also marked as processed as in
103 @Efl.Input.Event.processed, if this operation was successful. This
104 makes sure other widgets will not also process this input event.
105 ]]
106 params {
107 @cref eo_event: Efl.Event;
108 [[EO event struct with an Efl.Input.Event as info.]]
109 @in source: Efl.Canvas.Object;
110 [[Source object where the event originated. Often same as this.]]
111 }
112 return: bool; [[$true on success, $false otherwise]]
113 legacy: null;
114 }
115 @property orientation_mode_disabled {
116 [[Whether the widget's automatic orientation is disabled or not.
117
118 Orientation mode is used for widgets to change their style or send
119 signals based on the canvas rotation (i.e. the window orientation).
120 If the orientation mode is enabled, the widget will emit signals
121 such as "elm,state,orient,N" where $N is one of 0, 90, 180, 270,
122 depending on the window orientation. Such signals may be handled by
123 the theme in order to provide a different look for the widget based
124 on the canvas orientation.
125
126 By default orientation mode is enabled, which means this property
127 is $false.
128 ]]
129 values {
130 disabled: bool(false); [[$true if the orientation mode is disabled.]]
131 }
132 }
133 // FIXME: focus_allow? can_focus? focusable?
134 @property focus_allow {
135 [[The ability for a widget to be focused.
136
137 Unfocusable objects do nothing when programmatically focused. The
138 nearest focusable parent object the one really getting focus. Also,
139 when they receive mouse input, they will get the event, but not take
140 away the focus from where it was previously.
141
142 Note: Objects which are meant to be interacted with by input events
143 are created able to be focused, by default. All the others are not.
144
145 This property's default value depends on the widget (eg. a box is
146 not focusable, but a button is).
147 ]]
148 set {
149 legacy: elm_widget_can_focus_set;
150 }
151 get {
152 legacy: elm_widget_can_focus_get;
153 }
154 values {
155 can_focus: bool; [[Whether the object is focusable.]]
156 }
157 }
158 @property widget_parent @protected {
159 [[The internal parent of this widget.
160
161 @Elm.Widget objects have a parent hierarchy that may differ slightly
162 from their @Efl.Object or @Efl.Canvas.Object hierarchy. This is
163 meant for internal handling.
164
165 See also @.widget_top.
166 ]]
167 set {}
168 get {
169 legacy: elm_widget_parent_get; /* internal in legacy */
170 }
171 values {
172 parent: Elm.Widget @nullable; [[Widget parent object]]
173 }
174 }
175 @property widget_top {
176 [[Root widget in the widget hierarchy.
177
178 This returns the top widget, in terms of widget hierarchy. This is
179 usually a window (@Efl.Ui.Win). This function walks the list of
180 @.widget_parent.
181
182 If this widget has no parent (in terms of widget hierarchy) this
183 will return $null.
184
185 Note: This may not be a display manager window in case of nested
186 canvases. If a "real" window is required, then you might want to
187 verify that the returned object is a $Efl.Ui.Win_Inlined, and then
188 get $Efl.Ui.Win_Inlined.inlined_parent to find an object in the
189 master window.
190
191 See also @.widget_parent.
192 ]]
193 get {
194 legacy: elm_widget_top_get; /* internal in legacy */
195 }
196 values {
197 top: Elm.Widget; [[Top widget, usually a window.]]
198 }
199 }
200
201 /* Accessibility */
202 @property access_info {
203 [[Accessibility information.
204
205 This is a replacement string to be read by the accessibility
206 text-to-speech engine, if accessibility is enabled by configuration.
207 This will take precedence over the default text for this object,
208 which means for instance that the label of a button won't be read
209 out loud, instead $txt will be read out.
210 ]]
211 values {
212 txt: string @nullable; [[Accessibility text description.]]
213 }
214 }
215 on_access_activate @protected @beta {
216 [[Hook function called when widget is activated through accessibility.
217
218 This meant to be overridden by subclasses to support accessibility.
219 This is an unstable API.
220 ]]
221 params {
222 @in act: Efl.Ui.Activate; [[Type of activation.]]
223 }
224 return: bool; [[$true on success, $false otherwise]]
225 legacy: null; /* FIXME: legacy API does extra work */
226 }
227 on_access_update @protected @beta {
228 [[Hook function called when accessibility is changed on the widget.
229
230 This meant to be overridden by subclasses to support accessibility.
231 This is an unstable API.
232 ]]
233 params {
234 @in enable: bool; [[$true if accessibility is enabled.]]
235 }
236 legacy: null; /* FIXME: legacy API does extra work */
237 }
238
239 /* Internal hooks. */
240 widget_sub_object_add @protected {
241 [[Virtual function handling sub objects being added.
242
243 Sub objects can be any canvas object, not necessarily widgets.
244
245 See also @.widget_parent.
246 ]]
247 params {
248 @in sub_obj: Efl.Canvas.Object;
249 [[Sub object to be added. Not necessarily a widget itself.]]
250 }
251 return: bool; [[Indicates if the operation succeeded.]]
252 legacy: elm_widget_sub_object_add;
253 }
254 widget_sub_object_del @protected {
255 [[Virtual function handling sub objects being removed.
256
257 Sub objects can be any canvas object, not necessarily widgets.
258
259 See also @.widget_parent.
260 ]]
261 params {
262 @in sub_obj: Efl.Canvas.Object;
263 [[Sub object to be removed. Should be a child of this widget.]]
264 }
265 return: bool; [[Indicates if the operation succeeded.]]
266 legacy: elm_widget_sub_object_del;
267 }
268 on_orientation_update @protected {
269 [[Virtual function handling canvas orientation changes.
270
271 This method will be called recursively from the top widget (the
272 window) to all the children objects whenever the window rotation
273 is changed. The given $rotation will be one of 0, 90, 180, 270 or
274 the special value -1 if @.orientation_mode_disabled is $true.
275
276 If @.orientation_mode_disabled is $false, the default implementation
277 will emit the signal "elm,state,orient,$R" will be emitted (where $R
278 is the rotation angle in degrees).
279
280 Note: This function may be called even if the orientation has not
281 actually changed, like when a widget needs to be reconfigured.
282
283 See also @Efl.Orientation.orientation.set.
284 ]]
285 params {
286 rotation: int; [[Orientation in degrees: 0, 90, 180, 270 or -1 if
287 @.orientation_mode_disabled is $true.]]
288 }
289 }
290 on_disabled_update @protected {
291 [[Virtual function called when the widget becomes disabled.
292
293 This may be triggered even if this widget is not disabled, as the
294 parent widget could be disabled and propagate its state.
295 ]]
296 params {
297 disabled: bool; [[The new value of @.disabled.]]
298 }
299 return: bool; [[Indicates if the operation succeeded.]]
300 }
301 theme_apply @protected {
302 [[Virtual function called when the widget needs to re-apply its theme.
303
304 This may be called when the object is first created, or whenever
305 the widget is modified in any way that may require a reload of the
306 theme. This may include but is not limited to scale, theme, or
307 mirrored mode changes.
308
309 Note: even widgets not based on layouts may override this method
310 to handle widget updates (scale, mirrored mode, etc...).
311 ]]
312 return: Efl.Ui.Theme.Apply; [[Indicates success, and if the current
313 theme or default theme was used.]]
314 }
315 on_focus_update @protected {
316 [[Virtual function handling focus in/out events on the widget]]
317 params {
318 /* FIXME: EO API is not supposed to have any widget item!!! */
319 @in item: Elm.Widget.Item @nullable; [[Widget]]
320 }
321 return: bool; [[$true if this widget can handle focus, $false otherwise]]
322 }
323
324 /* Scroll API. */
325 @property on_show_region_hook @protected {
326 [[Hook function called when the @.show_region is changed.
327
328 See also @.show_region.
329 ]]
330 set {}
331 values {
332 func: Efl.Ui.Scrollable_On_Show_Region @nullable; [[Region hook function]]
333 }
334 }
335 @property show_region @protected {
336 [[Region inside the widget to show.
337
338 See also @.on_show_region_hook.
339 ]]
340 set {
341 [[Request parent scrollers to pan around so that this region
342 of the widget becomes visible.
343
344 If $force is $true this will trigger scroller changes and
345 the @.on_show_region_hook to be called even if the region is
346 unchanged.
347 ]]
348 values {
349 region: Eina.Rect; [[The region to show.]]
350 force: bool; [[Set to $true to force show even if unchanged.]]
351 }
352 }
353 get {
354 [[Returns the current region to show.]]
355 values {
356 region: Eina.Rect; [[The region to show.]]
357 }
358 }
359 }
360
361 /* FIXME: Scroll API. Not sure how those APIs should be exposed with
362 * the new scrollable API. */
363 scroll_hold_push {
364 [[Push scroll hold]]
365 }
366 scroll_hold_pop {
367 [[Pop scroller hold]]
368 }
369 scroll_freeze_push {
370 [[Push scroller freeze]]
371 }
372 scroll_freeze_pop {
373 [[Pop scroller freeze]]
374 }
375
376 /* Region of interest */
377 @property interest_region @protected {
378 [[Region of interest inside this widget, that should be given
379 priority to be visible inside a scroller.
380
381 When this widget or one of its subwidgets is given focus, this
382 region should be shown, which means any parent scroller should
383 attempt to display the given area of this widget. For instance, an
384 entry given focus should scroll to show the text cursor if that
385 cursor moves. In this example, this region defines the relative
386 geometry of the cursor within the widget.
387
388 Note: The region is relative to the top-left corner of the widget,
389 i.e. X,Y start from 0,0 to indicate the top-left corner of the
390 widget. W,H must be greater or equal to 1 for this region to be
391 taken into account, otherwise it is ignored.
392
393 See also @.interest_region_mode
394 ]]
395 get {
396 legacy: elm_widget_focus_region_get;
397 }
398 values {
399 region: Eina.Rect;
400 [[The relative region to show. If width or height is <= 0 it
401 will be ignored, and no action will be taken.]]
402 }
403 }
404 @property interest_region_mode {
405 [[Defines how @.show_region should be calculated.
406
407 It is up to the implementation of @.show_region.get to take this
408 value into account (or ignore it).
409 ]]
410 get {
411 legacy: elm_widget_focus_region_show_mode_get;
412 }
413 set {
414 legacy: elm_widget_focus_region_show_mode_set;
415 }
416 values {
417 mode: Efl.Ui.Interest_Region_Mode;
418 [[Whether to show a specific item or the widget as a whole.]]
419 }
420 }
421
422 /* Focus highlight (visual focus rectangle) properties */
423 @property focus_highlight_geometry @protected {
424 [[The rectangle region to be highlighted on focus.
425
426 This is a rectangle region where the focus highlight should be
427 displayed.
428 ]]
429 get {
430 [[This is a read-only property.]]
431 }
432 values {
433 region: Eina.Rect; [[The rectangle area.]]
434 }
435 }
436 @property focus_highlight_enabled {
437 [[Whether focus highlight is enabled or not.
438
439 As of EFL 1.21 focus highlight properties apply to a single window,
440 not a single widget. As a consequence, calls to this function may
441 be forwarded to the parent window. Future versions of EFL may
442 implement widget-specific focus highlight properties.
443
444 See also @.widget_top.
445 See also @.focus_highlight_style.
446 See also @.focus_highlight_animate.
447 ]]
448 set {
449 [[Set the enabled status for the focus highlight in a window.
450
451 This function will enable or disable the focus highlight,
452 regardless of the global setting for it.
453 ]]
454 }
455 get {
456 [[Get the enabled value of the focus highlight for this window.]]
457 }
458 values {
459 enabled: bool; [[The enabled value for the highlight.]]
460 }
461 }
462 @property focus_highlight_style {
463 [[Control the widget focus highlight style.
464
465 If $style is $null, the default will be used.
466
467 As of EFL 1.21 focus highlight properties apply to a single window,
468 not a single widget. As a consequence, calls to this function may
469 be forwarded to the parent window. Future versions of EFL may
470 implement widget-specific focus highlight properties.
471
472 See also @.widget_top.
473 See also @.focus_highlight_enabled.
474 See also @.focus_highlight_animate.
475 ]]
476 set {
477 /* FIXME: This is async... success here means nothing. */
478 return: bool; [[$true on success, $false otherwise.]]
479 }
480 get {
481 }
482 values {
483 style: string @nullable; [[The name of the focus highlight style.]]
484 }
485 }
486 @property focus_highlight_animate {
487 [[Whether focus highlight should animate or not.
488
489 As of EFL 1.21 focus highlight properties apply to a single window,
490 not a single widget. As a consequence, calls to this function may
491 be forwarded to the parent window. Future versions of EFL may
492 implement widget-specific focus highlight properties.
493
494 See also @.widget_top.
495 See also @.focus_highlight_style.
496 See also @.focus_highlight_enabled.
497 ]]
498 set {
499 [[Set the animate status for the focus highlight for this window.
500
501 This function will enable or disable the animation of focus
502 highlight.
503 ]]
504 }
505 get {
506 [[Get the animate value of the focus highlight for this window.]]
507 }
508 values {
509 animate: bool; [[The enabled value for the highlight animation.]]
510 }
511 }
512 @property focus_move_policy @beta {
513 [[The widget's focus move policy.]]
514 values {
515 policy: Efl.Ui.Focus.Move_Policy; [[Focus move policy]]
516 }
517 }
518 @property focus_move_policy_automatic @beta {
519 [[Control the widget's focus_move_policy mode setting.
520
521 @since 1.18]]
522 values {
523 automatic: bool; [[$true to follow system focus move policy change,
524 $false otherwise]]
525 }
526 }
527
528 /* FIXME: No more items in EO API */
529 @property focused_item @beta {
530 get {
531 [[Get the focused widget item.]]
532 return: Elm.Widget.Item; [[Focused item]]
533 }
534 }
535
536 /* Focus Manager API */
537 focus_state_apply @protected {
538 [[Register focus with the given configuration.
539
540 The implementation can feel free to change the logical flag as it
541 wants, but other than that it should strictly keep the configuration.
542
543 The implementation in elm.widget updates the current state into what
544 is passed as configured state, respecting manager changes,
545 registeration and unregistration based on if it should be registered
546 or unregistered.
547
548 A manager field that is $null means that the widget should not or was
549 not registered.
550 ]]
551 params {
552 @in current_state : Efl.Ui.Widget.Focus_State;
553 [[The focus manager to register with.]]
554 @inout configured_state : Efl.Ui.Widget.Focus_State;
555 [[The evalulated Focus state that should be used.]]
556 @in redirect : Elm.Widget;
557 [[A redirect that will be set by the elm.widget implementation.]]
558 }
559 return: bool; [[Returns whether the widget is registered or not.]]
560 }
561 focus_manager_create @protected {
562 [[If the widget needs a focus manager, this function will be called.
563
564 It can be used and overriden to inject your own manager or set
565 custom options on the focus manager.
566 ]]
567 params {
568 @in root: Efl.Ui.Focus.Object; [[The logical root object for focus.]]
569 }
570 return: Efl.Ui.Focus.Manager; [[The focus manager.]]
571 }
572 }
573 parts {
574 shadow: Efl.Ui.Widget.Part_Shadow;
575 }
576 implements {
577 class.constructor;
578 Efl.Object.constructor;
579 Efl.Object.finalize;
580 Efl.Object.destructor;
581 Efl.Object.provider_find;
582 Efl.Object.debug_name_override;
583 Efl.Gfx.Color.color { set; }
584 Efl.Gfx.visible { set; }
585 Efl.Gfx.position { set; }
586 Efl.Gfx.size { set; }
587 Efl.Gfx.scale { set; get; }
588 Efl.Canvas.Object.clip { set; }
589 Efl.Canvas.Object.no_render { set; }
590 Efl.Canvas.Object.is_frame_object { set; }
591 Efl.Canvas.Group.group_calculate;
592 Efl.Canvas.Group.group_member_del;
593 Efl.Canvas.Group.group_member_add;
594 Efl.Access.name { get; }
595 Efl.Access.state_set { get; }
596 Efl.Access.children { get; }
597 Efl.Access.parent { get; }
598 Efl.Access.attributes { get; }
599 Efl.Access.Component.focus_grab;
600 Efl.Ui.Focus.User.focus_manager { get; }
601 Efl.Ui.Focus.User.focus_parent { get; }
602 Efl.Ui.Focus.Object.focus_geometry { get; }
603 Efl.Ui.Focus.Object.focus { set; }
604 Efl.Ui.Base.mirrored { get; set; }
605 Efl.Ui.Base.mirrored_automatic { get; set; }
606 Efl.Ui.Cursor.cursor { get; set; }
607 Efl.Ui.Cursor.cursor_style { get; set; }
608 Efl.Ui.Cursor.cursor_theme_search_enabled { get; set; }
609 Efl.Ui.Translatable.translation_update; [[This implements the calls to $gettext() and $text_set().]]
610 Efl.Part.part; [[Returns @Efl.Ui.Widget.Part.]]
611 }
612 events {
613 moved; [[Called when widget moved]]
614 language,changed; [[Called when widget language changed]]
615 access,changed; [[Called when accessibility changed]]
616 }
617}