Audacity 3.2.0
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 () const override
 
TranslatableString GetDescription () const override
 
template<bool Const>
bool VisitSettings (SettingsVisitorBase< Const > &S)
 
bool VisitSettings (SettingsVisitor &S) override
 
bool VisitSettings (ConstSettingsVisitor &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 () const override
 
VendorSymbol GetVendor () const override
 
wxString GetVersion () const override
 
ComponentInterfaceSymbol GetSymbol () const override=0
 
virtual TranslatableString GetDescription () const override
 
virtual ManualPageID ManualPage ()
 
virtual bool IsBatchProcessing () const
 
virtual void SetBatchProcessing (bool start)
 
virtual bool Apply (const CommandContext &WXUNUSED(context))
 
bool ShowInterface (wxWindow *parent, bool forceModal=false)
 
wxDialog * CreateUI (wxWindow *parent, AudacityCommand *client)
 
bool SaveSettingsAsString (wxString &parms)
 
bool LoadSettingsFromString (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 ()
 
virtual bool VisitSettings (SettingsVisitor &)
 
virtual bool VisitSettings (ConstSettingsVisitor &)
 
- Public Member Functions inherited from ComponentInterface
virtual ~ComponentInterface ()
 
virtual PluginPath GetPath () const =0
 
virtual ComponentInterfaceSymbol GetSymbol () const =0
 
virtual VendorSymbol GetVendor () const =0
 
virtual wxString GetVersion () const =0
 
virtual TranslatableString GetDescription () const =0
 
TranslatableString GetName () const
 

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 }
 
- Protected Attributes inherited from AudacityCommand
ProgressDialogmProgress
 
wxDialog * mUIDialog
 
wxWindow * mUIParent
 

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 82 of file HelpCommand.cpp.

83{
84 if( mFormat == kJson )
85 return ApplyInner( context );
86
87 if( mFormat == kLisp )
88 {
89 CommandContext LispyContext(
90 context.project,
91 std::make_unique<LispifiedCommandOutputTargets>( *context.pOutput.get() )
92 );
93 return ApplyInner( LispyContext );
94 }
95
96 if( mFormat == kBrief )
97 {
98 CommandContext BriefContext(
99 context.project,
100 std::make_unique<BriefCommandOutputTargets>( *context.pOutput.get() )
101 );
102 return ApplyInner( BriefContext );
103 }
104
105 return false;
106}
@ kBrief
Definition: HelpCommand.cpp:42
@ kJson
Definition: HelpCommand.cpp:40
@ kLisp
Definition: HelpCommand.cpp:41
CommandContext provides additional information to an 'Apply()' command. It provides the project,...
AudacityProject & project
std::unique_ptr< CommandOutputTargets > pOutput
bool ApplyInner(const CommandContext &context)

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 108 of file HelpCommand.cpp.

108 {
111 if( ID.empty() )
112 context.Status( "Command not found" );
113 else
114 em.GetCommandDefinition( ID, context, 1);
115 return true;
116}
wxString PluginID
virtual void Status(const wxString &message, bool bFlush=false) const
EffectManager is the class that handles effects and effect categories.
Definition: EffectManager.h:48
void GetCommandDefinition(const PluginID &ID, const CommandContext &context, int flags)
static EffectManager & Get()
const PluginID & GetEffectByIdentifier(const CommandID &strTarget)
wxString mCommandName
Definition: HelpCommand.h:45

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:

◆ GetDescription()

TranslatableString HelpCommand::GetDescription ( ) const
inlineoverridevirtual

Reimplemented from AudacityCommand.

Definition at line 34 of file HelpCommand.h.

34{return XO("Gives help on a command.");};
XO("Cut/Copy/Paste")

References XO().

Here is the call graph for this function:

◆ GetSymbol()

ComponentInterfaceSymbol HelpCommand::GetSymbol ( ) const
inlineoverridevirtual

Implements AudacityCommand.

Definition at line 33 of file HelpCommand.h.

33{return Symbol;};
static const ComponentInterfaceSymbol Symbol
Definition: HelpCommand.h:29

References Symbol.

◆ ManualPage()

ManualPageID HelpCommand::ManualPage ( )
inlineoverridevirtual

Reimplemented from AudacityCommand.

Definition at line 43 of file HelpCommand.h.

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

◆ PopulateOrExchange()

void HelpCommand::PopulateOrExchange ( ShuttleGui S)
override

Definition at line 69 of file HelpCommand.cpp.

70{
71 S.AddSpace(0, 5);
72
73 S.StartMultiColumn(2, wxALIGN_CENTER);
74 {
75 S.TieTextBox(XXO("Command:"),mCommandName);
76 S.TieChoice( XXO("Format:"),
78 }
79 S.EndMultiColumn();
80}
XXO("&Cut/Copy/Paste Toolbar")
@ nFormats
Definition: HelpCommand.cpp:43
static const EnumValueSymbol kFormats[nFormats]
Definition: HelpCommand.cpp:46
TranslatableStrings Msgids(const EnumValueSymbol strings[], size_t nStrings)
Convenience function often useful when adding choice controls.
#define S(N)
Definition: ToChars.cpp:64

References kFormats, mCommandName, mFormat, Msgids(), nFormats, S, and XXO().

Here is the call graph for this function:

◆ VisitSettings() [1/3]

bool HelpCommand::VisitSettings ( ConstSettingsVisitor )
overridevirtual

Visit settings, if defined. false means no defined settings. Default implementation returns false

Reimplemented from AudacityCommand.

Definition at line 66 of file HelpCommand.cpp.

67 { return VisitSettings<true>(S); }

References S.

◆ VisitSettings() [2/3]

bool HelpCommand::VisitSettings ( SettingsVisitor )
overridevirtual

Visit settings, if defined. false means no defined settings. Default implementation returns false

Reimplemented from AudacityCommand.

Definition at line 63 of file HelpCommand.cpp.

64 { return VisitSettings<false>(S); }

References S.

◆ VisitSettings() [3/3]

template<bool Const>
bool HelpCommand::VisitSettings ( SettingsVisitorBase< Const > &  S)

Definition at line 58 of file HelpCommand.cpp.

58 {
59 S.Define( mCommandName, wxT("Command"), wxString{"Help"} );
60 S.DefineEnum( mFormat, wxT("Format"), 0, kFormats, nFormats );
61 return true;
62}
wxT("CloseDown"))

References kFormats, mCommandName, mFormat, nFormats, S, and wxT().

Here is the call graph for this function:

Member Data Documentation

◆ mCommandName

wxString HelpCommand::mCommandName

Definition at line 45 of file HelpCommand.h.

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

◆ mFormat

int HelpCommand::mFormat

Definition at line 30 of file HelpCommand.h.

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

◆ 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: