Audacity  2.2.2
CommandType.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity - A Digital Audio Editor
4  Copyright 1999-2009 Audacity Team
5  License: wxwidgets
6 
7  Dan Horgan
8 
9 ******************************************************************//*******************************************************************/
15 
16 #ifndef __COMMANDTYPE__
17 #define __COMMANDTYPE__
18 
19 #include "CommandMisc.h"
20 #include "CommandSignature.h"
21 #include "../MemoryX.h"
22 #include "../commands/AudacityCommand.h"
23 
24 class OldStyleCommand;
25 
26 /**************************************************************/
39 using OldStyleCommandPointer = std::shared_ptr<OldStyleCommand>;
41 class CommandSignature;
42 class wxString;
43 
45 {
46 private:
49 
50 public:
52  virtual ~OldStyleCommandType();
55  wxString Describe(); // for debugging only ?
56 
57  // Subclasses should override the following:
58  // =========================================
59 
60  // Return the name of the command type
61  virtual IdentInterfaceSymbol BuildName() = 0;
62 
64  // names, validators and default values.
65  virtual void BuildSignature(CommandSignature &signature) = 0;
66 
67  // Create a command instance with the specified output target
68  virtual OldStyleCommandPointer Create(std::unique_ptr<CommandOutputTargets> &&target) = 0;
69 };
70 
71 #endif /* End of include guard: __COMMANDTYPE__ */
IdentInterfaceSymbol mSymbol
Definition: CommandType.h:47
CommandOutputTargets a mix of three output classes to output progress indication, status messages and...
virtual ~OldStyleCommandType()
Definition: CommandType.cpp:30
Base class for containing data common to all commands of a given type. Also acts as a factory...
Definition: CommandType.h:44
virtual void BuildSignature(CommandSignature &signature)=0
Postcondition: signature is a 'signature' map containing parameter.
virtual IdentInterfaceSymbol BuildName()=0
Maybe< CommandSignature > mSignature
Definition: CommandType.h:48
CommandSignature & GetSignature()
Definition: CommandType.cpp:41
IdentInterfaceSymbol pairs a persistent string identifier used internally with an optional...
Base class for command in Audacity.
OldStyleCommandPointer is a unique_ptr to an OldStyleCommand.
virtual OldStyleCommandPointer Create(std::unique_ptr< CommandOutputTargets > &&target)=0
Class that maps parameter names to default values and validators.
Declaration of CommandSignature class.
IdentInterfaceSymbol GetSymbol() override
Definition: CommandType.cpp:34
Abstract base class for command interface. This is the version created by Dan Horgan. It was previously a factory for other command classes. It created a separation between the type of a command and the command itself, which is being removed. These Cmmands were managed by CommandDirectory.
Definition: Command.h:33