KPublicTransport

locationreply.h
1 /*
2  SPDX-FileCopyrightText: 2018 Volker Krause <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #ifndef KPUBLICTRANSPORT_LOCATIONREPLY_H
8 #define KPUBLICTRANSPORT_LOCATIONREPLY_H
9 
10 #include "reply.h"
11 
12 #include <vector>
13 
14 namespace KPublicTransport {
15 
16 class AbstractBackend;
17 class Location;
18 class LocationRequest;
19 class LocationReplyPrivate;
20 
21 /** Location query reply. */
22 class KPUBLICTRANSPORT_EXPORT LocationReply : public Reply
23 {
24  Q_OBJECT
25 public:
26  ~LocationReply();
27 
28  /** The request this is the reply for. */
29  LocationRequest request() const;
30 
31  /** Returns the found locations. */
32  const std::vector<Location>& result() const;
33  /** Returns the found locations for moving elsewhere. */
34  std::vector<Location>&& takeResult();
35 
36 private:
37  friend class Manager;
38  friend class ManagerPrivate;
39  explicit LocationReply(const LocationRequest &req, QObject *parent = nullptr);
40 
41  friend class AbstractBackend;
42  Q_DECL_HIDDEN void addResult(std::vector<Location> &&res);
43  using Reply::addError;
44  Q_DECL_HIDDEN void addError(const AbstractBackend *backend, Reply::Error error, const QString &errorMsg);
45 
46 
47  Q_DECLARE_PRIVATE(LocationReply)
48 };
49 
50 }
51 
52 #endif // KPUBLICTRANSPORT_LOCATIONREPLY_H
Query operations and data types for accessing realtime public transport information from online servi...
Definition: attribution.cpp:16
Location query reply.
Definition: locationreply.h:22
Error
Error types.
Definition: reply.h:31
Describes a location search.
Entry point for starting public transport queries.
Definition: manager.h:41
Query response base class.
Definition: reply.h:24
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Oct 23 2021 23:05:21 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.