1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#pragma once
#include <time/time_locale.hpp>
namespace stm::internal
{
/**
* @brief Static settings data
*/
class StaticData
{
private:
bool isAutomaticDateAndTimeOn = false;
utils::time::Locale::DateFormat dateFormat = utils::time::Locale::DateFormat::DD_MM_YYYY;
utils::time::Locale::TimeFormat timeFormat = utils::time::Locale::TimeFormat::FormatTime12H;
std::string timezoneName;
std::string timezoneRules;
StaticData() = default;
public:
StaticData(const StaticData &) = delete;
StaticData &operator=(const StaticData &) = delete;
/**
* Gets instance of static data object
* @return instance of data object
*/
static StaticData &get();
/**
* Sets value corresponded to current Automatic Date and Time setting
* @param value new setting value
*/
void setAutomaticDateAndTime(bool value);
/**
* Gets value corresponded to current Automatic Date and Time setting
* @return actual setting value
*/
[[nodiscard]] bool getAutomaticDateAndTime() const noexcept;
/**
* Sets value corresponded to current Date format setting
* @param format new setting value
*/
void setDateFormat(utils::time::Locale::DateFormat format);
/**
* Gets value corresponded to current Date format setting
* @return actual setting value
*/
[[nodiscard]] utils::time::Locale::DateFormat getDateFormat() const noexcept;
/**
* Sets value corresponded to current Time format setting
* @param format new setting value
*/
void setTimeFormat(utils::time::Locale::TimeFormat format);
/**
* Gets value corresponded to current Time format setting
* @return actual setting value
*/
[[nodiscard]] utils::time::Locale::TimeFormat getTimeFormat() const noexcept;
/**
* Sets value corresponded to current Timezone name setting
* @param timezone new timezone to set
*/
void setTimezoneName(const std::string &newTimezone);
/**
* Gets value corresponded to current Timezone name setting
* @retrun actual timezone setting
*/
[[nodiscard]] std::string getCurrentTimezoneName() const;
/**
* Sets value corresponded to current Timezone rules setting
* @param timezone new timezone to set
*/
void setTimezoneRules(const std::string &newTimezone);
/**
* Gets value corresponded to current Timezone rules setting
* @retrun actual timezone setting
*/
[[nodiscard]] std::string getCurrentTimezoneRules() const;
};
} // namespace stm::internal