summaryrefslogtreecommitdiffabout
path: root/kabc/secrecy.h
authorzautrix <zautrix>2004-06-26 19:01:18 (UTC)
committer zautrix <zautrix>2004-06-26 19:01:18 (UTC)
commitb9aad1f15dc600e4dbe4c62d3fcced6363188ba3 (patch) (unidiff)
tree2c3d4004fb21c72cba65793859f9bcd8ffd3a49c /kabc/secrecy.h
downloadkdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.zip
kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.gz
kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.bz2
Initial revision
Diffstat (limited to 'kabc/secrecy.h') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/secrecy.h102
1 files changed, 102 insertions, 0 deletions
diff --git a/kabc/secrecy.h b/kabc/secrecy.h
new file mode 100644
index 0000000..8f2f736
--- a/dev/null
+++ b/kabc/secrecy.h
@@ -0,0 +1,102 @@
1/*
2 This file is part of libkabc.
3 Copyright (c) 2002 Tobias Koenig <tokoe@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
19*/
20
21/*
22Enhanced Version of the file for platform independent KDE tools.
23Copyright (c) 2004 Ulf Schenk
24
25$Id$
26*/
27
28#ifndef KABC_SECRECY_H
29#define KABC_SECRECY_H
30
31#include <qvaluelist.h>
32
33namespace KABC {
34
35class Secrecy
36{
37 friend QDataStream &operator<<( QDataStream &, const Secrecy & );
38 friend QDataStream &operator>>( QDataStream &, Secrecy & );
39
40public:
41 typedef QValueList<int> TypeList;
42
43 /**
44 * Secrecy types
45 *
46 * @li Public - for public access
47 * @li Private - only private access
48 * @li Confidential - access for confidential persons
49 */
50 enum Types {
51 Public,
52 Private,
53 Confidential,
54 Invalid
55 };
56
57 /**
58 * Constructor.
59 *
60 * @param type The secrecy type, @see Types.
61 */
62 Secrecy( int type = Invalid );
63
64 bool operator==( const Secrecy & ) const;
65 bool operator!=( const Secrecy & ) const;
66
67 /**
68 Returns if the Secrecy object has a valid value.
69 */
70 bool isValid() const;
71
72 /**
73 * Sets the type, @see Types.
74 */
75 void setType( int type );
76
77 /**
78 * Returns the type, @see Types.
79 */
80 int type() const;
81
82 /**
83 * Returns a list of all available secrecy types.
84 */
85 static TypeList typeList();
86
87 /**
88 * Returns a translated label for a given secrecy type.
89 */
90 static QString typeLabel( int type );
91
92 /**
93 * For debug.
94 */
95 QString asString() const;
96
97private:
98 int mType;
99};
100
101}
102#endif