odsstream
settingsxml.h
1 
8 /*******************************************************************************
9  * Copyright (c) 2013 Olivier Langella <Olivier.Langella@u-psud.fr>.
10  *
11  * This file is part of the libodsstream library.
12  *
13  * libodsstream is a library to read and write ODS documents as streams
14  * Copyright (C) 2013 Olivier Langella <Olivier.Langella@u-psud.fr>
15  *
16  * This program is free software: you can redistribute it and/or modify
17  * it under the terms of the GNU Lesser General Public License as published
18  *by the Free Software Foundation, either version 3 of the License, or (at your
19  *option) any later version.
20  *
21  * This program is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24  * GNU Lesser General Public License for more details.
25  *
26  * You should have received a copy of the GNU Lesser General Public License
27  * along with this program. If not, see <http://www.gnu.org/licenses/>.
28  *
29  * Contributors:
30  * Olivier Langella <Olivier.Langella@u-psud.fr> - initial API and
31  *implementation
32  ******************************************************************************/
33 
34 
35 #pragma once
36 
37 #include <quazip5/quazip.h>
38 #include <QXmlStreamWriter>
39 #include "../options/odstablesettings.h"
40 
41 class OdsDocWriter;
42 class ContentXml;
43 
45 {
46  friend OdsDocWriter;
47  friend ContentXml;
48 
49  protected:
50  SettingsXml();
51  virtual ~SettingsXml();
52 
53  void addSheetName(const QString &name);
54  const QString getDefaultSheetName() const;
55 
56  void setCurrentOdsTableSettings(const OdsTableSettings &settings);
57 
58  void write(QuaZip *p_quazip);
59 
60  private:
61  void writeConfigurationSettings(QXmlStreamWriter *p_writer);
62  void writeSheetSettings(QXmlStreamWriter *p_writer,
63  const QString &sheet_name);
64  void writeConfigItem(QXmlStreamWriter *p_writer,
65  const QString &name,
66  const QString &type,
67  const QString &value);
68 
69  private:
70  OdsTableSettings _default_table_settings;
71 
72  std::vector<QString> _sheet_list;
73 
74  std::vector<OdsTableSettings> _table_settings_list;
75 };
OdsDocWriter
Definition: odsdocwriter.h:31
ContentXml
Definition: contentxml.h:34
OdsTableSettings
Definition: odstablesettings.h:42
SettingsXml
Definition: settingsxml.h:44