Audacity 3.2.0
Public Member Functions | Public Attributes | List of all members
MenuRegistry::CommandItem Struct Referencefinal

#include <MenuRegistry.h>

Inheritance diagram for MenuRegistry::CommandItem:
[legend]
Collaboration diagram for MenuRegistry::CommandItem:
[legend]

Public Member Functions

 CommandItem (const CommandID &name_, const TranslatableString &label_in_, CommandFunctorPointer callback_, CommandFlag flags_, const Options &options_, CommandHandlerFinder finder_)
 
template<typename Handler >
 CommandItem (const CommandID &name, const TranslatableString &label_in, void(Handler::*pmf)(const CommandContext &), CommandFlag flags, const Options &options={}, CommandHandlerFinder finder=FinderScope::DefaultFinder())
 
 CommandItem (const CommandID &name, const TranslatableString &label_in, CommandFunctorPointer::NonMemberFn callback, CommandFlag flags, const Options &options={})
 
 ~CommandItem () override
 
- Public Member Functions inherited from Registry::SingleItem
 ~SingleItem () override=0
 
- Public Member Functions inherited from Registry::detail::BaseItem
 BaseItem (const Identifier &internalName)
 
virtual ~BaseItem ()
 

Public Attributes

const TranslatableString label_in
 
CommandHandlerFinder finder
 
CommandFunctorPointer callback
 
CommandFlag flags
 
Options options
 
- Public Attributes inherited from Registry::detail::BaseItem
const Identifier name
 
OrderingHint orderingHint
 

Detailed Description

Definition at line 281 of file MenuRegistry.h.

Constructor & Destructor Documentation

◆ CommandItem() [1/3]

MenuRegistry::CommandItem::CommandItem ( const CommandID name_,
const TranslatableString label_in_,
CommandFunctorPointer  callback_,
CommandFlag  flags_,
const Options options_,
CommandHandlerFinder  finder_ 
)

Definition at line 134 of file MenuRegistry.cpp.

140: SingleItem{ name_ }, label_in{ label_in_ }
141, finder{ finder_ }, callback{ callback_ }
142, flags{ flags_ }, options{ options_ }
143{}
CommandHandlerFinder finder
Definition: MenuRegistry.h:322
CommandFunctorPointer callback
Definition: MenuRegistry.h:323
const TranslatableString label_in
Definition: MenuRegistry.h:321
Common abstract base class for items that are not groups.
Definition: Registry.h:224

◆ CommandItem() [2/3]

template<typename Handler >
MenuRegistry::CommandItem::CommandItem ( const CommandID name,
const TranslatableString label_in,
void(Handler::*)(const CommandContext &)  pmf,
CommandFlag  flags,
const Options options = {},
CommandHandlerFinder  finder = FinderScope::DefaultFinder() 
)
inline
Precondition
finder != nullptr

Definition at line 295 of file MenuRegistry.h.

299 {},
303 static_cast<CommandFunctorPointer::MemberFn>(pmf) },
305 { assert(finder); }
std::function< CommandHandlerObject &(AudacityProject &) > CommandHandlerFinder
static CommandHandlerFinder DefaultFinder()
Definition: MenuRegistry.h:271
CommandItem(const CommandID &name_, const TranslatableString &label_in_, CommandFunctorPointer callback_, CommandFlag flags_, const Options &options_, CommandHandlerFinder finder_)
const Identifier name
Definition: Registry.h:86
void(CommandHandlerObject::*)(const CommandContext &context) MemberFn

◆ CommandItem() [3/3]

MenuRegistry::CommandItem::CommandItem ( const CommandID name,
const TranslatableString label_in,
CommandFunctorPointer::NonMemberFn  callback,
CommandFlag  flags,
const Options options = {} 
)
inline

Definition at line 309 of file MenuRegistry.h.

313 {})
316 flags, options, nullptr)
317 {}

◆ ~CommandItem()

MenuRegistry::CommandItem::~CommandItem ( )
override

Definition at line 144 of file MenuRegistry.cpp.

144{}

Member Data Documentation

◆ callback

CommandFunctorPointer MenuRegistry::CommandItem::callback

Definition at line 323 of file MenuRegistry.h.

◆ finder

CommandHandlerFinder MenuRegistry::CommandItem::finder

Definition at line 322 of file MenuRegistry.h.

◆ flags

CommandFlag MenuRegistry::CommandItem::flags

Definition at line 324 of file MenuRegistry.h.

◆ label_in

const TranslatableString MenuRegistry::CommandItem::label_in

◆ options

Options MenuRegistry::CommandItem::options

Definition at line 325 of file MenuRegistry.h.


The documentation for this struct was generated from the following files: