summaryrefslogtreecommitdiff
path: root/src/lib/elm_slideshow.eo
blob: ecf89eec99a3ea3139a6288cffce759beb76cd76 (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
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
class Elm_Slideshow (Elm_Layout)
{
   eo_prefix: elm_obj_slideshow;
   properties {
      cache_after {
         set {
            /*@
            Set the number of items to cache, on a given slideshow widget,
            <b>after the current item</b>

            The default value for this property is @c 2. See
            @ref Slideshow_Caching "slideshow caching" for more details.

            @see elm_slideshow_cache_after_get()

            @ingroup Slideshow */
         }
         get {
            /*@
            Retrieve the number of items to cache, on a given slideshow widget,
            <b>after the current item</b>

            @return The number of items set to be cached after the current one

            @see elm_slideshow_cache_after_set() for more details

            @ingroup Slideshow */
         }
         values {
            int count; /*@ Number of items to cache after the current one */
         }
      }
      cache_before {
         set {
            /*@
            Set the number of items to cache, on a given slideshow widget,
            <b>before the current item</b>

            The default value for this property is @c 2. See
            @ref Slideshow_Caching "slideshow caching" for more details.

            @see elm_slideshow_cache_before_get()

            @ingroup Slideshow */
         }
         get {
            /*@
            Retrieve the number of items to cache, on a given slideshow widget,
            <b>before the current item</b>

            @return The number of items set to be cached before the current one

            @see elm_slideshow_cache_before_set() for more details

            @ingroup Slideshow */
         }
         values {
            int count; /*@ Number of items to cache before the current one */
         }
      }
      layout {
         set {
            /*@
            Set the current slide layout in use for a given slideshow widget

            If @p layout is implemented in @p obj's theme (i.e., is contained
            in the list returned by elm_slideshow_layouts_get()), this new
            images layout will be used on the widget.

            @see elm_slideshow_layouts_get() for more details

            @ingroup Slideshow */
         }
         get {
            /*@
            Get the current slide layout in use for a given slideshow widget

            @return The current layout's name

            @see elm_slideshow_layout_set() for more details

            @ingroup Slideshow */
         }
         values {
            const char *layout; /*@ The new layout's name string */
         }
      }
      transition {
         set {
            /*@
            Set the current slide transition/effect in use for a given
            slideshow widget

            If @p transition is implemented in @p obj's theme (i.e., is
            contained in the list returned by
            elm_slideshow_transitions_get()), this new sliding effect will
            be used on the widget.

            @see elm_slideshow_transitions_get() for more details

            @ingroup Slideshow */
         }
         get {
            /*@
            Get the current slide transition/effect in use for a given
            slideshow widget

            @return The current transition's name

            @see elm_slideshow_transition_set() for more details

            @ingroup Slideshow */
         }
         values {
            const char *transition; /*@ The new transition's name string */
         }
      }
      loop {
         set {
            /*@
            Set if, after a slideshow is started, for a given slideshow
            widget, its items should be displayed cyclically or not.

            @note elm_slideshow_next() and elm_slideshow_previous() will @b
            ignore what is set by this functions, i.e., they'll @b always
            cycle through items. This affects only the "automatic"
            slideshow, as set by elm_slideshow_timeout_set().

            @see elm_slideshow_loop_get()

            @ingroup Slideshow */
         }
         get {
            /*@
            Get if, after a slideshow is started, for a given slideshow
            widget, its items are to be displayed cyclically or not.

            @return @c EINA_TRUE, if the items in @p obj will be cycled
            through or @c EINA_FALSE, otherwise

            @see elm_slideshow_loop_set() for more details

            @ingroup Slideshow */
         }
         values {
            Eina_Bool loop; /*@ Use @c EINA_TRUE to make it cycle through items or
            @c EINA_FALSE for it to stop at the end of @p obj's internal
            list of items */
         }
      }
      timeout {
         set {
            /*@
            Set the interval between each image transition on a given
            slideshow widget, <b>and start the slideshow, itself</b>

            After this call, the slideshow widget will start cycling its
            view, sequentially and automatically, with the images of the
            items it has. The time between each new image displayed is going
            to be @p timeout, in @b seconds. If a different timeout was set
            previously and an slideshow was in progress, it will continue
            with the new time between transitions, after this call.

            @note A value less than or equal to 0 on @p timeout will disable
            the widget's internal timer, thus halting any slideshow which
            could be happening on @p obj.

            @see elm_slideshow_timeout_get()

            @ingroup Slideshow */
         }
         get {
            /*@
            Get the interval set for image transitions on a given slideshow
            widget.

            @return Returns the timeout set on it or -1.0, on errors

            @see elm_slideshow_timeout_set() for more details

            @ingroup Slideshow */
         }
         values {
            double timeout; /*@ The new displaying timeout for images */
         }
      }
      items {
         get {
            /*@
            Get the internal list of items in a given slideshow widget.

            @return The list of items (#Elm_Object_Item as data) or
            @c NULL on errors.

            This list is @b not to be modified in any way and must not be
            freed. Use the list members with functions like
            elm_object_item_del(), elm_object_item_data_get().

            @warning This list is only valid until @p obj object's internal
            items list is changed. It should be fetched again with another
            call to this function when changes happen.

            @ingroup Slideshow */
            return const Eina_List *;
         }
      }
      transitions {
         get {
            /*@
            Returns the list of sliding transition/effect names available, for a
            given slideshow widget.

            @return The list of transitions (list of @b stringshared strings
            as data)

            The transitions, which come from @p obj's theme, must be an EDC
            data item named @c "transitions" on the theme file, with (prefix)
            names of EDC programs actually implementing them.

            The available transitions for slideshows on the default theme are:
            - @c "fade" - the current item fades out, while the new one
            fades in to the slideshow's viewport.
            - @c "black_fade" - the current item fades to black, and just
            then, the new item will fade in.
            - @c "horizontal" - the current item slides horizontally, until
            it gets out of the slideshow's viewport, while the new item
            comes from the left to take its place.
            - @c "vertical" - the current item slides vertically, until it
            gets out of the slideshow's viewport, while the new item comes
            from the bottom to take its place.
            - @c "square" - the new item starts to appear from the middle of
            the current one, but with a tiny size, growing until its
            target (full) size and covering the old one.

            @warning The stringshared strings get no new references
            exclusive to the user grabbing the list, here, so if you'd like
            to use them out of this call's context, you'd better @c
            eina_stringshare_ref() them. Also the list is an internal list and
            so is only valid for as long as the slideshow object is valid and
            has not internally changed its list for some reason, so make a
            copy if you need it around.

            @see elm_slideshow_transition_set()

            @ingroup Slideshow */
            return const Eina_List *;
         }
      }
      count {
         get {
            /*@
            Get the number of items stored in a given slideshow widget

            @return The number of items on @p obj, at the moment of this call

            @ingroup Slideshow */
            return unsigned int;
         }
      }
      item_current {
         get {
            /*@
            Returns the currently displayed item, in a given slideshow widget

            @return A handle to the item being displayed in @p obj or
            @c NULL, if none is (and on errors)

            @ingroup Slideshow */
            return Elm_Object_Item *;
         }
      }
      layouts {
         get {
            /*@
            Returns the list of @b layout names available, for a given
            slideshow widget.

            @return The list of layouts (list of @b stringshared strings
            as data)

            Slideshow layouts will change how the widget is to dispose each
            image item in its viewport, with regard to cropping, scaling,
            etc.

            The layouts, which come from @p obj's theme, must be an EDC
            data item name @c "layouts" on the theme file, with (prefix)
            names of EDC programs actually implementing them.

            The available layouts for slideshows on the default theme are:
            - @c "fullscreen" - item images with original aspect, scaled to
            touch top and down slideshow borders or, if the image's height
            is not enough, left and right slideshow borders.
            - @c "not_fullscreen" - the same behavior as the @c "fullscreen"
            one, but always leaving 10% of the slideshow's dimensions of
            distance between the item image's borders and the slideshow
            borders, for each axis.

            @warning The stringshared strings get no new references
            exclusive to the user grabbing the list, here, so if you'd like
            to use them out of this call's context, you'd better @c
            eina_stringshare_ref() them.

            @see elm_slideshow_layout_set()

            @ingroup Slideshow */
            return const Eina_List *;
         }
      }
   }
   methods {
      previous {
         /*@
         Slide to the @b previous item, in a given slideshow widget

         The sliding animation @p obj is set to use will be the
         transition effect used, after this call is issued.

         @note If the beginning of the slideshow's internal list of items
         is reached, it'll wrap around to the list's end, again.

         @ingroup Slideshow */

      }
      item_nth_get {
         /*@
         Get the the item, in a given slideshow widget, placed at
         position @p nth, in its internal items list

         @return The item stored in @p obj at position @p nth or @c NULL,
         if there's no item with that index (and on errors)

         @ingroup Slideshow */

         const;
         return Elm_Object_Item *;
         params {
            @in unsigned int nth; /*@ The number of the item to grab a handle to (0 being
            the first) */
         }
      }
      next {
         /*@
         Slide to the @b next item, in a given slideshow widget

         The sliding animation @p obj is set to use will be the
         transition effect used, after this call is issued.

         @note If the end of the slideshow's internal list of items is
         reached, it'll wrap around to the list's beginning, again.

         @ingroup Slideshow */

      }
      clear {
         /*@
         Remove all items from a given slideshow widget

         This removes (and deletes) all items in @p obj, leaving it
         empty.

         @see elm_object_item_del(), to remove just one item.

         @ingroup Slideshow */

      }
      item_add {
         /*@
         Add (append) a new item in a given slideshow widget.

         @return A handle to the item added or @c NULL, on errors

         Add a new item to @p obj's internal list of items, appending it.
         The item's class must contain the function really fetching the
         image object to show for this item, which could be an Evas image
         object or an Elementary photo, for example. The @p data
         parameter is going to be passed to both class functions of the
         item.

         @see #Elm_Slideshow_Item_Class
         @see elm_slideshow_item_sorted_insert()
         @see elm_object_item_data_set()

         @ingroup Slideshow */

         return Elm_Object_Item *;
         params {
            @in const Elm_Slideshow_Item_Class *itc; /*@ The item class for the item */
            @in const void *data; /*@ The item's data */
         }
      }
      item_sorted_insert {
         /*@
         Insert a new item into the given slideshow widget, using the @p func
         function to sort items (by item handles).

         @return Returns The slideshow item handle, on success, or
         @c NULL, on errors

         Add a new item to @p obj's internal list of items, in a position
         determined by the @p func comparing function. The item's class
         must contain the function really fetching the image object to
         show for this item, which could be an Evas image object or an
         Elementary photo, for example. The @p data parameter is going to
         be passed to both class functions of the item.

         @see #Elm_Slideshow_Item_Class
         @see elm_slideshow_item_add()

         @ingroup Slideshow */

         return Elm_Object_Item *;
         params {
            @in const Elm_Slideshow_Item_Class *itc; /*@ The item class for the item */
            @in const void *data; /*@ The item's data */
            @in Eina_Compare_Cb func; /*@ The comparing function to be used to sort slideshow
            items <b>by #Elm_Slideshow_Item_Class item handles</b> */
         }
      }
   }
   implements {
      class.constructor;
      Eo_Base.constructor;
      Evas_Object_Smart.add;
      Evas_Object_Smart.del;
      Elm_Widget.focus_next_manager_is;
      Elm_Widget.focus_direction_manager_is;
      Elm_Widget.event;
      Elm_Layout.sizing_eval;
   }
   events {
      changed;
      transition,end;
      language,changed;
      access,changed;
      focused;
      unfocused;
   }

}