#[repr(C)]
pub struct QTextBoundaryFinder { /* private fields */ }
Expand description

The QTextBoundaryFinder class provides a way of finding Unicode text boundaries in a string.

C++ class: QTextBoundaryFinder.

C++ documentation:

The QTextBoundaryFinder class provides a way of finding Unicode text boundaries in a string.

QTextBoundaryFinder allows to find Unicode text boundaries in a string, accordingly to the Unicode text boundary specification (see Unicode Standard Annex #14 and Unicode Standard Annex #29).

QTextBoundaryFinder can operate on a QString in four possible modes depending on the value of BoundaryType.

Units of Unicode characters that make up what the user thinks of as a character or basic unit of the language are here called Grapheme clusters. The two unicode characters 'A' + diaeresis do for example form one grapheme cluster as the user thinks of them as one character, yet it is in this case represented by two unicode code points (see http://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries).

Word boundaries are there to locate the start and end of what a language considers to be a word (see http://www.unicode.org/reports/tr29/#Word_Boundaries).

Line break boundaries give possible places where a line break might happen and sentence boundaries will show the beginning and end of whole sentences (see http://www.unicode.org/reports/tr29/#Sentence_Boundaries and http://www.unicode.org/reports/tr14/).

The first position in a string is always a valid boundary and refers to the position before the first character. The last position at the length of the string is also valid and refers to the position after the last character.

Implementations§

source§

impl QTextBoundaryFinder

source

pub unsafe fn boundary_reasons(&self) -> QFlags<BoundaryReason>

Returns the reasons for the boundary finder to have chosen the current position as a boundary.

Calls C++ function: QFlags<QTextBoundaryFinder::BoundaryReason> QTextBoundaryFinder::boundaryReasons() const.

C++ documentation:

Returns the reasons for the boundary finder to have chosen the current position as a boundary.

source

pub unsafe fn copy_from( &self, other: impl CastInto<Ref<QTextBoundaryFinder>> ) -> Ref<QTextBoundaryFinder>

Assigns the object, other, to another QTextBoundaryFinder object.

Calls C++ function: QTextBoundaryFinder& QTextBoundaryFinder::operator=(const QTextBoundaryFinder& other).

C++ documentation:

Assigns the object, other, to another QTextBoundaryFinder object.

source

pub unsafe fn is_at_boundary(&self) -> bool

Returns true if the object's position() is currently at a valid text boundary.

Calls C++ function: bool QTextBoundaryFinder::isAtBoundary() const.

C++ documentation:

Returns true if the object’s position() is currently at a valid text boundary.

source

pub unsafe fn is_valid(&self) -> bool

Returns true if the text boundary finder is valid; otherwise returns false. A default QTextBoundaryFinder is invalid.

Calls C++ function: bool QTextBoundaryFinder::isValid() const.

C++ documentation:

Returns true if the text boundary finder is valid; otherwise returns false. A default QTextBoundaryFinder is invalid.

source

pub unsafe fn new_0a() -> CppBox<QTextBoundaryFinder>

Constructs an invalid QTextBoundaryFinder object.

Calls C++ function: [constructor] void QTextBoundaryFinder::QTextBoundaryFinder().

C++ documentation:

Constructs an invalid QTextBoundaryFinder object.

source

pub unsafe fn new_2a( type_: BoundaryType, string: impl CastInto<Ref<QString>> ) -> CppBox<QTextBoundaryFinder>

Creates a QTextBoundaryFinder object of type operating on string.

Calls C++ function: [constructor] void QTextBoundaryFinder::QTextBoundaryFinder(QTextBoundaryFinder::BoundaryType type, const QString& string).

C++ documentation:

Creates a QTextBoundaryFinder object of type operating on string.

source

pub unsafe fn new_5a( type_: BoundaryType, chars: impl CastInto<Ptr<QChar>>, length: c_int, buffer: *mut c_uchar, buffer_size: c_int ) -> CppBox<QTextBoundaryFinder>

Creates a QTextBoundaryFinder object of type operating on chars with length.

Calls C++ function: [constructor] void QTextBoundaryFinder::QTextBoundaryFinder(QTextBoundaryFinder::BoundaryType type, const QChar* chars, int length, unsigned char* buffer = …, int bufferSize = …).

C++ documentation:

Creates a QTextBoundaryFinder object of type operating on chars with length.

buffer is an optional working buffer of size bufferSize you can pass to the QTextBoundaryFinder. If the buffer is large enough to hold the working data required (bufferSize >= length + 1), it will use this instead of allocating its own buffer.

Warning: QTextBoundaryFinder does not create a copy of chars. It is the application programmer's responsibility to ensure the array is allocated for as long as the QTextBoundaryFinder object stays alive. The same applies to buffer.

source

pub unsafe fn new_4a( type_: BoundaryType, chars: impl CastInto<Ptr<QChar>>, length: c_int, buffer: *mut c_uchar ) -> CppBox<QTextBoundaryFinder>

Creates a QTextBoundaryFinder object of type operating on chars with length.

Calls C++ function: [constructor] void QTextBoundaryFinder::QTextBoundaryFinder(QTextBoundaryFinder::BoundaryType type, const QChar* chars, int length, unsigned char* buffer = …).

C++ documentation:

Creates a QTextBoundaryFinder object of type operating on chars with length.

buffer is an optional working buffer of size bufferSize you can pass to the QTextBoundaryFinder. If the buffer is large enough to hold the working data required (bufferSize >= length + 1), it will use this instead of allocating its own buffer.

Warning: QTextBoundaryFinder does not create a copy of chars. It is the application programmer's responsibility to ensure the array is allocated for as long as the QTextBoundaryFinder object stays alive. The same applies to buffer.

source

pub unsafe fn new_3a( type_: BoundaryType, chars: impl CastInto<Ptr<QChar>>, length: c_int ) -> CppBox<QTextBoundaryFinder>

Creates a QTextBoundaryFinder object of type operating on chars with length.

Calls C++ function: [constructor] void QTextBoundaryFinder::QTextBoundaryFinder(QTextBoundaryFinder::BoundaryType type, const QChar* chars, int length).

C++ documentation:

Creates a QTextBoundaryFinder object of type operating on chars with length.

buffer is an optional working buffer of size bufferSize you can pass to the QTextBoundaryFinder. If the buffer is large enough to hold the working data required (bufferSize >= length + 1), it will use this instead of allocating its own buffer.

Warning: QTextBoundaryFinder does not create a copy of chars. It is the application programmer's responsibility to ensure the array is allocated for as long as the QTextBoundaryFinder object stays alive. The same applies to buffer.

source

pub unsafe fn new_copy( other: impl CastInto<Ref<QTextBoundaryFinder>> ) -> CppBox<QTextBoundaryFinder>

Copies the QTextBoundaryFinder object, other.

Calls C++ function: [constructor] void QTextBoundaryFinder::QTextBoundaryFinder(const QTextBoundaryFinder& other).

C++ documentation:

Copies the QTextBoundaryFinder object, other.

source

pub unsafe fn position(&self) -> c_int

Returns the current position of the QTextBoundaryFinder.

Calls C++ function: int QTextBoundaryFinder::position() const.

C++ documentation:

Returns the current position of the QTextBoundaryFinder.

The range is from 0 (the beginning of the string) to the length of the string inclusive.

See also setPosition().

source

pub unsafe fn set_position(&self, position: c_int)

Sets the current position of the QTextBoundaryFinder to position.

Calls C++ function: void QTextBoundaryFinder::setPosition(int position).

C++ documentation:

Sets the current position of the QTextBoundaryFinder to position.

If position is out of bounds, it will be bound to only valid positions. In this case, valid positions are from 0 to the length of the string inclusive.

See also position().

source

pub unsafe fn string(&self) -> CppBox<QString>

Returns the string the QTextBoundaryFinder object operates on.

Calls C++ function: QString QTextBoundaryFinder::string() const.

C++ documentation:

Returns the string the QTextBoundaryFinder object operates on.

source

pub unsafe fn to_end(&self)

Moves the finder to the end of the string. This is equivalent to setPosition(string.length()).

Calls C++ function: void QTextBoundaryFinder::toEnd().

C++ documentation:

Moves the finder to the end of the string. This is equivalent to setPosition(string.length()).

See also setPosition() and position().

source

pub unsafe fn to_next_boundary(&self) -> c_int

Moves the QTextBoundaryFinder to the next boundary position and returns that position.

Calls C++ function: int QTextBoundaryFinder::toNextBoundary().

C++ documentation:

Moves the QTextBoundaryFinder to the next boundary position and returns that position.

Returns -1 if there is no next boundary.

source

pub unsafe fn to_previous_boundary(&self) -> c_int

Moves the QTextBoundaryFinder to the previous boundary position and returns that position.

Calls C++ function: int QTextBoundaryFinder::toPreviousBoundary().

C++ documentation:

Moves the QTextBoundaryFinder to the previous boundary position and returns that position.

Returns -1 if there is no previous boundary.

source

pub unsafe fn to_start(&self)

Moves the finder to the start of the string. This is equivalent to setPosition(0).

Calls C++ function: void QTextBoundaryFinder::toStart().

C++ documentation:

Moves the finder to the start of the string. This is equivalent to setPosition(0).

See also setPosition() and position().

source

pub unsafe fn type_(&self) -> BoundaryType

Returns the type of the QTextBoundaryFinder.

Calls C++ function: QTextBoundaryFinder::BoundaryType QTextBoundaryFinder::type() const.

C++ documentation:

Returns the type of the QTextBoundaryFinder.

Trait Implementations§

source§

impl CppDeletable for QTextBoundaryFinder

source§

unsafe fn delete(&self)

Destructs the QTextBoundaryFinder object.

Calls C++ function: [destructor] void QTextBoundaryFinder::~QTextBoundaryFinder().

C++ documentation:

Destructs the QTextBoundaryFinder object.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, U> CastInto<U> for T
where U: CastFrom<T>,

source§

unsafe fn cast_into(self) -> U

Performs the conversion. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> StaticUpcast<T> for T

source§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.