SetLanguageCommand.h header

#include <ew/core/SetLanguageCommand.h>

Namespace ew::core

SetLanguageCommand class

class ew::core::SetLanguageCommand

Command that replaces a language's entire editable payload – its name, phonology (consonants, vowels, syllable patterns, and syllable-count bounds), grammar notes, and lexicon – in one step, as produced by editing the language in the conlang UI (coining or generating words, glossing entries, refining the sound system, or writing grammar notes). Capturing the whole payload keeps undo/redo simple and correct regardless of how much the edit touched: undo restores the previous payload and redo re-applies the new one.

Members

ew::core::SetLanguageCommand::SetLanguageCommand(Language &language, LanguageFields fields)

Creates a command that, when applied, replaces language's editable payload with fields.

ew::core::SetLanguageCommand::~SetLanguageCommand() override

Destroys the command.

void ew::core::SetLanguageCommand::apply() override

Records the language's current payload and applies the new one.

void ew::core::SetLanguageCommand::undo() override

Restores the previous payload.

QString ew::core::SetLanguageCommand::description() const override

Returns a short description for the undo/redo UI.