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
7#ifndef MARBLE_ROUTINGPROFILESMODEL_H
8#define MARBLE_ROUTINGPROFILESMODEL_H
9
10#include "marble_export.h"
11#include "RoutingProfile.h"
12
13#include <QAbstractListModel>
14
15
16namespace Marble {
17
18class PluginManager;
19
20class MARBLE_EXPORT RoutingProfilesModel : public QAbstractListModel
21{
22 Q_OBJECT
23public:
24 explicit RoutingProfilesModel( const PluginManager *pluginManager, QObject *parent = nullptr );
25
26 QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const override;
27 int rowCount( const QModelIndex& parent = QModelIndex() ) const override;
28 bool removeRows( int row, int count, const QModelIndex& parent = QModelIndex() ) override;
29
30 enum ProfileTemplate {
31 CarFastestTemplate,
32 CarShortestTemplate,
33 CarEcologicalTemplate,
34 BicycleTemplate,
35 PedestrianTemplate,
36
37 LastTemplate
38 };
39
40 void setProfiles( const QList<RoutingProfile> &profiles );
41 QList<RoutingProfile> profiles() const;
42
43 void loadDefaultProfiles();
44
45 void addProfile( const QString &name );
46 bool moveUp( int row );
47 bool moveDown( int row );
48
49 bool setProfileName( int row, const QString &name );
50 bool setProfilePluginSettings( int row, const QHash<QString, QHash<QString, QVariant> > &pluginSettings );
51
52private:
53 QList<RoutingProfile> m_profiles;
54 const PluginManager* m_pluginManager;
55};
56
57}
58
59#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 Fri Jun 7 2024 12:03:13 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.