libodsstream
Library for mass spectrometry
Loading...
Searching...
No Matches
odsdocwriter.h
Go to the documentation of this file.
1/*
2 libodsstream is a library to read and write ODS documents as streams
3 Copyright (C) 2013 Olivier Langella <Olivier.Langella@moulon.inra.fr>
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18*/
19
20#pragma once
21
22#include <QIODevice>
23#include <QString>
24#include <QUrl>
25
26#include <quazip.h>
27#include "calcwriterinterface.h"
30
32{
33 public:
34 OdsDocWriter(const QString &filename);
35 OdsDocWriter(QIODevice *device);
36 virtual ~OdsDocWriter();
37
38 void close() override;
39
40 void writeSheet(const QString &sheetName) override;
41 void writeLine() override;
42 void writeCell(const char *) override;
43 void writeCell(const QString &) override;
44 void writeEmptyCell() override;
45 void writeCell(std::size_t) override;
46 void writeCell(int) override;
47 void writeCell(float) override;
48 void writeCell(double) override;
49 void writeCellPercentage(double value) override;
50 void writeCell(bool) override;
51 void writeCell(const QDate &) override;
52 void writeCell(const QDateTime &) override;
53 void writeCell(const QUrl &, const QString &) override;
55 getTableCellStyleRef(const OdsTableCellStyle &style) override;
56 void setTableCellStyleRef(OdsTableCellStyleRef style_ref) override;
57 void setCellAnnotation(const QString &annotation) override;
58 void addColorScale(const OdsColorScale &ods_color_scale) override;
59 QString getOdsCellCoordinate() override;
60
61 void setCurrentOdsTableSettings(const OdsTableSettings &settings) override;
62
63 private:
64 void openDevice(QIODevice *device);
65 void clearAnnotation();
66
67 private:
69 QuaZip *_p_quaZip;
70 QIODevice *_p_device = nullptr;
71 bool _p_device_delete = false;
74};
SettingsXml _settings_xml
void clearAnnotation()
void writeSheet(const QString &sheetName) override
QuaZip * _p_quaZip
QIODevice * _p_device
bool _p_device_delete
QString getOdsCellCoordinate() override
get the last written cell coordinate in ODS coordinate format get the coordinate of the last written ...
void writeEmptyCell() override
void writeCellPercentage(double value) override
void close() override
void setCellAnnotation(const QString &annotation) override
set annotation to write in the next cell
ContentXml * _p_content
void openDevice(QIODevice *device)
QString _next_annotation
OdsTableCellStyleRef getTableCellStyleRef(const OdsTableCellStyle &style) override
void writeCell(const char *) override
write a text cell
void addColorScale(const OdsColorScale &ods_color_scale) override
apply solor scale conditional format on a cell range
void setTableCellStyleRef(OdsTableCellStyleRef style_ref) override
void setCurrentOdsTableSettings(const OdsTableSettings &settings) override
set ODS table settings of the current sheet (table)
virtual ~OdsDocWriter()
void writeLine() override