sourceview5 0.5.0

Rust bindings for GtkSourceView 5
// 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 glib::object::IsA;
#[cfg(any(feature = "v5_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v5_6")))]
use glib::translate::*;
use std::fmt;

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;
}

pub trait CompletionProposalExt: 'static {
    #[cfg(any(feature = "v5_6", feature = "dox"))]
    #[cfg_attr(feature = "dox", 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>;
}

impl<O: IsA<CompletionProposal>> CompletionProposalExt for O {
    #[cfg(any(feature = "v5_6", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v5_6")))]
    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 fmt::Display for CompletionProposal {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        f.write_str("CompletionProposal")
    }
}