KContacts

impp.h
1 /*
2  This file is part of libkabc.
3  SPDX-FileCopyrightText: 2015-2019 Laurent Montel <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7 
8 #ifndef IMPP_H
9 #define IMPP_H
10 
11 #include "kcontacts_export.h"
12 
13 #include <QMap>
14 #include <QMetaType>
15 #include <QSharedDataPointer>
16 #include <QString>
17 
18 namespace KContacts {
26 class KCONTACTS_EXPORT Impp
27 {
28  Q_GADGET
29  Q_PROPERTY(bool isValid READ isValid)
30  Q_PROPERTY(QUrl address READ address WRITE setAddress)
31  Q_PROPERTY(bool isPreferred READ isPreferred WRITE setPreferred)
32  Q_PROPERTY(QString serviceType READ serviceType)
33  Q_PROPERTY(QString serviceLabel READ serviceLabel)
34  Q_PROPERTY(QString serviceIcon READ serviceIcon)
35 
36  friend KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &, const Impp &);
37  friend KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &, Impp &);
38 public:
39  Impp();
40  Impp(const Impp &other);
41  Impp(const QUrl &address);
42 
43  ~Impp();
44 
45  typedef QVector<Impp> List;
46  Q_REQUIRED_RESULT bool isValid() const;
47 
48  void setAddress(const QUrl &address);
49  Q_REQUIRED_RESULT QUrl address() const;
50 
56  QString serviceType() const;
61  QString serviceLabel() const;
66  QString serviceIcon() const;
67 
72  bool isPreferred() const;
77  void setPreferred(bool preferred);
78 
79  void setParameters(const QMap<QString, QStringList> &params);
80  Q_REQUIRED_RESULT QMap<QString, QStringList> parameters() const;
81 
82  Q_REQUIRED_RESULT bool operator==(const Impp &other) const;
83  Q_REQUIRED_RESULT bool operator!=(const Impp &other) const;
84 
85  Impp &operator=(const Impp &other);
86 
87  Q_REQUIRED_RESULT QString toString() const;
88 
93  static QString serviceLabel(const QString &serviceType);
98  static QString serviceIcon(const QString &serviceType);
104  static QVector<QString> serviceTypes();
105 
106 private:
107  class Private;
109 };
110 
111 KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &stream, const Impp &object);
112 
113 KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &stream, Impp &object);
114 }
115 
116 Q_DECLARE_METATYPE(KContacts::Impp)
117 Q_DECLARE_TYPEINFO(KContacts::Impp, Q_MOVABLE_TYPE);
118 #endif // IMPP_H
QDataStream & operator>>(QDataStream &in, KDateTime::Spec &spec)
Class that holds a IMPP for a contact.
Definition: impp.h:26
QDataStream & operator<<(QDataStream &out, const KDateTime::Spec &spec)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Jul 4 2020 22:55:11 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.