![]() |
NDEVR
API Documentation
|
A DesignCommand for setting text values on target design objects with undo support. More...
Public Member Functions | |
| SetTextValue (const StringView &value) | |
| Constructs a SetTextValue command with the given text value. | |
| virtual bool | addTarget (UUID target_id) override |
| Adds a target object UUID to this command's target list. | |
| virtual void | execute (DesignObjectLookup *lookup) override |
| Executes this command against the given DesignObjectLookup. | |
| StringView | icon () const override |
| Returns the icon identifier for this command. | |
| TranslatedString | name () const override |
| Returns the translated display name for this command. | |
| Public Member Functions inherited from DesignCommand | |
| DesignCommand () | |
| Default constructor. | |
| DesignCommand (const DesignCommand &command)=default | |
| Default copy constructor. | |
| virtual | ~DesignCommand () |
| Virtual destructor. | |
| virtual bool | canCombineWith (const DynamicPointer< DesignCommand > &) |
| Checks whether this command can be combined with another command into a single operation. | |
| virtual bool | canGroupWith (const DynamicPointer< DesignCommand > &) |
| Checks whether this command can be grouped with another command for batch execution. | |
| virtual void | combineWith (const DynamicPointer< DesignCommand > &command) |
| Combines this command with another compatible command, merging their operations. | |
| virtual bool | isAsyncExecution () const |
| Whether this command should be executed asynchronously. | |
| void | setUndoRedoID (UUID undo_redo_group) |
| Sets the undo-redo group identifier for this command. | |
| UUID | undoRedoID () const |
| Gets the undo-redo group identifier for this command. | |
Public Attributes | |
| Buffer< UUID > | targets |
| The list of target object UUIDs this command will act upon. | |
| Public Attributes inherited from DesignCommand | |
| bool | can_undo = true |
| Whether this command supports being undone. | |
| bool | has_executed = false |
| Whether this command has already been executed. | |
| UUID | id |
| Unique identifier for this command instance. | |
| bool | is_undo = false |
| Whether this command represents an undo operation. | |
| LogPtr | log |
| Log pipe for reporting command progress and errors. | |
| Time | time = Constant<Time>::Invalid |
| Timestamp of when the command was created or executed. | |
| bool | update_project_modified = true |
| Whether executing this command should mark the project as modified. | |
Protected Attributes | |
| Buffer< TranslatedString > | m_previous_values |
| Previous text values stored for undo support. | |
| String | m_value |
| The new text value to apply to target objects. | |
| Protected Attributes inherited from DesignCommand | |
| UUID | m_undo_redo_group |
| The undo-redo group this command belongs to, for batch undo/redo. | |
A DesignCommand for setting text values on target design objects with undo support.
Definition at line 21 of file TextCommands.h.
|
inline |
Constructs a SetTextValue command with the given text value.
| [in] | value | The text value to set on target objects. |
Definition at line 28 of file TextCommands.h.
References m_value.
|
inlineoverridevirtual |
Adds a target object UUID to this command's target list.
| [in] | target_id | The UUID of the design object to target. |
Reimplemented from DesignCommand.
Definition at line 94 of file TextCommands.h.
References targets.
|
inlineoverridevirtual |
Executes this command against the given DesignObjectLookup.
On first execution, stores old text values for undo and sets the new text. On undo, restores the previously stored text values.
| [in] | lookup | The design object registry to modify. |
Reimplemented from DesignCommand.
Definition at line 40 of file TextCommands.h.
References DesignCommand::is_undo, DesignObject::isValid(), DesignObjectLookup::lockPtr(), m_previous_values, m_value, DesignObjectLookup::modelOrLayer(), and targets.
|
inlineoverridevirtual |
Returns the icon identifier for this command.
Implements DesignCommand.
Definition at line 75 of file TextCommands.h.
|
inlineoverridevirtual |
Returns the translated display name for this command.
Implements DesignCommand.
Definition at line 84 of file TextCommands.h.