Marble

ParsingRunnerManager.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2008 Henry de Valence <hdevalence@gmail.com>
4// SPDX-FileCopyrightText: 2010 Dennis Nienhüser <nienhueser@kde.org>
5// SPDX-FileCopyrightText: 2010-2013 Bernhard Beschow <bbeschow@cs.tu-berlin.de>
6// SPDX-FileCopyrightText: 2011 Thibaut Gridel <tgridel@free.fr>
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
17namespace Marble
18{
19
20class PluginManager;
21
22class MARBLE_EXPORT ParsingRunnerManager : public QObject
23{
24 Q_OBJECT
25
26public:
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
46Q_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
57private:
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-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.