ginga 1.0
The Ginga iTV middleware
Loading...
Searching...
No Matches
Document.h
1/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia
2
3This file is part of Ginga (Ginga-NCL).
4
5Ginga is free software: you can redistribute it and/or modify it
6under the terms of the GNU General Public License as published by
7the Free Software Foundation, either version 2 of the License, or
8(at your option) any later version.
9
10Ginga is distributed in the hope that it will be useful, but WITHOUT
11ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
13License for more details.
14
15You should have received a copy of the GNU General Public License
16along with Ginga. If not, see <https://www.gnu.org/licenses/>. */
17
18#ifndef DOCUMENT_H
19#define DOCUMENT_H
20
21#include "Object.h"
22
23namespace ginga {
24
25class Context;
26class Media;
27class Switch;
28
35{
36public:
37 Document ();
38 Document (const string&);
39 virtual ~Document ();
40
41 const set<Object *> *getObjects ();
42 Object *getObjectById (const string &);
43 Object *getObjectByIdOrAlias (const string &);
44 bool addObject (Object *);
45
46 const string getId ();
47 Context *getRoot ();
49 const set<Media *> *getMedias ();
50 const set<Media *> *getMediasRemote ();
51 const set<Context *> *getContexts ();
52 const set<Switch *> *getSwitches ();
53
54 int evalAction (Event *, Event::Transition, const string &value = "");
55 int evalAction (Action);
56 bool evalPredicate (Predicate *);
57 bool evalPropertyRef (const string &, string *);
58
59 bool getData (const string &, void **);
60 bool setData (const string &, void *, UserDataCleanFunc fn = nullptr);
61
62private:
63 string _id;
64 list<Action> evalActionInContext (Action, Context *);
65 set<Object *> _objects;
66 map<string, Object *> _objectsById;
69 set<Media *> _medias;
70 set<Media *> _mediasRemote;
71 set<Context *> _contexts;
72 set<Switch *> _switches;
74};
75
76}
77
78#endif // DOCUMENT_H
Definition Context.h:27
NCL document.
Definition Document.h:35
Context * getRoot()
Gets document's root object.
Definition Document.cpp:185
int evalAction(Event *, Event::Transition, const string &value="")
Evaluates action over document.
Definition Document.cpp:230
set< Switch * > _switches
Switch objects.
Definition Document.h:72
set< Context * > _contexts
Context objects.
Definition Document.h:71
Context * _root
Root context (body).
Definition Document.h:67
virtual ~Document()
Destroys document.
Definition Document.cpp:67
MediaSettings * getSettings()
Gets document's settings object.
Definition Document.cpp:196
set< Object * > _objects
Objects.
Definition Document.h:65
list< Action > evalActionInContext(Action, Context *)
Evaluates action over Context.
Definition Document.cpp:246
Document()
Creates a new document.
Definition Document.cpp:39
bool addObject(Object *)
Adds object to document.
Definition Document.cpp:133
set< Media * > _mediasRemote
Media objects.
Definition Document.h:70
map< string, Object * > _objectsById
Objects indexed by id.
Definition Document.h:66
Object * getObjectById(const string &)
Gets document object by id.
Definition Document.cpp:98
const string getId()
Gets document id.
Definition Document.cpp:77
UserData _udata
Attached user data.
Definition Document.h:73
const set< Object * > * getObjects()
Gets document objects.
Definition Document.cpp:87
Object * getObjectByIdOrAlias(const string &)
Gets document object by id or alias.
Definition Document.cpp:112
MediaSettings * _settings
Settings object.
Definition Document.h:68
set< Media * > _medias
Media objects.
Definition Document.h:69
Event state machine.
Definition Event.h:32
Transition
Event state transitions.
Definition Event.h:79
Definition MediaSettings.h:26
Definition Media.h:27
Definition Object.h:30
Definition Predicate.h:26
Definition Switch.h:27
Definition aux-ginga.h:204
Action.
Definition Event.h:132