io.qt.widgets.QDialogButtonBox Maven / Gradle / Ivy
Show all versions of qtjambi Show documentation
package io.qt.widgets;
import io.qt.*;
/**
* Widget that presents buttons in a layout that is appropriate to the current widget style
* Java wrapper for Qt class QDialogButtonBox
*/
public class QDialogButtonBox extends io.qt.widgets.QWidget
{
/**
* This variable stores the meta-object for the class.
*/
public static final io.qt.core.@NonNull QMetaObject staticMetaObject = io.qt.core.QMetaObject.forType(QDialogButtonBox.class);
/**
* Java wrapper for Qt enum QDialogButtonBox::ButtonLayout
*/
@QtUnlistedEnum
public enum ButtonLayout implements QtEnumerator {
/**
* Representing QDialogButtonBox:: WinLayout
*/
WinLayout(0),
/**
* Representing QDialogButtonBox:: MacLayout
*/
MacLayout(1),
/**
* Representing QDialogButtonBox:: KdeLayout
*/
KdeLayout(2),
/**
* Representing QDialogButtonBox:: GnomeLayout
*/
GnomeLayout(3),
/**
* Representing QDialogButtonBox:: AndroidLayout
*/
AndroidLayout(4);
static {
QtJambi_LibraryUtilities.initialize();
}
private ButtonLayout(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 ButtonLayout resolve(int value) {
switch (value) {
case 0: return WinLayout;
case 1: return MacLayout;
case 2: return KdeLayout;
case 3: return GnomeLayout;
case 4: return AndroidLayout;
default: throw new QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* Java wrapper for Qt enum QDialogButtonBox::ButtonRole
*/
@QtUnlistedEnum
public enum ButtonRole implements QtEnumerator {
/**
* Representing QDialogButtonBox:: InvalidRole
*/
InvalidRole(-1),
/**
* Representing QDialogButtonBox:: AcceptRole
*/
AcceptRole(0),
/**
* Representing QDialogButtonBox:: RejectRole
*/
RejectRole(1),
/**
* Representing QDialogButtonBox:: DestructiveRole
*/
DestructiveRole(2),
/**
* Representing QDialogButtonBox:: ActionRole
*/
ActionRole(3),
/**
* Representing QDialogButtonBox:: HelpRole
*/
HelpRole(4),
/**
* Representing QDialogButtonBox:: YesRole
*/
YesRole(5),
/**
* Representing QDialogButtonBox:: NoRole
*/
NoRole(6),
/**
* Representing QDialogButtonBox:: ResetRole
*/
ResetRole(7),
/**
* Representing QDialogButtonBox:: ApplyRole
*/
ApplyRole(8),
/**
* Representing QDialogButtonBox:: NRoles
*/
NRoles(9);
static {
QtJambi_LibraryUtilities.initialize();
}
private ButtonRole(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 ButtonRole resolve(int value) {
switch (value) {
case -1: return InvalidRole;
case 0: return AcceptRole;
case 1: return RejectRole;
case 2: return DestructiveRole;
case 3: return ActionRole;
case 4: return HelpRole;
case 5: return YesRole;
case 6: return NoRole;
case 7: return ResetRole;
case 8: return ApplyRole;
case 9: return NRoles;
default: throw new QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* Java wrapper for Qt enum QDialogButtonBox::StandardButton
*
* @see StandardButtons
*/
@QtRejectedEntries({"FirstButton", "LastButton"})
public enum StandardButton implements QtFlagEnumerator {
/**
* Representing QDialogButtonBox:: NoButton
*/
NoButton(0),
/**
* Representing QDialogButtonBox:: Ok
*/
Ok(1024),
/**
* Representing QDialogButtonBox:: Save
*/
Save(2048),
/**
* Representing QDialogButtonBox:: SaveAll
*/
SaveAll(4096),
/**
* Representing QDialogButtonBox:: Open
*/
Open(8192),
/**
* Representing QDialogButtonBox:: Yes
*/
Yes(16384),
/**
* Representing QDialogButtonBox:: YesToAll
*/
YesToAll(32768),
/**
* Representing QDialogButtonBox:: No
*/
No(65536),
/**
* Representing QDialogButtonBox:: NoToAll
*/
NoToAll(131072),
/**
* Representing QDialogButtonBox:: Abort
*/
Abort(262144),
/**
* Representing QDialogButtonBox:: Retry
*/
Retry(524288),
/**
* Representing QDialogButtonBox:: Ignore
*/
Ignore(1048576),
/**
* Representing QDialogButtonBox:: Close
*/
Close(2097152),
/**
* Representing QDialogButtonBox:: Cancel
*/
Cancel(4194304),
/**
* Representing QDialogButtonBox:: Discard
*/
Discard(8388608),
/**
* Representing QDialogButtonBox:: Help
*/
Help(16777216),
/**
* Representing QDialogButtonBox:: Apply
*/
Apply(33554432),
/**
* Representing QDialogButtonBox:: Reset
*/
Reset(67108864),
/**
* Representing QDialogButtonBox:: RestoreDefaults
*/
RestoreDefaults(134217728),
/**
* Representing QDialogButtonBox:: FirstButton
*/
FirstButton(1024),
/**
* Representing QDialogButtonBox:: LastButton
*/
LastButton(134217728);
static {
QtJambi_LibraryUtilities.initialize();
}
private StandardButton(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
public int value() {
return value;
}
/**
* Create a QFlags of the enum entry.
* @return QFlags
*/
public @NonNull StandardButtons asFlags() {
return new StandardButtons(value);
}
/**
* Combines this entry with other enum entry.
* @param e enum entry
* @return new flag
*/
public @NonNull StandardButtons combined(@NonNull StandardButton 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 StandardButtons cleared(@NonNull StandardButton e) {
return asFlags().setFlag(e, false);
}
/**
* Creates a new {@link StandardButtons} from the entries.
* @param values entries
* @return new flag
*/
public static @NonNull StandardButtons flags(@Nullable StandardButton @NonNull... values) {
return new StandardButtons(values);
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static @NonNull StandardButton resolve(int value) {
switch (value) {
case 0: return NoButton;
case 1024: return Ok;
case 2048: return Save;
case 4096: return SaveAll;
case 8192: return Open;
case 16384: return Yes;
case 32768: return YesToAll;
case 65536: return No;
case 131072: return NoToAll;
case 262144: return Abort;
case 524288: return Retry;
case 1048576: return Ignore;
case 2097152: return Close;
case 4194304: return Cancel;
case 8388608: return Discard;
case 16777216: return Help;
case 33554432: return Apply;
case 67108864: return Reset;
case 134217728: return RestoreDefaults;
default: throw new QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* {@link QFlags} type for enum {@link StandardButton}
*/
public static final class StandardButtons extends QFlags implements Comparable {
private static final long serialVersionUID = 0xbc3dfa9cca5951bdL;
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* Creates a new StandardButtons where the flags in args
are set.
* @param args enum entries
*/
public StandardButtons(@Nullable StandardButton @NonNull... args){
super(args);
}
/**
* Creates a new StandardButtons with given value
.
* @param value
*/
public StandardButtons(int value) {
super(value);
}
/**
* Combines this flags with enum entry.
* @param e enum entry
* @return new StandardButtons
*/
@Override
public final @NonNull StandardButtons combined(@StrictNonNull StandardButton e){
return new StandardButtons(value() | e.value());
}
/**
* Sets the flag e
* @param e enum entry
* @return this
*/
public final @NonNull StandardButtons setFlag(@Nullable StandardButton 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 StandardButtons setFlag(@Nullable StandardButton 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 StandardButtons.
* @return array of enum entries
*/
@Override
public final @NonNull StandardButton @NonNull[] flags(){
return super.flags(StandardButton.values());
}
/**
* {@inheritDoc}
*/
@Override
public final @NonNull StandardButtons clone(){
return new StandardButtons(value());
}
/**
* {@inheritDoc}
*/
@Override
public final int compareTo(@StrictNonNull StandardButtons other){
return Integer.compare(value(), other.value());
}
}
/**
* See QDialogButtonBox:: accepted()
*/
public final @NonNull Signal0 accepted = new Signal0();
/**
* See QDialogButtonBox:: clicked(QAbstractButton*)
*/
public final @NonNull Signal1 clicked = new Signal1<>();
/**
* See QDialogButtonBox:: helpRequested()
*/
public final @NonNull Signal0 helpRequested = new Signal0();
/**
* See QDialogButtonBox:: rejected()
*/
public final @NonNull Signal0 rejected = new Signal0();
/**
* See QDialogButtonBox:: QDialogButtonBox(QDialogButtonBox::StandardButtons, QWidget*)
*/
public QDialogButtonBox(io.qt.widgets.QDialogButtonBox.@NonNull StandardButtons buttons, io.qt.widgets.@Nullable QWidget parent){
super((QPrivateConstructor)null);
initialize_native(this, buttons, parent);
}
private native static void initialize_native(QDialogButtonBox instance, io.qt.widgets.QDialogButtonBox.StandardButtons buttons, io.qt.widgets.QWidget parent);
/**
* See QDialogButtonBox:: QDialogButtonBox(QDialogButtonBox::StandardButtons, Qt::Orientation, QWidget*)
*/
public QDialogButtonBox(io.qt.widgets.QDialogButtonBox.@NonNull StandardButtons buttons, io.qt.core.Qt.@NonNull Orientation orientation, io.qt.widgets.@Nullable QWidget parent){
super((QPrivateConstructor)null);
initialize_native(this, buttons, orientation, parent);
}
private native static void initialize_native(QDialogButtonBox instance, io.qt.widgets.QDialogButtonBox.StandardButtons buttons, io.qt.core.Qt.Orientation orientation, io.qt.widgets.QWidget parent);
/**
* See QDialogButtonBox:: QDialogButtonBox(QWidget*)
*/
public QDialogButtonBox(io.qt.widgets.@Nullable QWidget parent){
super((QPrivateConstructor)null);
initialize_native(this, parent);
}
private native static void initialize_native(QDialogButtonBox instance, io.qt.widgets.QWidget parent);
/**
* See QDialogButtonBox:: QDialogButtonBox(Qt::Orientation, QWidget*)
*/
public QDialogButtonBox(io.qt.core.Qt.@NonNull Orientation orientation, io.qt.widgets.@Nullable QWidget parent){
super((QPrivateConstructor)null);
initialize_native(this, orientation, parent);
}
private native static void initialize_native(QDialogButtonBox instance, io.qt.core.Qt.Orientation orientation, io.qt.widgets.QWidget parent);
/**
* See QDialogButtonBox:: addButton(QAbstractButton*, QDialogButtonBox::ButtonRole)
*/
@QtUninvokable
public final void addButton(io.qt.widgets.@Nullable QAbstractButton button, io.qt.widgets.QDialogButtonBox.@NonNull ButtonRole role){
addButton_native_QAbstractButton_ptr_QDialogButtonBox_ButtonRole(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(button), role.value());
}
@QtUninvokable
private native void addButton_native_QAbstractButton_ptr_QDialogButtonBox_ButtonRole(long __this__nativeId, long button, int role);
/**
* See QDialogButtonBox:: addButton(QDialogButtonBox::StandardButton)
*/
@QtUninvokable
public final io.qt.widgets.@Nullable QPushButton addButton(io.qt.widgets.QDialogButtonBox.@NonNull StandardButton button){
return addButton_native_QDialogButtonBox_StandardButton(QtJambi_LibraryUtilities.internal.nativeId(this), button.value());
}
@QtUninvokable
private native io.qt.widgets.QPushButton addButton_native_QDialogButtonBox_StandardButton(long __this__nativeId, int button);
/**
* See QDialogButtonBox:: addButton(QString, QDialogButtonBox::ButtonRole)
*/
@QtUninvokable
public final io.qt.widgets.@Nullable QPushButton addButton(java.lang.@NonNull String text, io.qt.widgets.QDialogButtonBox.@NonNull ButtonRole role){
return addButton_native_cref_QString_QDialogButtonBox_ButtonRole(QtJambi_LibraryUtilities.internal.nativeId(this), text, role.value());
}
@QtUninvokable
private native io.qt.widgets.QPushButton addButton_native_cref_QString_QDialogButtonBox_ButtonRole(long __this__nativeId, java.lang.String text, int role);
/**
* See QDialogButtonBox:: button(QDialogButtonBox::StandardButton)const
*/
@QtUninvokable
public final io.qt.widgets.@Nullable QPushButton button(io.qt.widgets.QDialogButtonBox.@NonNull StandardButton which){
return button_native_QDialogButtonBox_StandardButton_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), which.value());
}
@QtUninvokable
private native io.qt.widgets.QPushButton button_native_QDialogButtonBox_StandardButton_constfct(long __this__nativeId, int which);
/**
* See QDialogButtonBox:: buttonRole(QAbstractButton*)const
*/
@QtUninvokable
public final io.qt.widgets.QDialogButtonBox.@NonNull ButtonRole buttonRole(io.qt.widgets.@Nullable QAbstractButton button){
return io.qt.widgets.QDialogButtonBox.ButtonRole.resolve(buttonRole_native_QAbstractButton_ptr_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(button)));
}
@QtUninvokable
private native int buttonRole_native_QAbstractButton_ptr_constfct(long __this__nativeId, long button);
/**
* See QDialogButtonBox:: buttons()const
*/
@QtUninvokable
public final io.qt.core.@NonNull QList buttons(){
return buttons_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.core.QList buttons_native_constfct(long __this__nativeId);
/**
* See QDialogButtonBox:: centerButtons()const
*/
@QtPropertyReader(name="centerButtons")
@QtUninvokable
public final boolean centerButtons(){
return centerButtons_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean centerButtons_native_constfct(long __this__nativeId);
/**
*
*/
@QtUninvokable
public final void clear(){
clear_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native void clear_native(long __this__nativeId);
/**
* See QDialogButtonBox:: orientation()const
*/
@QtPropertyReader(name="orientation")
@QtUninvokable
public final io.qt.core.Qt.@NonNull Orientation orientation(){
return io.qt.core.Qt.Orientation.resolve(orientation_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@QtUninvokable
private native int orientation_native_constfct(long __this__nativeId);
/**
* See QDialogButtonBox:: removeButton(QAbstractButton*)
*/
@QtUninvokable
public final void removeButton(io.qt.widgets.@Nullable QAbstractButton button){
removeButton_native_QAbstractButton_ptr(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(button));
}
@QtUninvokable
private native void removeButton_native_QAbstractButton_ptr(long __this__nativeId, long button);
/**
* See QDialogButtonBox:: setCenterButtons(bool)
*/
@QtPropertyWriter(name="centerButtons")
@QtUninvokable
public final void setCenterButtons(boolean center){
setCenterButtons_native_bool(QtJambi_LibraryUtilities.internal.nativeId(this), center);
}
@QtUninvokable
private native void setCenterButtons_native_bool(long __this__nativeId, boolean center);
/**
* See QDialogButtonBox:: setOrientation(Qt::Orientation)
*/
@QtPropertyWriter(name="orientation")
@QtUninvokable
public final void setOrientation(io.qt.core.Qt.@NonNull Orientation orientation){
setOrientation_native_Qt_Orientation(QtJambi_LibraryUtilities.internal.nativeId(this), orientation.value());
}
@QtUninvokable
private native void setOrientation_native_Qt_Orientation(long __this__nativeId, int orientation);
/**
* See QDialogButtonBox:: setStandardButtons(QDialogButtonBox::StandardButtons)
*/
@QtPropertyWriter(name="standardButtons")
@QtUninvokable
public final void setStandardButtons(io.qt.widgets.QDialogButtonBox.@NonNull StandardButtons buttons){
setStandardButtons_native_QDialogButtonBox_StandardButtons(QtJambi_LibraryUtilities.internal.nativeId(this), buttons.value());
}
@QtUninvokable
private native void setStandardButtons_native_QDialogButtonBox_StandardButtons(long __this__nativeId, int buttons);
/**
* See QDialogButtonBox:: standardButton(QAbstractButton*)const
*/
@QtUninvokable
public final io.qt.widgets.QDialogButtonBox.@NonNull StandardButton standardButton(io.qt.widgets.@Nullable QAbstractButton button){
return io.qt.widgets.QDialogButtonBox.StandardButton.resolve(standardButton_native_QAbstractButton_ptr_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(button)));
}
@QtUninvokable
private native int standardButton_native_QAbstractButton_ptr_constfct(long __this__nativeId, long button);
/**
* See QDialogButtonBox:: standardButtons()const
*/
@QtPropertyReader(name="standardButtons")
@QtUninvokable
public final io.qt.widgets.QDialogButtonBox.@NonNull StandardButtons standardButtons(){
return new io.qt.widgets.QDialogButtonBox.StandardButtons(standardButtons_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@QtUninvokable
private native int standardButtons_native_constfct(long __this__nativeId);
/**
* See QWidget:: changeEvent(QEvent*)
*/
@QtUninvokable
@Override
protected void changeEvent(io.qt.core.@Nullable QEvent event){
changeEvent_native_QEvent_ptr(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(event));
}
@QtUninvokable
private native void changeEvent_native_QEvent_ptr(long __this__nativeId, long event);
/**
*
*/
@QtUninvokable
@Override
public boolean event(io.qt.core.@Nullable QEvent event){
return event_native_QEvent_ptr(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(event));
}
@QtUninvokable
private native boolean event_native_QEvent_ptr(long __this__nativeId, long event);
/**
* Constructor for internal use only.
* @param p expected to be null
.
* @hidden
*/
@NativeAccess
protected QDialogButtonBox(QPrivateConstructor p) { super(p); }
/**
* Constructor for internal use only.
* It is not allowed to call the declarative constructor from inside Java.
* @hidden
*/
@NativeAccess
protected QDialogButtonBox(QDeclarativeConstructor constructor) {
super((QPrivateConstructor)null);
initialize_native(this, constructor);
}
@QtUninvokable
private static native void initialize_native(QDialogButtonBox instance, QDeclarativeConstructor constructor);
/**
* Overloaded constructor for {@link #QDialogButtonBox(io.qt.widgets.QDialogButtonBox.StandardButtons, io.qt.widgets.QWidget)}
* with parent = null
.
*/
public QDialogButtonBox(io.qt.widgets.QDialogButtonBox.@NonNull StandardButtons buttons) {
this(buttons, (io.qt.widgets.QWidget)null);
}
/**
* Overloaded constructor for {@link #QDialogButtonBox(io.qt.widgets.QDialogButtonBox.StandardButtons, io.qt.core.Qt.Orientation, io.qt.widgets.QWidget)}
* with parent = null
.
*/
public QDialogButtonBox(io.qt.widgets.QDialogButtonBox.@NonNull StandardButtons buttons, io.qt.core.Qt.@NonNull Orientation orientation) {
this(buttons, orientation, (io.qt.widgets.QWidget)null);
}
/**
* Overloaded constructor for {@link #QDialogButtonBox(io.qt.widgets.QWidget)}
* with parent = null
.
*/
public QDialogButtonBox() {
this((io.qt.widgets.QWidget)null);
}
/**
* Overloaded constructor for {@link #QDialogButtonBox(io.qt.core.Qt.Orientation, io.qt.widgets.QWidget)}
* with parent = null
.
*/
public QDialogButtonBox(io.qt.core.Qt.@NonNull Orientation orientation) {
this(orientation, (io.qt.widgets.QWidget)null);
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #centerButtons()} instead.
*/
@QtPropertyReader(enabled=false)
@QtUninvokable
public final boolean getCenterButtons() {
return centerButtons();
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #orientation()} instead.
*/
@QtPropertyReader(enabled=false)
@QtUninvokable
public final io.qt.core.Qt.@NonNull Orientation getOrientation() {
return orientation();
}
/**
* Overloaded function for {@link #setStandardButtons(io.qt.widgets.QDialogButtonBox.StandardButtons)}.
*/
@QtUninvokable
public final void setStandardButtons(io.qt.widgets.QDialogButtonBox.@NonNull StandardButton @NonNull... buttons) {
setStandardButtons(new io.qt.widgets.QDialogButtonBox.StandardButtons(buttons));
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #standardButtons()} instead.
*/
@QtPropertyReader(enabled=false)
@QtUninvokable
public final io.qt.widgets.QDialogButtonBox.@NonNull StandardButtons getStandardButtons() {
return standardButtons();
}
}