Vivoe Lite 0.5.0
Lightweight GVA like HMI for military displays.
Loading...
Searching...
No Matches
widget.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
13#ifndef HMICORE_WIDGETS_WIDGET_H_
14#define HMICORE_WIDGETS_WIDGET_H_
15
16#include <string>
17
20
21namespace gva {
22
23class ScreenGva;
24class HandleType;
25
27class WidgetX {
28 public:
29 virtual ~WidgetX() = default;
30
37 explicit WidgetX(const RendererGva& renderer, widget::WidgetEnum widget_type);
38
44 virtual std::string GetWidgetName() const = 0;
45
51 virtual widget::WidgetEnum GetWidgetType() const;
52
58 void SetVisible(bool visible);
59
66 bool GetVisible() const;
67
73 virtual void SetX(uint32_t x);
74
80 uint32_t GetX() const;
81
87 virtual void SetY(uint32_t y);
88
94 uint32_t GetY() const;
95
101 void SetWidth(uint32_t width);
102
108 uint32_t GetWidth() const;
109
115 void SetHeight(uint32_t width);
116
122 uint32_t GetHeight() const;
123
128 virtual void Draw() = 0;
129
136
142 RendererGva* GetRenderer() const;
143
149 void SetStateText(LabelStates state);
150
156 void SetStateLabel(const LabelStates state);
157
164 uint32_t GetStateTextColour(LabelStates state) const;
165
167 uint32_t x_ = 0;
169 uint32_t y_ = 0;
171 uint32_t width_ = 0;
173 uint32_t height_ = 0;
174
175 private:
177 const RendererGva& renderer_;
179 widget::WidgetEnum widget_type_;
181 bool visible_ = false;
182};
183
184} // namespace gva
185
186#endif // HMICORE_WIDGETS_WIDGET_H_
Class definition of the GVA renderer.
Definition renderer_gva.h:29
Class defining the base widget.
Definition widget.h:27
widget::WidgetEnum GetType() const
Get the Type object.
Definition widget.cc:42
uint32_t GetStateTextColour(LabelStates state) const
Get the State Text Colour object.
Definition widget.cc:99
uint32_t width_
The widget width in pixels.
Definition widget.h:171
uint32_t GetHeight() const
Get the Height.
Definition widget.cc:40
virtual std::string GetWidgetName() const =0
Get the Widget Name attribute.
uint32_t GetX() const
Get the Y dimension.
Definition widget.cc:28
uint32_t height_
The widget height in pixels.
Definition widget.h:173
virtual void Draw()=0
Draw the widget.
virtual widget::WidgetEnum GetWidgetType() const
Get the Widget Type attribute.
Definition widget.cc:20
bool GetVisible() const
Get the Visible object.
Definition widget.cc:24
void SetWidth(uint32_t width)
Set the Width.
Definition widget.cc:34
uint32_t GetWidth() const
Get the Width.
Definition widget.cc:36
virtual void SetX(uint32_t x)
Set the X dimension.
Definition widget.cc:26
RendererGva * GetRenderer() const
Get the Renderer object.
Definition widget.cc:44
virtual void SetY(uint32_t y)
Set the Y dimension.
Definition widget.cc:30
uint32_t x_
The widget x location in pixels.
Definition widget.h:167
void SetVisible(bool visible)
Set the Visible object.
Definition widget.cc:22
void SetStateLabel(const LabelStates state)
Set the State Label object.
Definition widget.cc:67
void SetHeight(uint32_t width)
Set the Height.
Definition widget.cc:38
uint32_t y_
The widget y location in pixels.
Definition widget.h:169
uint32_t GetY() const
Get the Y dimension.
Definition widget.cc:32
void SetStateText(LabelStates state)
Set the State Text of an on screen label.
Definition widget.cc:46
LabelStates
Enum for the label states.
Definition gva.h:41
WidgetEnum
The different types of widget currently available for display.
Definition widget_types.h:39