13 #ifndef BERRYCOMMANDMANAGER_H_
14 #define BERRYCOMMANDMANAGER_H_
24 #include <QScopedPointer>
33 class ParameterizedCommand;
34 class Parameterization;
36 class CommandCategory;
67 void NotDefined(
const QString& commandId,
68 const NotDefinedException* exception)
override;
70 void NotEnabled(
const QString& commandId,
71 const NotEnabledException* exception)
override;
73 void NotHandled(
const QString& commandId,
74 const NotHandledException* exception)
override;
76 void PostExecuteFailure(
const QString& commandId,
77 const ExecutionException* exception)
override;
79 void PostExecuteSuccess(
const QString& commandId,
82 void PreExecute(
const QString& commandId,
const SmartPointer<
103 QScopedPointer<ICommandCategoryListener> categoryListener;
118 QScopedPointer<ICommandListener> commandListener;
125 void ParameterTypeChanged(
134 QScopedPointer<IParameterTypeListener> parameterTypeListener;
182 const QString& description);
383 const QString& helpContextId);
400 const NotEnabledException* exception);
417 const NotDefinedException* exception);
468 const ExecutionException* exception);
522 static QString Unescape(
const QString& escapedText);
529 QHash<QString, SmartPointer<CommandCategory> > categoriesById;
535 QSet<QString> definedCategoryIds;
542 QSet<QString> definedParameterTypeIds;
549 QScopedPointer<IExecutionListenerWithChecks> executionListener;
567 QHash<WeakPointer<IHandler>, QString> helpContextIdsByHandler;
574 QHash<QString, SmartPointer<ParameterType> > parameterTypesById;
584 void FireCommandManagerChanged(
602 QList<Parameterization> GetParameterizations(
603 const QString& serializedParameters,
622 int UnescapedIndexOf(
const QString& escapedText,
const char ch)
const;
static const char ID_VALUE_CHAR
QString GetHelpContextId(const SmartPointer< const Command > command) const
void FirePostExecuteFailure(const QString &commandId, const ExecutionException *exception)
static const char PARAMETER_START_CHAR
QList< SmartPointer< Command > > GetAllCommands() const
void AddExecutionListener(IExecutionListener *listener)
void RemoveCommandManagerListener(ICommandManagerListener *listener)
void AddCommandManagerListener(ICommandManagerListener *listener)
static const char PARAMETER_END_CHAR
void FireNotDefined(const QString &commandId, const NotDefinedException *exception)
SmartPointer< CommandCategory > GetCategory(const QString &categoryId)
QList< SmartPointer< Command > > GetDefinedCommands() const
static const char ESCAPE_CHAR
QSet< QString > GetDefinedCategoryIds() const
SmartPointer< ParameterizedCommand > Deserialize(const QString &serializedParameterizedCommand)
static const QString AUTOGENERATED_CATEGORY_ID
void SetHandlersByCommandId(const QHash< QString, SmartPointer< IHandler > > &handlersByCommandId)
void FirePreExecute(const QString &commandId, const SmartPointer< const ExecutionEvent > event)
QList< SmartPointer< ParameterType > > GetDefinedParameterTypes()
void RemoveExecutionListener(IExecutionListener *listener)
SmartPointer< ParameterType > GetParameterType(const QString ¶meterTypeId)
static const char PARAMETER_SEPARATOR_CHAR
QSet< QString > GetDefinedParameterTypeIds() const
void SetHelpContextId(const SmartPointer< IHandler > handler, const QString &helpContextId)
void FireNotEnabled(const QString &commandId, const NotEnabledException *exception)
SmartPointer< Command > GetCommand(const QString &commandId)
void FirePostExecuteSuccess(const QString &commandId, Object::Pointer returnValue)
QSet< QString > GetDefinedCommandIds() const
void DefineUncategorizedCategory(const QString &name, const QString &description)
QList< SmartPointer< CommandCategory > > GetDefinedCategories()
QHash< QString, SmartPointer< HandleObject > > HandleObjectsByIdMap
QSet< SmartPointer< HandleObject > > HandleObjectsSet
Implements transparent reference counting.