1
/***************************************************************************
2
* Copyright (C) 2005 by Tim Sutton *
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 *
7
* the Free Software Foundation; either version 2 of the License, or *
8
* (at your option) any later version. *
9
***************************************************************************/
10
#ifndef QGSPROJECTIONSELECTOR_H
11
#define QGSPROJECTIONSELECTOR_H
14
#include "qgsprojectionselectorbase.h"
16
#include "qgsprojectionselectorbase.uic.h"
21
#include <qlistview.h>
27
class QgsProjectionSelector: public QgsProjectionSelectorBase
31
QgsProjectionSelector( QWidget* parent , const char* name ,WFlags fl =0 );
32
~QgsProjectionSelector();
33
//! Populate the proj tree view with user defined projection names...
34
void getUserProjList();
35
//! Populate the proj tree view with system projection names...
37
void updateProjAndEllipsoidAcronyms(int theSrsid,QString theProj4String);
39
* \brief Make the string safe for use in SQL statements.
40
* This involves escaping single quotes, double quotes, backslashes,
41
* and optionally, percentage symbols. Percentage symbols are used
42
* as wildcards sometimes and so when using the string as part of the
43
* LIKE phrase of a select statement, should be escaped.
44
* \arg const QString in The input string to make safe.
45
* \return The string made safe for SQL statements.
47
const QString stringSQLSafe(const QString theSQL);
50
void setSelectedSRSName(QString theSRSName);
51
QString getSelectedName();
52
void setSelectedSRSID(long theSRSID);
53
QString getCurrentProj4String();
54
long getCurrentSRID(); //posgis style projection identifier
55
long getCurrentSRSID();//qgis projection identfier
56
void pbnFind_clicked();
60
// List view nodes for the tree view of projections
61
//! User defined projections node
62
QListViewItem *mUserProjList;
64
QListViewItem *mGeoList;
66
QListViewItem *mProjList;
67
//! Users custom coordinate system file
68
QString mCustomCsFile;
69
//! File name of the sqlite3 database
70
QString mSrsDatabaseFileName;
72
/**private handler for when user selects a cs
73
*it will cause wktSelected and sridSelected events to be spawned
75
void coordinateSystemSelected(QListViewItem*);
77
* Utility method used in conjunction with name based searching tool
79
long getLargestSRSIDMatch(QString theSql);
81
void sridSelected(QString theSRID);
82
//! Refresh any listening canvases
84
//! Let listeners know if find has focus so they can adjust the default button
85
void searchBoxHasFocus(bool);