Update documentation

This commit is contained in:
Debao Zhang
2013-11-23 15:44:06 +08:00
parent e1d93af4b7
commit 81316ecf6e
7 changed files with 468 additions and 54 deletions
+91 -5
View File
@@ -64,6 +64,7 @@ DataValidationPrivate::~DataValidationPrivate()
* \class DataValidation
* \brief Data validation for single cell or a range
* \inmodule QtXlsx
*
* The data validation can be applied to a single cell or a range of cells.
*/
@@ -110,7 +111,8 @@ DataValidationPrivate::~DataValidationPrivate()
*/
/*!
* Construct a data validation object
* Construct a data validation object with the given \a type, \a op, \a formula1
* \a formula2, and \a allowBlank.
*/
DataValidation::DataValidation(ValidationType type, ValidationOperator op, const QString &formula1, const QString &formula2, bool allowBlank)
:d(new DataValidationPrivate(type, op, formula1, formula2, allowBlank))
@@ -128,7 +130,7 @@ DataValidation::DataValidation()
}
/*!
\internal
Constructs a copy of \a other.
*/
DataValidation::DataValidation(const DataValidation &other)
:d(other.d)
@@ -136,6 +138,16 @@ DataValidation::DataValidation(const DataValidation &other)
}
/*!
Assigns \a other to this validation and returns a reference to this validation.
*/
DataValidation &DataValidation::operator=(const DataValidation &other)
{
this->d = other.d;
return *this;
}
/*!
* Destroy the object.
*/
@@ -143,86 +155,137 @@ DataValidation::~DataValidation()
{
}
/*!
Returns the validation type.
*/
DataValidation::ValidationType DataValidation::validationType() const
{
return d->validationType;
}
/*!
Returns the validation operator.
*/
DataValidation::ValidationOperator DataValidation::validationOperator() const
{
return d->validationOperator;
}
/*!
Returns the validation error style.
*/
DataValidation::ErrorStyle DataValidation::errorStyle() const
{
return d->errorStyle;
}
/*!
Returns the formula1.
*/
QString DataValidation::formula1() const
{
return d->formula1;
}
/*!
Returns the formula2.
*/
QString DataValidation::formula2() const
{
return d->formula2;
}
/*!
Returns whether blank is allowed.
*/
bool DataValidation::allowBlank() const
{
return d->allowBlank;
}
/*!
Returns the error message.
*/
QString DataValidation::errorMessage() const
{
return d->errorMessage;
}
/*!
Returns the error message title.
*/
QString DataValidation::errorMessageTitle() const
{
return d->errorMessageTitle;
}
/*!
Returns the prompt message.
*/
QString DataValidation::promptMessage() const
{
return d->promptMessage;
}
/*!
Returns the prompt message title.
*/
QString DataValidation::promptMessageTitle() const
{
return d->promptMessageTitle;
}
/*!
Returns the whether prompt message is shown.
*/
bool DataValidation::isPromptMessageVisible() const
{
return d->isPromptMessageVisible;
}
/*!
Returns the whether error message is shown.
*/
bool DataValidation::isErrorMessageVisible() const
{
return d->isErrorMessageVisible;
}
/*!
Returns the ranges on which the validation will be applied.
*/
QList<CellRange> DataValidation::ranges() const
{
return d->ranges;
}
/*!
Sets the validation type to \a type.
*/
void DataValidation::setValidationType(DataValidation::ValidationType type)
{
d->validationType = type;
}
/*!
Sets the validation operator to \a op.
*/
void DataValidation::setValidationOperator(DataValidation::ValidationOperator op)
{
d->validationOperator = op;
}
/*!
Sets the error style to \a es.
*/
void DataValidation::setErrorStyle(DataValidation::ErrorStyle es)
{
d->errorStyle = es;
}
/*!
Sets the formula1 to \a formula.
*/
void DataValidation::setFormula1(const QString &formula)
{
if (formula.startsWith(QLatin1Char('=')))
@@ -231,42 +294,61 @@ void DataValidation::setFormula1(const QString &formula)
d->formula1 = formula;
}
/*!
Sets the formulas to \a formula.
*/
void DataValidation::setFormula2(const QString &formula)
{
if (formula.startsWith(QLatin1Char('=')))
d->formula2 = formula.mid(1);
else
d->formula2 = formula;}
d->formula2 = formula;
}
/*!
Sets the error message to \a error with title \a title.
*/
void DataValidation::setErrorMessage(const QString &error, const QString &title)
{
d->errorMessage = error;
d->errorMessageTitle = title;
}
/*!
Sets the prompt message to \a prompt with title \a title.
*/
void DataValidation::setPromptMessage(const QString &prompt, const QString &title)
{
d->promptMessage = prompt;
d->promptMessageTitle = title;
}
/*!
Enable/disabe blank allow based on \a enable.
*/
void DataValidation::setAllowBlank(bool enable)
{
d->allowBlank = enable;
}
/*!
Enable/disabe prompt message visible based on \a visible.
*/
void DataValidation::setPromptMessageVisible(bool visible)
{
d->isPromptMessageVisible = visible;
}
/*!
Enable/disabe error message visible based on \a visible.
*/
void DataValidation::setErrorMessageVisible(bool visible)
{
d->isErrorMessageVisible = visible;
}
/*!
Add the \a cell which the DataValidation will apply to.
Add the \a cell on which the DataValidation will apply to.
*/
void DataValidation::addCell(const QString &cell)
{
@@ -275,6 +357,7 @@ void DataValidation::addCell(const QString &cell)
/*!
\overload
Add the cell(\a row, \a col) on which the DataValidation will apply to.
*/
void DataValidation::addCell(int row, int col)
{
@@ -282,7 +365,7 @@ void DataValidation::addCell(int row, int col)
}
/*!
Add the \a range which the DataValidation will apply to.
Add the \a range on which the DataValidation will apply to.
*/
void DataValidation::addRange(const QString &range)
{
@@ -291,6 +374,8 @@ void DataValidation::addRange(const QString &range)
/*!
\overload
Add the range(\a firstRow, \a firstCol, \a lastRow, \a lastCol) on
which the DataValidation will apply to.
*/
void DataValidation::addRange(int firstRow, int firstCol, int lastRow, int lastCol)
{
@@ -299,6 +384,7 @@ void DataValidation::addRange(int firstRow, int firstCol, int lastRow, int lastC
/*!
\overload
Add the \a range on which the DataValidation will apply to.
*/
void DataValidation::addRange(const CellRange &range)
{