SetSourceCommand.h header

#include <ew/core/SetSourceCommand.h>

Namespace ew::core

SetSourceCommand class

class ew::core::SetSourceCommand

Command that replaces a source's whole bibliographic state – its kind, title, citation key, and citation fields – in one edit, as produced by the source editor dialog. Undo restores the previous state and redo re-applies the new one.

Members

ew::core::SetSourceCommand::SetSourceCommand(Source &source, SourceType type, QString title, QString citationKey, std::map< QString, QString > fields)

Creates a command that sets source's kind to type, title to title, citation key to citationKey, and citation fields to fields when applied.

ew::core::SetSourceCommand::~SetSourceCommand() override

Destroys the command.

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

Records the source's current state and applies the new one.

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

Restores the previous state.

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

Returns a short description for the undo/redo UI.