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
36 public:
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 addFile(const QString &fileName, const QString &property, const GeoDataStyle::Ptr &style, DocumentRole role, int renderOrder = 0, bool recenter = false );
55
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
75 Q_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
81 private:
82
83 Q_PRIVATE_SLOT( d, void cleanupLoader( FileLoader *loader ) )
84
85 Q_DISABLE_COPY( FileManager )
86
87 friend class FileManagerPrivate;
88 FileManagerPrivate *const d;
89};
90
91}
92
93#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 Fri Jun 14 2024 11:54:16 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.