Audacity 3.2.0
Classes | Public Member Functions | Protected Attributes | List of all members
NumericConverterFormatter Struct Referenceabstract

#include <NumericConverterFormatter.h>

Inheritance diagram for NumericConverterFormatter:
[legend]
Collaboration diagram for NumericConverterFormatter:
[legend]

Classes

struct  ConversionResult
 

Public Member Functions

virtual ~NumericConverterFormatter ()
 
virtual void UpdateFormatForValue (double value, bool canShrink)
 Potentially updates the format so it can fit the value. Default implementation is empty. More...
 
virtual ConversionResult ValueToString (double value, bool nearest) const =0
 
virtual std::optional< double > StringToValue (const wxString &value) const =0
 
virtual double SingleStep (double value, int digitIndex, bool upwards) const =0
 
const wxString & GetPrefix () const
 
const NumericFieldsGetFields () const
 
const DigitInfosGetDigitInfos () const
 
- Public Member Functions inherited from Observer::Publisher< NumericConverterFormatChangedMessage >
 Publisher (ExceptionPolicy *pPolicy=nullptr, Alloc a={})
 Constructor supporting type-erased custom allocation/deletion. More...
 
 Publisher (Publisher &&)=default
 
Publisheroperator= (Publisher &&)=default
 
Subscription Subscribe (Callback callback)
 Connect a callback to the Publisher; later-connected are called earlier. More...
 
Subscription Subscribe (Object &obj, Return(Object::*callback)(Args...))
 Overload of Subscribe takes an object and pointer-to-member-function. More...
 

Protected Attributes

wxString mPrefix
 
NumericFields mFields
 
DigitInfos mDigits
 

Additional Inherited Members

- Public Types inherited from Observer::Publisher< NumericConverterFormatChangedMessage >
using message_type = NumericConverterFormatChangedMessage
 
using CallbackReturn = std::conditional_t< true, void, bool >
 
using Callback = std::function< CallbackReturn(const NumericConverterFormatChangedMessage &) >
 Type of functions that can be connected to the Publisher. More...
 
- Static Public Attributes inherited from Observer::Publisher< NumericConverterFormatChangedMessage >
static constexpr bool notifies_all
 
- Protected Member Functions inherited from Observer::Publisher< NumericConverterFormatChangedMessage >
CallbackReturn Publish (const NumericConverterFormatChangedMessage &message)
 Send a message to connected callbacks. More...
 

Detailed Description

Definition at line 60 of file NumericConverterFormatter.h.

Constructor & Destructor Documentation

◆ ~NumericConverterFormatter()

NumericConverterFormatter::~NumericConverterFormatter ( )
virtual

Definition at line 57 of file NumericConverterFormatter.cpp.

58{
59}

Member Function Documentation

◆ GetDigitInfos()

const DigitInfos & NumericConverterFormatter::GetDigitInfos ( ) const

Definition at line 75 of file NumericConverterFormatter.cpp.

76{
77 return mDigits;
78}

References mDigits.

◆ GetFields()

const NumericFields & NumericConverterFormatter::GetFields ( ) const

Definition at line 70 of file NumericConverterFormatter.cpp.

71{
72 return mFields;
73}

References mFields.

◆ GetPrefix()

const wxString & NumericConverterFormatter::GetPrefix ( ) const

Definition at line 65 of file NumericConverterFormatter.cpp.

66{
67 return mPrefix;
68}

References mPrefix.

◆ SingleStep()

virtual double NumericConverterFormatter::SingleStep ( double  value,
int  digitIndex,
bool  upwards 
) const
pure virtual

◆ StringToValue()

virtual std::optional< double > NumericConverterFormatter::StringToValue ( const wxString &  value) const
pure virtual

◆ UpdateFormatForValue()

void NumericConverterFormatter::UpdateFormatForValue ( double  value,
bool  canShrink 
)
virtual

Potentially updates the format so it can fit the value. Default implementation is empty.

Reimplemented in anonymous_namespace{BeatsNumericConverterFormatter.cpp}::BeatsFormatter.

Definition at line 61 of file NumericConverterFormatter.cpp.

62{
63}

◆ ValueToString()

virtual ConversionResult NumericConverterFormatter::ValueToString ( double  value,
bool  nearest 
) const
pure virtual

Member Data Documentation

◆ mDigits

DigitInfos NumericConverterFormatter::mDigits
protected

Definition at line 90 of file NumericConverterFormatter.h.

Referenced by GetDigitInfos().

◆ mFields

NumericFields NumericConverterFormatter::mFields
protected

Definition at line 89 of file NumericConverterFormatter.h.

Referenced by GetFields().

◆ mPrefix

wxString NumericConverterFormatter::mPrefix
protected

Definition at line 87 of file NumericConverterFormatter.h.

Referenced by GetPrefix().


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