pangomm 2.56.2
|
A Pango::TabArray contains an array of tab stops. More...
#include <pangomm/tabarray.h>
Public Member Functions | |
TabArray () | |
TabArray (PangoTabArray *gobject, bool make_a_copy=true) | |
TabArray (const TabArray &other) | |
TabArray & | operator= (const TabArray &other) |
TabArray (TabArray &&other) noexcept | |
TabArray & | operator= (TabArray &&other) noexcept |
~TabArray () noexcept | |
void | swap (TabArray &other) noexcept |
PangoTabArray * | gobj () |
Provides access to the underlying C instance. | |
const PangoTabArray * | gobj () const |
Provides access to the underlying C instance. | |
PangoTabArray * | gobj_copy () const |
Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs. | |
TabArray (int initial_size, bool positions_in_pixels=true) | |
TabArray (const Glib::ustring &text) | |
Deserializes a Pango::TabArray from a string. | |
operator bool () const | |
Checks whether this TabArray is valid. | |
int | get_size () const |
Gets the number of tab stops in tab_array. | |
void | resize (int new_size) |
Resizes a tab array. | |
void | set_tab (int tab_index, TabAlign alignment, int location) |
Sets the alignment and location of a tab stop. | |
std::pair< TabAlign, int > | get_tab (int tab_index) const |
Gets the alignment and position of a tab stop. | |
std::vector< std::pair< TabAlign, int > > | get_tabs () const |
Gets an array of std::pairs containing the tab stop alignments and tab positions. | |
bool | get_positions_in_pixels () const |
Returns true if the tab positions are in pixels, false if they are in Pango units. | |
void | set_positions_in_pixels (bool positions_in_pixels=true) |
Sets whether positions in this array are specified in pixels. | |
Glib::ustring | to_string () const |
Serializes a Pango::TabArray to a string. | |
void | set_decimal_point (int tab_index, gunichar decimal_point) |
Sets the Unicode character to use as decimal point. | |
gunichar | get_decimal_point (int tab_index) const |
Gets the Unicode character to use as decimal point. | |
void | sort () |
Utility function to ensure that the tab stops are in increasing order. | |
Static Public Member Functions | |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. | |
Protected Attributes | |
PangoTabArray * | gobject_ |
Related Symbols | |
(Note that these are not member symbols.) | |
void | swap (TabArray &lhs, TabArray &rhs) noexcept |
Pango::TabArray | wrap (PangoTabArray *object, bool take_copy=false) |
A Glib::wrap() method for this object. | |
A Pango::TabArray contains an array of tab stops.
Each tab stop has an alignment and a position.
Pango::TabArray::TabArray | ( | ) |
|
explicit |
|
noexcept |
|
noexcept |
|
explicit |
Deserializes a Pango::TabArray from a string.
This is the counterpart to to_string(). See that function for details about the format.
text | A string. |
Gets the Unicode character to use as decimal point.
This is only relevant for tabs with Pango::TabAlign::DECIMAL alignment, which align content at the first occurrence of the decimal point character.
The default value of 0 means that Pango will use the decimal point according to the current locale.
tab_index | The index of a tab stop. |
bool Pango::TabArray::get_positions_in_pixels | ( | ) | const |
Returns true
if the tab positions are in pixels, false
if they are in Pango units.
int Pango::TabArray::get_size | ( | ) | const |
Gets the number of tab stops in tab_array.
Gets the alignment and position of a tab stop.
std::vector< std::pair< TabAlign, int > > Pango::TabArray::get_tabs | ( | ) | const |
Gets an array of std::pairs containing the tab stop alignments and tab positions.
Get the GType for this class, for use with the underlying GObject type system.
|
inline |
Provides access to the underlying C instance.
|
inline |
Provides access to the underlying C instance.
PangoTabArray * Pango::TabArray::gobj_copy | ( | ) | const |
Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.
|
explicit |
Resizes a tab array.
You must subsequently initialize any tabs that were added as a result of growing the array.
new_size | New size of the array. |
Sets the Unicode character to use as decimal point.
This is only relevant for tabs with Pango::TabAlign::DECIMAL alignment, which align content at the first occurrence of the decimal point character.
By default, Pango uses the decimal point according to the current locale.
tab_index | The index of a tab stop. |
decimal_point | The decimal point to use. |
Sets whether positions in this array are specified in pixels.
positions_in_pixels | Whether positions are in pixels. |
Sets the alignment and location of a tab stop.
tab_index | The index of a tab stop. |
alignment | Tab alignment. |
location | Tab location in Pango units. |
void Pango::TabArray::sort | ( | ) |
Utility function to ensure that the tab stops are in increasing order.
Glib::ustring Pango::TabArray::to_string | ( | ) | const |
Serializes a Pango::TabArray
to a string.
In the resulting string, serialized tabs are separated by newlines or commas.
Individual tabs are serialized to a string of the form
[ALIGNMENT:]POSITION[:DECIMAL_POINT]
Where ALIGNMENT is one of left, right, center or decimal, and POSITION is the position of the tab, optionally followed by the unit px. If ALIGNMENT is omitted, it defaults to left. If ALIGNMENT is decimal, the DECIMAL_POINT character may be specified as a Unicode codepoint.
Note that all tabs in the array must use the same unit.
A typical example:
100px 200px center:300px right:400px
lhs | The left-hand side |
rhs | The right-hand side |
|
related |
A Glib::wrap() method for this object.
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |
|
protected |