1/*
2 This file is part of the KContacts framework.
3 SPDX-FileCopyrightText: 2015-2019 Laurent Montel <montel@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#ifndef GENDER_H
9#define GENDER_H
10#include "kcontacts_export.h"
11#include <QSharedDataPointer>
12#include <QString>
13
14namespace KContacts
15{
16/*!
17 * \class KContacts::Gender
18 * \inheaderfile KContacts/Gender
19 * \inmodule KContacts
20 *
21 * \brief Class that holds a Gender for a contact.
22 * \since 4.14.5
23 */
24class KCONTACTS_EXPORT Gender
25{
26 friend KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &, const Gender &);
27 friend KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &, Gender &);
28
29public:
30 /*!
31 * Creates an empty Gender object.
32 */
33 Gender();
34
35 Gender(const Gender &other);
36
37 /*!
38 */
39 Gender(const QString &gender);
40
41 ~Gender();
42
43 /*!
44 */
45 void setGender(const QString &gender);
46
47 /*!
48 */
49 Q_REQUIRED_RESULT QString gender() const;
50
51 /*!
52 */
53 void setComment(const QString &comment);
54
55 /*!
56 */
57 Q_REQUIRED_RESULT QString comment() const;
58
59 /*!
60 */
61 Q_REQUIRED_RESULT bool isValid() const;
62
63 /*!
64 */
65 Q_REQUIRED_RESULT bool operator==(const Gender &other) const;
66
67 /*!
68 */
69 Q_REQUIRED_RESULT bool operator!=(const Gender &other) const;
70
71 Gender &operator=(const Gender &other);
72
73 /*!
74 */
75 Q_REQUIRED_RESULT QString toString() const;
76
77private:
78 class Private;
79 QSharedDataPointer<Private> d;
80};
81
82/*!
83 * \relates KContacts::Gender
84 */
85KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &stream, const Gender &object);
86
87/*!
88 * \relates KContacts::Gender
89 */
90KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &stream, Gender &object);
91}
92Q_DECLARE_TYPEINFO(KContacts::Gender, Q_RELOCATABLE_TYPE);
93#endif // GENDER_H
94

source code of kcontacts/src/gender.h