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.

Note: This is the stored data, not the answer to "may this reader see it". That question belongs to the policy gate – ask ew::app::policy::isVisibleToReader, which puts it to ew::core::policy::authorize() together with who is asking. This class deliberately offers no isVisibleTo of its own: a second place that decides is how two answers drift apart, and the one it used to have made every caller remember the same empty-audience guard.

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

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

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.