QUnicodeTables Namespace Reference


Classes

struct  Properties

Enumerations

enum  LineBreakClass
enum  Script
enum  

Functions

Q_CORE_EXPORT const QUnicodeTables::Propertiesproperties (uint ucs4)
Q_CORE_EXPORT QChar::Category category (uint ucs4)
Q_CORE_EXPORT unsigned char combiningClass (uint ucs4)
Q_CORE_EXPORT QChar::Direction direction (uint ucs4)
Q_CORE_EXPORT QUnicodeTables::LineBreakClass lineBreakClass (uint ucs4)
Q_CORE_EXPORT QChar::Joining joining (uint ucs4)
Q_CORE_EXPORT QChar::UnicodeVersion unicodeVersion (uint ucs4)
Q_CORE_EXPORT int digitValue (uint ucs4)
Q_CORE_EXPORT bool mirrored (uint ucs4)
Q_CORE_EXPORT int mirroredChar (uint ucs4)
Q_CORE_EXPORT int upper (uint ucs4)
Q_CORE_EXPORT int lower (uint ucs4)
QString decomposition (uint ucs4)
QChar::Decomposition decompositionTag (uint ucs4)
ushort ligature (ushort u1, ushort u2)
QString normalize (const QString &str, QString::NormalizationForm mode)
QString normalize (const QString &str, QString::NormalizationForm mode, QChar::UnicodeVersion version)
int script (unsigned int uc)
uint surrogateToUcs4 (ushort high, ushort low)
ushort highSurrogate (uint ucs4)
ushort lowSurrogate (uint ucs4)
bool isHighSurrogate (uint utf16)
bool isLowSurrogate (uint utf16)
QChar::Category category (const QChar &c)
unsigned char combiningClass (const QChar &ch)
QChar::Direction direction (const QChar &c)
int lineBreakClass (const QChar &ch)
Q_CORE_EXPORT int QT_FASTCALL script (uint ucs4)
Q_CORE_EXPORT_INLINE int QT_FASTCALL script (const QChar &ch)
QChar::Joining joining (const QChar &c)
bool mirrored (const QChar &c)
QChar mirroredChar (const QChar &c)
QChar upper (const QChar &c)
QChar lower (const QChar &c)
bool isMark (const QChar &ch)
bool isSpace (const QChar &ch)

Variables

static const unsigned char uc_scripts []


Enumeration Type Documentation

anonymous enum

Definition at line 248 of file qunicodetables_p.h.

enum QUnicodeTables::LineBreakClass

Definition at line 58 of file qunicodetables_p.h.

enum QUnicodeTables::Script

Definition at line 189 of file qunicodetables_p.h.


Function Documentation

QChar::Category QUnicodeTables::category ( const QChar c  )  [inline]

Definition at line 84 of file qunicodetables_p.h.

References c, and category().

Referenced by calcLineBreaks(), QChar::isLower(), QChar::isUpper(), CharacterWidget::mousePressEvent(), Launcher::setup(), Launcher::showCategories(), and Launcher::showExamples().

00084                                                   {
00085         return category(c.unicode());
00086     }

Here is the call graph for this function:

Q_CORE_EXPORT QChar::Category QT_FASTCALL QUnicodeTables::category ( uint  ucs4  ) 

Definition at line 47 of file qunicodetables.cpp.

References QUnicodeTables::Properties::category, and qGetProp().

Referenced by arabicGroup(), QChar::category(), category(), QFontMetrics::charWidth(), Q3TextFormatterBreakWords::format(), hebrew_shape(), heuristicSetGlyphAttributes(), QChar::isDigit(), QChar::isLetter(), QChar::isLetterOrNumber(), isMark(), QChar::isMark(), QChar::isNumber(), QChar::isPrint(), QChar::isPunct(), isSpace(), QChar::isSymbol(), nextChar(), prevChar(), shapedString(), QFontMetrics::width(), and QFontMetricsF::width().

00048 {
00049     return (QChar::Category) qGetProp(ucs4)->category;
00050 }

Here is the call graph for this function:

unsigned char QUnicodeTables::combiningClass ( const QChar ch  )  [inline]

Definition at line 89 of file qunicodetables_p.h.

References combiningClass(), and QChar::unicode().

00089                                                          {
00090         return QUnicodeTables::combiningClass(ch.unicode());
00091     }

Here is the call graph for this function:

Q_CORE_EXPORT unsigned char QT_FASTCALL QUnicodeTables::combiningClass ( uint  ucs4  ) 

Definition at line 52 of file qunicodetables.cpp.

References QUnicodeTables::Properties::combiningClass, and qGetProp().

Referenced by canonicalOrder(), QChar::combiningClass(), combiningClass(), compose(), hebrew_shape(), and shapedString().

00053 {
00054     return (unsigned char) qGetProp(ucs4)->combiningClass;
00055 }

Here is the call graph for this function:

Q_CORE_EXPORT QString QT_FASTCALL QUnicodeTables::decomposition ( uint  ucs4  ) 

Definition at line 143 of file qunicodetables.cpp.

References buffer, d, QString::fromUtf16(), and length.

Referenced by QChar::decomposition().

00144 {
00145     unsigned short buffer[3];
00146     int length;
00147     int tag;
00148     const unsigned short *d = ::decomposition(ucs4, &length, &tag, buffer);
00149     return QString::fromUtf16(d, length);
00150 }

Here is the call graph for this function:

Q_CORE_EXPORT QChar::Decomposition QT_FASTCALL QUnicodeTables::decompositionTag ( uint  ucs4  ) 

Definition at line 152 of file qunicodetables.cpp.

References GET_DECOMPOSITION_INDEX, index, QChar::NoDecomposition, and uc_decomposition_map.

Referenced by QChar::decompositionTag().

00153 {
00154     const unsigned short index = GET_DECOMPOSITION_INDEX(ucs4);
00155     if (index == 0xffff)
00156         return QChar::NoDecomposition;
00157     return (QChar::Decomposition)(uc_decomposition_map[index] & 0xff);
00158 }

Q_CORE_EXPORT int QT_FASTCALL QUnicodeTables::digitValue ( uint  ucs4  ) 

Definition at line 77 of file qunicodetables.cpp.

References QUnicodeTables::Properties::digit_value, qGetProp(), and val.

Referenced by Calculator::digitClicked(), QChar::digitValue(), Q3FtpPI::readyRead(), QFtpPI::readyRead(), QString::replace(), and replaceArgEscapes().

00078 {
00079     int val = qGetProp(ucs4)->digit_value;
00080     return val == 0xf ? -1 : val;
00081 }

Here is the call graph for this function:

QChar::Direction QUnicodeTables::direction ( const QChar c  )  [inline]

Definition at line 93 of file qunicodetables_p.h.

References c, and direction().

00093                                                     {
00094         return QUnicodeTables::direction(c.unicode());
00095     }

Here is the call graph for this function:

Q_CORE_EXPORT QChar::Direction QT_FASTCALL QUnicodeTables::direction ( uint  ucs4  ) 

Definition at line 57 of file qunicodetables.cpp.

References QUnicodeTables::Properties::direction, and qGetProp().

Referenced by bidiItemize(), QChar::direction(), direction(), and QString::updateProperties().

00058 {
00059     return (QChar::Direction) qGetProp(ucs4)->direction;
00060 }

Here is the call graph for this function:

ushort QUnicodeTables::highSurrogate ( uint  ucs4  )  [inline]

Definition at line 70 of file qunicodetables_p.h.

Referenced by canonicalOrder(), and normalize().

00070                                            {
00071         return (ucs4>>10) + 0xd7c0;
00072     }

bool QUnicodeTables::isHighSurrogate ( uint  utf16  )  [inline]

Definition at line 76 of file qunicodetables_p.h.

Referenced by canonicalOrder(), compose(), and decompose().

00076                                             {
00077         return (utf16 >= 0xd800 && utf16 < 0xdc00);
00078     }

bool QUnicodeTables::isLowSurrogate ( uint  utf16  )  [inline]

Definition at line 79 of file qunicodetables_p.h.

Referenced by canonicalOrder(), compose(), and decompose().

00079                                            {
00080         return (utf16 >= 0xdc00 && utf16 < 0xe000);
00081     }

bool QUnicodeTables::isMark ( const QChar ch  )  [inline]

Definition at line 132 of file qunicodetables_p.h.

References c, category(), QChar::Mark_Enclosing, QChar::Mark_NonSpacing, and QChar::unicode().

00132                                         {
00133         QChar::Category c = QUnicodeTables::category(ch.unicode());
00134         return c >= QChar::Mark_NonSpacing && c <= QChar::Mark_Enclosing;
00135     }

Here is the call graph for this function:

bool QUnicodeTables::isSpace ( const QChar ch  )  [inline]

Definition at line 136 of file qunicodetables_p.h.

References c, category(), QChar::Separator_Paragraph, QChar::Separator_Space, and QChar::unicode().

Referenced by Q3TextEdit::contentsMouseDoubleClickEvent(), Qt::convertFromPlainText(), MessageModel::doCharCounting(), Q3Dns::doResInit(), Q3TextDocument::eatSpace(), QChar::isSpace(), Rpp::MacroFunctionParser::MacroFunctionParser(), Qt::mightBeRichText(), QTextCursorPrivate::movePosition(), QLocalePrivate::numberToCLocale(), QHttpHeader::parse(), Q3HttpHeader::parse(), Q3TextDocument::parseChar(), Q3TextDocument::parseHTMLSpecialChar(), parsePrinterDesc(), parsePrintersConf(), Q3TextDocument::parseWord(), qt_set_x11_resources(), qTrim(), and QString::trimmed().

00136                                          {
00137         if(ch.unicode() >= 9 && ch.unicode() <=13) return true;
00138         QChar::Category c = QUnicodeTables::category(ch.unicode());
00139         return c >= QChar::Separator_Space && c <= QChar::Separator_Paragraph;
00140     }

Here is the call graph for this function:

QChar::Joining QUnicodeTables::joining ( const QChar c  )  [inline]

Definition at line 109 of file qunicodetables_p.h.

References c, and joining().

00109                                                 {
00110         return QUnicodeTables::joining(c.unicode());
00111     }

Here is the call graph for this function:

Q_CORE_EXPORT QChar::Joining QT_FASTCALL QUnicodeTables::joining ( uint  ucs4  ) 

Definition at line 67 of file qunicodetables.cpp.

References QUnicodeTables::Properties::joining, and qGetProp().

Referenced by joining(), and QChar::joining().

00068 {
00069     return (QChar::Joining) qGetProp(ucs4)->joining;
00070 }

Here is the call graph for this function:

Q_CORE_EXPORT ushort QT_FASTCALL QUnicodeTables::ligature ( ushort  u1,
ushort  u2 
)

Definition at line 160 of file qunicodetables.cpp.

References GET_LIGATURE_INDEX, Hangul_LBase, Hangul_LCount, Hangul_SBase, Hangul_SCount, Hangul_TBase, Hangul_TCount, Hangul_VBase, Hangul_VCount, i, index, length, and uc_ligature_map.

Referenced by compose().

00161 {
00162     // hangul L-V pair
00163     int LIndex = u1 - Hangul_LBase;
00164     if (0 <= LIndex && LIndex < Hangul_LCount) {
00165         int VIndex = u2 - Hangul_VBase;
00166         if (0 <= VIndex && VIndex < Hangul_VCount)
00167             return Hangul_SBase + (LIndex * Hangul_VCount + VIndex) * Hangul_TCount;
00168     }
00169 
00170     // hangul LV-T pair
00171     int SIndex = u1 - Hangul_SBase;
00172     if (0 <= SIndex && SIndex < Hangul_SCount && (SIndex % Hangul_TCount) == 0) {
00173         int TIndex = u2 - Hangul_TBase;
00174         if (0 <= TIndex && TIndex <= Hangul_TCount)
00175             return u1 + TIndex;
00176     }
00177 
00178     const unsigned short index = GET_LIGATURE_INDEX(u2);
00179     if (index == 0xffff)
00180         return 0;
00181     const unsigned short *ligatures = uc_ligature_map+index;
00182     ushort length = *ligatures;
00183     ++ligatures;
00184     // ### use bsearch
00185     for (uint i = 0; i < length; ++i)
00186         if (ligatures[2*i] == u1)
00187             return ligatures[2*i+1];
00188     return 0;
00189 }

int QUnicodeTables::lineBreakClass ( const QChar ch  )  [inline]

Definition at line 98 of file qunicodetables_p.h.

References lineBreakClass(), and QChar::unicode().

00098                                                {
00099         return QUnicodeTables::lineBreakClass(ch.unicode());
00100     }

Here is the call graph for this function:

Q_CORE_EXPORT LineBreakClass QT_FASTCALL QUnicodeTables::lineBreakClass ( uint  ucs4  ) 

Definition at line 62 of file qunicodetables.cpp.

References QUnicodeTables::Properties::line_break_class, and qGetProp().

Referenced by lineBreakClass().

00063 {
00064     return (QUnicodeTables::LineBreakClass) qGetProp(ucs4)->line_break_class;
00065 }

Here is the call graph for this function:

QChar QUnicodeTables::lower ( const QChar c  )  [inline]

Definition at line 127 of file qunicodetables_p.h.

References c, and lower().

Referenced by Q3Dns::doResInit(), Q3Dns::setLabel(), and DocuParser320::startElement().

00127                                        {
00128         return QChar(QUnicodeTables::lower(c.unicode()));
00129     }

Here is the call graph for this function:

Q_CORE_EXPORT int QT_FASTCALL QUnicodeTables::lower ( uint  ucs4  ) 

Definition at line 101 of file qunicodetables.cpp.

References QChar::Letter_Titlecase, QChar::Letter_Uppercase, p, and qGetProp().

Referenced by bm_find(), bm_init_skiptable(), caseInsensitiveLessThan(), QString::compare(), QString::count(), QString::endsWith(), QString::indexOf(), QString::lastIndexOf(), lower(), QByteArray::qstricmp(), QByteArray::qstrnicmp(), QString::remove(), QString::replace(), QString::startsWith(), QChar::toLower(), QString::toLower(), QByteArray::toLower(), ucstricmp(), and ucstrnicmp().

00102 {
00103     const QUnicodeTables::Properties *p = qGetProp(ucs4);
00104     if (p->category == QChar::Letter_Uppercase || p->category == QChar::Letter_Titlecase)
00105         return ucs4 + p->caseDiff;
00106     return ucs4;
00107 }

Here is the call graph for this function:

ushort QUnicodeTables::lowSurrogate ( uint  ucs4  )  [inline]

Definition at line 73 of file qunicodetables_p.h.

Referenced by canonicalOrder(), and normalize().

00073                                           {
00074         return ucs4%0x400 + 0xdc00;
00075     }

bool QUnicodeTables::mirrored ( const QChar c  )  [inline]

Definition at line 114 of file qunicodetables_p.h.

References c, and mirrored().

Referenced by QFontEngineXLFD::stringToCMap(), and QFontEngineFT::stringToCMap().

00114                                          {
00115         return QUnicodeTables::mirrored(c.unicode());
00116     }

Here is the call graph for this function:

Q_CORE_EXPORT bool QT_FASTCALL QUnicodeTables::mirrored ( uint  ucs4  ) 

Definition at line 83 of file qunicodetables.cpp.

References QUnicodeTables::Properties::mirrorDiff, and qGetProp().

Referenced by QChar::hasMirrored(), and mirrored().

00084 {
00085     return qGetProp(ucs4)->mirrorDiff != 0;
00086 }

Here is the call graph for this function:

QChar QUnicodeTables::mirroredChar ( const QChar c  )  [inline]

Definition at line 118 of file qunicodetables_p.h.

References c, and mirroredChar().

00118                                               {
00119         return QUnicodeTables::mirroredChar(c.unicode());
00120     }

Here is the call graph for this function:

Q_CORE_EXPORT int QT_FASTCALL QUnicodeTables::mirroredChar ( uint  ucs4  ) 

Definition at line 88 of file qunicodetables.cpp.

References QUnicodeTables::Properties::mirrorDiff, and qGetProp().

Referenced by QChar::mirroredChar(), mirroredChar(), shapedString(), QFontEngineXLFD::stringToCMap(), and QFontEngineFT::stringToCMap().

00089 {
00090     return ucs4 + qGetProp(ucs4)->mirrorDiff;
00091 }

Here is the call graph for this function:

Q_CORE_EXPORT QString QUnicodeTables::normalize ( const QString str,
QString::NormalizationForm  mode,
QChar::UnicodeVersion  version 
)

Definition at line 338 of file qunicodetables.cpp.

References CURRENT_VERSION, highSurrogate(), i, lowSurrogate(), n, NumNormalizationCorrections, s, and uc_normalization_corrections.

00339 {
00340     QString s = str;
00341     if (version != CURRENT_VERSION) {
00342         for (int i = 0; i < NumNormalizationCorrections; ++i) {
00343             const NormalizationCorrection n = uc_normalization_corrections[i];
00344             if (n.version > version) {
00345                 QString orig;
00346                 orig += QChar(highSurrogate(n.ucs4));
00347                 orig += QChar(lowSurrogate(n.ucs4));
00348                 QString replacement;
00349                 replacement += QChar(highSurrogate(n.old_mapping));
00350                 replacement += QChar(lowSurrogate(n.old_mapping));
00351                 s.replace(orig, replacement);
00352             }
00353         }
00354     }
00355     s = decompose(s, mode < QString::NormalizationForm_KD, version);
00356 
00357     s = canonicalOrder(s, version);
00358 
00359     if (mode == QString::NormalizationForm_D || mode == QString::NormalizationForm_KD)
00360         return s;
00361 
00362     return compose(s);
00363 
00364 }

Here is the call graph for this function:

Q_CORE_EXPORT QString QUnicodeTables::normalize ( const QString str,
QString::NormalizationForm  mode 
)

Definition at line 333 of file qunicodetables.cpp.

References CURRENT_VERSION.

Referenced by QFileDialog::getExistingDirectory(), Q3FileDialog::getExistingDirectory(), QFileDialog::getOpenFileName(), Q3FileDialog::getOpenFileName(), Q3FileDialog::getOpenFileNames(), QFileDialog::getOpenFileNames(), Q3FileDialog::getSaveFileName(), QFileDialog::getSaveFileName(), locale_decode(), QString::normalized(), and qt_nameprep().

00334 {
00335     return normalize(str, mode, CURRENT_VERSION);
00336 }

Q_CORE_EXPORT const Properties *QT_FASTCALL QUnicodeTables::properties ( uint  ucs4  ) 

Definition at line 41 of file qunicodetables.cpp.

References GET_PROP_INDEX, index, and uc_properties.

Referenced by calcLineBreaks(), and heuristicSetGlyphAttributes().

00042 {
00043     int index = GET_PROP_INDEX(ucs4);
00044     return uc_properties + index;
00045 }

Q_CORE_EXPORT_INLINE int QT_FASTCALL QUnicodeTables::script ( const QChar ch  ) 

Definition at line 103 of file qunicodetables_p.h.

References script(), and QChar::unicode().

Referenced by QTextEngine::attributes(), QFontMetricsF::boundingRect(), QFontMetrics::boundingRect(), QFontMetrics::charWidth(), QTextEngine::fontEngine(), indic_shape_syllable(), QFontMetricsF::inFont(), QFontMetrics::inFont(), QFontMetricsF::leftBearing(), QFontMetrics::leftBearing(), load(), QFontEngineMultiFT::loadEngine(), qAppendItems(), QFontMetrics::rightBearing(), QFontMetricsF::rightBearing(), QFontMetrics::width(), and QFontMetricsF::width().

00103                                                                  {
00104         return script(ch.unicode());
00105     }

Here is the call graph for this function:

Q_CORE_EXPORT int QT_FASTCALL QUnicodeTables::script ( uint  ucs4  ) 

int QUnicodeTables::script ( unsigned int  uc  ) 

Definition at line 366 of file qunicodetables.cpp.

References ScriptSentinel, uc_scripts, UnicodeBlockCount, and UnicodeBlockSize.

Referenced by QTextEngine::attributes(), QFontMetricsF::boundingRect(), QFontMetrics::boundingRect(), QFontMetrics::charWidth(), QFontMetricsF::inFont(), QFontMetrics::inFont(), QFontMetricsF::leftBearing(), QFontMetrics::leftBearing(), qAppendItems(), QFontMetrics::rightBearing(), QFontMetricsF::rightBearing(), script(), QFontMetrics::width(), and QFontMetricsF::width().

00367 {
00368     if (uc > 0xffff)
00369         return Common;
00370     int script = uc_scripts[uc >> 7];
00371     if (script < ScriptSentinel)
00372         return script;
00373     script = (((script - ScriptSentinel) * UnicodeBlockSize) + UnicodeBlockCount);
00374     script = uc_scripts[script + (uc & 0x7f)];
00375     return script;
00376 }

uint QUnicodeTables::surrogateToUcs4 ( ushort  high,
ushort  low 
) [inline]

Definition at line 67 of file qunicodetables_p.h.

Referenced by canonicalOrder(), compose(), and decompose().

00067                                                          {
00068         return (high<<10) + low - 0x35fdc00;
00069     }

Q_CORE_EXPORT QChar::UnicodeVersion QT_FASTCALL QUnicodeTables::unicodeVersion ( uint  ucs4  ) 

Definition at line 72 of file qunicodetables.cpp.

References qGetProp(), and QUnicodeTables::Properties::unicode_version.

Referenced by canonicalOrder(), decompose(), and QChar::unicodeVersion().

00073 {
00074     return (QChar::UnicodeVersion) qGetProp(ucs4)->unicode_version;
00075 }

Here is the call graph for this function:

QChar QUnicodeTables::upper ( const QChar c  )  [inline]

Definition at line 122 of file qunicodetables_p.h.

References c, and upper().

Referenced by getFmtString().

00122                                        {
00123         return QChar(QUnicodeTables::upper(c.unicode()));
00124     }

Here is the call graph for this function:

Q_CORE_EXPORT int QT_FASTCALL QUnicodeTables::upper ( uint  ucs4  ) 

Definition at line 93 of file qunicodetables.cpp.

References QChar::Letter_Lowercase, p, and qGetProp().

Referenced by QString::toUpper(), QByteArray::toUpper(), QChar::toUpper(), and upper().

00094 {
00095     const QUnicodeTables::Properties *p = qGetProp(ucs4);
00096     if (p->category == QChar::Letter_Lowercase)
00097         return ucs4 + p->caseDiff;
00098     return ucs4;
00099 }

Here is the call graph for this function:


Variable Documentation

const unsigned char QUnicodeTables::uc_scripts[] [static]

Definition at line 7033 of file qunicodedata.cpp.

Referenced by script().


Generated on Thu Mar 15 20:52:05 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1