Ginga
0.13.6.2086-83aa
The iTV middleware.
|
NCL document. More...
#include <Document.h>
Public Member Functions | |
Document () | |
Creates a new document. More... | |
virtual | ~Document () |
Destroys document. More... | |
const set< Object * > * | getObjects () |
Gets document objects. More... | |
Object * | getObjectById (const string &) |
Gets document object by id. More... | |
Object * | getObjectByIdOrAlias (const string &) |
Gets document object by id or alias. More... | |
bool | addObject (Object *) |
Adds object to document. More... | |
Context * | getRoot () |
Gets document's root object. More... | |
MediaSettings * | getSettings () |
Gets document's settings object. More... | |
const set< Media * > * | getMedias () |
const set< Context * > * | getContexts () |
const set< Switch * > * | getSwitches () |
int | evalAction (Event *, Event::Transition, const string &value="") |
Evaluates action over document. | |
int | evalAction (Action) |
Evaluates action over document. | |
bool | evalPredicate (Predicate *) |
bool | evalPropertyRef (const string &, string *) |
bool | getData (const string &, void **) |
bool | setData (const string &, void *, UserDataCleanFunc fn=nullptr) |
Private Attributes | |
set< Object * > | _objects |
Objects. | |
map< string, Object * > | _objectsById |
Objects indexed by id. | |
Context * | _root |
Root context (body). | |
MediaSettings * | _settings |
Settings object. | |
set< Media * > | _medias |
Media objects. | |
set< Context * > | _contexts |
Context objects. | |
set< Switch * > | _switches |
Switch objects. | |
UserData | _udata |
Attached user data. | |
NCL document.
Maintains all objects in document.
GINGA_NAMESPACE_BEGIN Document::Document | ( | ) |
Creates a new document.
This function creates a new NCL document containing a root context (the document body) with id "__root__" and a child settings media object with id "__settings__".
|
virtual |
Destroys document.
This function destroys the document and all its child objects.
bool Document::addObject | ( | Object * | obj | ) |
Adds object to document.
This function assumes that obj
is not in another document.
obj | The object to add. |
true
if successful, or false
otherwise (object already in document). Object * Document::getObjectById | ( | const string & | id | ) |
Gets document object by id.
id | Object id. |
Object * Document::getObjectByIdOrAlias | ( | const string & | id | ) |
Gets document object by id or alias.
id | Object id or alias. |
const set< Object * > * Document::getObjects | ( | ) |
Gets document objects.
Context * Document::getRoot | ( | ) |
Gets document's root object.
MediaSettings * Document::getSettings | ( | ) |
Gets document's settings object.