Marble

RoutingInputWidget.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2010 Dennis Nienhüser <nienhueser@kde.org>
4//
5
6#ifndef MARBLE_ROUTINGINPUTWIDGET_H
7#define MARBLE_ROUTINGINPUTWIDGET_H
8
9#include "PositionProviderPluginInterface.h"
10
11#include <QWidget>
12
14
15namespace Marble
16{
17
18class RoutingInputWidgetPrivate;
19class GeoDataCoordinates;
20class GeoDataPlacemark;
21class MarbleModel;
22class MarblePlacemarkModel;
23
24/**
25 * Combines a line edit for input and a couple of buttons to let
26 * the user type in a search term, find according placemarks using
27 * the marble runner manager and store one of them as the current
28 * selection (target position)
29 */
31{
33
34public:
35 /** Constructor */
36 explicit RoutingInputWidget(MarbleModel *model, int index, QWidget *parent = nullptr);
37
38 /** Destructor */
39 ~RoutingInputWidget() override;
40
41 /**
42 * Returns true if the user has selected a valid geo position
43 * @see targetPosition
44 */
45 bool hasTargetPosition() const;
46
47 /**
48 * Returns the geoposition selected by the user, or a default
49 * constructed geoposition if hasTargetPosition returns false
50 * @see hasTargetPosition selectPlacemark
51 */
53
54 /**
55 * Returns the placemark model that contains search results
56 */
58
59 /**
60 * Returns false iff the input text is empty
61 */
62 bool hasInput() const;
63
64 /**
65 * Change the data index in the route request model
66 */
67 void setIndex(int index);
68
69 /**
70 * Remove target position and user input, if any
71 */
72 void clear();
73
74public Q_SLOTS:
75 /**
76 * Search for placemarks matching the current input text. Does nothing
77 * if input is empty
78 */
79 void findPlacemarks();
80
81 /** Set the target position to the given coordinates,
82 * eliminating any previously set positions
83 * @see selectPlacemark hasTargetPosition
84 */
85 void setTargetPosition(const GeoDataCoordinates &position, const QString &name = QString());
86
87 /** Cancel a started input request from the map */
89
90 /** Reload the bookmarks menu */
91 void reloadBookmarks();
92
94 /** All runners are finished */
96
97 /** User requests to remove this widget */
99
100 /** User requests to activate this widget */
102
103 /** User requests position input from the map */
105
106 /** hasTargetPosition changed because of selecting a placemark or changing the search term */
107 void targetValidityChanged(bool targetValid);
108
109private Q_SLOTS:
110 /** Runner progress */
111 void setPlacemarkModel(QAbstractItemModel *);
112
113 /** Handle click on the goto target button */
114 void requestActivity();
115
116 /** Handle click on the remove widget button */
117 void requestRemoval();
118
119 /** Handle click on the map input button */
120 void setMapInputModeEnabled(bool enabled);
121
122 /** All runners have completed */
123 void finishSearch();
124
125 /** Mark ourselves dirty (no target) */
126 void setInvalid();
127
128 /** Set the target position (dragging) */
129 void updatePosition(int index, const GeoDataCoordinates &position);
130
131 void reverseGeocoding();
132
133 void retrieveReverseGeocodingResult(const GeoDataCoordinates &coordinates, const GeoDataPlacemark &placemark);
134
135 void setHomePosition();
136
137 void setCurrentLocation();
138
139 void updateCurrentLocationButton(PositionProviderStatus status);
140
141 void updateCenterButton(bool hasPosition);
142
143 void setBookmarkPosition(QAction *bookmark);
144
145 void openTargetSelectionDialog();
146
147 void showMenu();
148
149private:
150 RoutingInputWidgetPrivate *const d;
151};
152
153} // namespace Marble
154
155#endif
A 3d point representation.
a class representing a point of interest on the map
The data model (not based on QAbstractModel) for a MarbleWidget.
Definition MarbleModel.h:84
This class represents a model of all place marks which are currently available through a given Placem...
Combines a line edit for input and a couple of buttons to let the user type in a search term,...
void reloadBookmarks()
Reload the bookmarks menu.
void targetValidityChanged(bool targetValid)
hasTargetPosition changed because of selecting a placemark or changing the search term
void removalRequest(RoutingInputWidget *)
User requests to remove this widget.
void clear()
Remove target position and user input, if any.
void searchFinished(RoutingInputWidget *)
All runners are finished.
GeoDataCoordinates targetPosition() const
Returns the geoposition selected by the user, or a default constructed geoposition if hasTargetPositi...
bool hasTargetPosition() const
Returns true if the user has selected a valid geo position.
void abortMapInputRequest()
Cancel a started input request from the map.
void setTargetPosition(const GeoDataCoordinates &position, const QString &name=QString())
Set the target position to the given coordinates, eliminating any previously set positions.
MarblePlacemarkModel * searchResultModel()
Returns the placemark model that contains search results.
void findPlacemarks()
Search for placemarks matching the current input text.
void mapInputModeEnabled(RoutingInputWidget *, bool enabled)
User requests position input from the map.
void setIndex(int index)
Change the data index in the route request model.
void activityRequest(RoutingInputWidget *)
User requests to activate this widget.
bool hasInput() const
Returns false iff the input text is empty.
~RoutingInputWidget() override
Destructor.
RoutingInputWidget(MarbleModel *model, int index, QWidget *parent=nullptr)
Constructor.
Q_SCRIPTABLE CaptureState status()
Binds a QML item to a specific geodetic location in screen coordinates.
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.