Qt Model Utilities  2.0.3
A set of utilities for the model/view framework of Qt
abstractstringserialiser.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 
14 #ifndef ABSTRACTMODELSERIALISER_H
15 #define ABSTRACTMODELSERIALISER_H
16 
17 #include "abstractmodelserialiser.h"
18 #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
19 # include <QTextCodec>
20 #endif
21 class AbstractStringSerialiserPrivate;
22 class MODELUTILITIES_EXPORT AbstractStringSerialiser : public AbstractModelSerialiser
23 {
24  Q_OBJECT
25  Q_DECLARE_PRIVATE(AbstractStringSerialiser)
26  Q_DISABLE_COPY(AbstractStringSerialiser)
27 public:
28  explicit AbstractStringSerialiser(QObject *parent = Q_NULLPTR);
29  AbstractStringSerialiser(QAbstractItemModel *model, QObject *parent);
30  AbstractStringSerialiser(const QAbstractItemModel *model, QObject *parent);
32 #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
33  QTextCodec *textCodec() const;
34  bool setTextCodec(QTextCodec *val);
35 #endif
36  Q_INVOKABLE virtual bool saveModel(QString *destination) const = 0;
37  Q_INVOKABLE virtual bool loadModel(QString *source) = 0;
38  Q_INVOKABLE bool loadModel(const QString &source);
39 
40 protected:
41  AbstractStringSerialiser(AbstractStringSerialiserPrivate &d, QObject *parent);
42 };
43 
44 #endif // ABSTRACTMODELSERIALISER_H
The interface for model serialisers.
Definition: abstractmodelserialiser.h:24
virtual Q_INVOKABLE bool loadModel(QIODevice *source)=0
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
virtual ~AbstractStringSerialiser()=0