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::SetTimelineEventCommand::SetTimelineEventCommand(TimelineEvent &event, TimelineEventFields fields)

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

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

Defaulted.

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

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

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

Restores the previous fields.

QString ew::core::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

ContentId ew::core::TimelineEventFields::timelineId

The timeline the event belongs to.

QString ew::core::TimelineEventFields::title

The event title.

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

The start instant (minutes since the story epoch).

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

The duration in minutes.

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

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

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

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

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

The participant entities.

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

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

ContentId ew::core::TimelineEventFields::locationId

The location entity (null for none).

ContentId ew::core::TimelineEventFields::parentId

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

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

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

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

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

QString ew::core::TimelineEventFields::description

The description.

QString ew::core::TimelineEventFields::styleColor

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

QString ew::core::TimelineEventFields::styleLabel

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

QString ew::core::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.