Audacity  2.2.0
OpenSaveCommands.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4  Audacity(R) is copyright (c) 1999-2009 Audacity Team.
5  File License: wxwidgets
6 
7  OpenSaveCommands.h
8  Stephen Parry
9 
10 ******************************************************************//*******************************************************************/
19 
20 #include "Command.h"
21 #include "CommandType.h"
22 
23 // Open
24 
25 class OpenProjectCommandType final : public CommandType
26 {
27 public:
28  wxString BuildName() override;
29  void BuildSignature(CommandSignature &signature) override;
30  CommandHolder Create(std::unique_ptr<CommandOutputTarget> &&target) override;
31 };
32 
34 {
35 public:
37  std::unique_ptr<CommandOutputTarget> &&target)
38  : CommandImplementation(type, std::move(target))
39  { }
40 
41  virtual ~OpenProjectCommand();
42  bool Apply(CommandExecutionContext context) override;
43 };
44 
45 // Save
46 
47 class SaveProjectCommandType final : public CommandType
48 {
49 public:
50  wxString BuildName() override;
51  void BuildSignature(CommandSignature &signature) override;
52  CommandHolder Create(std::unique_ptr<CommandOutputTarget> &&target) override;
53 };
54 
56 {
57 public:
59  std::unique_ptr<CommandOutputTarget> &&target)
60  : CommandImplementation(type, std::move(target))
61  { }
62 
63  virtual ~SaveProjectCommand();
64  bool Apply(CommandExecutionContext context) override;
65 };
Definition: OpenSaveCommands.h:47
Command for opening an Audacity project.
Definition: OpenSaveCommands.h:33
void BuildSignature(CommandSignature &signature) override
Postcondition: signature is a 'signature' map containing parameter.
Definition: OpenSaveCommands.cpp:71
Definition: OpenSaveCommands.h:25
SaveProjectCommand(CommandType &type, std::unique_ptr< CommandOutputTarget > &&target)
Definition: OpenSaveCommands.h:58
wxString BuildName() override
Definition: OpenSaveCommands.cpp:66
std::shared_ptr< Command > CommandHolder
Definition: AppCommandEvent.h:26
Contains declarations for CommandType class.
Contains declaration of Command base class.
OpenProjectCommand(CommandType &type, std::unique_ptr< CommandOutputTarget > &&target)
Definition: OpenSaveCommands.h:36
is derived from Command. It validates and applies the command. CommandImplementation::Apply() is over...
Definition: Command.h:118
Base class for containing data common to all commands of a given type. Also acts as a factory...
Definition: CommandType.h:29
void BuildSignature(CommandSignature &signature) override
Postcondition: signature is a 'signature' map containing parameter.
Definition: OpenSaveCommands.cpp:27
bool Apply(CommandExecutionContext context) override
Definition: OpenSaveCommands.cpp:40
CommandHolder Create(std::unique_ptr< CommandOutputTarget > &&target) override
Definition: OpenSaveCommands.cpp:35
virtual ~SaveProjectCommand()
Definition: OpenSaveCommands.cpp:99
wxString BuildName() override
Definition: OpenSaveCommands.cpp:22
CommandHolder Create(std::unique_ptr< CommandOutputTarget > &&target) override
Definition: OpenSaveCommands.cpp:83
virtual ~OpenProjectCommand()
Definition: OpenSaveCommands.cpp:61
Represents a context to which a command may be applied.
Definition: Command.h:50
bool Apply(CommandExecutionContext context) override
Definition: OpenSaveCommands.cpp:88
Class that maps parameter names to default values and validators.
Definition: CommandSignature.h:28
Command for saving an Audacity project.
Definition: OpenSaveCommands.h:55