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

#include <XLDataValidation.hpp>

Public Member Functions

 XLDataValidation ()
 
 XLDataValidation (const XMLNode &node)
 
bool empty () const
 
XLDataValidationrequireList (const std::vector< std::string > &list, bool allowBlank=true)
 Fluent API for setting a dropdown list validation.
 
XLDataValidationrequireList (std::string_view formula, bool allowBlank=true)
 Fluent API for setting a dropdown list validation using a formula or range reference.
 
XLDataValidationsetErrorAlert (std::string_view title, std::string_view message, XLDataValidationErrorStyle style=XLDataValidationErrorStyle::Stop)
 
XLDataValidationsetPromptMessage (std::string_view title, std::string_view message)
 
XLDataValidationConfig config () const
 
void applyConfig (const XLDataValidationConfig &config)
 
std::string sqref () const
 
XLDataValidationType type () const
 
XLDataValidationOperator operator_ () const
 
bool allowBlank () const
 
std::string formula1 () const
 
std::string formula2 () const
 
bool showDropDown () const
 
bool showInputMessage () const
 
bool showErrorMessage () const
 
XLIMEMode imeMode () const
 
std::string promptTitle () const
 
std::string prompt () const
 
std::string errorTitle () const
 
std::string error () const
 
XLDataValidationErrorStyle errorStyle () const
 
void setSqref (std::string_view sqref)
 
void addCell (const XLCellReference &ref)
 
void addCell (const std::string &ref)
 
void addRange (const XLCellReference &topLeft, const XLCellReference &bottomRight)
 
void addRange (const std::string &range)
 
void removeCell (const XLCellReference &ref)
 
void removeCell (const std::string &ref)
 
void removeRange (const XLCellReference &topLeft, const XLCellReference &bottomRight)
 
void removeRange (const std::string &range)
 
void setType (XLDataValidationType type)
 
void setOperator (XLDataValidationOperator op)
 
void setAllowBlank (bool allow)
 
void setFormula1 (std::string_view formula)
 
void setFormula2 (std::string_view formula)
 
void setPrompt (std::string_view title, std::string_view msg)
 
void setError (std::string_view title, std::string_view msg, XLDataValidationErrorStyle style=XLDataValidationErrorStyle::Stop)
 
void setShowDropDown (bool show)
 
void setShowInputMessage (bool show)
 
void setShowErrorMessage (bool show)
 
void setIMEMode (XLIMEMode mode)
 
void setWholeNumberRange (double min, double max)
 
void setDecimalRange (double min, double max)
 
void setDateRange (std::string_view min, std::string_view max)
 
void setTimeRange (std::string_view min, std::string_view max)
 
void setTextLengthRange (int min, int max)
 
void setList (const std::vector< std::string > &items)
 
void setReferenceDropList (std::string_view targetSheet, std::string_view range)
 

Constructor & Destructor Documentation

◆ XLDataValidation() [1/2]

OpenXLSX::XLDataValidation::XLDataValidation ( )
inline

◆ XLDataValidation() [2/2]

OpenXLSX::XLDataValidation::XLDataValidation ( const XMLNode node)
inlineexplicit

Member Function Documentation

◆ addCell() [1/2]

void OpenXLSX::XLDataValidation::addCell ( const std::string &  ref)

◆ addCell() [2/2]

void OpenXLSX::XLDataValidation::addCell ( const XLCellReference ref)

◆ addRange() [1/2]

void OpenXLSX::XLDataValidation::addRange ( const std::string &  range)

◆ addRange() [2/2]

void OpenXLSX::XLDataValidation::addRange ( const XLCellReference topLeft,
const XLCellReference bottomRight 
)

◆ allowBlank()

bool OpenXLSX::XLDataValidation::allowBlank ( ) const

◆ applyConfig()

void OpenXLSX::XLDataValidation::applyConfig ( const XLDataValidationConfig config)

◆ config()

XLDataValidationConfig OpenXLSX::XLDataValidation::config ( ) const

◆ empty()

bool OpenXLSX::XLDataValidation::empty ( ) const
inline

◆ error()

std::string OpenXLSX::XLDataValidation::error ( ) const

◆ errorStyle()

XLDataValidationErrorStyle OpenXLSX::XLDataValidation::errorStyle ( ) const

◆ errorTitle()

std::string OpenXLSX::XLDataValidation::errorTitle ( ) const

◆ formula1()

std::string OpenXLSX::XLDataValidation::formula1 ( ) const

◆ formula2()

std::string OpenXLSX::XLDataValidation::formula2 ( ) const

◆ imeMode()

XLIMEMode OpenXLSX::XLDataValidation::imeMode ( ) const

◆ operator_()

XLDataValidationOperator OpenXLSX::XLDataValidation::operator_ ( ) const

◆ prompt()

std::string OpenXLSX::XLDataValidation::prompt ( ) const

◆ promptTitle()

std::string OpenXLSX::XLDataValidation::promptTitle ( ) const

◆ removeCell() [1/2]

void OpenXLSX::XLDataValidation::removeCell ( const std::string &  ref)

◆ removeCell() [2/2]

void OpenXLSX::XLDataValidation::removeCell ( const XLCellReference ref)

◆ removeRange() [1/2]

void OpenXLSX::XLDataValidation::removeRange ( const std::string &  range)

◆ removeRange() [2/2]

void OpenXLSX::XLDataValidation::removeRange ( const XLCellReference topLeft,
const XLCellReference bottomRight 
)

◆ requireList() [1/2]

XLDataValidation & OpenXLSX::XLDataValidation::requireList ( const std::vector< std::string > &  list,
bool  allowBlank = true 
)

Fluent API for setting a dropdown list validation.

Parameters
listA vector of strings to show in the dropdown.
allowBlankAllows blank cells.
Returns
Reference to self for chaining.

◆ requireList() [2/2]

XLDataValidation & OpenXLSX::XLDataValidation::requireList ( std::string_view  formula,
bool  allowBlank = true 
)

Fluent API for setting a dropdown list validation using a formula or range reference.

Parameters
formulaReference string (e.g. "$A$1:$A$10" or "Config!$B$1:$B$5").
allowBlankAllows blank cells.
Returns
Reference to self for chaining.

◆ setAllowBlank()

void OpenXLSX::XLDataValidation::setAllowBlank ( bool  allow)

◆ setDateRange()

void OpenXLSX::XLDataValidation::setDateRange ( std::string_view  min,
std::string_view  max 
)

◆ setDecimalRange()

void OpenXLSX::XLDataValidation::setDecimalRange ( double  min,
double  max 
)

◆ setError()

void OpenXLSX::XLDataValidation::setError ( std::string_view  title,
std::string_view  msg,
XLDataValidationErrorStyle  style = XLDataValidationErrorStyle::Stop 
)

◆ setErrorAlert()

XLDataValidation & OpenXLSX::XLDataValidation::setErrorAlert ( std::string_view  title,
std::string_view  message,
XLDataValidationErrorStyle  style = XLDataValidationErrorStyle::Stop 
)

◆ setFormula1()

void OpenXLSX::XLDataValidation::setFormula1 ( std::string_view  formula)

◆ setFormula2()

void OpenXLSX::XLDataValidation::setFormula2 ( std::string_view  formula)

◆ setIMEMode()

void OpenXLSX::XLDataValidation::setIMEMode ( XLIMEMode  mode)

◆ setList()

void OpenXLSX::XLDataValidation::setList ( const std::vector< std::string > &  items)

◆ setOperator()

void OpenXLSX::XLDataValidation::setOperator ( XLDataValidationOperator  op)

◆ setPrompt()

void OpenXLSX::XLDataValidation::setPrompt ( std::string_view  title,
std::string_view  msg 
)

◆ setPromptMessage()

XLDataValidation & OpenXLSX::XLDataValidation::setPromptMessage ( std::string_view  title,
std::string_view  message 
)

◆ setReferenceDropList()

void OpenXLSX::XLDataValidation::setReferenceDropList ( std::string_view  targetSheet,
std::string_view  range 
)

◆ setShowDropDown()

void OpenXLSX::XLDataValidation::setShowDropDown ( bool  show)

◆ setShowErrorMessage()

void OpenXLSX::XLDataValidation::setShowErrorMessage ( bool  show)

◆ setShowInputMessage()

void OpenXLSX::XLDataValidation::setShowInputMessage ( bool  show)

◆ setSqref()

void OpenXLSX::XLDataValidation::setSqref ( std::string_view  sqref)

◆ setTextLengthRange()

void OpenXLSX::XLDataValidation::setTextLengthRange ( int  min,
int  max 
)

◆ setTimeRange()

void OpenXLSX::XLDataValidation::setTimeRange ( std::string_view  min,
std::string_view  max 
)

◆ setType()

void OpenXLSX::XLDataValidation::setType ( XLDataValidationType  type)

◆ setWholeNumberRange()

void OpenXLSX::XLDataValidation::setWholeNumberRange ( double  min,
double  max 
)

◆ showDropDown()

bool OpenXLSX::XLDataValidation::showDropDown ( ) const

◆ showErrorMessage()

bool OpenXLSX::XLDataValidation::showErrorMessage ( ) const

◆ showInputMessage()

bool OpenXLSX::XLDataValidation::showInputMessage ( ) const

◆ sqref()

std::string OpenXLSX::XLDataValidation::sqref ( ) const

◆ type()

XLDataValidationType OpenXLSX::XLDataValidation::type ( ) const

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