Ginga  0.13.6
 All Classes Namespaces Functions Variables
FormatterDeviceRegion.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 FORMATTERDEVICEREGION_H_
51 #define FORMATTERDEVICEREGION_H_
52 
53 #include "util/Color.h"
54 using namespace ::br::pucrio::telemidia::util;
55 
56 #include "ncl/Entity.h"
57 using namespace ::br::pucrio::telemidia::ncl;
58 
59 #include "ncl/layout/LayoutRegion.h"
60 using namespace ::br::pucrio::telemidia::ncl::layout;
61 
62 #include "system/thread/Thread.h"
63 using namespace ::br::pucrio::telemidia::ginga::core::system::thread;
64 
65 #include <pthread.h>
66 #include <set>
67 #include <vector>
68 using namespace std;
69 
70 namespace br {
71 namespace pucrio {
72 namespace telemidia {
73 namespace ginga {
74 namespace ncl {
75 namespace model {
76 namespace presentation {
77  class FormatterDeviceRegion : public LayoutRegion {
78  private:
79  string id;
80  int top, left, width, height;
81  vector<LayoutRegion*>* sortedRegions;
82  set<LayoutRegion*> regionSet;
83  pthread_mutex_t rMutex;
84 
85  public:
86  FormatterDeviceRegion(string id);
87  virtual ~FormatterDeviceRegion(){};
88  void addRegion(LayoutRegion *region);
89  LayoutRegion *cloneRegion();
90  int compareWidthSize(string w);
91  int compareHeightSize(string h);
92  short getBackgroundColor();
93  double getBottom();
94  double getHeight();
95  double getLeft();
96  double getRight();
97  LayoutRegion *getRegion(string id);
98  LayoutRegion *getRegionRecursively(string id);
99  vector<LayoutRegion*> *getRegions();
100  string getTitle();
101  double getTop();
102  double getWidth();
103  int getZIndex();
104  int getZIndexValue();
105  bool isBottomPercentual();
106  bool isHeightPercentual();
107  bool isLeftPercentual();
108  bool isRightPercentual();
109  bool isTopPercentual();
110  bool isWidthPercentual();
111  string toString();
112  bool removeRegion(LayoutRegion *region);
113  void removeRegions();
114  void setBackgroundColor(Color *newBackgroundColor);
115  bool setBottom(double newBottom, bool isPercentual);
116  bool setHeight(double newHeight, bool isPercentual);
117  bool setLeft(double newLeft, bool isPercentual);
118  bool setRight(double newRight, bool isPercentual);
119  void setTitle(string newTitle);
120  bool setTop(double newTop, bool isPercentual);
121  bool setWidth(double newWidth, bool isPercentual);
122  void setZIndex(int newZIndex);
123  vector<LayoutRegion*> *getRegionsSortedByZIndex();
124  vector<LayoutRegion*> *getRegionsOverRegion(
125  LayoutRegion *region);
126 
127  LayoutRegion *getParent();
128  void setParent(LayoutRegion *parent);
129  int getTopInPixels();
130  int getBottomInPixels();
131  int getRightInPixels();
132  int getLeftInPixels();
133  int getHeightInPixels();
134  int getWidthInPixels();
135  bool isMovable();
136  bool isResizable();
137  bool isDecorated();
138  void setMovable(bool movable);
139  void setResizable(bool resizable);
140  void setDecorated(bool decorated);
141  void resetTop();
142  void resetBottom();
143  void resetRight();
144  void resetLeft();
145  void resetHeight();
146  void resetWidth();
147  void resetZIndex();
148  void resetDecorated();
149  void resetMovable();
150  void resetResizable();
151  int getAbsoluteLeft();
152  int getAbsoluteTop();
153 
154  void dispose();
155  string getId();
156  void setId(string id);
157  Entity *getDataEntity();
158  int compareTo(void *arg0);
159  };
160 }
161 }
162 }
163 }
164 }
165 }
166 }
167 
168 #endif /*FORMATTERDEVICEREGION_H_*/
Definition: Color.h:62