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

tdeui

  • tdeui
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 <tdelibs_export.h>
28
48class TDEUI_EXPORT KWordWrap
49{
50public:
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
139private:
140 KWordWrap( const TQRect & r );
141 TQValueList<int> m_breakPositions;
142 TQValueList<int> m_lineWidths;
143 TQRect m_boundingRect;
144 TQString m_text;
145private:
146 class KWordWrapPrivate* d;
147};
148
149#endif
KWordWrap
Word-wrap algorithm that takes into account beautifulness ;)
Definition: kwordwrap.h:49
KWordWrap::boundingRect
TQRect boundingRect() const
Definition: kwordwrap.h:77

tdeui

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

tdeui

Skip menu "tdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.9.4
This website is maintained by Timothy Pearson.