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 {
16 const char *keyName;
17 const KLazyLocalizedString label;
18
19 constexpr inline OSMElementInformationModel::Key key() const { return OSMElementInformationModel::Diet; }
20 constexpr inline OSMElementInformationModel::KeyCategory category() const { return OSMElementInformationModel::Main; }
21} static constexpr const diet_type_map[] = {
22 { "diet:gluten_free", kli18nc("OSM::diet_type", "gluten free") },
23 { "diet:halal", kli18nc("OSM::diet_type", "halal") },
24 { "diet:kosher", kli18nc("OSM::diet_type", "kosher") },
25 { "diet:lactose_free", kli18nc("OSM::diet_type", "lactose free") },
26 { "diet:vegan", kli18nc("OSM::diet_type", "vegan") },
27 { "diet:vegetarian", kli18nc("OSM::diet_type", "vegetarian") },
28};
29static_assert(isSortedLookupTable(diet_type_map), "diet type map is not sorted!");
30
31// generic payment types (excluding cash, that's handled separately)
32struct {
33 const char *keyName;
34 OSMElementInformationModel::Key m_key;
35
36 constexpr inline OSMElementInformationModel::Key key() const { return m_key; }
37 constexpr inline OSMElementInformationModel::KeyCategory category() const { return OSMElementInformationModel::Payment; }
38} static constexpr const payment_generic_type_map[] = {
39 { "payment:account_cards", OSMElementInformationModel::PaymentDebitCard },
40 { "payment:credit_cards", OSMElementInformationModel::PaymentCreditCard },
41 { "payment:debit_cards", OSMElementInformationModel::PaymentDebitCard },
42 { "payment:electronic_purses", OSMElementInformationModel::PaymentStoredValueCard },
43};
44static_assert(isSortedLookupTable(payment_generic_type_map), "generic payment type map is not sorted!");
45
46// payment vendor types only, generic ones go into the list above and are handled separately
47struct {
48 const char *keyName;
49 OSMElementInformationModel::Key m_key;
50 const KLazyLocalizedString label;
51
52 constexpr inline OSMElementInformationModel::Key key() const { return m_key; }
53 constexpr inline OSMElementInformationModel::KeyCategory category() const { return OSMElementInformationModel::Payment; }
54} static constexpr const payment_type_map[] = {
55 { "payment:american_express", OSMElementInformationModel::PaymentCreditCard, kli18nc("OSM::payment_method", "American Express") },
56 { "payment:apple_pay", OSMElementInformationModel::PaymentDigital, kli18nc("OSM::payment_method", "Apple Pay") },
57 { "payment:diners_club", OSMElementInformationModel::PaymentCreditCard, kli18nc("OSM::payment_method", "Diners Club") },
58 { "payment:discover_card", OSMElementInformationModel::PaymentCreditCard, kli18nc("OSM::payment_method", "Discover Card") },
59 { "payment:jcb", OSMElementInformationModel::PaymentCreditCard, kli18nc("OSM::payment_method", "JCB") },
60 { "payment:girocard", OSMElementInformationModel::PaymentDebitCard, kli18nc("OSM::payment_method", "Girocard") },
61 { "payment:google_pay", OSMElementInformationModel::PaymentDigital, kli18nc("OSM::payment_method", "Google Pay") },
62 { "payment:maestro", OSMElementInformationModel::PaymentDebitCard, kli18nc("OSM::payment_method", "Maestro") },
63 { "payment:mastercard", OSMElementInformationModel::PaymentCreditCard, kli18nc("OSM::payment_method", "Mastercard") },
64 { "payment:unionpay", OSMElementInformationModel::PaymentCreditCard, kli18nc("OSM::payment_method", "UnionPay") },
65 { "payment:v_pay", OSMElementInformationModel::PaymentCreditCard, kli18nc("OSM::payment_method", "V Pay") },
66 { "payment:vpay", OSMElementInformationModel::PaymentCreditCard, kli18nc("OSM::payment_method", "V Pay") },
67 { "payment:visa", OSMElementInformationModel::PaymentCreditCard, kli18nc("OSM::payment_method", "Visa") },
68};
69
70static constexpr const ValueMapEntry wheelchair_map[] = {
71 { "limited", kli18nc("OSM::wheelchair_access", "limited") },
72 { "no", kli18nc("OSM::wheelchair_access", "no") },
73 { "yes", kli18nc("OSM::wheelchair_access", "yes") },
74};
75static_assert(isSortedLookupTable(wheelchair_map), "wheelchair access map is not sorted!");
76
77// socket types for charging stations
78struct {
79 const char *keyName;
80 const KLazyLocalizedString label;
81
82 constexpr inline OSMElementInformationModel::Key key() const { return OSMElementInformationModel::Socket; }
83 constexpr inline OSMElementInformationModel::KeyCategory category() const { return OSMElementInformationModel::Main; }
84} static constexpr const socket_type_map[] = {
85 { "socket:chademo", kli18nc("OSM::charging_station_socket", "Chademo") },
86 { "socket:schuko", kli18nc("OSM::charging_station_socket", "Schuko") },
87 { "socket:tesla_standard", kli18nc("OSM::charging_station_socket", "Tesla") },
88 { "socket:tesla_supercharger", kli18nc("OSM::charging_station_socket", "Tesla Supercharger") },
89 { "socket:tesla_supercharger_ccs", kli18nc("OSM::charging_station_socket", "Tesla Supercharger CCS") },
90 { "socket:type2", kli18nc("OSM::charging_station_socket", "Type 2") },
91 { "socket:type2_cable", kli18nc("OSM::charging_station_socket", "Type 2 cable") },
92 { "socket:type2_combo", kli18nc("OSM::charging_station_socket", "Type 2 CCS") },
93 { "socket:typee", kli18nc("OSM::charging_station_socket", "Type E") },
94};
95static_assert(isSortedLookupTable(socket_type_map), "socket type map is not sorted!");
96
97// charging station authentication methods
98struct {
99 const char *keyName;
100 const KLazyLocalizedString label;
101
102 constexpr inline OSMElementInformationModel::Key key() const { return OSMElementInformationModel::Authentication; }
103 constexpr inline OSMElementInformationModel::KeyCategory category() const { return OSMElementInformationModel::Main; }
104} static constexpr const authentication_type_map[] = {
105 { "authentication:app", kli18nc("OSM::charging_station_authentication", "app") },
106 { "authentication:membership_card", kli18nc("OSM::charging_station_authentication", "membership card") },
107 { "authentication:nfc", kli18nc("OSM::charging_station_authentication", "NFC") },
108 { "authentication:none", kli18nc("OSM::charging_station_authentication", "none") },
109 { "authentication:phone_call", kli18nc("OSM::charging_station_authentication", "phone call") },
110 { "authentication:short_message", kli18nc("OSM::charging_station_authentication", "SMS") },
111};
112static_assert(isSortedLookupTable(authentication_type_map), "authentication type map is not sorted!");
113
114// bicycle parking values
115// see https://taginfo.openstreetmap.org/keys/?key=bicycle_parking#values
116static constexpr const ValueMapEntry bicycle_parking_map[] = {
117 { "anchors", kli18nc("OSM::bicycle_parking", "anchors") },
118 { "bollard", kli18nc("OSM::bicycle_parking", "bollard") },
119 { "building", kli18nc("OSM::bicycle_parking", "building") },
120 { "ground_slots", kli18nc("OSM::bicycle_parking", "ground slots") },
121 { "lockers", kli18nc("OSM::bicycle_parking", "lockers") },
122 { "racks", kli18nc("OSM::bicycle_parking", "racks") },
123 { "shed", kli18nc("OSM::bicycle_parking", "shed") },
124 { "stands", kli18nc("OSM::bicycle_parking", "stands") },
125 { "wall_loops", kli18nc("OSM::bicycle_parking", "wall loops") },
126 { "wide_stands", kli18nc("OSM::bicycle_parking", "wide stands") },
127};
128static_assert(isSortedLookupTable(bicycle_parking_map), "bicycle parking map is not sorted!");
129
130// shared vehicle types
131// tag keys are our extension, based on KPublicTransport data
132static constexpr const ValueMapEntry available_vehicles_map[] = {
133 { "mx:realtime_available:bike", kli18ncp("available rental vehicles", "%1 bike", "%1 bikes") },
134 { "mx:realtime_available:pedelec", kli18ncp("available rental vehicles", "%1 pedelec", "%1 pedelecs") },
135 { "mx:realtime_available:scooter", kli18ncp("available rental vehicles", "%1 kick scooter", "%1 kick scooters") },
136 { "mx:realtime_available:motorcycle", kli18ncp("available rental vehicles", "%1 moped", "%1 mopeds") },
137 { "mx:realtime_available:car", kli18ncp("available rental vehicles", "%1 car", "%1 cars") },
138};
139
140// gender neutral/gender segregated facilities
141struct {
142 const char *keyName;
143 const KLazyLocalizedString label;
144
145 constexpr inline OSMElementInformationModel::Key key() const { return OSMElementInformationModel::Gender; }
146 constexpr inline OSMElementInformationModel::KeyCategory category() const { return OSMElementInformationModel::UnresolvedCategory; }
147} static constexpr const gender_type_map[] = {
148 { "female", kli18nc("OSM::gender_segregation", "female") },
149 { "male", kli18nc("OSM::gender_segregation", "male") },
150 { "unisex", kli18nc("OSM::gender_segregation", "unisex") },
151};
152static_assert(isSortedLookupTable(gender_type_map), "gender type map is not sorted!");
153
154// tactile writing variants
155struct {
156 const char *keyName;
157 const KLazyLocalizedString label;
158
159 constexpr inline OSMElementInformationModel::Key key() const { return OSMElementInformationModel::TactileWriting; }
160 constexpr inline OSMElementInformationModel::KeyCategory category() const { return OSMElementInformationModel::Accessibility; }
161} static constexpr const tactile_writing_map[] = {
162 { "tactile_writing:braille", kli18nc("tactile writing", "braille") },
163 { "tactile_writing:embossed_printed_letters", kli18nc("tactile writing", "embossed printed letters") },
164 { "tactile_writing:engraved_printed_letters", kli18nc("tactile writing", "engraved printed letters") },
165};
166static_assert(isSortedLookupTable(tactile_writing_map), "tactile writing type map is not sorted!");
167
168}
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 Tue Mar 26 2024 11:20:03 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.