mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-27 06:01:14 +01:00
Initial UI in src
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <string>
|
||||
#include "color.hpp"
|
||||
using json = nlohmann::json;
|
||||
|
||||
class UI_item {
|
||||
public:
|
||||
UI_item(std::string type);
|
||||
UI_item(std::string id, std::string type, std::string text, uint8_t text_size, Color fg_color, Color bg_color);
|
||||
UI_item(const json& j);
|
||||
|
||||
std::string id() const;
|
||||
std::string type() const;
|
||||
bool is_type(json j);
|
||||
|
||||
void set_text(std::string text);
|
||||
std::string text() const;
|
||||
|
||||
void set_text_size(uint8_t text_size);
|
||||
uint8_t text_size() const;
|
||||
|
||||
void set_fg_color(Color fg_color);
|
||||
Color fg_color() const;
|
||||
|
||||
void set_bg_color(Color bg_color);
|
||||
Color bg_color() const;
|
||||
|
||||
virtual void from_json(const json& j);
|
||||
|
||||
virtual json to_json() const;
|
||||
|
||||
protected:
|
||||
std::string p_id;
|
||||
std::string p_type;
|
||||
std::string p_text;
|
||||
uint8_t p_text_size;
|
||||
Color p_fg_color;
|
||||
Color p_bg_color;
|
||||
};
|
||||
Reference in New Issue
Block a user