Marble

RoutingWidget.h
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2010 Dennis Nienhüser <[email protected]>
4 //
5 
6 #ifndef MARBLE_ROUTINGWIDGET_H
7 #define MARBLE_ROUTINGWIDGET_H
8 
9 #include "RoutingManager.h"
10 #include "marble_export.h"
11 
12 #include <QWidget>
13 
14 class QModelIndex;
15 
16 namespace Marble
17 {
18 
19 class MarbleWidget;
20 class RoutingInputWidget;
21 class RoutingWidgetPrivate;
22 class RouteSyncManager;
23 class GeoDataCoordinates;
24 
25 /**
26  * A widget consisting of input fields for places / routing destinations,
27  * a list view showing routing instructions and a interactive paint layer
28  * showing placemarks and the route
29  */
30 class MARBLE_EXPORT RoutingWidget : public QWidget
31 {
32  Q_OBJECT
33 
34 public:
35  /**
36  * @brief Constructor
37  * @param marbleWidget The marble widget used to register an event handler
38  * on. Must not be null.
39  * @param parent Optional parent widget
40  */
41  explicit RoutingWidget( MarbleWidget *marbleWidget, QWidget *parent );
42 
43  /** Destructor */
44  ~RoutingWidget() override;
45 
46  /** Show or hide the "open file..." button. Default is false (not visible) */
47  void setShowDirectionsButtonVisible( bool visible );
48 
49  void setRouteSyncManager(RouteSyncManager* manager);
50 
51 public Q_SLOTS:
52  /** Ask the user for a kml file to open */
53  void openRoute();
54 
55  /** Ask the user for a kml file to save the current route to */
56  void saveRoute();
57 
58  /** Upload route to the cloud */
59  void uploadToCloud();
60 
61  /** Open cloud routes dialog */
62  void openCloudRoutesDialog();
63 
64  /** Add another input field at the end */
65  void addInputWidget();
66 
67 private Q_SLOTS:
68  /** Retrieve route directions */
69  void retrieveRoute();
70 
71  /** User activated a route instruction element in the list view, synchronize paint layer */
72  void activateItem ( const QModelIndex &index );
73 
74  /** Placemark search is finished in an input field, switch to its placemark model */
75  void handleSearchResult( RoutingInputWidget *widget );
76 
77  /** Switch to the placemark model of an input field */
78  void centerOnInputWidget( RoutingInputWidget *widget );
79 
80  /** A placemark was selected in the map, synchronize list view */
81  void activatePlacemark( const QModelIndex &index );
82 
83  /** Insert another input field at the given position */
84  void insertInputWidget( int index );
85 
86  /** Remove an existing input field */
87  void removeInputWidget( RoutingInputWidget *widget );
88 
89  /** Remove an existing input field */
90  void removeInputWidget( int index );
91 
92  /** Route state changed */
93  void updateRouteState( RoutingManager::State state );
94 
95  /** An input field requests a position input from the map */
96  void requestMapPosition( RoutingInputWidget *widget, bool enabled );
97 
98  /** Position in the map selected by the user after a previous slotMapInputRequested */
99  void retrieveSelectedPoint( const GeoDataCoordinates &coordinates );
100 
101  /** Update the text of the Search / GetDirections button */
102  void adjustSearchButton();
103 
104  /** The user canceled point selection from the map */
105  void pointSelectionCanceled();
106 
107  /** show profile configuration dialog */
108  void configureProfile();
109 
110  /** Progress animation update */
111  void updateProgress();
112 
113  /** Toggle visibility of alternative routes */
114  void updateAlternativeRoutes();
115 
116  /** Select the first routing profile if none is selected yet */
117  void selectFirstProfile();
118 
119  /** Show the directions ListView */
120  void showDirections();
121 
122  /** Update the route request with the given profile */
123  void setRoutingProfile( int index );
124 
125  /** Change selected routing profile to the one set in the shared request */
126  void updateActiveRoutingProfile();
127 
128  /** Toggle cloud sync button visibility based on whether route sync is enabled */
129  void updateCloudSyncButtons();
130 
131  /** Open a remote route and center on it */
132  void openCloudRoute( const QString &identifier );
133 
134  void updateUploadProgress( qint64 sent, qint64 total );
135 
136  void centerOn( const GeoDataCoordinates &coordinates );
137 
138  void seekTourToStart();
139 
140  void initializeTour();
141 
142  void clearTour();
143 
144  void toggleRoutePlay();
145 
146  void handlePlanetChange();
147 
148 protected:
149  bool eventFilter( QObject *o, QEvent *e ) override;
150  void resizeEvent(QResizeEvent *e) override;
151 
152 private:
153  RoutingWidgetPrivate *const d;
154 };
155 
156 } // namespace Marble
157 
158 #endif
A 3d point representation.
A widget class that displays a view of the earth.
Definition: MarbleWidget.h:98
Combines a line edit for input and a couple of buttons to let the user type in a search term,...
A widget consisting of input fields for places / routing destinations, a list view showing routing in...
Definition: RoutingWidget.h:30
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Oct 2 2023 03:52:09 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.