2 * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 using System.Collections.Generic;
23 /// The axis along which flip effect should be applied.
39 /// The direction in which the wipe effect should occur.
41 public enum WipeDirection
65 /// Whether the wipe effect should show or hide the object.
70 /// Hide the object during the animation
75 /// Show the object during the animation
81 /// The type of acceleration used in the transition.
91 /// Starts slow, increase speed over time, then decrease again and stop slowly, v1 being a power factor
96 /// Starts fast and decrease speed over time, v1 being a power factor
101 /// Starts slow and increase speed over time, v1 being a power factor
106 /// Start at gradient v1, interpolated via power of v2 curve
111 /// Start at 0.0 then "drop" like a ball bouncing to the ground at 1.0, and bounce v2 times, with decay factor of v1
116 /// Start at 0.0 then "wobble" like a spring rest position 1.0, and wobble v2 times, with decay factor of v1
121 /// Follow the cubic-bezier curve calculated with the control points (x1, y1), (x2, y2)
127 /// Blend effect class.
129 public class BlendEffect : EffectBase
132 /// Creates and initializes a new instance of BlendEffect class.
138 internal override IntPtr CreateEffect(IntPtr transit)
140 return Interop.Elementary.elm_transit_effect_blend_add(transit);
145 /// Color effect class.
147 public class ColorEffect : EffectBase
153 /// Creates and initializes a new instance of ColorEffect class.
155 /// <param name="beginColor">The begin color of the effect</param>
156 /// <param name="endColor">The end color of the effect</param>
157 public ColorEffect(Color beginColor, Color endColor)
164 /// The begin color of the effect
166 public Color BeginColor
168 get { return _begin; }
172 /// The end color of the effect
174 public Color EndColor
179 internal override IntPtr CreateEffect(IntPtr transit)
181 return Interop.Elementary.elm_transit_effect_color_add(transit, _begin.R, _begin.G, _begin.B, _begin.A, _end.R, _end.G, _end.B, _end.A);
186 /// Fade effect class.
188 public class FadeEffect : EffectBase
191 /// Creates and initializes a new instance of FadeEffect class.
197 internal override IntPtr CreateEffect(IntPtr transit)
199 return Interop.Elementary.elm_transit_effect_fade_add(transit);
204 /// Flip effect class.
206 public class FlipEffect : EffectBase
213 /// Creates and initializes a new instance of FlipEffect class.
215 /// <param name="axis">Flipping Axis(X or Y).</param>
216 /// <param name="clockWise">Flipping Direction. True is clock-wise.</param>
217 /// <param name="resizable">Resizable effect with FlipEffect</param>
218 public FlipEffect(FlipAxis axis, bool clockWise, bool resizable = false)
221 _clockWise = clockWise;
222 _resizable = resizable;
226 /// Flipping Axis(X or Y).
230 get { return _axis; }
234 /// Flipping Direction. True is clock-wise.
236 public bool ClockWise
238 get { return _clockWise; }
242 /// Resizable FlipEffect.
244 public bool Resizable
246 get { return _resizable; }
249 internal override IntPtr CreateEffect(IntPtr transit)
252 return Interop.Elementary.elm_transit_effect_resizable_flip_add(transit, (int)_axis, _clockWise);
253 return Interop.Elementary.elm_transit_effect_flip_add(transit, (int)_axis, _clockWise);
258 /// Resizing effect class.
260 public class ResizingEffect : EffectBase
266 /// Creates and initializes a new instance of FlipEffect class.
268 /// <param name="beginSize">The begin Size of the effect</param>
269 /// <param name="endSize">The end Size of the effect</param>
270 public ResizingEffect(Size beginSize, Size endSize)
277 /// The begin Size of the effect
279 public Size BeginSize
281 get { return _begin; }
285 /// The end Size of the effect
292 internal override IntPtr CreateEffect(IntPtr transit)
294 return Interop.Elementary.elm_transit_effect_resizing_add(transit, _begin.Width, _begin.Height, _end.Width, _end.Height);
299 /// Rotation effect class.
301 public class RotationEffect : EffectBase
307 /// Creates and initializes a new instance of RotationEffect class.
309 /// <param name="beginDegree">The begin degree of the effect</param>
310 /// <param name="endDegree">The end degree of the effect</param>
311 public RotationEffect(float beginDegree, float endDegree)
313 _begin = beginDegree;
318 /// The begin degree of the effect
320 public float BeginDegree
322 get { return _begin; }
326 /// The end degree of the effect
328 public float EndDegree
333 internal override IntPtr CreateEffect(IntPtr transit)
335 return Interop.Elementary.elm_transit_effect_rotation_add(transit, _begin, _end);
340 /// Translation effect class.
342 public class TranslationEffect : EffectBase
348 /// Creates and initializes a new instance of FlipEffect class.
350 /// <param name="beginPoint">The begin Point of the effect</param>
351 /// <param name="endPoint">The end Point of the effect</param>
352 public TranslationEffect(Point beginPoint, Point endPoint)
359 /// The begin Point of the effect
361 public Point BeginPoint
363 get { return _begin; }
367 /// The end Point of the effect
369 public Point EndPoint
374 internal override IntPtr CreateEffect(IntPtr transit)
376 return Interop.Elementary.elm_transit_effect_translation_add(transit, _begin.X, _begin.Y, _end.X, _end.Y);
381 /// Wipe effect class.
383 public class WipeEffect : EffectBase
386 WipeDirection _direction;
389 /// Creates and initializes a new instance of WipeEffect class.
391 /// <param name="type">Wipe type. Hide or show.</param>
392 /// <param name="direction">Wipe Direction.</param>
393 public WipeEffect(WipeType type, WipeDirection direction)
396 _direction = direction;
400 /// Wipe type. Hide or show.
404 get { return _type; }
410 public WipeDirection Direction
412 get { return _direction; }
415 internal override IntPtr CreateEffect(IntPtr transit)
417 return Interop.Elementary.elm_transit_effect_wipe_add(transit, (int)_type, (int)_direction);
422 /// Zoom effect class.
424 public class ZoomEffect : EffectBase
430 /// Creates and initializes a new instance of ZoomEffect class.
432 /// <param name="beginRate">The begin rate of the effect</param>
433 /// <param name="endRate">The end rate of the effect</param>
434 public ZoomEffect(float beginRate, float endRate)
441 /// The begin rate of the effect
443 public float BeginRate
445 get { return _begin; }
449 /// The end rate of the effect
456 internal override IntPtr CreateEffect(IntPtr transit)
458 return Interop.Elementary.elm_transit_effect_zoom_add(transit, _begin, _end);