File indexing completed on 2024-11-24 04:44:35
0001 /* 0002 SPDX-FileCopyrightText: 2009 Kevin Ottens <ervin@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include "akonadi-singlefileresource_export.h" 0010 #include <Akonadi/Attribute> 0011 0012 #include <QMap> 0013 0014 #include <KIMAP/Acl> 0015 0016 namespace Akonadi 0017 { 0018 class AKONADI_SINGLEFILERESOURCE_EXPORT ImapAclAttribute : public Akonadi::Attribute 0019 { 0020 public: 0021 ImapAclAttribute(); 0022 ImapAclAttribute(const QMap<QByteArray, KIMAP::Acl::Rights> &rights, const QMap<QByteArray, KIMAP::Acl::Rights> &oldRights); 0023 void setRights(const QMap<QByteArray, KIMAP::Acl::Rights> &rights); 0024 QMap<QByteArray, KIMAP::Acl::Rights> rights() const; 0025 QMap<QByteArray, KIMAP::Acl::Rights> oldRights() const; 0026 void setMyRights(KIMAP::Acl::Rights rights); 0027 KIMAP::Acl::Rights myRights() const; 0028 QByteArray type() const override; 0029 ImapAclAttribute *clone() const override; 0030 QByteArray serialized() const override; 0031 void deserialize(const QByteArray &data) override; 0032 0033 bool operator==(const ImapAclAttribute &other) const; 0034 0035 private: 0036 QMap<QByteArray, KIMAP::Acl::Rights> mRights; 0037 QMap<QByteArray, KIMAP::Acl::Rights> mOldRights; 0038 KIMAP::Acl::Rights mMyRights; 0039 }; 0040 }