00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KABC_SECRECY_H
00022 #define KABC_SECRECY_H
00023
00024 #include "kabc_export.h"
00025 #include <QtCore/QList>
00026 #include <QtCore/QSharedDataPointer>
00027
00028 namespace KABC {
00029
00030 class KABC_EXPORT Secrecy
00031 {
00032 friend KABC_EXPORT QDataStream &operator<<( QDataStream &, const Secrecy & );
00033 friend KABC_EXPORT QDataStream &operator>>( QDataStream &, Secrecy & );
00034
00035 public:
00043 enum Type {
00044 Public,
00045 Private,
00046 Confidential,
00047 Invalid
00048 };
00049
00053 typedef QList<Type> TypeList;
00054
00060 Secrecy( Type type = Invalid );
00061
00065 Secrecy( const Secrecy &other );
00066
00070 ~Secrecy();
00071
00072 Secrecy &operator=( const Secrecy & );
00073
00074 bool operator==( const Secrecy & ) const;
00075 bool operator!=( const Secrecy & ) const;
00076
00080 bool isValid() const;
00081
00087 void setType( Type type );
00088
00092 Type type() const;
00093
00097 static TypeList typeList();
00098
00102 static QString typeLabel( Type type );
00103
00107 QString toString() const;
00108
00109 private:
00110 class PrivateData;
00111 QSharedDataPointer<PrivateData> d;
00112 };
00113
00117 KABC_EXPORT QDataStream &operator<<( QDataStream &stream, const Secrecy &secrecy );
00118
00122 KABC_EXPORT QDataStream &operator>>( QDataStream &stream, Secrecy &secrecy );
00123
00124 }
00125 #endif