Akonadi

itemserializerplugin.h
1 /*
2  SPDX-FileCopyrightText: 2007 Till Adam <[email protected]>
3  SPDX-FileCopyrightText: 2007 Volker Krause <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7 
8 #ifndef AKONADI_ITEMSERIALIZERPLUGIN_H
9 #define AKONADI_ITEMSERIALIZERPLUGIN_H
10 
11 #include <QByteArray>
12 #include <QSet>
13 
14 #include "item.h"
15 #include "akonadicore_export.h"
16 
17 class QIODevice;
18 
19 namespace Akonadi
20 {
21 
107 class AKONADICORE_EXPORT ItemSerializerPlugin
108 {
109 public:
113  virtual ~ItemSerializerPlugin();
114 
134  virtual bool deserialize(Item &item, const QByteArray &label, QIODevice &data, int version) = 0;
135 
153  virtual void serialize(const Item &item, const QByteArray &label, QIODevice &data, int &version) = 0;
154 
161  virtual QSet<QByteArray> parts(const Item &item) const;
162 
172  static void overridePluginLookup(QObject *plugin);
173 
174 
184  virtual void apply(Item &item, const Item &other);
185 
196  virtual QSet<QByteArray> availableParts(const Item &item) const;
197 
209  virtual QSet<QByteArray> allowedForeignParts(const Item &item) const;
210 
211 protected:
212  explicit ItemSerializerPlugin() = default;
213 
214 private:
215  Q_DISABLE_COPY_MOVE(ItemSerializerPlugin)
216 };
217 
218 }
219 
220 Q_DECLARE_INTERFACE(Akonadi::ItemSerializerPlugin, "org.freedesktop.Akonadi.ItemSerializerPlugin/2.0")
221 
222 #endif
Helper integration between Akonadi and Qt.
The base class for item type serializer plugins.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun Jul 12 2020 23:16:57 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.