Marble

MarbleLocale.h
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2006-2007 Torsten Rahn <[email protected]>
4 // SPDX-FileCopyrightText: 2007 Inge Wallin <[email protected]>
5 // SPDX-FileCopyrightText: 2015 Ilya Kowalewski <[email protected]>
6 //
7 
8 #ifndef MARBLE_MARBLELOCALE_H
9 #define MARBLE_MARBLELOCALE_H
10 
11 #include "marble_export.h"
12 
13 #include <QtGlobal>
14 
15 namespace Marble
16 {
17 
18 class 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 
26 class MARBLE_EXPORT MarbleLocale
27 {
28  public:
29  MarbleLocale();
30  ~MarbleLocale();
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,
61  qreal &targetValue, MeasureUnit &targetUnit);
62 
63  /**
64  * @brief unitAbbreviation Represents a short string form of @p unit, e.g. "km" for Kilometer
65  */
66  static QString unitAbbreviation(MeasureUnit unit);
67 
68  private:
69  Q_DISABLE_COPY( MarbleLocale )
70  MarbleLocalePrivate * const d;
71 };
72 
73 }
74 
75 #endif
Binds a QML item to a specific geodetic location in screen coordinates.
A class that contains all localization stuff for Marble.
Definition: MarbleLocale.h:26
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Sep 21 2023 04:12:27 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.