File indexing completed on 2024-11-10 04:40:11
0001 /* 0002 SPDX-FileCopyrightText: 2013 Christian Mollekopf <mollekopf@kolabsys.com> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include <QObject> 0010 0011 class GidTest : public QObject 0012 { 0013 Q_OBJECT 0014 private Q_SLOTS: 0015 void initTestCase(); 0016 void testSetAndFetch_data(); 0017 void testSetAndFetch(); 0018 void testCreate(); 0019 void testSetWithIgnorePayload(); 0020 void testFetchScope(); 0021 }; 0022 0023 #include "gidextractorinterface.h" 0024 #include "itemserializer_p.h" 0025 #include "itemserializerplugin.h" 0026 0027 class TestSerializer : public QObject, public Akonadi::ItemSerializerPlugin, public Akonadi::GidExtractorInterface 0028 { 0029 Q_OBJECT 0030 Q_INTERFACES(Akonadi::ItemSerializerPlugin) 0031 Q_INTERFACES(Akonadi::GidExtractorInterface) 0032 0033 public: 0034 bool deserialize(Akonadi::Item &item, const QByteArray &label, QIODevice &data, int version) override; 0035 void serialize(const Akonadi::Item &item, const QByteArray &label, QIODevice &data, int &version) override; 0036 QString extractGid(const Akonadi::Item &item) const override; 0037 };