Quantum GIS API Documentation  1.7.5-Wroclaw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
qgsprojectionselector.h
Go to the documentation of this file.
1 /***************************************************************************
2  * qgsprojectionselector.h *
3  * Copyright (C) 2005 by Tim Sutton *
4  * tim@linfiniti.com *
5  * *
6  * This program is free software; you can redistribute it and/or modify *
7  * it under the terms of the GNU General Public License as published by *
8  * the Free Software Foundation; either version 2 of the License, or *
9  * (at your option) any later version. *
10  ***************************************************************************/
11 #ifndef QGSCRSSELECTOR_H
12 #define QGSCRSSELECTOR_H
13 
14 #include <ui_qgsprojectionselectorbase.h>
15 
16 #include <QSet>
17 #include <QStringList>
18 
19 #include "qgis.h"
20 
21 class QResizeEvent;
22 
28 class GUI_EXPORT QgsProjectionSelector: public QWidget, private Ui::QgsProjectionSelectorBase
29 {
30  Q_OBJECT
31  public:
32  QgsProjectionSelector( QWidget* parent,
33  const char * name = "",
34  Qt::WFlags fl = 0 );
35 
37 
47  void loadUserCrsList( QSet<QString> * crsFilter = 0 );
48 
58  void loadCrsList( QSet<QString> * crsFilter = 0 );
59 
60 
70  const QString sqlSafeString( const QString theSQL );
71 
73  // @deprecated there are other authorities - use selectedAuthId()
74  Q_DECL_DEPRECATED long selectedEpsg();
75 
77  long selectedSrsid();
78 
80  QString selectedAuthId();
81 
82  public slots:
83  void setSelectedCrsName( QString theCRSName );
84 
85  QString selectedName();
86 
87  void setSelectedCrsId( long theCRSID );
88 
89  void setSelectedAuthId( QString authId );
90 
92  // @deprecated there are other authorities - so not always defined
93  Q_DECL_DEPRECATED void setSelectedEpsg( long epsg );
94 
95  QString selectedProj4String();
96 
98  long selectedPostgresSrId();
99 
101  long selectedCrsId();
102 
115  void setOgcWmsCrsFilter( QSet<QString> crsFilter );
116 
117  void on_pbnFind_clicked();
118  void on_lstRecent_currentItemChanged( QTreeWidgetItem *, QTreeWidgetItem * );
119  void on_cbxHideDeprecated_stateChanged();
120 
121  protected:
123  void showEvent( QShowEvent * theEvent );
124 
126  void resizeEvent( QResizeEvent * theEvent );
127 
128  private:
140  QString ogcWmsCrsFilterAsSqlExpression( QSet<QString> * crsFilter );
141 
152  void applySelection();
153 
159  QString getSelectedExpression( QString e );
160 
162  void showDBMissingWarning( const QString theFileName );
163  // List view nodes for the tree view of projections
165  QTreeWidgetItem *mUserProjList;
167  QTreeWidgetItem *mGeoList;
169  QTreeWidgetItem *mProjList;
170 
172  QString mCustomCsFile;
175 
179  long getLargestCRSIDMatch( QString theSql );
180 
182  void insertRecent( long theCrsId );
183 
186 
189 
192 
195 
198 
201 
204 
207 
210 
212  QSet<QString> mCrsFilter;
213 
215  QStringList mRecentProjections;
216 
218  void hideDeprecated( QTreeWidgetItem *item );
219 
220  private slots:
224  void coordinateSystemSelected( QTreeWidgetItem* );
225 
227  QStringList authorities();
228 
229  signals:
230  void sridSelected( QString theSRID );
232  void refresh();
234  void searchBoxHasFocus( bool );
235 };
236 
237 #endif