Timeline.h header
#include <ew/core/timeline/Timeline.h>
Namespace ew::core::timeline
Timeline class
class ew::core::timeline::Timeline
A named timeline track: a chronology onto which timeline events are placed (e.g. the main "Story" timeline, a single character's life, or one plot thread). A project may hold many, shown as parallel tracks; each is a first-class content object so it can be linked and embedded like anything else. Events reference their timeline by id.
Members
ew::core::timeline::Timeline::Timeline(ew::core::foundation::ContentId id, QString title)
Creates a timeline with identity id and title, with no description.
const QString & ew::core::timeline::Timeline::title() const
The timeline's title (its track label).
void ew::core::timeline::Timeline::setTitle(QString title)
Sets the timeline's title (its track label).
const QString & ew::core::timeline::Timeline::description() const
A free-form description of what the timeline tracks. Empty by default.
void ew::core::timeline::Timeline::setDescription(QString description)
Sets the free-form description of what the timeline tracks.
int ew::core::timeline::Timeline::sortIndex() const
The timeline's position among the project's timelines (lower comes first); it orders the parallel tracks in the timeline view.
void ew::core::timeline::Timeline::setSortIndex(int sortIndex)
Sets the timeline's position among the project's timelines (lower comes first).
Functions
std::vector< ew::core::foundation::ContentId > ew::core::timeline::orderedTimelineIds(const ew::core::project::Project &project)
The ids of orderedTimelines, in the same order – for callers that only need identity.
std::vector< const Timeline * > ew::core::timeline::orderedTimelines(const ew::core::project::Project &project)
The project's timelines in the ONE order the product shows them: by Timeline::sortIndex (what ew::core::timeline::MoveTimelineCommand writes), then by title, then by id.
One function because there were three, and they disagreed. The Timeline dock sorted by sort index then a byte-order title compare; the Manage Timelines dialog sorted by a locale-aware title compare then id, ignoring the sort index entirely; the MCP listing tools had their own copy again. They agreed only because nothing could set a sort index, so every timeline sat at 0 and all three degenerated to "by title" – and even then the dialog and the dock disagreed about accented titles, since one compare is locale-aware and the other is not. Giving the dialog reorder buttons would have made a list that moved things in an order the dock did not draw.
The title compare is locale-aware because this is an order a reader sees, and the id is the final tiebreak so two timelines sharing a title still have a stable, repeatable position.
A free function beside the type it orders rather than a unit of its own, per CODING_STANDARDS 2.2: the primary type here is Timeline and this is a helper about Timelines. (The analogue for documents, ew::core::document::orderedChildDocumentIds, has a file of its own because the manuscript TREE is a concept in its own right; an ordering is not.)