using System;
using System.Text;
using System.Drawing;
namespace DevComponents.Charts.TextMarkup
{
    /// 
    /// Holds text-markup related settings.
    /// 
    public static class MarkupSettings
    {
        private static HyperlinkStyle _NormalHyperlink = new HyperlinkStyle(Color.Blue, eHyperlinkUnderlineStyle.SolidLine);
        /// 
        /// Gets the style of the hyperlink in its default state.
        /// 
        public static HyperlinkStyle NormalHyperlink
        {
            get { return _NormalHyperlink; }
        }
        private static HyperlinkStyle _MouseOverHyperlink = new HyperlinkStyle();
        /// 
        /// Gets the style of the hyperlink when mouse is over the link.
        /// 
        public static HyperlinkStyle MouseOverHyperlink
        {
            get { return _MouseOverHyperlink; }
        }
        private static HyperlinkStyle _VisitedHyperlink = new HyperlinkStyle();
        /// 
        /// Gets the style of the visited hyperlink.
        /// 
        public static HyperlinkStyle VisitedHyperlink
        {
            get { return _VisitedHyperlink; }
        }
    }
    /// 
    /// Defines the text-markup hyperlink appearance style.
    /// 
    public class HyperlinkStyle
    {
        /// 
        /// Initializes a new instance of the HyperlinkStyle class.
        /// 
        public HyperlinkStyle()
        {
        }
        /// 
        /// Initializes a new instance of the HyperlinkStyle class.
        /// 
        /// 
        /// 
        public HyperlinkStyle(Color textColor, eHyperlinkUnderlineStyle underlineStyle)
        {
            _TextColor = textColor;
            _UnderlineStyle = underlineStyle;
        }
        /// 
        /// Initializes a new instance of the HyperlinkStyle class.
        /// 
        /// 
        /// 
        /// 
        public HyperlinkStyle(Color textColor, Color backColor, eHyperlinkUnderlineStyle underlineStyle)
        {
            _TextColor = textColor;
            _BackColor = backColor;
            _UnderlineStyle = underlineStyle;
        }
        private Color _TextColor = Color.Empty;
        /// 
        /// Gets or sets hyperlink text color.
        /// 
        public Color TextColor
        {
            get { return _TextColor; }
            set
            {
                if (_TextColor != value)
                {
                    _TextColor = value;
                }
            }
        }
        private Color _BackColor = Color.Empty;
        /// 
        /// Gets or sets hyperlink back color.
        /// 
        public Color BackColor
        {
            get { return _BackColor; }
            set
            {
                if (_BackColor != value)
                {
                    _BackColor = value;
                }
            }
        }
        private eHyperlinkUnderlineStyle _UnderlineStyle = eHyperlinkUnderlineStyle.None;
        /// 
        /// Gets or sets the underline style for the hyperlink.
        /// 
        public eHyperlinkUnderlineStyle UnderlineStyle
        {
            get { return _UnderlineStyle; }
            set
            {
                if (_UnderlineStyle != value)
                {
                    _UnderlineStyle = value;
                }
            }
        }
        /// 
        /// Gets whether style has been changed from its default state.
        /// 
        public bool IsChanged
        {
            get { return !_TextColor.IsEmpty || !_BackColor.IsEmpty || _UnderlineStyle != eHyperlinkUnderlineStyle.None; }
        }
    }
    /// 
    /// Defines hyperlink styles.
    /// 
    public enum eHyperlinkUnderlineStyle
    {
        /// 
        /// Hyper links are not marked.
        /// 
        None,
        /// 
        /// Hyper links are underlined using solid line.
        /// 
        SolidLine,
        /// 
        /// Hyper links are underlined using dashed line.
        /// 
        DashedLine
    }
}