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 writeCell(float number) = 0;
98  virtual void writeCell(double number) = 0;
99 
104  virtual void writeCellPercentage(double value) = 0;
109  virtual void writeCell(bool true_or_false) = 0;
114  virtual void writeCell(const QDate &date) = 0;
119  virtual void writeCell(const QDateTime &datetime) = 0;
125  virtual void writeCell(const QUrl &url_link, const QString &text) = 0;
126 
127 
134  virtual OdsTableCellStyleRef
135  getTableCellStyleRef([[maybe_unused ]] const OdsTableCellStyle &style)
136  {
137  return nullptr;
138  };
146  virtual void
147  setTableCellStyleRef([[maybe_unused ]] OdsTableCellStyleRef style_ref)
148  {
149  };
150 
156  void
158  {
159  setTableCellStyleRef(nullptr);
160  };
161 
166  virtual void setCellAnnotation(const QString &annotation) = 0;
167 
171  virtual void addColorScale([[maybe_unused ]] const OdsColorScale &ods_color_scale)
172  {
173  };
174 
181  virtual QString
183  {
184  return QString();
185  };
186 
189  virtual void setCurrentOdsTableSettings([[maybe_unused ]] const OdsTableSettings &settings)
190  {
191  };
192 };
193 
Definition: calcwriterinterface.h:49
virtual void addColorScale([[maybe_unused]] const OdsColorScale &ods_color_scale)
apply solor scale conditional format on a cell range
Definition: calcwriterinterface.h:171
virtual void writeEmptyCell()=0
write an empty cell
virtual void writeCell(const char *cell_text)=0
write a text cell
virtual void setCurrentOdsTableSettings([[maybe_unused]] const OdsTableSettings &settings)
set ODS table settings of the current sheet (table)
Definition: calcwriterinterface.h:189
void clearTableCellStyleRef()
Definition: calcwriterinterface.h:157
virtual void setCellAnnotation(const QString &annotation)=0
set annotation to write in the next cell
virtual void writeCell(bool true_or_false)=0
write a boolean in a cell
virtual void writeCell(const QString &cell_text)=0
write a text cell
virtual void writeCell(std::size_t number)=0
write an unsigned integer in a cell
virtual OdsTableCellStyleRef getTableCellStyleRef([[maybe_unused]] const OdsTableCellStyle &style)
Definition: calcwriterinterface.h:135
virtual void writeCell(float number)=0
write a float in a cell
virtual QString getOdsCellCoordinate()
get the last written cell coordinate in ODS coordinate format get the coordinate of the last written ...
Definition: calcwriterinterface.h:182
virtual void writeCellPercentage(double value)=0
write a double as a percentage
virtual void writeCell(double number)=0
write a double in a cell
virtual void writeCell(const QDate &date)=0
write a date in a cell
virtual void writeCell(const QDateTime &datetime)=0
write a timestamp in a cell
virtual void writeCell(const QUrl &url_link, const QString &text)=0
write a text cell with an URL link
virtual void writeSheet(const QString &sheetName)=0
open a new sheet
virtual void setTableCellStyleRef([[maybe_unused]] OdsTableCellStyleRef style_ref)
Definition: calcwriterinterface.h:147
virtual void writeCell(int number)=0
write an integer in a cell
virtual void writeLine()=0
open a new line
Definition: odscolorscale.h:44
Definition: odstablecellstyleref.h:39
Definition: odstablecellstyle.h:34
Definition: odstablesettings.h:43
structure to apply a color scale in ODS sheets
handler for ODS cell style
internal reference on handler for ODS cell style
store table settings