mod imp;

use glib::Object;
use gtk::{
    gio, glib::{self, subclass::types::ObjectSubclassIsExt}, prelude::*, Application, Button, Entry, Picture
};

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

impl MemoryCardsNewScene {
    pub fn new(app: &Application) -> Self {
        Object::builder().property("application", app).build()
    }

    pub fn get_file_choose_button(&self) -> &Button {
        self.imp().file_choose_button.as_ref()
    }

    pub fn get_picture_widget(&self) -> &Picture {
        self.imp().picture.as_ref()
    }

    pub fn get_hieroglyph_input(&self) -> String {
        self.imp().heiroglyph_entry.text().to_string()
    }

    pub fn get_hieroglyph_entry(&self) -> &Entry {
        self.imp().heiroglyph_entry.as_ref()
    }

    pub fn get_reading_entry(&self) -> &Entry {
        self.imp().reading_entry.as_ref()
    }

    pub fn get_translation_entry(&self) -> &Entry {
        self.imp().translation_entry.as_ref()
    }

    pub fn get_reading_input(&self) -> String {
        self.imp().reading_entry.text().to_string()
    }

    pub fn get_translation_input(&self) -> String {
        self.imp().translation_entry.text().to_string()
    }

    pub fn get_done_button(&self) -> &Button {
        self.imp().done_button.as_ref()
    }
}
