summaryrefslogtreecommitdiffabout
path: root/kaddressbook/geowidget.h
Unidiff
Diffstat (limited to 'kaddressbook/geowidget.h') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/geowidget.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/kaddressbook/geowidget.h b/kaddressbook/geowidget.h
index 3d39691..5b64370 100644
--- a/kaddressbook/geowidget.h
+++ b/kaddressbook/geowidget.h
@@ -1,155 +1,159 @@
1/* 1/*
2 This file is part of KAddressBook. 2 This file is part of KAddressBook.
3 Copyright (c) 2002 Tobias Koenig <tokoe@kde.org> 3 Copyright (c) 2002 Tobias Koenig <tokoe@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifndef GEOWIDGET_H 24#ifndef GEOWIDGET_H
25#define GEOWIDGET_H 25#define GEOWIDGET_H
26 26
27#include <qmap.h> 27#include <qmap.h>
28 28
29#include <qwidget.h> 29#include <qwidget.h>
30//Added by qt3to4:
31#include <QLabel>
32#include <QMouseEvent>
33#include <QPaintEvent>
30#include <kdialogbase.h> 34#include <kdialogbase.h>
31 35
32namespace KABC { 36namespace KABC {
33class Geo; 37class Geo;
34} 38}
35 39
36class GeoMapWidget; 40class GeoMapWidget;
37 41
38class KComboBox; 42class KComboBox;
39class KDoubleSpinBox; 43class KDoubleSpinBox;
40 44
41class QCheckBox; 45class QCheckBox;
42class QLabel; 46class QLabel;
43class QSpinBox; 47class QSpinBox;
44class QPushButton; 48class QPushButton;
45 49
46typedef struct { 50typedef struct {
47 double latitude; 51 double latitude;
48 double longitude; 52 double longitude;
49 QString country; 53 QString country;
50} GeoData; 54} GeoData;
51 55
52class GeoWidget : public QWidget 56class GeoWidget : public QWidget
53{ 57{
54 Q_OBJECT 58 Q_OBJECT
55 59
56 public: 60 public:
57 GeoWidget( QWidget *parent, const char *name = 0 ); 61 GeoWidget( QWidget *parent, const char *name = 0 );
58 ~GeoWidget(); 62 ~GeoWidget();
59 63
60 /** 64 /**
61 Sets the geo object. 65 Sets the geo object.
62 */ 66 */
63 void setGeo( const KABC::Geo &geo ); 67 void setGeo( const KABC::Geo &geo );
64 68
65 /** 69 /**
66 Returns a geo object. 70 Returns a geo object.
67 */ 71 */
68 KABC::Geo geo() const; 72 KABC::Geo geo() const;
69 73
70 signals: 74 signals:
71 void changed(); 75 void changed();
72 76
73 private slots: 77 private slots:
74 void editGeoData(); 78 void editGeoData();
75 79
76 private: 80 private:
77 KDoubleSpinBox *mLatitudeBox; 81 KDoubleSpinBox *mLatitudeBox;
78 KDoubleSpinBox *mLongitudeBox; 82 KDoubleSpinBox *mLongitudeBox;
79 83
80 QCheckBox *mGeoIsValid; 84 QCheckBox *mGeoIsValid;
81 QPushButton *mExtendedButton; 85 QPushButton *mExtendedButton;
82}; 86};
83 87
84class GeoDialog : public KDialogBase 88class GeoDialog : public KDialogBase
85{ 89{
86 Q_OBJECT 90 Q_OBJECT
87 91
88 public: 92 public:
89 GeoDialog( QWidget *parent, const char *name = 0 ); 93 GeoDialog( QWidget *parent, const char *name = 0 );
90 ~GeoDialog(); 94 ~GeoDialog();
91 95
92 void setLatitude( double latitude ); 96 void setLatitude( double latitude );
93 double latitude() const; 97 double latitude() const;
94 98
95 void setLongitude( double longitude ); 99 void setLongitude( double longitude );
96 double longitude() const; 100 double longitude() const;
97 101
98 private slots: 102 private slots:
99 void updateInputs(); 103 void updateInputs();
100 104
101 void sexagesimalInputChanged(); 105 void sexagesimalInputChanged();
102 void geoMapChanged(); 106 void geoMapChanged();
103 void cityInputChanged(); 107 void cityInputChanged();
104 108
105 private: 109 private:
106 void loadCityList(); 110 void loadCityList();
107 double calculateCoordinate( const QString& ); 111 double calculateCoordinate( const QString& );
108 int nearestCity( double, double ); 112 int nearestCity( double, double );
109 113
110 GeoMapWidget *mMapWidget; 114 GeoMapWidget *mMapWidget;
111 KComboBox *mCityCombo; 115 KComboBox *mCityCombo;
112 116
113 QSpinBox *mLatDegrees; 117 QSpinBox *mLatDegrees;
114 QSpinBox *mLatMinutes; 118 QSpinBox *mLatMinutes;
115 QSpinBox *mLatSeconds; 119 QSpinBox *mLatSeconds;
116 KComboBox *mLatDirection; 120 KComboBox *mLatDirection;
117 121
118 QSpinBox *mLongDegrees; 122 QSpinBox *mLongDegrees;
119 QSpinBox *mLongMinutes; 123 QSpinBox *mLongMinutes;
120 QSpinBox *mLongSeconds; 124 QSpinBox *mLongSeconds;
121 KComboBox *mLongDirection; 125 KComboBox *mLongDirection;
122 126
123 double mLatitude; 127 double mLatitude;
124 double mLongitude; 128 double mLongitude;
125 QMap<QString, GeoData> mGeoDataMap; 129 QMap<QString, GeoData> mGeoDataMap;
126 bool mUpdateSexagesimalInput; 130 bool mUpdateSexagesimalInput;
127}; 131};
128 132
129class GeoMapWidget : public QWidget 133class GeoMapWidget : public QWidget
130{ 134{
131 Q_OBJECT 135 Q_OBJECT
132 136
133 public: 137 public:
134 GeoMapWidget( QWidget *parent, const char *name = 0 ); 138 GeoMapWidget( QWidget *parent, const char *name = 0 );
135 ~GeoMapWidget(); 139 ~GeoMapWidget();
136 140
137 void setLatitude( double latitude ); 141 void setLatitude( double latitude );
138 double latitude()const; 142 double latitude()const;
139 143
140 void setLongitude( double longitude ); 144 void setLongitude( double longitude );
141 double longitude()const; 145 double longitude()const;
142 146
143 signals: 147 signals:
144 void changed(); 148 void changed();
145 149
146 protected: 150 protected:
147 virtual void mousePressEvent( QMouseEvent* ); 151 virtual void mousePressEvent( QMouseEvent* );
148 virtual void paintEvent( QPaintEvent* ); 152 virtual void paintEvent( QPaintEvent* );
149 153
150 private: 154 private:
151 double mLatitude; 155 double mLatitude;
152 double mLongitude; 156 double mLongitude;
153}; 157};
154 158
155#endif 159#endif