Marble

SearchRunner.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2010 Dennis Nienhüser <nienhueser@kde.org>
4// SPDX-FileCopyrightText: 2011 Thibaut Gridel <tgridel@free.fr>
5// SPDX-FileCopyrightText: 2012, 2013 Bernhard Beschow <bbeschow@cs.tu-berlin.de>
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
15namespace Marble
16{
17
18class GeoDataLatLonBox;
19class GeoDataPlacemark;
20class MarbleModel;
21
22class MARBLE_EXPORT SearchRunner : public QObject
23{
24 Q_OBJECT
25
26public:
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
42Q_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
49protected:
50 /**
51 * Access to the currently used model, or null if no was set with @see setModel
52 */
53 const MarbleModel *model() const;
54
55private:
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-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:18:17 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.