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