io.qt.gui.QTextLine Maven / Gradle / Ivy
Show all versions of qtjambi Show documentation
package io.qt.gui;
import io.qt.*;
/**
* Represents a line of text inside a QTextLayout
* Java wrapper for Qt class QTextLine
*/
public class QTextLine extends QtObject
implements java.lang.Cloneable
{
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* Java wrapper for Qt enum QTextLine::CursorPosition
*/
public enum CursorPosition implements QtEnumerator {
/**
* Representing QTextLine:: CursorBetweenCharacters
*/
CursorBetweenCharacters(0),
/**
* Representing QTextLine:: CursorOnCharacter
*/
CursorOnCharacter(1);
static {
QtJambi_LibraryUtilities.initialize();
}
private CursorPosition(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 CursorPosition resolve(int value) {
switch (value) {
case 0: return CursorBetweenCharacters;
case 1: return CursorOnCharacter;
default: throw new QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* Java wrapper for Qt enum QTextLine::Edge
*/
public enum Edge implements QtEnumerator {
/**
* Representing QTextLine:: Leading
*/
Leading(0),
/**
* Representing QTextLine:: Trailing
*/
Trailing(1);
static {
QtJambi_LibraryUtilities.initialize();
}
private Edge(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 Edge resolve(int value) {
switch (value) {
case 0: return Leading;
case 1: return Trailing;
default: throw new QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
*
*/
public QTextLine(){
super((QPrivateConstructor)null);
initialize_native(this);
}
private native static void initialize_native(QTextLine instance);
/**
* See QTextLine:: QTextLine(QTextLine)
*/
public QTextLine(io.qt.gui.@NonNull QTextLine other){
super((QPrivateConstructor)null);
initialize_native(this, other);
}
private native static void initialize_native(QTextLine instance, io.qt.gui.QTextLine other);
/**
*
*/
@QtUninvokable
public final double ascent(){
return ascent_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native double ascent_native_constfct(long __this__nativeId);
/**
*
*/
@QtUninvokable
public final double descent(){
return descent_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native double descent_native_constfct(long __this__nativeId);
/**
* See QTextLine:: draw(QPainter*, QPointF)const
*/
@QtUninvokable
public final void draw(io.qt.gui.@Nullable QPainter painter, io.qt.core.@NonNull QPointF position){
draw_native_QPainter_ptr_cref_QPointF_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(painter), QtJambi_LibraryUtilities.internal.checkedNativeId(position));
}
@QtUninvokable
private native void draw_native_QPainter_ptr_cref_QPointF_constfct(long __this__nativeId, long painter, long position);
/**
* See QTextLine:: glyphRuns(int, int)const
*/
@QtUninvokable
public final io.qt.core.@NonNull QList glyphRuns(int from, int length){
return glyphRuns_native_int_int_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), from, length);
}
@QtUninvokable
private native io.qt.core.QList glyphRuns_native_int_int_constfct(long __this__nativeId, int from, int length);
/**
* See QTextLine:: glyphRuns(int, int, QTextLayout::GlyphRunRetrievalFlags)const
*/
@QtUninvokable
public final io.qt.core.@NonNull QList glyphRuns(int from, int length, io.qt.gui.QTextLayout.@NonNull GlyphRunRetrievalFlags flags){
return glyphRuns_native_int_int_QTextLayout_GlyphRunRetrievalFlags_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), from, length, flags.value());
}
@QtUninvokable
private native io.qt.core.QList glyphRuns_native_int_int_QTextLayout_GlyphRunRetrievalFlags_constfct(long __this__nativeId, int from, int length, int flags);
/**
*
*/
@QtUninvokable
public final double height(){
return height_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native double height_native_constfct(long __this__nativeId);
/**
* See QTextLine:: horizontalAdvance()const
*/
@QtUninvokable
public final double horizontalAdvance(){
return horizontalAdvance_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native double horizontalAdvance_native_constfct(long __this__nativeId);
/**
*
*/
@QtUninvokable
public final boolean isValid(){
return isValid_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean isValid_native_constfct(long __this__nativeId);
/**
*
*/
@QtUninvokable
public final double leading(){
return leading_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native double leading_native_constfct(long __this__nativeId);
/**
* See QTextLine:: leadingIncluded()const
*/
@QtUninvokable
public final boolean leadingIncluded(){
return leadingIncluded_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean leadingIncluded_native_constfct(long __this__nativeId);
/**
* See QTextLine:: lineNumber()const
*/
@QtUninvokable
public final int lineNumber(){
return lineNumber_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native int lineNumber_native_constfct(long __this__nativeId);
/**
* See QTextLine:: naturalTextRect()const
*/
@QtUninvokable
public final io.qt.core.@NonNull QRectF naturalTextRect(){
return naturalTextRect_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.core.QRectF naturalTextRect_native_constfct(long __this__nativeId);
/**
* See QTextLine:: naturalTextWidth()const
*/
@QtUninvokable
public final double naturalTextWidth(){
return naturalTextWidth_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native double naturalTextWidth_native_constfct(long __this__nativeId);
/**
* See QTextLine:: position()const
*/
@QtUninvokable
public final io.qt.core.@NonNull QPointF position(){
return position_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.core.QPointF position_native_constfct(long __this__nativeId);
/**
*
*/
@QtUninvokable
public final io.qt.core.@NonNull QRectF rect(){
return rect_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.core.QRectF rect_native_constfct(long __this__nativeId);
/**
* See QTextLine:: setLeadingIncluded(bool)
*/
@QtUninvokable
public final void setLeadingIncluded(boolean included){
setLeadingIncluded_native_bool(QtJambi_LibraryUtilities.internal.nativeId(this), included);
}
@QtUninvokable
private native void setLeadingIncluded_native_bool(long __this__nativeId, boolean included);
/**
* See QTextLine:: setLineWidth(qreal)
*/
@QtUninvokable
public final void setLineWidth(double width){
setLineWidth_native_qreal(QtJambi_LibraryUtilities.internal.nativeId(this), width);
}
@QtUninvokable
private native void setLineWidth_native_qreal(long __this__nativeId, double width);
/**
* See QTextLine:: setNumColumns(int)
*/
@QtUninvokable
public final void setNumColumns(int columns){
setNumColumns_native_int(QtJambi_LibraryUtilities.internal.nativeId(this), columns);
}
@QtUninvokable
private native void setNumColumns_native_int(long __this__nativeId, int columns);
/**
* See QTextLine:: setNumColumns(int, qreal)
*/
@QtUninvokable
public final void setNumColumns(int columns, double alignmentWidth){
setNumColumns_native_int_qreal(QtJambi_LibraryUtilities.internal.nativeId(this), columns, alignmentWidth);
}
@QtUninvokable
private native void setNumColumns_native_int_qreal(long __this__nativeId, int columns, double alignmentWidth);
/**
* See QTextLine:: setPosition(QPointF)
*/
@QtUninvokable
public final void setPosition(io.qt.core.@NonNull QPointF pos){
setPosition_native_cref_QPointF(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(pos));
}
@QtUninvokable
private native void setPosition_native_cref_QPointF(long __this__nativeId, long pos);
/**
* See QTextLine:: textLength()const
*/
@QtUninvokable
public final int textLength(){
return textLength_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native int textLength_native_constfct(long __this__nativeId);
/**
* See QTextLine:: textStart()const
*/
@QtUninvokable
public final int textStart(){
return textStart_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native int textStart_native_constfct(long __this__nativeId);
/**
*
*/
@QtUninvokable
public final double width(){
return width_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native double width_native_constfct(long __this__nativeId);
/**
*
*/
@QtUninvokable
public final double x(){
return x_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native double x_native_constfct(long __this__nativeId);
/**
* See QTextLine:: xToCursor(qreal, QTextLine::CursorPosition)const
*/
@QtUninvokable
public final int xToCursor(double x, io.qt.gui.QTextLine.@NonNull CursorPosition arg__2){
return xToCursor_native_qreal_QTextLine_CursorPosition_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), x, arg__2.value());
}
@QtUninvokable
private native int xToCursor_native_qreal_QTextLine_CursorPosition_constfct(long __this__nativeId, double x, int arg__2);
/**
*
*/
@QtUninvokable
public final double y(){
return y_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native double y_native_constfct(long __this__nativeId);
/**
* Constructor for internal use only.
* @param p expected to be null
.
* @hidden
*/
@NativeAccess
protected QTextLine(QPrivateConstructor p) { super(p); }
/**
* Creates and returns a copy of this object.
See QTextLine:: QTextLine(QTextLine)
*/
@QtUninvokable
@Override
public QTextLine clone() {
return clone_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
private static native QTextLine clone_native(long __this_nativeId);
/**
* Overloaded function for {@link #draw(io.qt.gui.QPainter, io.qt.core.QPointF)}.
*/
@QtUninvokable
public final void draw(io.qt.gui.@Nullable QPainter painter, io.qt.core.@NonNull QPoint position) {
draw(painter, new io.qt.core.QPointF(position));
}
/**
* Overloaded function for {@link #glyphRuns(int, int)}
* with length = -1
.
*/
@QtUninvokable
public final io.qt.core.@NonNull QList glyphRuns(int from) {
return glyphRuns(from, (int)-1);
}
/**
* Overloaded function for {@link #glyphRuns(int, int)}
* with:
* from = -1
* length = -1
*
*/
@QtUninvokable
public final io.qt.core.@NonNull QList glyphRuns() {
return glyphRuns((int)-1, (int)-1);
}
/**
* Overloaded function for {@link #glyphRuns(int, int, io.qt.gui.QTextLayout.GlyphRunRetrievalFlags)}.
*/
@QtUninvokable
public final io.qt.core.@NonNull QList glyphRuns(int from, int length, io.qt.gui.QTextLayout.@NonNull GlyphRunRetrievalFlag @NonNull... flags) {
return glyphRuns(from, length, new io.qt.gui.QTextLayout.GlyphRunRetrievalFlags(flags));
}
/**
* Overloaded function for {@link #setPosition(io.qt.core.QPointF)}.
*/
@QtUninvokable
public final void setPosition(io.qt.core.@NonNull QPoint pos) {
setPosition(new io.qt.core.QPointF(pos));
}
/**
* Overloaded function for {@link #xToCursor(double, io.qt.gui.QTextLine.CursorPosition)}
* with arg__2 = io.qt.gui.QTextLine.CursorPosition.CursorBetweenCharacters
.
*/
@QtUninvokable
public final int xToCursor(double x) {
return xToCursor(x, io.qt.gui.QTextLine.CursorPosition.CursorBetweenCharacters);
}
}