// This file was generated by gir (https://github.com/gtk-rs/gir)
// from ../ev-girs
// from ../gir-files
// DO NOT EDIT

use crate::{ffi, Job};
use glib::{prelude::*, translate::*};

glib::wrapper! {
    #[doc(alias = "PpsJobAnnots")]
    pub struct JobAnnots(Object<ffi::PpsJobAnnots, ffi::PpsJobAnnotsClass>) @extends Job;

    match fn {
        type_ => || ffi::pps_job_annots_get_type(),
    }
}

impl JobAnnots {
    pub const NONE: Option<&'static JobAnnots> = None;

    #[doc(alias = "pps_job_annots_new")]
    pub fn new(document: &impl IsA<papers_document::Document>) -> JobAnnots {
        assert_initialized_main_thread!();
        unsafe {
            Job::from_glib_full(ffi::pps_job_annots_new(document.as_ref().to_glib_none().0))
                .unsafe_cast()
        }
    }
}

mod sealed {
    pub trait Sealed {}
    impl<T: super::IsA<super::JobAnnots>> Sealed for T {}
}

pub trait JobAnnotsExt: IsA<JobAnnots> + sealed::Sealed + 'static {
    #[doc(alias = "pps_job_annots_get_annots")]
    #[doc(alias = "get_annots")]
    fn annots(&self) -> Vec<papers_document::MappingList> {
        unsafe {
            FromGlibPtrContainer::from_glib_none(ffi::pps_job_annots_get_annots(
                self.as_ref().to_glib_none().0,
            ))
        }
    }
}

impl<O: IsA<JobAnnots>> JobAnnotsExt for O {}
