#region << Using Directives >>
using System;
using System.Drawing;
using System.Windows.Forms;
#endregion

namespace Volpe.Cafe.EspressoUI.Charts
{
    /// <summary>
    /// Provides data for the <see cref="Chart.ChangeView"/> event.
    /// </summary>
    [Serializable]
    class ChangeViewEventArgs : EventArgs
    {

        #region /*** Ctors ***/

        /// <summary>
        /// Initializes a new instance of the <see cref="ChangeViewEventArgs"/> class.
        /// </summary>
        /// <param name="orientation">Specifies the orientation of the view change, whether the view should change along the
        ///   horizontal or vertical axis.</param>
        /// <param name="direction">Specifies the direction of the view change. If direction is -1, the previous view should be
        ///   selected; if direction is 1, the next view should be selected.</param>
        public ChangeViewEventArgs(Orientation orientation, int direction) : this(ChangeViewTrigger.Any, orientation, direction) { }
        /// <summary>
        /// Initializes a new instance of the <see cref="ChangeViewEventArgs"/> class.
        /// </summary>
        /// <param name="trigger">Specifies the user action that triggered the <see cref="Chart.ChangeView"/> event.</param>
        /// <param name="orientation">Specifies the orientation of the view change, whether the view should change along the
        ///   horizontal or vertical axis.</param>
        /// <param name="direction">Specifies the direction of the view change. If direction is -1, the previous view should be
        ///   selected; if direction is 1, the next view should be selected; if direction is 0, the direction should be
        ///   auto-detected if possible, or no action taken, if not.</param>
        public ChangeViewEventArgs(ChangeViewTrigger trigger, Orientation orientation, int direction) : base()
        {
            this.Trigger     = trigger;
            this.Orientation = orientation;
            this.Direction   = direction;
        }

        #endregion

        #region /*** Methods ***/
        #endregion

        #region /*** Properties ***/

        /// <summary>Gets the user action that triggered the <see cref="Chart.ChangeView"/> event.</summary>
        public ChangeViewTrigger Trigger { get; private set; }
        /// <summary>Gets whether a mouse input initiated a chart's <see cref="Chart.ChangeView"/> event.</summary>
        public bool IsMouseInput { get { return this.Trigger == ChangeViewTrigger.Mouse; } }
        /// <summary>Gets whether a keyboard input initiated a chart's <see cref="Chart.ChangeView"/> event.</summary>
        public bool IsKeyboardInput { get { return this.Trigger == ChangeViewTrigger.Keyboard; } }
        /// <summary>Gets whether a context menu selection initiated a chart's <see cref="Chart.ChangeView"/> event.</summary>
        public bool IsContextMenuInput { get { return this.Trigger == ChangeViewTrigger.ContextMenu; } }

        /// <summary>Gets the orientation of the view change, whether the view should change along the horizontal or vertical axis.</summary>
        public Orientation Orientation { get; private set; }
        /// <summary>Gets whether the view should change along the horizontal axis.</summary>
        public bool IsHorizontal { get { return this.Orientation == Orientation.Horizontal; } }
        /// <summary>Gets whether the view should change along the vertical axis.</summary>
        public bool IsVertical { get { return this.Orientation == Orientation.Vertical; } }

        /// <summary>Gets the direction of the view change. If direction is -1, the previous view should be selected; if direction
        ///   is 1, the next view should be selected; if direction is 0, the direction should be auto-detected if possible, or no
        ///   action taken, if not.</summary>
        public int Direction { get; private set; }

        ///// <summary>Gets or sets the new owner of the <see cref="Chart.ChangeView"/> event. Any animation effects (such as
        /////   swipe-in, fade-in, etc.) after the event is handled, will be performed on the new owner. If this value is null, the
        /////   owner will remain the chart that initiated the event. If the value is not null, the owner will be the specified
        /////   <see cref="Chart"/> instance.</summary>
        //public Chart ChangeOwner { get; set; }

        #endregion

    }
}
