summaryrefslogtreecommitdiff
path: root/legacy/elementary/src/lib/elm_flip.eo
blob: c3cac2b5bce06112ac496c1556efb8529fa2e5c6 (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
enum Elm.Flip.Mode
{
  /*@
    @ingroup Flip
   */
   legacy: elm_flip;
   rotate_y_center_axis,
   rotate_x_center_axis,
   rotate_xz_center_axis,
   rotate_yz_center_axis,
   cube_left,
   cube_right,
   cube_up,
   cube_down,
   page_left,
   page_right,
   page_up,
   page_down
}

enum Elm.Flip.Interaction
{
  /*@
    @ingroup Flip
   */
   none,
   rotate,
   cube,
   page
}

enum Elm.Flip.Direction
{
  /*@
    @ingroup Flip
   */
   up = 0, /*@< Allows interaction with the top of the widget */
   down, /*@< Allows interaction with the bottom of the widget */
   left, /*@< Allows interaction with the left portion of the widget */
   right /*@< Allows interaction with the right portion of the widget */
}

class Elm.Flip (Elm.Container)
{
   eo_prefix: elm_obj_flip;
   methods {
      @property interaction {
         set {
            /*@
            @brief Set the interactive flip mode

            This sets if the flip should be interactive (allow user to click and
            drag a side of the flip to reveal the back page and cause it to flip).
            By default a flip is not interactive. You may also need to set which
            sides of the flip are "active" for flipping and how much space they use
            (a minimum of a finger size) with elm_flip_interaction_direction_enabled_set()
            and elm_flip_interaction_direction_hitsize_set()

            The four available mode of interaction are:
            @li #ELM_FLIP_INTERACTION_NONE - No interaction is allowed
            @li #ELM_FLIP_INTERACTION_ROTATE - Interaction will cause rotate animation
            @li #ELM_FLIP_INTERACTION_CUBE - Interaction will cause cube animation
            @li #ELM_FLIP_INTERACTION_PAGE - Interaction will cause page animation

            @note #ELM_FLIP_INTERACTION_ROTATE won't cause
            #ELM_FLIP_ROTATE_XZ_CENTER_AXIS or #ELM_FLIP_ROTATE_YZ_CENTER_AXIS to
            happen, those can only be achieved with elm_flip_go();

            @ingroup Flip */
         }
         get {
            /*@
            @brief Get the interactive flip mode

            @return The interactive flip mode

            Returns the interactive flip mode set by elm_flip_interaction_set()

            @ingroup Flip */
         }
         values {
            Elm.Flip.Interaction mode; /*@ The interactive flip mode to use */
         }
      }
      @property front_visible {
         get {
            /*@
            @brief Get flip front visibility state

            @return EINA_TRUE if front front is showing, EINA_FALSE if the back is
            showing.

            @ingroup Flip */
            return: bool;
         }
      }
      interaction_direction_hitsize_set {
         /*@
         @brief Set the amount of the flip that is sensitive to interactive flip

         Set the amount of the flip that is sensitive to interactive flip, with 0
         representing no area in the flip and 1 representing the entire flip. There
         is however a consideration to be made in that the area will never be
         smaller than the finger size set (as set in your Elementary configuration),
         and dragging must always start from the opposite half of the flip (eg. right
         half of the flip when dragging to the left).

         Note that the @c dir parameter is not actually related to the direction of
         the drag, it only refers to the area in the flip where interaction can
         occur (top, bottom, left, right).

         Negative values of @c hitsize will disable this hit area.

         @see elm_flip_interaction_set()

         @ingroup Flip */

         params {
            @in Elm.Flip.Direction dir; /*@ The hit area to set */
            @in double hitsize; /*@ The amount of that dimension (0.0 to 1.0) to use */
         }
      }
      interaction_direction_hitsize_get {
         /*@
         @brief Get the amount of the flip that is sensitive to interactive flip

         @return The size set for that direction

         Returns the amount of sensitive area set by
         elm_flip_interaction_direction_hitsize_set().

         @ingroup Flip */

         return: double;
         params {
            @in Elm.Flip.Direction dir; /*@ The direction to check */
         }
      }
      interaction_direction_enabled_set {
         /*@
         @brief Set which directions of the flip respond to interactive flip

         By default all directions are disabled, so you may want to enable the
         desired directions for flipping if you need interactive flipping. You must
         call this function once for each direction that should be enabled.

         You can also set the appropriate hit area size by calling
         @c elm_flip_interaction_direction_hitsize_set(). By default, a minimum
         hit area will be created on the opposite edge of the flip.

         @see elm_flip_interaction_set()

         @ingroup Flip */

         params {
            @in Elm.Flip.Direction dir; /*@ The direction to change */
            @in bool enabled; /*@ If that direction is enabled or not */
         }
      }
      interaction_direction_enabled_get {
         /*@
         @brief Get the enabled state of that flip direction

         @return If that direction is enabled or not

         Get the enabled state set by elm_flip_interaction_direction_enabled_set()

         @see elm_flip_interaction_set()

         @ingroup Flip */

         return: bool;
         params {
            @in Elm.Flip.Direction dir; /*@ The direction to check */
         }
      }
      go {
         /*@
         @brief Runs the flip animation

         Flips the front and back contents using the @p mode animation. This
         effectively hides the currently visible content and shows the hidden one.

         There a number of possible animations to use for the flipping:
         @li #ELM_FLIP_ROTATE_X_CENTER_AXIS - Rotate the currently visible content
         around a horizontal axis in the middle of its height, the other content
         is shown as the other side of the flip.
         @li #ELM_FLIP_ROTATE_Y_CENTER_AXIS - Rotate the currently visible content
         around a vertical axis in the middle of its width, the other content is
         shown as the other side of the flip.
         @li #ELM_FLIP_ROTATE_XZ_CENTER_AXIS - Rotate the currently visible content
         around a diagonal axis in the middle of its width, the other content is
         shown as the other side of the flip.
         @li #ELM_FLIP_ROTATE_YZ_CENTER_AXIS - Rotate the currently visible content
         around a diagonal axis in the middle of its height, the other content is
         shown as the other side of the flip.
         @li #ELM_FLIP_CUBE_LEFT - Rotate the currently visible content to the left
         as if the flip was a cube, the other content is show as the right face of
         the cube.
         @li #ELM_FLIP_CUBE_RIGHT - Rotate the currently visible content to the
         right as if the flip was a cube, the other content is show as the left
         face of the cube.
         @li #ELM_FLIP_CUBE_UP - Rotate the currently visible content up as if the
         flip was a cube, the other content is show as the bottom face of the cube.
         @li #ELM_FLIP_CUBE_DOWN - Rotate the currently visible content down as if
         the flip was a cube, the other content is show as the upper face of the
         cube.
         @li #ELM_FLIP_PAGE_LEFT - Move the currently visible content to the left as
         if the flip was a book, the other content is shown as the page below that.
         @li #ELM_FLIP_PAGE_RIGHT - Move the currently visible content to the right
         as if the flip was a book, the other content is shown as the page below
         that.
         @li #ELM_FLIP_PAGE_UP - Move the currently visible content up as if the
         flip was a book, the other content is shown as the page below that.
         @li #ELM_FLIP_PAGE_DOWN - Move the currently visible content down as if the
         flip was a book, the other content is shown as the page below that.

         @image html elm_flip.png
         @image latex elm_flip.eps width=\textwidth

         @see elm_flip_go_to()

         @ingroup Flip */

         params {
            @in Elm.Flip.Mode mode; /*@ The mode type */
         }
      }
      go_to {
         /*@
         @brief Runs the flip animation to front or back.

         Flips the front and back contents using the @p mode animation. This
         effectively hides the currently visible content and shows the hidden one.

         There a number of possible animations to use for the flipping:
         @li #ELM_FLIP_ROTATE_X_CENTER_AXIS - Rotate the currently visible content
         around a horizontal axis in the middle of its height, the other content
         is shown as the other side of the flip.
         @li #ELM_FLIP_ROTATE_Y_CENTER_AXIS - Rotate the currently visible content
         around a vertical axis in the middle of its width, the other content is
         shown as the other side of the flip.
         @li #ELM_FLIP_ROTATE_XZ_CENTER_AXIS - Rotate the currently visible content
         around a diagonal axis in the middle of its width, the other content is
         shown as the other side of the flip.
         @li #ELM_FLIP_ROTATE_YZ_CENTER_AXIS - Rotate the currently visible content
         around a diagonal axis in the middle of its height, the other content is
         shown as the other side of the flip.
         @li #ELM_FLIP_CUBE_LEFT - Rotate the currently visible content to the left
         as if the flip was a cube, the other content is show as the right face of
         the cube.
         @li #ELM_FLIP_CUBE_RIGHT - Rotate the currently visible content to the
         right as if the flip was a cube, the other content is show as the left
         face of the cube.
         @li #ELM_FLIP_CUBE_UP - Rotate the currently visible content up as if the
         flip was a cube, the other content is show as the bottom face of the cube.
         @li #ELM_FLIP_CUBE_DOWN - Rotate the currently visible content down as if
         the flip was a cube, the other content is show as the upper face of the
         cube.
         @li #ELM_FLIP_PAGE_LEFT - Move the currently visible content to the left as
         if the flip was a book, the other content is shown as the page below that.
         @li #ELM_FLIP_PAGE_RIGHT - Move the currently visible content to the right
         as if the flip was a book, the other content is shown as the page below
         that.
         @li #ELM_FLIP_PAGE_UP - Move the currently visible content up as if the
         flip was a book, the other content is shown as the page below that.
         @li #ELM_FLIP_PAGE_DOWN - Move the currently visible content down as if the
         flip was a book, the other content is shown as the page below that.

         @image html elm_flip.png
         @image latex elm_flip.eps width=\textwidth

         @since 1.7

         @ingroup Flip */

         params {
            @in bool front; /*@ if @c EINA_TRUE, makes front visible, otherwise makes back. */
            @in Elm.Flip.Mode mode; /*@ The mode type */
         }
      }
   }
   implements {
      class.constructor;
      Eo.Base.constructor;
      Evas.Object_Smart.add;
      Evas.Object_Smart.del;
      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.sub_object_del;
      Elm.Container.content_get;
      Elm.Container.content_set;
      Elm.Container.content_unset;
   }
   events {
      animate,begin;
      animate,done;
   }

}