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

An encapsulation of a fill item. More...

#include <XLStyles.hpp>

Public Member Functions

 XLFill ()
 
 XLFill (const XMLNode &node)
 Constructor. New items should only be created through an XLStyles object.
 
 XLFill (const XLFill &other)
 Copy Constructor.
 
 XLFill (XLFill &&other) noexcept=default
 Move Constructor.
 
 ~XLFill ()
 
XLFilloperator= (const XLFill &other)
 Copy assignment operator.
 
XLFilloperator= (XLFill &&other) noexcept=default
 Move assignment operator.
 
XLFillType fillType () const
 Get the name of the element describing a fill.
 
bool setFillType (XLFillType newFillType, bool force=false)
 Create & set the base XML element describing the fill.
 
XLGradientType gradientType ()
 Getter functions for gradientFill - will throwOnFillType(XLPatternFill, func)
 
double degree ()
 
double left ()
 
double right ()
 
double top ()
 
double bottom ()
 
XLGradientStops stops ()
 
XLPatternType patternType ()
 Getter functions for patternFill - will throwOnFillType(XLGradientFill, func)
 
XLColor color ()
 
XLColor backgroundColor ()
 
bool setGradientType (XLGradientType newType)
 Setter functions for gradientFill - will throwOnFillType(XLPatternFill, func)
 
bool setDegree (double newDegree)
 
bool setLeft (double newLeft)
 
bool setRight (double newRight)
 
bool setTop (double newTop)
 
bool setBottom (double newBottom)
 
XLFillsetPatternType (XLPatternType newPatternType)
 Setter functions for patternFill - will throwOnFillType(XLGradientFill, func)
 
XLFillsetColor (XLColor newColor)
 
XLFillsetBackgroundColor (XLColor newBgColor)
 
std::string summary ()
 Return a string summary of the fill properties.
 

Friends

class XLFills
 

Detailed Description

An encapsulation of a fill item.

Constructor & Destructor Documentation

◆ XLFill() [1/4]

XLFill::XLFill ( )

◆ XLFill() [2/4]

XLFill::XLFill ( const XMLNode node)
explicit

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

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

◆ XLFill() [3/4]

XLFill::XLFill ( const XLFill other)

Copy Constructor.

Parameters
otherObject to be copied.

◆ XLFill() [4/4]

OpenXLSX::XLFill::XLFill ( XLFill &&  other)
defaultnoexcept

Move Constructor.

Parameters
otherObject to be moved.

◆ ~XLFill()

XLFill::~XLFill ( )
default

Member Function Documentation

◆ backgroundColor()

XLColor XLFill::backgroundColor ( )

◆ bottom()

double XLFill::bottom ( )

◆ color()

XLColor XLFill::color ( )

◆ degree()

double XLFill::degree ( )

◆ fillType()

XLFillType XLFill::fillType ( ) const

Get the name of the element describing a fill.

Returns
The XLFillType derived from the name of the first child element of the fill node

Returns the name of the first element child of fill

Note
an empty node ::name() returns an empty string "", leading to XLFillTypeInvalid

◆ gradientType()

XLGradientType XLFill::gradientType ( )

Getter functions for gradientFill - will throwOnFillType(XLPatternFill, func)

Returns
The requested gradientFill property

◆ left()

double XLFill::left ( )

◆ operator=() [1/2]

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

Copy assignment operator.

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

◆ operator=() [2/2]

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

Move assignment operator.

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

◆ patternType()

XLPatternType XLFill::patternType ( )

Getter functions for patternFill - will throwOnFillType(XLGradientFill, func)

Returns
The requested patternFill property

◆ right()

double XLFill::right ( )

◆ setBackgroundColor()

XLFill & XLFill::setBackgroundColor ( XLColor  newBgColor)

◆ setBottom()

bool XLFill::setBottom ( double  newBottom)

◆ setColor()

XLFill & XLFill::setColor ( XLColor  newColor)

◆ setDegree()

bool XLFill::setDegree ( double  newDegree)

◆ setFillType()

bool XLFill::setFillType ( XLFillType  newFillType,
bool  force = false 
)

Create & set the base XML element describing the fill.

Parameters
newFillTypethat shall be set
forceerase an existing fillType() if not equal newFillType
Returns
true for success, false for failure

◆ setGradientType()

bool XLFill::setGradientType ( XLGradientType  newType)

Setter functions for gradientFill - will throwOnFillType(XLPatternFill, func)

Parameters
valuethat shall be set
Returns
true for success, false for failure
Note
for gradient stops, use the stops() getter with the XLGradientStops access functions (create, stopByIndex, []) and the XLGradientStop setter functions

◆ setLeft()

bool XLFill::setLeft ( double  newLeft)

◆ setPatternType()

XLFill & XLFill::setPatternType ( XLPatternType  newPatternType)

Setter functions for patternFill - will throwOnFillType(XLGradientFill, func)

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

◆ setRight()

bool XLFill::setRight ( double  newRight)

◆ setTop()

bool XLFill::setTop ( double  newTop)

◆ stops()

XLGradientStops XLFill::stops ( )

◆ summary()

std::string XLFill::summary ( )

Return a string summary of the fill properties.

Returns
string with info about the fill object

◆ top()

double XLFill::top ( )

Friends And Related Symbol Documentation

◆ XLFills

friend class XLFills
friend

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