pangomm: 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
 
PangoTabArray* gobj ()
 Provides access to the underlying C instance. More...

 
const PangoTabArray* gobj () const
 Provides access to the underlying C instance. More...

 
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. More...

 
 TabArray (int initial_size, bool positions_in_pixels=true)
 
int get_size () const
 Gets the number of tab stops in tab_array. More...

 
void resize (int new_size)
 Resizes a tab array. More...

 
void set_tab (int tab_index, TabAlign alignment, int location)
 Sets the alignment and location of a tab stop. More...

 
std::pair< TabAlign, int > get_tab (int tab_index) const
 Gets the alignment and position of a tab stop. More...

 
std::vector< std::pair< TabAlign, int > > get_tabs () const
 Gets an array of std::pairs containing the tab stop alignments and tab positions. More...

 
bool get_positions_in_pixels () const
 Returns true if the tab positions are in pixels, false if they are in Pango units. More...

 

Static Public Member Functions

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

 

Protected Attributes

PangoTabArray* gobject_
 

Related Functions

(Note that these are not member functions.)

void swap (TabArray& lhs, TabArray& rhs) noexcept
 
Pango::TabArray wrap (PangoTabArray* object, bool take_copy=false)
 A Glib::wrap() method for this object. More...

 

Detailed Description

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

Each tab stop has an alignment and a position.

Constructor & Destructor Documentation

Pango::TabArray::TabArray ( )
Pango::TabArray::TabArray ( PangoTabArray *  gobject,
bool  make_a_copy = true 
)
explicit
Pango::TabArray::TabArray ( const TabArray other)
Pango::TabArray::TabArray ( TabArray&&  other)
noexcept
Pango::TabArray::~TabArray ( )
noexcept
Pango::TabArray::TabArray ( int  initial_size,
bool  positions_in_pixels = true 
)
explicit

Member Function Documentation

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.
int Pango::TabArray::get_size ( ) const

Gets the number of tab stops in tab_array.

Returns
The number of tab stops in the array.
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.
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.
static GType Pango::TabArray::get_type ( )
static

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

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

Provides access to the underlying C instance.

const PangoTabArray* Pango::TabArray::gobj ( ) const
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.

TabArray& Pango::TabArray::operator= ( const TabArray other)
TabArray& Pango::TabArray::operator= ( TabArray&&  other)
noexcept
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.
void Pango::TabArray::set_tab ( int  tab_index,
TabAlign  alignment,
int  location 
)

Sets the alignment and location of a tab stop.

alignment must always be Pango::TabAlign::LEFT in the current implementation.

Parameters
tab_indexThe index of a tab stop.
alignmentTab alignment.
locationTab location in Pango units.
void Pango::TabArray::swap ( TabArray other)
noexcept

Friends And Related Function Documentation

void swap ( TabArray lhs,
TabArray rhs 
)
related
Parameters
lhsThe left-hand side
rhsThe right-hand side
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

PangoTabArray* Pango::TabArray::gobject_
protected