Audacity 3.2.0
Public Member Functions | Public Attributes | Static Private Member Functions | List of all members
MenuRegistry::Options Struct Reference

#include <MenuRegistry.h>

Collaboration diagram for MenuRegistry::Options:
[legend]

Public Member Functions

 Options ()
 
 Options (const wxChar *accel_)
 
 Options (const wxChar *accel_, const TranslatableString &longName_)
 
Options && Accel (const wxChar *value) &&
 
Options && IsEffect (bool value=true) &&
 
Options && Parameter (const CommandParameter &value) &&
 
Options && LongName (const TranslatableString &value) &&
 
Options && IsGlobal () &&
 
Options && UseStrictFlags () &&
 
Options && WantKeyUp () &&
 
Options && SkipKeyDown () &&
 
Options && AllowDup () &&
 
Options && AllowInMacros (int value=1) &&
 
Options && CheckTest (const CheckFn &fn) &&
 
Options && CheckTest (const wxChar *key, bool defaultValue) &&
 
Options && CheckTest (const BoolSetting &setting) &&
 

Public Attributes

const wxChar * accel { wxT("") }
 
CheckFn checker
 
bool bIsEffect { false }
 
CommandParameter parameter {}
 
TranslatableString longName {}
 
bool global { false }
 
bool useStrictFlags { false }
 
bool wantKeyUp { false }
 
bool skipKeyDown { false }
 
bool allowDup { false }
 
int allowInMacros { -1 }
 

Static Private Member Functions

static CheckFn MakeCheckFn (const wxString key, bool defaultValue)
 
static CheckFn MakeCheckFn (const BoolSetting &setting)
 

Detailed Description

Definition at line 36 of file MenuRegistry.h.

Constructor & Destructor Documentation

◆ Options() [1/3]

MenuRegistry::Options::Options ( )
inline

Definition at line 38 of file MenuRegistry.h.

38{}

◆ Options() [2/3]

MenuRegistry::Options::Options ( const wxChar *  accel_)
inline

Definition at line 41 of file MenuRegistry.h.

41: accel{ accel_ } {}
const wxChar * accel
Definition: MenuRegistry.h:87

◆ Options() [3/3]

MenuRegistry::Options::Options ( const wxChar *  accel_,
const TranslatableString longName_ 
)
inline

Definition at line 43 of file MenuRegistry.h.

46 : accel{ accel_ }, longName{ longName_ } {}
TranslatableString longName
Definition: MenuRegistry.h:91

Member Function Documentation

◆ Accel()

Options && MenuRegistry::Options::Accel ( const wxChar *  value) &&
inline

Definition at line 48 of file MenuRegistry.h.

49 { accel = value; return std::move(*this); }

◆ AllowDup()

Options && MenuRegistry::Options::AllowDup ( ) &&
inline

Definition at line 66 of file MenuRegistry.h.

67 { allowDup = true; return std::move(*this); }

◆ AllowInMacros()

Options && MenuRegistry::Options::AllowInMacros ( int  value = 1) &&
inline

Definition at line 69 of file MenuRegistry.h.

70 { allowInMacros = value; return std::move(*this); }

Referenced by anonymous_namespace{MenuHelper.cpp}::AddEffectMenuItemGroup(), and anonymous_namespace{BatchProcessDialog.cpp}::PopulateMacrosMenu().

Here is the caller graph for this function:

◆ CheckTest() [1/3]

Options && MenuRegistry::Options::CheckTest ( const BoolSetting setting) &&
inline

Definition at line 82 of file MenuRegistry.h.

82 {
83 checker = MakeCheckFn( setting );
84 return std::move(*this);
85 }
static CheckFn MakeCheckFn(const wxString key, bool defaultValue)

◆ CheckTest() [2/3]

Options && MenuRegistry::Options::CheckTest ( const CheckFn fn) &&
inline

Definition at line 74 of file MenuRegistry.h.

75 { checker = fn; return std::move(*this); }
static const auto fn

References fn.

Referenced by anonymous_namespace{TimelineMenus.cpp}::ExtraSelectionMenu(), anonymous_namespace{LabelMenus.cpp}::LabelEditMenus(), anonymous_namespace{PluginMenus.cpp}::ToolsMenu(), anonymous_namespace{TrackMenus.cpp}::TracksMenu(), anonymous_namespace{TransportMenus.cpp}::TransportMenu(), and anonymous_namespace{ViewMenus.cpp}::ViewMenu().

Here is the caller graph for this function:

◆ CheckTest() [3/3]

Options && MenuRegistry::Options::CheckTest ( const wxChar *  key,
bool  defaultValue 
) &&
inline

Definition at line 77 of file MenuRegistry.h.

77 {
78 checker = MakeCheckFn( key, defaultValue );
79 return std::move(*this);
80 }
static const AudacityProject::AttachedObjects::RegisteredFactory key

References key.

◆ IsEffect()

Options && MenuRegistry::Options::IsEffect ( bool  value = true) &&
inline

Definition at line 50 of file MenuRegistry.h.

51 { bIsEffect = value; return std::move(*this); }

Referenced by anonymous_namespace{MenuHelper.cpp}::AddEffectMenuItemGroup(), and CommandManager::Populator::AddItemList().

Here is the caller graph for this function:

◆ IsGlobal()

Options && MenuRegistry::Options::IsGlobal ( ) &&
inline

Definition at line 56 of file MenuRegistry.h.

57 { global = true; return std::move(*this); }

Referenced by anonymous_namespace{PluginMenus.cpp}::AnalyzeMenu(), anonymous_namespace{PluginMenus.cpp}::GenerateMenu(), and PluginMenuItems().

Here is the caller graph for this function:

◆ LongName()

Options && MenuRegistry::Options::LongName ( const TranslatableString value) &&
inline

Definition at line 54 of file MenuRegistry.h.

55 { longName = value; return std::move(*this); }

Referenced by anonymous_namespace{ClipMenus.cpp}::ClipCursorItems(), anonymous_namespace{SelectMenus.cpp}::CursorMenu(), anonymous_namespace{SelectMenus.cpp}::SelectMenu(), and anonymous_namespace{TrackMenus.cpp}::TracksMenu().

Here is the caller graph for this function:

◆ MakeCheckFn() [1/2]

auto MenuRegistry::Options::MakeCheckFn ( const BoolSetting setting)
staticprivate

Definition at line 25 of file MenuRegistry.cpp.

26{
27 return MakeCheckFn( setting.GetPath(), setting.GetDefault() );
28}
const SettingPath & GetPath() const
Definition: Prefs.h:88
const T & GetDefault() const
Definition: Prefs.h:199

◆ MakeCheckFn() [2/2]

auto MenuRegistry::Options::MakeCheckFn ( const wxString  key,
bool  defaultValue 
)
staticprivate

Definition at line 20 of file MenuRegistry.cpp.

21{
22 return [=](AudacityProject&){ return gPrefs->ReadBool( key, defaultValue ); };
23}
audacity::BasicSettings * gPrefs
Definition: Prefs.cpp:68
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
bool ReadBool(const wxString &key, bool defaultValue) const

References gPrefs, key, and audacity::BasicSettings::ReadBool().

Here is the call graph for this function:

◆ Parameter()

Options && MenuRegistry::Options::Parameter ( const CommandParameter value) &&
inline

Definition at line 52 of file MenuRegistry.h.

53 { parameter = value; return std::move(*this); }
CommandParameter parameter
Definition: MenuRegistry.h:90

Referenced by anonymous_namespace{MenuHelper.cpp}::AddEffectMenuItemGroup().

Here is the caller graph for this function:

◆ SkipKeyDown()

Options && MenuRegistry::Options::SkipKeyDown ( ) &&
inline

Definition at line 62 of file MenuRegistry.h.

63 { skipKeyDown = true; return std::move(*this); }

◆ UseStrictFlags()

Options && MenuRegistry::Options::UseStrictFlags ( ) &&
inline

Definition at line 58 of file MenuRegistry.h.

59 { useStrictFlags = true; return std::move(*this); }

◆ WantKeyUp()

Options && MenuRegistry::Options::WantKeyUp ( ) &&
inline

Definition at line 60 of file MenuRegistry.h.

61 { wantKeyUp = true; return std::move(*this); }

Referenced by anonymous_namespace{ClipMenus.cpp}::ExtraTimeShiftItems().

Here is the caller graph for this function:

Member Data Documentation

◆ accel

const wxChar* MenuRegistry::Options::accel { wxT("") }

Definition at line 87 of file MenuRegistry.h.

◆ allowDup

bool MenuRegistry::Options::allowDup { false }

Definition at line 96 of file MenuRegistry.h.

◆ allowInMacros

int MenuRegistry::Options::allowInMacros { -1 }

Definition at line 98 of file MenuRegistry.h.

◆ bIsEffect

bool MenuRegistry::Options::bIsEffect { false }

Definition at line 89 of file MenuRegistry.h.

◆ checker

CheckFn MenuRegistry::Options::checker

◆ global

bool MenuRegistry::Options::global { false }

◆ longName

TranslatableString MenuRegistry::Options::longName {}

Definition at line 91 of file MenuRegistry.h.

◆ parameter

CommandParameter MenuRegistry::Options::parameter {}

Definition at line 90 of file MenuRegistry.h.

◆ skipKeyDown

bool MenuRegistry::Options::skipKeyDown { false }

Definition at line 95 of file MenuRegistry.h.

◆ useStrictFlags

bool MenuRegistry::Options::useStrictFlags { false }

Definition at line 93 of file MenuRegistry.h.

Referenced by CommandManager::Populator::AddItem().

◆ wantKeyUp

bool MenuRegistry::Options::wantKeyUp { false }

Definition at line 94 of file MenuRegistry.h.


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