using System.Windows.Forms;
using FastReport.Export;
using FastReport.Export.Ppml;
using FastReport.Utils;

namespace FastReport.Forms
{
    /// <summary>
    /// Form for <see cref="PPMLExport"/>.
    /// For internal use only.
    /// </summary>
    public partial class PPMLExportForm : BaseExportForm
    {
        /// <inheritdoc/>
        public override void Init(ExportBase export)
        {
            base.Init(export);
            PPMLExport PPMLExport = Export as PPMLExport;
            chCurves.Checked = PPMLExport.TextInCurves;
            nudJpegQuality.Value = PPMLExport.Quality;
        }
        
        /// <inheritdoc/>
        protected override void Done()
        {
            base.Done();
            PPMLExport PPMLExport = Export as PPMLExport;
            PPMLExport.TextInCurves = chCurves.Checked;
            PPMLExport.Quality = (int)nudJpegQuality.Value;
        }
        
        /// <inheritdoc/>
        public override void Localize()
        {
            base.Localize();
            MyRes res = new MyRes("Export,PPML");
            Text = res.Get("");
            res = new MyRes("Export,Misc");
            gbOptions.Text = res.Get("Options");
            res = new MyRes("Export,Pdf");
            chCurves.Text = res.Get("TextInCurves");
            lblQuality.Text = res.Get("JpegQuality");
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="PPMLExportForm"/> class.
        /// </summary>
        public PPMLExportForm()
        {
            InitializeComponent();
        }
    }
}
