airportentry.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. *openPilotLog - A FOSS Pilot Logbook Application
  3. *Copyright (C) 2020-2023 Felix Turowsky
  4. *
  5. *This program is free software: you can redistribute it and/or modify
  6. *it under the terms of the GNU General Public License as published by
  7. *the Free Software Foundation, either version 3 of the License, or
  8. *(at your option) any later version.
  9. *
  10. *This program is distributed in the hope that it will be useful,
  11. *but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. *GNU General Public License for more details.
  14. *
  15. *You should have received a copy of the GNU General Public License
  16. *along with this program. If not, see <https://www.gnu.org/licenses/>.
  17. */
  18. #ifndef AIRPORTENTRY_H
  19. #define AIRPORTENTRY_H
  20. #include "src/database/row.h"
  21. namespace OPL {
  22. /*!
  23. * \brief A Row representing an Airport entry. See Row class for details.
  24. */
  25. class AirportEntry : public Row
  26. {
  27. const static inline QString TABLE_NAME = QStringLiteral("airports");
  28. public:
  29. AirportEntry();
  30. AirportEntry(const RowData_T &row_data);
  31. AirportEntry(int row_id, const RowData_T &row_data);
  32. const QString getTableName() const override;
  33. /*!
  34. * \brief return the airports IATA code (3-letter)
  35. */
  36. const QString getIataCode() const;
  37. /*!
  38. * \brief return the airports ICAO code (4-letter)
  39. */
  40. const QString getIcaoCode() const;
  41. /*!
  42. * \brief Returns the airport common given name
  43. */
  44. const QString getAirportName() const;
  45. /*!
  46. * \brief return a string describing the airport
  47. * \details The string consists of the Airport ICAO Code, and if available
  48. * IATA Code and Airport Name
  49. */
  50. const QString getAirportDescriptor() const;
  51. /*!
  52. * \brief The ICAO code is a 4-letter alphanumeric identifier for airports
  53. */
  54. const static inline QString ICAO = QStringLiteral("icao");
  55. /*!
  56. * \brief The IATA code is a 3-letter alphanumeric identifier for airports
  57. */
  58. const static inline QString IATA = QStringLiteral("iata");
  59. /*!
  60. * \brief The airports common name
  61. */
  62. const static inline QString NAME = QStringLiteral("name");
  63. /*!
  64. * \brief The airports latitude. Stored as a double
  65. */
  66. const static inline QString LAT = QStringLiteral("lat");
  67. /*!
  68. * \brief The airports longitude. Stored as a double
  69. */
  70. const static inline QString LON = QStringLiteral("long");
  71. /*!
  72. * \brief The country the airport is located in
  73. */
  74. const static inline QString COUNTRY = QStringLiteral("country");
  75. /*!
  76. * \brief The altitude aboe mea sea level the airport is located at.
  77. */
  78. const static inline QString ALTITIDUE = QStringLiteral("alt");
  79. /*!
  80. * \brief The airports timezone Offset from UTC
  81. */
  82. const static inline QString UTC_OFFSET = QStringLiteral("utcoffset");
  83. /*!
  84. * \brief The timezone (Olson classification) the airport is situated in
  85. */
  86. const static inline QString TZ_OLSON = QStringLiteral("tzolson");
  87. };
  88. } // namespace OPL
  89. #endif // AIRPORTENTRY_H