Project.h header
#include <ew/core/Project.h>
Namespace ew::core
Project class
class ew::core::Project
The in-memory content graph: owns every content object in an open project and resolves them by id. Serialization to the folder-of-text store and the command stack operate on this model. Objects are kept in ascending id order so any serialized output is deterministic and diff-stable.
Members
ew::core::Project::Project()
Constructs an empty project.
ew::core::Project::~Project()
Destroys the project and every object it owns.
ew::core::Project::Project(const Project &)=delete
Not copyable.
ew::core::Project::Project(Project &&)=delete
Not movable.
Project & ew::core::Project::operator=(const Project &)=delete
Not copyable.
Project & ew::core::Project::operator=(Project &&)=delete
Not movable.
ContentObject * ew::core::Project::add(std::unique_ptr< ContentObject > object)
Adds object, taking ownership. Returns a non-owning pointer to it, or null if object is null or an object with the same id is already present.
ContentObject * ew::core::Project::find(ContentId id) const
Returns the object with id, or null if none is present.
bool ew::core::Project::contains(ContentId id) const
Returns true if an object with id is present.
bool ew::core::Project::remove(ContentId id)
Removes the object with id; returns true if one was removed.
std::unique_ptr< ContentObject > ew::core::Project::take(ContentId id)
Removes the object with id and returns ownership of it, or null if none is present. Unlike remove(), the caller keeps the object (used to implement undo).
int ew::core::Project::objectCount() const
Returns the number of objects in the project.
std::vector< ContentId > ew::core::Project::ids() const
Returns the ids of all objects, in ascending (deterministic) order.
void ew::core::Project::setPinned(ContentId id, bool pinned)
Marks id pinned (a favorite) or unpinned.
bool ew::core::Project::isPinned(ContentId id) const
Returns true if id is currently pinned.
std::vector< ContentId > ew::core::Project::pinnedIds() const
Returns the ids of pinned objects that still exist, in ascending order.
void ew::core::Project::setSavedSearches(std::vector< SavedSearch > searches)
Replaces the project's saved searches.
const std::vector< SavedSearch > & ew::core::Project::savedSearches() const
Returns the project's saved searches, in order.
void ew::core::Project::setEntityTemplates(std::vector< EntityTemplate > templates)
Replaces the project's entity-template registry – the reusable presets (category + pre-filled field values) a new codex entity can be created from.
const std::vector< EntityTemplate > & ew::core::Project::entityTemplates() const
Returns the project's entity templates, in order.
void ew::core::Project::setAudiences(std::vector< QString > audiences)
Replaces the project's audience registry – the named readerships (e.g. "Players", "GM") that per-object visibility (ContentObject::visibleAudiences) can be scoped to.
const std::vector< QString > & ew::core::Project::audiences() const
Returns the project's audience registry, in order.
void ew::core::Project::setPlotThreads(std::vector< PlotThread > plotThreads)
Replaces the project's plot-thread registry – the narrative through-lines (plot lines and character arcs) that scenes are tagged with (Document::plotThreadIds).
const std::vector< PlotThread > & ew::core::Project::plotThreads() const
Returns the project's plot-thread registry, in order.
void ew::core::Project::setContinuityRules(std::vector< ContinuityRule > continuityRules)
Replaces the project's continuity-rule registry – the user-authored assertions (ContinuityRule) the timeline validator checks alongside its built-in rules.
const std::vector< ContinuityRule > & ew::core::Project::continuityRules() const
Returns the project's continuity-rule registry, in order.
void ew::core::Project::setTimelineEras(std::vector< TimelineEra > timelineEras)
Replaces the project's timeline-era registry (TL-18): the named background bands – the Third Age, the Occupation – drawn across the shared time axis. Replaced as a whole by one undoable command.
const std::vector< TimelineEra > & ew::core::Project::timelineEras() const
Returns the project's timeline-era registry, in order.
void ew::core::Project::setTimelineMarkers(std::vector< TimelineMarker > timelineMarkers)
Replaces the project's timeline-marker registry (TL-19): the "now" marker and other pinned instants drawn as labelled vertical lines across the shared time axis. Replaced as a whole by one undoable command.
const std::vector< TimelineMarker > & ew::core::Project::timelineMarkers() const
Returns the project's timeline-marker registry, in order.
void ew::core::Project::setTimelineBookmarks(std::vector< TimelineBookmark > timelineBookmarks)
Replaces the project's timeline-bookmark registry (TL-41): the named saved spans a writer returns to ("Act Two", "the war"). Replaced as a whole by one undoable command.
const std::vector< TimelineBookmark > & ew::core::Project::timelineBookmarks() const
Returns the project's timeline-bookmark registry, in order.
void ew::core::Project::setBeatSheet(BeatSheet beatSheet)
Replaces the project's applied beat sheet – the chosen structure template and the scene mapped to each of its beats (an empty templateId means none applied).
const BeatSheet & ew::core::Project::beatSheet() const
Returns the project's applied beat sheet.
void ew::core::Project::setMounts(std::vector< LibraryMount > mounts)
Replaces the project's mounted libraries (shared universes / reference repos).
const std::vector< LibraryMount > & ew::core::Project::mounts() const
Returns the project's mounted libraries, in order.
Taxonomy & ew::core::Project::taxonomy()
The project's codex taxonomy: user-defined categories and their field schemas.
const Taxonomy & ew::core::Project::taxonomy() const
Const overload.
WritingLog & ew::core::Project::writingLog()
The project's writing-activity log (words written per day), for productivity analytics.
const WritingLog & ew::core::Project::writingLog() const
Const overload.
WritingGoal & ew::core::Project::writingGoal()
The project's writing goals (daily habit target, manuscript target, deadline).
const WritingGoal & ew::core::Project::writingGoal() const
Const overload.
Calendar & ew::core::Project::calendar()
The project's calendar (custom months, weekdays, era), used to interpret and format timeline instants.
const Calendar & ew::core::Project::calendar() const
Const overload.
void ew::core::Project::setCalendar(Calendar calendar)
Replaces the project's calendar.
const std::vector< Reckoning > & ew::core::Project::reckonings() const
The project's additional reckonings (TL-13): named regional datings of the same timeline (each a calendar + an epoch offset), which a reader may switch the display into. The primary calendar is the implicit zero-offset reckoning and is NOT in this list.
void ew::core::Project::setReckonings(std::vector< Reckoning > reckonings)
Replaces the project's reckoning registry, as a whole, by one undoable command.
const TimelineViewSettings & ew::core::Project::timelineViewSettings() const
The timeline view settings (how the timeline panel colours, groups, sizes, and labels events). One per-project configuration shared across all timelines.
void ew::core::Project::setTimelineViewSettings(TimelineViewSettings settings)
Replaces the project's timeline view settings.
void ew::core::Project::setTimelineViewPresets(std::vector< TimelineViewPreset > presets)
Replaces the project's user-saved timeline view presets – named bundles of the whole timeline view settings (TL-83) the reader can switch between in one gesture. Built-in presets are provided separately (ew::app::builtInTimelineViewPresets); this list is only the user's own.
const std::vector< TimelineViewPreset > & ew::core::Project::timelineViewPresets() const
Returns the project's user-saved timeline view presets, in order.