summaryrefslogtreecommitdiff
path: root/src/lib/elementary/efl_ui_popup.eo
blob: 619f7d7549aa2bf78467d5dd6985fcce19d1b8ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
parse efl_gfx_hint;
enum @beta Efl.Ui.Popup_Align {
    [[This is the alignment method for positioning Popup widgets.]]
    none = 0, [[Popup not aligned.]]
    center,   [[Popup is aligned to the center of its anchor object.]]
    left,     [[Popup's left edge is aligned to the left side of its anchor object.]]
    right,    [[Popup's right edge is aligned to the right side of its anchor object.]]
    top,      [[Popup's top is aligned to the top of its anchor object.]]
    bottom    [[Popup's bottom is aligned to the bottom of its anchor object.]]
}

class @beta Efl.Ui.Popup extends Efl.Ui.Layout_Base implements Efl.Content, Efl.Ui.Focus.Layer,
                                                               Efl.Ui.Widget_Scrollable_Content
{
   [[A styled container widget which overlays a window's contents.

     The Popup widget is a theme-capable container which can be used for various purposes.
     Regular contents can be set using the @Efl.Content interface, or basic scrollable contents
     can be set through the @Efl.Ui.Widget_Scrollable_Content mixin API. For contents which
     should be scrollable but require more fine-grained tuning, it may be necessary for users
     to set up and provide their own scroller object such as @Efl.Ui.Scroller.

     A Popup widget will create an overlay for the window contents. This overlay is an
     @Efl.Ui.Popup_Part_Backwall object, which provides functionality for passing events
     through to the main window while the Popup is active as well as the ability to set
     background images for the Popup.

     By default, a Popup is positioned by the user through the @Efl.Gfx.Entity.position property.
     This behavior can be altered by using the @.align and @.anchor properties. Setting the
     @Efl.Gfx.Entity.position property directly will unset both the @.align and @.anchor properties,
     and vice versa.

     By default, a Popup will size itself based on the minimum size of its contents through the
     @Efl.Gfx.Hint interface. A Popup will never size itself smaller than the minimum size of its contents,
     but by manually setting the @Efl.Gfx.Entity.size property or the @Efl.Gfx.Hint.hint_size_min property,
     a larger size can be specified.

     Users can set a given Popup widget to close automatically after a specified time using the @.closing_timeout
     property.

     For a Popup with a more specialized purpose, see @Efl.Ui.Alert_Popup.
   ]]
   methods {
      @property align {
         [[The align property specifies a Popup's current positioning relative to its anchor.

           When set, this property will override any user-provided value for
           the widget's @Efl.Gfx.Entity.position property.
         ]]
         set {
         }
         get {
         }
         values {
             type: Efl.Ui.Popup_Align; [[Alignment of the Popup relative to its anchor.
                                         The default is @Efl.Ui.Popup_Align.none.]]
         }
      }
      @property closing_timeout {
         [[The closing_timeout property is the time after which the Popup widget will be automatically deleted.

           The timer is initiated at the time when the popup is shown. If the value is changed
           prior to the timer expiring, the existing timer will be deleted. If the new value is greater than $0,
           a new timer will be created.
         ]]
         set {
         }
         get {
         }
         values {
             time: double; [[If greater than $0, the Popup will close automatically after the value in seconds.
                             The default is to not automatically delete the Popup.]]
         }
      }
      @property anchor {
         [[The anchor object is the reference object for positioning a Popup
           using the @.align and @.align_priority properties.

           A Popup will recalculate its alignment relative to its anchor and change its position when:
           - the anchor object is moved (unless the anchor is a window)
           - the anchor object is resized
           - the Popup is resized
           - the parent window is resized

           If @.anchor.get returns $NULL, the anchor is the parent window of the Popup.
           If the anchor object is set to $NULL, the Popup will no longer recalculate its alignment or change
           its position under any circumstance.
           If the Popup is moved by using @Efl.Gfx.Entity.position.set, $anchor is set $NULL.
         ]]
         set {
         }
         get {
         }
         values {
            anchor: Efl.Canvas.Object; [[The object which Popup is following. By default this is $NULL.]]
         }
      }
      @property align_priority {
         [[This is the priority in which alignments will be tested using the anchor object if the value of @.align
           is determined to be invalid. If a given alignment would result in the popup being partially or fully
           outside the visible area of the window, it is deemed invalid, and the next alignment is tested
           until either the priority list is exhausted or a usable alignment is found.

           An alignment will also be deemed invalid if the popup occludes its anchor object,
           except if @Efl.Ui.Popup_Align.center is specified.
         ]]
         set {
         }
         get {
         }
         values {
            first: Efl.Ui.Popup_Align;  [[First alignment. The default is @Efl.Ui.Popup_Align.top.]]
            second: Efl.Ui.Popup_Align; [[Second alignment. The default is @Efl.Ui.Popup_Align.left.]]
            third: Efl.Ui.Popup_Align;  [[Third alignment. The default is @Efl.Ui.Popup_Align.right.]]
            fourth: Efl.Ui.Popup_Align; [[Fourth alignment. The default is @Efl.Ui.Popup_Align.bottom.]]
            fifth: Efl.Ui.Popup_Align;  [[Fifth alignment. The default is @Efl.Ui.Popup_Align.center.]]
         }
      }
   }
   parts {
      backwall: Efl.Ui.Popup_Part_Backwall; [[A backwall behind the Popup.]]
   }
   implements {
      Efl.Object.constructor;
      Efl.Object.destructor;
      Efl.Canvas.Group.group_calculate;
      Efl.Gfx.Entity.position { set; }
      Efl.Gfx.Entity.size { set;}
      Efl.Gfx.Entity.visible { set; }
      Efl.Ui.Widget.widget_parent { set; }
      Efl.Content.content { get; set; }
      Efl.Content.content_unset;
      Efl.Part.part_get;
   }
   events {
      backwall,clicked: void; [[This is called whenever the user clicks the backwall part of the Popup.]]
      timeout: void; [[This is called when Popup times out.]]
   }
}