File indexing completed on 2024-05-05 03:50:38

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2014 Calin Cruceru <crucerucalincristian@gmail.com>
0004 //
0005 
0006 #ifndef MARBLE_EDITPOLYGONDIALOG_H
0007 #define MARBLE_EDITPOLYGONDIALOG_H
0008 
0009 #include <QDialog>
0010 #include <QColor>
0011 
0012 #include "MarbleGlobal.h"
0013 
0014 
0015 namespace Marble {
0016 
0017 class GeoDataPlacemark;
0018 class GeoDataCoordinates;
0019 class GeoDataFeature;
0020 class OsmPlacemarkData;
0021 
0022 /**
0023  * @brief As it name says by itself, this class is used to show a couple of
0024  * editing options for a polygon. So far there are only a few customization
0025  * options, such as lines width, lines/area color, lines/area opacity.
0026  */
0027 class EditPolygonDialog : public QDialog
0028 {
0029     Q_OBJECT
0030 
0031 public:
0032     EditPolygonDialog( GeoDataPlacemark *placemark,
0033                        const QHash<qint64, OsmPlacemarkData> *relations = nullptr,
0034                        QWidget *parent = nullptr );
0035     ~EditPolygonDialog() override;
0036 
0037 public Q_SLOTS:
0038     void handleAddingNode( const GeoDataCoordinates &node );
0039     void handleItemMoving( GeoDataPlacemark *item );
0040     void handleChangingStyle();
0041     void updatePolygon();
0042 
0043 Q_SIGNALS:
0044     void polygonUpdated( GeoDataFeature *feature );
0045 
0046     /**
0047      * @brief relationCreated signals the annotate plugin that a new relation has been
0048      * created( or modified ) within the relation editor
0049      * @param relation the relation's osmData
0050      */
0051     void relationCreated( const OsmPlacemarkData &relation );
0052 
0053 private Q_SLOTS:
0054     void updateLinesDialog( const QColor &color );
0055     void updatePolyDialog( const QColor &color );
0056     void checkFields();
0057     void restoreInitial( int result );
0058 
0059 private:
0060     class Private;
0061     Private * const d;
0062 };
0063 
0064 }
0065 
0066 #endif