schema_editor/comdel/domain/attribute.cpp

74 lines
1.7 KiB
C++
Raw Normal View History

2022-03-31 21:20:41 +00:00
#include "attribute.h"
namespace domain {
2022-05-27 06:18:17 +00:00
Enumeration::Enumeration(std::string name, Value value)
: name(name), value(value) {}
std::string &Enumeration::getName() {
return name;
}
Value Enumeration::getValue() {
return value;
}
Popup::Popup(std::string title, std::string text, PopupType type, std::vector<Rule> rules,
std::vector<Enumeration> enumeration)
: title(title), text(text), type(type), rules(rules), enumerated(enumeration.size() > 0),
enumeration(enumeration) {}
std::string Popup::getTitle() {
return title;
}
std::string Popup::getText() {
return text;
}
Popup::PopupType Popup::getType() {
return type;
}
std::vector<Rule> Popup::getRules() {
return rules;
}
bool Popup::isEnumerated() {
return enumerated;
}
std::vector<Enumeration> &Popup::getEnumeration() {
return enumeration;
}
2022-06-14 19:27:40 +00:00
Attribute::Attribute(std::string name, std::optional<std::string> displayName, Value defaultValue, std::optional<Popup> popup)
: name(name), displayName(displayName), defaultValue(defaultValue), popup(popup) {}
std::string Attribute::getDisplayName() {
if(displayName.has_value()) {
return *displayName;
}
return name;
}
2022-05-27 06:18:17 +00:00
std::string Attribute::getName() {
return name;
}
Value Attribute::getDefault() {
return defaultValue;
}
std::optional<Popup> Attribute::getPopup() {
return popup;
}
2022-03-31 21:20:41 +00:00
void Attribute::setPupup(std::optional<Popup> popup) {
this->popup = popup;
}
2022-03-31 21:20:41 +00:00
} // namespace domain