Marble

FileManager.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2006-2007 Torsten Rahn <tackat@kde.org>
4// SPDX-FileCopyrightText: 2007 Inge Wallin <ingwa@kde.org>
5//
6
7#ifndef MARBLE_FILEMANAGER_H
8#define MARBLE_FILEMANAGER_H
9
10#include "GeoDataDocument.h"
11
12#include <QObject>
13
14class QString;
15
16namespace Marble
17{
18
19class FileManagerPrivate;
20class FileLoader;
21class GeoDataLatLonBox;
22class GeoDataTreeModel;
23class PluginManager;
24
25/**
26 * This class is responsible for loading the
27 * different files into Geodata model.
28 *
29 * The loaded data are accessible via
30 * various models in MarbleModel.
31 */
32class MARBLE_EXPORT FileManager : public QObject
33{
34 Q_OBJECT
35
36public:
37 /**
38 * Creates a new file manager.
39 *
40 * @param treeModel The GeoDataTreeModel model.
41 * @param pluginManager The plugin manager.
42 * @param parent The parent object.
43 */
44 explicit FileManager(GeoDataTreeModel *treeModel, const PluginManager *pluginManager, QObject *parent = nullptr);
45
46 /**
47 * Destroys the file manager.
48 */
49 ~FileManager() override;
50
51 /**
52 * Loads a new file into the manager.
53 */
54 void
55 addFile(const QString &fileName, const QString &property, const GeoDataStyle::Ptr &style, DocumentRole role, int renderOrder = 0, bool recenter = false);
56
57 /**
58 * removes an existing file from the manager
59 */
60 void removeFile(const QString &fileName);
61
62 /**
63 * add Data containing KML code as string
64 */
65 void addData(const QString &name, const QString &data, DocumentRole role);
66
67 void closeFile(const GeoDataDocument *document);
68
69 int size() const;
70 GeoDataDocument *at(const QString &key);
71
72 /** Returns the number of files being opened at the moment */
73 int pendingFiles() const;
74
75Q_SIGNALS:
76 void fileAdded(const QString &key);
77 void fileRemoved(const QString &key);
78 void centeredDocument(const GeoDataLatLonBox &);
79 void fileError(const QString &key, const QString &error);
80
81private:
82 Q_PRIVATE_SLOT(d, void cleanupLoader(FileLoader *loader))
83
84 Q_DISABLE_COPY(FileManager)
85
86 friend class FileManagerPrivate;
87 FileManagerPrivate *const d;
88};
89
90}
91
92#endif
This class is responsible for loading the different files into Geodata model.
Definition FileManager.h:33
A container for Features, Styles and in the future Schemas.
A class that defines a 2D bounding box for geographic data.
The representation of GeoData in a model This class represents all available data given by kml-data f...
The class that handles Marble's plugins.
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 Sat Dec 21 2024 17:04:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.