1 /* This file is part of the KDE libraries
2 Copyright (C) 2000 Ronny Standtke <Ronny.Standtke@gmx.de>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
16 Boston, MA 02110-1301, USA.
19 #ifndef KSQUEEZEDTEXTLABEL_H
20 #define KSQUEEZEDTEXTLABEL_H
24 #include <kdelibs_export.h>
27 * @short A replacement for QLabel that squeezes its text
29 * A label class that squeezes its text into the label
31 * If the text is too long to fit into the label it is divided into
32 * remaining left and right parts which are separated by three dots.
35 * http://www.kde.org/documentation/index.html could be squeezed to
36 * http://www.kde...ion/index.html
38 * \image html ksqueezedtextlabel.png "KSqueezedTextLabel Widget"
40 * @author Ronny Standtke <Ronny.Standtke@gmx.de>
46 class KDEUI_EXPORT KSqueezedTextLabel
: public QLabel
{
51 * Default constructor.
53 KSqueezedTextLabel( QWidget
*parent
, const char *name
= 0 );
54 KSqueezedTextLabel( const QString
&text
, QWidget
*parent
, const char *name
= 0 );
56 virtual QSize
minimumSizeHint() const;
57 virtual QSize
sizeHint() const;
59 * Overridden for internal reasons; the API remains unaffected.
61 virtual void setAlignment( int );
64 void setText( const QString
& );
68 * used when widget is resized
70 void resizeEvent( QResizeEvent
* );
74 void squeezeTextToLabel();
78 virtual void virtual_hook( int id
, void* data
);
80 class KSqueezedTextLabelPrivate
;
81 KSqueezedTextLabelPrivate
*d
;
84 #endif // KSQUEEZEDTEXTLABEL_H