Trait sourceview4::prelude::LanguageExt
source · pub trait LanguageExt: IsA<Language> + Sealed + 'static {
Show 14 methods
// Provided methods
fn globs(&self) -> Vec<GString> { ... }
fn is_hidden(&self) -> bool { ... }
fn id(&self) -> Option<GString> { ... }
fn metadata(&self, name: &str) -> Option<GString> { ... }
fn mime_types(&self) -> Vec<GString> { ... }
fn name(&self) -> Option<GString> { ... }
fn section(&self) -> Option<GString> { ... }
fn style_fallback(&self, style_id: &str) -> Option<GString> { ... }
fn style_ids(&self) -> Vec<GString> { ... }
fn style_name(&self, style_id: &str) -> Option<GString> { ... }
fn connect_hidden_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId { ... }
fn connect_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { ... }
fn connect_name_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId { ... }
fn connect_section_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId { ... }
}
Expand description
Provided Methods§
sourcefn globs(&self) -> Vec<GString>
fn globs(&self) -> Vec<GString>
Returns the globs associated to this language. This is just
an utility wrapper around metadata()
to
retrieve the “globs” metadata property and split it into an array.
Returns
a newly-allocated None
terminated array containing the globs or None
if no globs are found.
The returned array must be freed with g_strfreev()
.
sourcefn id(&self) -> Option<GString>
fn id(&self) -> Option<GString>
Returns the ID of the language. The ID is not locale-dependent.
The returned string is owned by self
and should not be freed
or modified.
Returns
the ID of self
.
sourcefn mime_types(&self) -> Vec<GString>
fn mime_types(&self) -> Vec<GString>
Returns the mime types associated to this language. This is just
an utility wrapper around metadata()
to
retrieve the “mimetypes” metadata property and split it into an
array.
Returns
a newly-allocated None
terminated array containing the mime types
or None
if no mime types are found.
The returned array must be freed with g_strfreev()
.
sourcefn name(&self) -> Option<GString>
fn name(&self) -> Option<GString>
Returns the localized name of the language.
The returned string is owned by self
and should not be freed
or modified.
Returns
the name of self
.
sourcefn section(&self) -> Option<GString>
fn section(&self) -> Option<GString>
Returns the localized section of the language.
Each language belong to a section (ex. HTML belogs to the
Markup section).
The returned string is owned by self
and should not be freed
or modified.
Returns
the section of self
.
sourcefn style_fallback(&self, style_id: &str) -> Option<GString>
fn style_fallback(&self, style_id: &str) -> Option<GString>
Returns the ID of the style to use if the specified style_id
is not present in the current style scheme.
style_id
a style ID.
Returns
the ID of the style to use if the
specified style_id
is not present in the current style scheme or None
if the style has no fallback defined.
The returned string is owned by the self
and must not be modified.
sourcefn style_name(&self, style_id: &str) -> Option<GString>
fn style_name(&self, style_id: &str) -> Option<GString>
Returns the name of the style with ID style_id
defined by this self
.
style_id
a style ID.
Returns
the name of the style with ID style_id
defined by this self
or None
if the style has no name or there is no
style with ID style_id
defined by this self
.
The returned string is owned by the self
and must not be modified.