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

#[cfg(feature = "v23_8")]
#[cfg_attr(docsrs, doc(cfg(feature = "v23_8")))]
use crate::CertificateInfo;
use crate::{CertificateStatus, SignatureStatus, ffi};
use glib::translate::*;

glib::wrapper! {
    #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
    pub struct SignatureInfo(Boxed<ffi::PopplerSignatureInfo>);

    match fn {
        copy => |ptr| ffi::poppler_signature_info_copy(ptr),
        free => |ptr| ffi::poppler_signature_info_free(ptr),
        type_ => || ffi::poppler_signature_info_get_type(),
    }
}

impl SignatureInfo {
    #[cfg(feature = "v23_8")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v23_8")))]
    #[doc(alias = "poppler_signature_info_get_certificate_info")]
    #[doc(alias = "get_certificate_info")]
    pub fn certificate_info(&self) -> Option<CertificateInfo> {
        unsafe {
            from_glib_none(ffi::poppler_signature_info_get_certificate_info(
                self.to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "poppler_signature_info_get_certificate_status")]
    #[doc(alias = "get_certificate_status")]
    pub fn certificate_status(&self) -> CertificateStatus {
        unsafe {
            from_glib(ffi::poppler_signature_info_get_certificate_status(
                self.to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "poppler_signature_info_get_local_signing_time")]
    #[doc(alias = "get_local_signing_time")]
    pub fn local_signing_time(&self) -> Option<glib::DateTime> {
        unsafe {
            from_glib_none(ffi::poppler_signature_info_get_local_signing_time(
                self.to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "poppler_signature_info_get_signature_status")]
    #[doc(alias = "get_signature_status")]
    pub fn signature_status(&self) -> SignatureStatus {
        unsafe {
            from_glib(ffi::poppler_signature_info_get_signature_status(
                self.to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "poppler_signature_info_get_signer_name")]
    #[doc(alias = "get_signer_name")]
    pub fn signer_name(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::poppler_signature_info_get_signer_name(
                self.to_glib_none().0,
            ))
        }
    }
}
