17 #ifndef BERRYCOMMANDMANAGER_H_
18 #define BERRYCOMMANDMANAGER_H_
28 #include <QScopedPointer>
37 class ParameterizedCommand;
38 class Parameterization;
40 class CommandCategory;
71 void NotDefined(
const QString& commandId,
72 const NotDefinedException* exception)
override;
74 void NotEnabled(
const QString& commandId,
75 const NotEnabledException* exception)
override;
77 void NotHandled(
const QString& commandId,
78 const NotHandledException* exception)
override;
80 void PostExecuteFailure(
const QString& commandId,
81 const ExecutionException* exception)
override;
83 void PostExecuteSuccess(
const QString& commandId,
86 void PreExecute(
const QString& commandId,
const SmartPointer<
107 QScopedPointer<ICommandCategoryListener> categoryListener;
122 QScopedPointer<ICommandListener> commandListener;
129 void ParameterTypeChanged(
138 QScopedPointer<IParameterTypeListener> parameterTypeListener;
185 void DefineUncategorizedCategory(
const QString& name,
186 const QString& description);
235 QList<SmartPointer<Command> > GetAllCommands()
const;
270 QList<SmartPointer<CommandCategory> > GetDefinedCategories();
278 QSet<QString> GetDefinedCategoryIds()
const;
286 QSet<QString> GetDefinedCommandIds()
const;
294 QList<SmartPointer<Command> > GetDefinedCommands()
const;
303 QSet<QString> GetDefinedParameterTypeIds()
const;
311 QList<SmartPointer<ParameterType> > GetDefinedParameterTypes();
372 void SetHandlersByCommandId(
387 const QString& helpContextId);
403 void FireNotEnabled(
const QString& commandId,
404 const NotEnabledException* exception);
420 void FireNotDefined(
const QString& commandId,
421 const NotDefinedException* exception);
437 void FirePreExecute(
const QString& commandId,
const SmartPointer<
454 void FirePostExecuteSuccess(
const QString& commandId,
471 void FirePostExecuteFailure(
const QString& commandId,
472 const ExecutionException* exception);
526 static QString Unescape(
const QString& escapedText);
533 QHash<QString, SmartPointer<CommandCategory> > categoriesById;
539 QSet<QString> definedCategoryIds;
546 QSet<QString> definedParameterTypeIds;
553 QScopedPointer<IExecutionListenerWithChecks> executionListener;
571 QHash<WeakPointer<IHandler>, QString> helpContextIdsByHandler;
578 QHash<QString, SmartPointer<ParameterType> > parameterTypesById;
588 void FireCommandManagerChanged(
606 QList<Parameterization> GetParameterizations(
607 const QString& serializedParameters,
626 int UnescapedIndexOf(
const QString& escapedText,
const char ch)
const;
static MsgHandler handler
static const char PARAMETER_START_CHAR
QSet< SmartPointer< HandleObject > > HandleObjectsSet
static const char ESCAPE_CHAR
static const char PARAMETER_END_CHAR
static const char PARAMETER_SEPARATOR_CHAR
static const QString AUTOGENERATED_CATEGORY_ID
static const char ID_VALUE_CHAR
QHash< QString, SmartPointer< HandleObject > > HandleObjectsByIdMap