UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
zqb_placeholder.hpp
1 /* zqb_placeholder.hpp */
2 /* $Id: zqb_placeholder.hpp 20080 2009-12-15 15:57:52Z vlad $ */
3 #ifndef __zqb_placeholder_hpp
4 #define __zqb_placeholder_hpp
5 
6 #include <vector>
7 
8 #include "zqb_cliplinebyrect.hpp"
9 #include "zqb_visible.hpp"
10 #include "zqb_container.hpp"
11 #include "zqb_autoname.hpp"
12 #include "zqb_pixgroup.hpp"
13 #include "zqb_objectarray.hpp"
14 
15 
25 class ZqbPlaceholder
26  : virtual public ZqbAutoName, public ZqbVisible, public ZqbContainer
27 {
28 public:
29 
34  ZqbPlaceholder (ZqbContainer& container,
35  ZqbPixGroup* pPGX, ZqbPixGroup* pPGY,
36  const char* szPhName = NULL);
37 
39  virtual ~ZqbPlaceholder ();
40 
41 
42  /*
43  * Visible properties
44  */
45 
47  virtual void redraw (QPainter& paint);
48 
50  virtual ZqbEventHint input (QEvent& event);
51 
55  virtual void updateLimits (QPainter* paint = NULL);
56 
60  virtual void updateGeometry ();
61 
62 
63  /*
64  * Qt links
65  */
66 
69  virtual QPainter* getScreenPainter () const;
70 
73  virtual void setScreenPainter (QPainter* pPainter);
74 
77  virtual QWidget* getAreaWidget () const;
78 
81  virtual void setAreaWidget (QWidget* pWidget);
82 
84  virtual QRect getRect () const;
85 
86 
87  /*
88  * Operations over objects.
89  */
90 
94  virtual bool addObject (ZqObject* obj);
95 
99  virtual bool removeObject (ZqObject* obj);
100 
104  virtual bool toFront (ZqObject* obj);
105 
109  virtual bool toBack (ZqObject* obj);
110 
115  virtual int setDrawOrder (const ZqbObjectArray& objects);
116 
117 
118  /*
119  * Geometry of the place (location and size)
120  */
121 
124  bool isPlaced () const;
125 
128 
131 
132 
133  /*
134  * Clipping facility
135 
136  */
137 
144  bool clipLine (int x[2], int y[2]);
145 
146 
147  /*
148  * Flag of redrawing
149  */
150 
152  void setDirty ();
153 
155  void resetDirty ();
156 
158  bool isDirty () const;
159 
160 
161  /*
162  * Flag to clear (fill with white color by default) the area under
163  * placeholder before drawing placeholder's objects
164  */
165 
167  void setAutoClear (bool bAutoClear);
168 
170  void setAutoClear (bool bAutoClear, QColor qcFillColor);
171 
173  bool getAutoClear (QColor* qcFillColor = NULL) const;
174 
175 protected:
176 
179 
181  QPainter *m_pqPainter;
182 
185  QWidget *m_pqWidget;
186 
190 
193  bool m_bDirty;
194 
198  bool m_bAutoClear;
199 
201  QColor m_qcFillColor;
202 
203 private:
204 
206  static int m_iNameCounter;
207 
208 };
209 
210 
212 typedef std::vector<ZqbPlaceholder*> ZqbPlaceholderVector;
213 
214 
215 #endif /* zqb_placeholder.hpp */
virtual bool removeObject(ZqObject *obj)
virtual void setScreenPainter(QPainter *pPainter)
bool isPlaced() const
Definition: zqb_placeholder.hpp:25
virtual int setDrawOrder(const ZqbObjectArray &objects)
ZqObject * m_pGrabber
Definition: zqb_placeholder.hpp:188
virtual void updateLimits(QPainter *paint=NULL)
virtual QPainter * getScreenPainter() const
virtual bool toFront(ZqObject *obj)
virtual ZqbEventHint input(QEvent &event)
virtual QRect getRect() const
Definition: zqb_objectarray.hpp:26
ZqbPixGrpMember py
Definition: zqb_placeholder.hpp:130
virtual void redraw()
Definition: zqb_visible.hpp:82
bool m_bDirty
Definition: zqb_placeholder.hpp:192
Definition: zqb_autoname.hpp:18
Definition: zqb_container.hpp:23
bool isDirty() const
Definition: zqb_pixgrpmember.hpp:24
QPainter * m_pqPainter
Definition: zqb_placeholder.hpp:180
virtual bool toBack(ZqObject *obj)
ZqbPlaceholder(ZqbContainer &container, ZqbPixGroup *pPGX, ZqbPixGroup *pPGY, const char *szPhName=NULL)
virtual QWidget * getAreaWidget() const
QColor m_qcFillColor
Definition: zqb_placeholder.hpp:200
Definition: zq_object.hpp:36
QWidget * m_pqWidget
Definition: zqb_placeholder.hpp:184
virtual void updateGeometry()
bool clipLine(int x[2], int y[2])
Definition: zqb_visible.hpp:33
bool getAutoClear(QColor *qcFillColor=NULL) const
virtual ~ZqbPlaceholder()
virtual void setAreaWidget(QWidget *pWidget)
void setAutoClear(bool bAutoClear)
virtual bool addObject(ZqObject *obj)
ZqbPixGrpMember px
Definition: zqb_placeholder.hpp:127
bool m_bAutoClear
Definition: zqb_placeholder.hpp:197
ZqbContainer & m_Container
Definition: zqb_placeholder.hpp:177
Definition: zqb_pixgroup.hpp:34