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

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