16 #include <Poco/Exception.h> 17 #include <QTextStream> 23 if (categoryListener ==
nullptr)
25 throw ctkInvalidArgumentException(
"Category listener cannot be null");
35 throw Poco::InvalidArgumentException(
36 "The name of a command cannot be empty");
39 const bool definedChanged = !this->
defined;
42 const bool nameChanged = !(this->name ==
name);
45 const bool descriptionChanged = !(this->description ==
description);
49 descriptionChanged, nameChanged));
50 this->FireCategoryChanged(categoryEvent);
55 if (categoryListener ==
nullptr)
57 throw ctkInvalidArgumentException(
"CommandCategory listener cannot be null");
67 QTextStream stringBuffer(&
str);
76 const bool definedChanged =
defined;
79 const bool nameChanged = !
name.isEmpty();
82 const bool descriptionChanged = !
description.isEmpty();
86 descriptionChanged, nameChanged));
87 this->FireCategoryChanged(categoryEvent);
98 throw ctkInvalidArgumentException(
"Command category event cannot be null");
void RemoveListener(ICommandCategoryListener *listener)
void AddListener(ICommandCategoryListener *listener)
QString ToString() const override
CommandCategory(const QString &id)
void Define(const QString &name, const QString &description)
void AddCategoryListener(ICommandCategoryListener *categoryListener)
void RemoveCategoryListener(ICommandCategoryListener *categoryListener)