akonadi
itemserializerplugin.h
00001 /* 00002 Copyright (c) 2007 Till Adam <adam@kde.org> 00003 Copyright (c) 2007 Volker Krause <vkrause@kde.org> 00004 00005 This library is free software; you can redistribute it and/or modify it 00006 under the terms of the GNU Library General Public License as published by 00007 the Free Software Foundation; either version 2 of the License, or (at your 00008 option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, but WITHOUT 00011 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00013 License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to the 00017 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00018 02110-1301, USA. 00019 */ 00020 00021 #ifndef AKONADI_ITEMSERIALIZERPLUGIN_H 00022 #define AKONADI_ITEMSERIALIZERPLUGIN_H 00023 00024 #include <QtCore/QByteArray> 00025 #include <QtCore/QSet> 00026 00027 #include "item.h" 00028 #include "akonadi_export.h" 00029 00030 class QIODevice; 00031 00032 namespace Akonadi { 00033 00034 00120 class AKONADI_EXPORT ItemSerializerPlugin 00121 { 00122 public: 00126 virtual ~ItemSerializerPlugin(); 00127 00147 virtual bool deserialize( Item& item, const QByteArray& label, QIODevice& data, int version ) = 0; 00148 00166 virtual void serialize( const Item& item, const QByteArray& label, QIODevice& data, int &version ) = 0; 00167 00174 virtual QSet<QByteArray> parts( const Item &item ) const; 00175 00176 }; 00177 00183 class AKONADI_EXPORT ItemSerializerPluginV2 : public ItemSerializerPlugin 00184 { 00185 public: 00189 virtual ~ItemSerializerPluginV2(); 00190 00199 virtual void apply( Item &item, const Item &other ); 00200 00211 virtual QSet<QByteArray> availableParts( const Item &item ) const; 00212 }; 00213 00214 } 00215 00216 Q_DECLARE_INTERFACE( Akonadi::ItemSerializerPlugin, "org.freedesktop.Akonadi.ItemSerializerPlugin/1.0" ) 00217 Q_DECLARE_INTERFACE( Akonadi::ItemSerializerPluginV2, "org.freedesktop.Akonadi.ItemSerializerPlugin/1.1" ) 00218 00219 #endif