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

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

glib::wrapper! {
    #[doc(alias = "PpsDocumentAttachments")]
    pub struct DocumentAttachments(Interface<ffi::PpsDocumentAttachments, ffi::PpsDocumentAttachmentsInterface>);

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

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

pub trait DocumentAttachmentsExt: IsA<DocumentAttachments> + 'static {
    #[doc(alias = "pps_document_attachments_get_attachments")]
    #[doc(alias = "get_attachments")]
    fn attachments(&self) -> Vec<Attachment> {
        unsafe {
            FromGlibPtrContainer::from_glib_full(ffi::pps_document_attachments_get_attachments(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "pps_document_attachments_has_attachments")]
    fn has_attachments(&self) -> bool {
        unsafe {
            from_glib(ffi::pps_document_attachments_has_attachments(
                self.as_ref().to_glib_none().0,
            ))
        }
    }
}

impl<O: IsA<DocumentAttachments>> DocumentAttachmentsExt for O {}
