libodsstream
Library for mass spectrometry
Loading...
Searching...
No Matches
calcwriterinterface.cpp
Go to the documentation of this file.
1/**
2 * \file odsstream/odsdochandlerinterface.cpp
3 * \date 10/03/2015
4 * \author Olivier Langella
5 * \brief interface to use as a wildcard to writer in either TSV, ODS
6 * TSVdirectory writers any kind of writer can be created in your program :
7 * OdsDocWriter, TsvDirectoryWriter, TsvOutputStream
8 * All of them implements this interface :
9 * it allows to use the same code to write in these different formats.
10 */
11
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
39#include "calcwriterinterface.h"
40
44
45
46/**
47 * build table cell style reference with a style definition
48 *
49 * \param style OdsTableCellStyle
50 * \return OdsTableCellStyleRef pointer on a style reference
51 */
54 [[maybe_unused]] const OdsTableCellStyle &style)
55{
56 return nullptr;
57}
58
59/**
60 * set the cell table style. This is applied to in the stream to following
61 * cells. This ends by using an other style reference or by using
62 * setTableCellStyleRef function
63 *
64 * \param style_ref OdsTableCellStyleRef
65 */
66void
71
72/**
73 * clear cell style definition in the stream. the default style will be
74 * applied.
75 *
76 */
77void
82
83/** \brief apply solor scale conditional format on a cell range
84 *
85 */
86void
88 [[maybe_unused]] const OdsColorScale &ods_color_scale)
89{
90}
91
92/** @brief get the last written cell coordinate in ODS coordinate format
93 * get the coordinate of the last written cell or an empty string if the
94 * writer is not an OdsDocWriter
95 *
96 * @return QString with ODS cell coordinate of the form : "classeur.A5"
97 */
98QString
100{
101 return QString();
102}
103
104/** @brief set ODS table settings of the current sheet (table)
105 */
106void
108 [[maybe_unused]] const OdsTableSettings &settings)
109{
110}
111
112/**
113 * \brief write a cell for a given QVariant
114 * \param QVariant variable to write
115 */
116void
118{
119 int type = var.metaType().id();
120 switch(type)
121 {
122 case QMetaType::Void:
124 break;
125 case QMetaType::Bool:
126 writeCell(var.toBool());
127 break;
128 case QMetaType::Double:
129 case QMetaType::Float:
130 writeCell(var.toDouble());
131 break;
132 case QMetaType::Int:
133 writeCell(var.toInt());
134 break;
135 case QMetaType::QDate:
136 writeCell(var.toDate());
137 break;
138 case QMetaType::QDateTime:
139 writeCell(var.toDateTime());
140 break;
141 case QMetaType::QString:
142 writeCell(var.toString());
143 break;
144 case QMetaType::QUrl:
145 writeCell(var.toUrl(), var.toUrl().toString());
146 break;
147 default:
148 writeCell(var.toString());
149 }
150}
virtual void writeEmptyCell()=0
write an empty cell
virtual void writeCell(const char *cell_text)=0
write a text cell
virtual void writeCellVariant(const QVariant &var)
write a cell for a given QVariant
virtual void setTableCellStyleRef(OdsTableCellStyleRef style_ref)
virtual void addColorScale(const OdsColorScale &ods_color_scale)
apply solor scale conditional format on a cell range
virtual QString getOdsCellCoordinate()
get the last written cell coordinate in ODS coordinate format get the coordinate of the last written ...
virtual OdsTableCellStyleRef getTableCellStyleRef(const OdsTableCellStyle &style)
virtual void setCurrentOdsTableSettings(const OdsTableSettings &settings)
set ODS table settings of the current sheet (table)