Ginga  0.13.6.1771-df200
The iTV middleware.
Document.h
Go to the documentation of this file.
1 /* Copyright (C) 2006-2017 PUC-Rio/Laboratorio TeleMidia
2 
3 This file is part of Ginga (Ginga-NCL).
4 
5 Ginga is free software: you can redistribute it and/or modify it
6 under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9 
10 Ginga is distributed in the hope that it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
13 License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with Ginga. If not, see <http://www.gnu.org/licenses/>. */
17 
18 #ifndef DOCUMENT_H
19 #define DOCUMENT_H
20 
21 #include "Object.h"
22 
24 
25 class Context;
26 class Media;
27 class Switch;
28 
29 class Document
30 {
31 public:
32  Document ();
33  virtual ~Document ();
34 
35  const set<Object *> *getObjects ();
36  Object *getObjectById (const string &);
37  Object *getObjectByIdOrAlias (const string &);
38  void addObject (Object *);
39 
40  Context *getRoot ();
42  const set<Media *> *getMedias ();
43  const set<Context *> *getContexts ();
44  const set<Switch *> *getSwitches ();
45 
46  int evalAction (Event *, Event::Transition, const string &value="");
47  int evalAction (Action);
48  bool evalPredicate (Predicate *);
49  bool evalPropertyRef (const string &, string *);
50 
51  bool getData (const string &, void **);
52  bool setData (const string &, void *, UserDataCleanFunc fn=nullptr);
53 
54 private:
55  set<Object *> _objects; // all objects
56  Context *_root; // root object
57  MediaSettings *_settings; // settings object
58  set<Media *> _medias; // media objects
59  set<Context *> _contexts; // context objects
60  set<Switch *> _switches; // switch objects
61  UserData _udata; // user data
62 };
63 
65 
66 #endif // DOCUMENT_H
Definition: Object.h:29
set< Media * > _medias
Definition: Document.h:58
MediaSettings * getSettings()
Definition: Document.cpp:125
virtual ~Document()
Definition: Document.cpp:43
Definition: Context.h:26
set< Switch * > _switches
Definition: Document.h:60
Context * _root
Definition: Document.h:56
bool evalPropertyRef(const string &, string *)
Definition: Document.cpp:350
#define GINGA_NAMESPACE_END
Definition: aux-ginga.h:62
const set< Switch * > * getSwitches()
Definition: Document.cpp:144
bool evalPredicate(Predicate *)
Definition: Document.cpp:249
set< Context * > _contexts
Definition: Document.h:59
Definition: Switch.h:26
const set< Context * > * getContexts()
Definition: Document.cpp:138
Definition: aux-ginga.h:185
Context * getRoot()
Definition: Document.cpp:118
Definition: MediaSettings.h:25
#define GINGA_NAMESPACE_BEGIN
Definition: aux-ginga.h:61
Definition: Event.h:88
Transition
Definition: Event.h:44
Definition: Media.h:26
Definition: Document.h:29
bool getData(const string &, void **)
Definition: Document.cpp:371
void(* UserDataCleanFunc)(void *)
Definition: aux-ginga.h:184
MediaSettings * _settings
Definition: Document.h:57
const set< Media * > * getMedias()
Definition: Document.cpp:132
bool setData(const string &, void *, UserDataCleanFunc fn=nullptr)
Definition: Document.cpp:377
void addObject(Object *)
Definition: Document.cpp:77
Definition: Event.h:27
Document()
Definition: Document.cpp:29
Definition: Predicate.h:25
int evalAction(Event *, Event::Transition, const string &value="")
Definition: Document.cpp:150
Object * getObjectById(const string &)
Definition: Document.cpp:56
UserData _udata
Definition: Document.h:61
Object * getObjectByIdOrAlias(const string &)
Definition: Document.cpp:65
const set< Object * > * getObjects()
Definition: Document.cpp:50
set< Object * > _objects
Definition: Document.h:55