objectnotificationmessage.h
00001 /* 00002 Copyright (c) 2011 Stephen Kelly <steveire@gmail.com> 00003 00004 This library is free software; you can redistribute it and/or modify it 00005 under the terms of the GNU Library General Public License as published by 00006 the Free Software Foundation; either version 2 of the License, or (at your 00007 option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, but WITHOUT 00010 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00011 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00012 License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to the 00016 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00017 02110-1301, USA. 00018 */ 00019 00020 #ifndef AKONADI_OBJECTNOTIFICATIONMESSAGE_H 00021 #define AKONADI_OBJECTNOTIFICATIONMESSAGE_H 00022 00023 #include "collection.h" 00024 #include "item.h" 00025 #include "notificationmessage_p.h" 00026 00027 #include <QQueue> 00028 00029 namespace Akonadi 00030 { 00031 00032 class NotificationMessage; 00033 00040 class ObjectNotificationMessage 00041 { 00042 public: 00043 ObjectNotificationMessage(const Akonadi::NotificationMessage &message = Akonadi::NotificationMessage()); 00044 00045 static bool appendAndCompress( QList<ObjectNotificationMessage> &vector, const Akonadi::ObjectNotificationMessage &message); 00046 static bool appendAndCompress( QVector<ObjectNotificationMessage> &vector, const Akonadi::ObjectNotificationMessage &message); 00047 00048 Item::List items() const; 00049 Collection::List collections() const; 00050 Collection parentCollection() const; 00051 Collection parentDestCollection() const; 00052 NotificationMessage message() const; 00053 NotificationMessage::Operation operation() const; 00054 NotificationMessage::Type type() const; 00055 QByteArray resource() const; 00056 QString remoteId() const; 00057 QSet<QByteArray> itemParts() const; 00058 QString mimeType() const; 00059 00060 void appendItems(const Item::List &list); 00061 void appendCollections(const Collection::List &list); 00062 00063 private: 00064 Item::List m_items; 00065 Collection::List m_collections; 00066 Collection m_parentCollection; 00067 Collection m_parentDestCollection; 00068 NotificationMessage m_message; 00069 }; 00070 00071 } 00072 00073 Q_DECLARE_TYPEINFO(Akonadi::ObjectNotificationMessage, Q_MOVABLE_TYPE); 00074 00075 #endif