Marble

EditPlacemarkDialog.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2014 Calin Cruceru <crucerucalincristian@gmail.com>
4//
5
6#ifndef EDITPLACEMARKDIALOG_H
7#define EDITPLACEMARKDIALOG_H
8
9#include "marble_export.h"
10
11#include <QDialog>
12
13namespace Marble
14{
15
16class GeoDataFeature;
17class GeoDataPlacemark;
18class OsmPlacemarkData;
19
20/**
21 * @brief The EditPlacemarkDialog class deals with customizing placemarks.
22 */
23class MARBLE_EXPORT EditPlacemarkDialog : public QDialog
24{
25 Q_OBJECT
26
27public:
28 EditPlacemarkDialog(GeoDataPlacemark *placemark, const QHash<qint64, OsmPlacemarkData> *relations = nullptr, QWidget *parent = nullptr);
29 ~EditPlacemarkDialog() override;
30
31 /**
32 * @brief setLabelColor tells the dialog what the label color is
33 */
34 void setLabelColor(const QColor &color);
35
36 /**
37 * @brief idFilter gets filter for id of placemark
38 * @return QStringList of ids which could not be used as id.
39 */
40 QStringList idFilter() const;
41
42 /**
43 * @brief targetIds gets ids which could be target of placemark.
44 * @return QStringList of ids which could be target of placemark.
45 */
46 QStringList targetIds() const;
47
48 /**
49 * @brief isTargetIdFieldVisible tells if targetId field is shown.
50 */
51 bool isTargetIdFieldVisible() const;
52
53 /**
54 * @brief isIdFieldVisible tells if targetId field is shown.
55 */
56 bool isIdFieldVisible() const;
57
58public Q_SLOTS:
59 /**
60 * @brief updateDialogFields is connected to a signal from AnnotatePlugin in order
61 * to update some fields in the dialog as the user interacts directly with the text
62 * annotation item.
63 */
64 void updateDialogFields();
65
66 /**
67 * @brief setIdFilter sets filter for id of placemark.
68 * @param filter QStringList with ids which could not be used as id.
69 */
70 void setIdFilter(const QStringList &filter);
71
72 /**
73 * @brief setTargetIds sets ids which could be target of placemark.
74 * @param targetIds QStringList with ids which could be target of placemark.
75 */
76 void setTargetIds(const QStringList &targetIds);
77
78 /**
79 * @brief setTargetIdFieldVisible tells the dialog whether targetId field should be shown.
80 */
81 void setTargetIdFieldVisible(bool visible);
82
83 /**
84 * @brief setIdFieldVisible tells the dialog whether id field should be shown.
85 */
86 void setIdFieldVisible(bool visible);
87
88 /**
89 * @brief isReadOnly tells whether the data from input fields is protected
90 */
91 bool isReadOnly() const;
92
93 /**
94 * @brief Protecting data from input fields changes
95 */
96 void setReadOnly(bool state);
97
98private Q_SLOTS:
99
100 /**
101 * @brief checkFields shows warnings if there are important fields which don't hold
102 * accurate information.
103 */
104 void checkFields();
105
106 /**
107 * @brief updateTextAnnotation is the main slot which synchronizes the information
108 * from the dialog with the way the text annotation item is painted.
109 */
110 void updateTextAnnotation();
111
112 /**
113 * @brief updateLabelDialog The color chooser for label is represented as a push
114 * button with a filled pixmap as its icon. This slot updates the color fill of this
115 * pixmap.
116 */
117 void updateLabelDialog(const QColor &color);
118
119 /**
120 * @brief updateIconDialog The same as above, but for icons.
121 * FIXME: This is not functional ATM - we need some mechanism for customizing existing
122 * icons.
123 */
124 void updateIconDialog(const QColor &color);
125
126 /**
127 * @brief updatePlacemarkAltitude changes an actual elevation value of placemark instance
128 * according to the value/unit of elevation widget spin box representing it
129 */
130 void updatePlacemarkAltitude();
131
132 /**
133 * @brief restoreInitial restores the dialog's previous settings if the dialog closes with
134 * a zero return value.
135 */
136 void restoreInitial(int result);
137
138 /**
139 * @brief toogleDescriptionEditMode toggles edit mode for description field.
140 */
141
142Q_SIGNALS:
143 /**
144 * @brief textAnnotationUpdated signals that some property of the PlacemarkTextAnnotation
145 * instance has changed.
146 * @param feature The instance's placemark.
147 */
149
150 /**
151 * @brief relationCreated signals the annotate plugin that a new relation has been
152 * created( or modified ) within the relation editor
153 * @param relation the relation's osmData
154 */
155 void relationCreated(const OsmPlacemarkData &relation);
156
157private:
158 class Private;
159 Private *const d;
160};
161
162}
163
164#endif
The EditPlacemarkDialog class deals with customizing placemarks.
void relationCreated(const OsmPlacemarkData &relation)
relationCreated signals the annotate plugin that a new relation has been created( or modified ) withi...
void textAnnotationUpdated(GeoDataFeature *feature)
toogleDescriptionEditMode toggles edit mode for description field.
A base class for all geodata features.
a class representing a point of interest on the map
This class is used to encapsulate the osm data fields kept within a placemark's extendedData.
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 8 2024 12:02:43 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.