KContacts

lang.h
1 /*
2  This file is part of the KContacts framework.
3  SPDX-FileCopyrightText: 2015-2019 Laurent Montel <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7 
8 #ifndef LANG_H
9 #define LANG_H
10 
11 #include "kcontacts_export.h"
12 
13 #include <QMap>
14 #include <QSharedDataPointer>
15 #include <QString>
16 
17 class LangTest;
18 
19 namespace KContacts
20 {
21 class ParameterMap;
22 
23 /** @short Class that holds a Language for a contact.
24  * @since 4.14.5
25  */
26 class KCONTACTS_EXPORT Lang
27 {
28  friend KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &, const Lang &);
29  friend KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &, Lang &);
30  friend class Addressee;
31  friend class VCardTool;
32  friend class ::LangTest;
33 
34 public:
35  Lang();
36  Lang(const Lang &other);
37  Lang(const QString &language);
38 
39  ~Lang();
40 
41  typedef QVector<Lang> List;
42 
43  void setLanguage(const QString &lang);
44  Q_REQUIRED_RESULT QString language() const;
45 
46  Q_REQUIRED_RESULT bool isValid() const;
47 
48 #if KCONTACTS_ENABLE_DEPRECATED_SINCE(5, 88)
49  /**
50  * @deprecated Since 5.88 for lack of usage
51  */
52  KCONTACTS_DEPRECATED_VERSION(5, 88, "For lack of usage.")
53  void setParameters(const QMap<QString, QStringList> &params);
54 #endif
55 
56 #if KCONTACTS_ENABLE_DEPRECATED_SINCE(5, 88)
57  /**
58  * @deprecated Since 5.88 for lack of usage
59  */
60  Q_REQUIRED_RESULT
61  KCONTACTS_DEPRECATED_VERSION(5, 88, "For lack of usage.")
62  QMap<QString, QStringList> parameters() const;
63 #endif
64 
65  Q_REQUIRED_RESULT bool operator==(const Lang &other) const;
66  Q_REQUIRED_RESULT bool operator!=(const Lang &other) const;
67 
68  Lang &operator=(const Lang &other);
69 
70  Q_REQUIRED_RESULT QString toString() const;
71 
72 private:
73  // exported for LangTest
74  void setParams(const ParameterMap &params);
75  Q_REQUIRED_RESULT ParameterMap params() const;
76 
77  class Private;
79 };
80 KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &stream, const Lang &object);
81 
82 KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &stream, Lang &object);
83 }
84 Q_DECLARE_TYPEINFO(KContacts::Lang, Q_MOVABLE_TYPE);
85 #endif // LANG_H
Class that holds a Language for a contact.
Definition: lang.h:26
KCALENDARCORE_EXPORT QDataStream & operator<<(QDataStream &out, const KCalendarCore::Alarm::Ptr &)
KCALENDARCORE_EXPORT QDataStream & operator>>(QDataStream &in, const KCalendarCore::Alarm::Ptr &)
address book entry
Definition: addressee.h:69
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.