You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
86 lines
3.1 KiB
86 lines
3.1 KiB
12 years ago
|
/****************************************************************************
|
||
|
** 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 XLSXWORKSHEET_H
|
||
|
#define XLSXWORKSHEET_H
|
||
|
|
||
12 years ago
|
#include "xlsxglobal.h"
|
||
12 years ago
|
#include <QObject>
|
||
|
#include <QStringList>
|
||
|
#include <QMap>
|
||
|
#include <QVariant>
|
||
|
class QIODevice;
|
||
12 years ago
|
class QDateTime;
|
||
12 years ago
|
|
||
|
namespace QXlsx {
|
||
|
class Package;
|
||
|
class Workbook;
|
||
|
class XmlStreamWriter;
|
||
|
class Format;
|
||
|
|
||
12 years ago
|
class WorksheetPrivate;
|
||
12 years ago
|
class Q_XLSX_EXPORT Worksheet : public QObject
|
||
12 years ago
|
{
|
||
|
Q_OBJECT
|
||
12 years ago
|
Q_DECLARE_PRIVATE(Worksheet)
|
||
12 years ago
|
public:
|
||
12 years ago
|
int write(const QString row_column, const QVariant &value, Format *format=0);
|
||
|
int write(int row, int column, const QVariant &value, Format *format=0);
|
||
|
int writeString(int row, int column, const QString &value, Format *format=0);
|
||
|
int writeNumber(int row, int column, double value, Format *format=0);
|
||
|
int writeFormula(int row, int column, const QString &formula, Format *format=0, double result=0);
|
||
|
int writeBlank(int row, int column, Format *format=0);
|
||
|
int writeBool(int row, int column, bool value, Format *format=0);
|
||
12 years ago
|
int writeDateTime(int row, int column, const QDateTime& dt, Format *format=0);
|
||
12 years ago
|
|
||
12 years ago
|
bool setRow(int row, double height, Format* format=0, bool hidden=false);
|
||
|
bool setColumn(int colFirst, int colLast, double width, Format* format=0, bool hidden=false);
|
||
|
|
||
12 years ago
|
void setRightToLeft(bool enable);
|
||
|
void setZeroValuesHidden(bool enable);
|
||
|
|
||
|
private:
|
||
|
friend class Package;
|
||
|
friend class Workbook;
|
||
12 years ago
|
Worksheet(const QString &sheetName, int sheetIndex, Workbook *parent=0);
|
||
|
~Worksheet();
|
||
|
|
||
12 years ago
|
virtual bool isChartsheet() const;
|
||
|
QString name() const;
|
||
|
int index() const;
|
||
|
bool isHidden() const;
|
||
|
bool isSelected() const;
|
||
|
bool isActived() const;
|
||
|
void setHidden(bool hidden);
|
||
|
void setSelected(bool select);
|
||
|
void setActived(bool act);
|
||
|
void saveToXmlFile(QIODevice *device);
|
||
|
|
||
12 years ago
|
WorksheetPrivate * const d_ptr;
|
||
12 years ago
|
};
|
||
|
|
||
|
} //QXlsx
|
||
|
|
||
|
#endif // XLSXWORKSHEET_H
|