/* * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using System; using System.Collections.Generic; namespace ElmSharp { /// /// Enumeration for the axis along which flip effect should be applied. /// /// preview public enum FlipAxis { /// /// Flip on X-axis. /// X, /// /// Flip on Y-axis. /// Y, } /// /// Enumeration for the direction in which the wipe effect should occur. /// /// preview public enum WipeDirection { /// /// Wipe to the left. /// Left, /// /// Wipe to the right. /// Right, /// /// Wipe to the up. /// Up, /// /// Wipe to the down. /// Down, } /// /// Enumeration for whether the wipe effect should show or hide the object. /// /// preview public enum WipeType { /// /// Hide the object during the animation. /// Hide, /// /// Show the object during the animation. /// Show, } /// /// Enumration for the type of acceleration used in transition. /// /// preview public enum TweenMode { /// /// Constant speed. /// Linear, /// /// Starts slow, increases speed over time, then decrease again and stop slowly, v1 being a power factor. /// Sinusoidal, /// /// Starts fast and decreases speed over time, v1 being a power factor. /// Decelerate, /// /// Starts slow and increases speed over time, v1 being a power factor. /// Accelerate, /// /// Starts at gradient v1, interpolated via power of v2 curve. /// DivisorInterpolate, /// /// Starts at 0.0 then "drop" like a ball bouncing to the ground at 1.0, and bounce v2 times, with decay factor of v1. /// Bounce, /// /// Starts at 0.0 then "wobble" like a spring rest position 1.0, and wobble v2 times, with decay factor of v1. /// Spring, /// /// Follows the cubic-bezier curve calculated with the control points (x1, y1), (x2, y2). /// BezierCurve, } /// /// Blend effect class. /// /// preview public class BlendEffect : EffectBase { /// /// Creates and initializes a new instance of the BlendEffect class. /// /// preview public BlendEffect() { } internal override IntPtr CreateEffect(IntPtr transit) { return Interop.Elementary.elm_transit_effect_blend_add(transit); } } /// /// Color effect class. /// /// preview public class ColorEffect : EffectBase { Color _begin; Color _end; /// /// Creates and initializes a new instance of the ColorEffect class. /// /// The begin color of the effect. /// The end color of the effect. /// preview public ColorEffect(Color beginColor, Color endColor) { _begin = beginColor; _end = endColor; } /// /// The begin color of the effect. /// /// preview public Color BeginColor { get { return _begin; } } /// /// The end color of the effect. /// /// preview public Color EndColor { get { return _end; } } internal override IntPtr CreateEffect(IntPtr transit) { 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); } } /// /// Fade effect class. /// /// preview public class FadeEffect : EffectBase { /// /// Creates and initializes a new instance of the FadeEffect class. /// /// preview public FadeEffect() { } internal override IntPtr CreateEffect(IntPtr transit) { return Interop.Elementary.elm_transit_effect_fade_add(transit); } } /// /// Flip effect class. /// /// preview public class FlipEffect : EffectBase { FlipAxis _axis; bool _clockWise; bool _resizable; /// /// Creates and initializes a new instance of the FlipEffect class. /// /// Flipping axis (X or Y). /// Flipping Direction. True is clockwise. /// Resizable effect with FlipEffect. /// preview public FlipEffect(FlipAxis axis, bool clockWise, bool resizable = false) { _axis = axis; _clockWise = clockWise; _resizable = resizable; } /// /// Flipping axis (X or Y). /// /// preview public FlipAxis Axis { get { return _axis; } } /// /// Flipping direction. True is clockwise. /// /// preview public bool ClockWise { get { return _clockWise; } } /// /// Resizable FlipEffect. /// /// preview public bool Resizable { get { return _resizable; } } internal override IntPtr CreateEffect(IntPtr transit) { if (_resizable) return Interop.Elementary.elm_transit_effect_resizable_flip_add(transit, (int)_axis, _clockWise); return Interop.Elementary.elm_transit_effect_flip_add(transit, (int)_axis, _clockWise); } } /// /// Resizing effect class. /// /// preview public class ResizingEffect : EffectBase { Size _begin; Size _end; /// /// Creates and initializes a new instance of the ResizingEffect class. /// /// The begin size of the effect. /// The end size of the effect. /// preview public ResizingEffect(Size beginSize, Size endSize) { _begin = beginSize; _end = endSize; } /// /// The begin size of the effect. /// /// preview public Size BeginSize { get { return _begin; } } /// /// The end size of the effect. /// /// preview public Size EndSize { get { return _end; } } internal override IntPtr CreateEffect(IntPtr transit) { return Interop.Elementary.elm_transit_effect_resizing_add(transit, _begin.Width, _begin.Height, _end.Width, _end.Height); } } /// /// Rotation effect class. /// /// preview public class RotationEffect : EffectBase { float _begin; float _end; /// /// Creates and initializes a new instance of the RotationEffect class. /// /// The begin degree of the effect. /// The end degree of the effect. /// preview public RotationEffect(float beginDegree, float endDegree) { _begin = beginDegree; _end = endDegree; } /// /// The begin degree of the effect. /// /// preview public float BeginDegree { get { return _begin; } } /// /// The end degree of the effect. /// /// preview public float EndDegree { get { return _end; } } internal override IntPtr CreateEffect(IntPtr transit) { return Interop.Elementary.elm_transit_effect_rotation_add(transit, _begin, _end); } } /// /// Translation effect class. /// /// preview public class TranslationEffect : EffectBase { Point _begin; Point _end; /// /// Creates and initializes a new instance of the TranslationEffect class. /// /// The begin point of the effect. /// The end point of the effect. /// preview public TranslationEffect(Point beginPoint, Point endPoint) { _begin = beginPoint; _end = endPoint; } /// /// The begin point of the effect. /// /// preview public Point BeginPoint { get { return _begin; } } /// /// The end point of the effect. /// /// preview public Point EndPoint { get { return _end; } } internal override IntPtr CreateEffect(IntPtr transit) { return Interop.Elementary.elm_transit_effect_translation_add(transit, _begin.X, _begin.Y, _end.X, _end.Y); } } /// /// Wipe effect class. /// /// preview public class WipeEffect : EffectBase { WipeType _type; WipeDirection _direction; /// /// Creates and initializes a new instance of the WipeEffect class. /// /// Wipe type. Hide or show. /// Wipe direction. /// preview public WipeEffect(WipeType type, WipeDirection direction) { _type = type; _direction = direction; } /// /// Wipe type. Hide or show. /// /// preview public WipeType Type { get { return _type; } } /// /// Wipe direction. /// /// preview public WipeDirection Direction { get { return _direction; } } internal override IntPtr CreateEffect(IntPtr transit) { return Interop.Elementary.elm_transit_effect_wipe_add(transit, (int)_type, (int)_direction); } } /// /// Zoom effect class. /// /// preview public class ZoomEffect : EffectBase { float _begin; float _end; /// /// Creates and initializes a new instance of the ZoomEffect class. /// /// The begin rate of the effect. /// The end rate of the effect. /// preview public ZoomEffect(float beginRate, float endRate) { _begin = beginRate; _end = endRate; } /// /// The begin rate of the effect. /// /// preview public float BeginRate { get { return _begin; } } /// /// The end rate of the effect. /// /// preview public float EndRate { get { return _end; } } internal override IntPtr CreateEffect(IntPtr transit) { return Interop.Elementary.elm_transit_effect_zoom_add(transit, _begin, _end); } } }