MyBooks
serializerinterface.h
Go to the documentation of this file.
1 /***************************************************************************
2  * This file is part of the CuteReport project *
3  * Copyright (C) 2012-2017 by Alexander Mikhalov *
4  * alexander.mikhalov@gmail.com *
5  * *
6  ** GNU General Public License Usage **
7  * *
8  * This library is free software: you can redistribute it and/or modify *
9  * it under the terms of the GNU General Public License as published by *
10  * the Free Software Foundation, either version 3 of the License, or *
11  * (at your option) any later version. *
12  * You should have received a copy of the GNU General Public License *
13  * along with this program. If not, see <http://www.gnu.org/licenses/>. *
14  * *
15  ** GNU Lesser General Public License **
16  * *
17  * This library is free software: you can redistribute it and/or modify *
18  * it under the terms of the GNU Lesser General Public License as *
19  * published by the Free Software Foundation, either version 3 of the *
20  * License, or (at your option) any later version. *
21  * You should have received a copy of the GNU Lesser General Public *
22  * License along with this library. *
23  * If not, see <http://www.gnu.org/licenses/>. *
24  * *
25  * This library 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 General Public License for more details. *
29  ****************************************************************************/
30 #ifndef SERIALIZERINTERFACE_H
31 #define SERIALIZERINTERFACE_H
32 
33 #include "reportplugininterface.h"
34 
35 namespace CuteReport
36 {
37 
38 class CUTEREPORT_EXPORTS SerializerInterface : public ReportPluginInterface
39 {
40  Q_OBJECT
42 
43 public:
44  explicit SerializerInterface(QObject * parent);
45  virtual ~SerializerInterface();
46 
47  virtual QByteArray serialize(const QObject * object, bool * ok = 0) = 0;
48  virtual QObject * deserialize(const QByteArray &data, bool * ok = 0) = 0;
49 
50  virtual QString lastError() = 0;
51 
52 signals:
53 
54 protected:
55  virtual SerializerInterface * createInstance(QObject * parent = 0) const = 0;
56  explicit SerializerInterface(const SerializerInterface & source)
57  :ReportPluginInterface(source.parent()){}
58 
59  friend class ReportCore;
60 };
61 
62 }
63 
64 Q_DECLARE_INTERFACE(CuteReport::SerializerInterface, "CuteReport.SerializerInterface/1.0")
65 
66 #endif // SERIALIZERINTERFACE_H
Definition: serializerinterface.h:38
Definition: abstractpainterdelegate.h:42
Definition: reportplugininterface.h:53
#define CUTEREPORT_EXPORTS
Definition: cutereport_globals.h:47
SerializerInterface(const SerializerInterface &source)
Definition: serializerinterface.h:56
Definition: reportcore.h:83