Audacity 3.2.0
PreferenceCommands.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4 Audacity(R) is copyright (c) 1999-2018 Audacity Team.
5 File License: wxwidgets
6
7 PreferenceCommands.h
8 Dan Horgan
9 James Crook
10
11******************************************************************//*******************************************************************/
20
21#ifndef __PREFERENCE_COMMANDS__
22#define __PREFERENCE_COMMANDS__
23
24#include "Command.h"
25#include "CommandType.h"
26
27// GetPreference
28
30{
31public:
33
34 // ComponentInterface overrides
35 ComponentInterfaceSymbol GetSymbol() const override {return Symbol;};
36 TranslatableString GetDescription() const override {return XO("Gets the value of a single preference.");};
37 template<bool Const> bool VisitSettings( SettingsVisitorBase<Const> &S );
38 bool VisitSettings( SettingsVisitor & S ) override;
39 bool VisitSettings( ConstSettingsVisitor & S ) override;
40 void PopulateOrExchange(ShuttleGui & S) override;
41 bool Apply(const CommandContext & context) override;
42
43 // AudacityCommand overrides
44 ManualPageID ManualPage() override {return L"Extra_Menu:_Scriptables_I#get_preference";}
45
46 wxString mName;
47};
48
49// SetPreference
50
52{
53public:
55
56 // ComponentInterface overrides
57 ComponentInterfaceSymbol GetSymbol() const override {return Symbol;};
58 TranslatableString GetDescription() const override {return XO("Sets the value of a single preference.");};
59 template<bool Const> bool VisitSettings( SettingsVisitorBase<Const> &S );
60 bool VisitSettings( SettingsVisitor & S ) override;
61 bool VisitSettings( ConstSettingsVisitor & S ) override;
62 void PopulateOrExchange(ShuttleGui & S) override;
63 bool Apply(const CommandContext & context) override;
64
65 // AudacityCommand overrides
66 ManualPageID ManualPage() override {return L"Extra_Menu:_Scriptables_I#set_preference";}
67
68 wxString mName;
69 wxString mValue;
72};
73
74#endif /* End of include guard: __PREFERENCE_COMMANDS__ */
Contains declaration of Command base class.
Contains declarations for CommandType class.
XO("Cut/Copy/Paste")
#define S(N)
Definition: ToChars.cpp:64
Base class for command in Audacity.
CommandContext provides additional information to an 'Apply()' command. It provides the project,...
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Command for getting the value of a preference.
static const ComponentInterfaceSymbol Symbol
bool VisitSettings(SettingsVisitorBase< Const > &S)
bool Apply(const CommandContext &context) override
TranslatableString GetDescription() const override
ComponentInterfaceSymbol GetSymbol() const override
void PopulateOrExchange(ShuttleGui &S) override
ManualPageID ManualPage() override
Command for setting a preference to a given value.
TranslatableString GetDescription() const override
bool Apply(const CommandContext &context) override
void PopulateOrExchange(ShuttleGui &S) override
bool VisitSettings(SettingsVisitorBase< Const > &S)
static const ComponentInterfaceSymbol Symbol
ManualPageID ManualPage() override
ComponentInterfaceSymbol GetSymbol() const override
Visitor of effect or command parameters. This is a base class with lots of virtual functions that do ...
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640
Holds a msgid for the translation catalog; may also bind format arguments.