// Created with MonoDevelop
//
//    QuickStep: Acquire, view and identify spectra 
//    Copyright (C) 2024 Hiperscan GmbH Dresden, Germany
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.


using System;
using System.Collections.Generic;
using Hiperscan.Unix;

namespace Hiperscan.ApoIdentCore.Reporting.Protocol.SubstanceProperties
{
    public class CommonCannabisSubstanceProperties : CommonSubstanceProperties
    {
        protected override void Init(PdfArgs args)
        {
            base.Init(args);
            this.THCContent = this.Info.THCInput + "%";
            this.CBDContent = this.Info.CBDInput + "%";
        }

        protected override bool DrawRow1Right()
        {
            this.DoLineFeed = true;

            this.Layout.XPosition = this.IndentX2;
            if (this.Layout.AddParagraph(this.THCContentLabel) == false)
                return false;

            this.Layout.XPosition = this.IndentX3;
            return this.Layout.AddParagraph(this.THCContent);
        }

        protected override bool DrawRow2Right()
        {
            this.DoLineFeed = true;

            this.Layout.XPosition = this.IndentX2;
            if (this.Layout.AddParagraph(this.CBDContentLabel) == false)
                return false;

            this.Layout.XPosition = this.IndentX3;
            return this.Layout.AddParagraph(this.CBDContent);
        }

        protected override bool DrawRow3Left()
        {
            return true;
        }

        protected override List<string> InitLabelColumn()
        {
            List<string> tmp = base.InitLabelColumn();
            tmp.Add(this.THCContentLabel);
            tmp.Add(this.CBDContentLabel);
            return tmp;
        }

        protected override List<string> InitContentColumn()
        {
            List<string> tmp = base.InitContentColumn();
            tmp.Add(this.THCContent);
            tmp.Add(this.CBDContent);
            return tmp;
        }

        private string THCContentLabel => Catalog.GetString("THC content:");
        private string CBDContentLabel => Catalog.GetString("CBD content:");

        private string THCContent { get; set; }
        private string CBDContent { get; set; }
    }
}
