pangomm 2.54.0
Public Member Functions | Static Public Member Functions | Protected Attributes | Related Symbols | List of all members
Pango::TabArray Class Reference

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)
 
TabArrayoperator= (const TabArray &other)
 
 TabArray (TabArray &&other) noexcept
 
TabArrayoperator= (TabArray &&other) noexcept
 
 ~TabArray () noexcept
 
void swap (TabArray &other) noexcept
 
PangoTabArraygobj ()
 Provides access to the underlying C instance.
 
const PangoTabArraygobj () const
 Provides access to the underlying C instance.
 
PangoTabArraygobj_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, intget_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

PangoTabArraygobject_
 

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.
 

Detailed Description

A Pango::TabArray contains an array of tab stops.

Each tab stop has an alignment and a position.

Constructor & Destructor Documentation

◆ TabArray() [1/6]

Pango::TabArray::TabArray ( )

◆ TabArray() [2/6]

Pango::TabArray::TabArray ( PangoTabArray gobject,
bool  make_a_copy = true 
)
explicit

◆ TabArray() [3/6]

Pango::TabArray::TabArray ( const TabArray other)

◆ TabArray() [4/6]

Pango::TabArray::TabArray ( TabArray &&  other)
noexcept

◆ ~TabArray()

Pango::TabArray::~TabArray ( )
noexcept

◆ TabArray() [5/6]

Pango::TabArray::TabArray ( int  initial_size,
bool  positions_in_pixels = true 
)
explicit

◆ TabArray() [6/6]

Pango::TabArray::TabArray ( const Glib::ustring &  text)
explicit

Deserializes a Pango::TabArray from a string.

This is the counterpart to to_string(). See that function for details about the format.

Since pangomm 2.54:
Parameters
textA string.
Returns
A new Pango::TabArray.

Member Function Documentation

◆ get_decimal_point()

gunichar Pango::TabArray::get_decimal_point ( int  tab_index) const

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.

Since pangomm 2.54:
Parameters
tab_indexThe index of a tab stop.

◆ get_positions_in_pixels()

bool Pango::TabArray::get_positions_in_pixels ( ) const

Returns true if the tab positions are in pixels, false if they are in Pango units.

Returns
Whether positions are in pixels.

◆ get_size()

int Pango::TabArray::get_size ( ) const

Gets the number of tab stops in tab_array.

Returns
The number of tab stops in the array.

◆ get_tab()

std::pair< TabAlign, int > Pango::TabArray::get_tab ( int  tab_index) const

Gets the alignment and position of a tab stop.

Returns
An std::pair<TabAlign, int>. The first element represents the tab stop alignment, the second one is the tab position.

◆ get_tabs()

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.

Returns
An array of std::pair<TabAlign, int>. The first element in each pair represents the tab stop alignment, the second one is the tab position.

◆ get_type()

static GType Pango::TabArray::get_type ( )
static

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

◆ gobj() [1/2]

PangoTabArray * Pango::TabArray::gobj ( )
inline

Provides access to the underlying C instance.

◆ gobj() [2/2]

const PangoTabArray * Pango::TabArray::gobj ( ) const
inline

Provides access to the underlying C instance.

◆ gobj_copy()

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.

◆ operator bool()

Pango::TabArray::operator bool ( ) const
explicit

Checks whether this TabArray is valid.

Since pangomm 2.54:
Returns
true if the TabArray is valid.

◆ operator=() [1/2]

TabArray & Pango::TabArray::operator= ( const TabArray other)

◆ operator=() [2/2]

TabArray & Pango::TabArray::operator= ( TabArray &&  other)
noexcept

◆ resize()

void Pango::TabArray::resize ( int  new_size)

Resizes a tab array.

You must subsequently initialize any tabs that were added as a result of growing the array.

Parameters
new_sizeNew size of the array.

◆ set_decimal_point()

void Pango::TabArray::set_decimal_point ( int  tab_index,
gunichar  decimal_point 
)

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.

Since pangomm 2.54:
Parameters
tab_indexThe index of a tab stop.
decimal_pointThe decimal point to use.

◆ set_positions_in_pixels()

void Pango::TabArray::set_positions_in_pixels ( bool  positions_in_pixels = true)

Sets whether positions in this array are specified in pixels.

Since pangomm 2.54:
Parameters
positions_in_pixelsWhether positions are in pixels.

◆ set_tab()

void Pango::TabArray::set_tab ( int  tab_index,
TabAlign  alignment,
int  location 
)

Sets the alignment and location of a tab stop.

Parameters
tab_indexThe index of a tab stop.
alignmentTab alignment.
locationTab location in Pango units.

◆ sort()

void Pango::TabArray::sort ( )

Utility function to ensure that the tab stops are in increasing order.

Since pangomm 2.54:

◆ swap()

void Pango::TabArray::swap ( TabArray other)
noexcept

◆ to_string()

Glib::ustring Pango::TabArray::to_string ( ) const

Serializes a Pango::TabArray to a string.

No guarantees are made about the format of the string, it may change between Pango versions.

The intended use of this function is testing and debugging. The format is not meant as a permanent storage format.

Since pangomm 2.54:
Returns
A newly allocated string.

Friends And Related Symbol Documentation

◆ swap()

void swap ( TabArray lhs,
TabArray rhs 
)
related
Parameters
lhsThe left-hand side
rhsThe right-hand side

◆ wrap()

Pango::TabArray wrap ( PangoTabArray 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.

Member Data Documentation

◆ gobject_

PangoTabArray* Pango::TabArray::gobject_
protected