Loading...
Searching...
No Matches
odsdocwriter.h
Go to the documentation of this file.
/*
libodsstream is a library to read and write ODS documents as streams
Copyright (C) 2013 Olivier Langella <Olivier.Langella@moulon.inra.fr>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <QIODevice>
#include <QString>
#include <QUrl>
#include <quazip.h>
#include "calcwriterinterface.h"
#include "writer/structure/contentxml.h"
#include "writer/structure/settingsxml.h"
class OdsDocWriter : public CalcWriterInterface
{
public:
OdsDocWriter(const QString &filename);
OdsDocWriter(QIODevice *device);
virtual ~OdsDocWriter();
void close() override;
void writeSheet(const QString &sheetName) override;
void writeLine() override;
void writeCell(const char *) override;
void writeCell(const QString &) override;
void writeEmptyCell() override;
void writeCell(std::size_t) override;
void writeCell(int) override;
void writeCell(float) override;
void writeCell(double) override;
void writeCellPercentage(double value) override;
void writeCell(bool) override;
void writeCell(const QDate &) override;
void writeCell(const QDateTime &) override;
void writeCell(const QUrl &, const QString &) override;
OdsTableCellStyleRef
getTableCellStyleRef(const OdsTableCellStyle &style) override;
void setTableCellStyleRef(OdsTableCellStyleRef style_ref) override;
void setCellAnnotation(const QString &annotation) override;
void addColorScale(const OdsColorScale &ods_color_scale) override;
QString getOdsCellCoordinate() override;
void setCurrentOdsTableSettings(const OdsTableSettings &settings) override;
private:
void openDevice(QIODevice *device);
void clearAnnotation();
private:
ContentXml *_p_content;
QuaZip *_p_quaZip;
QIODevice *_p_device = nullptr;
bool _p_device_delete = false;
QString _next_annotation;
SettingsXml _settings_xml;
};
calcwriterinterface.h
CalcWriterInterface
Definition calcwriterinterface.h:49
ContentXml
Definition contentxml.h:35
OdsColorScale
Definition odscolorscale.h:44
OdsDocWriter::_settings_xml
SettingsXml _settings_xml
Definition odsdocwriter.h:73
OdsDocWriter::clearAnnotation
void clearAnnotation()
Definition odsdocwriter.cpp:161
OdsDocWriter::writeSheet
void writeSheet(const QString &sheetName) override
Definition odsdocwriter.cpp:143
OdsDocWriter::_p_quaZip
QuaZip * _p_quaZip
Definition odsdocwriter.h:69
OdsDocWriter::_p_device
QIODevice * _p_device
Definition odsdocwriter.h:70
OdsDocWriter::_p_device_delete
bool _p_device_delete
Definition odsdocwriter.h:71
OdsDocWriter::getOdsCellCoordinate
QString getOdsCellCoordinate() override
get the last written cell coordinate in ODS coordinate format get the coordinate of the last written ...
Definition odsdocwriter.cpp:396
OdsDocWriter::writeEmptyCell
void writeEmptyCell() override
Definition odsdocwriter.cpp:202
OdsDocWriter::writeCellPercentage
void writeCellPercentage(double value) override
Definition odsdocwriter.cpp:274
OdsDocWriter::close
void close() override
Definition odsdocwriter.cpp:103
OdsDocWriter::setCellAnnotation
void setCellAnnotation(const QString &annotation) override
set annotation to write in the next cell
Definition odsdocwriter.cpp:383
OdsDocWriter::_p_content
ContentXml * _p_content
Definition odsdocwriter.h:68
OdsDocWriter::openDevice
void openDevice(QIODevice *device)
Definition odsdocwriter.cpp:53
OdsDocWriter::_next_annotation
QString _next_annotation
Definition odsdocwriter.h:72
OdsDocWriter::getTableCellStyleRef
OdsTableCellStyleRef getTableCellStyleRef(const OdsTableCellStyle &style) override
Definition odsdocwriter.cpp:369
OdsDocWriter::writeCell
void writeCell(const char *) override
write a text cell
Definition odsdocwriter.cpp:184
OdsDocWriter::addColorScale
void addColorScale(const OdsColorScale &ods_color_scale) override
apply solor scale conditional format on a cell range
Definition odsdocwriter.cpp:389
OdsDocWriter::setTableCellStyleRef
void setTableCellStyleRef(OdsTableCellStyleRef style_ref) override
Definition odsdocwriter.cpp:376
OdsDocWriter::setCurrentOdsTableSettings
void setCurrentOdsTableSettings(const OdsTableSettings &settings) override
set ODS table settings of the current sheet (table)
Definition odsdocwriter.cpp:402
OdsDocWriter::~OdsDocWriter
virtual ~OdsDocWriter()
Definition odsdocwriter.cpp:89
OdsDocWriter::writeLine
void writeLine() override
Definition odsdocwriter.cpp:154
OdsDocWriter::OdsDocWriter
OdsDocWriter(const QString &filename)
Definition odsdocwriter.cpp:31
OdsTableCellStyle
Definition odstablecellstyle.h:34
OdsTableSettings
Definition odstablesettings.h:43
SettingsXml
Definition settingsxml.h:45
contentxml.h
OdsTableCellStyleRef
OdsTableCellStyleRefInternal * OdsTableCellStyleRef
Definition odstablecellstyleref.h:35
settingsxml.h