io.qt.core.QTextBoundaryFinder Maven / Gradle / Ivy
Show all versions of qtjambi Show documentation
package io.qt.core;
import io.qt.*;
/**
* Way of finding Unicode text boundaries in a string
* Java wrapper for Qt class QTextBoundaryFinder
*/
public class QTextBoundaryFinder extends QtObject
implements java.lang.Cloneable
{
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* Java wrapper for Qt enum QTextBoundaryFinder::BoundaryReason
*
* @see BoundaryReasons
*/
public enum BoundaryReason implements QtFlagEnumerator {
/**
* Representing QTextBoundaryFinder:: NotAtBoundary
*/
NotAtBoundary(0),
/**
* Representing QTextBoundaryFinder:: BreakOpportunity
*/
BreakOpportunity(31),
/**
* Representing QTextBoundaryFinder:: StartOfItem
*/
StartOfItem(32),
/**
* Representing QTextBoundaryFinder:: EndOfItem
*/
EndOfItem(64),
/**
* Representing QTextBoundaryFinder:: MandatoryBreak
*/
MandatoryBreak(128),
/**
* Representing QTextBoundaryFinder:: SoftHyphen
*/
SoftHyphen(256);
static {
QtJambi_LibraryUtilities.initialize();
}
private BoundaryReason(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
public int value() {
return value;
}
/**
* Create a QFlags of the enum entry.
* @return QFlags
*/
public @NonNull BoundaryReasons asFlags() {
return new BoundaryReasons(value);
}
/**
* Combines this entry with other enum entry.
* @param e enum entry
* @return new flag
*/
public @NonNull BoundaryReasons combined(@NonNull BoundaryReason e) {
return asFlags().setFlag(e, true);
}
/**
* Excludes other enum entry from a flag of this entry.
* @param e enum entry
* @return new flag
*/
public @NonNull BoundaryReasons cleared(@NonNull BoundaryReason e) {
return asFlags().setFlag(e, false);
}
/**
* Creates a new {@link BoundaryReasons} from the entries.
* @param values entries
* @return new flag
*/
public static @NonNull BoundaryReasons flags(@Nullable BoundaryReason @NonNull... values) {
return new BoundaryReasons(values);
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static @NonNull BoundaryReason resolve(int value) {
switch (value) {
case 0: return NotAtBoundary;
case 31: return BreakOpportunity;
case 32: return StartOfItem;
case 64: return EndOfItem;
case 128: return MandatoryBreak;
case 256: return SoftHyphen;
default: throw new QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* {@link QFlags} type for enum {@link BoundaryReason}
*/
public static final class BoundaryReasons extends QFlags implements Comparable {
private static final long serialVersionUID = 0x4e12944fa8d67624L;
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* Creates a new BoundaryReasons where the flags in args
are set.
* @param args enum entries
*/
public BoundaryReasons(@Nullable BoundaryReason @NonNull... args){
super(args);
}
/**
* Creates a new BoundaryReasons with given value
.
* @param value
*/
public BoundaryReasons(int value) {
super(value);
}
/**
* Combines this flags with enum entry.
* @param e enum entry
* @return new BoundaryReasons
*/
@Override
public final @NonNull BoundaryReasons combined(@StrictNonNull BoundaryReason e){
return new BoundaryReasons(value() | e.value());
}
/**
* Sets the flag e
* @param e enum entry
* @return this
*/
public final @NonNull BoundaryReasons setFlag(@Nullable BoundaryReason e){
return setFlag(e, true);
}
/**
* Sets or clears the flag flag
* @param e enum entry
* @param on set (true) or clear (false)
* @return this
*/
public final @NonNull BoundaryReasons setFlag(@Nullable BoundaryReason e, boolean on){
if (on) {
setValue(value() | e.value());
}else {
setValue(value() & ~e.value());
}
return this;
}
/**
* Returns an array of flag objects represented by this BoundaryReasons.
* @return array of enum entries
*/
@Override
public final @NonNull BoundaryReason @NonNull[] flags(){
return super.flags(BoundaryReason.values());
}
/**
* {@inheritDoc}
*/
@Override
public final @NonNull BoundaryReasons clone(){
return new BoundaryReasons(value());
}
/**
* {@inheritDoc}
*/
@Override
public final int compareTo(@StrictNonNull BoundaryReasons other){
return Integer.compare(value(), other.value());
}
}
/**
* Java wrapper for Qt enum QTextBoundaryFinder::BoundaryType
*/
public enum BoundaryType implements QtEnumerator {
/**
* Representing QTextBoundaryFinder:: Grapheme
*/
Grapheme(0),
/**
* Representing QTextBoundaryFinder:: Word
*/
Word(1),
/**
* Representing QTextBoundaryFinder:: Sentence
*/
Sentence(2),
/**
* Representing QTextBoundaryFinder:: Line
*/
Line(3);
static {
QtJambi_LibraryUtilities.initialize();
}
private BoundaryType(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
public int value() {
return value;
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static @NonNull BoundaryType resolve(int value) {
switch (value) {
case 0: return Grapheme;
case 1: return Word;
case 2: return Sentence;
case 3: return Line;
default: throw new QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* See QTextBoundaryFinder:: QTextBoundaryFinder()
*/
public QTextBoundaryFinder(){
super((QPrivateConstructor)null);
initialize_native(this);
}
private native static void initialize_native(QTextBoundaryFinder instance);
/**
* See QTextBoundaryFinder:: QTextBoundaryFinder(QTextBoundaryFinder)
*/
public QTextBoundaryFinder(io.qt.core.@NonNull QTextBoundaryFinder other){
super((QPrivateConstructor)null);
initialize_native(this, other);
}
private native static void initialize_native(QTextBoundaryFinder instance, io.qt.core.QTextBoundaryFinder other);
/**
* See QTextBoundaryFinder:: QTextBoundaryFinder(QTextBoundaryFinder::BoundaryType, QString)
*/
public QTextBoundaryFinder(io.qt.core.QTextBoundaryFinder.@NonNull BoundaryType type, java.lang.@NonNull String string){
super((QPrivateConstructor)null);
initialize_native(this, type, string);
}
private native static void initialize_native(QTextBoundaryFinder instance, io.qt.core.QTextBoundaryFinder.BoundaryType type, java.lang.String string);
/**
* See QTextBoundaryFinder:: boundaryReasons()const
*/
@QtUninvokable
public final io.qt.core.QTextBoundaryFinder.@NonNull BoundaryReasons boundaryReasons(){
return new io.qt.core.QTextBoundaryFinder.BoundaryReasons(boundaryReasons_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@QtUninvokable
private native int boundaryReasons_native_constfct(long __this__nativeId);
/**
* See QTextBoundaryFinder:: isAtBoundary()const
*/
@QtUninvokable
public final boolean isAtBoundary(){
return isAtBoundary_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean isAtBoundary_native_constfct(long __this__nativeId);
/**
* See QTextBoundaryFinder:: isValid()const
*/
@QtUninvokable
public final boolean isValid(){
return isValid_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean isValid_native_constfct(long __this__nativeId);
/**
* See QTextBoundaryFinder:: operator=(QTextBoundaryFinder)
*/
@QtUninvokable
public final void assign(io.qt.core.@NonNull QTextBoundaryFinder other){
assign_native_cref_QTextBoundaryFinder(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(other));
}
@QtUninvokable
private native void assign_native_cref_QTextBoundaryFinder(long __this__nativeId, long other);
/**
* See QTextBoundaryFinder:: position()const
*/
@QtUninvokable
public final long position(){
return position_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native long position_native_constfct(long __this__nativeId);
/**
* See QTextBoundaryFinder:: setPosition(qsizetype)
*/
@QtUninvokable
public final void setPosition(long position){
setPosition_native_qsizetype(QtJambi_LibraryUtilities.internal.nativeId(this), position);
}
@QtUninvokable
private native void setPosition_native_qsizetype(long __this__nativeId, long position);
/**
* See QTextBoundaryFinder:: string()const
*/
@QtUninvokable
public final java.lang.@NonNull String string(){
return string_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native java.lang.String string_native_constfct(long __this__nativeId);
/**
* See QTextBoundaryFinder:: toEnd()
*/
@QtUninvokable
public final void toEnd(){
toEnd_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native void toEnd_native(long __this__nativeId);
/**
* See QTextBoundaryFinder:: toNextBoundary()
*/
@QtUninvokable
public final long toNextBoundary(){
return toNextBoundary_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native long toNextBoundary_native(long __this__nativeId);
/**
* See QTextBoundaryFinder:: toPreviousBoundary()
*/
@QtUninvokable
public final long toPreviousBoundary(){
return toPreviousBoundary_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native long toPreviousBoundary_native(long __this__nativeId);
/**
* See QTextBoundaryFinder:: toStart()
*/
@QtUninvokable
public final void toStart(){
toStart_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native void toStart_native(long __this__nativeId);
/**
* See QTextBoundaryFinder:: type()const
*/
@QtUninvokable
public final io.qt.core.QTextBoundaryFinder.@NonNull BoundaryType type(){
return io.qt.core.QTextBoundaryFinder.BoundaryType.resolve(type_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@QtUninvokable
private native int type_native_constfct(long __this__nativeId);
/**
* Constructor for internal use only.
* @param p expected to be null
.
* @hidden
*/
@NativeAccess
protected QTextBoundaryFinder(QPrivateConstructor p) { super(p); }
/**
* Creates and returns a copy of this object.
See QTextBoundaryFinder:: QTextBoundaryFinder(QTextBoundaryFinder)
*/
@QtUninvokable
@Override
public QTextBoundaryFinder clone() {
return clone_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
private static native QTextBoundaryFinder clone_native(long __this_nativeId);
}