• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kdeui
 

kdeui

  • kdeui
kwordwrap.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 2001 David Faure <david@mandrakesoft.com>
3 
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.
7 
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.
12 
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 Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17 */
18 
19 #ifndef kwordwrap_h
20 #define kwordwrap_h
21 
22 #include <tqfontmetrics.h>
23 #include <tqvaluelist.h>
24 #include <tqrect.h>
25 #include <tqstring.h>
26 
27 #include <kdelibs_export.h>
28 
48 class KDEUI_EXPORT KWordWrap
49 {
50 public:
56  enum { FadeOut = 0x10000000, Truncate = 0x20000000 };
57 
69  static KWordWrap* formatText( TQFontMetrics &fm, const TQRect & r, int flags, const TQString & str, int len = -1 );
70 
77  TQRect boundingRect() const { return m_boundingRect; }
78 
83  TQString wrappedString() const; // gift for Dirk :)
84 
90  TQString truncatedString( bool dots = true ) const;
91 
104  void drawText( TQPainter *painter, int x, int y, int flags = TQt::AlignAuto ) const;
105 
109  ~KWordWrap();
110 
123  static void drawFadeoutText( TQPainter *p, int x, int y, int maxW,
124  const TQString &t );
125 
136  static void drawTruncateText( TQPainter *p, int x, int y, int maxW,
137  const TQString &t );
138 
139 private:
140  KWordWrap( const TQRect & r );
141  TQValueList<int> m_breakPositions;
142  TQValueList<int> m_lineWidths;
143  TQRect m_boundingRect;
144  TQString m_text;
145 private:
146  class KWordWrapPrivate* d;
147 };
148 
149 #endif
KWordWrap
Word-wrap algorithm that takes into account beautifulness ;)
Definition: kwordwrap.h:48
KWordWrap::boundingRect
TQRect boundingRect() const
Definition: kwordwrap.h:77

kdeui

Skip menu "kdeui"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdeui

Skip menu "kdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kdeui by doxygen 1.8.6
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |