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/** @short Class that holds a Gender for a contact.
17 * @since 4.14.5
18 */
19class KCONTACTS_EXPORT Gender
20{
21 friend KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &, const Gender &);
22 friend KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &, Gender &);
23
24public:
25 /**
26 * Creates an empty Gender object.
27 */
28 Gender();
29 Gender(const Gender &other);
30 Gender(const QString &gender);
31
32 ~Gender();
33
34 void setGender(const QString &gender);
35 Q_REQUIRED_RESULT QString gender() const;
36
37 void setComment(const QString &comment);
38 Q_REQUIRED_RESULT QString comment() const;
39
40 Q_REQUIRED_RESULT bool isValid() const;
41
42 Q_REQUIRED_RESULT bool operator==(const Gender &other) const;
43 Q_REQUIRED_RESULT bool operator!=(const Gender &other) const;
44
45 Gender &operator=(const Gender &other);
46
47 Q_REQUIRED_RESULT QString toString() const;
48
49private:
50 class Private;
51 QSharedDataPointer<Private> d;
52};
53
54KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &stream, const Gender &object);
55
56KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &stream, Gender &object);
57}
58Q_DECLARE_TYPEINFO(KContacts::Gender, Q_RELOCATABLE_TYPE);
59#endif // GENDER_H
60

source code of kcontacts/src/gender.h