odsstream
calcwriterinterface.h
1 
12 /*******************************************************************************
13  * Copyright (c) 2013 Olivier Langella <Olivier.Langella@u-psud.fr>.
14  *
15  * This file is part of the libodsstream library.
16  *
17  * libodsstream is a library to read and write ODS documents as streams
18  * Copyright (C) 2013 Olivier Langella <Olivier.Langella@u-psud.fr>
19  *
20  * This program is free software: you can redistribute it and/or modify
21  * it under the terms of the GNU Lesser General Public License as published
22  *by the Free Software Foundation, either version 3 of the License, or (at your
23  *option) any later version.
24  *
25  * This program is distributed in the hope that it will be useful,
26  * but WITHOUT ANY WARRANTY; without even the implied warranty of
27  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28  * GNU Lesser General Public License for more details.
29  *
30  * You should have received a copy of the GNU Lesser General Public License
31  * along with this program. If not, see <http://www.gnu.org/licenses/>.
32  *
33  * Contributors:
34  * Olivier Langella <Olivier.Langella@u-psud.fr> - initial API and
35  *implementation
36  ******************************************************************************/
37 
38 #pragma once
39 
40 
41 #include <QDate>
42 #include <QUrl>
47 
49 {
50  public:
51  virtual ~CalcWriterInterface(){};
52  virtual void close() = 0;
53 
59  virtual void writeSheet(const QString &sheetName) = 0;
60 
64  virtual void writeLine() = 0;
69  virtual void writeCell(const char *cell_text) = 0;
74  virtual void writeCell(const QString &cell_text) = 0;
78  virtual void writeEmptyCell() = 0;
83  virtual void writeCell(std::size_t number) = 0;
88  virtual void writeCell(int number) = 0;
93  virtual void
94  writeCell(unsigned int posInteger)
95  {
96  writeCell((std::size_t)posInteger);
97  };
102  virtual void writeCell(float number) = 0;
107  virtual void writeCell(double number) = 0;
108 
113  virtual void writeCellPercentage(double value) = 0;
118  virtual void writeCell(bool true_or_false) = 0;
123  virtual void writeCell(const QDate &date) = 0;
128  virtual void writeCell(const QDateTime &datetime) = 0;
134  virtual void writeCell(const QUrl &url_link, const QString &text) = 0;
135 
136 
143  virtual OdsTableCellStyleRef
145  {
146  return nullptr;
147  };
155  virtual void setTableCellStyleRef(OdsTableCellStyleRef style_ref){};
156 
162  void
164  {
165  setTableCellStyleRef(nullptr);
166  };
167 
172  virtual void setCellAnnotation(const QString &annotation) = 0;
173 
177  virtual void addColorScale(const OdsColorScale &ods_color_scale){};
178 
185  virtual QString
187  {
188  return QString();
189  };
190 
193  virtual void setCurrentOdsTableSettings(const OdsTableSettings &settings){};
194 };
CalcWriterInterface::writeEmptyCell
virtual void writeEmptyCell()=0
write an empty cell
OdsTableCellStyle
Definition: odstablecellstyle.h:33
CalcWriterInterface::setCurrentOdsTableSettings
virtual void setCurrentOdsTableSettings(const OdsTableSettings &settings)
set ODS table settings of the current sheet (table)
Definition: calcwriterinterface.h:215
CalcWriterInterface::setCellAnnotation
virtual void setCellAnnotation(const QString &annotation)=0
set annotation to write in the next cell
CalcWriterInterface::writeCellPercentage
virtual void writeCellPercentage(double value)=0
write a double as a percentage
OdsColorScale
Definition: odscolorscale.h:42
CalcWriterInterface::getTableCellStyleRef
virtual OdsTableCellStyleRef getTableCellStyleRef(const OdsTableCellStyle &style)
Definition: calcwriterinterface.h:166
odscolorscale.h
structure to apply a color scale in ODS sheets
CalcWriterInterface::getOdsCellCoordinate
virtual QString getOdsCellCoordinate()
get the last written cell coordinate in ODS coordinate format get the coordinate of the last written ...
Definition: calcwriterinterface.h:208
CalcWriterInterface::clearTableCellStyleRef
void clearTableCellStyleRef()
Definition: calcwriterinterface.h:185
CalcWriterInterface::addColorScale
virtual void addColorScale(const OdsColorScale &ods_color_scale)
apply solor scale conditional format on a cell range
Definition: calcwriterinterface.h:199
CalcWriterInterface::writeLine
virtual void writeLine()=0
open a new line
odstablecellstyleref.h
internal reference on handler for ODS cell style
CalcWriterInterface
Definition: calcwriterinterface.h:47
CalcWriterInterface::writeCell
virtual void writeCell(const char *cell_text)=0
write a text cell
CalcWriterInterface::writeSheet
virtual void writeSheet(const QString &sheetName)=0
open a new sheet
odstablecellstyle.h
handler for ODS cell style
OdsTableSettings
Definition: odstablesettings.h:41
OdsTableCellStyleRefInternal
Definition: odstablecellstyleref.h:38
CalcWriterInterface::setTableCellStyleRef
virtual void setTableCellStyleRef(OdsTableCellStyleRef style_ref)
Definition: calcwriterinterface.h:177
odstablesettings.h
store table settings