libodsstream
calcwriterinterface.h
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 #ifndef CALCWRITERINTERFACE_H
21 #define CALCWRITERINTERFACE_H
22 
23 
24 #include <QDate>
25 #include <QUrl>
26 #include "odstablecellstyle.h"
27 #include "odstablecellstyleref.h"
28 
30 {
31 public:
32  virtual ~CalcWriterInterface() {};
33  virtual void close ()= 0;
34 
40  virtual void writeSheet(const QString & sheetName)= 0;
41 
45  virtual void writeLine()= 0;
50  virtual void writeCell(const char * cell_text)= 0;
55  virtual void writeCell(const QString & cell_text)= 0;
59  virtual void writeEmptyCell()= 0;
64  virtual void writeCell(int number)= 0;
69  virtual void writeCell(unsigned int posInteger) {
70  writeCell((int) posInteger);
71  };
76  virtual void writeCell(float number)= 0;
81  virtual void writeCell(double number)= 0;
82 
87  virtual void writeCellPercentage(double value)=0;
92  virtual void writeCell(bool true_or_false)= 0;
97  virtual void writeCell(const QDate & date)= 0;
102  virtual void writeCell(const QDateTime & datetime)= 0;
108  virtual void writeCell(const QUrl & url_link, const QString & text)= 0;
109 
110 
118  return nullptr;
119  };
126  virtual void setTableCellStyleRef(OdsTableCellStyleRef style_ref) {};
127 
133  setTableCellStyleRef(nullptr);
134  };
135 
140  virtual void setCellAnnotation(const QString & annotation) = 0 ;
141 
142 };
143 
144 #endif // CALCWRITERINTERFACE_H
virtual void writeSheet(const QString &sheetName)=0
open a new sheet
virtual void setCellAnnotation(const QString &annotation)=0
set annotation to write in the next cell
Definition: odstablecellstyleref.h:31
virtual OdsTableCellStyleRef getTableCellStyleRef(const OdsTableCellStyle &style)
Definition: calcwriterinterface.h:117
virtual void setTableCellStyleRef(OdsTableCellStyleRef style_ref)
Definition: calcwriterinterface.h:126
Definition: odstablecellstyle.h:26
virtual void writeCell(unsigned int posInteger)
write a positive integer in a cell
Definition: calcwriterinterface.h:69
virtual void writeCellPercentage(double value)=0
write a double as a percentage
virtual void writeCell(const char *cell_text)=0
write a text cell
void clearTableCellStyleRef()
Definition: calcwriterinterface.h:132
virtual void writeLine()=0
open a new line
virtual void writeEmptyCell()=0
write an empty cell
Definition: calcwriterinterface.h:29