27 #include <kdialogbase.h>
29 #include "contacteditorwidget.h"
51 class GeoWidget : public KAB::ContactEditorWidget
57 GeoWidget( TDEABC::AddressBook *ab, TQWidget *parent, const char *name = 0 );
60 void loadContact( TDEABC::Addressee *addr );
61 void storeContact( TDEABC::Addressee *addr );
63 void setReadOnly( bool readOnly );
69 KDoubleSpinBox *mLatitudeBox;
70 KDoubleSpinBox *mLongitudeBox;
72 TQCheckBox *mGeoIsValid;
73 TQPushButton *mExtendedButton;
78 class GeoDialog : public KDialogBase
84 GeoDialog( TQWidget *parent, const char *name = 0 );
87 void setLatitude( double latitude );
88 double latitude() const;
90 void setLongitude( double longitude );
91 double longitude() const;
96 void sexagesimalInputChanged();
98 void cityInputChanged();
102 double calculateCoordinate( const TQString& ) const;
103 int nearestCity( double, double ) const;
105 GeoMapWidget *mMapWidget;
106 KComboBox *mCityCombo;
108 TQSpinBox *mLatDegrees;
109 TQSpinBox *mLatMinutes;
110 TQSpinBox *mLatSeconds;
111 KComboBox *mLatDirection;
113 TQSpinBox *mLongDegrees;
114 TQSpinBox *mLongMinutes;
115 TQSpinBox *mLongSeconds;
116 KComboBox *mLongDirection;
120 TQMap<TQString, GeoData> mGeoDataMap;
121 bool mUpdateSexagesimalInput;
124 class GeoMapWidget : public TQWidget
130 GeoMapWidget( TQWidget *parent, const char *name = 0 );
133 void setLatitude( double latitude );
134 double latitude() const;
136 void setLongitude( double longitude );
137 double longitude() const;
143 virtual void mousePressEvent( TQMouseEvent* );
144 virtual void paintEvent( TQPaintEvent* );
151 class GeoWidgetFactory : public KAB::ContactEditorWidgetFactory
154 KAB::ContactEditorWidget *createWidget( TDEABC::AddressBook *ab, TQWidget *parent, const char *name )
156 return new GeoWidget( ab, parent, name );
159 TQString pageIdentifier() const { return "misc"; }
|