Files
MuditaOS/module-gui/gui/input/Profile.hpp
Krzysztof Móżdżyński f3566bcecc [EGD-4591] Change input language parser to load from files
Completely independent input language files and display language files.
Input language files are now loaded based on number of files in
"profiles" folder.
InputLanguageSettings window now shows input languages based on their
"filetype" value andfiles in "profiles" folder.
2021-01-12 15:03:42 +01:00

34 lines
887 B
C++

// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "InputEvent.hpp"
#include <string>
#include <cstdint>
#include <vector>
#include <map>
#include "json/json11.hpp"
#include <filesystem>
namespace gui
{
class Profile
{
private:
std::string name;
json11::Json inputChars;
const json11::Json createJson(const std::string &filepath);
public:
static constexpr uint32_t none_key = 0;
Profile() = default;
explicit Profile(const std::filesystem::path &filepath);
[[nodiscard]] const std::string &getName() noexcept;
[[nodiscard]] uint32_t getCharKey(bsp::KeyCodes code, uint32_t times);
[[nodiscard]] const json11::Json &getJson() const noexcept;
};
} /* namespace gui */