/usr/include/qgis/qgsextentgroupbox.h is in libqgis-dev 2.18.17+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | /***************************************************************************
qgsextentgroupbox.h
---------------------
begin : March 2014
copyright : (C) 2014 by Martin Dobias
email : wonder dot sk at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSEXTENTGROUPBOX_H
#define QGSEXTENTGROUPBOX_H
#include "qgscollapsiblegroupbox.h"
#include "ui_qgsextentgroupboxwidget.h"
#include "qgscoordinatereferencesystem.h"
#include "qgsrectangle.h"
class QgsCoordinateReferenceSystem;
/** \ingroup gui
* Collapsible group box for configuration of extent, typically for a save operation.
*
* Besides allowing the user to enter the extent manually, it comes with options to use
* original extent or extent defined by the current view in map canvas.
*
* When using the widget, make sure to call setOriginalExtent(), setCurrentExtent() and setOutputCrs() during initialization.
*
* @note added in 2.4
*/
class GUI_EXPORT QgsExtentGroupBox : public QgsCollapsibleGroupBox, private Ui::QgsExtentGroupBoxWidget
{
Q_OBJECT
Q_PROPERTY( QString titleBase READ titleBase WRITE setTitleBase )
public:
explicit QgsExtentGroupBox( QWidget* parent = nullptr );
enum ExtentState
{
OriginalExtent, //!< layer's extent
CurrentExtent, //!< map canvas extent
UserExtent, //!< extent manually entered/modified by the user
};
//! Setup original extent - should be called as part of initialization
void setOriginalExtent( const QgsRectangle& originalExtent, const QgsCoordinateReferenceSystem& originalCrs );
QgsRectangle originalExtent() const { return mOriginalExtent; }
const QgsCoordinateReferenceSystem& originalCrs() const { return mOriginalCrs; }
//! Setup current extent - should be called as part of initialization (or whenever current extent changes)
void setCurrentExtent( const QgsRectangle& currentExtent, const QgsCoordinateReferenceSystem& currentCrs );
QgsRectangle currentExtent() const { return mCurrentExtent; }
const QgsCoordinateReferenceSystem& currentCrs() const { return mCurrentCrs; }
//! Set the output CRS - may need to be used for transformation from original/current extent.
//! Should be called as part of initialization and whenever the the output CRS is changed
void setOutputCrs( const QgsCoordinateReferenceSystem& outputCrs );
//! Get the resulting extent - in output CRS coordinates
QgsRectangle outputExtent() const;
ExtentState extentState() const { return mExtentState; }
//! Set base part of title of the group box (will be appended with extent state)
//! @note added in 2.12
void setTitleBase( const QString& title );
//! Set base part of title of the group box (will be appended with extent state)
//! @note added in 2.12
QString titleBase() const;
public slots:
//! set output extent to be the same as original extent (may be transformed to output CRS)
void setOutputExtentFromOriginal();
//! set output extent to be the same as current extent (may be transformed to output CRS)
void setOutputExtentFromCurrent();
//! set output extent to custom extent (may be transformed to output CRS)
void setOutputExtentFromUser( const QgsRectangle& extent, const QgsCoordinateReferenceSystem& crs );
signals:
//! emitted when extent is changed
void extentChanged( const QgsRectangle& r );
protected slots:
void on_mXMinLineEdit_textEdited( const QString & ) { setOutputExtentFromLineEdit(); }
void on_mXMaxLineEdit_textEdited( const QString & ) { setOutputExtentFromLineEdit(); }
void on_mYMinLineEdit_textEdited( const QString & ) { setOutputExtentFromLineEdit(); }
void on_mYMaxLineEdit_textEdited( const QString & ) { setOutputExtentFromLineEdit(); }
void groupBoxClicked();
protected:
void setOutputExtent( const QgsRectangle& r, const QgsCoordinateReferenceSystem& srcCrs, ExtentState state );
void setOutputExtentFromLineEdit();
void updateTitle();
//! Base part of the title used for the extent
QString mTitleBase;
ExtentState mExtentState;
QgsCoordinateReferenceSystem mOutputCrs;
QgsRectangle mCurrentExtent;
QgsCoordinateReferenceSystem mCurrentCrs;
QgsRectangle mOriginalExtent;
QgsCoordinateReferenceSystem mOriginalCrs;
};
#endif // QGSEXTENTGROUPBOX_H
|