File indexing completed on 2024-04-14 03:47:46
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2010 Dennis Nienhüser <nienhueser@kde.org> 0004 // 0005 0006 #ifndef MARBLE_GOTODIALOG_H 0007 #define MARBLE_GOTODIALOG_H 0008 0009 #include "marble_export.h" 0010 0011 #include <QDialog> 0012 0013 class QModelIndex; 0014 0015 namespace Marble 0016 { 0017 0018 class GeoDataPlacemark; 0019 class GeoDataCoordinates; 0020 class GoToDialogPrivate; 0021 class MarbleModel; 0022 0023 /** 0024 * A dialog that provides a list of targets to go to: The current location, 0025 * route start, destination and via points and bookmarks. Clicking on a target 0026 * centers the map on the selected position 0027 */ 0028 class MARBLE_EXPORT GoToDialog: public QDialog 0029 { 0030 Q_OBJECT 0031 0032 public: 0033 explicit GoToDialog( MarbleModel* marbleModel, QWidget * parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags() ); 0034 0035 ~GoToDialog() override; 0036 0037 /** Toggle whether routing items (source, destination and via points) are visible */ 0038 void setShowRoutingItems( bool show ); 0039 0040 /** Toggle whether the dialog can be used to search for placemarks */ 0041 void setSearchEnabled( bool enabled ); 0042 0043 /** 0044 * Returns the position of the item selected by the user, or a default 0045 * constructed GeoDataLookAt if the dialog was cancelled by the user 0046 */ 0047 GeoDataCoordinates coordinates() const; 0048 0049 Q_PRIVATE_SLOT( d, void saveSelection( const QModelIndex &index ) ) 0050 0051 Q_PRIVATE_SLOT( d, void startSearch() ) 0052 0053 Q_PRIVATE_SLOT( d, void updateSearchResult( const QVector<GeoDataPlacemark*>& placemarks ) ) 0054 0055 Q_PRIVATE_SLOT( d, void updateSearchMode() ) 0056 0057 Q_PRIVATE_SLOT( d, void updateProgress() ) 0058 0059 Q_PRIVATE_SLOT( d, void stopProgressAnimation() ) 0060 0061 private: 0062 GoToDialogPrivate * const d; 0063 friend class GoToDialogPrivate; 0064 }; 0065 0066 } // namespace Marble 0067 0068 #endif // MARBLE_GOTODIALOG_H