ContentObject.h header

#include <ew/core/ContentObject.h>

Namespace ew::core

ContentObject class

class ew::core::ContentObject

Common base for every object in the content graph. Carries the stable identity and structural kind shared by all content; concrete subtypes (documents, entities, sheets, maps, timelines, ...) add their own data. Held via pointer as the base of a polymorphic hierarchy.

Members

ew::core::content::ContentObject::ContentObject(ew::core::foundation::ContentId id, ContentType type)

Constructs a content object with the given identity and structural kind.

virtual ew::core::content::ContentObject::~ContentObject()=default

Defaulted.

ew::core::content::ContentObject::ContentObject(const ContentObject &)=delete

Polymorphic base: non-copyable and non-movable (referenced, never sliced).

ew::core::content::ContentObject::ContentObject(ContentObject &&)=delete

Not movable.

ContentObject & ew::core::content::ContentObject::operator=(const ContentObject &)=delete

Not copyable.

ContentObject & ew::core::content::ContentObject::operator=(ContentObject &&)=delete

Not movable.

ew::core::foundation::ContentId ew::core::content::ContentObject::id() const

Returns this object's stable identity.

ContentType ew::core::content::ContentObject::type() const

Returns this object's structural kind.

const std::set< QString > & ew::core::content::ContentObject::visibleAudiences() const

The audiences this object is visible to (by name; see Project::audiences()). An empty set – the default – means it is visible to everyone; otherwise it is restricted to the named audiences, and a reader viewing as an audience outside the set does not see it. Lets one project serve different readerships (e.g. a GM's secrets hidden from players) without keeping separate copies. Ordered for deterministic serialization.

void ew::core::content::ContentObject::setVisibleAudiences(std::set< QString > audiences)

Sets the audiences this object is visible to (empty means visible to everyone).

bool ew::core::content::ContentObject::isVisibleTo(const QString &audience) const

Returns true if this object is visible to audience: either it is unrestricted (its audience set is empty) or the set contains audience.

Note: An EMPTY audience is not treated as "no filter" – a restricted object reports false for it, because "" is matched against the set like any other name. Callers that use an empty string to mean "no reader lens is active" must therefore short-circuit before asking (!audience.isEmpty() && !object->isVisibleTo(audience)), as every current caller does – five at the call site and stripHiddenEmbeds at its function entry. Getting this wrong fails safe (restricted content would be hidden when it should show, never leaked to a reader who may not see it), but it would still make content vanish from the unfiltered view, so the guard is the caller's responsibility and is documented here rather than left to be rediscovered.

const std::set< QString > & ew::core::content::ContentObject::tags() const

The free-form labels the writer has attached to this object (e.g. "draft", "needs-research", "act-1"). Tags are a cross-cutting organization axis independent of the codex category tree: any object of any kind can carry any tags, and the writer can filter or group by them. Kept as a set (deduplicated, ordered for deterministic serialization).

void ew::core::content::ContentObject::setTags(std::set< QString > tags)

Sets this object's free-form organization tags.

bool ew::core::content::ContentObject::hasTag(const QString &tag) const

Returns true if this object carries tag.

bool ew::core::content::ContentObject::aiExcluded() const

Whether this object is excluded from AI features. When true, the object's content is withheld from every AI feature – the agent's world snapshot, the semantic (RAG) index, and canon-consistency checks – giving the writer per-object privacy control. Defaults to false (included). Independent of visibleAudiences (which hides content from readers) and of redaction (which masks entity names in a request).

void ew::core::content::ContentObject::setAiExcluded(bool excluded)

Sets whether this object is excluded from AI features.

bool ew::core::content::ContentObject::locked() const

Whether this object is locked – the writer's way of saying "this one is finished, keep it safe". A locked object is shown but not editable, cannot be deleted, and no MCP tool or in-app AI request may modify it. It CAN still be moved, because reordering the manuscript is arranging the book rather than changing the work. Defaults to false.

Deliberately unreachable from every AI path: nothing an assistant can call sets or clears it, in either direction, because a lock an assistant could lift is not a lock. Independent of aiExcluded (which withholds content from AI entirely) and of visibleAudiences (which hides content from readers).

void ew::core::content::ContentObject::setLocked(bool locked)

Sets whether this object is locked against editing and deletion.

const std::vector< QString > & ew::core::content::ContentObject::plotThreadIds() const

The plot threads (by stable thread id) this object advances or belongs to – a cross-cutting membership axis independent of the category tree, available on ANY object: a scene document, a timeline event, or an entity (a character's arc). Kept in the order the writer added them.

void ew::core::content::ContentObject::setPlotThreadIds(std::vector< QString > plotThreadIds)

Sets the plot threads (by thread id) this object advances or belongs to.