File indexing completed on 2024-11-24 04:44:15

0001 /*
0002     This file is part of Akonadi KolabProxy
0003     SPDX-FileCopyrightText: 2009 Kevin Krammer <kevin.krammer@gmx.at>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #pragma once
0009 
0010 #include "kolabbase.h"
0011 
0012 namespace KContacts
0013 {
0014 class ContactGroup;
0015 }
0016 
0017 namespace KolabV2
0018 {
0019 class DistributionList : public KolabBase
0020 {
0021 public:
0022     explicit DistributionList(const KContacts::ContactGroup *contactGroup);
0023     DistributionList(const QString &xml);
0024     ~DistributionList() override;
0025 
0026     void saveTo(KContacts::ContactGroup *contactGroup);
0027 
0028     QString type() const override;
0029 
0030     void setName(const QString &name);
0031     QString name() const;
0032 
0033     // Load the attributes of this class
0034     bool loadAttribute(QDomElement &) override;
0035 
0036     // Save the attributes of this class
0037     bool saveAttributes(QDomElement &) const override;
0038 
0039     // Load this note by reading the XML file
0040     bool loadXML(const QDomDocument &xml) override;
0041 
0042     // Serialize this note to an XML string
0043     QString saveXML() const override;
0044 
0045     QString productID() const override;
0046 
0047 protected:
0048     void setFields(const KContacts::ContactGroup *);
0049 
0050 private:
0051     void loadDistrListMember(const QDomElement &element);
0052     void saveDistrListMembers(QDomElement &element) const;
0053 
0054     QString mName;
0055 
0056     struct Custom {
0057         QString app;
0058         QString name;
0059         QString value;
0060     };
0061     QList<Custom> mCustomList;
0062 
0063     struct Member {
0064         QString displayName;
0065         QString email;
0066         QString uid;
0067     };
0068     QList<Member> mDistrListMembers;
0069 };
0070 }
0071 
0072 // kate: space-indent on; indent-width 2; replace-tabs on;