KOSMIndoorMap

osmelementinformationmodel_data.cpp
1/*
2 SPDX-FileCopyrightText: 2020 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "localization_p.h"
8#include "osmelementinformationmodel.h"
9
10#include <KLazyLocalizedString>
11
12namespace KOSMIndoorMap {
13
14// diet types offered at restaurants
15struct : public ValueMapEntry {
16 constexpr inline OSMElementInformationModel::Key key() const { return OSMElementInformationModel::Diet; }
17 constexpr inline OSMElementInformationModel::KeyCategory category() const { return OSMElementInformationModel::Main; }
18} static constexpr const diet_type_map[] = {
19 { "diet:gluten_free", kli18nc("OSM::diet_type", "gluten free") },
20 { "diet:halal", kli18nc("OSM::diet_type", "halal") },
21 { "diet:kosher", kli18nc("OSM::diet_type", "kosher") },
22 { "diet:lactose_free", kli18nc("OSM::diet_type", "lactose free") },
23 { "diet:vegan", kli18nc("OSM::diet_type", "vegan") },
24 { "diet:vegetarian", kli18nc("OSM::diet_type", "vegetarian") },
25};
26static_assert(isSortedLookupTable(diet_type_map), "diet type map is not sorted!");
27
28// generic payment types (excluding cash, that's handled separately)
29struct {
30 const char *keyName;
31 OSMElementInformationModel::Key m_key;
32
33 constexpr inline OSMElementInformationModel::Key key() const { return m_key; }
34 constexpr inline OSMElementInformationModel::KeyCategory category() const { return OSMElementInformationModel::Payment; }
35} static constexpr const payment_generic_type_map[] = {
36 { "payment:account_cards", OSMElementInformationModel::PaymentDebitCard },
37 { "payment:credit_cards", OSMElementInformationModel::PaymentCreditCard },
38 { "payment:debit_cards", OSMElementInformationModel::PaymentDebitCard },
39 { "payment:electronic_purses", OSMElementInformationModel::PaymentStoredValueCard },
40};
41static_assert(isSortedLookupTable(payment_generic_type_map), "generic payment type map is not sorted!");
42
43// payment vendor types only, generic ones go into the list above and are handled separately
44struct {
45 const char *keyName;
46 OSMElementInformationModel::Key m_key;
47 const KLazyLocalizedString label;
48
49 constexpr inline OSMElementInformationModel::Key key() const { return m_key; }
50 constexpr inline OSMElementInformationModel::KeyCategory category() const { return OSMElementInformationModel::Payment; }
51} static constexpr const payment_type_map[] = {
52 { "payment:american_express", OSMElementInformationModel::PaymentCreditCard, kli18nc("OSM::payment_method", "American Express") },
53 { "payment:apple_pay", OSMElementInformationModel::PaymentDigital, kli18nc("OSM::payment_method", "Apple Pay") },
54 { "payment:diners_club", OSMElementInformationModel::PaymentCreditCard, kli18nc("OSM::payment_method", "Diners Club") },
55 { "payment:discover_card", OSMElementInformationModel::PaymentCreditCard, kli18nc("OSM::payment_method", "Discover Card") },
56 { "payment:girocard", OSMElementInformationModel::PaymentDebitCard, kli18nc("OSM::payment_method", "Girocard") },
57 { "payment:google_pay", OSMElementInformationModel::PaymentDigital, kli18nc("OSM::payment_method", "Google Pay") },
58 { "payment:jcb", OSMElementInformationModel::PaymentCreditCard, kli18nc("OSM::payment_method", "JCB") },
59 { "payment:maestro", OSMElementInformationModel::PaymentDebitCard, kli18nc("OSM::payment_method", "Maestro") },
60 { "payment:mastercard", OSMElementInformationModel::PaymentCreditCard, kli18nc("OSM::payment_method", "Mastercard") },
61 { "payment:unionpay", OSMElementInformationModel::PaymentCreditCard, kli18nc("OSM::payment_method", "UnionPay") },
62 { "payment:v_pay", OSMElementInformationModel::PaymentCreditCard, kli18nc("OSM::payment_method", "V Pay") },
63 { "payment:visa", OSMElementInformationModel::PaymentCreditCard, kli18nc("OSM::payment_method", "Visa") },
64 { "payment:vpay", OSMElementInformationModel::PaymentCreditCard, kli18nc("OSM::payment_method", "V Pay") },
65};
66static_assert(isSortedLookupTable(payment_type_map), "payment details map is not sorted!");
67
68static constexpr const ValueMapEntry wheelchair_map[] = {
69 { "limited", kli18nc("OSM::wheelchair_access", "limited") },
70 { "no", kli18nc("OSM::wheelchair_access", "no") },
71 { "yes", kli18nc("OSM::wheelchair_access", "yes") },
72};
73static_assert(isSortedLookupTable(wheelchair_map), "wheelchair access map is not sorted!");
74
75// socket types for charging stations
76struct : public ValueMapEntry {
77 constexpr inline OSMElementInformationModel::Key key() const { return OSMElementInformationModel::Socket; }
78 constexpr inline OSMElementInformationModel::KeyCategory category() const { return OSMElementInformationModel::Main; }
79} static constexpr const socket_type_map[] = {
80 { "socket:chademo", kli18nc("OSM::charging_station_socket", "Chademo") },
81 { "socket:schuko", kli18nc("OSM::charging_station_socket", "Schuko") },
82 { "socket:tesla_standard", kli18nc("OSM::charging_station_socket", "Tesla") },
83 { "socket:tesla_supercharger", kli18nc("OSM::charging_station_socket", "Tesla Supercharger") },
84 { "socket:tesla_supercharger_ccs", kli18nc("OSM::charging_station_socket", "Tesla Supercharger CCS") },
85 { "socket:type2", kli18nc("OSM::charging_station_socket", "Type 2") },
86 { "socket:type2_cable", kli18nc("OSM::charging_station_socket", "Type 2 cable") },
87 { "socket:type2_combo", kli18nc("OSM::charging_station_socket", "Type 2 CCS") },
88 { "socket:typee", kli18nc("OSM::charging_station_socket", "Type E") },
89};
90static_assert(isSortedLookupTable(socket_type_map), "socket type map is not sorted!");
91
92// charging station authentication methods
93struct : public ValueMapEntry {
94 constexpr inline OSMElementInformationModel::Key key() const { return OSMElementInformationModel::Authentication; }
95 constexpr inline OSMElementInformationModel::KeyCategory category() const { return OSMElementInformationModel::Main; }
96} static constexpr const authentication_type_map[] = {
97 { "authentication:app", kli18nc("OSM::charging_station_authentication", "app") },
98 { "authentication:membership_card", kli18nc("OSM::charging_station_authentication", "membership card") },
99 { "authentication:nfc", kli18nc("OSM::charging_station_authentication", "NFC") },
100 { "authentication:none", kli18nc("OSM::charging_station_authentication", "none") },
101 { "authentication:phone_call", kli18nc("OSM::charging_station_authentication", "phone call") },
102 { "authentication:short_message", kli18nc("OSM::charging_station_authentication", "SMS") },
103};
104static_assert(isSortedLookupTable(authentication_type_map), "authentication type map is not sorted!");
105
106// bicycle parking values
107// see https://taginfo.openstreetmap.org/keys/?key=bicycle_parking#values
108static constexpr const ValueMapEntry bicycle_parking_map[] = {
109 { "anchors", kli18nc("OSM::bicycle_parking", "anchors") },
110 { "bollard", kli18nc("OSM::bicycle_parking", "bollard") },
111 { "building", kli18nc("OSM::bicycle_parking", "building") },
112 { "ground_slots", kli18nc("OSM::bicycle_parking", "ground slots") },
113 { "lockers", kli18nc("OSM::bicycle_parking", "lockers") },
114 { "racks", kli18nc("OSM::bicycle_parking", "racks") },
115 { "shed", kli18nc("OSM::bicycle_parking", "shed") },
116 { "stands", kli18nc("OSM::bicycle_parking", "stands") },
117 { "wall_loops", kli18nc("OSM::bicycle_parking", "wall loops") },
118 { "wide_stands", kli18nc("OSM::bicycle_parking", "wide stands") },
119};
120static_assert(isSortedLookupTable(bicycle_parking_map), "bicycle parking map is not sorted!");
121
122// shared vehicle types
123// tag keys are our extension, based on KPublicTransport data
124static constexpr const ValueMapEntry available_vehicles_map[] = {
125 { "mx:realtime_available:bike", kli18ncp("available rental vehicles", "%1 bike", "%1 bikes") },
126 { "mx:realtime_available:pedelec", kli18ncp("available rental vehicles", "%1 pedelec", "%1 pedelecs") },
127 { "mx:realtime_available:scooter", kli18ncp("available rental vehicles", "%1 kick scooter", "%1 kick scooters") },
128 { "mx:realtime_available:motorcycle", kli18ncp("available rental vehicles", "%1 moped", "%1 mopeds") },
129 { "mx:realtime_available:car", kli18ncp("available rental vehicles", "%1 car", "%1 cars") },
130};
131
132// tactile writing variants
133struct : public ValueMapEntry {
134 constexpr inline OSMElementInformationModel::Key key() const { return OSMElementInformationModel::TactileWriting; }
135 constexpr inline OSMElementInformationModel::KeyCategory category() const { return OSMElementInformationModel::Accessibility; }
136} static constexpr const tactile_writing_map[] = {
137 { "tactile_writing:braille", kli18nc("tactile writing", "braille") },
138 { "tactile_writing:embossed_printed_letters", kli18nc("tactile writing", "embossed printed letters") },
139 { "tactile_writing:engraved_printed_letters", kli18nc("tactile writing", "engraved printed letters") },
140};
141static_assert(isSortedLookupTable(tactile_writing_map), "tactile writing type map is not sorted!");
142
143}
OSM-based multi-floor indoor maps for buildings.
Category category(StandardShortcut id)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:17:55 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.