Marble

RouteItem.cpp
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2013 Utku Aydın <[email protected]>
4 //
5 
6 #include "RouteItem.h"
7 
8 #include <QUrl>
9 #include <QIcon>
10 
11 namespace Marble {
12 
13 class Q_DECL_HIDDEN RouteItem::Private {
14 
15 public:
16  QString m_identifier;
17  QString m_name;
18  QIcon m_preview;
19  QUrl m_previewUrl;
20  QString m_distance;
21  QString m_duration;
22  bool m_onCloud;
23 };
24 
25 RouteItem::RouteItem() : d( new Private() )
26 {
27 }
28 
29 RouteItem::RouteItem( const RouteItem &other ) : d( new Private( *other.d ) )
30 {
31 }
32 
33 RouteItem::~RouteItem()
34 {
35  delete d;
36 }
37 
38 RouteItem &RouteItem::operator=( const RouteItem &other )
39 {
40  *d = *other.d;
41  return *this;
42 }
43 
44 bool RouteItem::operator==( const RouteItem& other ) const
45 {
46  return identifier() == other.identifier();
47 }
48 
49 QString RouteItem::identifier() const
50 {
51  return d->m_identifier;
52 }
53 
54 void RouteItem::setIdentifier( const QString &timestamp )
55 {
56  d->m_identifier = timestamp;
57 }
58 
59 QString RouteItem::name() const
60 {
61  return d->m_name;
62 }
63 
64 void RouteItem::setName( const QString &name )
65 {
66  d->m_name = name;
67 }
68 
69 QIcon RouteItem::preview() const
70 {
71  return d->m_preview;
72 }
73 
74 void RouteItem::setPreview( const QIcon &preview )
75 {
76  d->m_preview = preview;
77 }
78 
79 QUrl RouteItem::previewUrl() const
80 {
81  return d->m_previewUrl;
82 }
83 
84 void RouteItem::setPreviewUrl( const QUrl &previewUrl )
85 {
86  d->m_previewUrl = previewUrl;
87 }
88 
89 QString RouteItem::distance() const
90 {
91  return d->m_distance;
92 }
93 
94 void RouteItem::setDistance( const QString &distance )
95 {
96  d->m_distance = distance;
97 }
98 
99 QString RouteItem::duration() const
100 {
101  return d->m_duration;
102 }
103 
104 void RouteItem::setDuration( const QString &duration )
105 {
106  d->m_duration = duration;
107 }
108 
109 bool RouteItem::onCloud() const
110 {
111  return d->m_onCloud;
112 }
113 
114 void RouteItem::setOnCloud( const bool onCloud )
115 {
116  d->m_onCloud = onCloud;
117 }
118 
119 }
KOSM_EXPORT double distance(const std::vector< const OSM::Node * > &path, Coordinate coord)
Binds a QML item to a specific geodetic location in screen coordinates.
const char * name(StandardAction id)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Oct 4 2023 04:09:43 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.