Qt Model Utilities  2.0.3
A set of utilities for the model/view framework of Qt
htmlmodelserialiser.h
1 /****************************************************************************\
2  Copyright 2018 Luca Beldi
3  Licensed under the Apache License, Version 2.0 (the "License");
4  you may not use this file except in compliance with the License.
5  You may obtain a copy of the License at
6  http://www.apache.org/licenses/LICENSE-2.0
7  Unless required by applicable law or agreed to in writing, software
8  distributed under the License is distributed on an "AS IS" BASIS,
9  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10  See the License for the specific language governing permissions and
11  limitations under the License.
12 \****************************************************************************/
13 #ifndef HTMLMODELSERIALISER_H
14 #define HTMLMODELSERIALISER_H
15 
16 #include "abstractstringserialiser.h"
17 class HtmlModelSerialiserPrivate;
18 class MODELUTILITIES_EXPORT HtmlModelSerialiser : public AbstractStringSerialiser
19 {
20  Q_OBJECT
21  Q_PROPERTY(bool printStartDocument READ printStartDocument WRITE setPrintStartDocument)
22  Q_DECLARE_PRIVATE(HtmlModelSerialiser)
23  Q_DISABLE_COPY(HtmlModelSerialiser)
24 public:
25  explicit HtmlModelSerialiser(QObject *parent = Q_NULLPTR);
26  HtmlModelSerialiser(QAbstractItemModel *model, QObject *parent);
27  HtmlModelSerialiser(const QAbstractItemModel *model, QObject *parent);
28  bool printStartDocument() const;
29  void setPrintStartDocument(bool val);
30  bool saveModel(QIODevice *destination) const Q_DECL_OVERRIDE;
31  bool saveModel(QByteArray *destination) const Q_DECL_OVERRIDE;
32  bool saveModel(QString *destination) const Q_DECL_OVERRIDE;
33  bool loadModel(QString *source) Q_DECL_OVERRIDE;
34  bool loadModel(QIODevice *source) Q_DECL_OVERRIDE;
35  bool loadModel(const QByteArray &source) Q_DECL_OVERRIDE;
36 
37 protected:
38  HtmlModelSerialiser(HtmlModelSerialiserPrivate &d, QObject *parent);
39 };
40 #endif // HTMLMODELSERIALISER_H
The interface for model serialisers saving to strings.
Definition: abstractstringserialiser.h:23
virtual Q_INVOKABLE bool saveModel(QString *destination) const =0
virtual Q_INVOKABLE bool loadModel(QString *source)=0
Serialiser to save and load models in HTML format.
Definition: htmlmodelserialiser.h:19