summaryrefslogtreecommitdiffabout
path: root/kabc/timezone.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/timezone.h
downloadkdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.zip
kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.gz
kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.bz2
Initial revision
Diffstat (limited to 'kabc/timezone.h') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/timezone.h94
1 files changed, 94 insertions, 0 deletions
diff --git a/kabc/timezone.h b/kabc/timezone.h
new file mode 100644
index 0000000..8d96e03
--- a/dev/null
+++ b/kabc/timezone.h
@@ -0,0 +1,94 @@
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., 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_TIMEZONE_H
29#define KABC_TIMEZONE_H
30
31#include <qstring.h>
32
33namespace KABC {
34
35/**
36 * @short Time zone information.
37 *
38 * This class stores information about a time zone.
39 */
40class TimeZone
41{
42 friend QDataStream &operator<<( QDataStream &, const TimeZone & );
43 friend QDataStream &operator>>( QDataStream &, TimeZone & );
44
45public:
46
47 /**
48 * Construct invalid time zone.
49 */
50 TimeZone();
51
52 /**
53 * Construct time zone.
54 *
55 * @param offset Offset in minutes relative to UTC.
56 */
57 TimeZone( int offset );
58
59 /**
60 * Set time zone offset relative to UTC.
61 *
62 * @param offset Offset in minutes.
63 */
64 void setOffset( int );
65
66 /**
67 * Return offset in minutes relative to UTC.
68 */
69 int offset() const;
70
71 /**
72 * Return, if this time zone object is valid.
73 */
74 bool isValid() const;
75
76 bool operator==( const TimeZone & ) const;
77 bool operator!=( const TimeZone & ) const;
78
79 /**
80 * Return string representation of time zone offset.
81 */
82 QString asString() const;
83
84private:
85 int mOffset; // Offset in minutes
86
87 bool mValid;
88};
89
90QDataStream &operator<<( QDataStream &, const TimeZone & );
91QDataStream &operator>>( QDataStream &, TimeZone & );
92
93}
94#endif