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

use crate::ffi;
use glib::prelude::*;
#[cfg(feature = "v5_6")]
#[cfg_attr(docsrs, doc(cfg(feature = "v5_6")))]
use glib::translate::*;

glib::wrapper! {
    #[doc(alias = "GtkSourceCompletionProposal")]
    pub struct CompletionProposal(Interface<ffi::GtkSourceCompletionProposal, ffi::GtkSourceCompletionProposalInterface>);

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

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

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

pub trait CompletionProposalExt: IsA<CompletionProposal> + sealed::Sealed + 'static {
    #[cfg(feature = "v5_6")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v5_6")))]
    #[doc(alias = "gtk_source_completion_proposal_get_typed_text")]
    #[doc(alias = "get_typed_text")]
    fn typed_text(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_full(ffi::gtk_source_completion_proposal_get_typed_text(
                self.as_ref().to_glib_none().0,
            ))
        }
    }
}

impl<O: IsA<CompletionProposal>> CompletionProposalExt for O {}
