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

use crate::{Annotation, Rectangle};
use glib::{prelude::*, translate::*};

glib::wrapper! {
    #[doc(alias = "PpsDocumentAnnotations")]
    pub struct DocumentAnnotations(Interface<ffi::PpsDocumentAnnotations, ffi::PpsDocumentAnnotationsInterface>);

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

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

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

pub trait DocumentAnnotationsExt: IsA<DocumentAnnotations> + sealed::Sealed + 'static {
    #[doc(alias = "pps_document_annotations_add_annotation")]
    fn add_annotation(&self, annot: &impl IsA<Annotation>, rect: &mut Rectangle) {
        unsafe {
            ffi::pps_document_annotations_add_annotation(
                self.as_ref().to_glib_none().0,
                annot.as_ref().to_glib_none().0,
                rect.to_glib_none_mut().0,
            );
        }
    }

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

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

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

    //#[doc(alias = "pps_document_annotations_get_annotations")]
    //#[doc(alias = "get_annotations")]
    //fn annotations(&self, page: &impl IsA<Page>) -> /*Ignored*/Option<MappingList> {
    //    unsafe { TODO: call ffi:pps_document_annotations_get_annotations() }
    //}

    //#[doc(alias = "pps_document_annotations_over_markup")]
    //fn over_markup(&self, annot: &impl IsA<Annotation>, x: f64, y: f64) -> /*Ignored*/AnnotationsOverMarkup {
    //    unsafe { TODO: call ffi:pps_document_annotations_over_markup() }
    //}

    #[doc(alias = "pps_document_annotations_remove_annotation")]
    fn remove_annotation(&self, annot: &impl IsA<Annotation>) {
        unsafe {
            ffi::pps_document_annotations_remove_annotation(
                self.as_ref().to_glib_none().0,
                annot.as_ref().to_glib_none().0,
            );
        }
    }

    //#[doc(alias = "pps_document_annotations_save_annotation")]
    //fn save_annotation(&self, annot: &impl IsA<Annotation>, mask: /*Ignored*/AnnotationsSaveMask) {
    //    unsafe { TODO: call ffi:pps_document_annotations_save_annotation() }
    //}
}

impl<O: IsA<DocumentAnnotations>> DocumentAnnotationsExt for O {}
