2022-03-31 21:20:41 +00:00
|
|
|
#ifndef DOMAIN_ATTRIBUTE_H
|
|
|
|
#define DOMAIN_ATTRIBUTE_H
|
|
|
|
|
2022-05-08 12:50:56 +00:00
|
|
|
#include <utility>
|
2022-04-12 21:37:05 +00:00
|
|
|
#include <vector>
|
|
|
|
|
2022-03-31 21:20:41 +00:00
|
|
|
#include "rule.h"
|
|
|
|
#include "value.h"
|
|
|
|
|
|
|
|
namespace domain {
|
|
|
|
|
2022-05-27 06:18:17 +00:00
|
|
|
class Enumeration {
|
|
|
|
std::string name;
|
|
|
|
Value value;
|
|
|
|
public:
|
|
|
|
Enumeration(std::string name, Value value);
|
|
|
|
|
|
|
|
std::string &getName();
|
|
|
|
|
|
|
|
Value getValue();
|
2022-03-31 21:20:41 +00:00
|
|
|
};
|
|
|
|
|
2022-05-27 06:18:17 +00:00
|
|
|
class Popup {
|
|
|
|
public:
|
|
|
|
enum PopupType {
|
|
|
|
AUTOMATIC,
|
|
|
|
ON_DEMAND
|
|
|
|
};
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::string title;
|
|
|
|
std::string text;
|
|
|
|
PopupType type;
|
|
|
|
|
|
|
|
bool enumerated;
|
|
|
|
std::vector<Enumeration> enumeration;
|
|
|
|
std::vector<Rule> rules;
|
|
|
|
|
|
|
|
public:
|
|
|
|
Popup(std::string title, std::string text, PopupType type, std::vector<Rule> rules,
|
|
|
|
std::vector<Enumeration> enumeration);
|
|
|
|
|
|
|
|
std::string getTitle();
|
|
|
|
|
|
|
|
std::string getText();
|
|
|
|
|
|
|
|
PopupType getType();
|
|
|
|
|
|
|
|
std::vector<Rule> getRules();
|
|
|
|
|
|
|
|
bool isEnumerated();
|
|
|
|
|
|
|
|
std::vector<Enumeration> &getEnumeration();
|
|
|
|
|
|
|
|
void setEnumeration(std::vector<Enumeration> enums) {
|
|
|
|
enumerated = true;
|
|
|
|
enumeration = std::move(enums);
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
class Attribute {
|
|
|
|
std::string name;
|
|
|
|
Value defaultValue;
|
|
|
|
std::optional<Popup> popup;
|
|
|
|
public:
|
|
|
|
Attribute(std::string name, Value defaultValue, std::optional<Popup> popup = std::nullopt);
|
|
|
|
|
|
|
|
std::string getName();
|
|
|
|
|
|
|
|
Value getDefault();
|
|
|
|
|
|
|
|
std::optional<Popup> getPopup();
|
|
|
|
};
|
2022-03-31 21:20:41 +00:00
|
|
|
|
|
|
|
} // namespace domain
|
|
|
|
|
|
|
|
#endif // DOMAIN_ATTRIBUTE_H
|