1 /* 2 * Copyright 2012, 2013 Thomas Schöps 3 * 4 * This file is part of OpenOrienteering. 5 * 6 * OpenOrienteering is free software: you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation, either version 3 of the License, or 9 * (at your option) any later version. 10 * 11 * OpenOrienteering is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with OpenOrienteering. If not, see <http://www.gnu.org/licenses/>. 18 */ 19 20 21 #ifndef OPENORIENTEERING_MAP_DIALOG_ROTATE_H 22 #define OPENORIENTEERING_MAP_DIALOG_ROTATE_H 23 24 #include <QDialog> 25 #include <QObject> 26 27 class QDoubleSpinBox; 28 class QCheckBox; 29 class QRadioButton; 30 class QWidget; 31 32 namespace OpenOrienteering { 33 34 class Map; 35 36 37 /** 38 * Dialog for rotating the whole map around a point. 39 */ 40 class RotateMapDialog : public QDialog 41 { 42 Q_OBJECT 43 public: 44 /** Creates a new RotateMapDialog. */ 45 RotateMapDialog(QWidget* parent, Map* map); 46 47 /** Sets the rotation angle in degrees in the corresponding widget. */ 48 void setRotationDegrees(double rotation); 49 /** Enables the setting to rotate around the georeferencing reference point. */ 50 void setRotateAroundGeorefRefPoint(); 51 /** Checks or unchecks the setting to adjust the georeferencing declination. */ 52 void setAdjustDeclination(bool adjust); 53 /** Sets the visibility of the setting to adjust the georeferencing declination. */ 54 void showAdjustDeclination(bool show); 55 56 private slots: 57 void updateWidgets(); 58 void okClicked(); 59 60 private: 61 QDoubleSpinBox* rotation_edit; 62 QRadioButton* center_origin_radio; 63 QRadioButton* center_georef_radio; 64 QRadioButton* center_other_radio; 65 QDoubleSpinBox* other_x_edit; 66 QDoubleSpinBox* other_y_edit; 67 68 QCheckBox* adjust_georeferencing_check; 69 QCheckBox* adjust_declination_check; 70 QCheckBox* adjust_templates_check; 71 72 Map* map; 73 }; 74 75 76 } // namespace OpenOrienteering 77 78 #endif 79