File indexing completed on 2024-04-21 14:54:34

0001 /*
0002     This file is part of the KContacts framework.
0003     SPDX-FileCopyrightText: 2015-2019 Laurent Montel <montel@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #ifndef GENDER_H
0009 #define GENDER_H
0010 #include "kcontacts_export.h"
0011 #include <QSharedDataPointer>
0012 #include <QString>
0013 
0014 namespace KContacts
0015 {
0016 /** @short Class that holds a Gender for a contact.
0017  *  @since 4.14.5
0018  */
0019 class KCONTACTS_EXPORT Gender
0020 {
0021     friend KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &, const Gender &);
0022     friend KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &, Gender &);
0023 
0024 public:
0025     /**
0026      * Creates an empty Gender object.
0027      */
0028     Gender();
0029     Gender(const Gender &other);
0030     Gender(const QString &gender);
0031 
0032     ~Gender();
0033 
0034     void setGender(const QString &gender);
0035     Q_REQUIRED_RESULT QString gender() const;
0036 
0037     void setComment(const QString &comment);
0038     Q_REQUIRED_RESULT QString comment() const;
0039 
0040     Q_REQUIRED_RESULT bool isValid() const;
0041 
0042     Q_REQUIRED_RESULT bool operator==(const Gender &other) const;
0043     Q_REQUIRED_RESULT bool operator!=(const Gender &other) const;
0044 
0045     Gender &operator=(const Gender &other);
0046 
0047     Q_REQUIRED_RESULT QString toString() const;
0048 
0049 private:
0050     class Private;
0051     QSharedDataPointer<Private> d;
0052 };
0053 
0054 KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &stream, const Gender &object);
0055 
0056 KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &stream, Gender &object);
0057 }
0058 Q_DECLARE_TYPEINFO(KContacts::Gender, Q_MOVABLE_TYPE);
0059 #endif // GENDER_H