File indexing completed on 2024-04-28 04:41:41

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_VEHICLELAYOUTREPLY_H
0008 #define KPUBLICTRANSPORT_VEHICLELAYOUTREPLY_H
0009 
0010 #include "reply.h"
0011 
0012 namespace KPublicTransport {
0013 
0014 class AbstractBackend;
0015 class Stopover;
0016 class Vehicle;
0017 class VehicleLayoutRequest;
0018 class VehicleLayoutReplyPrivate;
0019 
0020 /** Reply to a vehicle layout query. */
0021 class KPUBLICTRANSPORT_EXPORT VehicleLayoutReply : public Reply
0022 {
0023     Q_OBJECT
0024 public:
0025     ~VehicleLayoutReply() override;
0026 
0027     /** The request this is the reply for. */
0028     VehicleLayoutRequest request() const;
0029 
0030     /** The requested Stopover information, including the vehicle and platform layout. */
0031     Stopover stopover() const;
0032 
0033 private:
0034     friend class Manager;
0035     friend class ManagerPrivate;
0036     explicit VehicleLayoutReply(const VehicleLayoutRequest &req, QObject *parent = nullptr);
0037 
0038     friend class AbstractBackend;
0039     Q_DECL_HIDDEN void addResult(const Stopover &stopover);
0040     using Reply::addError;
0041     Q_DECL_HIDDEN void addError(const AbstractBackend *backend, Reply::Error error, const QString &errorMsg);
0042 
0043     Q_DECLARE_PRIVATE(VehicleLayoutReply)
0044 };
0045 
0046 }
0047 
0048 #endif // KPUBLICTRANSPORT_VEHICLELAYOUTREPLY_H