|
FOSSredder 0.5.0
|
Owns Annual view form state and delegates annual CRUD and computation to workspace and workflow. More...
#include <AnnualViewModel.h>


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 |
Owns Annual view form state and delegates annual CRUD and computation to workspace and workflow.
Definition at line 27 of file AnnualViewModel.h.
|
explicit |
Creates the annual view model.
| parent | Optional Qt parent object. |
Definition at line 134 of file AnnualViewModel.cpp.
| void ui::AnnualViewModel::addAvailableAnalysisAtIndex | ( | int | index | ) |
Adds an available analysis by row index.
| index | Index into availableAnalysisRows(). |
Definition at line 439 of file AnnualViewModel.cpp.
| QVariantList ui::AnnualViewModel::analysisIds | ( | ) | const |
Returns ids of analyses assigned to the annual.
Definition at line 430 of file AnnualViewModel.cpp.
| QVariantList ui::AnnualViewModel::annualRows | ( | ) | const |
Returns annual rows for the sidebar.
Definition at line 172 of file AnnualViewModel.cpp.
|
inline |
Returns annual transaction preview rows.
Definition at line 151 of file AnnualViewModel.h.
|
inline |
Returns analyses assigned to the annual.
Definition at line 135 of file AnnualViewModel.h.
|
inline |
Returns analyses available for assignment.
Definition at line 127 of file AnnualViewModel.h.
|
inlinenoexcept |
Returns whether the current annual can be submitted.
Definition at line 177 of file AnnualViewModel.h.
|
signal |
|
inlinenoexcept |
Returns the active annual content stack index.
Definition at line 143 of file AnnualViewModel.h.
| void ui::AnnualViewModel::deleteCurrent | ( | ) |
Deletes the selected annual through workspace.
Definition at line 537 of file AnnualViewModel.cpp.

| bool ui::AnnualViewModel::hasChanges | ( | ) | const |
Returns whether form state differs from the saved annual state.
Definition at line 202 of file AnnualViewModel.cpp.
| bool ui::AnnualViewModel::hasRows | ( | ) | const |
Returns whether annual rows exist.
Definition at line 198 of file AnnualViewModel.cpp.
| bool ui::AnnualViewModel::isEdit | ( | ) | const |
Returns whether an existing annual is selected.
Definition at line 168 of file AnnualViewModel.cpp.
|
inline |
| void ui::AnnualViewModel::navigate | ( | int | delta | ) |
Navigates between annual rows.
| delta | Relative movement, usually -1 or 1. |
Definition at line 555 of file AnnualViewModel.cpp.
| void ui::AnnualViewModel::refreshFromSelection | ( | ) |
Reloads create or edit state from the workspace selection.
Definition at line 214 of file AnnualViewModel.cpp.

| void ui::AnnualViewModel::removeAnalysis | ( | const QString & | id | ) |
Removes an analysis from the annual.
| id | Analysis id. |
Definition at line 455 of file AnnualViewModel.cpp.
| void ui::AnnualViewModel::resetCreateState | ( | ) |
Resets the create form to defaults.
Definition at line 220 of file AnnualViewModel.cpp.
| void ui::AnnualViewModel::selectAnnual | ( | const QString & | id | ) |
Selects an annual row.
| id | Annual id or empty string for create mode. |
Definition at line 567 of file AnnualViewModel.cpp.
| QString ui::AnnualViewModel::selectedAnnualId | ( | ) | const |
Returns the selected annual id.
Definition at line 176 of file AnnualViewModel.cpp.
| void ui::AnnualViewModel::setAnalysisExportFormat | ( | const QString & | id, |
| const QString & | exportFormat ) |
Updates export format for an assigned analysis.
| id | Analysis id. |
| exportFormat | Export format key. |
Definition at line 465 of file AnnualViewModel.cpp.
| void ui::AnnualViewModel::setAnnualWorkflow | ( | AnnualWorkflow * | value | ) |
Sets the workflow used for annual computation.
| value | Annual workflow or nullptr. |
Definition at line 158 of file AnnualViewModel.cpp.

| void ui::AnnualViewModel::setName | ( | const QString & | value | ) |
Updates the annual name field.
| value | Annual name. |
Definition at line 180 of file AnnualViewModel.cpp.
| 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.

| void ui::AnnualViewModel::setYear | ( | int | value | ) |
Updates the selected annual year.
| value | Year value. |
Definition at line 188 of file AnnualViewModel.cpp.

| QString ui::AnnualViewModel::statusSummaryText | ( | ) | const |
Returns the annual status summary text.
Definition at line 675 of file AnnualViewModel.cpp.
| void ui::AnnualViewModel::stepYear | ( | int | delta | ) |
Steps the selected year by a relative delta.
| delta | Year delta. |
Definition at line 234 of file AnnualViewModel.cpp.

| void ui::AnnualViewModel::submitCreate | ( | ) |
Creates an annual through workspace.
Definition at line 508 of file AnnualViewModel.cpp.

| void ui::AnnualViewModel::submitUpdate | ( | ) |
Updates the selected annual through workspace.
Definition at line 524 of file AnnualViewModel.cpp.

| void ui::AnnualViewModel::toggleContent | ( | ) |
Toggles between annual analysis assignment and transaction preview.
Definition at line 229 of file AnnualViewModel.cpp.
| void ui::AnnualViewModel::toggleTransactionSection | ( | const QString & | key | ) |
Toggles expansion state for a transaction section.
| key | Section key. |
Definition at line 683 of file AnnualViewModel.cpp.
| QVariantList ui::AnnualViewModel::transactionSections | ( | ) | const |
Returns grouped annual transaction sections.
Definition at line 617 of file AnnualViewModel.cpp.
| QVariantList ui::AnnualViewModel::verificationRows | ( | ) | const |
Returns annual verification rows.
Definition at line 638 of file AnnualViewModel.cpp.
|
inlinenoexcept |
Returns the selected annual year.
Definition at line 107 of file AnnualViewModel.h.
|
read |
Definition at line 32 of file AnnualViewModel.h.
|
read |
Definition at line 41 of file AnnualViewModel.h.
|
read |
Definition at line 38 of file AnnualViewModel.h.
|
read |
Definition at line 36 of file AnnualViewModel.h.
|
read |
Definition at line 47 of file AnnualViewModel.h.
|
read |
Definition at line 40 of file AnnualViewModel.h.
|
read |
Definition at line 49 of file AnnualViewModel.h.
|
read |
Definition at line 48 of file AnnualViewModel.h.
|
read |
Definition at line 31 of file AnnualViewModel.h.
|
readwrite |
Definition at line 34 of file AnnualViewModel.h.
|
read |
Definition at line 33 of file AnnualViewModel.h.
|
read |
Definition at line 46 of file AnnualViewModel.h.
|
read |
Definition at line 43 of file AnnualViewModel.h.
|
read |
Definition at line 45 of file AnnualViewModel.h.
|
readwrite |
Definition at line 35 of file AnnualViewModel.h.