• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.9.3 API Reference
  • KDE Home
  • Contact Us
 

akonadi/contact

  • akonadi
  • contact
  • editor
geoeditwidget.h
1 /*
2  This file is part of Akonadi Contact.
3 
4  Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
5 
6  This library is free software; you can redistribute it and/or modify it
7  under the terms of the GNU Library General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or (at your
9  option) any later version.
10 
11  This library is distributed in the hope that it will be useful, but WITHOUT
12  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
14  License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to the
18  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  02110-1301, USA.
20 */
21 
22 #ifndef GEOEDITWIDGET_H
23 #define GEOEDITWIDGET_H
24 
25 #include <kabc/geo.h>
26 #include <kdialog.h>
27 
28 #include <QtGui/QWidget>
29 
30 namespace KABC
31 {
32 class Addressee;
33 }
34 
35 class QDoubleSpinBox;
36 class QLabel;
37 class QPushButton;
38 class QSpinBox;
39 
40 class KComboBox;
41 
42 class GeoMapWidget;
43 
44 class GeoEditWidget : public QWidget
45 {
46  Q_OBJECT
47 
48  public:
49  GeoEditWidget( QWidget *parent = 0 );
50  ~GeoEditWidget();
51 
52  void loadContact( const KABC::Addressee &contact );
53  void storeContact( KABC::Addressee &contact ) const;
54 
55  void setReadOnly( bool readOnly );
56 
57  private Q_SLOTS:
58  void changeClicked();
59 
60  private:
61  void updateView();
62 
63  GeoMapWidget *mMap;
64  QLabel *mLatitudeLabel;
65  QLabel *mLongitudeLabel;
66  QPushButton *mChangeButton;
67  KABC::Geo mCoordinates;
68  bool mReadOnly;
69 };
70 
71 class GeoDialog : public KDialog
72 {
73  Q_OBJECT
74 
75  public:
76  GeoDialog( const KABC::Geo &coordinates, QWidget *parent );
77 
78  KABC::Geo coordinates() const;
79 
80  private:
81  enum ExceptType {
82  ExceptNone = 0,
83  ExceptCity = 1,
84  ExceptSexagesimal = 2,
85  ExceptDecimal = 4
86  };
87 
88  private Q_SLOTS:
89  void updateInputs( ExceptType type = ExceptNone );
90 
91  void decimalInputChanged();
92  void sexagesimalInputChanged();
93  void cityInputChanged();
94 
95  private:
96  void loadCityList();
97  int nearestCity( double, double ) const;
98 
99  typedef struct {
100  double latitude;
101  double longitude;
102  QString country;
103  } GeoData;
104 
105  KComboBox *mCityCombo;
106 
107  QDoubleSpinBox *mLatitude;
108  QDoubleSpinBox *mLongitude;
109 
110  QSpinBox *mLatDegrees;
111  QSpinBox *mLatMinutes;
112  QSpinBox *mLatSeconds;
113  KComboBox *mLatDirection;
114 
115  QSpinBox *mLongDegrees;
116  QSpinBox *mLongMinutes;
117  QSpinBox *mLongSeconds;
118  KComboBox *mLongDirection;
119 
120  KABC::Geo mCoordinates;
121  QMap<QString, GeoData> mGeoDataMap;
122  bool mUpdateSexagesimalInput;
123 };
124 
125 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Wed Nov 28 2012 21:55:23 by doxygen 1.8.1.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akonadi/contact

Skip menu "akonadi/contact"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs-4.9.3 API Reference

Skip menu "kdepimlibs-4.9.3 API Reference"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal