Audacity  3.0.3
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
HelpCommand Class Reference

Command to get help about other commands. More...

#include <HelpCommand.h>

Inheritance diagram for HelpCommand:
[legend]
Collaboration diagram for HelpCommand:
[legend]

Public Member Functions

ComponentInterfaceSymbol GetSymbol () override
 
TranslatableString GetDescription () override
 
bool DefineParams (ShuttleParams &S) override
 
void PopulateOrExchange (ShuttleGui &S) override
 
bool Apply (const CommandContext &context) override
 
bool ApplyInner (const CommandContext &context)
 
ManualPageID ManualPage () override
 
- Public Member Functions inherited from AudacityCommand
 AudacityCommand ()
 
virtual ~AudacityCommand ()
 
PluginPath GetPath () override
 
VendorSymbol GetVendor () override
 
wxString GetVersion () override
 
virtual bool IsBatchProcessing ()
 
virtual void SetBatchProcessing (bool start)
 
virtual bool Apply (const CommandContext &WXUNUSED(context))
 
bool ShowInterface (wxWindow *parent, bool forceModal=false)
 
virtual void SetHostUI (EffectUIHostInterface *WXUNUSED(host))
 
wxDialog * CreateUI (wxWindow *parent, AudacityCommand *client)
 
virtual bool GetAutomationParameters (wxString &parms)
 
virtual bool SetAutomationParameters (const wxString &parms)
 
bool DoAudacityCommand (wxWindow *parent, const CommandContext &context, bool shouldPrompt=true)
 
int MessageBox (const TranslatableString &message, long style=DefaultMessageBoxStyle, const TranslatableString &titleStr={})
 
virtual bool Init ()
 
virtual bool PromptUser (wxWindow *parent)
 
virtual bool CheckWhetherSkipAudacityCommand ()
 
virtual void End ()
 
virtual void PopulateOrExchange (ShuttleGui &WXUNUSED(S))
 
virtual bool TransferDataToWindow ()
 
virtual bool TransferDataFromWindow ()
 
- Public Member Functions inherited from ComponentInterface
virtual ~ComponentInterface ()
 
TranslatableString GetName ()
 
virtual bool DefineParams (ShuttleParams &WXUNUSED(S))
 

Public Attributes

int mFormat
 
wxString mCommandName
 

Static Public Attributes

static const ComponentInterfaceSymbol Symbol { XO("Help") }
 

Additional Inherited Members

- Public Types inherited from AudacityCommand
enum  : long { DefaultMessageBoxStyle = wxOK | wxCENTRE }
 
using VetoDialogHook = bool(*)(wxDialog *)
 
- Static Public Member Functions inherited from AudacityCommand
static VetoDialogHook SetVetoDialogHook (VetoDialogHook hook)
 
- Protected Attributes inherited from AudacityCommand
ProgressDialogmProgress
 
wxDialog * mUIDialog
 
wxWindow * mUIParent
 
int mUIResultID
 

Detailed Description

Command to get help about other commands.

Command which returns information about the given command.

Definition at line 26 of file HelpCommand.h.

Member Function Documentation

◆ Apply()

bool HelpCommand::Apply ( const CommandContext context)
override

Definition at line 74 of file HelpCommand.cpp.

75 {
76  if( mFormat == kJson )
77  return ApplyInner( context );
78 
79  if( mFormat == kLisp )
80  {
81  CommandContext LispyContext(
82  context.project,
83  std::make_unique<LispifiedCommandOutputTargets>( *context.pOutput.get() )
84  );
85  return ApplyInner( LispyContext );
86  }
87 
88  if( mFormat == kBrief )
89  {
90  CommandContext BriefContext(
91  context.project,
92  std::make_unique<BriefCommandOutputTargets>( *context.pOutput.get() )
93  );
94  return ApplyInner( BriefContext );
95  }
96 
97  return false;
98 }

References ApplyInner(), kBrief, kJson, kLisp, mFormat, CommandContext::pOutput, and CommandContext::project.

Here is the call graph for this function:

◆ ApplyInner()

bool HelpCommand::ApplyInner ( const CommandContext context)

Definition at line 100 of file HelpCommand.cpp.

100  {
103  if( ID.empty() )
104  context.Status( "Command not found" );
105  else
106  em.GetCommandDefinition( ID, context, 1);
107  return true;
108 }

References EffectManager::Get(), EffectManager::GetCommandDefinition(), EffectManager::GetEffectByIdentifier(), mCommandName, and CommandContext::Status().

Referenced by Apply().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DefineParams()

bool HelpCommand::DefineParams ( ShuttleParams S)
override

Definition at line 55 of file HelpCommand.cpp.

55  {
56  S.Define( mCommandName, wxT("Command"), "Help" );
57  S.DefineEnum( mFormat, wxT("Format"), 0, kFormats, nFormats );
58  return true;
59 }

References ShuttleParams::Define(), ShuttleParams::DefineEnum(), kFormats, mCommandName, mFormat, and nFormats.

Here is the call graph for this function:

◆ GetDescription()

TranslatableString HelpCommand::GetDescription ( )
inlineoverridevirtual

Reimplemented from AudacityCommand.

Definition at line 34 of file HelpCommand.h.

34 {return XO("Gives help on a command.");};

References XO.

◆ GetSymbol()

ComponentInterfaceSymbol HelpCommand::GetSymbol ( )
inlineoverridevirtual

Implements AudacityCommand.

Definition at line 33 of file HelpCommand.h.

33 {return Symbol;};

References Symbol.

◆ ManualPage()

ManualPageID HelpCommand::ManualPage ( )
inlineoverridevirtual

Reimplemented from AudacityCommand.

Definition at line 41 of file HelpCommand.h.

41 {return L"Extra_Menu:_Scriptables_II#help";}

◆ PopulateOrExchange()

void HelpCommand::PopulateOrExchange ( ShuttleGui S)
override

Definition at line 61 of file HelpCommand.cpp.

62 {
63  S.AddSpace(0, 5);
64 
65  S.StartMultiColumn(2, wxALIGN_CENTER);
66  {
67  S.TieTextBox(XXO("Command:"),mCommandName);
68  S.TieChoice( XXO("Format:"),
70  }
71  S.EndMultiColumn();
72 }

References ShuttleGui::AddSpace(), ShuttleGuiBase::EndMultiColumn(), kFormats, mCommandName, mFormat, Msgids(), nFormats, ShuttleGuiBase::StartMultiColumn(), ShuttleGuiBase::TieChoice(), ShuttleGuiBase::TieTextBox(), and XXO.

Here is the call graph for this function:

Member Data Documentation

◆ mCommandName

wxString HelpCommand::mCommandName

Definition at line 43 of file HelpCommand.h.

Referenced by ApplyInner(), DefineParams(), and PopulateOrExchange().

◆ mFormat

int HelpCommand::mFormat

Definition at line 30 of file HelpCommand.h.

Referenced by Apply(), DefineParams(), and PopulateOrExchange().

◆ Symbol

const ComponentInterfaceSymbol HelpCommand::Symbol { XO("Help") }
static

Definition at line 29 of file HelpCommand.h.

Referenced by GetSymbol().


The documentation for this class was generated from the following files:
HelpCommand::ApplyInner
bool ApplyInner(const CommandContext &context)
Definition: HelpCommand.cpp:100
kLisp
@ kLisp
Definition: HelpCommand.cpp:38
ShuttleGui::AddSpace
wxSizerItem * AddSpace(int width, int height, int prop=0)
Definition: ShuttleGui.cpp:2459
XO
#define XO(s)
Definition: Internat.h:31
ShuttleGuiBase::EndMultiColumn
void EndMultiColumn()
Definition: ShuttleGui.cpp:1238
EffectManager::Get
static EffectManager & Get()
Definition: EffectManager.cpp:42
kJson
@ kJson
Definition: HelpCommand.cpp:37
ShuttleGuiBase::TieTextBox
wxTextCtrl * TieTextBox(const TranslatableString &Caption, wxString &Value, const int nChars=0)
Definition: ShuttleGui.cpp:1652
CommandContext::Status
virtual void Status(const wxString &message, bool bFlush=false) const
Definition: CommandContext.cpp:63
XXO
#define XXO(s)
Definition: Internat.h:44
EffectManager
EffectManager is the class that handles effects and effect categories.
Definition: EffectManager.h:46
CommandContext
CommandContext provides additional information to an 'Apply()' command. It provides the project,...
Definition: CommandContext.h:34
ShuttleGuiBase::StartMultiColumn
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)
Definition: ShuttleGui.cpp:1229
nFormats
@ nFormats
Definition: HelpCommand.cpp:40
PluginID
wxString PluginID
Definition: EffectManager.h:30
ShuttleParams::DefineEnum
virtual void DefineEnum(int &var, const wxChar *key, const int vdefault, const EnumValueSymbol strings[], size_t nStrings)
Definition: Shuttle.cpp:339
Msgids
TranslatableStrings Msgids(const EnumValueSymbol strings[], size_t nStrings)
Convenience function often useful when adding choice controls.
Definition: ShuttleGui.cpp:2522
HelpCommand::Symbol
static const ComponentInterfaceSymbol Symbol
Definition: HelpCommand.h:29
HelpCommand::mFormat
int mFormat
Definition: HelpCommand.h:30
kBrief
@ kBrief
Definition: HelpCommand.cpp:39
EffectManager::GetEffectByIdentifier
const PluginID & GetEffectByIdentifier(const CommandID &strTarget)
Definition: EffectManager.cpp:821
EffectManager::GetCommandDefinition
void GetCommandDefinition(const PluginID &ID, const CommandContext &context, int flags)
Definition: EffectManager.cpp:163
HelpCommand::mCommandName
wxString mCommandName
Definition: HelpCommand.h:43
ShuttleParams::Define
virtual void Define(bool &var, const wxChar *key, const bool vdefault, const bool vmin=false, const bool vmax=false, const bool vscl=false)
Definition: Shuttle.cpp:332
CommandContext::project
AudacityProject & project
Definition: CommandContext.h:64
ShuttleGuiBase::TieChoice
wxChoice * TieChoice(const TranslatableString &Prompt, TranslatableString &Selected, const TranslatableStrings &choices)
Definition: ShuttleGui.cpp:1727
kFormats
static const EnumValueSymbol kFormats[nFormats]
Definition: HelpCommand.cpp:43
CommandContext::pOutput
std::unique_ptr< CommandOutputTargets > pOutput
Definition: CommandContext.h:65