io.qt.widgets.QStackedLayout Maven / Gradle / Ivy
Show all versions of qtjambi Show documentation
package io.qt.widgets;
import io.qt.*;
/**
* Stack of widgets where only one widget is visible at a time
* Java wrapper for Qt class QStackedLayout
*/
public class QStackedLayout extends io.qt.widgets.QLayout
{
/**
* This variable stores the meta-object for the class.
*/
public static final io.qt.core.@NonNull QMetaObject staticMetaObject = io.qt.core.QMetaObject.forType(QStackedLayout.class);
/**
* Java wrapper for Qt enum QStackedLayout::StackingMode
*/
public enum StackingMode implements QtEnumerator {
/**
* Representing QStackedLayout:: StackOne
*/
StackOne(0),
/**
* Representing QStackedLayout:: StackAll
*/
StackAll(1);
static {
QtJambi_LibraryUtilities.initialize();
}
private StackingMode(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 StackingMode resolve(int value) {
switch (value) {
case 0: return StackOne;
case 1: return StackAll;
default: throw new QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* See QStackedLayout:: currentChanged(int)
*/
@QtPropertyNotify(name="currentIndex")
public final @NonNull Signal1 currentChanged = new Signal1<>();
/**
* See QStackedLayout:: widgetRemoved(int)
*/
public final @NonNull Signal1 widgetRemoved = new Signal1<>();
/**
* See QStackedLayout:: QStackedLayout()
*/
public QStackedLayout(){
super((QPrivateConstructor)null);
initialize_native(this);
}
private native static void initialize_native(QStackedLayout instance);
/**
* See QStackedLayout:: QStackedLayout(QLayout*)
*/
public QStackedLayout(io.qt.widgets.@Nullable QLayout parentLayout){
super((QPrivateConstructor)null);
initialize_native(this, parentLayout);
}
private native static void initialize_native(QStackedLayout instance, io.qt.widgets.QLayout parentLayout);
/**
* See QStackedLayout:: QStackedLayout(QWidget*)
*/
public QStackedLayout(io.qt.widgets.@Nullable QWidget parent){
super((QPrivateConstructor)null);
initialize_native(this, parent);
}
private native static void initialize_native(QStackedLayout instance, io.qt.widgets.QWidget parent);
/**
* See QStackedLayout:: addWidget(QWidget*)
*/
@QtUninvokable
public final int stackWidget(io.qt.widgets.@StrictNonNull QWidget w){
if(QWidgetItem.hasWidgetItemV2(w))
throw new IllegalArgumentException("Widget is already a layout member.");
java.util.Objects.requireNonNull(w, "Argument 'w': null not expected.");
int __qt_return_value = stackWidget_native_QWidget_ptr(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(w));
if (w.parent()==null) {
QtJambi_LibraryUtilities.internal.addReferenceCount(this, io.qt.widgets.QLayout.class, "__rcLayoutedObjects", false, false, w);
}
return __qt_return_value;
}
@QtUninvokable
private native int stackWidget_native_QWidget_ptr(long __this__nativeId, long w);
/**
* See QStackedLayout:: currentIndex()const
*/
@QtPropertyReader(name="currentIndex")
@QtUninvokable
public final int currentIndex(){
return currentIndex_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native int currentIndex_native_constfct(long __this__nativeId);
/**
* See QStackedLayout:: currentWidget()const
*/
@QtUninvokable
public final io.qt.widgets.@Nullable QWidget currentWidget(){
return currentWidget_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.widgets.QWidget currentWidget_native_constfct(long __this__nativeId);
/**
* See QStackedLayout:: insertWidget(int, QWidget*)
*/
@QtUninvokable
public final int insertWidget(int index, io.qt.widgets.@StrictNonNull QWidget w){
if(QWidgetItem.hasWidgetItemV2(w))
throw new IllegalArgumentException("Widget is already a layout member.");
java.util.Objects.requireNonNull(w, "Argument 'w': null not expected.");
int __qt_return_value = insertWidget_native_int_QWidget_ptr(QtJambi_LibraryUtilities.internal.nativeId(this), index, QtJambi_LibraryUtilities.internal.checkedNativeId(w));
if (w.parent()==null) {
QtJambi_LibraryUtilities.internal.addReferenceCount(this, io.qt.widgets.QLayout.class, "__rcLayoutedObjects", false, false, w);
}
return __qt_return_value;
}
@QtUninvokable
private native int insertWidget_native_int_QWidget_ptr(long __this__nativeId, int index, long w);
/**
* See QStackedLayout:: setCurrentIndex(int)
*/
@QtPropertyWriter(name="currentIndex")
public final void setCurrentIndex(int index){
setCurrentIndex_native_int(QtJambi_LibraryUtilities.internal.nativeId(this), index);
}
private native void setCurrentIndex_native_int(long __this__nativeId, int index);
/**
* See QStackedLayout:: setCurrentWidget(QWidget*)
*/
public final void setCurrentWidget(io.qt.widgets.@Nullable QWidget w){
setCurrentWidget_native_QWidget_ptr(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(w));
}
private native void setCurrentWidget_native_QWidget_ptr(long __this__nativeId, long w);
/**
* See QStackedLayout:: setStackingMode(QStackedLayout::StackingMode)
*/
@QtPropertyWriter(name="stackingMode")
@QtUninvokable
public final void setStackingMode(io.qt.widgets.QStackedLayout.@NonNull StackingMode stackingMode){
setStackingMode_native_QStackedLayout_StackingMode(QtJambi_LibraryUtilities.internal.nativeId(this), stackingMode.value());
}
@QtUninvokable
private native void setStackingMode_native_QStackedLayout_StackingMode(long __this__nativeId, int stackingMode);
/**
* See QStackedLayout:: stackingMode()const
*/
@QtPropertyReader(name="stackingMode")
@QtUninvokable
public final io.qt.widgets.QStackedLayout.@NonNull StackingMode stackingMode(){
return io.qt.widgets.QStackedLayout.StackingMode.resolve(stackingMode_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@QtUninvokable
private native int stackingMode_native_constfct(long __this__nativeId);
/**
* See QStackedLayout:: widget(int)const
*/
@QtUninvokable
public final io.qt.widgets.@Nullable QWidget widget(int arg__1){
return widget_native_int_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), arg__1);
}
@QtUninvokable
private native io.qt.widgets.QWidget widget_native_int_constfct(long __this__nativeId, int arg__1);
/**
* See QLayout:: addItem(QLayoutItem*)
*/
@QtUninvokable
@Override
public void addItem(io.qt.widgets.@StrictNonNull QLayoutItem item){
java.util.Objects.requireNonNull(item, "Argument 'item': null not expected.");
QWidget widget = item.widget();
if(widget==null){
throw new IllegalArgumentException("Only widgets can be added to QStackedLayout. Use QWidgetItem instead.");
}
addItem_native_QLayoutItem_ptr(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(item));
if(widget!=null && widget.parent()==null){
QtJambi_LibraryUtilities.internal.addReferenceCount(this, io.qt.widgets.QLayout.class, "__rcLayoutedObjects", false, false, widget);
}
}
@QtUninvokable
private native void addItem_native_QLayoutItem_ptr(long __this__nativeId, long item);
/**
*
*/
@QtUninvokable
@Override
public int count(){
return count_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native int count_native_constfct(long __this__nativeId);
/**
* See QLayoutItem:: hasHeightForWidth()const
*/
@QtUninvokable
@Override
public boolean hasHeightForWidth(){
return hasHeightForWidth_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
private native static boolean hasHeightForWidth_native_constfct(long __this__nativeId);
/**
* See QLayoutItem:: heightForWidth(int)const
*/
@QtUninvokable
@Override
public int heightForWidth(int width){
return heightForWidth_native_int_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), width);
}
private native static int heightForWidth_native_int_constfct(long __this__nativeId, int width);
/**
*
*/
@QtUninvokable
@Override
public io.qt.widgets.@Nullable QLayoutItem itemAt(int arg__1){
return itemAt_native_int_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), arg__1);
}
@QtUninvokable
private native io.qt.widgets.QLayoutItem itemAt_native_int_constfct(long __this__nativeId, int arg__1);
/**
* See QLayoutItem:: minimumSize()const
*/
@QtUninvokable
@Override
public io.qt.core.@NonNull QSize minimumSize(){
return minimumSize_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
private native static io.qt.core.QSize minimumSize_native_constfct(long __this__nativeId);
/**
* See QLayoutItem:: setGeometry(QRect)
*/
@QtUninvokable
@Override
public void setGeometry(io.qt.core.@NonNull QRect rect){
setGeometry_native_cref_QRect(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(rect));
}
private native static void setGeometry_native_cref_QRect(long __this__nativeId, long rect);
/**
* See QLayoutItem:: sizeHint()const
*/
@QtUninvokable
@Override
public io.qt.core.@NonNull QSize sizeHint(){
return sizeHint_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
private native static io.qt.core.QSize sizeHint_native_constfct(long __this__nativeId);
/**
*
*/
@QtUninvokable
@Override
public io.qt.widgets.@Nullable QLayoutItem takeAt(int arg__1){
io.qt.widgets.@Nullable QLayoutItem __qt_return_value = takeAt_native_int(QtJambi_LibraryUtilities.internal.nativeId(this), arg__1);
if(__qt_return_value != null){
QtJambi_LibraryUtilities.internal.setDefaultOwnership(__qt_return_value);
}
if(__qt_return_value != null){
QtJambi_LibraryUtilities.internal.setDefaultOwnership(__qt_return_value);
}
return __qt_return_value;
}
@QtUninvokable
private native io.qt.widgets.QLayoutItem takeAt_native_int(long __this__nativeId, int arg__1);
/**
* Constructor for internal use only.
* @param p expected to be null
.
* @hidden
*/
@NativeAccess
protected QStackedLayout(QPrivateConstructor p) { super(p); }
/**
* Constructor for internal use only.
* It is not allowed to call the declarative constructor from inside Java.
* @hidden
*/
@NativeAccess
protected QStackedLayout(QDeclarativeConstructor constructor) {
super((QPrivateConstructor)null);
initialize_native(this, constructor);
}
@QtUninvokable
private static native void initialize_native(QStackedLayout instance, QDeclarativeConstructor constructor);
@QtUninvokable
void add_widget(QWidget widget){
stackWidget(widget);
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #currentIndex()} instead.
*/
@QtPropertyReader(enabled=false)
@QtUninvokable
public final int getCurrentIndex() {
return currentIndex();
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #stackingMode()} instead.
*/
@QtPropertyReader(enabled=false)
@QtUninvokable
public final io.qt.widgets.QStackedLayout.@NonNull StackingMode getStackingMode() {
return stackingMode();
}
}