home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / kcutlabel.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-05-27  |  1.4 KB  |  69 lines

  1. /* 
  2.  *
  3.  * $Id: kcutlabel.h 619556 2007-01-03 17:38:12Z trueg $
  4.  * Copyright (C) 2003 Sebastian Trueg <trueg@k3b.org>
  5.  *
  6.  * This file is part of the K3b project.
  7.  * Copyright (C) 1998-2007 Sebastian Trueg <trueg@k3b.org>
  8.  *
  9.  * This program is free software; you can redistribute it and/or modify
  10.  * it under the terms of the GNU General Public License as published by
  11.  * the Free Software Foundation; either version 2 of the License, or
  12.  * (at your option) any later version.
  13.  * See the file "COPYING" for the exact licensing terms.
  14.  */
  15.  
  16.  
  17. #ifndef KCUTLABEL_H
  18. #define KCUTLABEL_H
  19.  
  20. #include <qlabel.h>
  21. #include "k3b_export.h"
  22.  
  23.  
  24. /*
  25.  * @ref QLabel
  26.  */
  27. class LIBK3B_EXPORT KCutLabel : public QLabel 
  28. {
  29.   Q_OBJECT
  30.  
  31.  public:
  32.   /**
  33.    * Default constructor.
  34.    */
  35.   KCutLabel( QWidget *parent = 0, const char *name = 0);
  36.   KCutLabel( const QString &text, QWidget *parent = 0, const char *name = 0 );
  37.  
  38.   virtual QSize minimumSizeHint() const;
  39.  
  40.   /**
  41.    * \return the full text while text() returns the cut text
  42.    */
  43.   const QString& fullText() const;
  44.  
  45.  public slots:
  46.   void setText( const QString & );
  47.  
  48.   /**
  49.    * \param i the number of characters that have to be visible. Default is 1.
  50.    */
  51.   void setMinimumVisibleText( int i );
  52.  
  53.  protected:
  54.   /**
  55.    * used when widget is resized
  56.    */
  57.   void resizeEvent( QResizeEvent * );
  58.   /**
  59.    * does the dirty work
  60.    */
  61.   void cutTextToLabel();
  62.  
  63.  private:
  64.   QString m_fullText;
  65.   int m_minChars;
  66. };
  67.  
  68. #endif // KCUTLABEL_H
  69.