Vivoe Lite 0.5.0
Lightweight GVA like HMI for military displays.
Loading...
Searching...
No Matches
cell_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_CELL_TYPE_H_
14#define HMICORE_WIDGETS_TABLE_CELL_TYPE_H_
15
16#include <stdint.h>
17#include <string>
18#include <string_view>
20
21namespace gva {
22
27class CellType {
28 public:
33 CellType() = default;
34
39 ~CellType() = default;
40
52 CellType(const std::string text, const uint32_t width, const uint32_t background_colour,
53 const uint32_t foreground_colour, const uint32_t outline_colour, const uint32_t highlight_colour,
54 const widget::CellAlignType alignment);
55
61 CellType(const CellType &a);
62
69 CellType &operator=(const CellType &a);
70
76 uint32_t GetWidth() const;
77
83 std::string GetText() const;
84
90 void SetText(std::string_view text);
91
97 uint32_t GetForegroundColour() const;
98
104 uint32_t GetBackgroundColour() const;
105
111 uint32_t GetOutlineColour() const;
112
118 uint32_t GetHighlightColour() const;
119
126
127 private:
129 uint32_t width_ = 0;
131 std::string text_ = "";
133 uint32_t background_colour_ = 0;
135 uint32_t foreground_colour_ = 0;
137 uint32_t outline_colour_ = 0;
139 uint32_t highlight_colour_ = 0;
141 widget::CellAlignType alignment_ = widget::CellAlignType::kAlignLeft;
142};
143} // namespace gva
144
145#endif // HMICORE_WIDGETS_TABLE_CELL_TYPE_H_
This is the class describing a TableWidget cell.
Definition cell_type.h:27
uint32_t GetWidth() const
Get the Width object.
Definition cell_type.cc:55
std::string GetText() const
Get the Text object.
Definition cell_type.cc:57
uint32_t GetBackgroundColour() const
Get the Background Colour object.
Definition cell_type.cc:63
widget::CellAlignType GetCellAlignment() const
Get the Cell Alignment object.
Definition cell_type.cc:69
CellType()=default
Construct a new Cell Type object.
void SetText(std::string_view text)
Set the Text attribute.
Definition cell_type.cc:59
~CellType()=default
Destroy the Cell Type object.
uint32_t GetForegroundColour() const
Get the Foreground Colour object.
Definition cell_type.cc:61
CellType & operator=(const CellType &a)
Assignment operator.
Definition cell_type.cc:44
uint32_t GetHighlightColour() const
Get the Highlight Colour object.
Definition cell_type.cc:67
uint32_t GetOutlineColour() const
Get the Outline Colour object.
Definition cell_type.cc:65
CellAlignType
Table (see WidgetTable) cell alignment.
Definition widget_types.h:27