aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/elementary/elm_layout.eo
blob: e7e52c4908b184ab51970eb878e686355f2537ba (plain) (blame)
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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
import edje_types;

struct Elm.Layout_Part_Alias_Description
{
   [[
     Elementary Layout-based widgets may declare part proxies, i.e., aliases
     for real theme part names to expose to the API calls:
     - elm_layout_text_set()
     - elm_layout_text_get()
     - elm_layout_content_set()
     - elm_layout_content_get()
     - elm_layout_content_unset()
     and their equivalents. This list must be set on the "_smart_set_user()" function of inheriting widgets,
     so that part aliasing is handled automatically for them.
   ]]
   alias: string; [[Alternate name for a given (real) part. Calls receiving this string as a part name will be translated to the string at Elm.Layout_Part_Proxies_Description::real_part]]
   real_part: string; [[Target part name for the alias set on Elm.Layout_Part_Proxies_Description::real_part. An example of usage would be "default" on that field, with "elm.content.swallow" on this one]]
}

class Elm.Layout (Elm.Widget, Efl.Part, Efl.Container, Efl.File)
{
   legacy_prefix: elm_layout;
   eo_prefix: elm_obj_layout;
   event_prefix: elm_layout;
   data: Elm_Layout_Smart_Data;
   methods {
      @property edje_object_can_access {
         set {
            [[Set accessibility to all texblock(text) parts in the layout
              object.

              @since 1.7
            ]]
            return: bool; [[$true on success or $false on failure. If $obj
                            is not a proper layout object, $false is returned.]]
         }
         get {
            [[Get accessibility state of texblock(text) parts in the layout
              object

              @since 1.7
            ]]
         }
         values {
            can_access: bool; [[Makes all textblock(text) parts in the layout
                                $obj possible to have accessibility. $true
                                means textblock(text) parts can be accessible.]]
         }
      }
      @property theme {
         set {
            [[Set the edje group from the elementary theme that will be used
              as layout.

              Note that $style will be the new style of $obj too, as in an
              \@ref elm_object_style_set call.
            ]]
            return: bool;
         }
         values {
            klass: string; [[The class of the group.]]
            group: string; [[The group.]]
            style: string; [[The style to used.]]
         }
      }
      @property text_aliases @protected {
         get {
            legacy: null;
         }
         values {
            aliases: const(Elm.Layout_Part_Alias_Description)*;
         }
      }
      @property content_aliases @protected {
         get {
            legacy: null;
         }
         values {
            aliases: const(Elm.Layout_Part_Alias_Description)*;
         }
      }
      @property edje {
         get {
            [[Get the edje layout

              This returns the edje object. It is not expected to be used
              to then swallow objects via \@ref edje_object_part_swallow
              for example. Use \@ref elm_layout_content_set instead so
              child object handling and sizing is done properly.

              Note: This function should only be used if you really need
              to call some low level Edje function on this edje object.
              All the common stuff (setting text, emitting signals,
              hooking callbacks to signals, etc.) can be done with
              proper elementary functions.
            ]]
            return: Evas.Object; [[An Evas_Object with the edje layout
                                     settings loaded \@ref elm_layout_file_set.]]
         }
      }
      part_cursor_engine_only_set {
         [[Sets if the cursor set should be searched on the theme or should
           use the provided by the engine, only.

           Note: Before you set if should look on theme you should define a
           cursor with @.part_cursor_set. By default it will only look for
           cursors provided by the engine.
         ]]
         return: bool; [[$true on success or $false on failure, that may be
                         part not exists or it did not had a cursor set.]]
         params {
            @in part_name: string; [[A part from loaded edje group.]]
            @in engine_only: bool; [[If cursors should be just provided by
                                     the engine ($true) or should also search
                                     on widget's theme as well ($false)]]
         }
      }
      part_cursor_engine_only_get @const {
         [[Get a specific cursor engine_only for an edje part.]]
         return: bool; [[Whenever the cursor is just provided by engine
                         or also from theme.]]
         params {
            @in part_name: string; [[A part from loaded edje group.]]
         }
      }
      freeze {
         [[Freezes the Elementary layout object.

           This function puts all changes on hold. Successive freezes will
           nest, requiring an equal number of thaws.

           See also @.thaw.
         ]]
         return: int; [[The frozen state or 0 on error.]]
      }
      theme_enable {
         legacy: null;
         return: bool;
      }
      sizing_eval {
         [[Eval sizing.

           Manually forces a sizing re-evaluation. This is useful when the
           minimum size required by the edje theme of this layout has
           changed. The change on the minimum size required by the edje
           theme is not immediately reported to the elementary layout,
           so one needs to call this function in order to tell the widget
           (layout) that it needs to reevaluate its own size.

           The minimum size of the theme is calculated based on minimum
           size of parts, the size of elements inside containers like box
           and table, etc. All of this can change due to state changes,
           and that's when this function should be called.

           Also note that a standard signal of "size,eval" "elm" emitted
           from the edje object will cause this to happen too.
         ]]
      }
      sizing_restricted_eval {
         [[Request sizing reevaluation, restricted to current width and/or
           height.

           Useful mostly when there are TEXTBLOCK parts defining the height
           of the object and nothing else restricting it to a minimum width.
           Calling this function will restrict the minimum size in the Edje
           calculation to whatever size it the layout has at the moment.

           @since 1.8
         ]]
         params {
            @in width: bool; [[Restrict minimum size to the current width.]]
            @in height: bool; [[Restrict minimum size ot the current height.]]
         }
      }
      part_cursor_style_set {
         [[Sets a specific cursor style for an edje part.]]
         return: bool; [[True on success or false on failure, that may be
                         part not exists or it did not had a cursor set.]]
         params {
            @in part_name: string; [[A part from loaded edje group.]]
            @in style: string; [[The theme style to use (default,
                                       transparent, ...).]]
         }
      }
      part_cursor_style_get @const {
         [[Get a specific cursor style for an edje part.]]
         return: string; [[The theme style in use, defaults to "default".
                                 If the object does not have a cursor set,
                                 then $null is returned.]]
         params {
            @in part_name: string; [[A part from loaded edje group.]]
         }
      }
      @property text {
         set {
            [[Set the text of the given part.]]
            return: bool;
         }
         get {
            [[Get the text set in the given part.]]
         }
         keys {
            part: string @nullable; [[The TEXT part where to set the text.]]
         }
         values {
            text: string @nullable; [[The text to set.]]
         }
      }
      signal_callback_add {
         [[Add a callback for a (Edje) signal emitted by a layout widget's
           underlying Edje object.

           This function connects a callback function to a signal emitted by
           the underlying Edje object of $obj. Globs are accepted in either
           the emission or source strings.
         ]]
         params {
            @in emission: string; [[The signal's name string.]]
            @in source: string; [[The signal's source string.]]
            @in func: Edje.Signal_Cb; [[The callback function to be executed
                                        when the signal is emitted.]]
            @in data: void_ptr @optional; [[A pointer to data to pass in to the
                                          callback function.]]
         }
      }
      part_cursor_set {
         [[Sets a specific cursor for an edje part.]]
         return: bool; [[$true on success or $false on failure, that may be
                         part not exists or it has "mouse_events: 0".]]
         params {
            @in part_name: string; [[A part from loaded edje group.]]
            @in cursor: string; [[Cursor name to use, see Elementary_Cursor.h.]]
         }
      }
      part_cursor_get @const {
         [[Get the cursor to be shown when mouse is over an edje part.]]
         return: string;
         params {
            @in part_name: string; [[A part from loaded edje group.]]
         }
      }
      sub_object_add_enable {
         legacy: null;
         return: bool;
      }
      data_get @const {
         [[Get the edje data from the given layout.

           This function fetches data specified inside the edje theme of
           this layout. This function return NULL if data is not found.

           In EDC this comes from a data block within the group block that
           $obj was loaded from.
         ]]
         /* FIXME-doc
         @code
         collections {
         group {
         name: "a_group";
         data {
         item: "key1" "value1";
         item: "key2" "value2";
         }
         }
         }
         @endcode
         */
         return: string; [[The edje data string.]]
         params {
            @in key: string; [[The data key.]]
         }
      }
      signal_callback_del {
         [[Remove a signal-triggered callback from a given layout widget.

           This function removes the last callback attached to a signal
           emitted by the undelying Edje object of $obj, with parameters
           $emission, $source and $func matching exactly those passed to a
           previous call to @.signal_callback_add. The data pointer that
           was passed to this call will be returned.
         ]]
         return: void_ptr; [[The data pointer of the signal callback (passed on
                           @.signal_callback_add) or $null on errors.]]
         params {
            @in emission: string; [[The signal's name string.]]
            @in source: string; [[The signal's source string.]]
            @in func: Edje.Signal_Cb; [[The callback function being executed
                                        when the signal was emitted.]]
         }
      }
      thaw {
         [[Thaws the Elementary object.

           This function thaws the given Edje object and the Elementary
           sizing calc.

           Note: If sucessives freezes were done, an equal number of
           thaws will be required.

           See also @.freeze.
         ]]
         return: int; [[The frozen state or 0 if the object is not frozen or on error.]]
      }
      signal_emit {
         [[Send a (Edje) signal to a given layout widget's underlying Edje
           object.

           This function sends a signal to the underlying Edje object of
           $obj. An Edje program on that Edje object's definition can
           respond to a signal by specifying matching 'signal' and
           'source' fields.
         ]]
         params {
            @in emission: string; [[The signal's name string.]]
            @in source: string; [[The signal's source string.]]
         }
      }
      part_cursor_unset {
         [[Unsets a cursor previously set with @.part_cursor_set.]]
         return: bool;
         params {
            @in part_name: string; [[A part from loaded edje group,
                                           that had a cursor set wit
                                           @.part_cursor_set.]]
         }
      }
   }
   implements {
      class.constructor;
      Eo.Base.constructor;
      Eo.Base.dbg_info_get;
      Efl.File.file.set;
      Efl.File.file.get;
      Efl.Canvas.Group.group_del;
      Efl.Canvas.Group.group_add;
      Efl.Canvas.Group.group_calculate;
      Elm.Widget.focus_direction;
      Elm.Widget.sub_object_add;
      Elm.Widget.theme_apply;
      Elm.Widget.focus_direction_manager_is;
      Elm.Widget.focus_next_manager_is;
      Elm.Widget.focus_next;
      Elm.Widget.disable;
      Elm.Widget.sub_object_del;
      Elm.Widget.on_focus;
      Efl.Container.content_part_name.get;
      Efl.Container.content_count;
      Efl.Container.content_remove;
      Efl.Container.content_iterate;
      Efl.Container.content.set;
      Efl.Container.content.get;
      Efl.Container.content_unset;
      Efl.Part.part;
   }
   events {
      theme,changed;
   }

}