Audacity  2.2.0
CommandSignature.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 ******************************************************************//*******************************************************************/
18 
19 #ifndef __COMMANDSIGNATURE__
20 #define __COMMANDSIGNATURE__
21 
22 #include "CommandMisc.h"
23 
24 class wxString;
25 class wxVariant;
26 class Validator;
27 
29 {
30 private:
33  explicit CommandSignature(const CommandSignature & WXUNUSED(other)) { }
34 public:
35  explicit CommandSignature() { }
37 
38  // Add a parameter to the signature.
39  // name: the parameter name (case-sensitive)
40  // dft: a default value
41  // valid: a suitable validator (caller doesn't need to DELETE it)
42  void AddParameter(const wxString &name,
43  const wxVariant &dft,
44  movable_ptr<Validator> &&valid);
45 
46  // Methods for accessing the signature
47  ParamValueMap GetDefaults() const;
48  Validator &GetValidator(const wxString &paramName);
49 };
50 
51 #endif /* End of include guard: __COMMANDSIGNATURE__ */
std::unique_ptr< T > movable_ptr
Definition: MemoryX.h:683
std::map< wxString, wxVariant > ParamValueMap
Definition: CommandMisc.h:23
ValidatorMap mValidators
Definition: CommandSignature.h:32
void AddParameter(const wxString &name, const wxVariant &dft, movable_ptr< Validator > &&valid)
Definition: CommandSignature.cpp:25
ParamValueMap GetDefaults() const
Definition: CommandSignature.cpp:42
~CommandSignature()
Definition: CommandSignature.cpp:21
CommandSignature()
Definition: CommandSignature.h:35
std::map< wxString, movable_ptr< Validator > > ValidatorMap
Definition: CommandMisc.h:31
const wxChar * name
Definition: Distortion.cpp:94
CommandSignature(const CommandSignature &WXUNUSED(other))
Definition: CommandSignature.h:33
Validator & GetValidator(const wxString &paramName)
Definition: CommandSignature.cpp:47
Class that maps parameter names to default values and validators.
Definition: CommandSignature.h:28
ParamValueMap mDefaults
Definition: CommandSignature.h:31
A Validator is an object which checks whether a wxVariant satisfies a certain criterion. This is a base validator which allows anything.
Definition: Validators.h:48