27 const int CommandManagerEvent::CHANGED_CATEGORY_DEFINED = 1;
28 const int CommandManagerEvent::CHANGED_COMMAND_DEFINED = 1 << 1;
29 const int CommandManagerEvent::CHANGED_PARAMETER_TYPE_DEFINED = 1 << 2;
32 const QString& commandId,
const bool commandIdAdded,
33 const bool commandIdChanged,
const QString& categoryId,
34 const bool categoryIdAdded,
const bool categoryIdChanged) :
35 categoryId(categoryId), commandId(commandId), commandManager(commandManager)
42 if (commandIdChanged && (commandId.isEmpty()))
44 throw ctkInvalidArgumentException(
45 "If the list of defined commands changed, then the added/removed command must be mentioned");
48 if (categoryIdChanged && (categoryId.isEmpty()))
50 throw ctkInvalidArgumentException(
51 "If the list of defined categories changed, then the added/removed category must be mentioned");
54 int changedValues = 0;
55 if (categoryIdChanged && categoryIdAdded)
57 changedValues |= CHANGED_CATEGORY_DEFINED;
59 if (commandIdChanged && commandIdAdded)
61 changedValues |= CHANGED_COMMAND_DEFINED;
63 this->changedValues = changedValues;
67 const QString& parameterTypeId,
const bool parameterTypeIdAdded,
68 const bool parameterTypeIdChanged) :
69 parameterTypeId(parameterTypeId), commandManager(commandManager)
77 if (parameterTypeIdChanged && (parameterTypeId.isEmpty()))
79 throw ctkInvalidArgumentException(
80 "If the list of defined command parameter types changed, then the added/removed parameter type must be mentioned");
83 int changedValues = 0;
84 if (parameterTypeIdChanged && parameterTypeIdAdded)
86 changedValues |= CHANGED_PARAMETER_TYPE_DEFINED;
89 this->changedValues = changedValues;
104 return commandManager;
109 return parameterTypeId;
114 return (!categoryId.isEmpty());
119 return (((changedValues & CHANGED_CATEGORY_DEFINED) != 0)
120 && (!categoryId.isEmpty()));
125 return (!commandId.isEmpty());
130 return (((changedValues & CHANGED_COMMAND_DEFINED) != 0)
131 && (!commandId.isEmpty()));
136 return (!parameterTypeId.isEmpty());
141 return (((changedValues & CHANGED_PARAMETER_TYPE_DEFINED) != 0)
142 && (!parameterTypeId.isEmpty()));
CommandManager & GetCommandManager() const
QString GetCategoryId() const
bool IsParameterTypeChanged() const
bool IsCategoryChanged() const
CommandManagerEvent(CommandManager &commandManager, const QString &commandId, const bool commandIdAdded, const bool commandIdChanged, const QString &categoryId, const bool categoryIdAdded, const bool categoryIdChanged)
bool IsCategoryDefined() const
bool IsCommandDefined() const
bool IsCommandChanged() const
QString GetParameterTypeId() const
bool IsParameterTypeDefined() const
QString GetCommandId() const