summaryrefslogtreecommitdiffabout
path: root/kabc/geo.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/geo.h
downloadkdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.zip
kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.gz
kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.bz2
Initial revision
Diffstat (limited to 'kabc/geo.h') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/geo.h106
1 files changed, 106 insertions, 0 deletions
diff --git a/kabc/geo.h b/kabc/geo.h
new file mode 100644
index 0000000..4c7f90f
--- a/dev/null
+++ b/kabc/geo.h
@@ -0,0 +1,106 @@
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_GEO_H
29#define KABC_GEO_H
30
31#include <qstring.h>
32
33namespace KABC {
34
35/**
36 @short Geographic position
37
38 This class represents a geographic position.
39*/
40class Geo
41{
42 friend QDataStream &operator<<( QDataStream &, const Geo & );
43 friend QDataStream &operator>>( QDataStream &, Geo & );
44
45 public:
46 /**
47 Construct invalid geographics position object.
48 */
49 Geo();
50
51 /**
52 Construct geographics position object.
53
54 @param latitude Geographical latitude
55 @param longitude Geographical longitude
56 */
57 Geo( float latitude, float longitude );
58
59 /**
60 Sets the latitude.
61 */
62 void setLatitude( float );
63
64 /**
65 Returns the latitude.
66 */
67 float latitude() const;
68
69 /**
70 Sets the longitude.
71 */
72 void setLongitude( float );
73
74 /**
75 Returns the longitude.
76 */
77 float longitude() const;
78
79 /**
80 Returns, if this object contains a valid geographical position.
81 */
82 bool isValid() const;
83
84 bool operator==( const Geo & ) const;
85 bool operator!=( const Geo & ) const;
86
87 /**
88 Returns string representation of geographical position.
89 */
90 QString asString() const;
91
92 private:
93 float mLatitude;
94 float mLongitude;
95
96 bool mValid;
97 bool mValidLat;
98 bool mValidLong;
99};
100
101QDataStream &operator<<( QDataStream &, const Geo & );
102QDataStream &operator>>( QDataStream &, Geo & );
103
104}
105
106#endif