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 <tqlabel.h>
00025 #include <kdepimmacros.h>
00026 
00038 /*
00039  * TQLabel
00040  */
00041 class KDE_EXPORT KRSqueezedTextLabel : public TQLabel {
00042   Q_OBJECT
00043   TQ_OBJECT
00044 
00045 public:
00049   KRSqueezedTextLabel( TQWidget *parent, const char *name = 0 );
00050   KRSqueezedTextLabel( const TQString &text, TQWidget *parent, const char *name = 0 );
00051 
00052   virtual TQSize minimumSizeHint() const;
00053   virtual TQSize sizeHint() const;
00057   virtual void setAlignment( int );
00058 
00059 public slots:
00060   void setText( const TQString & );
00061 
00062 protected:
00066   void resizeEvent( TQResizeEvent * );
00070   void squeezeTextToLabel();
00071   TQString fullText;
00072 
00073 };
00074 
00075 #endif // KRSQUEEZEDTEXTLABEL_H