gtksourceviewmm  3.21.3
Public Member Functions | Static Public Member Functions | Related Functions | List of all members
Gsv::Language Class Reference

Object representing a syntax highlighted language. More...

#include <gtksourceviewmm/language.h>

Inheritance diagram for Gsv::Language:
Inheritance graph
[legend]

Public Member Functions

 Language (Language&& src) noexcept
 
Languageoperator= (Language&& src) noexcept
 
 ~Language () noexceptoverride
 
GtkSourceLanguage* gobj ()
 Provides access to the underlying C GObject. More...
 
const GtkSourceLanguage* gobj () const
 Provides access to the underlying C GObject. More...
 
GtkSourceLanguage* gobj_copy ()
 Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
 
Glib::ustring get_id () const
 Returns the ID of a language. More...
 
Glib::ustring get_name () const
 Returns the localized name of the language. More...
 
Glib::ustring get_section () const
 Returns the localized section of the language. More...
 
bool get_hidden () const
 Returns whether the language should be hidden from the user. More...
 
std::vector< Glib::ustringget_mime_types () const
 Returns the mime types associated to this language. More...
 
std::vector< Glib::ustringget_globs () const
 Returns the globs associated to this language. More...
 
std::vector< Glib::ustringget_style_ids () const
 Returns the ids of the styles defined by this language. More...
 
Glib::ustring get_style_name (const Glib::ustring& style_id) const
 Returns the name of the style with ID style_id defined by this language. More...
 
Glib::ustring get_style_fallback (const Glib::ustring& style_id) const
 Returns the ID of the style to use if the specified style_id is not present in the current style scheme. More...
 
Glib::ustring get_metadata (const Glib::ustring& name) const
 Returns metadata of a language. More...
 
Glib::PropertyProxy_ReadOnly< std::stringproperty_id () const
 Language id. More...
 
Glib::PropertyProxy_ReadOnly< std::stringproperty_name () const
 Language name. More...
 
Glib::PropertyProxy_ReadOnly< std::stringproperty_section () const
 Language section. More...
 
Glib::PropertyProxy_ReadOnly< bool > property_hidden () const
 Whether the language should be hidden from the user. More...
 
- Public Member Functions inherited from Glib::Object
 Object (const Object &)=delete
 
Objectoperator= (const Object &)=delete
 
 Object (Object &&src) noexcept
 
Objectoperator= (Object &&src) noexcept
 
void * get_data (const QueryQuark &key)
 
void set_data (const Quark &key, void *data)
 
void set_data (const Quark &key, void *data, DestroyNotify notify)
 
void remove_data (const QueryQuark &quark)
 
void * steal_data (const QueryQuark &quark)
 
Glib::RefPtr< Glib::Objectwrap (GObject *object, bool take_copy=false)
 
- Public Member Functions inherited from Glib::ObjectBase
 ObjectBase (const ObjectBase &)=delete
 
ObjectBaseoperator= (const ObjectBase &)=delete
 
void set_property_value (const Glib::ustring &property_name, const Glib::ValueBase &value)
 
void get_property_value (const Glib::ustring &property_name, Glib::ValueBase &value) const
 
void set_property (const Glib::ustring &property_name, const PropertyType &value)
 
void get_property (const Glib::ustring &property_name, PropertyType &value) const
 
void connect_property_changed (const Glib::ustring &property_name, const sigc::slot< void > &slot)
 
void connect_property_changed (const Glib::ustring &property_name, sigc::slot< void > &&slot)
 
sigc::connection connect_property_changed_with_return (const Glib::ustring &property_name, const sigc::slot< void > &slot)
 
sigc::connection connect_property_changed_with_return (const Glib::ustring &property_name, sigc::slot< void > &&slot)
 
void freeze_notify ()
 
void thaw_notify ()
 
virtual void reference () const
 
virtual void unreference () const
 
GObject * gobj ()
 
const GObject * gobj () const
 
GObject * gobj_copy () const
 
- Public Member Functions inherited from sigc::trackable
 trackable () noexcept
 
 trackable (const trackable &src) noexcept
 
 trackable (trackable &&src)
 
 ~trackable ()
 
void add_destroy_notify_callback (void *data, func_destroy_notify func) const
 
void notify_callbacks ()
 
trackableoperator= (const trackable &src)
 
trackableoperator= (trackable &&src)
 
void remove_destroy_notify_callback (void *data) const
 

Static Public Member Functions

static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system. More...
 

Related Functions

(Note that these are not member functions.)

Glib::RefPtr< Gsv::Languagewrap (GtkSourceLanguage* object, bool take_copy=false)
 A Glib::wrap() method for this object. More...
 

Additional Inherited Members

- Public Types inherited from Glib::Object
typedef void(*)(gpointer data DestroyNotify)
 
- Public Types inherited from sigc::trackable
typedef internal::func_destroy_notify func_destroy_notify
 
- Protected Member Functions inherited from Glib::Object
 Object ()
 
 Object (const Glib::ConstructParams &construct_params)
 
 Object (GObject *castitem)
 
 ~Object () noexceptoverride
 
- Protected Member Functions inherited from Glib::ObjectBase
 ObjectBase ()
 
 ObjectBase (const char *custom_type_name)
 
 ObjectBase (const std::type_info &custom_type_info)
 
 ObjectBase (ObjectBase &&src) noexcept
 
ObjectBaseoperator= (ObjectBase &&src) noexcept
 
virtual ~ObjectBase () noexcept=0
 
void initialize (GObject *castitem)
 
void initialize_move (GObject *castitem, Glib::ObjectBase *previous_wrapper)
 

Detailed Description

Object representing a syntax highlighted language.

Language encapsulates syntax and highlighting styles for a particular language. Use LanguageManager to obtain a Language instance, and Buffer::set_language() to apply it to a Buffer.

Constructor & Destructor Documentation

Gsv::Language::Language ( Language&&  src)
noexcept
Gsv::Language::~Language ( )
overridenoexcept

Member Function Documentation

std::vector<Glib::ustring> Gsv::Language::get_globs ( ) const

Returns the globs associated to this language.

This is just a utility wrapper around get_metadata() to retrieve the "globs" metadata property and split it into an array.

Returns
An array containing the globs.
bool Gsv::Language::get_hidden ( ) const

Returns whether the language should be hidden from the user.

Returns
true if the language should be hidden, false otherwise.
Glib::ustring Gsv::Language::get_id ( ) const

Returns the ID of a language.

The ID is not locale-dependent.

Returns
The ID of a language.
Glib::ustring Gsv::Language::get_metadata ( const Glib::ustring name) const

Returns metadata of a language.

Parameters
nameMetadata property name.
Returns
Value of property name stored in the metadata of language or empty string if language doesn't contain that metadata property.
std::vector<Glib::ustring> Gsv::Language::get_mime_types ( ) const

Returns the mime types associated to this language.

This is just a utility wrapper around get_metadata() to retrieve the "mimetypes" metadata property and split it into an array.

Returns
An array containing the mime types.
Glib::ustring Gsv::Language::get_name ( ) const

Returns the localized name of the language.

Returns
The name of a language.
Glib::ustring Gsv::Language::get_section ( ) const

Returns the localized section of the language.

Each language belong to a section (ex. HTML belogs to the Markup section).

Returns
The section of a language.
Glib::ustring Gsv::Language::get_style_fallback ( const Glib::ustring style_id) const

Returns the ID of the style to use if the specified style_id is not present in the current style scheme.

Parameters
style_ida style ID.
Returns
the ID of the style to use if the specified style_id is not present in the current style scheme or NULL if the style has no fallback defined. The returned string is owned by the language and must not be modified. {3,4}
std::vector<Glib::ustring> Gsv::Language::get_style_ids ( ) const

Returns the ids of the styles defined by this language.

Returns
An array containing ids of the styles defined by this language.
Glib::ustring Gsv::Language::get_style_name ( const Glib::ustring style_id) const

Returns the name of the style with ID style_id defined by this language.

Parameters
style_idA style ID.
Returns
The name of the style with ID style_id defined by this language or empty string if the style has no name or there is no style with ID style_id defined by this language.
static GType Gsv::Language::get_type ( )
static

Get the GType for this class, for use with the underlying GObject type system.

GtkSourceLanguage* Gsv::Language::gobj ( )
inline

Provides access to the underlying C GObject.

const GtkSourceLanguage* Gsv::Language::gobj ( ) const
inline

Provides access to the underlying C GObject.

GtkSourceLanguage* Gsv::Language::gobj_copy ( )

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

Language& Gsv::Language::operator= ( Language&&  src)
noexcept
Glib::PropertyProxy_ReadOnly< bool > Gsv::Language::property_hidden ( ) const

Whether the language should be hidden from the user.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< std::string > Gsv::Language::property_id ( ) const

Language id.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< std::string > Gsv::Language::property_name ( ) const

Language name.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< std::string > Gsv::Language::property_section ( ) const

Language section.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

Friends And Related Function Documentation

Glib::RefPtr< Gsv::Language > wrap ( GtkSourceLanguage *  object,
bool  take_copy = false 
)
related

A Glib::wrap() method for this object.

Parameters
objectThe C instance.
take_copyFalse if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns
A C++ instance that wraps this C instance.