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;
181 void DefineUncategorizedCategory(
const QString& name,
182 const QString& description);
231 QList<SmartPointer<Command> > GetAllCommands()
const;
266 QList<SmartPointer<CommandCategory> > GetDefinedCategories();
274 QSet<QString> GetDefinedCategoryIds()
const;
282 QSet<QString> GetDefinedCommandIds()
const;
290 QList<SmartPointer<Command> > GetDefinedCommands()
const;
299 QSet<QString> GetDefinedParameterTypeIds()
const;
307 QList<SmartPointer<ParameterType> > GetDefinedParameterTypes();
368 void SetHandlersByCommandId(
383 const QString& helpContextId);
399 void FireNotEnabled(
const QString& commandId,
400 const NotEnabledException* exception);
416 void FireNotDefined(
const QString& commandId,
417 const NotDefinedException* exception);
433 void FirePreExecute(
const QString& commandId,
const SmartPointer<
450 void FirePostExecuteSuccess(
const QString& commandId,
467 void FirePostExecuteFailure(
const QString& commandId,
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;