File indexing completed on 2024-05-12 04:42:48

0001 /*
0002     SPDX-FileCopyrightText: 2020 Volker Krause <vkrause@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #ifndef KPUBLICTRANSPORT_LINEMETADATA_H
0008 #define KPUBLICTRANSPORT_LINEMETADATA_H
0009 
0010 #include "kpublictransport_export.h"
0011 
0012 #include <KPublicTransport/Line>
0013 
0014 class QColor;
0015 class QString;
0016 class QUrl;
0017 
0018 namespace KPublicTransport {
0019 
0020 struct LineMetaDataContent;
0021 
0022 /** Static information about a public transport line.
0023  *  @internal exported only for unit tests
0024  */
0025 class KPUBLICTRANSPORT_EXPORT LineMetaData
0026 {
0027 public:
0028     LineMetaData();
0029     ~LineMetaData();
0030     LineMetaData(const LineMetaData&);
0031     LineMetaData& operator=(const LineMetaData&);
0032 
0033     bool isNull() const;
0034     QString name() const;
0035     QColor color() const;
0036     QUrl logoUrl() const;
0037     Line::Mode mode() const;
0038     QUrl modeLogoUrl() const;
0039 
0040     /** Attempts to find information about a line with the given name and a stop at the given coordinates. */
0041     static LineMetaData find(double latitude, double longitude, const QString &name, Line::Mode mode);
0042 
0043 private:
0044     LineMetaData(const LineMetaDataContent *dd);
0045     const LineMetaDataContent *d = nullptr;
0046 };
0047 
0048 }
0049 
0050 #endif // KPUBLICTRANSPORT_LINEMETADATA_H