kwordwrap.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
#ifndef kwordwrap_h
00020
#define kwordwrap_h
00021
00022
#include <qfontmetrics.h>
00023
#include <qvaluelist.h>
00024
#include <qrect.h>
00025
#include <qstring.h>
00026
00044 class KWordWrap
00045 {
00046
public:
00052
enum { FadeOut = 0x10000000, Truncate = 0x20000000 };
00053
00065
static KWordWrap*
formatText(
QFontMetrics &fm,
const QRect & r,
int flags,
const QString & str,
int len = -1 );
00066
00073 QRect boundingRect()
const {
return m_boundingRect; }
00074
00079
QString wrappedString() const;
00080
00086
QString truncatedString(
bool dots = true ) const;
00087
00100
void drawText(
QPainter *painter,
int x,
int y,
int flags =
Qt::AlignAuto ) const;
00101
00105 ~
KWordWrap();
00106
00119 static
void drawFadeoutText(
QPainter *p,
int x,
int y,
int maxW,
00120 const
QString &t );
00121
00132 static
void drawTruncateText(
QPainter *p,
int x,
int y,
int maxW,
00133 const
QString &t );
00134
00135 private:
00136
KWordWrap( const
QRect & r );
00137
QValueList<
int> m_breakPositions;
00138
QValueList<
int> m_lineWidths;
00139
QRect m_boundingRect;
00140
QString m_text;
00141 private:
00142 class KWordWrapPrivate* d;
00143 };
00144
00145 #endif
This file is part of the documentation for kdeui Library Version 3.3.1.