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 <ComponentInterface.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 59 of file ComponentInterface.h.

Constructor & Destructor Documentation

◆ ComponentInterfaceSymbol() [1/5]

ComponentInterfaceSymbol::ComponentInterfaceSymbol ( )
default

◆ ComponentInterfaceSymbol() [2/5]

ComponentInterfaceSymbol::ComponentInterfaceSymbol ( const TranslatableString msgid)
inline

Definition at line 65 of file ComponentInterface.h.

66  : mInternal{ msgid.MSGID().GET(), }, mMsgid{ msgid }
67  {}

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 70 of file ComponentInterface.h.

71  : mInternal{ internal }, mMsgid{ internal, {} }
72  {}

◆ ComponentInterfaceSymbol() [4/5]

ComponentInterfaceSymbol::ComponentInterfaceSymbol ( const wxChar *  msgid)
inline

Definition at line 75 of file ComponentInterface.h.

76  : mInternal{ msgid }, mMsgid{ msgid, {} }
77  {}

◆ ComponentInterfaceSymbol() [5/5]

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

Definition at line 81 of file ComponentInterface.h.

83  : mInternal{ internal.GET() }
84  // Do not permit non-empty msgid with empty internal
85  , mMsgid{ internal.empty() ? TranslatableString{} : msgid }
86  {}

Member Function Documentation

◆ empty()

bool ComponentInterfaceSymbol::empty ( ) const
inline

Definition at line 95 of file ComponentInterface.h.

95 { 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 89 of file ComponentInterface.h.

89 { return mMsgid; }

References mMsgid.

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

Here is the caller graph for this function:

◆ Stripped()

const TranslatableString ComponentInterfaceSymbol::Stripped ( ) const
inline

Definition at line 90 of file ComponentInterface.h.

90 { 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 92 of file ComponentInterface.h.

93  { 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

Friends And Related Function Documentation

◆ operator!=

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

Definition at line 101 of file ComponentInterface.h.

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

◆ operator==

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

Definition at line 97 of file ComponentInterface.h.

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

Member Data Documentation

◆ mInternal

wxString ComponentInterfaceSymbol::mInternal
private

Definition at line 106 of file ComponentInterface.h.

Referenced by empty(), and Internal().

◆ mMsgid

TranslatableString ComponentInterfaceSymbol::mMsgid
private

Definition at line 107 of file ComponentInterface.h.

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


The documentation for this class was generated from the following file:
TranslatableString
Definition: Types.h:290
TranslatableString::empty
bool empty() const
Definition: Types.h:329
ComponentInterfaceSymbol::mInternal
wxString mInternal
Definition: ComponentInterface.h:106
ComponentInterfaceSymbol::Stripped
const TranslatableString Stripped() const
Definition: ComponentInterface.h:90
Identifier::GET
const wxString & GET() const
Definition: Types.h:110
ComponentInterfaceSymbol::mMsgid
TranslatableString mMsgid
Definition: ComponentInterface.h:107
TranslatableString::MSGID
Identifier MSGID() const
Definition: Types.h:335
TranslatableString::Translation
wxString Translation() const
Definition: Types.h:337
TranslatableString::Stripped
TranslatableString Stripped(unsigned options=MenuCodes) const
Definition: Types.h:457