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 
41 // Forward declaraion
42 namespace Ui { class SRSManagerDialogForm; }
43 
44 namespace te
45 {
46  namespace qt
47  {
48  namespace widgets
49  {
50  class SRSDialog;
51 
52  /*!
53  \class SRSManagerDialog
54 
55  \brief A dialog used to build a SRSManagerDialog element.
56 
57  \ingroup widgets
58  */
59  class TEQTWIDGETSEXPORT SRSManagerDialog : public QDialog
60  {
61  Q_OBJECT
62 
63  public:
64 
65  /*!
66  \brief Constructs a basic dialog which is a child of parent, with widget flags set to f.
67  \param parent Pointer to the dialog parent.
68  \param f The dialog flags.
69  */
70  SRSManagerDialog( QWidget* parent = 0, Qt::WindowFlags f = 0);
71 
72  /*!
73  \brief Destructor.
74  */
76 
77  /*!
78  \brief Returns the selected SRS in the window.
79  \return a const pair <srid,auth_name> reference, with an SRS identification given by an authority. If the user doesn't
80  select a SRS the pair will have a TE_UNKNOW_SRS and an empty auth_name.
81  */
82  const std::pair<int, std::string>& getSelectedSRS() const;
83 
84  /*!
85  \brief Pops up a modal SRS selector dialog with the given window title, lets the user select a SRS,
86  and returns that SRS.
87  \param parent Dialog parent.
88  \param title Dialog title.
89  \return a pair <srid,auth_name>, with an SRS identification given by an authority. If the user doesn't
90  select a SRS the pair will have a TE_UNKNOW_SRS and an empty auth_name.
91  */
92  static std::pair<int, std::string> getSRS(QWidget* parent, const QString& title = "");
93 
94 
95  protected slots:
96 
97  void onSRSTreeWidgetItemClicked(QTreeWidgetItem* , int);
98  void onOkPushButtonClicked();
99  void onCancelPushButtonClicked();
100  void onHelpPushButtonClicked();
101  void onSearchLineEditTextChanged(const QString& text);
102  void onSRSRecentTableWidgetItemClicked(QTableWidgetItem*);
103  void onAddSRSPushButtonClicked();
104  void onEditSRSPushButtonClicked();
105  void onRemoveSRSPushButtonClicked();
106 
107  private:
108 
109  void filter(const QList<QTreeWidgetItem*>& items);
110 
111  Ui::SRSManagerDialogForm* m_ui; //!< Dialog form.
112  std::pair<int, std::string> m_selSrsId; //!< The selected SRS
113  QStringList m_recentSRS;
114  };
115  } // end namespace widgets
116  } // end namespace qt
117 } // end namespace te
118 
119 #endif // __TERRALIB_SRS_INTERNAL_QT_SRSMANAGERDIALOG_H
std::pair< int, std::string > m_selSrsId
The selected SRS.
URI C++ Library.
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63
A dialog used to build a SRSManagerDialog element.
Ui::SRSManagerDialogForm * m_ui
Dialog form.