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


Signals | |
| void | changed () |
| Emitted when actor view model state changed. | |
Public Member Functions | |
| ActorViewModel (WorkspaceStore *store, WorkspaceCommands *commands, WorkspaceSelection *selection, WorkspaceSelectors *selectors, QObject *parent=nullptr) | |
| Creates the actor view model bound to workspace roles. | |
| QString | currentId () const |
| Returns the currently selected actor id. | |
| QString | name () const |
| Returns the editable actor name. | |
| void | setName (const QString &value) |
| Updates the editable actor name. | |
| QVariantList | aliases () const |
| Returns editable actor aliases. | |
| void | setAliases (const QVariantList &value) |
| Replaces editable actor 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. | |
| QVariantList | selectedContractIds () const |
| Returns selected contract ids in the actor form. | |
| void | setSelectedContractIds (const QVariantList &value) |
| Replaces selected contract ids in the actor form. | |
| bool | isEdit () const |
| Checks whether the form edits an existing actor. | |
| bool | hasChanges () const |
| Checks whether the editable form differs from the loaded actor. | |
| bool | canSubmit () const |
| Checks whether the form has enough UI data to submit. | |
| QVariantList | actorRows () const |
| Returns actor sidebar rows. | |
| QVariantList | contractRows () const |
| Returns selectable contract rows for the actor form. | |
| Q_INVOKABLE void | selectActor (const QString &id) |
| Selects an actor for editing. | |
| 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 actor form. | |
| Q_INVOKABLE void | requestRemoveSelectedAlias () |
| Removes the currently selected alias when possible. | |
| Q_INVOKABLE void | enterCreateMode () |
| Clears selection and opens an empty create form. | |
| Q_INVOKABLE void | previous () |
| Selects the previous actor row. | |
| Q_INVOKABLE void | next () |
| Selects the next actor row. | |
| Q_INVOKABLE QString | submit () |
| Creates or updates the actor through workspace commands. | |
| Q_INVOKABLE void | deleteCurrent () |
| Deletes the selected actor through workspace commands. | |
| Q_INVOKABLE void | clear () |
| Clears the editable actor form. | |
| Q_INVOKABLE void | setContractSelected (const QString &contractId, bool selected) |
| Adds or removes a contract id from the actor form selection. | |
Properties | |
| QString | currentId |
| QString | name |
| QVariantList | aliases |
| QString | aliasInputText |
| int | aliasIndex |
| QVariantList | selectedContractIds |
| QVariantList | actorRows |
| QVariantList | contractRows |
| bool | isEdit |
| bool | hasChanges |
| bool | canSubmit |
Owns editable actor UI state and delegates actor CRUD to workspace.
Definition at line 24 of file ActorViewModel.h.
|
explicit |
Creates the actor view model bound to workspace roles.
| parent | Optional QObject parent. |
Definition at line 260 of file ActorViewModel.cpp.
| QVariantList ui::ActorViewModel::actorRows | ( | ) | const |
Returns actor sidebar rows.
Definition at line 428 of file ActorViewModel.cpp.
| void ui::ActorViewModel::addAlias | ( | const QString & | value | ) |
Adds an alias to the actor form.
| value | Alias text to add. |
Definition at line 337 of file ActorViewModel.cpp.

|
inline |
Returns editable actor aliases.
Definition at line 71 of file ActorViewModel.h.
|
inline |
Returns the selected alias index.
Definition at line 95 of file ActorViewModel.h.
|
inline |
Returns the current alias input text.
Definition at line 83 of file ActorViewModel.h.
| bool ui::ActorViewModel::canAddAlias | ( | const QString & | value | ) | const |
Checks whether an alias value can be added to the form.
| value | Alias text to inspect. |
Definition at line 329 of file ActorViewModel.cpp.
| bool ui::ActorViewModel::canSubmit | ( | ) | const |
Checks whether the form has enough UI data to submit.
Definition at line 317 of file ActorViewModel.cpp.
|
signal |
Emitted when actor view model state changed.

| void ui::ActorViewModel::clear | ( | ) |
Clears the editable actor form.
Definition at line 410 of file ActorViewModel.cpp.
| QVariantList ui::ActorViewModel::contractRows | ( | ) | const |
Returns selectable contract rows for the actor form.
Definition at line 432 of file ActorViewModel.cpp.
| QString ui::ActorViewModel::currentId | ( | ) | const |
Returns the currently selected actor id.
Definition at line 424 of file ActorViewModel.cpp.
| void ui::ActorViewModel::deleteCurrent | ( | ) |
Deletes the selected actor through workspace commands.
Definition at line 397 of file ActorViewModel.cpp.

| void ui::ActorViewModel::enterCreateMode | ( | ) |
Clears selection and opens an empty create form.
Definition at line 352 of file ActorViewModel.cpp.
| bool ui::ActorViewModel::hasChanges | ( | ) | const |
Checks whether the editable form differs from the loaded actor.
Definition at line 321 of file ActorViewModel.cpp.
| bool ui::ActorViewModel::isEdit | ( | ) | const |
Checks whether the form edits an existing actor.
Definition at line 313 of file ActorViewModel.cpp.
|
inline |
Returns the editable actor name.
Definition at line 59 of file ActorViewModel.h.
| void ui::ActorViewModel::next | ( | ) |
Selects the next actor row.
Definition at line 368 of file ActorViewModel.cpp.
| void ui::ActorViewModel::previous | ( | ) |
Selects the previous actor row.
Definition at line 359 of file ActorViewModel.cpp.
| void ui::ActorViewModel::requestRemoveSelectedAlias | ( | ) |
Removes the currently selected alias when possible.
Definition at line 344 of file ActorViewModel.cpp.

| void ui::ActorViewModel::selectActor | ( | const QString & | id | ) |
Selects an actor for editing.
| id | Actor id selected by the QML sidebar. |
Definition at line 442 of file ActorViewModel.cpp.
|
inline |
Returns selected contract ids in the actor form.
Definition at line 107 of file ActorViewModel.h.
| void ui::ActorViewModel::setAliases | ( | const QVariantList & | value | ) |
Replaces editable actor aliases.
| value | New alias list. |
Definition at line 278 of file ActorViewModel.cpp.

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

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

| void ui::ActorViewModel::setContractSelected | ( | const QString & | contractId, |
| bool | selected ) |
Adds or removes a contract id from the actor form selection.
| contractId | Contract id to toggle. |
| selected | Whether the contract should be selected. |
Definition at line 416 of file ActorViewModel.cpp.

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

| void ui::ActorViewModel::setSelectedContractIds | ( | const QVariantList & | value | ) |
Replaces selected contract ids in the actor form.
| value | New selected contract ids. |
Definition at line 305 of file ActorViewModel.cpp.

| QString ui::ActorViewModel::submit | ( | ) |
Creates or updates the actor through workspace commands.
Definition at line 377 of file ActorViewModel.cpp.

|
read |
Definition at line 34 of file ActorViewModel.h.
|
readwrite |
Definition at line 28 of file ActorViewModel.h.
|
readwrite |
Definition at line 31 of file ActorViewModel.h.
|
readwrite |
Definition at line 29 of file ActorViewModel.h.
|
read |
Definition at line 38 of file ActorViewModel.h.
|
read |
Definition at line 35 of file ActorViewModel.h.
|
read |
Definition at line 26 of file ActorViewModel.h.
|
read |
Definition at line 37 of file ActorViewModel.h.
|
read |
Definition at line 36 of file ActorViewModel.h.
|
readwrite |
Definition at line 27 of file ActorViewModel.h.
|
read |
Definition at line 32 of file ActorViewModel.h.