1 | /* |
2 | * Copyright (C) 2012 Cutehacks AS. All rights reserved. |
3 | * info@cutehacks.com |
4 | * http://cutehacks.com |
5 | * |
6 | * This file is part of Fly. |
7 | * |
8 | * Fly is free software: you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by |
10 | * the Free Software Foundation, either version 3 of the License, or |
11 | * (at your option) any later version. |
12 | * |
13 | * Fly is distributed in the hope that it will be useful, |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | * GNU General Public License for more details. |
17 | * |
18 | * You should have received a copy of the GNU General Public License |
19 | * along with Fly. If not, see <http://www.gnu.org/licenses/>. |
20 | */ |
21 | |
22 | #ifndef AIRPORTNAMES_H |
23 | #define AIRPORTNAMES_H |
24 | |
25 | #include "xmldatasource.h" |
26 | #include <QStringList> |
27 | #include <QHash> |
28 | |
29 | class AirportNames : public XmlDataSource |
30 | { |
31 | Q_OBJECT |
32 | Q_PROPERTY(QStringList avinorAirports READ avinorAirports CONSTANT) |
33 | public: |
34 | AirportNames(QObject *parent = 0); |
35 | ~AirportNames(); |
36 | |
37 | QStringList avinorAirports() const; |
38 | |
39 | public Q_SLOTS: |
40 | QString avinorAirportCodeAt(int index) const; |
41 | QString airportName(const QString &code) const; |
42 | |
43 | protected Q_SLOTS: |
44 | void createMapping(Node *root); |
45 | |
46 | private: |
47 | QHash<QString, QString> m_mapping; |
48 | QStringList m_airports; |
49 | }; |
50 | |
51 | #endif |
52 | |