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 20080 2009-12-15 15:57:52Z vlad $ */
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 
85  virtual void setOrientation(Qt::Orientation orientation)
86  {m_eOrientation = orientation;}
87 
88  Qt::Orientation getOrientation() const
89  {return m_eOrientation;}
90 
91 
93  virtual void fitTextHeight (bool bFit = true);
94 
96  virtual void fitTextWidth (bool bFit = true);
97 
98 
99  /*
100  * Polymorphic methods
101  */
102 
104  virtual void redraw (QPainter& paint);
105 
109  virtual void updateLimits (QPainter* paint = NULL);
110 
111 protected:
112 
116  void calcSize (QSize& box, QPainter* paint = NULL);
117 
119  QPen m_qPen;
120 
122  QFont m_qFont;
123 
125  QString m_qText;
126 
129 
132  bool m_bFitHeight;
133 
136  bool m_bFitWidth;
137 
139  Qt::Orientation m_eOrientation;
140 
141 private:
142 
144  static int s_iNameCounter;
145 
146 };
147 
148 
149 #include "zq_title_inline.hpp"
150 
151 
152 #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)
Qt::Orientation m_eOrientation
Definition: zq_title.hpp:139
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