20 #include <Poco/Exception.h>
21 #include <QTextStream>
27 if (categoryListener ==
nullptr)
29 throw ctkInvalidArgumentException(
"Category listener cannot be null");
39 throw Poco::InvalidArgumentException(
40 "The name of a command cannot be empty");
43 const bool definedChanged = !this->
defined;
46 const bool nameChanged = !(this->name ==
name);
49 const bool descriptionChanged = !(this->description ==
description);
53 descriptionChanged, nameChanged));
54 this->FireCategoryChanged(categoryEvent);
59 if (categoryListener ==
nullptr)
61 throw ctkInvalidArgumentException(
"CommandCategory listener cannot be null");
71 QTextStream stringBuffer(&
str);
80 const bool definedChanged =
defined;
83 const bool nameChanged = !
name.isEmpty();
86 const bool descriptionChanged = !
description.isEmpty();
90 descriptionChanged, nameChanged));
91 this->FireCategoryChanged(categoryEvent);
101 if (!categoryEvent) {
102 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)