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

0001 /*
0002     SPDX-FileCopyrightText: 2019 Volker Krause <vkrause@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #ifndef KPUBLICTRANSPORT_BACKEND_H
0008 #define KPUBLICTRANSPORT_BACKEND_H
0009 
0010 #include "kpublictransport_export.h"
0011 #include "coveragearea.h"
0012 #include "datatypes.h"
0013 
0014 namespace KPublicTransport {
0015 
0016 class BackendPrivate;
0017 
0018 /** Information about a backend service queried for location/departure/journey data.
0019  *  This is used to let the user (API user or end user) determine which backends to query.
0020  */
0021 class KPUBLICTRANSPORT_EXPORT Backend
0022 {
0023     KPUBLICTRANSPORT_GADGET(Backend)
0024     /** Internal identifier of this backend.
0025      *  Not intended for display, use for storing per-backend settings for example.
0026      */
0027     Q_PROPERTY(QString identifier READ identifier)
0028     /** Short, humand readable name of the backend. Typically the company providing the service */
0029     Q_PROPERTY(QString name READ name)
0030     /** Humand readable description of this backend. */
0031     Q_PROPERTY(QString description READ description)
0032     /** Supports secrure network access.
0033      *  Yes, even in 2019 that is unfortunately not guaranteed.
0034      */
0035     Q_PROPERTY(bool isSecure READ isSecure)
0036 
0037 public:
0038     QString identifier() const;
0039     QString name() const;
0040     QString description() const;
0041     bool isSecure() const;
0042 
0043     Q_INVOKABLE KPublicTransport::CoverageArea coverageArea(KPublicTransport::CoverageArea::Type coverageType) const;
0044 };
0045 
0046 }
0047 
0048 Q_DECLARE_METATYPE(KPublicTransport::Backend)
0049 
0050 #endif // KPUBLICTRANSPORT_BACKEND_H