• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeabc
 

tdeabc

  • tdeabc
secrecy.cpp
1 /*
2  This file is part of libtdeabc.
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., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 
21 #include <tdelocale.h>
22 
23 #include "secrecy.h"
24 
25 using namespace TDEABC;
26 
27 Secrecy::Secrecy( int type )
28  : mType( type )
29 {
30 }
31 
32 bool Secrecy::operator==( const Secrecy &s ) const
33 {
34  return ( mType == s.mType );
35 }
36 
37 bool Secrecy::operator!=( const Secrecy &s ) const
38 {
39  return !( *this == s );
40 }
41 
42 bool Secrecy::isValid() const
43 {
44  return mType != Invalid;
45 }
46 
47 void Secrecy::setType( int type )
48 {
49  mType = type;
50 }
51 
52 int Secrecy::type() const
53 {
54  return mType;
55 }
56 
57 Secrecy::TypeList Secrecy::typeList()
58 {
59  static TypeList list;
60 
61  if ( list.isEmpty() )
62  list << Public << Private << Confidential;
63 
64  return list;
65 }
66 
67 TQString Secrecy::typeLabel( int type )
68 {
69  switch ( type ) {
70  case Public:
71  return i18n( "Public" );
72  break;
73  case Private:
74  return i18n( "Private" );
75  break;
76  case Confidential:
77  return i18n( "Confidential" );
78  break;
79  default:
80  return i18n( "Unknown type" );
81  break;
82  }
83 }
84 
85 TQString Secrecy::asString() const
86 {
87  return typeLabel( mType );
88 }
89 
90 TQDataStream &TDEABC::operator<<( TQDataStream &s, const Secrecy &secrecy )
91 {
92  return s << secrecy.mType;
93 }
94 
95 TQDataStream &TDEABC::operator>>( TQDataStream &s, Secrecy &secrecy )
96 {
97  s >> secrecy.mType;
98 
99  return s;
100 }
TDEABC
static data, shared by ALL addressee objects
Definition: address.h:48
tdelocale.h

tdeabc

Skip menu "tdeabc"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeabc

Skip menu "tdeabc"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeabc by doxygen 1.8.8
This website is maintained by Timothy Pearson.