// Created with MonoDevelop
//
//    QuickStep: Acquire, view and identify spectra 
//    Copyright (C) 2023. 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.Reflection;

using Hiperscan.Unix;
using Hiperscan.Extensions.ReferenceCheck.View;
using Hiperscan.Extensions.ReferenceCheck.Control;

namespace Hiperscan.Extensions.ReferenceCheck
{
    public class Plugin : IPlugin
    {
        public static bool replace_gui = false;

        internal static IHost host;
        private MenuInfo[] menu_infos;
        private bool active = true;
      
        public Plugin()
        {
            MenuInfo menu_info1 = new MenuInfo(Catalog.GetString("Reference Checker"));
            menu_info1.Invoked += delegate(object sender, EventArgs e) 
            {
                GUI.Run(Plugin.host); 
            };

            this.menu_infos = new MenuInfo[] { menu_info1 };
        }

        public void ReplaceGui()
        {
            Plugin.replace_gui = false;
        } 
        
        public MenuInfo[] MenuInfos
        {
            get { return this.menu_infos; }
        }
        
        public ToolbarInfo[] ToolbarInfos
        {
            get { return null; }
        }
        
        public PlotTypeInfo[] PlotTypeInfos
        {
            get { return null; }
        }

        public FileTypeInfo[] FileTypeInfos
        {
            get { return null; }
        }

        public void Initialize(IHost host)
        {
            Plugin.host = host;
        }
        
        public string Name
        {
            get { return CoreApp.ApplicationName; }
        }
        
        public string Version
        {
            get { return Assembly.GetExecutingAssembly().GetName().Version.ToString(); }
        }
        
        public string Vendor
        {
            get { return "HiperScan GmbH"; }
        }
        
        public Assembly Assembly
        {
            get { return Assembly.GetExecutingAssembly(); }
        }

        public string Description
        {
            get { return Catalog.GetString("Checks external references."); }
        }
        
        public Guid Guid
        {
            get { return new Guid("d601edc3-000b-42d8-b80e-4d3387517fab"); }
        }
        
        public bool Active
        {
            get { return this.active;  }
            set { this.active = value; }
        }

        public bool CanReplaceGui
        {
            get { return false; }
        }
    }
}
