// This file was generated by gir (https://github.com/gtk-rs/gir)
// from ../gir-files
// from ../pps-girs
// 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()
        }
    }
}

pub trait JobAnnotsExt: IsA<JobAnnots> + 'static {
    #[doc(alias = "pps_job_annots_get_annots")]
    #[doc(alias = "get_annots")]
    fn annots(&self) -> Vec<papers_document::Annotation> {
        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 {}
