SetTimelineEventCommand.h header

#include <ew/core/SetTimelineEventCommand.h>

Namespace ew::core

SetTimelineEventCommand class

class ew::core::SetTimelineEventCommand

Command that replaces all of a timeline event's editable fields with a new set. Undo restores the previous fields and redo re-applies the new ones.

Members

ew::core::timeline::SetTimelineEventCommand::SetTimelineEventCommand(TimelineEvent &event, TimelineEventFields fields)

Creates a command that sets event's fields to fields when applied.

Warning: fields REPLACES every editable field, so anything left at its default is erased. A caller changing one thing must start from fieldsOf and override only what it means to change – never from a default-constructed struct. Building one field-by-field is how an event silently lost data twice: once when EntityMerge's hand-built aggregate fell behind the struct (CL 3377), and once when four desktop handlers each copied fifteen of sixteen fields and dropped constraints (audit A-020).

ew::core::timeline::SetTimelineEventCommand::~SetTimelineEventCommand() override

Defaulted.

void ew::core::timeline::SetTimelineEventCommand::apply() override

Records the event's current fields and applies the new ones.

void ew::core::timeline::SetTimelineEventCommand::undo() override

Restores the previous fields.

QString ew::core::timeline::SetTimelineEventCommand::description() const override

Returns a short description for the undo/redo UI.

TimelineEventFields struct

struct ew::core::TimelineEventFields

The editable fields of a timeline event, gathered so an edit can be applied as one atomic, undoable change.

Members

ew::core::foundation::ContentId ew::core::timeline::TimelineEventFields::timelineId

The timeline the event belongs to.

QString ew::core::timeline::TimelineEventFields::title

The event title.

qint64 ew::core::timeline::TimelineEventFields::startMinute = 0

The start instant (minutes since the story epoch).

qint64 ew::core::timeline::TimelineEventFields::durationMinutes = 0

The duration in minutes.

int ew::core::timeline::TimelineEventFields::ordinal = 0

The sequence position for ordinal mode (TL-09).

TimelineDateQualifier ew::core::timeline::TimelineEventFields::dateQualifier =

How certain the event's date is (TL-10).

std::vector<ew::core::foundation::ContentId> ew::core::timeline::TimelineEventFields::participantIds

The participant entities.

std::vector<TimelineConstraint> ew::core::timeline::TimelineEventFields::constraints

The relative constraints this event holds on other events (TL-12).

ew::core::foundation::ContentId ew::core::timeline::TimelineEventFields::locationId

The location entity (null for none).

ew::core::foundation::ContentId ew::core::timeline::TimelineEventFields::parentId

The parent event this nests inside (TL-11); null for a top-level event.

bool ew::core::timeline::TimelineEventFields::collapsed = false

Whether the event is collapsed to a summary bar (TL-11); false (expanded) by default.

std::vector<ew::core::foundation::ContentId> ew::core::timeline::TimelineEventFields::sceneIds

The scene document(s) that depict this event (TL-61); empty for a planned-only event.

QString ew::core::timeline::TimelineEventFields::description

The description.

QString ew::core::timeline::TimelineEventFields::styleColor

The manual colour override ("#RRGGBB"), or empty for the automatic encoding colour (TL-76).

QString ew::core::timeline::TimelineEventFields::styleLabel

What the override colour means, for the legend; empty falls back to the colour.

QString ew::core::timeline::TimelineEventFields::layer

The named layer this event belongs to (TL-88); empty for the default layer.

bool operator==(const TimelineEventFields &, const TimelineEventFields &)=default

Value equality over all fields, so a no-op edit (dialog OK'd with no change) can be detected.

Functions

TimelineEventFields ew::core::timeline::fieldsOf(const TimelineEvent &event)

Every editable field of event, gathered into the struct SetTimelineEventCommand takes.

This is the safe starting point for any edit: take the event's current fields, override the few that change, and pass the result. Because it is the single place that enumerates all of them, a field added to TimelineEventFields is carried by every caller automatically – which hand-building the struct is not. Nothing in the toolchain catches a hand-built aggregate that has fallen behind (see the corrected note in CLAUDE.md), so this exists to make that class unreachable rather than merely discouraged.