KContacts

title.h
1 /*
2  This file is part of the KContacts framework.
3  SPDX-FileCopyrightText: 2016-2019 Laurent Montel <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7 
8 #ifndef TITLE_H
9 #define TITLE_H
10 
11 #include "kcontacts_export.h"
12 
13 #include <QMap>
14 #include <QSharedDataPointer>
15 #include <QString>
16 
17 class TitleTest;
18 
19 namespace KContacts
20 {
21 class ParameterMap;
22 
23 /** @short Class that holds a Title for a contact.
24  * @since 5.3
25  */
26 class KCONTACTS_EXPORT Title
27 {
28  friend KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &, const Title &);
29  friend KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &, Title &);
30  friend class VCardTool;
31  friend class ::TitleTest;
32 
33 public:
34  Title();
35  Title(const Title &other);
36  Title(const QString &title);
37 
38  ~Title();
39 
40  typedef QVector<Title> List;
41 
42  void setTitle(const QString &title);
43  Q_REQUIRED_RESULT QString title() const;
44 
45  Q_REQUIRED_RESULT bool isValid() const;
46 
47 #if KCONTACTS_ENABLE_DEPRECATED_SINCE(5, 88)
48  /**
49  * @deprecated Since 5.88 for lack of usage
50  */
51  KCONTACTS_DEPRECATED_VERSION(5, 88, "For lack of usage.")
52  void setParameters(const QMap<QString, QStringList> &params);
53 #endif
54 
55 #if KCONTACTS_ENABLE_DEPRECATED_SINCE(5, 88)
56  /**
57  * @deprecated Since 5.88 for lack of usage
58  */
59  Q_REQUIRED_RESULT
60  KCONTACTS_DEPRECATED_VERSION(5, 88, "For lack of usage.")
61  QMap<QString, QStringList> parameters() const;
62 #endif
63 
64  Q_REQUIRED_RESULT bool operator==(const Title &other) const;
65  Q_REQUIRED_RESULT bool operator!=(const Title &other) const;
66 
67  Title &operator=(const Title &other);
68 
69  Q_REQUIRED_RESULT QString toString() const;
70 
71 private:
72  // exported for TitleTest
73  void setParams(const ParameterMap &params);
74  Q_REQUIRED_RESULT ParameterMap params() const;
75 
76  class Private;
78 };
79 KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &stream, const Title &object);
80 
81 KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &stream, Title &object);
82 }
83 Q_DECLARE_TYPEINFO(KContacts::Title, Q_MOVABLE_TYPE);
84 #endif // TITLE_H
Class that holds a Title for a contact.
Definition: title.h:26
KCALENDARCORE_EXPORT QDataStream & operator<<(QDataStream &out, const KCalendarCore::Alarm::Ptr &)
KCALENDARCORE_EXPORT QDataStream & operator>>(QDataStream &in, const KCalendarCore::Alarm::Ptr &)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Dec 10 2023 03:49:09 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.