// 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

use crate::{FontType, ffi};
use glib::translate::*;

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

    match fn {
        copy => |ptr| ffi::poppler_fonts_iter_copy(mut_override(ptr)),
        free => |ptr| ffi::poppler_fonts_iter_free(ptr),
        type_ => || ffi::poppler_fonts_iter_get_type(),
    }
}

impl FontsIter {
    #[doc(alias = "poppler_fonts_iter_get_encoding")]
    #[doc(alias = "get_encoding")]
    pub fn encoding(&mut self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::poppler_fonts_iter_get_encoding(
                self.to_glib_none_mut().0,
            ))
        }
    }

    #[doc(alias = "poppler_fonts_iter_get_file_name")]
    #[doc(alias = "get_file_name")]
    pub fn file_name(&mut self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::poppler_fonts_iter_get_file_name(
                self.to_glib_none_mut().0,
            ))
        }
    }

    #[doc(alias = "poppler_fonts_iter_get_font_type")]
    #[doc(alias = "get_font_type")]
    pub fn font_type(&mut self) -> FontType {
        unsafe {
            from_glib(ffi::poppler_fonts_iter_get_font_type(
                self.to_glib_none_mut().0,
            ))
        }
    }

    #[doc(alias = "poppler_fonts_iter_get_full_name")]
    #[doc(alias = "get_full_name")]
    pub fn full_name(&mut self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::poppler_fonts_iter_get_full_name(
                self.to_glib_none_mut().0,
            ))
        }
    }

    #[doc(alias = "poppler_fonts_iter_get_name")]
    #[doc(alias = "get_name")]
    pub fn name(&mut self) -> Option<glib::GString> {
        unsafe { from_glib_none(ffi::poppler_fonts_iter_get_name(self.to_glib_none_mut().0)) }
    }

    #[doc(alias = "poppler_fonts_iter_get_substitute_name")]
    #[doc(alias = "get_substitute_name")]
    pub fn substitute_name(&mut self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::poppler_fonts_iter_get_substitute_name(
                self.to_glib_none_mut().0,
            ))
        }
    }

    #[doc(alias = "poppler_fonts_iter_is_embedded")]
    pub fn is_embedded(&mut self) -> bool {
        unsafe {
            from_glib(ffi::poppler_fonts_iter_is_embedded(
                self.to_glib_none_mut().0,
            ))
        }
    }

    #[doc(alias = "poppler_fonts_iter_is_subset")]
    pub fn is_subset(&mut self) -> bool {
        unsafe { from_glib(ffi::poppler_fonts_iter_is_subset(self.to_glib_none_mut().0)) }
    }

    #[doc(alias = "poppler_fonts_iter_next")]
    pub fn next(&mut self) -> bool {
        unsafe { from_glib(ffi::poppler_fonts_iter_next(self.to_glib_none_mut().0)) }
    }
}
