Marble

MarbleLocale.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2006-2007 Torsten Rahn <tackat@kde.org>
4// SPDX-FileCopyrightText: 2007 Inge Wallin <ingwa@kde.org>
5// SPDX-FileCopyrightText: 2015 Ilya Kowalewski <illya.kovalevskyy@gmail.com>
6//
7
8#ifndef MARBLE_MARBLELOCALE_H
9#define MARBLE_MARBLELOCALE_H
10
11#include "marble_export.h"
12
13#include <QtGlobal>
14
15namespace Marble
16{
17
18class MarbleLocalePrivate;
19
20/**
21 * @short A class that contains all localization stuff for Marble.
22 *
23 * The class stores properties like the measurement system.
24 */
25
26class MARBLE_EXPORT MarbleLocale
27{
28public:
31
32 enum MeasurementSystem {
33 MetricSystem = 0,
34 ImperialSystem,
35 NauticalSystem
36 };
37
38 enum MeasureUnit {
39 Meter = 0,
40 Kilometer,
41 Milimeter,
42 Centimeter,
43
44 Foot,
45 Inch,
46 Yard,
47 Mile,
48
49 NauticalMile
50 };
51
52 void setMeasurementSystem(MarbleLocale::MeasurementSystem measurementSystem);
53 MarbleLocale::MeasurementSystem measurementSystem() const;
54
55 static QString languageCode();
56
57 /**
58 * @brief meterToCustomUnit Converts @p meters to @p targetValue of @p targetUnit in @p targetSystem
59 */
60 static void meterToTargetUnit(qreal meters, MeasurementSystem targetSystem, qreal &targetValue, MeasureUnit &targetUnit);
61
62 /**
63 * @brief unitAbbreviation Represents a short string form of @p unit, e.g. "km" for Kilometer
64 */
65 static QString unitAbbreviation(MeasureUnit unit);
66
67private:
68 Q_DISABLE_COPY(MarbleLocale)
69 MarbleLocalePrivate *const d;
70};
71
72}
73
74#endif
A class that contains all localization stuff for Marble.
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 8 2024 12:02:44 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.