ConfigDataBar class Contains the configuration data for one bar in the window manager Inherits from ConfigDataBase class.
More...
#include <ConfigDataBar.hpp>
ConfigDataBar class Contains the configuration data for one bar in the window manager Inherits from ConfigDataBase class.
- See also
- ConfigDataBase
◆ ConfigDataBar()
ConfigDataBar::ConfigDataBar |
( |
| ) |
|
ConfigDataBar class constructor.
int barBorderSize_
Definition: ConfigDataBar.hpp:108
unsigned int barBorderColor_
Definition: ConfigDataBar.hpp:109
int barSize_
Definition: ConfigDataBar.hpp:102
int barFontSize_
Definition: ConfigDataBar.hpp:106
unsigned int barBackgroundColor_
Definition: ConfigDataBar.hpp:107
std::string barFont_
Definition: ConfigDataBar.hpp:103
unsigned int barFontColor_
Definition: ConfigDataBar.hpp:105
◆ ~ConfigDataBar()
ConfigDataBar::~ConfigDataBar |
( |
| ) |
|
|
overridedefault |
◆ configInit()
void ConfigDataBar::configInit |
( |
const Json::Value & |
root | ) |
|
|
overridevirtual |
Initializes the configuration data for the bar You must call configInit() in each ConfigDataBase Child class to load the data.
- Parameters
-
root | Json::Value& object containing the Bar configuration data |
Implements ConfigDataBase.
47 if (root.empty() || !root.isObject()) {
48 throw std::runtime_error(
"Invalid configuration file");
50 if (root[
"Bar_Size"].empty() || !root[
"Bar_Size"].isInt()) {
55 if (root[
"Font"].empty() || !root[
"Font"].isString()) {
60 if (root[
"Font_Color"].empty() || !root[
"Font_Color"].isString()) {
66 if (root[
"Background_Color"].empty() || !root[
"Background_Color"].isString()) {
72 if (root[
"Border_Color"].empty() || !root[
"Border_Color"].isString()) {
78 if (root[
"Font_Size"].empty() || !root[
"Font_Size"].isInt()) {
83 if (root[
"Border_Size"].empty() || !root[
"Border_Size"].isInt()) {
88 if (root[
"Position"].empty() || !root[
"Position"].isString()) {
93 for (
auto &widget : root[
"Widgets"]) {
94 std::shared_ptr<ConfigDataWidget> widgetData = std::make_shared<ConfigDataWidget>();
95 widgetData->configInit(widget);
98 std::stringstream msg;
@ L_ERROR
Definition: Logger.hpp:51
@ L_INFO
Definition: Logger.hpp:49
std::vector< std::shared_ptr< ConfigDataWidget > > widgets
Definition: ConfigDataBar.hpp:110
std::string barPosition_
Definition: ConfigDataBar.hpp:104
static unsigned long colorCodeToULong(const std::string &colorCode)
Convert a string containing a color code to unsigned long.
Definition: ConfigHandler.cpp:94
virtual void Log(const std::string &message, LogLevel level) const
Log a message This method logs a message to the log file or stream. The message is only logged if the...
Definition: Logger.cpp:73
static Logger * GetInstance()
Get the Logger object.
Definition: Logger.cpp:41
References barBackgroundColor_, barBorderColor_, barBorderSize_, barFont_, barFontColor_, barFontSize_, barPosition_, barSize_, ConfigHandler::colorCodeToULong(), Logger::GetInstance(), L_ERROR, L_INFO, Logger::Log(), and widgets.
◆ configSave()
Json::Value ConfigDataBar::configSave |
( |
| ) |
|
|
overridevirtual |
return a Json::Value object containing the Bar configuration data
Implements ConfigDataBase.
103 return Json::Value();
◆ getBarBackgroundColor()
unsigned int ConfigDataBar::getBarBackgroundColor |
( |
| ) |
const |
◆ getBarBorderColor()
unsigned int ConfigDataBar::getBarBorderColor |
( |
| ) |
const |
◆ getBarBorderSize()
int ConfigDataBar::getBarBorderSize |
( |
| ) |
const |
◆ getBarFont()
const std::string & ConfigDataBar::getBarFont |
( |
| ) |
const |
◆ getBarFontColor()
unsigned int ConfigDataBar::getBarFontColor |
( |
| ) |
const |
◆ getBarFontSize()
int ConfigDataBar::getBarFontSize |
( |
| ) |
const |
◆ getBarPosition()
const std::string & ConfigDataBar::getBarPosition |
( |
| ) |
const |
◆ getBarSize()
int ConfigDataBar::getBarSize |
( |
| ) |
const |
◆ getWidgets()
const std::vector< std::shared_ptr< ConfigDataWidget > > & ConfigDataBar::getWidgets |
( |
| ) |
const |
◆ barBackgroundColor_
unsigned int ConfigDataBar::barBackgroundColor_ |
|
private |
◆ barBorderColor_
unsigned int ConfigDataBar::barBorderColor_ |
|
private |
◆ barBorderSize_
int ConfigDataBar::barBorderSize_ |
|
private |
◆ barFont_
std::string ConfigDataBar::barFont_ |
|
private |
◆ barFontColor_
unsigned int ConfigDataBar::barFontColor_ |
|
private |
◆ barFontSize_
int ConfigDataBar::barFontSize_ |
|
private |
◆ barPosition_
std::string ConfigDataBar::barPosition_ |
|
private |
◆ barSize_
int ConfigDataBar::barSize_ |
|
private |
◆ widgets
The documentation for this class was generated from the following files: