KContacts

secrecy.h
1 /*
2  This file is part of the KContacts framework.
3  SPDX-FileCopyrightText: 2002 Tobias Koenig <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7 
8 #ifndef KCONTACTS_SECRECY_H
9 #define KCONTACTS_SECRECY_H
10 
11 #include "kcontacts_export.h"
12 #include <QVector>
13 #include <QSharedDataPointer>
14 
15 namespace KContacts {
17 class KCONTACTS_EXPORT Secrecy
18 {
19  friend KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &, const Secrecy &);
20  friend KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &, Secrecy &);
21 
22 public:
30  enum Type {
31  Public,
32  Private,
33  Confidential,
34  Invalid
35  };
36 
41 
47  Secrecy(Type type = Invalid);
48 
52  Secrecy(const Secrecy &other);
53 
57  ~Secrecy();
58 
59  Secrecy &operator=(const Secrecy &other);
60 
61  Q_REQUIRED_RESULT bool operator==(const Secrecy &other) const;
62  Q_REQUIRED_RESULT bool operator!=(const Secrecy &other) const;
63 
67  Q_REQUIRED_RESULT bool isValid() const;
68 
74  void setType(Type type);
75 
79  Q_REQUIRED_RESULT Type type() const;
80 
84  Q_REQUIRED_RESULT static TypeList typeList();
85 
89  Q_REQUIRED_RESULT static QString typeLabel(Type type);
90 
94  Q_REQUIRED_RESULT QString toString() const;
95 
96 private:
97  class PrivateData;
99 };
100 
104 KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &stream, const Secrecy &secrecy);
105 
109 KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &stream, Secrecy &secrecy);
110 }
111 Q_DECLARE_TYPEINFO(KContacts::Secrecy, Q_MOVABLE_TYPE);
112 #endif
QDataStream & operator>>(QDataStream &in, KDateTime::Spec &spec)
QVector< Type > TypeList
List of secrecy types.
Definition: secrecy.h:40
Type
Secrecy types.
Definition: secrecy.h:30
QDataStream & operator<<(QDataStream &out, const KDateTime::Spec &spec)
Descripes the confidentiality of an addressee.
Definition: secrecy.h:17
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Jul 4 2020 22:55:11 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.