NDEVR
API Documentation

A DesignCommand for setting text values on target design objects with undo support. More...

Inheritance diagram for SetTextValue:
[legend]
Collaboration diagram for SetTextValue:
[legend]

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< UUIDtargets
 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< TranslatedStringm_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.

Detailed Description

A DesignCommand for setting text values on target design objects with undo support.


Definition at line 21 of file TextCommands.h.

Constructor & Destructor Documentation

◆ SetTextValue()

SetTextValue::SetTextValue ( const StringView & value)
inline

Constructs a SetTextValue command with the given text value.

Parameters
[in]valueThe text value to set on target objects.

Definition at line 28 of file TextCommands.h.

References m_value.

Member Function Documentation

◆ addTarget()

virtual bool SetTextValue::addTarget ( UUID target_id)
inlineoverridevirtual

Adds a target object UUID to this command's target list.

Parameters
[in]target_idThe UUID of the design object to target.
Returns
True, indicating the target was successfully added.

Reimplemented from DesignCommand.

Definition at line 94 of file TextCommands.h.

References targets.

◆ execute()

virtual void SetTextValue::execute ( DesignObjectLookup * lookup)
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.

Parameters
[in]lookupThe 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.

◆ icon()

StringView SetTextValue::icon ( ) const
inlineoverridevirtual

Returns the icon identifier for this command.

Returns
A StringView containing the icon name "label".

Implements DesignCommand.

Definition at line 75 of file TextCommands.h.

◆ name()

TranslatedString SetTextValue::name ( ) const
inlineoverridevirtual

Returns the translated display name for this command.

Returns
The translated string "Set Text".

Implements DesignCommand.

Definition at line 84 of file TextCommands.h.


The documentation for this class was generated from the following file: