﻿using System;
using BugseePlugin.Internals;

namespace BugseePlugin.Internals
{
    internal sealed class BugseeFeedbackAppearance : AppearanceBase, IBugseeFeedbackAppearance
    {
        private IBugseeAppearance baseAppearance;

        internal BugseeFeedbackAppearance(
            IBugseeAppearance baseAppearance,
            Func<BugseeAppearanceProperties, AppearanceValue, AppearanceValue> getSetHandler
            ) : base(getSetHandler)
        {
            this.baseAppearance = baseAppearance;
        }


        #region Common

        /// <summary>
        /// Gets or sets the color of the background.
        /// </summary>
        /// <value>The color of the background.</value>
        public IBugseeColor BackgroundColor
        {
            get => g(BugseeAppearanceProperties.FeedbackBackgroundColor).Color;
            set => s(BugseeAppearanceProperties.FeedbackBackgroundColor, AppearanceValue.Create(value, null));
        }

        /// <summary>
        /// Gets or sets the color of the incoming bubble.
        /// </summary>
        /// <value>The color of the incoming bubble.</value>
        public IBugseeColor IncomingBubbleColor
        {
            get => g(BugseeAppearanceProperties.FeedbackIncomingBubbleColor).Color;
            set => s(BugseeAppearanceProperties.FeedbackIncomingBubbleColor, AppearanceValue.Create(value, null));
        }

        /// <summary>
        /// Gets or sets the color of the outgoing bubble.
        /// </summary>
        /// <value>The color of the outgoing bubble.</value>
        public IBugseeColor OutgoingBubbleColor
        {
            get => g(BugseeAppearanceProperties.FeedbackOutgoingBubbleColor).Color;
            set => s(BugseeAppearanceProperties.FeedbackOutgoingBubbleColor, AppearanceValue.Create(value, null));
        }

        /// <summary>
        /// Gets or sets the color of the incoming text.
        /// </summary>
        /// <value>The color of the incoming text.</value>
        public IBugseeColor IncomingTextColor
        {
            get => g(BugseeAppearanceProperties.FeedbackIncomingTextColor).Color;
            set => s(BugseeAppearanceProperties.FeedbackIncomingTextColor, AppearanceValue.Create(value, null));
        }

        /// <summary>
        /// Gets or sets the color of the outgoing text.
        /// </summary>
        /// <value>The color of the outgoing text.</value>
        public IBugseeColor OutgoingTextColor
        {
            get => g(BugseeAppearanceProperties.FeedbackOutgoingTextColor).Color;
            set => s(BugseeAppearanceProperties.FeedbackOutgoingTextColor, AppearanceValue.Create(value, null));
        }

        /// <summary>
        /// Gets or sets the color of the title text.
        /// </summary>
        /// <value>The color of the title text.</value>
        public IBugseeColor TitleTextColor
        {
            get => g(BugseeAppearanceProperties.FeedbackTitleTextColor).Color;
            set => s(BugseeAppearanceProperties.FeedbackTitleTextColor, AppearanceValue.Create(value, null));
        }

        /// <summary>
        /// Ask for email popup skip button text color
        /// </summary>
        /// <value>The color of the email skip.</value>
        public IBugseeColor EmailSkipColor
        {
            get => g(BugseeAppearanceProperties.FeedbackEmailSkipColor).Color;
            set => s(BugseeAppearanceProperties.FeedbackEmailSkipColor, AppearanceValue.Create(value, null));
        }

        /// <summary>
        /// Ask for email popup background color
        /// </summary>
        /// <value>The color of the email background.</value>
        public IBugseeColor EmailBackgroundColor
        {
            get => g(BugseeAppearanceProperties.FeedbackEmailBackgroundColor).Color;
            set => s(BugseeAppearanceProperties.FeedbackEmailBackgroundColor, AppearanceValue.Create(value, null));
        }

        /// <summary>
        /// Ask for email continue not active button background color
        /// </summary>
        /// <value>The color of the email continue not active.</value>
        public IBugseeColor EmailContinueNotActiveColor
        {
            get => g(BugseeAppearanceProperties.FeedbackEmailContinueNotActiveColor).Color;
            set => s(BugseeAppearanceProperties.FeedbackEmailContinueNotActiveColor, AppearanceValue.Create(value, null));
        }

        /// <summary>
        /// Ask for email continue button background color
        /// </summary>
        /// <value>The color of the email continue active.</value>
        public IBugseeColor EmailContinueActiveColor
        {
            get => g(BugseeAppearanceProperties.FeedbackEmailContinueActiveColor).Color;
            set => s(BugseeAppearanceProperties.FeedbackEmailContinueActiveColor, AppearanceValue.Create(value, null));
        }

        #endregion

        #region iOS

        /// <summary>
        /// iOS: Navigation bar and bottom bar colors
        /// </summary>
        /// <value>The color of the bars.</value>
        public IBugseeColor BarsColor
        {
            get => g(BugseeAppearanceProperties.FeedbackBarsColor).Color;
            set => s(BugseeAppearanceProperties.FeedbackBarsColor, AppearanceValue.Create(value, null));
        }

        /// <summary>
        /// iOS: Gets or sets the color of the input text.
        /// </summary>
        /// <value>The color of the input text.</value>
        public IBugseeColor InputTextColor
        {
            get => g(BugseeAppearanceProperties.FeedbackInputTextColor).Color;
            set => s(BugseeAppearanceProperties.FeedbackInputTextColor, AppearanceValue.Create(value, null));
        }

        /// <summary>
        /// iOS: Gets or sets the color of the close button.
        /// </summary>
        /// <value>The color of the close button.</value>
        public IBugseeColor CloseButtonColor
        {
            get => g(BugseeAppearanceProperties.FeedbackCloseButtonColor).Color;
            set => s(BugseeAppearanceProperties.FeedbackCloseButtonColor, AppearanceValue.Create(value, null));
        }

        /// <summary>
        /// iOS: Gets or sets the color of the navigation bar.
        /// </summary>
        /// <value>The color of the navigation bar.</value>
        public IBugseeColor NavigationBarColor
        {
            get => g(BugseeAppearanceProperties.FeedbackNavigationBarColor).Color;
            set => s(BugseeAppearanceProperties.FeedbackNavigationBarColor, AppearanceValue.Create(value, null));
        }

        #endregion

        #region Android

        /// <summary>
        /// Android: Action bar background color in Feedback UI
        /// </summary>
        /// <value>The color of the action bar.</value>
        public IBugseeColor ActionBarColor
        {
            get => g(BugseeAppearanceProperties.FeedbackActionBarColor).Color;
            set => s(BugseeAppearanceProperties.FeedbackActionBarColor, AppearanceValue.Create(value, null));
        }

        /// <summary>
        /// Android: Action bar buttons background color in clicked state in Feedback UI
        /// </summary>
        /// <value>The color of the action bar button background clicked.</value>
        public IBugseeColor ActionBarButtonBackgroundClickedColor
        {
            get => g(BugseeAppearanceProperties.FeedbackActionBarButtonBackgroundClickedColor).Color;
            set => s(BugseeAppearanceProperties.FeedbackActionBarButtonBackgroundClickedColor, AppearanceValue.Create(value, null));
        }

        /// <summary>
        /// Android: Message date text color in Feedback UI
        /// </summary>
        /// <value>The color of the date text.</value>
        public IBugseeColor DateTextColor
        {
            get => g(BugseeAppearanceProperties.FeedbackDateTextColor).Color;
            set => s(BugseeAppearanceProperties.FeedbackDateTextColor, AppearanceValue.Create(value, null));
        }

        /// <summary>
        /// Android: Ask for email dialog "Skip" button text color in Feedback UI
        /// </summary>
        /// <value>The color of the email skip text.</value>
        public IBugseeColor EmailSkipTextColor
        {
            get => g(BugseeAppearanceProperties.FeedbackEmailSkipTextColor).Color;
            set => s(BugseeAppearanceProperties.FeedbackEmailSkipTextColor, AppearanceValue.Create(value, null));
        }

        /// <summary>
        /// Android: Ask for email dialog "Skip" button background color in clicked state in Feedback UI
        /// </summary>
        /// <value>The color of the email skip background clicked.</value>
        public IBugseeColor EmailSkipBackgroundClickedColor
        {
            get => g(BugseeAppearanceProperties.FeedbackEmailSkipBackgroundClickedColor).Color;
            set => s(BugseeAppearanceProperties.FeedbackEmailSkipBackgroundClickedColor, AppearanceValue.Create(value, null));
        }

        /// <summary>
        /// Android: Ask for email dialog "Continue" button background color in clicked state in Feedback UI
        /// </summary>
        /// <value>The color of the email continue clicked.</value>
        public IBugseeColor EmailContinueClickedColor
        {
            get => g(BugseeAppearanceProperties.FeedbackEmailContinueClickedColor).Color;
            set => s(BugseeAppearanceProperties.FeedbackEmailContinueClickedColor, AppearanceValue.Create(value, null));
        }

        /// <summary>
        /// Android: Input message hint text color in Feedback UI
        /// </summary>
        /// <value>The color of the input text hint.</value>
        public IBugseeColor InputTextHintColor
        {
            get => g(BugseeAppearanceProperties.FeedbackInputTextHintColor).Color;
            set => s(BugseeAppearanceProperties.FeedbackInputTextHintColor, AppearanceValue.Create(value, null));
        }

        /// <summary>
        /// Android: Color of delimiter between message list and EditText for new message inputting in Feedback UI
        /// </summary>
        /// <value>The color of the bottom delimiter.</value>
        public IBugseeColor BottomDelimiterColor
        {
            get => g(BugseeAppearanceProperties.FeedbackBottomDelimiterColor).Color;
            set => s(BugseeAppearanceProperties.FeedbackBottomDelimiterColor, AppearanceValue.Create(value, null));
        }

        /// <summary>
        /// Android: Background color of a bar in Feedback UI, which indicates loading state and shows error information if any
        /// </summary>
        /// <value>The color of the loading bar background.</value>
        public IBugseeColor LoadingBarBackgroundColor
        {
            get => g(BugseeAppearanceProperties.FeedbackLoadingBarBackgroundColor).Color;
            set => s(BugseeAppearanceProperties.FeedbackLoadingBarBackgroundColor, AppearanceValue.Create(value, null));
        }

        /// <summary>
        /// Android: Text color in a bar, which indicates loading state in Feedback UI
        /// </summary>
        /// <value>The color of the loading text.</value>
        public IBugseeColor LoadingTextColor
        {
            get => g(BugseeAppearanceProperties.FeedbackLoadingTextColor).Color;
            set => s(BugseeAppearanceProperties.FeedbackLoadingTextColor, AppearanceValue.Create(value, null));
        }

        /// <summary>
        /// Android: Error description text color in Feedback UI
        /// </summary>
        /// <value>The color of the error text.</value>
        public IBugseeColor ErrorTextColor
        {
            get => g(BugseeAppearanceProperties.FeedbackErrorTextColor).Color;
            set => s(BugseeAppearanceProperties.FeedbackErrorTextColor, AppearanceValue.Create(value, null));
        }

        /// <summary>
        /// Android: Background color of a bar in Feedback UI, which indicates that app version has changed
        /// </summary>
        /// <value>The color of the version changed background.</value>
        public IBugseeColor VersionChangedBackgroundColor
        {
            get => g(BugseeAppearanceProperties.FeedbackVersionChangedBackgroundColor).Color;
            set => s(BugseeAppearanceProperties.FeedbackVersionChangedBackgroundColor, AppearanceValue.Create(value, null));
        }

        /// <summary>
        /// Android: Text color in a bar in Feedback UI, which indicates that app version has changed
        /// </summary>
        /// <value>The color of the feedback version changed text.</value>
        public IBugseeColor FeedbackVersionChangedTextColor
        {
            get => g(BugseeAppearanceProperties.FeedbackVersionChangedTextColor).Color;
            set => s(BugseeAppearanceProperties.FeedbackVersionChangedTextColor, AppearanceValue.Create(value, null));
        }

        #endregion
    }
}
