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

Owns Annual view form state and delegates annual CRUD and computation to workspace and workflow. More...

#include <AnnualViewModel.h>

Inheritance diagram for ui::AnnualViewModel:
Collaboration diagram for ui::AnnualViewModel:

Signals

void changed ()

Public Member Functions

 AnnualViewModel (QObject *parent=nullptr)
 Creates the annual view model.
void setWorkspaceRoles (WorkspaceStore *store, WorkspaceCommands *commands, WorkspaceSelection *selection, WorkspaceSelectors *selectors)
 Sets workspace roles used for annual rows, selection and mutations.
void setAnnualWorkflow (AnnualWorkflow *value)
 Sets the workflow used for annual computation.
bool isEdit () const
 Returns whether an existing annual is selected.
QVariantList annualRows () const
 Returns annual rows for the sidebar.
QString selectedAnnualId () const
 Returns the selected annual id.
QString name () const
 Returns the annual name field.
void setName (const QString &value)
 Updates the annual name field.
int year () const noexcept
 Returns the selected annual year.
void setYear (int value)
 Updates the selected annual year.
QVariantList analysisIds () const
 Returns ids of analyses assigned to the annual.
QVariantList availableAnalysisRows () const
 Returns analyses available for assignment.
QVariantList assignedAnalysisRows () const
 Returns analyses assigned to the annual.
int contentIndex () const noexcept
 Returns the active annual content stack index.
QVariantList annualTransactions () const
 Returns annual transaction preview rows.
QVariantList transactionSections () const
 Returns grouped annual transaction sections.
QVariantList verificationRows () const
 Returns annual verification rows.
QString statusSummaryText () const
 Returns the annual status summary text.
bool canSubmit () const noexcept
 Returns whether the current annual can be submitted.
bool hasRows () const
 Returns whether annual rows exist.
bool hasChanges () const
 Returns whether form state differs from the saved annual state.
Q_INVOKABLE void refreshFromSelection ()
 Reloads create or edit state from the workspace selection.
Q_INVOKABLE void resetCreateState ()
 Resets the create form to defaults.
Q_INVOKABLE void submitCreate ()
 Creates an annual through workspace.
Q_INVOKABLE void submitUpdate ()
 Updates the selected annual through workspace.
Q_INVOKABLE void deleteCurrent ()
 Deletes the selected annual through workspace.
Q_INVOKABLE void navigate (int delta)
 Navigates between annual rows.
Q_INVOKABLE void selectAnnual (const QString &id)
 Selects an annual row.
Q_INVOKABLE void toggleContent ()
 Toggles between annual analysis assignment and transaction preview.
Q_INVOKABLE void stepYear (int delta)
 Steps the selected year by a relative delta.
Q_INVOKABLE void addAvailableAnalysisAtIndex (int index)
 Adds an available analysis by row index.
Q_INVOKABLE void removeAnalysis (const QString &id)
 Removes an analysis from the annual.
Q_INVOKABLE void setAnalysisExportFormat (const QString &id, const QString &exportFormat)
 Updates export format for an assigned analysis.
Q_INVOKABLE void toggleTransactionSection (const QString &key)
 Toggles expansion state for a transaction section.

Properties

bool isEdit
QVariantList annualRows
QString selectedAnnualId
QString name
int year
QVariantList availableAnalysisRows
QVariantList assignedAnalysisRows
int contentIndex
QVariantList annualTransactions
QVariantList transactionSections
QVariantList verificationRows
QString statusSummaryText
bool canSubmit
bool hasRows
bool hasChanges

Detailed Description

Owns Annual view form state and delegates annual CRUD and computation to workspace and workflow.

Definition at line 27 of file AnnualViewModel.h.

Constructor & Destructor Documentation

◆ AnnualViewModel()

ui::AnnualViewModel::AnnualViewModel ( QObject * parent = nullptr)
explicit

Creates the annual view model.

Parameters
parentOptional Qt parent object.

Definition at line 134 of file AnnualViewModel.cpp.

Member Function Documentation

◆ addAvailableAnalysisAtIndex()

void ui::AnnualViewModel::addAvailableAnalysisAtIndex ( int index)

Adds an available analysis by row index.

Parameters
indexIndex into availableAnalysisRows().

Definition at line 439 of file AnnualViewModel.cpp.

◆ analysisIds()

QVariantList ui::AnnualViewModel::analysisIds ( ) const

Returns ids of analyses assigned to the annual.

Returns
Analysis id list.

Definition at line 430 of file AnnualViewModel.cpp.

◆ annualRows()

QVariantList ui::AnnualViewModel::annualRows ( ) const

Returns annual rows for the sidebar.

Returns
Annual rows.

Definition at line 172 of file AnnualViewModel.cpp.

◆ annualTransactions()

QVariantList ui::AnnualViewModel::annualTransactions ( ) const
inline

Returns annual transaction preview rows.

Returns
Annual transaction rows.

Definition at line 151 of file AnnualViewModel.h.

◆ assignedAnalysisRows()

QVariantList ui::AnnualViewModel::assignedAnalysisRows ( ) const
inline

Returns analyses assigned to the annual.

Returns
Assigned analysis rows.

Definition at line 135 of file AnnualViewModel.h.

◆ availableAnalysisRows()

QVariantList ui::AnnualViewModel::availableAnalysisRows ( ) const
inline

Returns analyses available for assignment.

Returns
Available analysis rows.

Definition at line 127 of file AnnualViewModel.h.

◆ canSubmit()

bool ui::AnnualViewModel::canSubmit ( ) const
inlinenoexcept

Returns whether the current annual can be submitted.

Returns
True when quick UI checks pass.

Definition at line 177 of file AnnualViewModel.h.

◆ changed

void ui::AnnualViewModel::changed ( )
signal

◆ contentIndex()

int ui::AnnualViewModel::contentIndex ( ) const
inlinenoexcept

Returns the active annual content stack index.

Returns
Content stack index.

Definition at line 143 of file AnnualViewModel.h.

◆ deleteCurrent()

void ui::AnnualViewModel::deleteCurrent ( )

Deletes the selected annual through workspace.

Definition at line 537 of file AnnualViewModel.cpp.

Here is the call graph for this function:

◆ hasChanges()

bool ui::AnnualViewModel::hasChanges ( ) const

Returns whether form state differs from the saved annual state.

Returns
True when there are unsaved UI changes.

Definition at line 202 of file AnnualViewModel.cpp.

◆ hasRows()

bool ui::AnnualViewModel::hasRows ( ) const

Returns whether annual rows exist.

Returns
True when the sidebar has rows.

Definition at line 198 of file AnnualViewModel.cpp.

◆ isEdit()

bool ui::AnnualViewModel::isEdit ( ) const

Returns whether an existing annual is selected.

Returns
True in edit mode, false in create mode.

Definition at line 168 of file AnnualViewModel.cpp.

◆ name()

QString ui::AnnualViewModel::name ( ) const
inline

Returns the annual name field.

Returns
Annual name.

Definition at line 93 of file AnnualViewModel.h.

◆ navigate()

void ui::AnnualViewModel::navigate ( int delta)

Navigates between annual rows.

Parameters
deltaRelative movement, usually -1 or 1.

Definition at line 555 of file AnnualViewModel.cpp.

◆ refreshFromSelection()

void ui::AnnualViewModel::refreshFromSelection ( )

Reloads create or edit state from the workspace selection.

Definition at line 214 of file AnnualViewModel.cpp.

Here is the caller graph for this function:

◆ removeAnalysis()

void ui::AnnualViewModel::removeAnalysis ( const QString & id)

Removes an analysis from the annual.

Parameters
idAnalysis id.

Definition at line 455 of file AnnualViewModel.cpp.

◆ resetCreateState()

void ui::AnnualViewModel::resetCreateState ( )

Resets the create form to defaults.

Definition at line 220 of file AnnualViewModel.cpp.

◆ selectAnnual()

void ui::AnnualViewModel::selectAnnual ( const QString & id)

Selects an annual row.

Parameters
idAnnual id or empty string for create mode.

Definition at line 567 of file AnnualViewModel.cpp.

◆ selectedAnnualId()

QString ui::AnnualViewModel::selectedAnnualId ( ) const

Returns the selected annual id.

Returns
Selected annual id or an empty string.

Definition at line 176 of file AnnualViewModel.cpp.

◆ setAnalysisExportFormat()

void ui::AnnualViewModel::setAnalysisExportFormat ( const QString & id,
const QString & exportFormat )

Updates export format for an assigned analysis.

Parameters
idAnalysis id.
exportFormatExport format key.

Definition at line 465 of file AnnualViewModel.cpp.

◆ setAnnualWorkflow()

void ui::AnnualViewModel::setAnnualWorkflow ( AnnualWorkflow * value)

Sets the workflow used for annual computation.

Parameters
valueAnnual workflow or nullptr.

Definition at line 158 of file AnnualViewModel.cpp.

Here is the call graph for this function:

◆ setName()

void ui::AnnualViewModel::setName ( const QString & value)

Updates the annual name field.

Parameters
valueAnnual name.

Definition at line 180 of file AnnualViewModel.cpp.

◆ setWorkspaceRoles()

void ui::AnnualViewModel::setWorkspaceRoles ( WorkspaceStore * store,
WorkspaceCommands * commands,
WorkspaceSelection * selection,
WorkspaceSelectors * selectors )

Sets workspace roles used for annual rows, selection and mutations.

Definition at line 145 of file AnnualViewModel.cpp.

Here is the call graph for this function:

◆ setYear()

void ui::AnnualViewModel::setYear ( int value)

Updates the selected annual year.

Parameters
valueYear value.

Definition at line 188 of file AnnualViewModel.cpp.

Here is the caller graph for this function:

◆ statusSummaryText()

QString ui::AnnualViewModel::statusSummaryText ( ) const

Returns the annual status summary text.

Returns
Status summary text.

Definition at line 675 of file AnnualViewModel.cpp.

◆ stepYear()

void ui::AnnualViewModel::stepYear ( int delta)

Steps the selected year by a relative delta.

Parameters
deltaYear delta.

Definition at line 234 of file AnnualViewModel.cpp.

Here is the call graph for this function:

◆ submitCreate()

void ui::AnnualViewModel::submitCreate ( )

Creates an annual through workspace.

Definition at line 508 of file AnnualViewModel.cpp.

Here is the call graph for this function:

◆ submitUpdate()

void ui::AnnualViewModel::submitUpdate ( )

Updates the selected annual through workspace.

Definition at line 524 of file AnnualViewModel.cpp.

Here is the call graph for this function:

◆ toggleContent()

void ui::AnnualViewModel::toggleContent ( )

Toggles between annual analysis assignment and transaction preview.

Definition at line 229 of file AnnualViewModel.cpp.

◆ toggleTransactionSection()

void ui::AnnualViewModel::toggleTransactionSection ( const QString & key)

Toggles expansion state for a transaction section.

Parameters
keySection key.

Definition at line 683 of file AnnualViewModel.cpp.

◆ transactionSections()

QVariantList ui::AnnualViewModel::transactionSections ( ) const

Returns grouped annual transaction sections.

Returns
Section rows.

Definition at line 617 of file AnnualViewModel.cpp.

◆ verificationRows()

QVariantList ui::AnnualViewModel::verificationRows ( ) const

Returns annual verification rows.

Returns
Verification rows.

Definition at line 638 of file AnnualViewModel.cpp.

◆ year()

int ui::AnnualViewModel::year ( ) const
inlinenoexcept

Returns the selected annual year.

Returns
Year value.

Definition at line 107 of file AnnualViewModel.h.

Property Documentation

◆ annualRows

QVariantList ui::AnnualViewModel::annualRows
read

Definition at line 32 of file AnnualViewModel.h.

◆ annualTransactions

QVariantList ui::AnnualViewModel::annualTransactions
read

Definition at line 41 of file AnnualViewModel.h.

◆ assignedAnalysisRows

QVariantList ui::AnnualViewModel::assignedAnalysisRows
read

Definition at line 38 of file AnnualViewModel.h.

◆ availableAnalysisRows

QVariantList ui::AnnualViewModel::availableAnalysisRows
read

Definition at line 36 of file AnnualViewModel.h.

◆ canSubmit

bool ui::AnnualViewModel::canSubmit
read

Definition at line 47 of file AnnualViewModel.h.

◆ contentIndex

int ui::AnnualViewModel::contentIndex
read

Definition at line 40 of file AnnualViewModel.h.

◆ hasChanges

bool ui::AnnualViewModel::hasChanges
read

Definition at line 49 of file AnnualViewModel.h.

◆ hasRows

bool ui::AnnualViewModel::hasRows
read

Definition at line 48 of file AnnualViewModel.h.

◆ isEdit

bool ui::AnnualViewModel::isEdit
read

Definition at line 31 of file AnnualViewModel.h.

◆ name

QString ui::AnnualViewModel::name
readwrite

Definition at line 34 of file AnnualViewModel.h.

◆ selectedAnnualId

QString ui::AnnualViewModel::selectedAnnualId
read

Definition at line 33 of file AnnualViewModel.h.

◆ statusSummaryText

QString ui::AnnualViewModel::statusSummaryText
read

Definition at line 46 of file AnnualViewModel.h.

◆ transactionSections

QVariantList ui::AnnualViewModel::transactionSections
read

Definition at line 43 of file AnnualViewModel.h.

◆ verificationRows

QVariantList ui::AnnualViewModel::verificationRows
read

Definition at line 45 of file AnnualViewModel.h.

◆ year

int ui::AnnualViewModel::year
readwrite

Definition at line 35 of file AnnualViewModel.h.


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