16 changed files with 947 additions and 4 deletions
@ -0,0 +1,9 @@ |
|||
TARGET = datavalidation |
|||
|
|||
#include(../../../src/xlsx/qtxlsx.pri) |
|||
QT+=xlsx |
|||
|
|||
CONFIG += console |
|||
CONFIG -= app_bundle |
|||
|
|||
SOURCES += main.cpp |
@ -0,0 +1,22 @@ |
|||
#include <QtCore> |
|||
#include "xlsxdocument.h" |
|||
#include "xlsxdatavalidation.h" |
|||
|
|||
QTXLSX_USE_NAMESPACE |
|||
|
|||
int main() |
|||
{ |
|||
Document xlsx; |
|||
xlsx.write("A1", "A2 and A3:E5 only accept the number between 33 and 99"); |
|||
|
|||
//![1]
|
|||
DataValidation validation(DataValidation::Whole, DataValidation::Between, "33", "99"); |
|||
validation.addRange("A2"); |
|||
validation.addRange("A3:E5"); |
|||
validation.setPromptMessage("Please Input Integer between 33 and 99"); |
|||
xlsx.addDataValidation(validation); |
|||
//![1]
|
|||
|
|||
xlsx.save(); |
|||
return 0; |
|||
} |
@ -0,0 +1,119 @@ |
|||
/****************************************************************************
|
|||
** Copyright (c) 2013 Debao Zhang <hello@debao.me> |
|||
** All right reserved. |
|||
** |
|||
** Permission is hereby granted, free of charge, to any person obtaining |
|||
** a copy of this software and associated documentation files (the |
|||
** "Software"), to deal in the Software without restriction, including |
|||
** without limitation the rights to use, copy, modify, merge, publish, |
|||
** distribute, sublicense, and/or sell copies of the Software, and to |
|||
** permit persons to whom the Software is furnished to do so, subject to |
|||
** the following conditions: |
|||
** |
|||
** The above copyright notice and this permission notice shall be |
|||
** included in all copies or substantial portions of the Software. |
|||
** |
|||
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
|||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
|||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|||
** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
|||
** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
|||
** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
|||
** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|||
** |
|||
****************************************************************************/ |
|||
#include "xlsxcellrange.h" |
|||
#include "xlsxutility_p.h" |
|||
#include <QString> |
|||
#include <QPoint> |
|||
#include <QStringList> |
|||
QT_BEGIN_NAMESPACE_XLSX |
|||
/*!
|
|||
\class CellRange |
|||
|
|||
\brief The CellRange class provides a way to |
|||
|
|||
\inmodule QtXlsx |
|||
|
|||
The CellRange class stores the top left and bottom |
|||
right rows and columns of a range in a worksheet. |
|||
*/ |
|||
|
|||
/*!
|
|||
Constructs an range, i.e. a range |
|||
whose rowCount() and columnCount() are 0. |
|||
*/ |
|||
CellRange::CellRange() |
|||
: top(-1), left(-1), bottom(-2), right(-2) |
|||
{ |
|||
} |
|||
|
|||
/*!
|
|||
Constructs the range from the given \a top, \a |
|||
left, \a bottom and \a right rows and columns. |
|||
|
|||
\sa topRow(), leftColumn(), bottomRow(), rightColumn() |
|||
*/ |
|||
CellRange::CellRange(int top, int left, int bottom, int right) |
|||
: top(top), left(left), bottom(bottom), right(right) |
|||
{ |
|||
} |
|||
|
|||
/*!
|
|||
\overload |
|||
Constructs the range form the given \a range string. |
|||
*/ |
|||
CellRange::CellRange(const QString &range) |
|||
{ |
|||
QStringList rs = range.split(QLatin1Char(':')); |
|||
if (rs.size() == 2) { |
|||
QPoint start = xl_cell_to_rowcol(rs[0]); |
|||
QPoint end = xl_cell_to_rowcol(rs[1]); |
|||
top = start.x(); |
|||
left = start.y(); |
|||
bottom = end.x(); |
|||
right = end.y(); |
|||
} else { |
|||
QPoint p = xl_cell_to_rowcol(rs[0]); |
|||
top = p.x(); |
|||
left = p.y(); |
|||
bottom = p.x(); |
|||
right = p.y(); |
|||
} |
|||
} |
|||
|
|||
/*!
|
|||
Constructs a the range by copying the given \a |
|||
other range. |
|||
*/ |
|||
CellRange::CellRange(const CellRange &other) |
|||
: top(other.top), left(other.left), bottom(other.bottom), right(other.right) |
|||
{ |
|||
} |
|||
|
|||
/*!
|
|||
Destroys the range. |
|||
*/ |
|||
CellRange::~CellRange() |
|||
{ |
|||
} |
|||
|
|||
/*!
|
|||
Convert the range to string notation, such as "A1:B5". |
|||
*/ |
|||
QString CellRange::toString() const |
|||
{ |
|||
if (left == -1 || top == -1) |
|||
return QString(); |
|||
|
|||
if (left == right && top == bottom) { |
|||
//Single cell
|
|||
return xl_rowcol_to_cell(top, left); |
|||
} |
|||
|
|||
QString cell_1 = xl_rowcol_to_cell(top, left); |
|||
QString cell_2 = xl_rowcol_to_cell(bottom, right); |
|||
return cell_1 + QLatin1String(":") + cell_2; |
|||
} |
|||
|
|||
QT_END_NAMESPACE_XLSX |
@ -0,0 +1,54 @@ |
|||
/****************************************************************************
|
|||
** Copyright (c) 2013 Debao Zhang <hello@debao.me> |
|||
** All right reserved. |
|||
** |
|||
** Permission is hereby granted, free of charge, to any person obtaining |
|||
** a copy of this software and associated documentation files (the |
|||
** "Software"), to deal in the Software without restriction, including |
|||
** without limitation the rights to use, copy, modify, merge, publish, |
|||
** distribute, sublicense, and/or sell copies of the Software, and to |
|||
** permit persons to whom the Software is furnished to do so, subject to |
|||
** the following conditions: |
|||
** |
|||
** The above copyright notice and this permission notice shall be |
|||
** included in all copies or substantial portions of the Software. |
|||
** |
|||
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
|||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
|||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|||
** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
|||
** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
|||
** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
|||
** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|||
** |
|||
****************************************************************************/ |
|||
#ifndef QXLSX_XLSXCELLRANGE_H |
|||
#define QXLSX_XLSXCELLRANGE_H |
|||
#include "xlsxglobal.h" |
|||
|
|||
QT_BEGIN_NAMESPACE_XLSX |
|||
|
|||
class Q_XLSX_EXPORT CellRange |
|||
{ |
|||
public: |
|||
CellRange(); |
|||
CellRange(int firstRow, int firstColumn, int lastRow, int lastColumn); |
|||
CellRange(const QString &range); |
|||
CellRange(const CellRange &other); |
|||
~CellRange(); |
|||
|
|||
QString toString() const; |
|||
inline int firstRow() const { return top; } |
|||
inline int lastRow() const { return bottom; } |
|||
inline int firstColumn() const { return left; } |
|||
inline int lastColumn() const { return right; } |
|||
inline int rowCount() const { return bottom - top + 1; } |
|||
inline int columnCount() const { return right - left + 1; } |
|||
|
|||
private: |
|||
int top, left, bottom, right; |
|||
}; |
|||
|
|||
QT_END_NAMESPACE_XLSX |
|||
|
|||
#endif // QXLSX_XLSXCELLRANGE_H
|
@ -0,0 +1,302 @@ |
|||
/****************************************************************************
|
|||
** Copyright (c) 2013 Debao Zhang <hello@debao.me> |
|||
** All right reserved. |
|||
** |
|||
** Permission is hereby granted, free of charge, to any person obtaining |
|||
** a copy of this software and associated documentation files (the |
|||
** "Software"), to deal in the Software without restriction, including |
|||
** without limitation the rights to use, copy, modify, merge, publish, |
|||
** distribute, sublicense, and/or sell copies of the Software, and to |
|||
** permit persons to whom the Software is furnished to do so, subject to |
|||
** the following conditions: |
|||
** |
|||
** The above copyright notice and this permission notice shall be |
|||
** included in all copies or substantial portions of the Software. |
|||
** |
|||
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
|||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
|||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|||
** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
|||
** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
|||
** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
|||
** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|||
** |
|||
****************************************************************************/ |
|||
|
|||
#include "xlsxdatavalidation.h" |
|||
#include "xlsxdatavalidation_p.h" |
|||
#include "xlsxworksheet.h" |
|||
#include "xlsxcellrange.h" |
|||
|
|||
QT_BEGIN_NAMESPACE_XLSX |
|||
|
|||
DataValidationPrivate::DataValidationPrivate() |
|||
:validationType(DataValidation::None), validationOperator(DataValidation::Between) |
|||
, errorStyle(DataValidation::Stop), allowBlank(false), isPromptMessageVisible(true) |
|||
, isErrorMessageVisible(true) |
|||
{ |
|||
|
|||
} |
|||
|
|||
DataValidationPrivate::DataValidationPrivate(DataValidation::ValidationType type, DataValidation::ValidationOperator op, const QString &formula1, const QString &formula2, bool allowBlank) |
|||
:validationType(type), validationOperator(op) |
|||
, errorStyle(DataValidation::Stop), allowBlank(allowBlank), isPromptMessageVisible(true) |
|||
, isErrorMessageVisible(true), formula1(formula1), formula2(formula2) |
|||
{ |
|||
|
|||
} |
|||
|
|||
DataValidationPrivate::DataValidationPrivate(const DataValidationPrivate &other) |
|||
:QSharedData(other) |
|||
, validationType(DataValidation::None), validationOperator(DataValidation::Between) |
|||
, errorStyle(DataValidation::Stop), allowBlank(false), isPromptMessageVisible(true) |
|||
, isErrorMessageVisible(true) |
|||
{ |
|||
|
|||
} |
|||
|
|||
DataValidationPrivate::~DataValidationPrivate() |
|||
{ |
|||
|
|||
} |
|||
|
|||
/*!
|
|||
* \class DataValidation |
|||
* |
|||
* The data validation can be applied to a single cell or a range of cells. |
|||
*/ |
|||
|
|||
/*!
|
|||
* \enum DataValidation::ValidationType |
|||
* |
|||
* The enum type defines the type of data that you wish to validate. |
|||
* |
|||
* \value None the type of data is unrestricted. This is the same as not applying a data validation. |
|||
* \value Whole restricts the cell to integer values. Means "Whole number"? |
|||
* \value Decimal restricts the cell to decimal values. |
|||
* \value List restricts the cell to a set of user specified values. |
|||
* \value Date restricts the cell to date values. |
|||
* \value Time restricts the cell to time values. |
|||
* \value TextLength restricts the cell data based on an integer string length. |
|||
* \value Custom restricts the cell based on an external Excel formula that returns a true/false value. |
|||
*/ |
|||
|
|||
/*!
|
|||
* \enum DataValidation::ValidationOperator |
|||
* |
|||
* The enum type defines the criteria by which the data in the |
|||
* cell is validated |
|||
* |
|||
* \value Between |
|||
* \value NotBetween |
|||
* \value Equal |
|||
* \value NotEqual |
|||
* \value LessThan |
|||
* \value LessThanOrEqual |
|||
* \value GreaterThan |
|||
* \value GreaterThanOrEqual |
|||
*/ |
|||
|
|||
/*!
|
|||
* \enum DataValidation::ErrorStyle |
|||
* |
|||
* The enum type defines the type of error dialog that |
|||
* is displayed. |
|||
* |
|||
* \value Error |
|||
* \value Warning |
|||
* \value Information |
|||
*/ |
|||
|
|||
/*!
|
|||
* Construct a data validation object |
|||
*/ |
|||
DataValidation::DataValidation(ValidationType type, ValidationOperator op, const QString &formula1, const QString &formula2, bool allowBlank) |
|||
:d(new DataValidationPrivate(type, op, formula1, formula2, allowBlank)) |
|||
{ |
|||
|
|||
} |
|||
|
|||
/*!
|
|||
Construct a data validation object |
|||
*/ |
|||
DataValidation::DataValidation() |
|||
:d(new DataValidationPrivate()) |
|||
{ |
|||
|
|||
} |
|||
|
|||
/*!
|
|||
\internal |
|||
*/ |
|||
DataValidation::DataValidation(const DataValidation &other) |
|||
:d(other.d) |
|||
{ |
|||
|
|||
} |
|||
|
|||
/*!
|
|||
* Destroy the object. |
|||
*/ |
|||
DataValidation::~DataValidation() |
|||
{ |
|||
} |
|||
|
|||
DataValidation::ValidationType DataValidation::validationType() const |
|||
{ |
|||
return d->validationType; |
|||
} |
|||
|
|||
DataValidation::ValidationOperator DataValidation::validationOperator() const |
|||
{ |
|||
return d->validationOperator; |
|||
} |
|||
|
|||
DataValidation::ErrorStyle DataValidation::errorStyle() const |
|||
{ |
|||
return d->errorStyle; |
|||
} |
|||
|
|||
QString DataValidation::formula1() const |
|||
{ |
|||
return d->formula1; |
|||
} |
|||
|
|||
QString DataValidation::formula2() const |
|||
{ |
|||
return d->formula2; |
|||
} |
|||
|
|||
bool DataValidation::allowBlank() const |
|||
{ |
|||
return d->allowBlank; |
|||
} |
|||
|
|||
QString DataValidation::errorMessage() const |
|||
{ |
|||
return d->errorMessage; |
|||
} |
|||
|
|||
QString DataValidation::errorMessageTitle() const |
|||
{ |
|||
return d->errorMessageTitle; |
|||
} |
|||
|
|||
QString DataValidation::promptMessage() const |
|||
{ |
|||
return d->promptMessage; |
|||
} |
|||
|
|||
QString DataValidation::promptMessageTitle() const |
|||
{ |
|||
return d->promptMessageTitle; |
|||
} |
|||
|
|||
bool DataValidation::isPromptMessageVisible() const |
|||
{ |
|||
return d->isPromptMessageVisible; |
|||
} |
|||
|
|||
bool DataValidation::isErrorMessageVisible() const |
|||
{ |
|||
return d->isErrorMessageVisible; |
|||
} |
|||
|
|||
QList<CellRange> DataValidation::ranges() const |
|||
{ |
|||
return d->ranges; |
|||
} |
|||
|
|||
void DataValidation::setValidationType(DataValidation::ValidationType type) |
|||
{ |
|||
d->validationType = type; |
|||
} |
|||
|
|||
void DataValidation::setValidationOperator(DataValidation::ValidationOperator op) |
|||
{ |
|||
d->validationOperator = op; |
|||
} |
|||
|
|||
void DataValidation::setErrorStyle(DataValidation::ErrorStyle es) |
|||
{ |
|||
d->errorStyle = es; |
|||
} |
|||
|
|||
void DataValidation::setFormula1(const QString &formula) |
|||
{ |
|||
d->formula1 = formula; |
|||
} |
|||
|
|||
void DataValidation::setFormula2(const QString &formula) |
|||
{ |
|||
d->formula2 = formula; |
|||
} |
|||
|
|||
void DataValidation::setErrorMessage(const QString &error, const QString &title) |
|||
{ |
|||
d->errorMessage = error; |
|||
d->errorMessageTitle = title; |
|||
} |
|||
|
|||
void DataValidation::setPromptMessage(const QString &prompt, const QString &title) |
|||
{ |
|||
d->promptMessage = prompt; |
|||
d->promptMessageTitle = title; |
|||
} |
|||
|
|||
void DataValidation::setAllowBlank(bool enable) |
|||
{ |
|||
d->allowBlank = enable; |
|||
} |
|||
|
|||
void DataValidation::setPromptMessageVisible(bool visible) |
|||
{ |
|||
d->isPromptMessageVisible = visible; |
|||
} |
|||
|
|||
void DataValidation::setErrorMessageVisible(bool visible) |
|||
{ |
|||
d->isErrorMessageVisible = visible; |
|||
} |
|||
|
|||
/*!
|
|||
Add the \a cell which the DataValidation will apply to. |
|||
*/ |
|||
void DataValidation::addCell(const QString &cell) |
|||
{ |
|||
d->ranges.append(CellRange(cell)); |
|||
} |
|||
|
|||
/*!
|
|||
\overload |
|||
*/ |
|||
void DataValidation::addCell(int row, int col) |
|||
{ |
|||
d->ranges.append(CellRange(row, col, row, col)); |
|||
} |
|||
|
|||
/*!
|
|||
Add the \a range which the DataValidation will apply to. |
|||
*/ |
|||
void DataValidation::addRange(const QString &range) |
|||
{ |
|||
d->ranges.append(CellRange(range)); |
|||
} |
|||
|
|||
/*!
|
|||
\overload |
|||
*/ |
|||
void DataValidation::addRange(int firstRow, int firstCol, int lastRow, int lastCol) |
|||
{ |
|||
d->ranges.append(CellRange(firstRow, firstCol, lastRow, lastCol)); |
|||
} |
|||
|
|||
/*!
|
|||
\overload |
|||
*/ |
|||
void DataValidation::addRange(const CellRange &range) |
|||
{ |
|||
d->ranges.append(range); |
|||
} |
|||
|
|||
QT_END_NAMESPACE_XLSX |
@ -0,0 +1,118 @@ |
|||
/****************************************************************************
|
|||
** Copyright (c) 2013 Debao Zhang <hello@debao.me> |
|||
** All right reserved. |
|||
** |
|||
** Permission is hereby granted, free of charge, to any person obtaining |
|||
** a copy of this software and associated documentation files (the |
|||
** "Software"), to deal in the Software without restriction, including |
|||
** without limitation the rights to use, copy, modify, merge, publish, |
|||
** distribute, sublicense, and/or sell copies of the Software, and to |
|||
** permit persons to whom the Software is furnished to do so, subject to |
|||
** the following conditions: |
|||
** |
|||
** The above copyright notice and this permission notice shall be |
|||
** included in all copies or substantial portions of the Software. |
|||
** |
|||
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
|||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
|||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|||
** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
|||
** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
|||
** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
|||
** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|||
** |
|||
****************************************************************************/ |
|||
#ifndef QXLSX_XLSXDATAVALIDATION_H |
|||
#define QXLSX_XLSXDATAVALIDATION_H |
|||
|
|||
#include "xlsxglobal.h" |
|||
#include <QSharedDataPointer> |
|||
#include <QString> |
|||
#include <QList> |
|||
|
|||
QT_BEGIN_NAMESPACE_XLSX |
|||
|
|||
class Worksheet; |
|||
class CellRange; |
|||
|
|||
class DataValidationPrivate; |
|||
class Q_XLSX_EXPORT DataValidation |
|||
{ |
|||
public: |
|||
enum ValidationType |
|||
{ |
|||
None, |
|||
Whole, |
|||
Decimal, |
|||
List, |
|||
Date, |
|||
Time, |
|||
TextLength, |
|||
Custom |
|||
}; |
|||
|
|||
enum ValidationOperator |
|||
{ |
|||
Between, |
|||
NotBetween, |
|||
Equal, |
|||
NotEqual, |
|||
LessThan, |
|||
LessThanOrEqual, |
|||
GreaterThan, |
|||
GreaterThanOrEqual |
|||
}; |
|||
|
|||
enum ErrorStyle |
|||
{ |
|||
Stop, |
|||
Warning, |
|||
Information |
|||
}; |
|||
|
|||
DataValidation(); |
|||
DataValidation(ValidationType type, ValidationOperator op=Between, const QString &formula1=QString() |
|||
, const QString &formula2=QString(), bool allowBlank=false); |
|||
DataValidation(const DataValidation &other); |
|||
~DataValidation(); |
|||
|
|||
ValidationType validationType() const; |
|||
ValidationOperator validationOperator() const; |
|||
ErrorStyle errorStyle() const; |
|||
QString formula1() const; |
|||
QString formula2() const; |
|||
bool allowBlank() const; |
|||
QString errorMessage() const; |
|||
QString errorMessageTitle() const; |
|||
QString promptMessage() const; |
|||
QString promptMessageTitle() const; |
|||
bool isPromptMessageVisible() const; |
|||
bool isErrorMessageVisible() const; |
|||
QList<CellRange> ranges() const; |
|||
|
|||
void setValidationType(ValidationType type); |
|||
void setValidationOperator(ValidationOperator op); |
|||
void setErrorStyle(ErrorStyle es); |
|||
void setFormula1(const QString &formula); |
|||
void setFormula2(const QString &formula); |
|||
void setErrorMessage(const QString &error, const QString &title=QString()); |
|||
void setPromptMessage(const QString &prompt, const QString &title=QString()); |
|||
void setAllowBlank(bool enable); |
|||
void setPromptMessageVisible(bool visible); |
|||
void setErrorMessageVisible(bool visible); |
|||
|
|||
void addCell(const QString &cell); |
|||
void addCell(int row, int col); |
|||
void addRange(const QString &range); |
|||
void addRange(int firstRow, int firstCol, int lastRow, int lastCol); |
|||
void addRange(const CellRange &range); |
|||
|
|||
//needed by QSharedDataPointer!!
|
|||
DataValidation &operator=(const DataValidation &other); |
|||
private: |
|||
QSharedDataPointer<DataValidationPrivate> d; |
|||
}; |
|||
|
|||
QT_END_NAMESPACE_XLSX |
|||
|
|||
#endif // QXLSX_XLSXDATAVALIDATION_H
|
@ -0,0 +1,57 @@ |
|||
/****************************************************************************
|
|||
** Copyright (c) 2013 Debao Zhang <hello@debao.me> |
|||
** All right reserved. |
|||
** |
|||
** Permission is hereby granted, free of charge, to any person obtaining |
|||
** a copy of this software and associated documentation files (the |
|||
** "Software"), to deal in the Software without restriction, including |
|||
** without limitation the rights to use, copy, modify, merge, publish, |
|||
** distribute, sublicense, and/or sell copies of the Software, and to |
|||
** permit persons to whom the Software is furnished to do so, subject to |
|||
** the following conditions: |
|||
** |
|||
** The above copyright notice and this permission notice shall be |
|||
** included in all copies or substantial portions of the Software. |
|||
** |
|||
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
|||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
|||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|||
** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
|||
** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
|||
** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
|||
** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|||
** |
|||
****************************************************************************/ |
|||
|
|||
#ifndef XLSXDATAVALIDATION_P_H |
|||
#define XLSXDATAVALIDATION_P_H |
|||
#include "xlsxdatavalidation.h" |
|||
#include <QSharedData> |
|||
|
|||
QT_BEGIN_NAMESPACE_XLSX |
|||
|
|||
class Q_XLSX_EXPORT DataValidationPrivate : public QSharedData |
|||
{ |
|||
public: |
|||
DataValidationPrivate(); |
|||
DataValidationPrivate(DataValidation::ValidationType type, DataValidation::ValidationOperator op, const QString &formula1, const QString &formula2, bool allowBlank); |
|||
DataValidationPrivate(const DataValidationPrivate &other); |
|||
~DataValidationPrivate(); |
|||
|
|||
DataValidation::ValidationType validationType; |
|||
DataValidation::ValidationOperator validationOperator; |
|||
DataValidation::ErrorStyle errorStyle; |
|||
bool allowBlank; |
|||
bool isPromptMessageVisible; |
|||
bool isErrorMessageVisible; |
|||
QString formula1; |
|||
QString formula2; |
|||
QString errorMessage; |
|||
QString errorMessageTitle; |
|||
QString promptMessage; |
|||
QString promptMessageTitle; |
|||
QList<CellRange> ranges; |
|||
}; |
|||
|
|||
QT_END_NAMESPACE_XLSX |
|||
#endif // XLSXDATAVALIDATION_P_H
|
Loading…
Reference in new issue