YggdrasilWM  0.1.1
A tiny window manager coded in C++
ConfigDataBars.hpp
Go to the documentation of this file.
1 
27 #ifndef YGGDRASILWM_CONFIGDATABARS_HPP
28 #define YGGDRASILWM_CONFIGDATABARS_HPP
29 
30 #include "ConfigDataBase.hpp"
31 #include "json/json.h"
32 #include <string>
33 #include <vector>
34 #include <set>
35 #include <unordered_map>
36 
37 class ConfigDataBar;
43 public:
53  ~ConfigDataBars() override;
62  void configInit(const Json::Value& root_) override;
67  Json::Value configSave() override;
73  std::shared_ptr<ConfigDataBar> getBar(int index);
78  void addBar(const std::string& barName, std::shared_ptr<ConfigDataBar> bar);
84  void removeBar(int index);
89  [[nodiscard]] const std::vector<std::shared_ptr<ConfigDataBar>> & getBars() const;
90 private:
91  std::vector<std::shared_ptr<ConfigDataBar>> bars_;
92 
93 };
94 
95 #endif //YGGDRASILWM_CONFIGDATABARS_HPP
ConfigDataBase class header. This class is an interface for the ConfigData classes.
ConfigDataBar class Contains the configuration data for one bar in the window manager Inherits from C...
Definition: ConfigDataBar.hpp:41
ConfigDataBars class.
Definition: ConfigDataBars.hpp:42
void removeBar(int index)
Remove the Bar object at index.
Definition: ConfigDataBars.cpp:51
ConfigDataBars()
Construct a new ConfigDataBars object.
Definition: ConfigDataBars.cpp:32
std::vector< std::shared_ptr< ConfigDataBar > > bars_
Definition: ConfigDataBars.hpp:91
void addBar(const std::string &barName, std::shared_ptr< ConfigDataBar > bar)
Add a new Bar object to the ConfigDataBars object.
Definition: ConfigDataBars.cpp:50
std::shared_ptr< ConfigDataBar > getBar(int index)
Get the Bar object at index.
Definition: ConfigDataBars.cpp:49
const std::vector< std::shared_ptr< ConfigDataBar > > & getBars() const
Get the Bars object.
Definition: ConfigDataBars.cpp:52
~ConfigDataBars() override
Destroy the ConfigDataBars object.
Definition: ConfigDataBars.cpp:54
Json::Value configSave() override
return a Json::Value object containing the Bars configuration data
Definition: ConfigDataBars.cpp:46
void configInit(const Json::Value &root_) override
Initialize the ConfigDataBars object You must call configInit() in each ConfigDataBase Child class to...
Definition: ConfigDataBars.cpp:33
ConfigDataBase class This class is an interface for the ConfigData classes This is a pure virtual cla...
Definition: ConfigDataBase.hpp:38