using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using SPC.Kiosk.Base;
namespace SPC.Kiosk.Common
{
    public class M_PopupReturn
    {
        public bool OKAnswer { get; set; }
        public bool TimeOut { get; set; }
        public SupportLanguageType ReturnLanguage { get; set; }
        public object PopupArgs { get; set; } = null;
        public object PopupSubArgs { get; set; } = null;
        public ParentPage PopupParentPage { get; set; } = ParentPage.EmptyPage;

    }
    /// <summary>
    /// a Basket Item
    /// </summary>
    /// 2019-04-05 - 1997fx11 : SetItem 관련 참조
    public class M_BasketItem : ViewModelBase
    {
        /// <summary>
        /// Index No
        /// </summary>
        public int Index { get; set; } = 0;


        /// <summary>
        /// PLU_Index No
        /// </summary>
        public int p_Index { get; set; } = 0;

        /// <summary>
        /// Item Add Type
        /// </summary>
        public BasketItemType ItemType { get; set; }
        /// <summary>
        /// Item Code
        /// </summary>
        public string ItemCode { get; set; } = string.Empty;
        /// <summary>
        /// Item Base Price
        /// </summary>
        public double BasePrice { get; set; } = 0d;
        private double price = 0d;
        /// <summary>
        /// Item Price With Option
        /// </summary>
        public double Price
        {
            get { return price; }
            set { price = value; PropertyChange("Price"); }
        }
        private double campaignPrice = 0d;
        public double CampaignPrice
        {
            get { return campaignPrice; }
            set { campaignPrice = value; PropertyChange("CampaignPrice"); }
        }
        private int count = 1;
        /// <summary>
        /// Item Count
        /// </summary>
        public int Count
        {
            get { return count; }
            set { count = value; PropertyChange("Count"); }
        }
        /// <summary>
        /// Is Coupon DC
        /// </summary>
        public bool IsCouponDC { get; set; } = false;
        private double couponDiscount = 0d;
        /// <summary>
        /// Coupon DC Price
        /// </summary>
        public double CouponDiscount
        {
            get { return couponDiscount; }
            set { couponDiscount = value; PropertyChange("CouponDiscount"); }
        }

        /// <summary>
        /// Item Image
        /// </summary>
        public string ItemImage { get; set; }
        /// <summary>
        /// Item Name
        /// </summary>
        public List<M_Language> ItemName { get; set; }
        /// <summary>
        /// Item Count Label
        /// </summary>
        public List<M_Language> ItemCountLabel { get; set; }
        /// <summary>
        /// Item Price Label
        /// </summary>
        public List<M_Language> ItemPriceLabel { get; set; }

        private List<M_Language> allOptionLabel;

        
        /// <summary>
        /// Selected Options Names 
        /// </summary>
        public List<M_Language> AllOptionLabel
        {
            get { return allOptionLabel; }
            set { allOptionLabel = value; PropertyChange("AllOptionLabel"); }
        }

        private List<M_ItemOptionGroup> option;
        /// <summary>
        /// Item Options
        /// </summary>
        public List<M_ItemOptionGroup> Option
        {
            get { return option; }
            set { option = value; PropertyChange("Option"); }
        }
        /// <summary>
        /// Minus Normal Brush
        /// </summary>
        public string MinusNormalBrush { get; set; } = "pack://application:,,,/SPC.Kiosk.Common;component/Resource/btn_move01_left_basic.png";
        /// <summary>
        /// Minus Down Brush
        /// </summary>
        public string MinusDownBrush { get; set; } = "pack://application:,,,/SPC.Kiosk.Common;component/Resource/btn_move01_left_press.png";
        /// <summary>
        /// Plus Normal Brush
        /// </summary>
        public string PlusNormalBrush { get; set; } = "pack://application:,,,/SPC.Kiosk.Common;component/Resource/btn_move01_right_basic.png";
        /// <summary>
        /// Plus Down Brush
        /// </summary>
        public string PlusDownBrush { get; set; } = "pack://application:,,,/SPC.Kiosk.Common;component/Resource/btn_move01_right_press.png";
    }

    /// <summary>
    /// Button Send Events Args
    /// </summary>
    public class M_ItemDropEventArgs
    {
        /// <summary>
        /// Send Object
        /// </summary>
        public object SourceObject { get; set; } = null;
        /// <summary>
        /// Target Object
        /// </summary>
        public object TargetObject { get; set; } = null;
    }
    public class M_IntroItems
    {
        public int ItemsStack { get; set; } = 1;
        public double StackWidth { get; set; } = double.NaN;
        public List<M_StackContents> StackContents { get; set; } = null;
    }
    public class M_StackContents
    {
        public int ItemsIndex { get; set; } = 0;
        public List<M_MediaRollItem> MediaRollItems { get; set; } = null;
    }
    /// <summary>
    /// Media Rolling Item Model
    /// </summary>
    public class M_MediaRollItem
    {
        /// <summary>
        /// Media Type Image or VOD
        /// </summary>
        public MediaType Type { get; set; } = MediaType.None;
        /// <summary>
        /// Media File Path
        /// </summary>
        public string MediaPath { get; set; } = string.Empty;
        /// <summary>
        /// Media Show Running Time Seconds
        /// </summary>
        public double RunnigSeconds { get; set; } = 0;
        public bool RepeatMedia { get; set; }
        public TimeSpan  StartTime { get; set; } = default(TimeSpan);
        public TimeSpan EndTime { get; set; } = default(TimeSpan);
        public IntroLinkType LinkType { get; set; } = IntroLinkType.None;
        public string LinkParameter { get; set; } = string.Empty;
    }
    /// <summary>
    /// Button List Item Collection
    /// </summary>
    public class M_ItemData
    {
        public int Index { get; set; } = -1;
        public string ItemCode { get; set; } = string.Empty;
        public string Category1 { get; set; } = string.Empty;
        public string Category2 { get; set; } = string.Empty;
        public string ImageFile { get; set; } = string.Empty;
        public double Price { get; set; } = 0d;
        public bool IsOption { get; set; }
        public bool IsSoldOut { get; set; }
        public List<M_ItemOptionGroup> Option { get; set; }
        public M_AnimationButton DataParameter { get; set; }
        public M_TextBlock BaseTextBlock { get; set; }
        public M_TextBlock AdditionTextBlock { get; set; }
        public List<string> BadgeImages { get; set; } = null;
        public double BadgeHeight { get; set; } = 0d;
        public HorizontalAlignment BadgeHorizontalAlignment { get; set; } = HorizontalAlignment.Center;
        public VerticalAlignment BadgeVerticalAlignment { get; set; } = VerticalAlignment.Center;
        public Orientation BadgeOrientation { get; set; } = Orientation.Horizontal;
    }
    public class M_ItemOptionGroup 
    {
        public int Index { get; set; } = -1;
        public string Code { get; set; } = string.Empty;
        public string ImageFile { get; set; } = string.Empty;
        public OptionSelectMode SelectMode { get; set; } = OptionSelectMode.None;
        public bool IsMustSelect { get; set; }
        public List<M_Language> Name { get; set; }
        public List<M_ItemOption> Options { get; set; }
        public M_ItemOptionGroup Clone()
        {
            M_ItemOptionGroup result = null;
            try
            {
                result = new M_ItemOptionGroup
                {
                    Index = Index,
                    Code = Code,
                    ImageFile = ImageFile,
                    SelectMode = SelectMode,
                    IsMustSelect = IsMustSelect,
                };
                var newName = new List<M_Language>();
                foreach (var aLanguage in Name)
                {
                    newName.Add(aLanguage.Clone());
                }
                result.Name = newName;
                var newOptions = new List<M_ItemOption>();
                foreach (var aOption in Options)
                {
                    newOptions.Add(aOption.Clone());
                }
                result.Options = newOptions;

            }
            catch 
            {
                result = null;
            }
            return result;
        }
    }
    public class M_ItemOption
    {
        public int Index { get; set; } = -1;
        public string Code { get; set; } = string.Empty;
        public List<M_Language> Name { get; set; }
        public bool IsSelected { get; set; }
        public double SelectValue { get; set; } = 0d;
        public OptionKind Kind { get; set; } = OptionKind.None;
        public string KindCode { get; set; } = string.Empty;
        public double Amount { get; set; } = 0d;
        public int AmountMin { get; set; } = 0;
        public int AmountMax { get; set; } = 0;
        public M_ItemOption Clone()
        {
            M_ItemOption result = null;
            try
            {
                result = new M_ItemOption
                {
                    Index = Index,
                    Code = Code,
                    IsSelected = IsSelected,
                    SelectValue = SelectValue,
                    Kind = Kind,
                    KindCode = KindCode,
                    Amount= Amount,
                    AmountMin = AmountMin,
                    AmountMax = AmountMax,
                };
                var newName = new List<M_Language>();
                foreach (var aLanguage in Name)
                {
                    newName.Add(aLanguage.Clone());
                }
                result.Name = newName;

            }
            catch
            {
                result = null;
            }
            return result;
        }

    }

    public class M_AnimationButton
    {
        public double Width                                     { get; set; } = double.NaN;
        public double Height                                    { get; set; } = double.NaN;
        public Thickness Margin                                 { get; set; }
        public string NormalBrush                               { get; set; } = string.Empty;
        public string DownBrush                                 { get; set; } = string.Empty;
        public string DisableBrush                              { get; set; } = string.Empty;
        public string SwitchOnBrush                             { get; set; } = string.Empty;
        public string DragCursorImage                           { get; set; } = string.Empty;
        public HotSpotType DragCursorHotSpot                    { get; set; } = HotSpotType.LeftTop;
        public Stretch BrushStretch                             { get; set; } = Stretch.Fill;
        public bool Enabled                                     { get; set; } = true;
        public bool Switch                                      { get; set; }
        public bool IsBreathing                                 { get; set; } = false;
        public bool AutoToggle                                  { get; set; } 
        public bool ClickSend                                   { get; set; } 
        public string BaseGrid                                  { get; set; } = string.Empty;
        public string ReciveElement                             { get; set; } = string.Empty;
        public ButtonAnimationType ClickAnimationType           { get; set; } = ButtonAnimationType.None;
        public ButtonAnimationType DropAnimationType            { get; set; } = ButtonAnimationType.None;
        public List<M_Language> LanguageText                    { get; set; } = null;
        public string Text                                      { get; set; } = string.Empty;
        public Visibility TextVisible                           { get; set; } = Visibility.Collapsed;
        public string TextForeground                            { get; set; } = string.Empty;
        public string SwitchOnForeground                        { get; set; } = string.Empty;
        public string DisableForeground                         { get; set; } = string.Empty;
        public VerticalAlignment TextVerticalAlignment          { get; set; } = VerticalAlignment.Center;
        public HorizontalAlignment TextHorizontalAlignment      { get; set; } = HorizontalAlignment.Center;
        public string TextFontFamily                            { get; set; } = string.Empty;
        public double TextFontSize                              { get; set; } = 12;
        public double SwitchOnFontSize                          { get; set; } = 12;
        public double DisableFontSize                           { get; set; } = 12;
        public FontWeight TextFontWeight                        { get; set; } = FontWeights.Normal;
        public FontWeight SwitchOnFontWeight                    { get; set; } = FontWeights.Normal;
        public FontWeight DisableWeight                         { get; set; } = FontWeights.Normal;
        public TextWrapping TextWrapping                        { get; set; } = TextWrapping.Wrap;
        public TextAlignment TextAlignment                      { get; set; } = TextAlignment.Center;
        public Thickness TextMargin                             { get; set; } 
        public bool DragEnable                                  { get; set; } 
        public double CircleSize                                { get; set; } = 30d;
        public string CircleBackBrush                           { get; set; } = string.Empty;
        public string CircleTextBruch                           { get; set; } = string.Empty;
        public string CircleText                                { get; set; } = string.Empty;
        public bool CircleOuter                                 { get; set; } 
        public SupportLanguageType DisplayLanguage              { get; set; }


    };
    /// <summary>
    /// Button List Item Text Box Collection
    /// </summary>
    public class M_TextBlock
    {
        public List<M_Language> LanguageData { get; set; } = null;
        public double Width { get; set; } = double.NaN;
        public double Height { get; set; } = double.NaN;
        public double TextSize { get; set; } = 12;
        public string TextBrush { get; set; } = "Transparent";
        public FontWeight TextWeight { get; set; } = FontWeights.Normal;
        public string TextFontFamily { get; set; } = "NanumSquare";
        public VerticalAlignment TextVerticalAlignment { get; set; } = VerticalAlignment.Center;
        public HorizontalAlignment TextHorizontalAlignment { get; set; } = HorizontalAlignment.Center;
        public TextAlignment TextAlignment { get; set; } = TextAlignment.Center;
        public TextWrapping TextWrapping { get; set; } = TextWrapping.Wrap;
        public bool AutoTextTrim { get; set; } = false;
        public Thickness TextMargin { get; set; }
    }
    public class M_MultiLanguage
    {
        public string MessageCode { get; set; }
        public List<M_Language> MessageData {get; set;}
    }
    public class M_Language
    {
        public SupportLanguageType Type { get; set; }
        public string LanguageData { get; set; }
        public M_Language Clone()
        {
            M_Language result = null;
            try
            {
                result = new M_Language
                {
                    Type = Type,
                    LanguageData = LanguageData,
                };
            }
            catch
            {
                result = null;
            }
            return result;
        }

    }

    //public class NhsFuncInfo
    //{
    //    /// <summary>
    //    /// STEP01 포인트 적립 - 해피포인트 적립
    //    /// </summary>
    //    public string SaveHappyPoint { get; set; }
    //    /// <summary>
    //    /// STEP01 포인트 적립 - OK CASHBAG 적립
    //    /// </summary>        
    //    public string SaveOkCashBag { get; set; }
    //    /// <summary>
    //    /// STEP01 통신사 할인 - SKT
    //    /// </summary>        
    //    public string DiscountSKT { get; set; }
    //    /// <summary>
    //    /// STEP01 통신사 할인 - KT
    //    /// </summary>        
    //    public string DiscountKT { get; set; }
    //    /// <summary>
    //    /// STEP01 통신사 할인 - LGT
    //    /// </summary>        
    //    public string DiscountLG { get; set; }
    //    /// <summary>
    //    /// STEP02 포인트 사용 - 해피포인트 사용
    //    /// </summary>        
    //    public string UsePointHappyPoint { get; set; }
    //    /// <summary>
    //    /// STEP02 포인트 사용 - OK CASHBAG 사용
    //    /// </summary>        
    //    public string UsePointOkCashBag { get; set; }
    //    /// <summary>
    //    /// STEP02 쿠폰 사용 - 해피쿠폰할인
    //    /// </summary>        
    //    public string UseCouponHappy { get; set; }
    //    /// <summary>
    //    /// STEP02 쿠폰 사용 - 모바일쿠폰
    //    /// </summary>        
    //    public string UseCouponMobile { get; set; }
    //    /// <summary>
    //    /// STEP03 카드 결제 - 신용카드
    //    /// </summary>        
    //    public string UseCardPaymentCreditCard { get; set; }
    //    /// <summary>
    //    /// STEP03 카드 결제 - SPC 사원증
    //    /// </summary>        
    //    public string UseCardPaymentSPCEmployeeCertificate { get; set; }
    //    /// <summary>
    //    /// STEP03 카드 결제 - HAPPY GIFT
    //    /// </summary>        
    //    public string UseCardPaymentHappyGift { get; set; }
    //    /// <summary>
    //    /// STEP03 카드 결제 - 삼성/LG 페이
    //    /// </summary>        
    //    public string UseCardPaymentSamsungLGPay { get; set; }
    //    /// <summary>
    //    /// STEP03 카드 결제 - 스마일페이
    //    /// </summary>        
    //    public string UseCardPaymentSmilePay { get; set; }
    //}
}
