Audacity 3.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
24class wxString;
25class wxVariant;
26class Validator;
27
28class AUDACITY_DLL_API CommandSignature
29{
30private:
35public:
36 explicit CommandSignature();
38
39 // Add a parameter to the signature.
40 // name: the parameter name (case-sensitive)
41 // dft: a default value
42 // valid: a suitable validator (caller doesn't need to DELETE it)
43 void AddParameter(const wxString &name,
44 const wxVariant &dft,
45 std::unique_ptr<Validator> &&valid);
46
47 // Methods for accessing the signature
48 ParamValueMap GetDefaults() const;
49 Validator &GetValidator(const wxString &paramName);
50};
51
52#endif /* End of include guard: __COMMANDSIGNATURE__ */
std::map< wxString, std::unique_ptr< Validator > > ValidatorMap
Definition: CommandMisc.h:32
std::map< wxString, wxVariant > ParamValueMap
Definition: CommandMisc.h:23
const TranslatableString name
Definition: Distortion.cpp:74
Class that maps parameter names to default values and validators.
CommandSignature & operator=(const CommandSignature &) PROHIBITED
ParamValueMap mDefaults
ValidatorMap mValidators
CommandSignature(const CommandSignature &) PROHIBITED
A Validator is an object which checks whether a wxVariant satisfies a certain criterion....
Definition: Validators.h:53