File indexing completed on 2024-12-22 04:59:45

0001 /*
0002    SPDX-FileCopyrightText: 2017-2019 Volker Krause <vkrause@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "knowledgedb/iatacode.h"
0010 
0011 #include <vector>
0012 
0013 class QDateTime;
0014 
0015 namespace KItinerary {
0016 
0017 class Airline;
0018 class Airport;
0019 class Flight;
0020 
0021 /** Post-processing logic for flight reservations. */
0022 class FlightPostProcessor
0023 {
0024 public:
0025     Flight processFlight(Flight flight);
0026 
0027 private:
0028     Airport processAirport(Airport airport, const std::vector<KnowledgeDb::IataCode> &codes) const;
0029     Airline processAirline(Airline airline) const;
0030     QDateTime processFlightTime(QDateTime dt, const Flight &flight, const std::vector<KnowledgeDb::IataCode> &codes) const;
0031 
0032     void lookupAirportCodes(const Airport &airport, std::vector<KnowledgeDb::IataCode> &codes) const;
0033     void pickAirportByDistance(int duration, const std::vector<KnowledgeDb::IataCode> &startCodes, std::vector<KnowledgeDb::IataCode> &codes) const;
0034 
0035     std::vector<KnowledgeDb::IataCode> m_departureCodes;
0036     std::vector<KnowledgeDb::IataCode> m_arrivalCodes;
0037 };
0038 
0039 }
0040