Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

qcomplextext_p.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 ** $Id: qcomplextext_p.h,v 1.1 2002/07/14 21:21:35 leseb Exp $
00003 **
00004 ** Internal header file.
00005 **
00006 ** Created : 
00007 **
00008 ** Copyright (C) 2001 Trolltech AS.  All rights reserved.
00009 **
00010 ** This file is part of the kernel module of the Qt GUI Toolkit.
00011 **
00012 ** This file may be distributed under the terms of the Q Public License
00013 ** as defined by Trolltech AS of Norway and appearing in the file
00014 ** LICENSE.QPL included in the packaging of this file.
00015 **
00016 ** This file may be distributed and/or modified under the terms of the
00017 ** GNU General Public License version 2 as published by the Free Software
00018 ** Foundation and appearing in the file LICENSE.GPL included in the
00019 ** packaging of this file.
00020 **
00021 ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
00022 ** licenses may use this file in accordance with the Qt Commercial License
00023 ** Agreement provided with the Software.
00024 **
00025 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00026 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00027 **
00028 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
00029 **   information about Qt Commercial License Agreements.
00030 ** See http://www.trolltech.com/qpl/ for QPL licensing information.
00031 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00032 **
00033 ** Contact info@trolltech.com if any conditions of this licensing are
00034 ** not clear to you.
00035 **
00036 **********************************************************************/
00037 
00038 #ifndef QCOMPLEXTEXT_H
00039 #define QCOMPLEXTEXT_H
00040 
00041 //
00042 //  W A R N I N G
00043 //  -------------
00044 //
00045 // This file is not part of the Qt API.  It exists for the convenience
00046 // of Qt Remote Control. This header file may change from version to
00047 // version without notice, or even be removed.
00048 //
00049 // We mean it.
00050 //
00051 //
00052 
00053 #ifndef QT_H
00054 #include "qt3namespace.h"
00055 #include <qstring.h>
00056 #include <qpointarray.h>
00057 #include <qfont.h>
00058 #include <qpainter.h>
00059 #include <qlist.h>
00060 #include <qshared.h>
00061 #endif // QT_H
00062 
00063 class QFontPrivate;
00064 
00065 namespace Qt3 {
00066 
00067 // bidi helper classes. Internal to Qt
00068 struct Q_EXPORT QBidiStatus {
00069     QBidiStatus() {
00070         eor = QChar::DirON;
00071         lastStrong = QChar::DirON;
00072         last = QChar:: DirON;
00073     }
00074     QChar::Direction eor;
00075     QChar::Direction lastStrong;
00076     QChar::Direction last;
00077 };
00078 
00079 struct Q_EXPORT QBidiContext : public QShared {
00080     // ### ref and deref parent?
00081     QBidiContext( uchar level, QChar::Direction embedding, QBidiContext *parent = 0, bool override = FALSE );
00082     ~QBidiContext();
00083 
00084     unsigned char level;
00085     bool override : 1;
00086     QChar::Direction dir : 5;
00087 
00088     QBidiContext *parent;
00089 };
00090 
00091 struct Q_EXPORT QBidiControl {
00092     QBidiControl() { context = 0; }
00093     QBidiControl( QBidiContext *c, QBidiStatus s)
00094     { context = c; if( context ) context->ref(); status = s; }
00095     ~QBidiControl() { if ( context && context->deref() ) delete context; }
00096     void setContext( QBidiContext *c ) { if ( context == c ) return; if ( context && context->deref() ) delete context; context = c; context->ref(); }
00097     QBidiContext *context;
00098     QBidiStatus status;
00099 };
00100 
00101 struct Q_EXPORT QTextRun {
00102     QTextRun(int _start, int _stop, QBidiContext *context, QChar::Direction dir);
00103 
00104     int start;
00105     int stop;
00106     // explicit + implicit levels here
00107     uchar level;
00108 };
00109 
00110 class Q_EXPORT QComplexText {
00111 public:
00112     enum Shape {
00113         XIsolated,
00114         XFinal,
00115         XInitial,
00116         XMedial
00117     };
00118     static Shape glyphVariant( const QString &str, int pos);
00119     static Shape glyphVariantLogical( const QString &str, int pos);
00120 
00121     static QChar shapedCharacter(const QString &str, int pos, const QFontMetrics *fm = 0);
00122 
00123     // positions non spacing marks relative to the base character at position pos.
00124     static QPointArray positionMarks( QFontPrivate *f, const QString &str, int pos, QRect *boundingRect = 0 );
00125 
00126     static QPtrList<QTextRun> *bidiReorderLine( QBidiControl *control, const QString &str, int start, int len, 
00127                                                 QChar::Direction basicDir = QChar::DirON );
00128     static QString bidiReorderString( const QString &str, QChar::Direction basicDir = QChar::DirON );
00129 };
00130 
00131 } // namespace Qt3
00132 
00133 #endif

Generated on Sat Nov 5 16:17:01 2005 for OPIE by  doxygen 1.4.2