UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
zq_title.hpp
1 /* zq_title.hpp */
2 /* $Id: zq_title.hpp,v 1.9 2006/06/05 10:39:18 guser4 Exp $ */
3 #ifndef __zq_title_hpp
4 #define __zq_title_hpp
5 
6 #include <qfontmetrics.h>
7 #include <qfont.h>
8 #include <qpen.h>
9 
10 #include "zq_object.hpp"
11 
12 
20 class ZqTitle : public ZqObject
21 {
22 public:
23 
25  enum Alignment {
26  AlignCenter,
27  AlignNorth,
28  AlignSouth,
29  AlignWest,
30  AlignEast,
31  AlignNorthWest,
32  AlignNorthEast,
33  AlignSouthWest,
34  AlignSouthEast
35  };
36 
38  ZqTitle (const char* szName = NULL);
39 
41  ZqTitle (ZqbPlaceholder* pPh, const char* szName = NULL);
42 
43 
44  /*
45  * Properties
46  */
47 
49  virtual void setPen (const QPen& pen);
50 
52  virtual const QPen& getPen () const;
53 
55  virtual QPen& pen ();
56 
57 
59  virtual void setFont (const QFont& font);
60 
62  virtual const QFont& getFont () const;
63 
65  virtual QFont& font ();
66 
67 
69  virtual void setText (const QString& text);
70 
72  virtual const QString& getText () const;
73 
75  virtual QString& text ();
76 
77 
79  virtual void setAlignment (Alignment align);
80 
82  virtual Alignment getAlignment () const;
83 
84 
86  virtual void fitTextHeight (bool bFit = true);
87 
89  virtual void fitTextWidth (bool bFit = true);
90 
91 
92  /*
93  * Polymorphic methods
94  */
95 
97  virtual void redraw (QPainter& paint);
98 
102  virtual void updateLimits (QPainter* paint = NULL);
103 
104 protected:
105 
109  void calcSize (QSize& box, QPainter* paint = NULL);
110 
112  QPen m_qPen;
113 
115  QFont m_qFont;
116 
118  QString m_qText;
119 
122 
126 
130 
131 private:
132 
134  static int s_iNameCounter;
135 
136 };
137 
138 
139 #include "zq_title_inline.hpp"
140 
141 
142 #endif /* zq_title.hpp */
Alignment
Definition: zq_title.hpp:25
QString m_qText
Definition: zq_title.hpp:118
QFont m_qFont
Definition: zq_title.hpp:115
virtual QFont & font()
Definition: zq_title_inline.hpp:79
virtual const QString & getText() const
Definition: zq_title_inline.hpp:101
virtual void setText(const QString &text)
Definition: zq_title_inline.hpp:90
virtual void fitTextWidth(bool bFit=true)
Definition: zq_title_inline.hpp:156
QPen m_qPen
Definition: zq_title.hpp:112
bool m_bFitHeight
Definition: zq_title.hpp:125
Definition: zqb_placeholder.hpp:25
virtual const QPen & getPen() const
Definition: zq_title_inline.hpp:35
void calcSize(QSize &box, QPainter *paint=NULL)
virtual void setAlignment(Alignment align)
Definition: zq_title_inline.hpp:123
bool m_bFitWidth
Definition: zq_title.hpp:129
Alignment m_eTextAlign
Definition: zq_title.hpp:121
virtual Alignment getAlignment() const
Definition: zq_title_inline.hpp:134
virtual void setFont(const QFont &font)
Definition: zq_title_inline.hpp:57
Definition: zq_title.hpp:20
virtual void redraw()
Definition: zqb_visible.hpp:82
virtual void fitTextHeight(bool bFit=true)
Definition: zq_title_inline.hpp:145
virtual void setPen(const QPen &pen)
Definition: zq_title_inline.hpp:24
virtual QPen & pen()
Definition: zq_title_inline.hpp:46
Definition: zq_object.hpp:36
virtual void updateLimits(QPainter *paint=NULL)
ZqTitle(const char *szName=NULL)
virtual const QFont & getFont() const
Definition: zq_title_inline.hpp:68
virtual QString & text()
Definition: zq_title_inline.hpp:112