using PDF_Office.Model.PDFTool;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PDF_Office.Views.HomePanel.PDFTools
{
    public enum PDFToolType
    {
        Split,
        Extract,
        Insert,
        Compress,
        Merge,
        Print,
        Security,
        ConvertPDF,
        PDFToWord,
        PDFToExcel,
        PDFToPPT,
        ImageToPDF,
        OCR,
        WaterMark,
        HeaderFooter,
        BatesNumbers,
        Batch,
        Background,
        CompareDoc

    }
    public class PDFTools
    {
        public List<ToolItem> AllTools = null;
        public List<ToolItem> QuickTools = null;
        public PDFTools()
        {
            InitPDFTools();
        }

        private void InitPDFTools()
        {
            AllTools = new List<ToolItem>();
            InitAllTools();
            InitQuickTools();
        }

        private void InitAllTools()
        {
            string path = @"pack://application:,,,/Resources/PromotionIcon/Windows.png";
            AddToolItem(PDFToolType.Split, path, "拆分", "Batch convert, compress, secure, watermark PDFs.");
            AddToolItem(PDFToolType.Extract, path, "提取", "Batch convert, compress, secure, watermark PDFs.");
            AddToolItem(PDFToolType.Insert, path, "插入", "Batch convert, compress, secure, watermark PDFs.");
            AddToolItem(PDFToolType.Compress, path, "压缩", "Batch convert, compress, secure, watermark PDFs.");
            AddToolItem(PDFToolType.Merge, path, "合并", "Batch convert, compress, secure, watermark PDFs.");
            AddToolItem(PDFToolType.Print, path, "打印", "Batch convert, compress, secure, watermark PDFs.");
            AddToolItem(PDFToolType.Security, path, "安全", "Batch convert, compress, secure, watermark PDFs.");
            AddToolItem(PDFToolType.ConvertPDF, path, "转档PDF", "Batch convert, compress, secure, watermark PDFs.");
            AddToolItem(PDFToolType.PDFToWord, path, "PDF转Word", "Batch convert, compress, secure, watermark PDFs.");
            AddToolItem(PDFToolType.PDFToExcel, path, "PDF转Excel", "Batch convert, compress, secure, watermark PDFs.");
            AddToolItem(PDFToolType.PDFToPPT, path, "PDF转PPT", "Batch convert, compress, secure, watermark PDFs.");
            AddToolItem(PDFToolType.ImageToPDF, path, "图片转PDF", "Batch convert, compress, secure, watermark PDFs.");
            AddToolItem(PDFToolType.OCR, path, "OCR", "Batch convert, compress, secure, watermark PDFs.");
            AddToolItem(PDFToolType.WaterMark, path, "水印", "Batch convert, compress, secure, watermark PDFs.");
            AddToolItem(PDFToolType.HeaderFooter, path, "页眉页脚", "Batch convert, compress, secure, watermark PDFs.");
            AddToolItem(PDFToolType.BatesNumbers, path, "贝茨Bates码", "Batch convert, compress, secure, watermark PDFs.");
            AddToolItem(PDFToolType.Batch, path, "批量处理", "Batch convert, compress, secure, watermark PDFs.");
            AddToolItem(PDFToolType.Background, path, "背景", "Batch convert, compress, secure, watermark PDFs.");
            AddToolItem(PDFToolType.CompareDoc, path, "文件对比", "Batch convert, compress, secure, watermark PDFs.");
        }

        private void AddToolItem(PDFToolType toolType, string imgPath,string title,string titleInfo,int id = 0)
        {
            ToolItem toolItem = new ToolItem();

            toolItem.Id = id;
            toolItem.Tag = toolType;
            toolItem.Image = imgPath;
            toolItem.Title = title;
            toolItem.TitleInfo = titleInfo;
            AllTools.Add(toolItem);
        }

        private void InitQuickTools()
        {
            QuickTools = AllTools.Take(8).ToList<ToolItem>();
        }
    }


}