Vivoe Lite 0.5.0
Lightweight GVA like HMI for military displays.
Loading...
Searching...
No Matches
row_type.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_TABLE_ROW_TYPE_H_
14#define HMICORE_WIDGETS_TABLE_ROW_TYPE_H_
15
16#include <string>
17#include <vector>
18
21
22namespace gva {
23
28class RowType {
29 public:
34 RowType() = default;
35
40 ~RowType() = default;
41
53 RowType(const uint32_t background_colour, const uint32_t foreground_colour, const uint32_t outline_colour,
54 const uint32_t highlight_colour, const widget::WeightType font_weight, const bool highlighted,
55 const widget::CellAlignType alignment);
56
62 RowType(const RowType &a);
63
70 RowType &operator=(const RowType &a);
71
76 bool operator<(const RowType &a) const;
77
85 bool operator>(const RowType &a) const;
86
92 uint32_t GetForegroundColour() const;
93
99 uint32_t GetBackgroundColour() const;
100
106 uint32_t GetOutlineColour() const;
107
113 uint32_t GetHighlightColour() const;
114
121
128 bool GetHighlighted() const;
129
135 void SetHighlighted(bool value);
136
143
149 std::vector<CellType> *GetCells() { return &cells_; }
150
151 private:
153 std::vector<CellType> cells_;
155 uint32_t background_colour_ = 0;
157 uint32_t foreground_colour_ = 0;
159 uint32_t outline_colour_ = 0;
161 uint32_t highlight_colour_ = 0;
163 widget::WeightType font_weight_ = widget::WeightType::kWeightNormal;
165 bool highlighted_;
167 widget::CellAlignType alignment_ = widget::CellAlignType::kAlignLeft;
168};
169
170} // namespace gva
171
172#endif // HMICORE_WIDGETS_TABLE_ROW_TYPE_H_
This is the class describing a TableWidget row.
Definition row_type.h:28
RowType()=default
Construct a new Row Type object.
bool operator<(const RowType &a) const
Sorting is based on priority then time.
Definition row_type.cc:59
RowType & operator=(const RowType &a)
Assignment operator.
Definition row_type.cc:44
uint32_t GetHighlightColour() const
Get the Highlight Colour.
Definition row_type.cc:83
bool operator>(const RowType &a) const
Sorting is based on priority then time.
Definition row_type.cc:68
bool GetHighlighted() const
Get the Highlighted object.
Definition row_type.cc:87
uint32_t GetForegroundColour() const
Get the Foreground Colour.
Definition row_type.cc:77
~RowType()=default
Destroy the Row Type object.
uint32_t GetOutlineColour() const
Get the Outline Colour.
Definition row_type.cc:81
std::vector< CellType > * GetCells()
Get a reference to the Cells vector for this row.
Definition row_type.h:149
widget::CellAlignType GetCellAlignment() const
Get the Cell Alignment object.
Definition row_type.cc:91
uint32_t GetBackgroundColour() const
Get the Background Colour.
Definition row_type.cc:79
void SetHighlighted(bool value)
Set the Highlighted flag.
Definition row_type.cc:89
widget::WeightType GetFontWeight() const
Get the Font Weight object.
Definition row_type.cc:85
WeightType
The line weight for boxes and tables.
Definition widget_types.h:33
CellAlignType
Table (see WidgetTable) cell alignment.
Definition widget_types.h:27