Marble

MapThemeModel.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2012 Dennis Nienhüser <nienhueser@kde.org>
4//
5
6#ifndef MARBLE_DECLARATIVE_STREETMAPTHEMEMODEL_H
7#define MARBLE_DECLARATIVE_STREETMAPTHEMEMODEL_H
8
9#include <QSortFilterProxyModel>
10#include <qqmlregistration.h>
11
12namespace Marble
13{
14class MapThemeManager;
15}
16
17class MapThemeModel : public QSortFilterProxyModel
18{
20 QML_ELEMENT
21
22public:
23 enum MapThemeFilter {
24 AnyTheme = 0x0,
25 Terrestrial = 0x1,
26 Extraterrestrial = 0x2,
27 LowZoom = 0x4,
28 HighZoom = 0x8,
29 };
30
31 Q_DECLARE_FLAGS(MapThemeFilters, MapThemeFilter)
32
33 Q_FLAGS(MapThemeFilter MapThemeFilters)
34
35 Q_PROPERTY(MapThemeFilters mapThemeFilter READ mapThemeFilter WRITE setMapThemeFilter NOTIFY mapThemeFilterChanged)
36
37public:
38 explicit MapThemeModel(QObject *parent = nullptr);
39
40 QHash<int, QByteArray> roleNames() const override;
41
42 Q_INVOKABLE QString name(const QString &id) const;
43
44 Q_INVOKABLE int indexOf(const QString &id) const;
45
46 Q_INVOKABLE MapThemeFilters mapThemeFilter() const;
47
48public Q_SLOTS:
49 void setMapThemeFilter(MapThemeFilters filters);
50
52 void mapThemeFilterChanged();
53
54protected:
55 bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
56
57private Q_SLOTS:
58 void handleChangedThemes();
59
60private:
61 Marble::MapThemeManager *m_themeManager;
62
63 QList<QString> m_streetMapThemeIds;
64
65 MapThemeFilters m_mapThemeFilters;
66};
67
68#endif
Provides access to all map themes installed locally.
The class that handles map themes that are locally available .
Binds a QML item to a specific geodetic location in screen coordinates.
Q_FLAGS(...)
Q_INVOKABLEQ_INVOKABLE
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:52:12 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.