Vivoe Lite 0.5.0
Lightweight GVA like HMI for military displays.
Loading...
Searching...
No Matches
table_dynamic.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_TABLE_TABLE_DYNAMIC_H_
13#define HMICORE_WIDGETS_TABLE_TABLE_DYNAMIC_H_
14
15#include <memory>
16#include <string>
17#include <vector>
18
20
21namespace gva {
22
28 public:
33 enum class SortType { kSortUnsorted = 0, kSortAscending, kSortDescending };
34
42 explicit WidgetTableDynamic(const RendererGva &renderer, TouchGva *touch, uint32_t background_colour);
43
48 ~WidgetTableDynamic() final = default;
49
55 std::string GetWidgetName() const final { return "WidgetTableDynamic"; }
56
61 void Draw() final;
62
72 void AddRow(uint32_t foreground_colour, uint32_t background_colour, uint32_t outline_colour,
73 uint32_t highlight_colour, widget::WeightType font_weight) final;
74
79 void AddRow() final;
80
86 void AddRow(widget::WeightType font_weight) final;
87
94 void AddCell(const std::string text, uint32_t width) final;
95
103 void AddCell(const std::string text, uint32_t width, uint32_t background_colour) final;
104
112 void AddCell(const std::string text, uint32_t width, widget::CellAlignType align) final;
113
122 void AddCell(const std::string text, uint32_t width, widget::CellAlignType align, uint32_t background_colour) final;
123
129 void SetHideOverride(bool hide);
130
137 bool GetHideOverride() const;
138
144 void SetSorted(SortType sort);
145
152 SortType GetSorted() const;
153
159 void SetAllHighlighted(bool highlight_all);
160
167 bool GetAllHighlighted() const;
168
169 private:
170 uint32_t background_colour_;
171 uint32_t foreground_colour_ = Renderer::PackRgb(kHmiWhite);
172 uint32_t outline_colour_ = ConfigData::GetInstance()->GetThemeLabelBorderEnabled();
173 uint32_t highlight_colour_ = ConfigData::GetInstance()->GetThemeLabelBorderEnabledSelected();
174
175 std::vector<RowType> dynamic_rows_;
176 std::vector<RowType> dynamic_rows_filtered_;
177
178 bool highlight_all_ = false;
179 bool hide_override_ = false;
180 SortType sorted_ = SortType::kSortUnsorted;
181};
182
183} // namespace gva
184
185#endif // HMICORE_WIDGETS_TABLE_TABLE_DYNAMIC_H_
Class defining the config data.
Definition config_reader.h:256
Class definition of the GVA renderer.
Definition renderer_gva.h:29
Class defining the renderer.
Definition renderer.h:61
This is the class describing a TableWidget row.
Definition row_type.h:28
Class defining the touch screen events.
Definition touch_gva.h:71
A widget representing a table of elements.
Definition table_dynamic.h:27
void SetHideOverride(bool hide)
Set the Hide Override attribute.
Definition table_dynamic.cc:97
~WidgetTableDynamic() final=default
Destroy the Widget Keyboard object.
std::string GetWidgetName() const final
Get the Widget Name attribute.
Definition table_dynamic.h:55
SortType GetSorted() const
Get the Sorted attribute.
Definition table_dynamic.cc:114
void AddCell(const std::string text, uint32_t width) final
Add a basic cell.
Definition table_dynamic.cc:75
bool GetHideOverride() const
Get the Hide Override attribute.
Definition table_dynamic.cc:105
void SetAllHighlighted(bool highlight_all)
Set the All Highlighted attribute.
Definition table_dynamic.cc:116
void SetSorted(SortType sort)
Set the Sorted attribute.
Definition table_dynamic.cc:107
void Draw() final
The base class override to draw the table once setup.
Definition table_dynamic.cc:34
void AddRow() final
Add a row to the table.
Definition table_dynamic.cc:63
SortType
An enum representing to type of sort.
Definition table_dynamic.h:33
bool GetAllHighlighted() const
Get the All Highlighted attribute.
Definition table_dynamic.cc:135
A widget representing a table of elements.
Definition table.h:32
const gva::ColourType kHmiWhite
The RGB values for white.
Definition renderer.h:24