TimelineEvent.h header

#include <ew/core/TimelineEvent.h>

Namespace ew::core

TimelineEvent class

class ew::core::TimelineEvent

An event on a timeline: something that happens at a point in story time, for a duration, involving participants at a location. Time is stored as an absolute instant – minutes since the project's story epoch – so events order and validate independently of any calendar (a Calendar formats the instant for display). A first-class content object placed on a Timeline (referenced by id); participants and location link to entities.

Members

ew::core::TimelineEvent::TimelineEvent(ContentId id, ContentId timelineId, QString title)

Creates an event with identity id and title on timeline timelineId, at instant zero with no duration, participants, location, or description.

ContentId ew::core::TimelineEvent::timelineId() const

The timeline this event belongs to.

void ew::core::TimelineEvent::setTimelineId(ContentId timelineId)

Sets the timeline this event belongs to.

const QString & ew::core::TimelineEvent::title() const

The event's title (what happens).

void ew::core::TimelineEvent::setTitle(QString title)

Sets the event's title.

qint64 ew::core::TimelineEvent::startMinute() const

When the event starts, in minutes since the project's story epoch (may be negative for events before the epoch).

void ew::core::TimelineEvent::setStartMinute(qint64 startMinute)

Sets the event's start instant, in minutes since the story epoch.

qint64 ew::core::TimelineEvent::durationMinutes() const

How long the event lasts, in minutes (0 means instantaneous). Negative values are clamped to 0.

void ew::core::TimelineEvent::setDurationMinutes(qint64 durationMinutes)

Sets the event's duration in minutes (negative values are clamped to 0).

qint64 ew::core::TimelineEvent::endMinute() const

The instant the event ends (startMinute + durationMinutes).

int ew::core::TimelineEvent::ordinal() const

The event's sequence position for ordinal / sequence mode (TL-09): a writer who knows the ORDER of events before their dates lays them out by this, evenly spaced, with zero dates entered. Independent of startMinute – adding dates later refines the same events in place rather than replacing this. New events append at the end of the sequence.

void ew::core::TimelineEvent::setOrdinal(int ordinal)

Sets the event's ordinal sequence position.

TimelineDateQualifier ew::core::TimelineEvent::dateQualifier() const

How certain the event's date is (TL-10): Exact (the default crisp instant), or Circa / Before / After / During, which change only how startMinute is drawn and labelled – as a soft band or bracket with a "c."/"before"/"after"/"during" prefix – never the stored instant. This lets a writer say "circa 1200" without entering a lie.

void ew::core::TimelineEvent::setDateQualifier(TimelineDateQualifier qualifier)

Sets how certain the event's date is.

ContentId ew::core::TimelineEvent::parentId() const

The parent event this event nests inside (TL-11), or a null id for a top-level event. History is thought about hierarchically – Age ⊃ War ⊃ Battle ⊃ the moment the gate fell – so an event can own children. A parent whose collapsed is set draws as a single summary bar spanning its descendants; expanded, it reveals them. The picker refuses to make an event its own ancestor, and the layout is cycle-safe regardless, so the nesting can never loop.

void ew::core::TimelineEvent::setParentId(ContentId parentId)

Sets the parent event this one nests inside.

bool ew::core::TimelineEvent::collapsed() const

Whether this event is collapsed (TL-11): a parent folded to one summary bar with its children hidden – the single most effective density control there is. False by default (expanded); has no visible effect on an event with no children.

void ew::core::TimelineEvent::setCollapsed(bool collapsed)

Sets whether the event is collapsed to a summary bar.

const std::vector< ContentId > & ew::core::TimelineEvent::participantIds() const

The entities taking part in the event (characters, factions, items), in order.

void ew::core::TimelineEvent::setParticipantIds(std::vector< ContentId > participantIds)

Sets the entities taking part in the event.

const std::vector< TimelineConstraint > & ew::core::TimelineEvent::constraints() const

The relative constraints this event holds on other events (TL-12): "this event is After / Before / During <other>". Each is validated (a broken one is flagged in the Conflicts dock) and honoured on a move (the dependent follows). Empty for an unconstrained event.

void ew::core::TimelineEvent::setConstraints(std::vector< TimelineConstraint > constraints)

Sets the relative constraints this event holds on other events.

ContentId ew::core::TimelineEvent::locationId() const

The entity where the event takes place; a null id means no location is set.

void ew::core::TimelineEvent::setLocationId(ContentId locationId)

Sets the entity where the event takes place.

const std::vector< ContentId > & ew::core::TimelineEvent::sceneIds() const

The scene document(s) that depict this event (TL-61) – the bridge between "what happened" (the event) and "what I wrote" (the prose). Empty means the event is only planned, not yet written; a linked scene can be opened straight from the timeline, and whether a scene has prose behind it drives the written-vs-planned read (TL-62). Document ids, in the order the writer added them.

void ew::core::TimelineEvent::setSceneIds(std::vector< ContentId > sceneIds)

Sets the scene document(s) that depict this event.

const QString & ew::core::TimelineEvent::description() const

A free-form description of the event. Empty by default.

void ew::core::TimelineEvent::setDescription(QString description)

Sets the event's description.

const QString & ew::core::TimelineEvent::styleColor() const

A manual colour override for this one event (TL-76): an explicit "#RRGGBB" hex token that beats the timeline's automatic colour encoding, or empty for none (the event then takes the automatic colour). Stored as a string, not a colour, so the model stays free of any UI type. The user sets this to call out one event – "this one is red because it is a catastrophe".

void ew::core::TimelineEvent::setStyleColor(QString styleColor)

Sets the manual colour override for this event.

const QString & ew::core::TimelineEvent::styleLabel() const

What the styleColor override means, shown in the legend beside its swatch (TL-76) so an override is explained rather than mysterious; empty falls back to the colour itself. Events sharing a colour+label read as one legend entry (e.g. every "Catastrophe" event).

void ew::core::TimelineEvent::setStyleLabel(QString styleLabel)

Sets the label explaining the colour override.

const QString & ew::core::TimelineEvent::layer() const

The named layer this event belongs to (TL-88), e.g. "Secrets"; empty for the default layer. Layers can be toggled visible or hidden together, consistent with the Maps dock's layers, so a related set of events shows and hides as a unit – and so a timeline can have its own "Secrets" that only chosen readers see. A grouping/colour dimension is a view of an existing property; the layer is an authored membership the writer assigns.

void ew::core::TimelineEvent::setLayer(QString layer)

Sets the named layer this event belongs to.