41 #include <QtCore/qtextboundaryfinder.h> 42 #include <QtCore/qvarlengtharray.h> 43 #include <private/qunicodetables_p.h> 45 #include "private/qharfbuzz_p.h" 59 const ushort *
string =
reinterpret_cast<const ushort *
>(chars);
60 const ushort *unicode = string;
62 const ushort *uc = unicode;
63 const ushort *e = uc + length;
73 if (script != lastScript) {
76 item.pos = start - string;
77 item.length = uc - start;
78 item.script = (HB_Script)lastScript;
89 item.pos = start - string;
90 item.length = uc - start;
91 item.script = (HB_Script)lastScript;
100 HB_GetSentenceBoundaries(
string, length, scriptItems.
data(), scriptItems.
count(),
attributes);
189 memcpy(
d, other.
d,
length*
sizeof(HB_CharAttributes));
211 memcpy(d, other.
d,
length*
sizeof(HB_CharAttributes));
231 ,
chars(string.unicode())
260 if (buffer && (
uint)bufferSize >= length*
sizeof(HB_CharAttributes)) {
358 if (pos < 0 || pos >=
length) {
368 while (pos < length && !d->attributes[
pos].charStop)
372 while (pos < length && !d->attributes[
pos].wordBoundary)
376 while (pos < length && !d->attributes[
pos].sentenceBoundary)
381 while (pos < length && d->attributes[
pos-1].lineBreakType < HB_Break)
401 if (pos <= 0 || pos >
length) {
478 if (prevIsSpace && !nextIsSpace)
480 else if (!prevIsSpace && nextIsSpace)
482 else if (!prevIsSpace && !nextIsSpace)
#define QT_END_NAMESPACE
This macro expands to.
void toStart()
Moves the finder to the start of the string.
int length() const
Returns the number of characters in this string.
QTextBoundaryFinderPrivate * d
int toPreviousBoundary()
Moves the QTextBoundaryFinder to the previous boundary position and returns that position.
QTextBoundaryFinder()
Constructs an invalid QTextBoundaryFinder object.
void toEnd()
Moves the finder to the end of the string.
The QString class provides a Unicode character string.
int position() const
Returns the current position of the QTextBoundaryFinder.
The QChar class provides a 16-bit Unicode character.
QString string() const
Returns the string the QTextBoundaryFinder object operates on.
static void init(QTextBoundaryFinder::BoundaryType type, const QChar *chars, int length, HB_CharAttributes *attributes)
#define QT_BEGIN_NAMESPACE
This macro expands to.
BoundaryReasons boundaryReasons() const
Returns the reasons for the boundary finder to have chosen the current position as a boundary...
const QChar * unicode() const
Returns a '\0'-terminated Unicode representation of the string.
void setPosition(int position)
Sets the current position of the QTextBoundaryFinder to position.
BoundaryType type() const
Returns the type of the QTextBoundaryFinder.
Q_CORE_EXPORT int QT_FASTCALL script(uint ucs4)
bool isAtBoundary() const
Returns true if the object's position() is currently at a valid text boundary.
QTextBoundaryFinder & operator=(const QTextBoundaryFinder &other)
Assigns the object, other, to another QTextBoundaryFinder object.
int toNextBoundary()
Moves the QTextBoundaryFinder to the next boundary position and returns that position.
Q_DECL_CONSTEXPR const T & qBound(const T &min, const T &val, const T &max)
~QTextBoundaryFinder()
Destructs the QTextBoundaryFinder object.
void qGetCharAttributes(const HB_UChar16 *string, hb_uint32 stringLength, const HB_ScriptItem *items, hb_uint32 numItems, HB_CharAttributes *attributes)
The QTextBoundaryFinder class provides a way of finding Unicode text boundaries in a string...
HB_CharAttributes attributes[1]