Ginga  0.13.6
 All Classes Namespaces Functions Variables
NclDocument.h
1 /******************************************************************************
2 Este arquivo eh parte da implementacao do ambiente declarativo do middleware
3 Ginga (Ginga-NCL).
4 
5 Direitos Autorais Reservados (c) 1989-2007 PUC-Rio/Laboratorio TeleMidia
6 
7 Este programa eh software livre; voce pode redistribui-lo e/ou modificah-lo sob
8 os termos da Licenca Publica Geral GNU versao 2 conforme publicada pela Free
9 Software Foundation.
10 
11 Este programa eh distribuido na expectativa de que seja util, porem, SEM
12 NENHUMA GARANTIA; nem mesmo a garantia implicita de COMERCIABILIDADE OU
13 ADEQUACAO A UMA FINALIDADE ESPECIFICA. Consulte a Licenca Publica Geral do
14 GNU versao 2 para mais detalhes.
15 
16 Voce deve ter recebido uma copia da Licenca Publica Geral do GNU versao 2 junto
17 com este programa; se nao, escreva para a Free Software Foundation, Inc., no
18 endereco 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
19 
20 Para maiores informacoes:
21 ncl @ telemidia.puc-rio.br
22 http://www.ncl.org.br
23 http://www.ginga.org.br
24 http://www.telemidia.puc-rio.br
25 ******************************************************************************
26 This file is part of the declarative environment of middleware Ginga (Ginga-NCL)
27 
28 Copyright: 1989-2007 PUC-RIO/LABORATORIO TELEMIDIA, All Rights Reserved.
29 
30 This program is free software; you can redistribute it and/or modify it under
31 the terms of the GNU General Public License version 2 as published by
32 the Free Software Foundation.
33 
34 This program is distributed in the hope that it will be useful, but WITHOUT ANY
35 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
36 PARTICULAR PURPOSE. See the GNU General Public License version 2 for more
37 details.
38 
39 You should have received a copy of the GNU General Public License version 2
40 along with this program; if not, write to the Free Software
41 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
42 
43 For further information contact:
44 ncl @ telemidia.puc-rio.br
45 http://www.ncl.org.br
46 http://www.ginga.org.br
47 http://www.telemidia.puc-rio.br
48 *******************************************************************************/
49 
50 #ifndef NCLDOCUMENT_H_
51 #define NCLDOCUMENT_H_
52 
53 extern "C" {
54  #include <assert.h>
55 }
56 
57 #include "switches/Rule.h"
58 #include "switches/RuleBase.h"
59 using namespace ::br::pucrio::telemidia::ncl::switches;
60 
61 #include "components/ContextNode.h"
62 #include "components/Node.h"
63 #include "components/NodeEntity.h"
64 using namespace ::br::pucrio::telemidia::ncl::components;
65 
66 #include "connectors/Connector.h"
67 #include "connectors/ConnectorBase.h"
68 using namespace ::br::pucrio::telemidia::ncl::connectors;
69 
70 #include "descriptor/GenericDescriptor.h"
71 #include "descriptor/DescriptorBase.h"
72 using namespace ::br::pucrio::telemidia::ncl::descriptor;
73 
74 #include "layout/LayoutRegion.h"
75 #include "layout/RegionBase.h"
76 using namespace ::br::pucrio::telemidia::ncl::layout;
77 
78 #include "transition/Transition.h"
79 #include "transition/TransitionBase.h"
80 using namespace ::br::pucrio::telemidia::ncl::transition;
81 
82 #include "metainformation/Meta.h"
83 #include "metainformation/Metadata.h"
84 using namespace ::br::pucrio::telemidia::ncl::metainformation;
85 
86 #include "Base.h"
87 
88 #include <map>
89 #include <string>
90 #include <vector>
91 using namespace std;
92 
93 namespace br {
94 namespace pucrio {
95 namespace telemidia {
96 namespace ncl {
97  class NclDocument {
98  private:
99  ContextNode* body;
100  ConnectorBase* connectorBase;
101  DescriptorBase* descriptorBase;
102  map<string, NclDocument*> documentAliases;
103  vector<NclDocument*> documentBase;
104  map<string, NclDocument*> documentLocations;
105  string id;
106  map<int, RegionBase*> regionBases;
107  RuleBase* ruleBase;
108  TransitionBase* transitionBase;
109  vector<Meta*> metainformationList;
110  vector<Metadata*> metadataList;
111 
112  string docLocation;
113  NclDocument* parentDocument;
114 
115  public:
116  NclDocument(string id, string docLocation);
117  ~NclDocument();
118 
119  NclDocument* getParentDocument();
120  void setParentDocument(NclDocument* parentDocument);
121  string getDocumentPerspective();
122 
123  string getDocumentLocation();
124 
125  bool addDocument(NclDocument* document, string alias, string location);
126  void clearDocument();
127  Connector* getConnector(string connectorId);
128  ConnectorBase* getConnectorBase();
129  Transition* getTransition(string transitionId);
130  TransitionBase* getTransitionBase();
131  GenericDescriptor* getDescriptor(string descriptorId);
132  DescriptorBase* getDescriptorBase();
133  NclDocument* getDocument(string documentId);
134  string getDocumentAlias(NclDocument* document);
135  ContextNode* getBody();
136  string getDocumentLocation(NclDocument* document);
137  vector<NclDocument*>* getDocuments();
138  string getId();
139 
140  private:
141  Node* getNodeLocally(string nodeId);
142 
143  public:
144  Node* getNode(string nodeId);
145  LayoutRegion* getRegion(string regionId);
146 
147  private:
148  LayoutRegion* getRegion(string regionId, RegionBase* regionBase);
149 
150  public:
151  RegionBase* getRegionBase(int devClass);
152  RegionBase* getRegionBase(string regionBaseId);
153  map<int, RegionBase*>* getRegionBases();
154  Rule* getRule(string ruleId);
155  RuleBase* getRuleBase();
156  bool removeDocument(NclDocument* document);
157  void setConnectorBase(ConnectorBase* connectorBase);
158  void setTransitionBase(TransitionBase* transitionBase);
159  void setDescriptorBase(DescriptorBase* descriptorBase);
160  void setDocumentAlias(NclDocument* document, string alias);
161  void setBody(ContextNode* node);
162  void setDocumentLocation(NclDocument* document, string location);
163  void setId(string id);
164  void addRegionBase(RegionBase* regionBase);
165  void setRuleBase(RuleBase* ruleBase);
166  void addMetainformation(Meta* meta);
167  void addMetadata(Metadata* metadata);
168  vector<Meta*>* getMetainformation();
169  vector<Metadata*>* getMetadata();
170  void removeRegionBase(string regionBaseId);
171  void removeMetainformation(Meta* meta);
172  void removeMetadata(Metadata* metadata);
173  void removeAllMetainformation();
174  void removeAllMetadata();
175  };
176 }
177 }
178 }
179 }
180 
181 #endif /*NCLDOCUMENT_H_*/
Definition: NclDocument.h:97