libyui
YLabel.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: YLabel.h
20 
21  Author: Stefan Hundhammer <shundhammer@suse.de>
22 
23 /-*/
24 
25 #ifndef YLabel_h
26 #define YLabel_h
27 
28 #include "YWidget.h"
29 #include <string>
30 #include "ImplPtr.h"
31 
32 
33 class YLabelPrivate;
34 
38 class YLabel : public YWidget
39 {
40 public:
41 
54  const std::string & text,
55  bool isHeading = false,
56  bool isOutputField = false );
57 
61  virtual ~YLabel();
62 
69  virtual const char * widgetClass() const;
70 
74  std::string text() const;
75 
79  std::string value() const { return text(); }
80  std::string label() const { return text(); }
81 
88  virtual void setText( const std::string & newText );
89 
93  void setValue( const std::string & newValue ) { setText( newValue ); }
94  void setLabel( const std::string & newLabel ) { setText( newLabel ); }
95 
102  bool isHeading() const;
103 
110  bool isOutputField() const;
111 
115  bool useBoldFont() const;
116 
123  virtual void setUseBoldFont( bool bold = true );
124 
128  bool autoWrap() const;
129 
144  virtual void setAutoWrap( bool autoWrap = true );
145 
159  virtual bool setProperty( const std::string & propertyName,
160  const YPropertyValue & val );
161 
169  virtual YPropertyValue getProperty( const std::string & propertyName );
170 
177  virtual const YPropertySet & propertySet();
178 
185  virtual std::string debugLabel() const;
186 
187 protected:
188 
196  int layoutPass();
197 
198 private:
199 
201 };
202 
203 
204 typedef YLabel YHeading;
205 typedef YLabel YOutputField;
206 
207 
208 #endif // YLabel_h
bool autoWrap() const
Definition: YLabel.cc:114
virtual void setAutoWrap(bool autoWrap=true)
Definition: YLabel.cc:120
bool isOutputField() const
Definition: YLabel.cc:96
virtual void setText(const std::string &newText)
Definition: YLabel.cc:84
int layoutPass()
Definition: YLabel.cc:137
virtual bool setProperty(const std::string &propertyName, const YPropertyValue &val)
Definition: YLabel.cc:169
bool useBoldFont() const
Definition: YLabel.cc:102
Definition: YLabel.h:38
Definition: YProperty.h:104
virtual YPropertyValue getProperty(const std::string &propertyName)
Definition: YLabel.cc:186
Definition: YProperty.h:197
YWidget * parent() const
Definition: YWidget.cc:271
bool isHeading() const
Definition: YLabel.cc:90
virtual const YPropertySet & propertySet()
Definition: YLabel.cc:146
std::string text() const
Definition: YLabel.cc:78
virtual std::string debugLabel() const
Definition: YLabel.cc:200
YLabel(YWidget *parent, const std::string &text, bool isHeading=false, bool isOutputField=false)
Definition: YLabel.cc:61
std::string value() const
Definition: YLabel.h:79
void setValue(const std::string &newValue)
Definition: YLabel.h:93
virtual const char * widgetClass() const
Definition: YLabel.cc:222
virtual void setUseBoldFont(bool bold=true)
Definition: YLabel.cc:108
virtual ~YLabel()
Definition: YLabel.cc:72
Definition: YLabel.cc:38
Definition: YWidget.h:54