Audacity  3.0.3
Public Member Functions | Private Attributes | Friends | List of all members
ComponentInterfaceSymbol Class Reference

ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional, different string as msgid for lookup in a translation catalog. More...

#include <ComponentInterfaceSymbol.h>

Collaboration diagram for ComponentInterfaceSymbol:
[legend]

Public Member Functions

 ComponentInterfaceSymbol ()=default
 
 ComponentInterfaceSymbol (const TranslatableString &msgid)
 
 ComponentInterfaceSymbol (const wxString &internal)
 
 ComponentInterfaceSymbol (const wxChar *msgid)
 
 ComponentInterfaceSymbol (const Identifier &internal, const TranslatableString &msgid)
 
const wxString & Internal () const
 
const TranslatableStringMsgid () const
 
const TranslatableString Stripped () const
 
const wxString Translation () const
 
const wxString StrippedTranslation () const
 
bool empty () const
 

Private Attributes

wxString mInternal
 
TranslatableString mMsgid
 

Friends

bool operator== (const ComponentInterfaceSymbol &a, const ComponentInterfaceSymbol &b)
 
bool operator!= (const ComponentInterfaceSymbol &a, const ComponentInterfaceSymbol &b)
 

Detailed Description

ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional, different string as msgid for lookup in a translation catalog.

If there is need to change a msgid in a later version of the program, change the constructor call to supply a second argument but leave the first the same, so that compatibility of older configuration files containing that internal string is not broken.

Definition at line 26 of file ComponentInterfaceSymbol.h.

Constructor & Destructor Documentation

◆ ComponentInterfaceSymbol() [1/5]

ComponentInterfaceSymbol::ComponentInterfaceSymbol ( )
default

◆ ComponentInterfaceSymbol() [2/5]

ComponentInterfaceSymbol::ComponentInterfaceSymbol ( const TranslatableString msgid)
inline

Definition at line 32 of file ComponentInterfaceSymbol.h.

33  : mInternal{ msgid.MSGID().GET(), }, mMsgid{ msgid }
34  {}

References Identifier::GET(), and TranslatableString::MSGID().

Here is the call graph for this function:

◆ ComponentInterfaceSymbol() [3/5]

ComponentInterfaceSymbol::ComponentInterfaceSymbol ( const wxString &  internal)
inline

Definition at line 37 of file ComponentInterfaceSymbol.h.

38  : mInternal{ internal }, mMsgid{ internal, {} }
39  {}

◆ ComponentInterfaceSymbol() [4/5]

ComponentInterfaceSymbol::ComponentInterfaceSymbol ( const wxChar *  msgid)
inline

Definition at line 42 of file ComponentInterfaceSymbol.h.

43  : mInternal{ msgid }, mMsgid{ msgid, {} }
44  {}

◆ ComponentInterfaceSymbol() [5/5]

ComponentInterfaceSymbol::ComponentInterfaceSymbol ( const Identifier internal,
const TranslatableString msgid 
)
inline

Definition at line 48 of file ComponentInterfaceSymbol.h.

50  : mInternal{ internal.GET() }
51  // Do not permit non-empty msgid with empty internal
52  , mMsgid{ internal.empty() ? TranslatableString{} : msgid }
53  {}

Member Function Documentation

◆ empty()

bool ComponentInterfaceSymbol::empty ( ) const
inline

Definition at line 62 of file ComponentInterfaceSymbol.h.

62 { return mInternal.empty(); }

References mInternal.

Referenced by OldStyleCommandType::GetSymbol().

Here is the caller graph for this function:

◆ Internal()

const wxString& ComponentInterfaceSymbol::Internal ( ) const
inline

◆ Msgid()

const TranslatableString& ComponentInterfaceSymbol::Msgid ( ) const
inline

Definition at line 56 of file ComponentInterfaceSymbol.h.

56 { return mMsgid; }

References mMsgid.

Referenced by anonymous_namespace{PluginMenus.cpp}::AddEffectMenuItems(), EffectManager::GetCommandName(), EnumValueSymbols::GetMsgids(), ComponentInterface::GetName(), and Msgids().

Here is the caller graph for this function:

◆ Stripped()

const TranslatableString ComponentInterfaceSymbol::Stripped ( ) const
inline

Definition at line 57 of file ComponentInterfaceSymbol.h.

57 { return mMsgid.Stripped(); }

References mMsgid, and TranslatableString::Stripped().

Referenced by SetTrackVisualsCommand::PopulateOrExchange(), and StrippedTranslation().

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

◆ StrippedTranslation()

const wxString ComponentInterfaceSymbol::StrippedTranslation ( ) const
inline

Definition at line 59 of file ComponentInterfaceSymbol.h.

60  { return Stripped().Translation(); }

References Stripped(), and TranslatableString::Translation().

Referenced by MacroCommandsCatalog::ByFriendlyName(), and MacroCommandsCatalog::MacroCommandsCatalog().

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

◆ Translation()

const wxString ComponentInterfaceSymbol::Translation ( ) const
inline

Definition at line 58 of file ComponentInterfaceSymbol.h.

58 { return mMsgid.Translation(); }

References mMsgid, and TranslatableString::Translation().

Referenced by anonymous_namespace{PluginMenus.cpp}::CompareEffectsByName(), anonymous_namespace{PluginMenus.cpp}::CompareEffectsByPublisher(), anonymous_namespace{PluginMenus.cpp}::CompareEffectsByPublisherAndName(), anonymous_namespace{PluginMenus.cpp}::CompareEffectsByType(), anonymous_namespace{PluginMenus.cpp}::CompareEffectsByTypeAndName(), VSTEffectsModule::DiscoverPluginsAtPath(), NumericTextCtrl::OnContext(), EffectUIHost::OnMenu(), VampEffect::Process(), and ShuttleGuiBase::TieRadioButton().

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

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const ComponentInterfaceSymbol a,
const ComponentInterfaceSymbol b 
)
friend

Definition at line 68 of file ComponentInterfaceSymbol.h.

70  { return !( a == b ); }

◆ operator==

bool operator== ( const ComponentInterfaceSymbol a,
const ComponentInterfaceSymbol b 
)
friend

Definition at line 64 of file ComponentInterfaceSymbol.h.

66  { return a.mInternal == b.mInternal; }

Member Data Documentation

◆ mInternal

wxString ComponentInterfaceSymbol::mInternal
private

Definition at line 73 of file ComponentInterfaceSymbol.h.

Referenced by empty(), and Internal().

◆ mMsgid

TranslatableString ComponentInterfaceSymbol::mMsgid
private

Definition at line 74 of file ComponentInterfaceSymbol.h.

Referenced by Msgid(), Stripped(), and Translation().


The documentation for this class was generated from the following file:
TranslatableString
Holds a msgid for the translation catalog; may also bind format arguments.
Definition: TranslatableString.h:32
TranslatableString::empty
bool empty() const
Definition: TranslatableString.h:72
ComponentInterfaceSymbol::mInternal
wxString mInternal
Definition: ComponentInterfaceSymbol.h:73
ComponentInterfaceSymbol::Stripped
const TranslatableString Stripped() const
Definition: ComponentInterfaceSymbol.h:57
Identifier::GET
const wxString & GET() const
Explicit conversion to wxString, meant to be ugly-looking and demanding of a comment why it's correct...
Definition: Identifier.h:66
ComponentInterfaceSymbol::mMsgid
TranslatableString mMsgid
Definition: ComponentInterfaceSymbol.h:74
TranslatableString::MSGID
Identifier MSGID() const
MSGID is the English lookup key in the catalog, not necessarily for user's eyes if locale is some oth...
Definition: TranslatableString.cpp:17
TranslatableString::Translation
wxString Translation() const
Definition: TranslatableString.h:79
TranslatableString::Stripped
TranslatableString Stripped(unsigned options=MenuCodes) const
non-mutating, constructs another TranslatableString object
Definition: TranslatableString.h:198