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

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

glib::wrapper! {
    #[doc(alias = "PpsSearchResult")]
    pub struct SearchResult(Object<ffi::PpsSearchResult, ffi::PpsSearchResultClass>);

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

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

    //#[doc(alias = "pps_search_result_new")]
    //pub fn new(markup: &str, label: &str, page: u32, index: u32, global_index: u32, rect: /*Ignored*/&mut papers_document::FindRectangle) -> SearchResult {
    //    unsafe { TODO: call ffi:pps_search_result_new() }
    //}
}

pub trait SearchResultExt: IsA<SearchResult> + 'static {
    //#[doc(alias = "pps_search_result_append_rectangle")]
    //fn append_rectangle(&self, rect: /*Ignored*/&mut papers_document::FindRectangle) {
    //    unsafe { TODO: call ffi:pps_search_result_append_rectangle() }
    //}

    #[cfg(feature = "v48")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v48")))]
    #[doc(alias = "pps_search_result_get_global_index")]
    #[doc(alias = "get_global_index")]
    fn global_index(&self) -> u32 {
        unsafe { ffi::pps_search_result_get_global_index(self.as_ref().to_glib_none().0) }
    }

    #[doc(alias = "pps_search_result_get_index")]
    #[doc(alias = "get_index")]
    fn index(&self) -> u32 {
        unsafe { ffi::pps_search_result_get_index(self.as_ref().to_glib_none().0) }
    }

    #[doc(alias = "pps_search_result_get_label")]
    #[doc(alias = "get_label")]
    fn label(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::pps_search_result_get_label(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "pps_search_result_get_markup")]
    #[doc(alias = "get_markup")]
    fn markup(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::pps_search_result_get_markup(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "pps_search_result_get_page")]
    #[doc(alias = "get_page")]
    fn page(&self) -> u32 {
        unsafe { ffi::pps_search_result_get_page(self.as_ref().to_glib_none().0) }
    }

    //#[doc(alias = "pps_search_result_get_rectangle_list")]
    //#[doc(alias = "get_rectangle_list")]
    //fn rectangle_list(&self) -> /*Ignored*/Vec<papers_document::FindRectangle> {
    //    unsafe { TODO: call ffi:pps_search_result_get_rectangle_list() }
    //}
}

impl<O: IsA<SearchResult>> SearchResultExt for O {}
