Loading...
Searching...
No Matches
SRSManagerDialog.h
Go to the documentation of this file.
1/* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2
3 This file is part of the TerraLib - a Framework for building GIS enabled applications.
4
5 TerraLib is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 TerraLib is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with TerraLib. See COPYING. If not, write to
17 TerraLib Team at <terralib-team@terralib.org>.
18 */
19
20/*!
21 \file terralib/srs/qt/SRSManagerDialog.h
22
23 \brief A dialog used to manage Spatial Reference Systems for coordinates.
24 */
25
26#ifndef __TERRALIB_SRS_INTERNAL_QT_SRSMANAGERDIALOG_H
27#define __TERRALIB_SRS_INTERNAL_QT_SRSMANAGERDIALOG_H
28
29// TerraLib
30#include "../Config.h"
31
32// Qt
33#include <QDialog>
34#include <QStringList>
35#include <QTableWidgetItem>
36#include <QTreeWidgetItem>
37
38//STL
39#include <string>
40#include <list>
41
42// Forward declaraion
43namespace Ui { class SRSManagerDialogForm; }
44
45namespace te
46{
47 namespace qt
48 {
49 namespace widgets
50 {
51 class SRSDialog;
52
53 /*!
54 \class SRSManagerDialog
55
56 \brief A dialog used to build a SRSManagerDialog element.
57
58 \ingroup widgets
59 */
60 class TEQTWIDGETSEXPORT SRSManagerDialog : public QDialog
61 {
62 Q_OBJECT
63
64 public:
65
66 /*!
67 \brief Constructs a basic dialog which is a child of parent, with widget flags set to f.
68 \param parent Pointer to the dialog parent.
69 \param f The dialog flags.
70 */
71 SRSManagerDialog( QWidget* parent = 0, Qt::WindowFlags f = 0);
72
73 /*!
74 \brief Destructor.
75 */
77
78 /*!
79 \brief Returns the selected SRS in the window.
80 \return a const pair <srid,auth_name> reference, with an SRS identification given by an authority. If the user doesn't
81 select a SRS the pair will have a TE_UNKNOW_SRS and an empty auth_name.
82 */
83 const std::pair<int, std::string>& getSelectedSRS() const;
84
85 /*!
86 \brief Pops up a modal SRS selector dialog with the given window title, lets the user select a SRS,
87 and returns that SRS.
88 \param parent Dialog parent.
89 \param title Dialog title.
90 \return a pair <srid,auth_name>, with an SRS identification given by an authority. If the user doesn't
91 select a SRS the pair will have a TE_UNKNOW_SRS and an empty auth_name.
92 */
93 static std::pair<int, std::string> getSRS(QWidget* parent, const QString& title = "");
94
95
96 protected slots:
97
98 void onSRSTreeWidgetItemClicked(QTreeWidgetItem* , int);
102 void onSearchLineEditTextChanged(const QString& text);
103 void onSRSRecentTableWidgetItemClicked(QTableWidgetItem*);
107
108 protected :
109
111
112 private:
113
114 void filter(const QList<QTreeWidgetItem*>& items);
115
116 Ui::SRSManagerDialogForm* m_ui; //!< Dialog form.
117 std::pair<int, std::string> m_selSrsId; //!< The selected SRS
118
119 std::list< std::pair< int, std::string > > m_recentSRSList; //!< Recent SRSs [SRID,AUTH]
120 };
121 } // end namespace widgets
122 } // end namespace qt
123} // end namespace te
124
125#endif // __TERRALIB_SRS_INTERNAL_QT_SRSMANAGERDIALOG_H
A dialog used to build a SRSManagerDialog element.
void onSRSRecentTableWidgetItemClicked(QTableWidgetItem *)
const std::pair< int, std::string > & getSelectedSRS() const
Returns the selected SRS in the window.
void onSRSTreeWidgetItemClicked(QTreeWidgetItem *, int)
Ui::SRSManagerDialogForm * m_ui
Dialog form.
std::pair< int, std::string > m_selSrsId
The selected SRS.
SRSManagerDialog(QWidget *parent=0, Qt::WindowFlags f=0)
Constructs a basic dialog which is a child of parent, with widget flags set to f.
void filter(const QList< QTreeWidgetItem * > &items)
void onSearchLineEditTextChanged(const QString &text)
std::list< std::pair< int, std::string > > m_recentSRSList
Recent SRSs [SRID,AUTH].
static std::pair< int, std::string > getSRS(QWidget *parent, const QString &title="")
Pops up a modal SRS selector dialog with the given window title, lets the user select a SRS,...
TerraLib.
#define slots
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63