OpenXLSX 1.9.1
Loading...
Searching...
No Matches
OpenXLSX::XLAlignment Class Reference

An encapsulation of an alignment item. More...

#include <XLStyles.hpp>

Public Member Functions

 XLAlignment ()
 
 XLAlignment (const XMLNode &node)
 Constructor. New items should only be created through an XLBorder object.
 
 XLAlignment (const XLAlignment &other)
 Copy Constructor.
 
 XLAlignment (XLAlignment &&other) noexcept=default
 Move Constructor.
 
 ~XLAlignment ()
 
XLAlignmentoperator= (const XLAlignment &other)
 Copy assignment operator.
 
XLAlignmentoperator= (XLAlignment &&other) noexcept=default
 Move assignment operator.
 
XLAlignmentStyle horizontal () const
 Get the horizontal alignment.
 
XLAlignmentStyle vertical () const
 Get the vertical alignment.
 
uint16_t textRotation () const
 Get text rotation.
 
bool wrapText () const
 Check whether text wrapping is enabled.
 
uint32_t indent () const
 Get the indent setting.
 
int32_t relativeIndent () const
 Get the relative indent setting.
 
bool justifyLastLine () const
 Check whether justification of last line is enabled.
 
bool shrinkToFit () const
 Check whether shrink to fit is enabled.
 
uint32_t readingOrder () const
 Get the reading order setting.
 
bool setHorizontal (XLAlignmentStyle newStyle)
 Setter functions for style parameters.
 
bool setVertical (XLAlignmentStyle newStyle)
 
bool setTextRotation (uint16_t newRotation)
 
bool setWrapText (bool set=true)
 
bool setIndent (uint32_t newIndent)
 
bool setRelativeIndent (int32_t newIndent)
 
bool setJustifyLastLine (bool set=true)
 
bool setShrinkToFit (bool set=true)
 
bool setReadingOrder (uint32_t newReadingOrder)
 
std::string summary () const
 Return a string summary of the alignment properties.
 

Detailed Description

An encapsulation of an alignment item.

Constructor & Destructor Documentation

◆ XLAlignment() [1/4]

XLAlignment::XLAlignment ( )

◆ XLAlignment() [2/4]

XLAlignment::XLAlignment ( const XMLNode node)
explicit

Constructor. New items should only be created through an XLBorder object.

Parameters
nodeAn XMLNode object with the alignment XMLNode. If no input is provided, a null node is used.

◆ XLAlignment() [3/4]

XLAlignment::XLAlignment ( const XLAlignment other)

Copy Constructor.

Parameters
otherObject to be copied.

◆ XLAlignment() [4/4]

OpenXLSX::XLAlignment::XLAlignment ( XLAlignment &&  other)
defaultnoexcept

Move Constructor.

Parameters
otherObject to be moved.

◆ ~XLAlignment()

XLAlignment::~XLAlignment ( )
default

Member Function Documentation

◆ horizontal()

XLAlignmentStyle XLAlignment::horizontal ( ) const

Get the horizontal alignment.

Returns
An XLAlignmentStyle

◆ indent()

uint32_t XLAlignment::indent ( ) const

Get the indent setting.

Returns
An integer value, where an increment of 1 represents 3 spaces.

◆ justifyLastLine()

bool XLAlignment::justifyLastLine ( ) const

Check whether justification of last line is enabled.

Returns
true if enabled, false otherwise

◆ operator=() [1/2]

XLAlignment & XLAlignment::operator= ( const XLAlignment other)

Copy assignment operator.

Parameters
otherRight hand side of assignment operation.
Returns
A reference to the lhs object.

◆ operator=() [2/2]

XLAlignment & OpenXLSX::XLAlignment::operator= ( XLAlignment &&  other)
defaultnoexcept

Move assignment operator.

Parameters
otherRight hand side of assignment operation.
Returns
A reference to lhs object.

◆ readingOrder()

uint32_t XLAlignment::readingOrder ( ) const

Get the reading order setting.

Returns
An integer value: 0 - Context Dependent, 1 - Left-to-Right, 2 - Right-to-Left (any other value should be invalid)

◆ relativeIndent()

int32_t XLAlignment::relativeIndent ( ) const

Get the relative indent setting.

Returns
An integer value, where an increment of 1 represents 1 space, in addition to indent()*3 spaces
Note
can be negative

◆ setHorizontal()

bool XLAlignment::setHorizontal ( XLAlignmentStyle  newStyle)

Setter functions for style parameters.

Parameters
valuethat shall be set
Returns
true for success, false for failure

◆ setIndent()

bool XLAlignment::setIndent ( uint32_t  newIndent)

◆ setJustifyLastLine()

bool XLAlignment::setJustifyLastLine ( bool  set = true)

◆ setReadingOrder()

bool XLAlignment::setReadingOrder ( uint32_t  newReadingOrder)

◆ setRelativeIndent()

bool XLAlignment::setRelativeIndent ( int32_t  newIndent)

◆ setShrinkToFit()

bool XLAlignment::setShrinkToFit ( bool  set = true)

◆ setTextRotation()

bool XLAlignment::setTextRotation ( uint16_t  newRotation)

on setTextRotation from XLSX specification: Text rotation in cells. Expressed in degrees. Values range from 0 to 180. The first letter of the text is considered the center-point of the arc. For 0 - 90, the value represents degrees above horizon. For 91-180 the degrees below the horizon is calculated as: [degrees below horizon] = 90 - [newRotation]. Examples: setTextRotation( 45): / (text is formatted along a line from lower left to upper right) setTextRotation(135): \ (text is formatted along a line from upper left to lower right)

◆ setVertical()

bool XLAlignment::setVertical ( XLAlignmentStyle  newStyle)

◆ setWrapText()

bool XLAlignment::setWrapText ( bool  set = true)

◆ shrinkToFit()

bool XLAlignment::shrinkToFit ( ) const

Check whether shrink to fit is enabled.

Returns
true if enabled, false otherwise

◆ summary()

std::string XLAlignment::summary ( ) const

Return a string summary of the alignment properties.

Returns
string with info about the alignment object

◆ textRotation()

uint16_t XLAlignment::textRotation ( ) const

Get text rotation.

Returns
A value indicating rotation: 0 to 90 is counter-clockwise, 90 to 180 is 90 degrees offset clockwise (e.g. 180 = 90 deg clockwise), 255 is vertical text.

◆ vertical()

XLAlignmentStyle XLAlignment::vertical ( ) const

Get the vertical alignment.

Returns
An XLAlignmentStyle

◆ wrapText()

bool XLAlignment::wrapText ( ) const

Check whether text wrapping is enabled.

Returns
true if enabled, false otherwise

The documentation for this class was generated from the following files: