Marble

SearchRunner.h
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2010 Dennis Nienhüser <[email protected]>
4 // SPDX-FileCopyrightText: 2011 Thibaut Gridel <[email protected]>
5 // SPDX-FileCopyrightText: 2012, 2013 Bernhard Beschow <[email protected]>
6 
7 #ifndef MARBLE_SEARCHRUNNER_H
8 #define MARBLE_SEARCHRUNNER_H
9 
10 #include "marble_export.h"
11 
12 #include <QObject>
13 #include <QVector>
14 
15 namespace Marble
16 {
17 
18 class GeoDataLatLonBox;
19 class GeoDataPlacemark;
20 class MarbleModel;
21 
22 class MARBLE_EXPORT SearchRunner : public QObject
23 {
24  Q_OBJECT
25 
26 public:
27  explicit SearchRunner( QObject *parent = nullptr );
28 
29  /**
30  * Stores a pointer to the currently used model
31  */
32  void setModel( const MarbleModel *model );
33 
34  /**
35  * Start a placemark search. Called by MarbleRunnerManager, runners
36  * are expected to return the result via the searchFinished signal.
37  * If implemented in a plugin, make sure to include Search in the
38  * plugin capabilities, otherwise MarbleRunnerManager will ignore the plugin
39  */
40  virtual void search( const QString &searchTerm, const GeoDataLatLonBox &preferred ) = 0;
41 
42 Q_SIGNALS:
43  /**
44  * This is emitted to indicate that the runner has finished the placemark search.
45  * @param result the result of the search.
46  */
47  void searchFinished( const QVector<GeoDataPlacemark*>& result );
48 
49 protected:
50  /**
51  * Access to the currently used model, or null if no was set with @see setModel
52  */
53  const MarbleModel *model() const;
54 
55 private:
56  const MarbleModel *m_model;
57 };
58 
59 }
60 
61 #endif
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:10 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.