File indexing completed on 2024-02-25 03:58:41

0001 /*
0002     This file is part of the KContacts framework.
0003     SPDX-FileCopyrightText: 2016-2019 Laurent Montel <montel@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #ifndef CLIENTPIDMAP_H
0009 #define CLIENTPIDMAP_H
0010 
0011 #include "kcontacts_export.h"
0012 
0013 #include <QMap>
0014 #include <QSharedDataPointer>
0015 #include <QString>
0016 
0017 class ClientPidMapTest;
0018 
0019 namespace KContacts
0020 {
0021 class ParameterMap;
0022 
0023 /** @short Class that holds a ClientPidMap for a contact.
0024  *  @since 5.4
0025  */
0026 class KCONTACTS_EXPORT ClientPidMap
0027 {
0028     friend KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &, const ClientPidMap &);
0029     friend KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &, ClientPidMap &);
0030     friend class VCardTool;
0031     friend class ::ClientPidMapTest;
0032 
0033 public:
0034     ClientPidMap();
0035     ClientPidMap(const ClientPidMap &other);
0036     ClientPidMap(const QString &clientpidmap);
0037 
0038     ~ClientPidMap();
0039 
0040     typedef QList<ClientPidMap> List;
0041 
0042     void setClientPidMap(const QString &clientpidmap);
0043     Q_REQUIRED_RESULT QString clientPidMap() const;
0044 
0045     Q_REQUIRED_RESULT bool isValid() const;
0046 
0047     Q_REQUIRED_RESULT bool operator==(const ClientPidMap &other) const;
0048     Q_REQUIRED_RESULT bool operator!=(const ClientPidMap &other) const;
0049 
0050     ClientPidMap &operator=(const ClientPidMap &other);
0051 
0052     Q_REQUIRED_RESULT QString toString() const;
0053 
0054 private:
0055     // exported for ClientPidMapTest
0056     void setParams(const ParameterMap &params);
0057     Q_REQUIRED_RESULT ParameterMap params() const;
0058 
0059     class Private;
0060     QSharedDataPointer<Private> d;
0061 };
0062 KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &stream, const ClientPidMap &object);
0063 
0064 KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &stream, ClientPidMap &object);
0065 }
0066 Q_DECLARE_TYPEINFO(KContacts::ClientPidMap, Q_RELOCATABLE_TYPE);
0067 #endif // CLIENTPIDMAP_H