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 ******************************************************************//** 12 13 \class GetPreferenceCommand 14 \brief Command for getting the value of a preference 15 16 \class SetPreferenceCommand 17 \brief Command for setting a preference to a given value 18 19 *//*******************************************************************/ 20 21 #ifndef __PREFERENCE_COMMANDS__ 22 #define __PREFERENCE_COMMANDS__ 23 24 #include "Command.h" 25 #include "CommandType.h" 26 27 // GetPreference 28 29 class GetPreferenceCommand final : public AudacityCommand 30 { 31 public: 32 static const ComponentInterfaceSymbol Symbol; 33 34 // ComponentInterface overrides GetSymbol()35 ComponentInterfaceSymbol GetSymbol() override {return Symbol;}; GetDescription()36 TranslatableString GetDescription() override {return XO("Gets the value of a single preference.");}; 37 bool DefineParams( ShuttleParams & S ) override; 38 void PopulateOrExchange(ShuttleGui & S) override; 39 bool Apply(const CommandContext & context) override; 40 41 // AudacityCommand overrides ManualPage()42 ManualPageID ManualPage() override {return L"Extra_Menu:_Scriptables_I#get_preference";} 43 44 wxString mName; 45 }; 46 47 // SetPreference 48 49 class SetPreferenceCommand final : public AudacityCommand 50 { 51 public: 52 static const ComponentInterfaceSymbol Symbol; 53 54 // ComponentInterface overrides GetSymbol()55 ComponentInterfaceSymbol GetSymbol() override {return Symbol;}; GetDescription()56 TranslatableString GetDescription() override {return XO("Sets the value of a single preference.");}; 57 bool DefineParams( ShuttleParams & S ) override; 58 void PopulateOrExchange(ShuttleGui & S) override; 59 bool Apply(const CommandContext & context) override; 60 61 // AudacityCommand overrides ManualPage()62 ManualPageID ManualPage() override {return L"Extra_Menu:_Scriptables_I#set_preference";} 63 64 wxString mName; 65 wxString mValue; 66 bool mbReload; 67 bool bHasReload; 68 }; 69 70 #endif /* End of include guard: __PREFERENCE_COMMANDS__ */ 71