Marble

RoutingProfilesModel.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2010 Niko Sams <niko.sams@gmail.com>
4//
5
6#ifndef MARBLE_ROUTINGPROFILESMODEL_H
7#define MARBLE_ROUTINGPROFILESMODEL_H
8
9#include "RoutingProfile.h"
10#include "marble_export.h"
11
12#include <QAbstractListModel>
13
14namespace Marble
15{
16
17class PluginManager;
18
19class MARBLE_EXPORT RoutingProfilesModel : public QAbstractListModel
20{
21 Q_OBJECT
22public:
23 explicit RoutingProfilesModel(const PluginManager *pluginManager, QObject *parent = nullptr);
24
25 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
26 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
27 bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
28
29 enum ProfileTemplate {
30 CarFastestTemplate,
31 CarShortestTemplate,
32 CarEcologicalTemplate,
33 BicycleTemplate,
34 PedestrianTemplate,
35
36 LastTemplate
37 };
38
39 void setProfiles(const QList<RoutingProfile> &profiles);
40 QList<RoutingProfile> profiles() const;
41
42 void loadDefaultProfiles();
43
44 void addProfile(const QString &name);
45 bool moveUp(int row);
46 bool moveDown(int row);
47
48 bool setProfileName(int row, const QString &name);
49 bool setProfilePluginSettings(int row, const QHash<QString, QHash<QString, QVariant>> &pluginSettings);
50
51private:
52 QList<RoutingProfile> m_profiles;
53 const PluginManager *m_pluginManager;
54};
55
56}
57
58#endif // MARBLE_ROUTINGPROFILESMODEL_H
Binds a QML item to a specific geodetic location in screen coordinates.
DisplayRole
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:37:04 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.