summaryrefslogtreecommitdiff
path: root/src/lib/elementary/elm_ctxpopup.eo
blob: 4166ace69649b7709c5fc779675aa31fc18e08f9 (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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
enum Elm.Ctxpopup.Direction
{
   [[Direction in which to show the popup.]]
   down, [[Ctxpopup show appear below clicked area.]]
   right, [[Ctxpopup show appear to the right of the clicked area.]]
   left, [[Ctxpopup show appear to the left of the clicked area.]]
   up, [[Ctxpopup show appear above the clicked area.]]
   unknown [[Ctxpopup does not determine it's direction yet.]]
}

class Elm.Ctxpopup (Efl.Ui.Layout, Efl.Ui.Focus.Layer, Efl.Access.Widget.Action,
                    Efl.Ui.Menu)
{
   [[Elementary context popup class]]
   legacy_prefix: elm_ctxpopup;
   eo_prefix: elm_obj_ctxpopup;
   event_prefix: elm_ctxpopup;
   methods {
      @property horizontal {
         set {
            [[Change the ctxpopup's orientation to horizontal or vertical.]]
         }
         get {
            [[Get the value of current ctxpopup object's orientation.

              See also @.horizontal.set.
            ]]
         }
         values {
            horizontal: bool; [[$true for horizontal mode, $false for vertical.]]
         }
      }
      @property auto_hide_disabled {
         set {
            [[Set ctxpopup auto hide mode triggered by ctxpopup policy.

              Use this function when user wants ctxpopup not to hide automatically.
              By default, ctxpopup is dismissed whenever mouse clicked its background area, language is changed,
              and its parent geometry is updated(changed).
              Not to hide ctxpopup automatically, disable auto hide function by calling this API,
              then ctxpopup won't be dismissed in those scenarios.

              Default value of disabled is $false.

              See also @.auto_hide_disabled.get.

              @since 1.9
            ]]
         }
         get {
            [[Get ctxpopup auto hide mode triggered by ctxpopup policy.

              See also @.auto_hide_disabled.set for more information.

              @since 1.9
            ]]
         }
         values {
            disabled: bool; [[Auto hide enable/disable.]]
         }
      }
      @property hover_parent {
         set {
            [[Set the Ctxpopup's parent

              Set the parent object.

              Note: \@ref elm_ctxpopup_add will automatically call this function
              with its $parent argument.

              See also \@ref elm_ctxpopup_add,
              \@ref elm_hover_parent_set.
            ]]
         }
         get {
            [[Get the Ctxpopup's parent

              See also @.hover_parent.set for more information
            ]]
         }
         values {
            parent: Efl.Canvas.Object; [[The parent to use.]]
         }
      }
      @property direction_priority {
         set {
            [[Set the direction priority of a ctxpopup.

              This functions gives a chance to user to set the priority of ctxpopup
              showing direction. This doesn't guarantee the ctxpopup will appear in the
              requested direction.

              See also @.Direction.
            ]]
         }
         get {
            [[Get the direction priority of a ctxpopup.

              See also @.direction_priority.set for more information.
            ]]
         }
         values {
            first: Elm.Ctxpopup.Direction; [[1st priority of direction]]
            second: Elm.Ctxpopup.Direction; [[2nd priority of direction]]
            third: Elm.Ctxpopup.Direction; [[3th priority of direction]]
            fourth: Elm.Ctxpopup.Direction; [[4th priority of direction]]
         }
      }
      @property direction {
         get {
            [[Get the current direction of a ctxpopup.

              Warning: Once the ctxpopup showed up, the direction would be determined

            ]]
            return: Elm.Ctxpopup.Direction(Elm.Ctxpopup.Direction.unknown); [[Direction]]
         }
      }
      dismiss {
         [[Dismiss a ctxpopup object

         Use this function to simulate clicking outside of the ctxpopup to dismiss it.
         In this way, the ctxpopup will be hidden and the "clicked" signal will be
         emitted.]]

      }
      clear {
         [[Clear all items in the given ctxpopup object.]]
      }
      item_insert_before {
         [[Insert a new item to a ctxpopup object before item $before.

           See also elm_object_content_set.

           @since 1.21
         ]]
         return: Elm.Widget.Item; [[A handle to the item added or $null, on errors.]]

         params {
            @in before: Elm.Widget.Item; [[The ctxpopup item to insert before.]]
            @in label: string; [[The Label of the new item]]
            @in icon: Efl.Canvas.Object @optional; [[Icon to be set on new item]]
            @in func: Evas_Smart_Cb @optional; [[Convenience function called when item selected]]
            @in data: const(void_ptr) @optional; [[Data passed to $func]]
         }
      }
      item_insert_after {
         [[Insert a new item to a ctxpopup object after item $after.

           See also elm_object_content_set.

           @since 1.21
         ]]
         return: Elm.Widget.Item; [[A handle to the item added or $null, on errors.]]

         params {
            @in after: Elm.Widget.Item; [[The ctxpopup item to insert after.]]
            @in label: string; [[The Label of the new item]]
            @in icon: Efl.Canvas.Object @optional; [[Icon to be set on new item]]
            @in func: Evas_Smart_Cb @optional; [[Convenience function called when item selected]]
            @in data: const(void_ptr) @optional; [[Data passed to $func]]
         }
      }
      item_append {
         [[Add a new item to a ctxpopup object.

           Warning:Ctxpopup can't hold both an item list and a content at the same
           time. When an item is added, any previous content will be removed.

           See also \@ref elm_object_content_set.
         ]]
         return: Elm.Widget.Item; [[A handle to the item added or $null, on errors.]]

         params {
            @in label: string; [[The Label of the new item]]
            @in icon: Efl.Canvas.Object @optional; [[Icon to be set on new item]]
            @in func: Evas_Smart_Cb @optional; [[Convenience function called when item selected]]
            @in data: const(void_ptr) @optional; [[Data passed to $func]]
         }
      }
      item_prepend {
         [[Prepend a new item to a ctxpopup object.

           Warning: Ctxpopup can't hold both an item list and a content at the same
           time. When an item is added, any previous content will be removed.

           See also \@ref elm_object_content_set.

           @since 1.11
         ]]
         return: Elm.Widget.Item; [[A handle to the item added or $null, on errors.]]

         params {
            @in label: string; [[The Label of the new item]]
            @in icon: Efl.Canvas.Object @optional; [[Icon to be set on new item]]
            @in func: Evas_Smart_Cb @optional; [[Convenience function called when item selected]]
            @in data: const(void_ptr) @optional; [[Data passed to $func]]
         }
      }
   }
   implements {
      class.constructor;
      Efl.Object.constructor;
      Elm.Widget.widget_parent { set; }
      Elm.Widget.on_disabled_update;
      Elm.Widget.widget_sub_object_add;
      Efl.Ui.Translatable.translation_update;
      Elm.Widget.theme_apply;
      Elm.Widget.widget_event;
      Elm.Widget.focused_item { get; }
      Efl.Ui.Menu.selected_item { get; }
      Efl.Ui.Menu.first_item { get; }
      Efl.Ui.Menu.last_item { get; }
      Efl.Ui.Menu.items { get; }
      Efl.Access.Widget.Action.elm_actions { get; }
      Efl.Access.state_set { get; }
      Efl.Part.part;
   }
   events {
      dismissed; [[Called when context popup was dismissed]]
      geometry,update: const(ptr(Eina.Rect)); [[Called when context popup geometry was updated]]
   }
}