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

kabc

  • kabc
timezone.cpp
1 /*
2  This file is part of libkabc.
3  Copyright (c) 2001 Cornelius Schumacher <schumacher@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 <tqdatastream.h>
22 
23 #include "timezone.h"
24 
25 using namespace KABC;
26 
27 TimeZone::TimeZone() :
28  mOffset( 0 ), mValid( false )
29 {
30 }
31 
32 TimeZone::TimeZone( int offset ) :
33  mOffset( offset ), mValid( true )
34 {
35 }
36 
37 void TimeZone::setOffset( int offset )
38 {
39  mOffset = offset;
40  mValid = true;
41 }
42 
43 int TimeZone::offset() const
44 {
45  return mOffset;
46 }
47 
48 bool TimeZone::isValid() const
49 {
50  return mValid;
51 }
52 
53 bool TimeZone::operator==( const TimeZone &t ) const
54 {
55  if ( !t.isValid() && !isValid() ) return true;
56  if ( !t.isValid() || !isValid() ) return false;
57  if ( t.mOffset == mOffset ) return true;
58  return false;
59 }
60 
61 bool TimeZone::operator!=( const TimeZone &t ) const
62 {
63  if ( !t.isValid() && !isValid() ) return false;
64  if ( !t.isValid() || !isValid() ) return true;
65  if ( t.mOffset != mOffset ) return true;
66  return false;
67 }
68 
69 TQString TimeZone::asString() const
70 {
71  return TQString::number( mOffset );
72 }
73 
74 TQDataStream &KABC::operator<<( TQDataStream &s, const TimeZone &zone )
75 {
76  return s << zone.mOffset;
77 }
78 
79 TQDataStream &KABC::operator>>( TQDataStream &s, TimeZone &zone )
80 {
81  s >> zone.mOffset;
82  zone.mValid = true;
83 
84  return s;
85 }
KABC::TimeZone::setOffset
void setOffset(int offset)
Set time zone offset relative to UTC.
Definition: timezone.cpp:37
KABC::TimeZone::isValid
bool isValid() const
Return, if this time zone object is valid.
Definition: timezone.cpp:48
KABC::TimeZone::offset
int offset() const
Return offset in minutes relative to UTC.
Definition: timezone.cpp:43
KABC::TimeZone::TimeZone
TimeZone()
Construct invalid time zone.
Definition: timezone.cpp:27
KABC::TimeZone
Time zone information.
Definition: timezone.h:35
KABC::TimeZone::asString
TQString asString() const
Return string representation of time zone offset.
Definition: timezone.cpp:69
KABC
static data, shared by ALL addressee objects
Definition: address.h:48

kabc

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

kabc

Skip menu "kabc"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kabc by doxygen 1.8.11
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |