io.qt.widgets.QSizePolicy Maven / Gradle / Ivy
Show all versions of qtjambi Show documentation
package io.qt.widgets;
import io.qt.*;
/**
* Layout attribute describing horizontal and vertical resizing policy
* Java wrapper for Qt class QSizePolicy
*/
public class QSizePolicy extends QtObject
implements java.lang.Cloneable
{
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* This variable stores the meta-object for the class.
*/
public static final io.qt.core.@NonNull QMetaObject staticMetaObject = io.qt.core.QMetaObject.forType(QSizePolicy.class);
/**
* Java wrapper for Qt enum QSizePolicy::ControlType
*
* @see ControlTypes
*/
public enum ControlType implements QtFlagEnumerator {
/**
* Representing QSizePolicy:: DefaultType
*/
DefaultType(1),
/**
* Representing QSizePolicy:: ButtonBox
*/
ButtonBox(2),
/**
* Representing QSizePolicy:: CheckBox
*/
CheckBox(4),
/**
* Representing QSizePolicy:: ComboBox
*/
ComboBox(8),
/**
* Representing QSizePolicy:: Frame
*/
Frame(16),
/**
* Representing QSizePolicy:: GroupBox
*/
GroupBox(32),
/**
* Representing QSizePolicy:: Label
*/
Label(64),
/**
* Representing QSizePolicy:: Line
*/
Line(128),
/**
* Representing QSizePolicy:: LineEdit
*/
LineEdit(256),
/**
* Representing QSizePolicy:: PushButton
*/
PushButton(512),
/**
* Representing QSizePolicy:: RadioButton
*/
RadioButton(1024),
/**
* Representing QSizePolicy:: Slider
*/
Slider(2048),
/**
* Representing QSizePolicy:: SpinBox
*/
SpinBox(4096),
/**
* Representing QSizePolicy:: TabWidget
*/
TabWidget(8192),
/**
* Representing QSizePolicy:: ToolButton
*/
ToolButton(16384);
static {
QtJambi_LibraryUtilities.initialize();
}
private ControlType(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
public int value() {
return value;
}
/**
* Create a QFlags of the enum entry.
* @return QFlags
*/
public @NonNull ControlTypes asFlags() {
return new ControlTypes(value);
}
/**
* Combines this entry with other enum entry.
* @param e enum entry
* @return new flag
*/
public @NonNull ControlTypes combined(@NonNull ControlType 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 ControlTypes cleared(@NonNull ControlType e) {
return asFlags().setFlag(e, false);
}
/**
* Creates a new {@link ControlTypes} from the entries.
* @param values entries
* @return new flag
*/
public static @NonNull ControlTypes flags(@Nullable ControlType @NonNull... values) {
return new ControlTypes(values);
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static @NonNull ControlType resolve(int value) {
switch (value) {
case 1: return DefaultType;
case 2: return ButtonBox;
case 4: return CheckBox;
case 8: return ComboBox;
case 16: return Frame;
case 32: return GroupBox;
case 64: return Label;
case 128: return Line;
case 256: return LineEdit;
case 512: return PushButton;
case 1024: return RadioButton;
case 2048: return Slider;
case 4096: return SpinBox;
case 8192: return TabWidget;
case 16384: return ToolButton;
default: throw new QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* {@link QFlags} type for enum {@link ControlType}
*/
public static final class ControlTypes extends QFlags implements Comparable {
private static final long serialVersionUID = 0x7b593f4c4a646573L;
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* Creates a new ControlTypes where the flags in args
are set.
* @param args enum entries
*/
public ControlTypes(@Nullable ControlType @NonNull... args){
super(args);
}
/**
* Creates a new ControlTypes with given value
.
* @param value
*/
public ControlTypes(int value) {
super(value);
}
/**
* Combines this flags with enum entry.
* @param e enum entry
* @return new ControlTypes
*/
@Override
public final @NonNull ControlTypes combined(@StrictNonNull ControlType e){
return new ControlTypes(value() | e.value());
}
/**
* Sets the flag e
* @param e enum entry
* @return this
*/
public final @NonNull ControlTypes setFlag(@Nullable ControlType 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 ControlTypes setFlag(@Nullable ControlType 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 ControlTypes.
* @return array of enum entries
*/
@Override
public final @NonNull ControlType @NonNull[] flags(){
return super.flags(ControlType.values());
}
/**
* {@inheritDoc}
*/
@Override
public final @NonNull ControlTypes clone(){
return new ControlTypes(value());
}
/**
* {@inheritDoc}
*/
@Override
public final int compareTo(@StrictNonNull ControlTypes other){
return Integer.compare(value(), other.value());
}
}
/**
* Java wrapper for Qt enum QSizePolicy::Policy
*/
public enum Policy implements QtEnumerator {
/**
* Representing QSizePolicy:: Fixed
*/
Fixed(0),
/**
* Representing QSizePolicy:: Minimum
*/
Minimum(1),
/**
* Representing QSizePolicy:: Maximum
*/
Maximum(4),
/**
* Representing QSizePolicy:: Preferred
*/
Preferred(5),
/**
* Representing QSizePolicy:: MinimumExpanding
*/
MinimumExpanding(3),
/**
* Representing QSizePolicy:: Expanding
*/
Expanding(7),
/**
* Representing QSizePolicy:: Ignored
*/
Ignored(13);
static {
QtJambi_LibraryUtilities.initialize();
}
private Policy(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 Policy resolve(int value) {
switch (value) {
case 0: return Fixed;
case 1: return Minimum;
case 4: return Maximum;
case 5: return Preferred;
case 3: return MinimumExpanding;
case 7: return Expanding;
case 13: return Ignored;
default: throw new QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* Java wrapper for Qt enum QSizePolicy::PolicyFlag
*/
public enum PolicyFlag implements QtEnumerator {
/**
* Representing QSizePolicy:: GrowFlag
*/
GrowFlag(1),
/**
* Representing QSizePolicy:: ExpandFlag
*/
ExpandFlag(2),
/**
* Representing QSizePolicy:: ShrinkFlag
*/
ShrinkFlag(4),
/**
* Representing QSizePolicy:: IgnoreFlag
*/
IgnoreFlag(8);
static {
QtJambi_LibraryUtilities.initialize();
}
private PolicyFlag(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 PolicyFlag resolve(int value) {
switch (value) {
case 1: return GrowFlag;
case 2: return ExpandFlag;
case 4: return ShrinkFlag;
case 8: return IgnoreFlag;
default: throw new QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* See QSizePolicy:: QSizePolicy()
*/
public QSizePolicy(){
super((QPrivateConstructor)null);
initialize_native(this);
}
private native static void initialize_native(QSizePolicy instance);
/**
* See QSizePolicy:: QSizePolicy(QSizePolicy)
*/
public QSizePolicy(io.qt.widgets.@NonNull QSizePolicy other){
super((QPrivateConstructor)null);
initialize_native(this, other);
}
private native static void initialize_native(QSizePolicy instance, io.qt.widgets.QSizePolicy other);
/**
* See QSizePolicy:: QSizePolicy(QSizePolicy::Policy, QSizePolicy::Policy, QSizePolicy::ControlType)
*/
public QSizePolicy(io.qt.widgets.QSizePolicy.@NonNull Policy horizontal, io.qt.widgets.QSizePolicy.@NonNull Policy vertical, io.qt.widgets.QSizePolicy.@NonNull ControlType type){
super((QPrivateConstructor)null);
initialize_native(this, horizontal, vertical, type);
}
private native static void initialize_native(QSizePolicy instance, io.qt.widgets.QSizePolicy.Policy horizontal, io.qt.widgets.QSizePolicy.Policy vertical, io.qt.widgets.QSizePolicy.ControlType type);
/**
* See QSizePolicy:: controlType()const
*/
@QtUninvokable
public final io.qt.widgets.QSizePolicy.@NonNull ControlType controlType(){
return io.qt.widgets.QSizePolicy.ControlType.resolve(controlType_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@QtUninvokable
private native int controlType_native_constfct(long __this__nativeId);
/**
* See QSizePolicy:: expandingDirections()const
*/
@QtUninvokable
public final io.qt.core.Qt.@NonNull Orientations expandingDirections(){
return new io.qt.core.Qt.Orientations(expandingDirections_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@QtUninvokable
private native int expandingDirections_native_constfct(long __this__nativeId);
/**
* See QSizePolicy:: hasHeightForWidth()const
*/
@QtUninvokable
public final boolean hasHeightForWidth(){
return hasHeightForWidth_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean hasHeightForWidth_native_constfct(long __this__nativeId);
/**
* See QSizePolicy:: hasWidthForHeight()const
*/
@QtUninvokable
public final boolean hasWidthForHeight(){
return hasWidthForHeight_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean hasWidthForHeight_native_constfct(long __this__nativeId);
/**
* See QSizePolicy:: horizontalPolicy()const
*/
@QtUninvokable
public final io.qt.widgets.QSizePolicy.@NonNull Policy horizontalPolicy(){
return io.qt.widgets.QSizePolicy.Policy.resolve(horizontalPolicy_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@QtUninvokable
private native int horizontalPolicy_native_constfct(long __this__nativeId);
/**
* See QSizePolicy:: horizontalStretch()const
*/
@QtUninvokable
public final int horizontalStretch(){
return horizontalStretch_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native int horizontalStretch_native_constfct(long __this__nativeId);
/**
* See operator<<(QDataStream&, QSizePolicy)
*/
@QtUninvokable
public void writeTo(io.qt.core.@StrictNonNull QDataStream arg__1){
java.util.Objects.requireNonNull(arg__1, "Argument 'arg__1': null not expected.");
writeTo_native_ref_QDataStream(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(arg__1));
}
@QtUninvokable
private native void writeTo_native_ref_QDataStream(long __this__nativeId, long arg__1);
/**
* See QSizePolicy:: operator==(QSizePolicy)const
*/
@QtUninvokable
public final boolean equals(io.qt.widgets.@NonNull QSizePolicy s){
return equals_native_cref_QSizePolicy_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(s));
}
@QtUninvokable
private native boolean equals_native_cref_QSizePolicy_constfct(long __this__nativeId, long s);
/**
* See operator>>(QDataStream&, QSizePolicy&)
*/
@QtUninvokable
public void readFrom(io.qt.core.@StrictNonNull QDataStream arg__1){
java.util.Objects.requireNonNull(arg__1, "Argument 'arg__1': null not expected.");
readFrom_native_ref_QDataStream(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(arg__1));
}
@QtUninvokable
private native void readFrom_native_ref_QDataStream(long __this__nativeId, long arg__1);
/**
* See QSizePolicy:: retainSizeWhenHidden()const
*/
@QtUninvokable
public final boolean retainSizeWhenHidden(){
return retainSizeWhenHidden_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean retainSizeWhenHidden_native_constfct(long __this__nativeId);
/**
* See QSizePolicy:: setControlType(QSizePolicy::ControlType)
*/
@QtUninvokable
public final void setControlType(io.qt.widgets.QSizePolicy.@NonNull ControlType type){
setControlType_native_QSizePolicy_ControlType(QtJambi_LibraryUtilities.internal.nativeId(this), type.value());
}
@QtUninvokable
private native void setControlType_native_QSizePolicy_ControlType(long __this__nativeId, int type);
/**
* See QSizePolicy:: setHeightForWidth(bool)
*/
@QtUninvokable
public final void setHeightForWidth(boolean b){
setHeightForWidth_native_bool(QtJambi_LibraryUtilities.internal.nativeId(this), b);
}
@QtUninvokable
private native void setHeightForWidth_native_bool(long __this__nativeId, boolean b);
/**
* See QSizePolicy:: setHorizontalPolicy(QSizePolicy::Policy)
*/
@QtUninvokable
public final void setHorizontalPolicy(io.qt.widgets.QSizePolicy.@NonNull Policy d){
setHorizontalPolicy_native_QSizePolicy_Policy(QtJambi_LibraryUtilities.internal.nativeId(this), d.value());
}
@QtUninvokable
private native void setHorizontalPolicy_native_QSizePolicy_Policy(long __this__nativeId, int d);
/**
* See QSizePolicy:: setHorizontalStretch(int)
*/
@QtUninvokable
public final void setHorizontalStretch(int stretchFactor){
setHorizontalStretch_native_int(QtJambi_LibraryUtilities.internal.nativeId(this), stretchFactor);
}
@QtUninvokable
private native void setHorizontalStretch_native_int(long __this__nativeId, int stretchFactor);
/**
* See QSizePolicy:: setRetainSizeWhenHidden(bool)
*/
@QtUninvokable
public final void setRetainSizeWhenHidden(boolean retainSize){
setRetainSizeWhenHidden_native_bool(QtJambi_LibraryUtilities.internal.nativeId(this), retainSize);
}
@QtUninvokable
private native void setRetainSizeWhenHidden_native_bool(long __this__nativeId, boolean retainSize);
/**
* See QSizePolicy:: setVerticalPolicy(QSizePolicy::Policy)
*/
@QtUninvokable
public final void setVerticalPolicy(io.qt.widgets.QSizePolicy.@NonNull Policy d){
setVerticalPolicy_native_QSizePolicy_Policy(QtJambi_LibraryUtilities.internal.nativeId(this), d.value());
}
@QtUninvokable
private native void setVerticalPolicy_native_QSizePolicy_Policy(long __this__nativeId, int d);
/**
* See QSizePolicy:: setVerticalStretch(int)
*/
@QtUninvokable
public final void setVerticalStretch(int stretchFactor){
setVerticalStretch_native_int(QtJambi_LibraryUtilities.internal.nativeId(this), stretchFactor);
}
@QtUninvokable
private native void setVerticalStretch_native_int(long __this__nativeId, int stretchFactor);
/**
* See QSizePolicy:: setWidthForHeight(bool)
*/
@QtUninvokable
public final void setWidthForHeight(boolean b){
setWidthForHeight_native_bool(QtJambi_LibraryUtilities.internal.nativeId(this), b);
}
@QtUninvokable
private native void setWidthForHeight_native_bool(long __this__nativeId, boolean b);
/**
*
*/
@QtUninvokable
public final void transpose(){
transpose_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native void transpose_native(long __this__nativeId);
/**
* See QSizePolicy:: transposed()const
*/
@QtUninvokable
public final io.qt.widgets.@NonNull QSizePolicy transposed(){
return transposed_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.widgets.QSizePolicy transposed_native_constfct(long __this__nativeId);
/**
* See QSizePolicy:: verticalPolicy()const
*/
@QtUninvokable
public final io.qt.widgets.QSizePolicy.@NonNull Policy verticalPolicy(){
return io.qt.widgets.QSizePolicy.Policy.resolve(verticalPolicy_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@QtUninvokable
private native int verticalPolicy_native_constfct(long __this__nativeId);
/**
* See QSizePolicy:: verticalStretch()const
*/
@QtUninvokable
public final int verticalStretch(){
return verticalStretch_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native int verticalStretch_native_constfct(long __this__nativeId);
/**
* Constructor for internal use only.
* @param p expected to be null
.
* @hidden
*/
@NativeAccess
protected QSizePolicy(QPrivateConstructor p) { super(p); }
/**
* See QSizePolicy:: operator==(QSizePolicy)const
*/
@Override
@QtUninvokable
public boolean equals(Object other) {
if (other instanceof io.qt.widgets.QSizePolicy) {
return equals((io.qt.widgets.QSizePolicy) other);
}
return false;
}
/**
* Returns the objects's hash code computed by qHash(QSizePolicy)
.
*/
@QtUninvokable
@Override
public int hashCode() {
return hashCode_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native static int hashCode_native(long __this_nativeId);
/**
* See operator<<(QDebug, QSizePolicy)
*/
@QtUninvokable
@Override
public @NonNull String toString() {
return toString_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private static native String toString_native(long __this_nativeId);
/**
* Creates and returns a copy of this object.
See QSizePolicy:: QSizePolicy(QSizePolicy)
*/
@QtUninvokable
@Override
public QSizePolicy clone() {
return clone_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
private static native QSizePolicy clone_native(long __this_nativeId);
/**
* Overloaded constructor for {@link #QSizePolicy(io.qt.widgets.QSizePolicy.Policy, io.qt.widgets.QSizePolicy.Policy, io.qt.widgets.QSizePolicy.ControlType)}
* with type = io.qt.widgets.QSizePolicy.ControlType.DefaultType
.
*/
public QSizePolicy(io.qt.widgets.QSizePolicy.@NonNull Policy horizontal, io.qt.widgets.QSizePolicy.@NonNull Policy vertical) {
this(horizontal, vertical, io.qt.widgets.QSizePolicy.ControlType.DefaultType);
}
}