Marble

ParsingRunnerManager.h
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2008 Henry de Valence <[email protected]>
4 // SPDX-FileCopyrightText: 2010 Dennis Nienhüser <[email protected]>
5 // SPDX-FileCopyrightText: 2010-2013 Bernhard Beschow <[email protected]>
6 // SPDX-FileCopyrightText: 2011 Thibaut Gridel <[email protected]>
7 
8 #ifndef MARBLE_PARSINGRUNNERMANAGER_H
9 #define MARBLE_PARSINGRUNNERMANAGER_H
10 
11 #include <QObject>
12 
13 #include "marble_export.h"
14 
15 #include "GeoDataDocument.h"
16 
17 namespace Marble
18 {
19 
20 class PluginManager;
21 
22 class MARBLE_EXPORT ParsingRunnerManager : public QObject
23 {
24  Q_OBJECT
25 
26 public:
27  /**
28  * Constructor.
29  * @param pluginManager The plugin manager that gives access to RunnerPlugins
30  * @param parent Optional parent object
31  */
32  explicit ParsingRunnerManager( const PluginManager *pluginManager, QObject *parent = nullptr );
33 
34  ~ParsingRunnerManager() override;
35 
36  /**
37  * Parse the file using the runners for various formats
38  * @see parseFile is asynchronous with results returned using the
39  * @see parsingFinished signal.
40  * @see openFile is blocking.
41  * @see parsingFinished signal indicates all runners are finished.
42  */
43  void parseFile( const QString &fileName, DocumentRole role = UserDocument );
44  GeoDataDocument *openFile( const QString &fileName, DocumentRole role = UserDocument, int timeout = 30000 );
45 
46 Q_SIGNALS:
47  /**
48  * The file was parsed and potential error message
49  */
50  void parsingFinished( GeoDataDocument *document, const QString &error = QString() );
51 
52  /**
53  * Emitted whenever all runners are finished for the query
54  */
55  void parsingFinished();
56 
57 private:
58  Q_PRIVATE_SLOT( d, void cleanupParsingTask() )
59  Q_PRIVATE_SLOT( d, void addParsingResult( GeoDataDocument *document, const QString &error ) )
60 
61  class Private;
62  friend class Private;
63  Private *const d;
64 };
65 
66 }
67 
68 #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 Tue Oct 3 2023 04:09:49 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.