io.qt.gui.QTextOption Maven / Gradle / Ivy
package io.qt.gui;
/**
* Description of general rich text properties
* Java wrapper for Qt class QTextOption
*/
public class QTextOption extends io.qt.QtObject
implements java.lang.Cloneable
{
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* Java wrapper for Qt enum QTextOption::Flag
*
* @see Flags
*/
public enum Flag implements io.qt.QtFlagEnumerator {
ShowTabsAndSpaces(1),
ShowLineAndParagraphSeparators(2),
AddSpaceForLineAndParagraphSeparators(4),
SuppressColors(8),
ShowDocumentTerminator(16),
IncludeTrailingSpaces(-2147483648);
private Flag(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
public int value() {
return value;
}
/**
* Create a QFlags of the enum entry.
* @return QFlags
*/
public Flags asFlags() {
return new Flags(value);
}
/**
* Combines this entry with other enum entry.
* @param e enum entry
* @return new flag
*/
public Flags combined(Flag e) {
return new Flags(this, e);
}
/**
* Creates a new {@link Flags} from the entries.
* @param values entries
* @return new flag
*/
public static Flags flags(Flag ... values) {
return new Flags(values);
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static Flag resolve(int value) {
switch (value) {
case 1: return ShowTabsAndSpaces;
case 2: return ShowLineAndParagraphSeparators;
case 4: return AddSpaceForLineAndParagraphSeparators;
case 8: return SuppressColors;
case 16: return ShowDocumentTerminator;
case -2147483648: return IncludeTrailingSpaces;
default: throw new io.qt.QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* QFlags type for enum {@link Flag}
*/
public static final class Flags extends io.qt.QFlags implements Comparable {
private static final long serialVersionUID = 0x92d9bce6c929c1c6L;
/**
* Creates a new Flags where the flags in args
are set.
* @param args enum entries
*/
public Flags(Flag ... args){
super(args);
}
/**
* Creates a new Flags with given value
.
* @param value
*/
public Flags(int value) {
super(value);
}
/**
* Combines this flags with enum entry.
* @param e enum entry
* @return new Flags
*/
@Override
public final Flags combined(Flag e){
return new Flags(value() | e.value());
}
/**
* Sets the flag e
* @param e enum entry
* @return this
*/
public final Flags setFlag(Flag e){
super.setFlag(e);
return this;
}
/**
* Sets or clears the flag flag
* @param e enum entry
* @param on set (true) or clear (false)
* @return this
*/
public final Flags setFlag(Flag e, boolean on){
super.setFlag(e, on);
return this;
}
/**
* Returns an array of flag objects represented by this Flags.
* @return array of enum entries
*/
@Override
public final Flag[] flags(){
return super.flags(Flag.values());
}
/**
* {@inheritDoc}
*/
@Override
public final Flags clone(){
return new Flags(value());
}
/**
* {@inheritDoc}
*/
@Override
public final int compareTo(Flags other){
return Integer.compare(value(), other.value());
}
}
/**
* Java wrapper for Qt enum QTextOption::TabType
*/
public enum TabType implements io.qt.QtEnumerator {
LeftTab(0),
RightTab(1),
CenterTab(2),
DelimiterTab(3);
private TabType(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 TabType resolve(int value) {
switch (value) {
case 0: return LeftTab;
case 1: return RightTab;
case 2: return CenterTab;
case 3: return DelimiterTab;
default: throw new io.qt.QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* Java wrapper for Qt enum QTextOption::WrapMode
*/
public enum WrapMode implements io.qt.QtEnumerator {
NoWrap(0),
WordWrap(1),
ManualWrap(2),
WrapAnywhere(3),
WrapAtWordBoundaryOrAnywhere(4);
private WrapMode(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 WrapMode resolve(int value) {
switch (value) {
case 0: return NoWrap;
case 1: return WordWrap;
case 2: return ManualWrap;
case 3: return WrapAnywhere;
case 4: return WrapAtWordBoundaryOrAnywhere;
default: throw new io.qt.QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* Java wrapper for Qt class QTextOption::Tab
*/
public static class Tab extends io.qt.QtObject
implements java.lang.Cloneable
{
static {
QtJambi_LibraryUtilities.initialize();
}
/**
*
*/
public Tab(){
super((QPrivateConstructor)null);
initialize_native(this);
}
private native static void initialize_native(Tab instance);
/**
* Overloaded constructor for {@link #Tab(double, io.qt.gui.QTextOption.TabType, char)}
* with delim = '\0'
.
*/
public Tab(double pos, io.qt.gui.QTextOption.TabType tabType) {
this(pos, tabType, '\0');
}
public Tab(double pos, io.qt.gui.QTextOption.TabType tabType, char delim){
super((QPrivateConstructor)null);
initialize_native(this, pos, tabType, delim);
}
private native static void initialize_native(Tab instance, double pos, io.qt.gui.QTextOption.TabType tabType, char delim);
/**
* See QTextOption::Tab::operator==(QTextOption::Tab)const
*/
@io.qt.QtUninvokable
private final boolean operator_equal(io.qt.gui.QTextOption.Tab other){
return operator_equal_native_cref_QTextOption_Tab_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(other));
}
@io.qt.QtUninvokable
private native boolean operator_equal_native_cref_QTextOption_Tab_constfct(long __this__nativeId, long other);
/**
* See QTextOption::Tab::delimiter
*/
@io.qt.QtUninvokable
public final void setDelimiter(char delimiter){
setDelimiter_native_cref_QChar(QtJambi_LibraryUtilities.internal.nativeId(this), delimiter);
}
@io.qt.QtUninvokable
private native void setDelimiter_native_cref_QChar(long __this__nativeId, char delimiter);
/**
* See QTextOption::Tab::delimiter
*/
@io.qt.QtUninvokable
public final char delimiter(){
return delimiter_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native char delimiter_native(long __this__nativeId);
/**
* See QTextOption::Tab::position
*/
@io.qt.QtUninvokable
public final void setPosition(double position){
setPosition_native_qtjambireal(QtJambi_LibraryUtilities.internal.nativeId(this), position);
}
@io.qt.QtUninvokable
private native void setPosition_native_qtjambireal(long __this__nativeId, double position);
/**
* See QTextOption::Tab::position
*/
@io.qt.QtUninvokable
public final double position(){
return position_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native double position_native(long __this__nativeId);
/**
*
*/
@io.qt.QtUninvokable
public final void setType(io.qt.gui.QTextOption.TabType type){
setType_native_cref_QTextOption_TabType(QtJambi_LibraryUtilities.internal.nativeId(this), type.value());
}
@io.qt.QtUninvokable
private native void setType_native_cref_QTextOption_TabType(long __this__nativeId, int type);
/**
*
*/
@io.qt.QtUninvokable
public final io.qt.gui.QTextOption.TabType type(){
return io.qt.gui.QTextOption.TabType.resolve(type_native(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@io.qt.QtUninvokable
private native int type_native(long __this__nativeId);
/**
* Constructor for internal use only.
* @param p expected to be null
.
*/
@io.qt.NativeAccess
protected Tab(QPrivateConstructor p) { super(p); }
@Override
@io.qt.QtUninvokable
public boolean equals(Object other) {
if (other instanceof io.qt.gui.QTextOption.Tab) {
return operator_equal((io.qt.gui.QTextOption.Tab) other);
}
return false;
}
@io.qt.QtUninvokable
@Override
public int hashCode() {
return hashCode_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native static int hashCode_native(long __this_nativeId);
@Override
public Tab clone() {
return clone_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
private native Tab clone_native(long __this_nativeId);
}
/**
* See QTextOption::QTextOption()
*/
public QTextOption(){
super((QPrivateConstructor)null);
initialize_native(this);
}
private native static void initialize_native(QTextOption instance);
/**
* Overloaded constructor for {@link #QTextOption(io.qt.core.Qt.Alignment)}.
*/
public QTextOption(io.qt.core.Qt.AlignmentFlag ... alignment){
this(new io.qt.core.Qt.Alignment(alignment));
}
/**
* See QTextOption::QTextOption(Qt::Alignment)
*/
public QTextOption(io.qt.core.Qt.Alignment alignment){
super((QPrivateConstructor)null);
initialize_native(this, alignment);
}
private native static void initialize_native(QTextOption instance, io.qt.core.Qt.Alignment alignment);
/**
* See QTextOption::QTextOption(QTextOption)
*/
public QTextOption(io.qt.gui.QTextOption o){
super((QPrivateConstructor)null);
initialize_native(this, o);
}
private native static void initialize_native(QTextOption instance, io.qt.gui.QTextOption o);
/**
* See QTextOption::alignment()const
*/
@io.qt.QtUninvokable
public final io.qt.core.Qt.Alignment alignment(){
return new io.qt.core.Qt.Alignment(alignment_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@io.qt.QtUninvokable
private native int alignment_native_constfct(long __this__nativeId);
/**
*
*/
@io.qt.QtUninvokable
public final io.qt.gui.QTextOption.Flags flags(){
return new io.qt.gui.QTextOption.Flags(flags_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@io.qt.QtUninvokable
private native int flags_native_constfct(long __this__nativeId);
/**
* Overloaded function for {@link #setAlignment(io.qt.core.Qt.Alignment)}.
*/
@io.qt.QtUninvokable
public final void setAlignment(io.qt.core.Qt.AlignmentFlag ... alignment){
setAlignment(new io.qt.core.Qt.Alignment(alignment));
}
/**
* See QTextOption::setAlignment(Qt::Alignment)
*/
@io.qt.QtUninvokable
public final void setAlignment(io.qt.core.Qt.Alignment alignment){
setAlignment_native_QFlags_Qt_AlignmentFlag_(QtJambi_LibraryUtilities.internal.nativeId(this), alignment.value());
}
@io.qt.QtUninvokable
private native void setAlignment_native_QFlags_Qt_AlignmentFlag_(long __this__nativeId, int alignment);
/**
* Overloaded function for {@link #setFlags(io.qt.gui.QTextOption.Flags)}.
*/
@io.qt.QtUninvokable
public final void setFlags(io.qt.gui.QTextOption.Flag ... flags){
setFlags(new io.qt.gui.QTextOption.Flags(flags));
}
/**
* See QTextOption::setFlags(Flags)
*/
@io.qt.QtUninvokable
public final void setFlags(io.qt.gui.QTextOption.Flags flags){
setFlags_native_QFlags_QTextOption_Flag_(QtJambi_LibraryUtilities.internal.nativeId(this), flags.value());
}
@io.qt.QtUninvokable
private native void setFlags_native_QFlags_QTextOption_Flag_(long __this__nativeId, int flags);
/**
* See QTextOption::setTabArray(QList<qreal>)
*/
@io.qt.QtUninvokable
public final void setTabArray(java.util.Collection tabStops){
setTabArray_native_cref_QList(QtJambi_LibraryUtilities.internal.nativeId(this), tabStops);
}
@io.qt.QtUninvokable
private native void setTabArray_native_cref_QList(long __this__nativeId, java.util.Collection tabStops);
/**
* See QTextOption::setTabStopDistance(qreal)
*/
@io.qt.QtUninvokable
public final void setTabStopDistance(double tabStopDistance){
setTabStopDistance_native_qtjambireal(QtJambi_LibraryUtilities.internal.nativeId(this), tabStopDistance);
}
@io.qt.QtUninvokable
private native void setTabStopDistance_native_qtjambireal(long __this__nativeId, double tabStopDistance);
/**
* See QTextOption::setTabs(QList<QTextOption::Tab>)
*/
@io.qt.QtUninvokable
public final void setTabs(java.util.Collection tabStops){
setTabs_native_cref_QList(QtJambi_LibraryUtilities.internal.nativeId(this), tabStops);
}
@io.qt.QtUninvokable
private native void setTabs_native_cref_QList(long __this__nativeId, java.util.Collection tabStops);
/**
* See QTextOption::setTextDirection(Qt::LayoutDirection)
*/
@io.qt.QtUninvokable
public final void setTextDirection(io.qt.core.Qt.LayoutDirection aDirection){
setTextDirection_native_Qt_LayoutDirection(QtJambi_LibraryUtilities.internal.nativeId(this), aDirection.value());
}
@io.qt.QtUninvokable
private native void setTextDirection_native_Qt_LayoutDirection(long __this__nativeId, int aDirection);
/**
* See QTextOption::setUseDesignMetrics(bool)
*/
@io.qt.QtUninvokable
public final void setUseDesignMetrics(boolean b){
setUseDesignMetrics_native_bool(QtJambi_LibraryUtilities.internal.nativeId(this), b);
}
@io.qt.QtUninvokable
private native void setUseDesignMetrics_native_bool(long __this__nativeId, boolean b);
/**
* See QTextOption::setWrapMode(QTextOption::WrapMode)
*/
@io.qt.QtUninvokable
public final void setWrapMode(io.qt.gui.QTextOption.WrapMode wrap){
setWrapMode_native_QTextOption_WrapMode(QtJambi_LibraryUtilities.internal.nativeId(this), wrap.value());
}
@io.qt.QtUninvokable
private native void setWrapMode_native_QTextOption_WrapMode(long __this__nativeId, int wrap);
/**
* See QTextOption::tabArray()const
*/
@io.qt.QtUninvokable
public final io.qt.core.QList tabArray(){
return tabArray_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native io.qt.core.QList tabArray_native_constfct(long __this__nativeId);
/**
* See QTextOption::tabStopDistance()const
*/
@io.qt.QtUninvokable
public final double tabStopDistance(){
return tabStopDistance_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native double tabStopDistance_native_constfct(long __this__nativeId);
/**
*
*/
@io.qt.QtUninvokable
public final io.qt.core.QList tabs(){
return tabs_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native io.qt.core.QList tabs_native_constfct(long __this__nativeId);
/**
* See QTextOption::textDirection()const
*/
@io.qt.QtUninvokable
public final io.qt.core.Qt.LayoutDirection textDirection(){
return io.qt.core.Qt.LayoutDirection.resolve(textDirection_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@io.qt.QtUninvokable
private native int textDirection_native_constfct(long __this__nativeId);
/**
* See QTextOption::useDesignMetrics()const
*/
@io.qt.QtUninvokable
public final boolean useDesignMetrics(){
return useDesignMetrics_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native boolean useDesignMetrics_native_constfct(long __this__nativeId);
/**
* See QTextOption::wrapMode()const
*/
@io.qt.QtUninvokable
public final io.qt.gui.QTextOption.WrapMode wrapMode(){
return io.qt.gui.QTextOption.WrapMode.resolve(wrapMode_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@io.qt.QtUninvokable
private native int wrapMode_native_constfct(long __this__nativeId);
/**
* Constructor for internal use only.
* @param p expected to be null
.
*/
@io.qt.NativeAccess
protected QTextOption(QPrivateConstructor p) { super(p); }
@Override
@io.qt.QtUninvokable
public boolean equals(Object other) {
if(other instanceof io.qt.gui.QTextOption)
return hashCode()==other.hashCode();
else return super.equals(other); }
@io.qt.QtUninvokable
@Override
public int hashCode() {
return hashCode_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native static int hashCode_native(long __this_nativeId);
@Override
public QTextOption clone() {
return clone_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
private native QTextOption clone_native(long __this_nativeId);
}