using Microsoft.AspNetCore.Components.Web;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using FastReport.Export.Html;
using FastReport.Web.Application.Localizations;

namespace FastReport.Web.Blazor.Components.Internal.ExportSettings
{
    public partial class HtmlExportSettings : ExportSettingsBase
    {
        const string Wysiwyg = nameof(HTMLExport.Wysiwyg);
        const string Pictures = nameof(HTMLExport.Pictures);
        const string SubFolder = nameof(HTMLExport.SubFolder);
        const string Navigator = nameof(HTMLExport.Navigator);
        const string SinglePage = nameof(HTMLExport.SinglePage);
        const string Layers = nameof(HTMLExport.Layers);
        const string EmbedPictures = nameof(HTMLExport.EmbedPictures);

        HtmlExportSettingsLocalization localization;


        protected override void OnInitialized()
        {
            base.OnInitialized();

            ExportParameters[Navigator] = "true";
            ExportParameters[Wysiwyg] = "true";
            ExportParameters[Pictures] = "true";
            ExportParameters[Navigator] = "true";
            ExportParameters[SinglePage] = "true";
            ExportParameters[Layers] = "true";
            ExportParameters[EmbedPictures] = "true";
        }

        protected override void LocalizeForm()
        {
            var res = WebReport.Res;
            localization = new HtmlExportSettingsLocalization(res);
        }

        void OnWysiwygClick(MouseEventArgs e)
        {
            ChangeBoolValue(Wysiwyg);
        }

        void OnPicturesClick(MouseEventArgs e)
        {
            ChangeBoolValue(Pictures);
        }

        void OnSubFolderClick(MouseEventArgs e)
        {
            ChangeBoolValue(SubFolder);
        }

        void OnNavigatorClick(MouseEventArgs e)
        {
            ChangeBoolValue(Navigator);
        }

        void OnSinglePageClick(MouseEventArgs e)
        {
            ChangeBoolValue(SinglePage);
        }

        void OnLayersClick(MouseEventArgs e)
        {
            ChangeBoolValue(Layers);
        }

        void OnEmbeddingPicturesClick(MouseEventArgs e)
        {
            ChangeBoolValue(EmbedPictures);
        }

        
    }
}
