|
FOSSredder 0.5.0
|
Owns editable contract UI state and delegates contract CRUD to workspace. More...
#include <ContractViewModel.h>


Signals | |
| void | changed () |
Public Member Functions | |
| ContractViewModel (WorkspaceStore *store, WorkspaceCommands *commands, WorkspaceSelection *selection, WorkspaceSelectors *selectors, QObject *parent=nullptr) | |
| Creates the contract view model bound to workspace roles. | |
| QString | currentId () const |
| Returns the currently selected contract id. | |
| QString | name () const |
| Returns the editable contract name. | |
| void | setName (const QString &value) |
| Updates the editable contract name. | |
| QVariantList | aliases () const |
| Returns editable contract aliases. | |
| void | setAliases (const QVariantList &value) |
| Replaces editable contract aliases. | |
| QString | aliasInputText () const |
| Returns the current alias input text. | |
| void | setAliasInputText (const QString &value) |
| Updates the current alias input text. | |
| int | aliasIndex () const |
| Returns the selected alias index. | |
| void | setAliasIndex (int value) |
| Updates the selected alias index. | |
| QString | type () const |
| Returns the editable contract type. | |
| void | setType (const QString &value) |
| Updates the editable contract type. | |
| QString | allocatableMode () const |
| Returns the editable allocatable mode. | |
| void | setAllocatableMode (const QString &value) |
| Updates the editable allocatable mode. | |
| QVariantList | selectedActorIds () const |
| Returns selected actor ids for this contract. | |
| void | setSelectedActorIds (const QVariantList &value) |
| Replaces selected actor ids for this contract. | |
| QVariantList | selectedPropertyIds () const |
| Returns selected property ids for this contract. | |
| void | setSelectedPropertyIds (const QVariantList &value) |
| Replaces selected property ids for this contract. | |
| QVariantList | actorDisplayRows () const |
| Returns actor rows with an empty entry for the primary actor combo. | |
| QVariantList | contractRows () const |
| Returns contract sidebar rows. | |
| QVariantList | propertyRows () const |
| Returns property rows for the contract property selector. | |
| int | selectedActorIndex () const |
| Returns the selected primary actor combo index. | |
| bool | isEdit () const |
| Reports whether the form edits an existing contract. | |
| bool | hasChanges () const |
| Reports whether the editable fields differ from saved state. | |
| bool | canSubmit () const |
| Reports whether the current form can be submitted. | |
| Q_INVOKABLE bool | canAddAlias (const QString &value) const |
| Checks whether an alias value can be added to the form. | |
| Q_INVOKABLE void | addAlias (const QString &value) |
| Adds an alias to the contract form. | |
| Q_INVOKABLE void | requestRemoveSelectedAlias () |
| Removes the currently selected alias when possible. | |
| Q_INVOKABLE void | clear () |
| Clears the current contract form without changing workspace data. | |
| Q_INVOKABLE void | enterCreateMode () |
| Enters create mode and clears the contract form. | |
| Q_INVOKABLE void | selectContract (const QString &id) |
| Selects a contract for editing. | |
| Q_INVOKABLE void | selectPrimaryActor (const QString &actorId) |
| Selects the primary actor for the contract. | |
| Q_INVOKABLE void | setPropertySelected (const QString &propertyId, bool selected) |
| Toggles a property link in the current form. | |
| Q_INVOKABLE void | previous () |
| Selects the previous contract row. | |
| Q_INVOKABLE void | next () |
| Selects the next contract row. | |
| Q_INVOKABLE QString | submit () |
| Creates or updates the current contract through workspace commands. | |
| Q_INVOKABLE void | deleteCurrent () |
| Deletes the selected contract through workspace commands. | |
Properties | |
| QString | currentId |
| QString | name |
| QString | type |
| QString | allocatableMode |
| QVariantList | aliases |
| QString | aliasInputText |
| int | aliasIndex |
| QVariantList | selectedActorIds |
| QVariantList | selectedPropertyIds |
| QVariantList | actorDisplayRows |
| QVariantList | contractRows |
| QVariantList | propertyRows |
| int | selectedActorIndex |
| bool | isEdit |
| bool | hasChanges |
| bool | canSubmit |
Owns editable contract UI state and delegates contract CRUD to workspace.
Definition at line 24 of file ContractViewModel.h.
|
explicit |
Creates the contract view model bound to workspace roles.
| parent | Optional QObject parent. |
Definition at line 299 of file ContractViewModel.cpp.
| QVariantList ui::ContractViewModel::actorDisplayRows | ( | ) | const |
Returns actor rows with an empty entry for the primary actor combo.
Definition at line 425 of file ContractViewModel.cpp.
| void ui::ContractViewModel::addAlias | ( | const QString & | value | ) |
Adds an alias to the contract form.
| value | Alias text to add. |
Definition at line 353 of file ContractViewModel.cpp.

|
inline |
Returns editable contract aliases.
Definition at line 78 of file ContractViewModel.h.
|
inline |
Returns the selected alias index.
Definition at line 102 of file ContractViewModel.h.
|
inline |
Returns the current alias input text.
Definition at line 90 of file ContractViewModel.h.
| QString ui::ContractViewModel::allocatableMode | ( | ) | const |
Returns the editable allocatable mode.
Definition at line 384 of file ContractViewModel.cpp.
| bool ui::ContractViewModel::canAddAlias | ( | const QString & | value | ) | const |
Checks whether an alias value can be added to the form.
| value | Alias text to inspect. |
Definition at line 345 of file ContractViewModel.cpp.
| bool ui::ContractViewModel::canSubmit | ( | ) | const |
Reports whether the current form can be submitted.
Definition at line 454 of file ContractViewModel.cpp.
|
signal |

| void ui::ContractViewModel::clear | ( | ) |
Clears the current contract form without changing workspace data.
Definition at line 459 of file ContractViewModel.cpp.
| QVariantList ui::ContractViewModel::contractRows | ( | ) | const |
Returns contract sidebar rows.
Definition at line 431 of file ContractViewModel.cpp.
| QString ui::ContractViewModel::currentId | ( | ) | const |
Returns the currently selected contract id.
Definition at line 368 of file ContractViewModel.cpp.
| void ui::ContractViewModel::deleteCurrent | ( | ) |
Deletes the selected contract through workspace commands.
Definition at line 551 of file ContractViewModel.cpp.

| void ui::ContractViewModel::enterCreateMode | ( | ) |
Enters create mode and clears the contract form.
Definition at line 465 of file ContractViewModel.cpp.
| bool ui::ContractViewModel::hasChanges | ( | ) | const |
Reports whether the editable fields differ from saved state.
Definition at line 566 of file ContractViewModel.cpp.
| bool ui::ContractViewModel::isEdit | ( | ) | const |
Reports whether the form edits an existing contract.
Definition at line 450 of file ContractViewModel.cpp.
|
inline |
Returns the editable contract name.
Definition at line 66 of file ContractViewModel.h.
| void ui::ContractViewModel::next | ( | ) |
Selects the next contract row.
Definition at line 513 of file ContractViewModel.cpp.

| void ui::ContractViewModel::previous | ( | ) |
Selects the previous contract row.
Definition at line 500 of file ContractViewModel.cpp.
| QVariantList ui::ContractViewModel::propertyRows | ( | ) | const |
Returns property rows for the contract property selector.
Definition at line 435 of file ContractViewModel.cpp.
| void ui::ContractViewModel::requestRemoveSelectedAlias | ( | ) |
Removes the currently selected alias when possible.
Definition at line 360 of file ContractViewModel.cpp.

| void ui::ContractViewModel::selectContract | ( | const QString & | id | ) |
Selects a contract for editing.
| id | Contract id selected by the QML sidebar. |
Definition at line 474 of file ContractViewModel.cpp.
| QVariantList ui::ContractViewModel::selectedActorIds | ( | ) | const |
Returns selected actor ids for this contract.
Definition at line 397 of file ContractViewModel.cpp.
| int ui::ContractViewModel::selectedActorIndex | ( | ) | const |
Returns the selected primary actor combo index.
Definition at line 439 of file ContractViewModel.cpp.
| QVariantList ui::ContractViewModel::selectedPropertyIds | ( | ) | const |
Returns selected property ids for this contract.
Definition at line 409 of file ContractViewModel.cpp.
| void ui::ContractViewModel::selectPrimaryActor | ( | const QString & | actorId | ) |
Selects the primary actor for the contract.
| actorId | Actor id from the QML combo box, or empty. |
Definition at line 480 of file ContractViewModel.cpp.

| void ui::ContractViewModel::setAliases | ( | const QVariantList & | value | ) |
Replaces editable contract aliases.
| value | New alias list. |
Definition at line 318 of file ContractViewModel.cpp.

| void ui::ContractViewModel::setAliasIndex | ( | int | value | ) |
Updates the selected alias index.
| value | New selected alias index. |
Definition at line 337 of file ContractViewModel.cpp.

| void ui::ContractViewModel::setAliasInputText | ( | const QString & | value | ) |
Updates the current alias input text.
| value | New alias input text. |
Definition at line 329 of file ContractViewModel.cpp.

| void ui::ContractViewModel::setAllocatableMode | ( | const QString & | value | ) |
Updates the editable allocatable mode.
| value | Mode text from QML. |
Definition at line 388 of file ContractViewModel.cpp.

| void ui::ContractViewModel::setName | ( | const QString & | value | ) |
Updates the editable contract name.
| value | New form name. |
Definition at line 310 of file ContractViewModel.cpp.

| void ui::ContractViewModel::setPropertySelected | ( | const QString & | propertyId, |
| bool | selected ) |
Toggles a property link in the current form.
| propertyId | Property id toggled by QML. |
| selected | Whether the property should be selected. |
Definition at line 489 of file ContractViewModel.cpp.

| void ui::ContractViewModel::setSelectedActorIds | ( | const QVariantList & | value | ) |
Replaces selected actor ids for this contract.
| value | Actor id list from QML. |
Definition at line 401 of file ContractViewModel.cpp.


| void ui::ContractViewModel::setSelectedPropertyIds | ( | const QVariantList & | value | ) |
Replaces selected property ids for this contract.
| value | Property id list from QML. |
Definition at line 413 of file ContractViewModel.cpp.

| void ui::ContractViewModel::setType | ( | const QString & | value | ) |
Updates the editable contract type.
| value | New type text from QML. |
Definition at line 376 of file ContractViewModel.cpp.

| QString ui::ContractViewModel::submit | ( | ) |
Creates or updates the current contract through workspace commands.
Definition at line 526 of file ContractViewModel.cpp.

| QString ui::ContractViewModel::type | ( | ) | const |
Returns the editable contract type.
Definition at line 372 of file ContractViewModel.cpp.
|
read |
Definition at line 39 of file ContractViewModel.h.
|
readwrite |
Definition at line 31 of file ContractViewModel.h.
|
readwrite |
Definition at line 34 of file ContractViewModel.h.
|
readwrite |
Definition at line 32 of file ContractViewModel.h.
|
read |
Definition at line 29 of file ContractViewModel.h.
|
read |
Definition at line 45 of file ContractViewModel.h.
|
read |
Definition at line 40 of file ContractViewModel.h.
|
read |
Definition at line 26 of file ContractViewModel.h.
|
read |
Definition at line 44 of file ContractViewModel.h.
|
read |
Definition at line 43 of file ContractViewModel.h.
|
readwrite |
Definition at line 27 of file ContractViewModel.h.
|
read |
Definition at line 41 of file ContractViewModel.h.
|
read |
Definition at line 35 of file ContractViewModel.h.
|
read |
Definition at line 42 of file ContractViewModel.h.
|
read |
Definition at line 37 of file ContractViewModel.h.
|
readwrite |
Definition at line 28 of file ContractViewModel.h.