Vivoe Lite 0.5.0
Lightweight GVA like HMI for military displays.
Loading...
Searching...
No Matches
keyboard.h
Go to the documentation of this file.
1//
2// Copyright (c) 2023, DefenceX PTY LTD
3//
4// This file is part of the VivoeX project developed by DefenceX.
5//
6// Licensed under the Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)
7// License. See the LICENSE file in the project root for full license details.
8//
12#ifndef HMICORE_WIDGETS_KEYBOARD_H_
13#define HMICORE_WIDGETS_KEYBOARD_H_
14
15#include <cstdint>
16#include <string>
17#include <vector>
18
22
23namespace gva {
24
26class WidgetKeyboard : public WidgetX {
27 public:
33 explicit WidgetKeyboard(const RendererGva& renderer);
34
39 ~WidgetKeyboard() final = default;
40
46 std::string GetWidgetName() const final { return "WidgetKeyboard"; };
47
52 void Draw() final;
53
59 void DrawKeyboard(const widget::KeyboardModeType mode);
60
65
66 void SetMode(const widget::KeyboardModeType mode);
67
73 widget::KeyboardModeType GetMode() const;
74
75 private:
76 widget::KeyboardModeType mode_ = widget::KeyboardModeType::kKeyboardUpper;
77 const std::vector<std::vector<char>> upperKeys_ = {{'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P'},
78 {'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', '-'},
79 {'Z', 'X', 'C', 'V', 'B', 'N', 'M', ' ', '-', '-'}};
80 const std::vector<std::vector<char>> lowerKeys_ = {{'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p'},
81 {'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', '-'},
82 {'z', 'x', 'c', 'v', 'b', 'n', 'm', ' ', '-', '-'}};
83 const std::vector<std::vector<char>> numKeys_ = {{'1', '2', '3', '4', '5', '6', '7', '8', '9', '0'},
84 {'-', '_', '.', ',', ';', ':', '"', '-', '-', '-'},
85 {'!', '@', '#', '$', '%', '^', '&', ' ', '-', '-'}};
86};
87
88} // namespace gva
89
90#endif // HMICORE_WIDGETS_KEYBOARD_H_
Class definition of the GVA renderer.
Definition renderer_gva.h:29
Class defining the mode widget.
Definition keyboard.h:26
void SetMode(const widget::KeyboardModeType mode)
Set the Mode object.
Definition keyboard.cc:99
~WidgetKeyboard() final=default
Destroy the Widget Keyboard object.
widget::KeyboardModeType GetMode() const
Get the Mode object.
Definition keyboard.cc:101
void DrawKeyboard(const widget::KeyboardModeType mode)
Draw the on screen keyboard.
Definition keyboard.cc:30
void Draw() final
Draw the current widget.
Definition keyboard.cc:24
std::string GetWidgetName() const final
Get the Widget Name attribute.
Definition keyboard.h:46
Class defining the base widget.
Definition widget.h:27