libkdepim

krsqueezedtextlabel.h

00001 /* This file has been copied from the KDE libraries and slightly modified.
00002    This can be removed as soon as kdelibs provides the same functionality.
00003 
00004    Copyright (C) 2000 Ronny Standtke <Ronny.Standtke@gmx.de>
00005 
00006    This library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Library General Public
00008    License version 2 as published by the Free Software Foundation.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018    Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #ifndef KRSQUEEZEDTEXTLABEL_H
00022 #define KRSQUEEZEDTEXTLABEL_H
00023 
00024 #include <qlabel.h>
00025 #include <kdepimmacros.h>
00026 
00038 /*
00039  * QLabel
00040  */
00041 class KDE_EXPORT KRSqueezedTextLabel : public QLabel {
00042   Q_OBJECT
00043 
00044 public:
00048   KRSqueezedTextLabel( QWidget *parent, const char *name = 0 );
00049   KRSqueezedTextLabel( const QString &text, QWidget *parent, const char *name = 0 );
00050 
00051   virtual QSize minimumSizeHint() const;
00052   virtual QSize sizeHint() const;
00056   virtual void setAlignment( int );
00057 
00058 public slots:
00059   void setText( const QString & );
00060 
00061 protected:
00065   void resizeEvent( QResizeEvent * );
00069   void squeezeTextToLabel();
00070   QString fullText;
00071 
00072 };
00073 
00074 #endif // KRSQUEEZEDTEXTLABEL_H
KDE Home | KDE Accessibility Home | Description of Access Keys