38#ifndef TQCOMPLEXTEXT_H
39#define TQCOMPLEXTEXT_H
55#include <tqpointarray.h>
62#ifndef TQT_NO_COMPLEXTEXT
65struct TQ_EXPORT KoBidiStatus {
68 lastStrong = TQChar::DirON;
69 last = TQChar:: DirON;
71 TQChar::Direction eor;
72 TQChar::Direction lastStrong;
73 TQChar::Direction last;
76struct TQ_EXPORT KoBidiContext : public TQShared {
78 KoBidiContext( uchar level, TQChar::Direction embedding, KoBidiContext *parent = 0, bool override = false );
83 TQChar::Direction dir : 5;
85 KoBidiContext *parent;
88struct TQ_EXPORT KoBidiControl {
89 KoBidiControl() { context = 0; }
90 KoBidiControl( KoBidiContext *c, KoBidiStatus s)
91 { context = c; if( context ) context->ref(); status = s; }
92 ~KoBidiControl() { if ( context && context->deref() ) delete context; }
93 void setContext( KoBidiContext *c ) { if ( context == c ) return; if ( context && context->deref() ) delete context; context = c; context->ref(); }
94 KoBidiContext *context;
98struct TQ_EXPORT KoTextRun {
99 KoTextRun( int _start, int _stop, KoBidiContext *context, TQChar::Direction dir);
107class TQ_EXPORT KoComplexText {
115 static Shape glyphVariant( const TQString &str, int pos);
116 static Shape glyphVariantLogical( const TQString &str, int pos);
118 static TQString shapedString( const TQString &str, int from = 0, int len = -1, TQPainter::TextDirection dir = TQPainter::Auto, const TQFontMetrics *fm = 0);
119 static TQChar shapedCharacter( const TQString &str, int pos, const TQFontMetrics *fm = 0);
124 static TQPtrList<KoTextRun> *bidiReorderLine( KoBidiControl *control, const TQString &str, int start, int len,
125 TQChar::Direction basicDir = TQChar::DirON );
126 static TQString bidiReorderString( const TQString &str, TQChar::Direction basicDir = TQChar::DirON );
|