Audacity 3.2.0
|
is derived from OldStyleCommand. It validates and applies the command. CommandImplementation::Apply() is overloaded in classes derived from it. More...
#include <Command.h>
Public Member Functions | |
CommandImplementation (AudacityProject &project, OldStyleCommandType &type) | |
virtual | ~CommandImplementation () |
ComponentInterfaceSymbol | GetSymbol () override |
An instance method for getting the command name (for consistency) More... | |
CommandSignature & | GetSignature () override |
Get the signature of the command. More... | |
bool | SetParameter (const wxString ¶mName, const wxVariant ¶mValue) override |
bool | Apply () override |
bool | Apply (const CommandContext &context) override |
Public Member Functions inherited from OldStyleCommand | |
OldStyleCommand (AudacityProject &project) | |
virtual | ~OldStyleCommand () |
virtual ComponentInterfaceSymbol | GetSymbol ()=0 |
virtual CommandSignature & | GetSignature ()=0 |
virtual bool | SetParameter (const wxString ¶mName, const wxVariant ¶mValue) |
virtual bool | Apply ()=0 |
virtual bool | Apply (const CommandContext &context)=0 |
Protected Member Functions | |
void | TypeCheck (const wxString &typeName, const wxString ¶mName, const wxVariant ¶m) |
void | CheckParam (const wxString ¶mName) |
bool | HasParam (const wxString ¶mName) |
bool | GetBool (const wxString ¶mName) |
long | GetLong (const wxString ¶mName) |
double | GetDouble (const wxString ¶mName) |
wxString | GetString (const wxString ¶mName) |
Private Member Functions | |
bool | Valid (const wxString ¶mName, const wxVariant ¶mValue) |
Private Attributes | |
OldStyleCommandType & | mType |
ParamValueMap | mParams |
ParamBoolMap | mSetParams |
Additional Inherited Members | |
Public Attributes inherited from OldStyleCommand | |
AudacityProject & | mProject |
is derived from OldStyleCommand. It validates and applies the command. CommandImplementation::Apply() is overloaded in classes derived from it.
CommandImplementation::CommandImplementation | ( | AudacityProject & | project, |
OldStyleCommandType & | type | ||
) |
Constructor should not be called directly; only by a factory which ensures name and params are set appropriately for the command.
Definition at line 171 of file Command.cpp.
|
virtual |
Definition at line 180 of file Command.cpp.
|
inlineoverridevirtual |
Actually carry out the command. Return true if successful and false otherwise.
Implements OldStyleCommand.
Definition at line 122 of file Command.h.
|
overridevirtual |
Implements OldStyleCommand.
|
protected |
Definition at line 198 of file Command.cpp.
References GetSymbol(), Internal, mParams, and wxT().
Referenced by GetBool(), GetDouble(), GetLong(), and GetString().
|
protected |
Definition at line 216 of file Command.cpp.
References CheckParam(), mParams, TypeCheck(), and wxT().
|
protected |
Definition at line 232 of file Command.cpp.
References CheckParam(), mParams, TypeCheck(), and wxT().
|
protected |
Definition at line 224 of file Command.cpp.
References CheckParam(), mParams, TypeCheck(), and wxT().
|
overridevirtual |
Get the signature of the command.
Implements OldStyleCommand.
Definition at line 255 of file Command.cpp.
References OldStyleCommandType::GetSignature(), and mType.
|
protected |
Definition at line 240 of file Command.cpp.
References CheckParam(), mParams, TypeCheck(), and wxT().
Referenced by BatchEvalCommand::Apply().
|
overridevirtual |
An instance method for getting the command name (for consistency)
Get the name of the command.
Implements OldStyleCommand.
Definition at line 249 of file Command.cpp.
References OldStyleCommandType::GetSymbol(), and mType.
Referenced by CheckParam(), SetParameter(), and TypeCheck().
|
protected |
Definition at line 208 of file Command.cpp.
References mParams, and mSetParams.
|
overridevirtual |
Attempt to one of the command's parameters to a particular value. (Note: wxVariant is reference counted)
Reimplemented from OldStyleCommand.
Definition at line 260 of file Command.cpp.
References _, CommandContext::Error(), Validator::GetConverted(), Validator::GetDescription(), OldStyleCommandType::GetSignature(), GetSymbol(), CommandSignature::GetValidator(), Internal, mParams, OldStyleCommand::mProject, mSetParams, mType, Validator::Validate(), and wxT().
|
protected |
Definition at line 184 of file Command.cpp.
References GetSymbol(), Internal, and wxT().
Referenced by GetBool(), GetDouble(), GetLong(), and GetString().
|
private |
Using the command signature, looks up a possible parameter value and checks whether it passes the validator.
|
private |
Definition at line 81 of file Command.h.
Referenced by CheckParam(), GetBool(), GetDouble(), GetLong(), GetString(), HasParam(), and SetParameter().
|
private |
Definition at line 82 of file Command.h.
Referenced by HasParam(), and SetParameter().
|
private |
Definition at line 80 of file Command.h.
Referenced by GetSignature(), GetSymbol(), and SetParameter().