SetEntityCategoriesCommand.h header

#include <ew/core/SetEntityCategoriesCommand.h>

Namespace ew::core

SetEntityCategoriesCommand class

class ew::core::SetEntityCategoriesCommand

Command that replaces an entity's ADDITIONAL category memberships, leaving its primary alone.

One command for the whole list rather than one per membership, because the ORDER is part of the value: it decides which category's declaration of a shared key the entity shows, so adding one and reordering the rest is a single decision the writer made and a single step they should be able to undo.

Members

ew::core::entity::SetEntityCategoriesCommand::SetEntityCategoriesCommand(Entity &entity, std::vector< ew::core::foundation::CategoryId > categoryIds)

Creates a command that will give entity the memberships categoryIds when applied.

ew::core::entity::SetEntityCategoriesCommand::~SetEntityCategoriesCommand() override

Destroys the command.

void ew::core::entity::SetEntityCategoriesCommand::apply() override

Stores the new memberships, remembering the previous ones.

void ew::core::entity::SetEntityCategoriesCommand::undo() override

Restores the previous memberships.

QString ew::core::entity::SetEntityCategoriesCommand::description() const override

Returns a short description for the undo/redo UI.

ew::core::foundation::OperationSubject ew::core::entity::SetEntityCategoriesCommand::subject() const override

Returns the subject this command changes. See Command::subject().