// Created with MonoDevelop
//
//    QuickStep: Acquire, view and identify spectra 
//    Copyright (C) 2022, 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;
namespace Hiperscan.Extensions.ApoIdent.Widgets
{
    public abstract class ApoIdentButtonTemplate
    {
        protected abstract void SetImage();

        public bool Visible
        {
            set
            {
                this.Widget.Visible = value;
            }
        }

        private bool sensitive = true;
        public bool Sensitive
        {
            get
            {
                return this.sensitive;
            }

            set
            {
                if (value == this.sensitive)
                    return;

                this.Widget.Sensitive = value;
                this.sensitive = value;
                this.SetImage();
            }
        }

        private Gdk.Pixbuf active_image = null;
        public Gdk.Pixbuf ActiveImage
        {
            protected get
            {
                return this.active_image;
            }

            set
            {
                if (this.active_image == value)
                    return;

                this.active_image = value;
                this.SetImage();
            }
        }

        private Gdk.Pixbuf inactive_image = null;
        public Gdk.Pixbuf InactiveImage
        {
            protected get
            {
                return this.inactive_image;
            }

            set
            {
                if (this.inactive_image == value)
                    return;

                this.inactive_image = value;
                this.SetImage();
            }
        }

        protected abstract Gtk.Bin Widget { get; }
    }
}
