|
FOSSredder 0.5.0
|
Owns Booking view form state and delegates statement and transaction CRUD to workspace. More...
#include <BookingViewModel.h>


Signals | |
| void | changed () |
Public Member Functions | |
| BookingViewModel (WorkspaceStore *store, WorkspaceCommands *commands, WorkspaceSelection *selection, WorkspaceSelectors *selectors, QObject *parent=nullptr) | |
| Creates the booking view model backed by workspace roles. | |
| bool | isCreateMode () const |
| Returns whether the form currently creates a new statement. | |
| QString | statementName () const |
| Returns the statement name shown in the form. | |
| void | setStatementName (const QString &value) |
| Updates the statement name shown in the form. | |
| QString | transactionName () const |
| Returns the current transaction name field. | |
| void | setTransactionName (const QString &value) |
| Updates the current transaction name field. | |
| QString | transactionBookingDate () const |
| Returns the current transaction booking date field. | |
| void | setTransactionBookingDate (const QString &value) |
| Updates the current transaction booking date field. | |
| QString | transactionValuta () const |
| Returns the current transaction valuta field. | |
| void | setTransactionValuta (const QString &value) |
| Updates the current transaction valuta field. | |
| QString | transactionAmountText () const |
| Returns the current amount field as text. | |
| void | setTransactionAmountText (const QString &value) |
| Updates the current amount field. | |
| int | transactionStatusIndex () const |
| Returns the selected transaction status option index. | |
| void | setTransactionStatusIndex (int index) |
| Updates the current transaction status from an option index. | |
| bool | transactionAllocatable () const |
| Returns whether the current transaction is allocatable. | |
| void | setTransactionAllocatable (bool value) |
| Updates the current transaction allocatable flag. | |
| QVariantList | propertyRows () const |
| Returns property rows for the property checkbox list. | |
| QVariantList | selectedPropertyIds () const |
| Returns property ids selected for the current transaction. | |
| QVariantList | transactionStatusOptions () const |
| Returns selectable transaction status options. | |
| QVariantList | statementRows () const |
| Returns statements shown in the booking sidebar. | |
| QString | selectedStatementId () const |
| Returns the selected statement id. | |
| QString | selectedTransactionId () const |
| Returns the selected transaction id. | |
| QVariantList | actorDisplayRows () const |
| Returns actor rows prepared for the actor dropdown. | |
| QVariantList | contractDisplayRows () const |
| Returns contract rows prepared for the contract dropdown. | |
| int | selectedActorIndex () const |
| Returns the selected actor dropdown index. | |
| int | selectedContractIndex () const |
| Returns the selected contract dropdown index. | |
| QString | transactionInfoText () const |
| Returns the transaction position text shown in the form. | |
| bool | hasStatements () const |
| Returns whether statement rows are available. | |
| bool | hasMultipleTransactions () const |
| Returns whether the current statement has multiple transactions. | |
| bool | canCreate () const |
| Returns whether the create form can be submitted. | |
| bool | canUpdate () const |
| Returns whether the selected statement or transaction changed. | |
| bool | canAddTransaction () const |
| Returns whether a transaction can be added to the current statement. | |
| bool | canDeleteTransaction () const |
| Returns whether the current transaction can be deleted. | |
| Q_INVOKABLE void | resetCreateState () |
| Clears the create form and creates a single empty transaction state. | |
| Q_INVOKABLE void | previousStatement () |
| Selects the previous statement or the create form. | |
| Q_INVOKABLE void | nextStatement () |
| Selects the next statement or the create form. | |
| Q_INVOKABLE void | previousTransaction () |
| Selects the previous transaction in the current statement. | |
| Q_INVOKABLE void | nextTransaction () |
| Selects the next transaction in the current statement. | |
| Q_INVOKABLE void | addTransactionAfterCurrent () |
| Adds a transaction after the current transaction. | |
| Q_INVOKABLE void | deleteCurrentTransaction () |
| Deletes the current transaction when at least one remains. | |
| Q_INVOKABLE void | setPropertySelected (const QString &propertyId, bool selected) |
| Updates whether a property is selected for the current transaction. | |
| Q_INVOKABLE void | selectActorIndex (int index) |
| Selects an actor from the actor dropdown. | |
| Q_INVOKABLE void | selectContractIndex (int index) |
| Selects a contract from the contract dropdown. | |
| Q_INVOKABLE void | selectStatement (const QString &statementId) |
| Selects a statement from the sidebar. | |
| Q_INVOKABLE void | selectTransaction (const QString &statementId, const QString &transactionId) |
| Selects a transaction from the sidebar. | |
| Q_INVOKABLE QString | submit () |
| Creates a statement and its transaction form states through workspace. | |
| Q_INVOKABLE void | updateCurrent () |
| Updates the selected statement and transaction through workspace. | |
| Q_INVOKABLE void | deleteCurrentStatement () |
| Deletes the selected statement through workspace. | |
Properties | |
| bool | isCreateMode |
| QString | statementName |
| QString | transactionName |
| QString | transactionBookingDate |
| QString | transactionValuta |
| QString | transactionAmountText |
| int | transactionStatusIndex |
| bool | transactionAllocatable |
| QVariantList | propertyRows |
| QVariantList | selectedPropertyIds |
| QVariantList | transactionStatusOptions |
| QVariantList | statementRows |
| QString | selectedStatementId |
| QString | selectedTransactionId |
| QVariantList | actorDisplayRows |
| QVariantList | contractDisplayRows |
| int | selectedActorIndex |
| int | selectedContractIndex |
| QString | transactionInfoText |
| bool | hasStatements |
| bool | hasMultipleTransactions |
| bool | canCreate |
| bool | canUpdate |
| bool | canAddTransaction |
| bool | canDeleteTransaction |
Owns Booking view form state and delegates statement and transaction CRUD to workspace.
Definition at line 24 of file BookingViewModel.h.
|
explicit |
Creates the booking view model backed by workspace roles.
| parent | Optional Qt parent object. |
Definition at line 459 of file BookingViewModel.cpp.

| QVariantList ui::BookingViewModel::actorDisplayRows | ( | ) | const |
Returns actor rows prepared for the actor dropdown.
Definition at line 1165 of file BookingViewModel.cpp.
| void ui::BookingViewModel::addTransactionAfterCurrent | ( | ) |
Adds a transaction after the current transaction.
Definition at line 769 of file BookingViewModel.cpp.

| bool ui::BookingViewModel::canAddTransaction | ( | ) | const |
Returns whether a transaction can be added to the current statement.
Definition at line 597 of file BookingViewModel.cpp.
| bool ui::BookingViewModel::canCreate | ( | ) | const |
Returns whether the create form can be submitted.
Definition at line 1032 of file BookingViewModel.cpp.
| bool ui::BookingViewModel::canDeleteTransaction | ( | ) | const |
Returns whether the current transaction can be deleted.
Definition at line 601 of file BookingViewModel.cpp.
| bool ui::BookingViewModel::canUpdate | ( | ) | const |
Returns whether the selected statement or transaction changed.
Definition at line 1036 of file BookingViewModel.cpp.
|
signal |


| QVariantList ui::BookingViewModel::contractDisplayRows | ( | ) | const |
Returns contract rows prepared for the contract dropdown.
Definition at line 1169 of file BookingViewModel.cpp.
| void ui::BookingViewModel::deleteCurrentStatement | ( | ) |
Deletes the selected statement through workspace.
Definition at line 1111 of file BookingViewModel.cpp.

| void ui::BookingViewModel::deleteCurrentTransaction | ( | ) |
Deletes the current transaction when at least one remains.
Definition at line 812 of file BookingViewModel.cpp.

| bool ui::BookingViewModel::hasMultipleTransactions | ( | ) | const |
Returns whether the current statement has multiple transactions.
Definition at line 589 of file BookingViewModel.cpp.
| bool ui::BookingViewModel::hasStatements | ( | ) | const |
Returns whether statement rows are available.
Definition at line 546 of file BookingViewModel.cpp.
| bool ui::BookingViewModel::isCreateMode | ( | ) | const |
Returns whether the form currently creates a new statement.
Definition at line 476 of file BookingViewModel.cpp.
| void ui::BookingViewModel::nextStatement | ( | ) |
Selects the next statement or the create form.
Definition at line 941 of file BookingViewModel.cpp.

| void ui::BookingViewModel::nextTransaction | ( | ) |
Selects the next transaction in the current statement.
Definition at line 1001 of file BookingViewModel.cpp.

| void ui::BookingViewModel::previousStatement | ( | ) |
Selects the previous statement or the create form.
Definition at line 913 of file BookingViewModel.cpp.

| void ui::BookingViewModel::previousTransaction | ( | ) |
Selects the previous transaction in the current statement.
Definition at line 969 of file BookingViewModel.cpp.

| QVariantList ui::BookingViewModel::propertyRows | ( | ) | const |
Returns property rows for the property checkbox list.
Definition at line 1147 of file BookingViewModel.cpp.
| void ui::BookingViewModel::resetCreateState | ( | ) |
Clears the create form and creates a single empty transaction state.
Definition at line 753 of file BookingViewModel.cpp.


| void ui::BookingViewModel::selectActorIndex | ( | int | index | ) |
Selects an actor from the actor dropdown.
| index | Index into actorDisplayRows(). |
Definition at line 1210 of file BookingViewModel.cpp.
| void ui::BookingViewModel::selectContractIndex | ( | int | index | ) |
Selects a contract from the contract dropdown.
| index | Index into contractDisplayRows(). |
Definition at line 1217 of file BookingViewModel.cpp.
| int ui::BookingViewModel::selectedActorIndex | ( | ) | const |
Returns the selected actor dropdown index.
Definition at line 1182 of file BookingViewModel.cpp.
| int ui::BookingViewModel::selectedContractIndex | ( | ) | const |
Returns the selected contract dropdown index.
Definition at line 1188 of file BookingViewModel.cpp.
| QVariantList ui::BookingViewModel::selectedPropertyIds | ( | ) | const |
Returns property ids selected for the current transaction.
Definition at line 1151 of file BookingViewModel.cpp.
| QString ui::BookingViewModel::selectedStatementId | ( | ) | const |
Returns the selected statement id.
Definition at line 538 of file BookingViewModel.cpp.
| QString ui::BookingViewModel::selectedTransactionId | ( | ) | const |
Returns the selected transaction id.
Definition at line 542 of file BookingViewModel.cpp.
| void ui::BookingViewModel::selectStatement | ( | const QString & | statementId | ) |
Selects a statement from the sidebar.
| statementId | Statement id to select. |
Definition at line 556 of file BookingViewModel.cpp.
| void ui::BookingViewModel::selectTransaction | ( | const QString & | statementId, |
| const QString & | transactionId ) |
Selects a transaction from the sidebar.
| statementId | Parent statement id. |
| transactionId | Transaction id to select. |
Definition at line 563 of file BookingViewModel.cpp.
| void ui::BookingViewModel::setPropertySelected | ( | const QString & | propertyId, |
| bool | selected ) |
Updates whether a property is selected for the current transaction.
| propertyId | Property id from the checkbox row. |
| selected | True to select the property, false to remove it. |
Definition at line 1194 of file BookingViewModel.cpp.
| void ui::BookingViewModel::setStatementName | ( | const QString & | value | ) |
Updates the statement name shown in the form.
| value | New statement name. |
Definition at line 484 of file BookingViewModel.cpp.

| void ui::BookingViewModel::setTransactionAllocatable | ( | bool | value | ) |
Updates the current transaction allocatable flag.
| value | New allocatable flag. |
Definition at line 730 of file BookingViewModel.cpp.
| void ui::BookingViewModel::setTransactionAmountText | ( | const QString & | value | ) |
Updates the current amount field.
| value | New amount text. |
Definition at line 722 of file BookingViewModel.cpp.
| void ui::BookingViewModel::setTransactionBookingDate | ( | const QString & | value | ) |
Updates the current transaction booking date field.
| value | New booking date text. |
Definition at line 705 of file BookingViewModel.cpp.
| void ui::BookingViewModel::setTransactionName | ( | const QString & | value | ) |
Updates the current transaction name field.
| value | New transaction name. |
Definition at line 697 of file BookingViewModel.cpp.
| void ui::BookingViewModel::setTransactionStatusIndex | ( | int | index | ) |
Updates the current transaction status from an option index.
| index | Index into transactionStatusOptions(). |
Definition at line 1139 of file BookingViewModel.cpp.
| void ui::BookingViewModel::setTransactionValuta | ( | const QString & | value | ) |
Updates the current transaction valuta field.
| value | New valuta text. |
Definition at line 713 of file BookingViewModel.cpp.
| QString ui::BookingViewModel::statementName | ( | ) | const |
Returns the statement name shown in the form.
Definition at line 480 of file BookingViewModel.cpp.
| QVariantList ui::BookingViewModel::statementRows | ( | ) | const |
Returns statements shown in the booking sidebar.
Definition at line 533 of file BookingViewModel.cpp.
| QString ui::BookingViewModel::submit | ( | ) |
Creates a statement and its transaction form states through workspace.
Definition at line 1045 of file BookingViewModel.cpp.

| bool ui::BookingViewModel::transactionAllocatable | ( | ) | const |
Returns whether the current transaction is allocatable.
Definition at line 726 of file BookingViewModel.cpp.
| QString ui::BookingViewModel::transactionAmountText | ( | ) | const |
Returns the current amount field as text.
Definition at line 717 of file BookingViewModel.cpp.
| QString ui::BookingViewModel::transactionBookingDate | ( | ) | const |
Returns the current transaction booking date field.
Definition at line 701 of file BookingViewModel.cpp.
| QString ui::BookingViewModel::transactionInfoText | ( | ) | const |
Returns the transaction position text shown in the form.
Definition at line 571 of file BookingViewModel.cpp.
| QString ui::BookingViewModel::transactionName | ( | ) | const |
Returns the current transaction name field.
Definition at line 693 of file BookingViewModel.cpp.
| int ui::BookingViewModel::transactionStatusIndex | ( | ) | const |
Returns the selected transaction status option index.
Definition at line 1127 of file BookingViewModel.cpp.
| QVariantList ui::BookingViewModel::transactionStatusOptions | ( | ) | const |
Returns selectable transaction status options.
Definition at line 1157 of file BookingViewModel.cpp.

| QString ui::BookingViewModel::transactionValuta | ( | ) | const |
Returns the current transaction valuta field.
Definition at line 709 of file BookingViewModel.cpp.
| void ui::BookingViewModel::updateCurrent | ( | ) |
Updates the selected statement and transaction through workspace.
Definition at line 1073 of file BookingViewModel.cpp.

|
read |
Definition at line 51 of file BookingViewModel.h.
|
read |
Definition at line 64 of file BookingViewModel.h.
|
read |
Definition at line 62 of file BookingViewModel.h.
|
read |
Definition at line 65 of file BookingViewModel.h.
|
read |
Definition at line 63 of file BookingViewModel.h.
|
read |
Definition at line 52 of file BookingViewModel.h.
|
read |
Definition at line 60 of file BookingViewModel.h.
|
read |
Definition at line 59 of file BookingViewModel.h.
|
read |
Definition at line 26 of file BookingViewModel.h.
|
read |
Definition at line 41 of file BookingViewModel.h.
|
read |
Definition at line 54 of file BookingViewModel.h.
|
read |
Definition at line 55 of file BookingViewModel.h.
|
read |
Definition at line 42 of file BookingViewModel.h.
|
read |
Definition at line 47 of file BookingViewModel.h.
|
read |
Definition at line 49 of file BookingViewModel.h.
|
readwrite |
Definition at line 27 of file BookingViewModel.h.
|
read |
Definition at line 46 of file BookingViewModel.h.
|
read |
Definition at line 39 of file BookingViewModel.h.
|
read |
Definition at line 35 of file BookingViewModel.h.
|
read |
Definition at line 31 of file BookingViewModel.h.
|
read |
Definition at line 57 of file BookingViewModel.h.
|
read |
Definition at line 29 of file BookingViewModel.h.
|
read |
Definition at line 37 of file BookingViewModel.h.
|
read |
Definition at line 44 of file BookingViewModel.h.
|
read |
Definition at line 33 of file BookingViewModel.h.