• Skip to content
  • Skip to link menu
KDE 4.8 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • KDE Home
  • Contact Us
 

akonadi

geoeditwidget.h
00001 /*
00002     This file is part of Akonadi Contact.
00003 
00004     Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
00005 
00006     This library is free software; you can redistribute it and/or modify it
00007     under the terms of the GNU Library General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or (at your
00009     option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful, but WITHOUT
00012     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00013     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00014     License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public License
00017     along with this library; see the file COPYING.LIB.  If not, write to the
00018     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00019     02110-1301, USA.
00020 */
00021 
00022 #ifndef GEOEDITWIDGET_H
00023 #define GEOEDITWIDGET_H
00024 
00025 #include <kabc/geo.h>
00026 #include <kdialog.h>
00027 
00028 #include <QtGui/QWidget>
00029 
00030 namespace KABC
00031 {
00032 class Addressee;
00033 }
00034 
00035 class QDoubleSpinBox;
00036 class QLabel;
00037 class QPushButton;
00038 class QSpinBox;
00039 
00040 class KComboBox;
00041 
00042 class GeoMapWidget;
00043 
00044 class GeoEditWidget : public QWidget
00045 {
00046   Q_OBJECT
00047 
00048   public:
00049     GeoEditWidget( QWidget *parent = 0 );
00050     ~GeoEditWidget();
00051 
00052     void loadContact( const KABC::Addressee &contact );
00053     void storeContact( KABC::Addressee &contact ) const;
00054 
00055     void setReadOnly( bool readOnly );
00056 
00057   private Q_SLOTS:
00058     void changeClicked();
00059 
00060   private:
00061     void updateView();
00062 
00063     GeoMapWidget *mMap;
00064     QLabel *mLatitudeLabel;
00065     QLabel *mLongitudeLabel;
00066     QPushButton *mChangeButton;
00067     KABC::Geo mCoordinates;
00068     bool mReadOnly;
00069 };
00070 
00071 class GeoDialog : public KDialog
00072 {
00073   Q_OBJECT
00074 
00075   public:
00076     GeoDialog( const KABC::Geo &coordinates, QWidget *parent );
00077 
00078     KABC::Geo coordinates() const;
00079 
00080   private:
00081     enum ExceptType {
00082       ExceptNone = 0,
00083       ExceptCity = 1,
00084       ExceptSexagesimal = 2,
00085       ExceptDecimal = 4
00086     };
00087 
00088   private Q_SLOTS:
00089     void updateInputs( ExceptType type = ExceptNone );
00090 
00091     void decimalInputChanged();
00092     void sexagesimalInputChanged();
00093     void cityInputChanged();
00094 
00095   private:
00096     void loadCityList();
00097     int nearestCity( double, double ) const;
00098 
00099     typedef struct {
00100       double latitude;
00101       double longitude;
00102       QString country;
00103     } GeoData;
00104 
00105     KComboBox *mCityCombo;
00106 
00107     QDoubleSpinBox *mLatitude;
00108     QDoubleSpinBox *mLongitude;
00109 
00110     QSpinBox *mLatDegrees;
00111     QSpinBox *mLatMinutes;
00112     QSpinBox *mLatSeconds;
00113     KComboBox *mLatDirection;
00114 
00115     QSpinBox *mLongDegrees;
00116     QSpinBox *mLongMinutes;
00117     QSpinBox *mLongSeconds;
00118     KComboBox *mLongDirection;
00119 
00120     KABC::Geo mCoordinates;
00121     QMap<QString, GeoData> mGeoDataMap;
00122     bool mUpdateSexagesimalInput;
00123 };
00124 
00125 #endif

akonadi

Skip menu "akonadi"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Modules
  • Related Pages

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • 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
Generated for KDE-PIM Libraries by doxygen 1.7.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal