Marble

DeclarativeMapThemeManager.h
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2010 Dennis Nienhüser <[email protected]>
4 //
5 
6 #ifndef DECLARATIVE_MAPTHEMEMANAGER_H
7 #define DECLARATIVE_MAPTHEMEMANAGER_H
8 
9 #include "MapThemeManager.h"
10 
11 #include <QQuickImageProvider>
12 
13 class MapThemeImageProvider : public QQuickImageProvider
14 {
15 public:
16  MapThemeImageProvider();
17 
18  QPixmap requestPixmap( const QString &id, QSize *size, const QSize &requestedSize ) override;
19 
20 private:
21  /** @todo FIXME It is a bit ugly to keep a separate object that loads all themes again
22  * just to provide their images to QML. The API change before Qt 4.7 made this necessary
23  * however (it's not possible anymore to assign a QPixmap property to QML images) */
24  Marble::MapThemeManager m_mapThemeManager;
25 };
26 
27 /**
28  * Provides access to all map themes installed locally
29  */
30 class MapThemeManager : public QObject
31 {
32  Q_OBJECT
33 
34 public:
35  /** Constructor. Map themes are loaded later on demand. */
36  explicit MapThemeManager( QObject *parent = nullptr );
37 
38  /**
39  * A list of all installed map theme ids, each entry has the form
40  * "planet/themeid/themeid.dgml", e.g. "earth/bluemarble/bluemarble.dgml"
41  */
42  QStringList mapThemeIds() const;
43 
44 private:
45  /** Marble map theme manager doing the real work */
46  Marble::MapThemeManager m_mapThemeManager;
47 };
48 
49 #endif // DECLARATIVE_MAPTHEMEMANAGER_H
Q_OBJECTQ_OBJECT
The class that handles map themes that are locally available .
Provides access to all map themes installed locally.
QStringList mapThemeIds() const
A list of all installed map theme ids, each entry has the form "planet/themeid/themeid....
MapThemeManager(QObject *parent=nullptr)
Constructor.
virtual QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize)
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sun Jun 26 2022 04:10:36 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.