DuxReiNummariae 1.0.0-alpha.23
Simple and powerful budgeting application
 
Loading...
Searching...
No Matches
drn::navigation Namespace Reference

Namespaces

namespace  internal
 

Classes

struct  AllowSubAccounts
 A flag type to indicate that the operation should allow sub-accounts. More...
 
class  BankAccountCode
 
struct  BudgetBankAccount
 Represents the bank account for a budget item. More...
 
struct  ConfigurationOptions
 The configurable options for the application's behavior. More...
 
struct  DisableJargonUi
 The type to track how the application configures whether specific accounting jargon should be excluded from the application's GUI. More...
 
struct  EnableAdvancedUi
 The type to track how the application configures and enables the advanced UI features. More...
 
class  Navigator
 
class  UserPreferences
 Manages user preferences related to budgeting, survey balance, work hours, and currency. More...
 

Functions

DRN_NAVIGATION_EXPORT std::optional< banking::BankAccountlookUpBankAccount (const budgeting::BudgetSource &toFind, const std::set< BudgetBankAccount > &accounts) noexcept
 Searches for a bank account associated with a given budget source in a provided collection.
 
DRN_NAVIGATION_EXPORT::QDebug operator<< (::QDebug out, BudgetWizardTemplates bwt)
 Full object Qt stream insertion operator.
 
DRN_NAVIGATION_EXPORT ConfigurationOptions parse (const ::QStringList &arguments) noexcept
 Parses arguments for the application.
 
DRN_NAVIGATION_EXPORT::QString presentationText (const CurrencyDisplayOptions &displayAs)
 Converts a currency display option into its corresponding presentation text.
 
DRN_NAVIGATION_EXPORT CurrencyDisplayOptions toCurrencyDisplayOptions (const ::QString &displayAs)
 Converts a textual representation into a CurrencyDisplayOptions enumeration value.
 
DRN_NAVIGATION_EXPORT pecunia::Currency toCurrencyFromDisplayable (const ::QString &text, const std::set< pecunia::Currency > &usableCodes, const CurrencyDisplayOptions displayAs)
 Converts a displayed currency representation into a specific currency code.
 
DRN_NAVIGATION_EXPORT::QString toDisplayable (const pecunia::Currency &code, const CurrencyDisplayOptions displayAs)
 Converts a currency and its display option into a user-friendly string representation.
 
DRN_NAVIGATION_EXPORT::QString toQString (const CurrencyDisplayOptions &displayAs)
 Converts a currency display option into its corresponding text-based representation.
 

Variables

constexpr std::array allCurrencyDisplayOptions
 Lists all possible currency display options.
 
constexpr int guiMessageDisplayDelayMs {1500}
 Specifies the delay, in milliseconds, for how long a message is displayed in the GUI.
 
constexpr int signalAsyncDelayMs {100}
 Specifies the delay, in milliseconds, used for emitting asynchronous signals/slots.
 
constexpr int statusMessageTimeOutMs {5000}
 Defines the time, in milliseconds, for how long a status message is displayed in the GUI.
 

Function Documentation

◆ lookUpBankAccount()

DRN_NAVIGATION_EXPORT std::optional< banking::BankAccount > drn::navigation::lookUpBankAccount ( const budgeting::BudgetSource & toFind,
const std::set< BudgetBankAccount > & accounts )
noexcept

Searches for a bank account associated with a given budget source in a provided collection.

Parameters
toFindThe budget item source for which a linked bank account is being sought. This serves as the identifier for the search.
accountsA collection of budget bank accounts to be searched for the matching budget source. The collection should represent all currently applicable budget sources.
Returns
When found, gives the bank account associated with the given budget source, else gives an empty value.

◆ operator<<()

DRN_NAVIGATION_EXPORT::QDebug drn::navigation::operator<< ( ::QDebug out,
BudgetWizardTemplates bwt )

Full object Qt stream insertion operator.

Parameters
outThe stream to place the data into.
bwtThe data to place into the stream.
Returns
The modified stream after insertion.

◆ parse()

DRN_NAVIGATION_EXPORT ConfigurationOptions drn::navigation::parse ( const ::QStringList & arguments)
noexcept

Parses arguments for the application.

This processes the provided list of arguments and extracts user-specified options, such as GUI preferences, for configuring the application's behavior.

Parameters
argumentsA list of strings representing the arguments passed to the application.
Returns
A structure containing the options extracted from the arguments.

◆ presentationText()

DRN_NAVIGATION_EXPORT::QString drn::navigation::presentationText ( const CurrencyDisplayOptions & displayAs)

Converts a currency display option into its corresponding presentation text.

This function is intended to generate a user-friendly textual representation of a currency display option. It is designed for applications that need to display currency options in a GUI element or other text-based contexts.

Exceptions
std::invalid_argumentThrown if an unidentified or unsupported currency display option is passed.
Parameters
displayAsSpecifies the desired currency display format.
Returns
A text representation of the currency display format, formatted for display in GUI elements or other user-facing contexts.

◆ toCurrencyDisplayOptions()

DRN_NAVIGATION_EXPORT CurrencyDisplayOptions drn::navigation::toCurrencyDisplayOptions ( const ::QString & displayAs)

Converts a textual representation into a CurrencyDisplayOptions enumeration value.

This function maps user-provided or system-provided textual representations of how a currency should be displayed (e.g., "ISO-4217 Code", "Symbol") into the corresponding CurrencyDisplayOptions value. It is useful when receiving input from GUI elements or external sources and standardizing it for internal processing.

Exceptions
std::logic_errorThrown if the provided text cannot be mapped to any CurrencyDisplayOptions value or if the input type fails to meet enumeration conversion requirements.
Parameters
displayAsThe textual representation of the target currency display format.
Returns
The corresponding CurrencyDisplayOptions enumeration value for the provided text.

◆ toCurrencyFromDisplayable()

DRN_NAVIGATION_EXPORT pecunia::Currency drn::navigation::toCurrencyFromDisplayable ( const ::QString & text,
const std::set< pecunia::Currency > & usableCodes,
const CurrencyDisplayOptions displayAs )

Converts a displayed currency representation into a specific currency code.

This method is useful for interpreting a user-selected or user-provided text representation of a currency, such as a symbol or ISO code, and mapping it to an actionable currency identifier. It can be used in GUI elements where users input or interact with currencies.

Exceptions
logic_errorThrown if the input text could not be interpreted based on the display format.
logic_errorThrown if no matching currency is found for the given display options.
Parameters
textThe displayed text representation of the currency (e.g., symbol or ISO code).
usableCodesA collection of currencies that are allowed for resolution.
displayAsSpecifies the display option used for representing the currency.
Returns
The resolved currency code corresponding to the provided display text.

◆ toDisplayable()

DRN_NAVIGATION_EXPORT::QString drn::navigation::toDisplayable ( const pecunia::Currency & code,
const CurrencyDisplayOptions displayAs )

Converts a currency and its display option into a user-friendly string representation.

This function generates a textual representation of a given currency based on the provided display option. It is designed to accommodate different formats of currency visualization, such as ISO codes, symbols, or a combination of both, and is particularly useful for GUI elements or text-based output where clear and standardized currency display is required. If the display option cannot be determined, the function throws an exception.

Exceptions
std::logic_errorThrown if the provided display option is not supported or if the function logic fails to map the currency to a valid representation.
Parameters
codeA reference to the currency object to be converted into a displayable string.
displayAsThe preferred display option describing how the currency should be visualized.
Returns
A string that represents the currency in the desired format, based on the provided display option.

◆ toQString()

DRN_NAVIGATION_EXPORT::QString drn::navigation::toQString ( const CurrencyDisplayOptions & displayAs)

Converts a currency display option into its corresponding text-based representation.

This function maps a given currency display option into a textual description. It is useful within applications that need to store, display, or communicate how a currency should be presented (e.g., using ISO codes, symbols, or both).

Exceptions
std::invalid_argumentThrown if the given display option does not have a corresponding text-based representation.
Parameters
displayAsAn enumeration value representing how the currency should be displayed.
Returns
A string representation of the provided CurrencyDisplayOptions value.

Variable Documentation

◆ allCurrencyDisplayOptions

std::array drn::navigation::allCurrencyDisplayOptions
inlineconstexpr
Initial value:
{
CurrencyDisplayOptions::IsoCode,
CurrencyDisplayOptions::Symbol,
CurrencyDisplayOptions::SymbolAndCode
}

Lists all possible currency display options.

This variable provides a collection of all defined options for representing currencies in a standardized way. It is utilized to ensure consistency when presenting currency data across various components of an application.

Use this to validate or iterate through the available representations of currency, ensuring no unintentional omissions of any display options. It is particularly useful when creating dropdowns, selectors, or validation mechanisms involving currency formats in GUI elements or other programmatic use cases.

◆ guiMessageDisplayDelayMs

int drn::navigation::guiMessageDisplayDelayMs {1500}
inlineconstexpr

Specifies the delay, in milliseconds, for how long a message is displayed in the GUI.

This variable determines the duration to wait before moving on from the current GUI item. It is intended to enhance the user experience by providing a consistent delay for messages, improving visual flow or interaction timing. Modifying this value can affect how quickly information is displayed to the user, and the perceived responsiveness of the system.

◆ signalAsyncDelayMs

int drn::navigation::signalAsyncDelayMs {100}
inlineconstexpr

Specifies the delay, in milliseconds, used for emitting asynchronous signals/slots.

This constant determines the time duration to wait before emitting the signals/slots. It is essential for ensuring that certain operations have appropriate delays to allow for other processes to complete, maintaining synchronisation, and responsiveness within the application. Adjusting this value may impact performance, timing, and user experience, depending on operational requirements.

◆ statusMessageTimeOutMs

int drn::navigation::statusMessageTimeOutMs {5000}
inlineconstexpr

Defines the time, in milliseconds, for how long a status message is displayed in the GUI.

This constant determines the duration for which status messages are visible in a GUI element, such as a status bar, ensuring proper visibility for users to read the displayed information. Adjusting this timeout value can tailor the user experience to either show messages for a shorter or longer duration, adapting to both user preferences and application-specific needs.