QGIS API Documentation  2.99.0-Master (13a3f2f)
qgsextentgroupbox.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsextentgroupbox.h
3  ---------------------
4  begin : March 2014
5  copyright : (C) 2014 by Martin Dobias
6  email : wonder dot sk at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 #ifndef QGSEXTENTGROUPBOX_H
16 #define QGSEXTENTGROUPBOX_H
17 
18 #include "qgscollapsiblegroupbox.h"
19 #include "qgis.h"
20 
21 #include "ui_qgsextentgroupboxwidget.h"
22 
24 #include "qgsrectangle.h"
25 #include "qgis_gui.h"
26 
28 
39 class GUI_EXPORT QgsExtentGroupBox : public QgsCollapsibleGroupBox, private Ui::QgsExtentGroupBoxWidget
40 {
41  Q_OBJECT
42  Q_PROPERTY( QString titleBase READ titleBase WRITE setTitleBase )
43 
44  public:
45  explicit QgsExtentGroupBox( QWidget *parent SIP_TRANSFERTHIS = 0 );
46 
48  {
52  };
53 
55  void setOriginalExtent( const QgsRectangle &originalExtent, const QgsCoordinateReferenceSystem &originalCrs );
56 
57  QgsRectangle originalExtent() const { return mOriginalExtent; }
58  const QgsCoordinateReferenceSystem &originalCrs() const { return mOriginalCrs; }
59 
61  void setCurrentExtent( const QgsRectangle &currentExtent, const QgsCoordinateReferenceSystem &currentCrs );
62 
63  QgsRectangle currentExtent() const { return mCurrentExtent; }
64  const QgsCoordinateReferenceSystem &currentCrs() const { return mCurrentCrs; }
65 
68  void setOutputCrs( const QgsCoordinateReferenceSystem &outputCrs );
69 
71  QgsRectangle outputExtent() const;
72 
73  QgsExtentGroupBox::ExtentState extentState() const { return mExtentState; }
74 
77  void setTitleBase( const QString &title );
80  QString titleBase() const;
81 
82  public slots:
84  void setOutputExtentFromOriginal();
85 
87  void setOutputExtentFromCurrent();
88 
90  void setOutputExtentFromUser( const QgsRectangle &extent, const QgsCoordinateReferenceSystem &crs );
91 
92  signals:
94  void extentChanged( const QgsRectangle &r );
95 
96  protected slots:
97 
98  void on_mXMinLineEdit_textEdited( const QString & ) { setOutputExtentFromLineEdit(); }
99  void on_mXMaxLineEdit_textEdited( const QString & ) { setOutputExtentFromLineEdit(); }
100  void on_mYMinLineEdit_textEdited( const QString & ) { setOutputExtentFromLineEdit(); }
101  void on_mYMaxLineEdit_textEdited( const QString & ) { setOutputExtentFromLineEdit(); }
102 
103  void groupBoxClicked();
104 
105  protected:
106  void setOutputExtent( const QgsRectangle &r, const QgsCoordinateReferenceSystem &srcCrs, QgsExtentGroupBox::ExtentState state );
107  void setOutputExtentFromLineEdit();
108  void updateTitle();
109 
111  QString mTitleBase;
112 
114 
116 
119 
122 };
123 
124 #endif // QGSEXTENTGROUPBOX_H
void on_mYMaxLineEdit_textEdited(const QString &)
Extent manually entered/modified by the user.
ExtentState mExtentState
A rectangle specified with double values.
Definition: qgsrectangle.h:38
QgsRectangle originalExtent() const
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:34
void on_mXMinLineEdit_textEdited(const QString &)
A groupbox that collapses/expands when toggled and can save its collapsed and checked states...
QgsCoordinateReferenceSystem mOutputCrs
QgsCoordinateReferenceSystem mOriginalCrs
QString mTitleBase
Base part of the title used for the extent.
QgsRectangle mCurrentExtent
const QgsCoordinateReferenceSystem & currentCrs() const
void on_mXMaxLineEdit_textEdited(const QString &)
QgsRectangle currentExtent() const
const QgsCoordinateReferenceSystem & originalCrs() const
This class represents a coordinate reference system (CRS).
QgsExtentGroupBox::ExtentState extentState() const
QgsRectangle mOriginalExtent
QgsCoordinateReferenceSystem mCurrentCrs
void on_mYMinLineEdit_textEdited(const QString &)
Collapsible group box for configuration of extent, typically for a save operation.