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 <QList>
13#include <QObject>
14
15#include "GeoDataPlacemark.h"
16
17namespace Marble
18{
19
20class GeoDataLatLonBox;
21class MarbleModel;
22
23class MARBLE_EXPORT SearchRunner : public QObject
24{
25 Q_OBJECT
26
27public:
28 explicit SearchRunner(QObject *parent = nullptr);
29
30 /**
31 * Stores a pointer to the currently used model
32 */
33 void setModel(const MarbleModel *model);
34
35 /**
36 * Start a placemark search. Called by MarbleRunnerManager, runners
37 * are expected to return the result via the searchFinished signal.
38 * If implemented in a plugin, make sure to include Search in the
39 * plugin capabilities, otherwise MarbleRunnerManager will ignore the plugin
40 */
41 virtual void search(const QString &searchTerm, const GeoDataLatLonBox &preferred) = 0;
42
43Q_SIGNALS:
44 /**
45 * This is emitted to indicate that the runner has finished the placemark search.
46 * @param result the result of the search.
47 */
48 void searchFinished(const QList<GeoDataPlacemark *> &result);
49
50protected:
51 /**
52 * Access to the currently used model, or null if no was set with @see setModel
53 */
54 const MarbleModel *model() const;
55
56private:
57 const MarbleModel *m_model;
58};
59
60}
61
62#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 Fri Nov 8 2024 12:02:44 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.