mod imp;

use glib::Object;
use gtk::{
    gio,
    glib::{self, subclass::types::ObjectSubclassIsExt},
    Label, Switch,
};

glib::wrapper! {
    pub struct LabledSwitch(ObjectSubclass<imp::LabledSwitch>)
        @extends gtk::Widget,
        @implements gio::ActionGroup, gio::ActionMap, gtk::Accessible, gtk::Buildable,
                    gtk::ConstraintTarget, gtk::Native, gtk::Root, gtk::ShortcutManager;
}

impl LabledSwitch {
    pub fn new(label: &String) -> Self {
        Object::builder()
            .property("label", label)
            .property("active", false)
            .build()
    }

    pub fn get_switch(&self) -> &Switch {
        self.imp().switch_obj.as_ref()
    }
    pub fn get_label(&self) -> &Label {
        self.imp().label_obj.as_ref()
    }
}
