FOSSredder 0.5.0
Loading...
Searching...
No Matches
ui::WorkspaceSelectors Class Reference

Projects workspace store data into QML-facing read models. More...

#include <WorkspaceSelectors.h>

Inheritance diagram for ui::WorkspaceSelectors:
Collaboration diagram for ui::WorkspaceSelectors:

Public Member Functions

 WorkspaceSelectors (WorkspaceStore &store, QObject *parent=nullptr)
 Creates selectors for a workspace store.
int dataRevision () const noexcept
 Returns the current workspace data revision.
QVariantList actorRows () const
 Returns actor rows for QML tables and dropdowns.
QVariantList propertyRows () const
 Returns property rows for QML tables and dropdowns.
QVariantList contractRows () const
 Returns contract rows for QML tables and dropdowns.
QVariantList analysisRows () const
 Returns analysis rows for QML views.
QVariantList annualRows () const
 Returns annual rows for QML views.
QVariantList statementRows () const
 Returns statement rows without embedded transactions.
QVariantList statementRowsWithTransactions () const
 Returns statement rows with their transaction rows embedded.
QVariantList statementTransactionRows (const QString &statementId) const
 Returns transactions belonging to a statement.
QVariantMap transactionRowById (const QString &id) const
 Looks up a transaction row by id.
QVariantMap transactionFormWithCatalogSelection (const QVariantMap &transaction, const QVariantMap &changes) const
 Applies catalog-dependent transaction form selection changes.
QVariantList actorDropdownRows () const
 Returns actor dropdown rows including the empty option.
QVariantList propertyDropdownRows () const
 Returns property dropdown rows.
QVariantList contractDropdownRows () const
 Returns contract dropdown rows including the empty option.
QVariantList importLogRows () const
 Returns import log rows for the import sidebar.
QVariantList exportLogRows () const
 Returns export log rows for the export sidebar.
QStringList attachedImportDraftIds () const
 Returns ids of import logs that have attached statement drafts.
QString exportLogTargetPath (const QString &id) const
 Resolves an export log target path.
QString actorIdByName (const QString &name) const
 Looks up an actor id by display name.
QString propertyIdByName (const QString &name) const
 Looks up a property id by display name.
QString contractIdBySignature (const QString &name, const QString &type, const QStringList &actorIds, const QStringList &propertyIds) const
 Looks up a contract id by unique signature.
QString nextContractName () const
 Returns the next generated contract name.
bool hasActorId (const QString &id) const
 Checks whether an actor id exists.
bool hasPropertyId (const QString &id) const
 Checks whether a property id exists.
bool hasContractId (const QString &id) const
 Checks whether a contract id exists.
bool hasStatementId (const QString &id) const
 Checks whether a statement id exists.
bool hasTransactionId (const QString &id) const
 Checks whether a transaction id exists.
bool hasAnalysisId (const QString &id) const
 Checks whether an analysis id exists.
bool hasAnnualId (const QString &id) const
 Checks whether an annual id exists.

Detailed Description

Projects workspace store data into QML-facing read models.

Definition at line 21 of file WorkspaceSelectors.h.

Constructor & Destructor Documentation

◆ WorkspaceSelectors()

ui::WorkspaceSelectors::WorkspaceSelectors ( WorkspaceStore & store,
QObject * parent = nullptr )
explicit

Creates selectors for a workspace store.

Parameters
storeWorkspace store dependency.
parentOptional Qt parent.

Definition at line 72 of file WorkspaceSelectors.cpp.

Member Function Documentation

◆ actorDropdownRows()

QVariantList ui::WorkspaceSelectors::actorDropdownRows ( ) const

Returns actor dropdown rows including the empty option.

Returns
Actor dropdown rows.

Definition at line 196 of file WorkspaceSelectors.cpp.

Here is the call graph for this function:

◆ actorIdByName()

QString ui::WorkspaceSelectors::actorIdByName ( const QString & name) const

Looks up an actor id by display name.

Parameters
nameActor name.
Returns
Actor id or an empty string.

Definition at line 257 of file WorkspaceSelectors.cpp.

Here is the call graph for this function:

◆ actorRows()

QVariantList ui::WorkspaceSelectors::actorRows ( ) const

Returns actor rows for QML tables and dropdowns.

Returns
Actor rows projected from the workspace snapshot.

Definition at line 79 of file WorkspaceSelectors.cpp.

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

◆ analysisRows()

QVariantList ui::WorkspaceSelectors::analysisRows ( ) const

Returns analysis rows for QML views.

Returns
Analysis rows projected from the workspace snapshot.

Definition at line 93 of file WorkspaceSelectors.cpp.

Here is the call graph for this function:

◆ annualRows()

QVariantList ui::WorkspaceSelectors::annualRows ( ) const

Returns annual rows for QML views.

Returns
Annual rows projected from the workspace snapshot.

Definition at line 98 of file WorkspaceSelectors.cpp.

Here is the call graph for this function:

◆ attachedImportDraftIds()

QStringList ui::WorkspaceSelectors::attachedImportDraftIds ( ) const

Returns ids of import logs that have attached statement drafts.

Returns
Draft ids or log ids usable for draft restoration.

Definition at line 222 of file WorkspaceSelectors.cpp.

◆ contractDropdownRows()

QVariantList ui::WorkspaceSelectors::contractDropdownRows ( ) const

Returns contract dropdown rows including the empty option.

Returns
Contract dropdown rows.

Definition at line 206 of file WorkspaceSelectors.cpp.

Here is the call graph for this function:

◆ contractIdBySignature()

QString ui::WorkspaceSelectors::contractIdBySignature ( const QString & name,
const QString & type,
const QStringList & actorIds,
const QStringList & propertyIds ) const

Looks up a contract id by unique signature.

Parameters
nameContract name.
typeContract type.
actorIdsActor ids linked to the contract.
propertyIdsProperty ids linked to the contract.
Returns
Contract id or an empty string.

Definition at line 273 of file WorkspaceSelectors.cpp.

Here is the call graph for this function:

◆ contractRows()

QVariantList ui::WorkspaceSelectors::contractRows ( ) const

Returns contract rows for QML tables and dropdowns.

Returns
Contract rows projected from the workspace snapshot.

Definition at line 88 of file WorkspaceSelectors.cpp.

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

◆ dataRevision()

int ui::WorkspaceSelectors::dataRevision ( ) const
noexcept

Returns the current workspace data revision.

Returns
Monotonic workspace revision.

Definition at line 75 of file WorkspaceSelectors.cpp.

◆ exportLogRows()

QVariantList ui::WorkspaceSelectors::exportLogRows ( ) const

Returns export log rows for the export sidebar.

Returns
Export log rows.

Definition at line 217 of file WorkspaceSelectors.cpp.

Here is the call graph for this function:

◆ exportLogTargetPath()

QString ui::WorkspaceSelectors::exportLogTargetPath ( const QString & id) const

Resolves an export log target path.

Parameters
idExport log id.
Returns
Target path or an empty string.

Definition at line 241 of file WorkspaceSelectors.cpp.

Here is the call graph for this function:

◆ hasActorId()

bool ui::WorkspaceSelectors::hasActorId ( const QString & id) const

Checks whether an actor id exists.

Parameters
idActor id.
Returns
True when found.

Definition at line 293 of file WorkspaceSelectors.cpp.

◆ hasAnalysisId()

bool ui::WorkspaceSelectors::hasAnalysisId ( const QString & id) const

Checks whether an analysis id exists.

Parameters
idAnalysis id.
Returns
True when found.

Definition at line 313 of file WorkspaceSelectors.cpp.

◆ hasAnnualId()

bool ui::WorkspaceSelectors::hasAnnualId ( const QString & id) const

Checks whether an annual id exists.

Parameters
idAnnual id.
Returns
True when found.

Definition at line 317 of file WorkspaceSelectors.cpp.

◆ hasContractId()

bool ui::WorkspaceSelectors::hasContractId ( const QString & id) const

Checks whether a contract id exists.

Parameters
idContract id.
Returns
True when found.

Definition at line 301 of file WorkspaceSelectors.cpp.

◆ hasPropertyId()

bool ui::WorkspaceSelectors::hasPropertyId ( const QString & id) const

Checks whether a property id exists.

Parameters
idProperty id.
Returns
True when found.

Definition at line 297 of file WorkspaceSelectors.cpp.

◆ hasStatementId()

bool ui::WorkspaceSelectors::hasStatementId ( const QString & id) const

Checks whether a statement id exists.

Parameters
idStatement id.
Returns
True when found.

Definition at line 305 of file WorkspaceSelectors.cpp.

◆ hasTransactionId()

bool ui::WorkspaceSelectors::hasTransactionId ( const QString & id) const

Checks whether a transaction id exists.

Parameters
idTransaction id.
Returns
True when found.

Definition at line 309 of file WorkspaceSelectors.cpp.

◆ importLogRows()

QVariantList ui::WorkspaceSelectors::importLogRows ( ) const

Returns import log rows for the import sidebar.

Returns
Import log rows.

Definition at line 212 of file WorkspaceSelectors.cpp.

Here is the call graph for this function:

◆ nextContractName()

QString ui::WorkspaceSelectors::nextContractName ( ) const

Returns the next generated contract name.

Returns
Generated contract name.

Definition at line 287 of file WorkspaceSelectors.cpp.

◆ propertyDropdownRows()

QVariantList ui::WorkspaceSelectors::propertyDropdownRows ( ) const

Returns property dropdown rows.

Returns
Property dropdown rows.

Definition at line 202 of file WorkspaceSelectors.cpp.

Here is the call graph for this function:

◆ propertyIdByName()

QString ui::WorkspaceSelectors::propertyIdByName ( const QString & name) const

Looks up a property id by display name.

Parameters
nameProperty name.
Returns
Property id or an empty string.

Definition at line 265 of file WorkspaceSelectors.cpp.

Here is the call graph for this function:

◆ propertyRows()

QVariantList ui::WorkspaceSelectors::propertyRows ( ) const

Returns property rows for QML tables and dropdowns.

Returns
Property rows projected from the workspace snapshot.

Definition at line 83 of file WorkspaceSelectors.cpp.

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

◆ statementRows()

QVariantList ui::WorkspaceSelectors::statementRows ( ) const

Returns statement rows without embedded transactions.

Returns
Statement rows projected from the workspace snapshot.

Definition at line 102 of file WorkspaceSelectors.cpp.

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

◆ statementRowsWithTransactions()

QVariantList ui::WorkspaceSelectors::statementRowsWithTransactions ( ) const

Returns statement rows with their transaction rows embedded.

Returns
Statement rows containing a transactions list.

Definition at line 107 of file WorkspaceSelectors.cpp.

Here is the call graph for this function:

◆ statementTransactionRows()

QVariantList ui::WorkspaceSelectors::statementTransactionRows ( const QString & statementId) const

Returns transactions belonging to a statement.

Parameters
statementIdStatement id used for filtering.
Returns
Transaction rows for the statement.

Definition at line 121 of file WorkspaceSelectors.cpp.

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

◆ transactionFormWithCatalogSelection()

QVariantMap ui::WorkspaceSelectors::transactionFormWithCatalogSelection ( const QVariantMap & transaction,
const QVariantMap & changes ) const

Applies catalog-dependent transaction form selection changes.

Parameters
transactionCurrent transaction form payload.
changesField changes from the form.
Returns
Updated transaction form payload.

Definition at line 152 of file WorkspaceSelectors.cpp.

Here is the call graph for this function:

◆ transactionRowById()

QVariantMap ui::WorkspaceSelectors::transactionRowById ( const QString & id) const

Looks up a transaction row by id.

Parameters
idTransaction id.
Returns
Transaction row or an empty map.

Definition at line 135 of file WorkspaceSelectors.cpp.

Here is the call graph for this function:

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