SetObjectLockCommand.h header
#include <ew/core/SetObjectLockCommand.h>
Namespace ew::core
SetObjectLockCommand class
class ew::core::SetObjectLockCommand
Command that locks or unlocks a content object – what the writer means by "this one is finished, keep it safe".
A locked object is read-only everywhere that would change it: the editor shows it but will not take an edit, no MCP tool and no in-app AI request may modify or delete it, and nothing may remove it. It can still be MOVED, because reordering the manuscript is arranging the book rather than changing the work.
There is deliberately no MCP tool and no AI path that constructs this command, in either direction. A lock an assistant could lift is not a lock; the point of the flag is that only a person can decide the work is open again.
Members
ew::core::content::SetObjectLockCommand::SetObjectLockCommand(ContentObject &object, bool locked)
Creates a command that sets object's locked flag to locked when applied.
ew::core::content::SetObjectLockCommand::~SetObjectLockCommand() override
Destroys the command.
void ew::core::content::SetObjectLockCommand::apply() override
Records the object's current locked flag and applies the new one.
void ew::core::content::SetObjectLockCommand::undo() override
Restores the previous locked flag.
QString ew::core::content::SetObjectLockCommand::description() const override
Returns a short description for the undo/redo UI.