libyui-qt  2.53.0
YQLabel.h
1 /*
2  Copyright (C) 2000-2012 Novell, Inc
3  This library is free software; you can redistribute it and/or modify
4  it under the terms of the GNU Lesser General Public License as
5  published by the Free Software Foundation; either version 2.1 of the
6  License, or (at your option) version 3.0 of the License. This library
7  is distributed in the hope that it will be useful, but WITHOUT ANY
8  WARRANTY; without even the implied warranty of MERCHANTABILITY or
9  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
10  License for more details. You should have received a copy of the GNU
11  Lesser General Public License along with this library; if not, write
12  to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
13  Floor, Boston, MA 02110-1301 USA
14 */
15 
16 
17 /*-/
18 
19  File: YQLabel.h
20 
21  Author: Stefan Hundhammer <sh@suse.de>
22 
23 /-*/
24 
25 
26 #ifndef YQLabel_h
27 #define YQLabel_h
28 
29 #include <qlabel.h>
30 #include <yui/YLabel.h>
31 
32 
33 class YQLabel : public QLabel, public YLabel
34 {
35  Q_OBJECT
36 
37 public:
38 
39  /**
40  * Constructor.
41  **/
42  YQLabel( YWidget * parent,
43  const std::string & text,
44  bool isHeading = false,
45  bool isOutputField = false );
46 
47  /**
48  * Destructor.
49  **/
50  virtual ~YQLabel();
51 
52  /**
53  * Set the text the widget displays.
54  *
55  * Reimplemented from YLabel.
56  **/
57  virtual void setText( const std::string & newText );
58 
59  /**
60  * Switch bold font on or off.
61  *
62  * Reimplemented from YLabel.
63  **/
64  virtual void setUseBoldFont( bool bold );
65 
66  /*
67  * Enable or disable automatic word wrapping.
68  *
69  * Reimplemented from YLabel.
70  **/
71  virtual void setAutoWrap( bool autoWrap = true );
72 
73  /**
74  * Set enabled / disabled state.
75  *
76  * Reimplemented from YWidget.
77  **/
78  virtual void setEnabled( bool enabled );
79 
80  /**
81  * Preferred width of the widget.
82  *
83  * Reimplemented from YWidget.
84  **/
85  virtual int preferredWidth();
86 
87  /**
88  * Preferred height of the widget.
89  *
90  * Reimplemented from YWidget.
91  **/
92  virtual int preferredHeight();
93 
94  /**
95  * Set the new size of the widget.
96  *
97  * Reimplemented from YWidget.
98  **/
99  virtual void setSize( int newWidth, int newHeight );
100 
101 protected:
102 
103  int _layoutPass1Width;
104 };
105 
106 
107 #endif // YQLabel_h
YQLabel::preferredWidth
virtual int preferredWidth()
Preferred width of the widget.
Definition: YQLabel.cc:111
YQLabel::~YQLabel
virtual ~YQLabel()
Destructor.
Definition: YQLabel.cc:74
YQLabel::setEnabled
virtual void setEnabled(bool enabled)
Set enabled / disabled state.
Definition: YQLabel.cc:104
YQLabel::setText
virtual void setText(const std::string &newText)
Set the text the widget displays.
Definition: YQLabel.cc:80
YQLabel::preferredHeight
virtual int preferredHeight()
Preferred height of the widget.
Definition: YQLabel.cc:154
YQLabel::setUseBoldFont
virtual void setUseBoldFont(bool bold)
Switch bold font on or off.
Definition: YQLabel.cc:87
YQLabel
Definition: YQLabel.h:34
YQLabel::setSize
virtual void setSize(int newWidth, int newHeight)
Set the new size of the widget.
Definition: YQLabel.cc:187
YQLabel::YQLabel
YQLabel(YWidget *parent, const std::string &text, bool isHeading=false, bool isOutputField=false)
Constructor.
Definition: YQLabel.cc:43