Marble

RunnerTask.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 
6 #ifndef MARBLE_RUNNERTASK_H
7 #define MARBLE_RUNNERTASK_H
8 
9 #include "GeoDataCoordinates.h"
10 #include "GeoDataDocument.h"
11 #include "GeoDataLatLonBox.h"
12 
13 #include <QRunnable>
14 #include <QString>
15 
16 namespace Marble
17 {
18 
19 class MarbleModel;
20 class ParsingRunner;
21 class SearchRunner;
22 class ReverseGeocodingRunner;
23 class RouteRequest;
24 class RoutingRunner;
25 class ParsingRunnerManager;
26 class SearchRunnerManager;
27 class ReverseGeocodingRunnerManager;
28 class RoutingRunnerManager;
29 
30 /** A RunnerTask that executes a placemark search */
31 class SearchTask : public QObject, public QRunnable
32 {
33  Q_OBJECT
34 
35 public:
36  SearchTask( SearchRunner *runner, SearchRunnerManager *manager, const MarbleModel *model, const QString &searchTerm, const GeoDataLatLonBox &preferred );
37 
38  /**
39  * @reimp
40  */
41  void run() override;
42 
43 Q_SIGNALS:
44  void finished( SearchTask *task );
45 
46 private:
47  SearchRunner *const m_runner;
48  QString m_searchTerm;
49  GeoDataLatLonBox m_preferredBbox;
50 };
51 
52 /** A RunnerTask that executes reverse geocoding */
53 class ReverseGeocodingTask : public QObject, public QRunnable
54 {
55  Q_OBJECT
56 
57 public:
58  ReverseGeocodingTask( ReverseGeocodingRunner*runner, ReverseGeocodingRunnerManager *manager, const MarbleModel *model, const GeoDataCoordinates &coordinates );
59 
60  /**
61  * @reimp
62  */
63  void run() override;
64 
65 Q_SIGNALS:
66  void finished( ReverseGeocodingTask *task );
67 
68 private:
69  ReverseGeocodingRunner *const m_runner;
70  GeoDataCoordinates m_coordinates;
71 };
72 
73 
74 /** A RunnerTask that executes a route calculation */
75 class RoutingTask : public QObject, public QRunnable
76 {
77  Q_OBJECT
78 
79 public:
80  RoutingTask( RoutingRunner *runner, RoutingRunnerManager *manager, const RouteRequest* routeRequest );
81 
82  /**
83  * @reimp
84  */
85  void run() override;
86 
87 Q_SIGNALS:
88  void finished( RoutingTask *task );
89 
90 private:
91  RoutingRunner *const m_runner;
92  const RouteRequest *const m_routeRequest;
93 };
94 
95 /** A RunnerTask that executes a file Parsing */
96 class ParsingTask : public QObject, public QRunnable
97 {
98  Q_OBJECT
99 
100 public:
101  ParsingTask( ParsingRunner *runner, ParsingRunnerManager *manager, const QString& fileName, DocumentRole role );
102 
103  /**
104  * @reimp
105  */
106  void run() override;
107 
108 Q_SIGNALS:
109  void parsed(GeoDataDocument* document, const QString &error);
110  void finished();
111 
112 private:
113  ParsingRunner *const m_runner;
114  QString m_fileName;
115  DocumentRole m_role;
116  ParsingRunnerManager* m_manager;
117 };
118 
119 }
120 
121 #endif
Q_OBJECTQ_OBJECT
A 3d point representation.
A RunnerTask that executes a file Parsing.
Definition: RunnerTask.h:96
void run() override
Definition: RunnerTask.cpp:69
A RunnerTask that executes reverse geocoding.
Definition: RunnerTask.h:53
void run() override
Definition: RunnerTask.cpp:34
A RunnerTask that executes a route calculation.
Definition: RunnerTask.h:75
A container for Features, Styles and in the future Schemas.
A class that defines a 2D bounding box for geographic data.
Binds a QML item to a specific geodetic location in screen coordinates.
Q_SIGNALSQ_SIGNALS
A RunnerTask that executes a placemark search.
Definition: RunnerTask.h:31
Points to be included in a route.
Definition: RouteRequest.h:26
void run() override
Definition: RunnerTask.cpp:87
The data model (not based on QAbstractModel) for a MarbleWidget.
Definition: MarbleModel.h:86
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Sep 27 2023 04:09:07 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.