libyui
 
Loading...
Searching...
No Matches
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
33class YLabelPrivate;
34
38class YLabel : public YWidget
39{
40public:
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
187protected:
188
196 int layoutPass();
197
198private:
199
200 ImplPtr<YLabelPrivate> priv;
201};
202
203
204typedef YLabel YHeading;
205typedef YLabel YOutputField;
206
207
208#endif // YLabel_h
Definition YLabel.h:39
bool isHeading() const
Definition YLabel.cc:90
virtual const YPropertySet & propertySet()
Definition YLabel.cc:146
virtual std::string debugLabel() const
Definition YLabel.cc:200
virtual bool setProperty(const std::string &propertyName, const YPropertyValue &val)
Definition YLabel.cc:169
virtual void setUseBoldFont(bool bold=true)
Definition YLabel.cc:108
std::string value() const
Definition YLabel.h:79
void setValue(const std::string &newValue)
Definition YLabel.h:93
virtual void setText(const std::string &newText)
Definition YLabel.cc:84
bool isOutputField() const
Definition YLabel.cc:96
bool autoWrap() const
Definition YLabel.cc:114
virtual void setAutoWrap(bool autoWrap=true)
Definition YLabel.cc:120
int layoutPass()
Definition YLabel.cc:137
std::string text() const
Definition YLabel.cc:78
virtual YPropertyValue getProperty(const std::string &propertyName)
Definition YLabel.cc:186
virtual const char * widgetClass() const
Definition YLabel.cc:222
bool useBoldFont() const
Definition YLabel.cc:102
virtual ~YLabel()
Definition YLabel.cc:72
YLabel(YWidget *parent, const std::string &text, bool isHeading=false, bool isOutputField=false)
Definition YLabel.cc:61
YWidget(YWidget *parent)
Definition YWidget.cc:106
YWidget * parent() const
Definition YWidget.cc:277
Definition YLabel.cc:39