~ubuntu-branches/ubuntu/quantal/qgis/quantal

« back to all changes in this revision

Viewing changes to widgets/projectionselector/qgsprojectionselector.h

  • Committer: Bazaar Package Importer
  • Author(s): Steve Halasz
  • Date: 2005-11-05 16:04:45 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20051105160445-l0g4isz5bc9yehet
Tags: 0.7.4-1
* New upstream release
* Build GRASS support in qgis-plugin-grass package (Closes: #248649)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   Copyright (C) 2005 by Tim Sutton                                      *
 
3
 *   tim@linfiniti.com                                                     *
 
4
 *                                                                         *
 
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
 
12
 
 
13
#ifdef WIN32
 
14
#include "qgsprojectionselectorbase.h"
 
15
#else
 
16
#include "qgsprojectionselectorbase.uic.h"
 
17
#endif
 
18
 
 
19
#include <qgis.h>
 
20
#include <qstring.h>
 
21
#include <qlistview.h>
 
22
 
 
23
 
 
24
/**
 
25
  @author Tim Sutton
 
26
  */
 
27
class QgsProjectionSelector: public QgsProjectionSelectorBase
 
28
{
 
29
  Q_OBJECT
 
30
    public:
 
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...
 
36
      void getProjList();
 
37
      void updateProjAndEllipsoidAcronyms(int theSrsid,QString theProj4String);
 
38
      /*!
 
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.
 
46
       */
 
47
      const QString stringSQLSafe(const QString theSQL);
 
48
 
 
49
      public slots:
 
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();
 
57
 
 
58
    private:
 
59
 
 
60
      // List view nodes for the tree view of projections
 
61
      //! User defined projections node
 
62
      QListViewItem *mUserProjList;
 
63
      //! GEOGCS node
 
64
      QListViewItem *mGeoList;
 
65
      //! PROJCS node
 
66
      QListViewItem *mProjList;
 
67
      //! Users custom coordinate system file
 
68
      QString mCustomCsFile;
 
69
      //! File name of the sqlite3 database
 
70
      QString mSrsDatabaseFileName;
 
71
 
 
72
      /**private handler for when user selects a cs
 
73
       *it will cause wktSelected and sridSelected events to be spawned
 
74
       */
 
75
      void coordinateSystemSelected(QListViewItem*);
 
76
      /** 
 
77
       * Utility method used in conjunction with name based searching tool 
 
78
       */
 
79
      long getLargestSRSIDMatch(QString theSql);
 
80
signals:
 
81
      void sridSelected(QString theSRID);
 
82
      //! Refresh any listening canvases
 
83
      void refresh();
 
84
      //! Let listeners know if find has focus so they can adjust the default button
 
85
      void searchBoxHasFocus(bool);
 
86
};
 
87
 
 
88
#endif