Ginga  0.13.6
 All Classes Namespaces Functions Variables
CascadingDescriptor.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 _CASCADINGDESCRIPTOR_H_
51 #define _CASCADINGDESCRIPTOR_H_
52 
53 #include "util/functions.h"
54 #include "util/Color.h"
55 
56 #include "ncl/Parameter.h"
57 using namespace ::br::pucrio::telemidia::ncl;
58 
59 #include "ncl/descriptor/Descriptor.h"
60 #include "ncl/descriptor/GenericDescriptor.h"
61 using namespace ::br::pucrio::telemidia::ncl::descriptor;
62 
63 #include "ncl/layout/LayoutRegion.h"
64 using namespace ::br::pucrio::telemidia::ncl::layout;
65 
66 #include "ncl/switches/DescriptorSwitch.h"
67 using namespace ::br::pucrio::telemidia::ncl::switches;
68 
69 #include "ncl/navigation/FocusDecoration.h"
70 #include "ncl/navigation/KeyNavigation.h"
71 using namespace ::br::pucrio::telemidia::ncl::navigation;
72 
73 #include "ncl/transition/Transition.h"
74 using namespace ::br::pucrio::telemidia::ncl::transition;
75 
76 #include "FormatterRegion.h"
77 using namespace ::br::pucrio::telemidia::ginga::ncl::model::presentation;
78 
79 #include <string>
80 #include <map>
81 #include <vector>
82 #include <set>
83 using namespace std;
84 
85 namespace br {
86 namespace pucrio {
87 namespace telemidia {
88 namespace ginga {
89 namespace ncl {
90 namespace model {
91 namespace presentation {
93  protected:
94  set<string> typeSet;
95 
96  private:
97  static int dummyCount;
98  string id;
99  vector<GenericDescriptor*> descriptors;
100  vector<GenericDescriptor*> unsolvedDescriptors;
101  map<string, string> parameters;
102  double explicitDuration;
103  string playerName;
104  long repetitions;
105  bool freeze;
106  LayoutRegion* region;
107  FormatterRegion* formatterRegion;
108 
109  string focusIndex, moveUp, moveDown, moveLeft, moveRight;
110  string focusSrc, selectionSrc;
111  Color* focusBorderColor;
112  Color* selBorderColor;
113  int focusBorderWidth;
114  int selBorderWidth;
115  double focusBorderTransparency;
116  vector<Transition*>* inputTransitions;
117  vector<Transition*>* outputTransitions;
118 
119  void cascadeDescriptor(Descriptor* descriptor);
120 
121  public:
122  CascadingDescriptor(GenericDescriptor* firstDescriptor);
125 
126  protected:
127  void initializeCascadingDescriptor();
128 
129  public:
130  bool instanceOf(string s);
131  string getId();
132  bool isLastDescriptor(GenericDescriptor* descriptor);
133  void cascade(GenericDescriptor* preferredDescriptor);
134  GenericDescriptor* getUnsolvedDescriptor(int i);
135  vector<GenericDescriptor*>* getUnsolvedDescriptors();
136  void cascadeUnsolvedDescriptor();
137  double getExplicitDuration();
138  bool getFreeze();
139  string getPlayerName();
140  LayoutRegion* getRegion();
141  LayoutRegion* getRegion(void* formatterLayout, void* object);
142  FormatterRegion* getFormatterRegion();
143 
144  private:
145  void updateRegion(void* formatterLayout, string name, string value);
146 
147  void createDummyRegion(void* formatterLayout, void* executionObject);
148  void createDummyRegion(void* formatterLayout);
149 
150  public:
151  void setFormatterLayout(void* formatterLayout);
152  long getRepetitions();
153  vector<Parameter*>* getParameters();
154  string getParameterValue(string paramName);
155  vector<GenericDescriptor*>* getNcmDescriptors();
156  Color* getFocusBorderColor();
157  double getFocusBorderTransparency();
158  int getFocusBorderWidth();
159  string getFocusIndex();
160  string getFocusSrc();
161  string getSelectionSrc();
162  string getMoveDown();
163  string getMoveLeft();
164  string getMoveRight();
165  string getMoveUp();
166  Color* getSelBorderColor();
167  int getSelBorderWidth();
168  vector<Transition*>* getInputTransitions();
169  vector<Transition*>* getOutputTransitions();
170  };
171 }
172 }
173 }
174 }
175 }
176 }
177 }
178 
179 #endif //_CASCADINGDESCRIPTOR_H_
Definition: Color.h:62