io.qt.widgets.QStyleOptionButton Maven / Gradle / Ivy
The newest version!
package io.qt.widgets;
/**
* Used to describe the parameters for drawing buttons
* Java wrapper for Qt class QStyleOptionButton
*/
public class QStyleOptionButton extends io.qt.widgets.QStyleOption
implements java.lang.Cloneable
{
/**
* Java wrapper for Qt enum QStyleOptionButton::ButtonFeature
*
* @see ButtonFeatures
*/
public enum ButtonFeature implements io.qt.QtFlagEnumerator {
None(0),
Flat(1),
HasMenu(2),
DefaultButton(4),
AutoDefaultButton(8),
CommandLinkButton(16);
private ButtonFeature(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
public int value() {
return value;
}
/**
* Create a QFlags of the enum entry.
* @return QFlags
*/
public ButtonFeatures asFlags() {
return new ButtonFeatures(value);
}
/**
* Combines this entry with other enum entry.
* @param e enum entry
* @return new flag
*/
public ButtonFeatures combined(ButtonFeature e) {
return new ButtonFeatures(this, e);
}
/**
* Creates a new {@link ButtonFeatures} from the entries.
* @param values entries
* @return new flag
*/
public static ButtonFeatures flags(ButtonFeature ... values) {
return new ButtonFeatures(values);
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static ButtonFeature resolve(int value) {
switch (value) {
case 0: return None;
case 1: return Flat;
case 2: return HasMenu;
case 4: return DefaultButton;
case 8: return AutoDefaultButton;
case 16: return CommandLinkButton;
default: throw new io.qt.QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* QFlags type for enum {@link ButtonFeature}
*/
public static final class ButtonFeatures extends io.qt.QFlags implements Comparable {
private static final long serialVersionUID = 0x164b09117e9f3058L;
/**
* Creates a new ButtonFeatures where the flags in args
are set.
* @param args enum entries
*/
public ButtonFeatures(ButtonFeature ... args){
super(args);
}
/**
* Creates a new ButtonFeatures with given value
.
* @param value
*/
public ButtonFeatures(int value) {
super(value);
}
/**
* Combines this flags with enum entry.
* @param e enum entry
* @return new ButtonFeatures
*/
@Override
public final ButtonFeatures combined(ButtonFeature e){
return new ButtonFeatures(value() | e.value());
}
/**
* Sets the flag e
* @param e enum entry
* @return this
*/
public final ButtonFeatures setFlag(ButtonFeature 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 ButtonFeatures setFlag(ButtonFeature e, boolean on){
super.setFlag(e, on);
return this;
}
/**
* Returns an array of flag objects represented by this ButtonFeatures.
* @return array of enum entries
*/
@Override
public final ButtonFeature[] flags(){
return super.flags(ButtonFeature.values());
}
/**
* {@inheritDoc}
*/
@Override
public final ButtonFeatures clone(){
return new ButtonFeatures(value());
}
/**
* {@inheritDoc}
*/
@Override
public final int compareTo(ButtonFeatures other){
return Integer.compare(value(), other.value());
}
}
/**
* See QStyleOptionButton::QStyleOptionButton()
*/
public QStyleOptionButton(){
super((QPrivateConstructor)null);
initialize_native(this);
}
private native static void initialize_native(QStyleOptionButton instance);
/**
* See QStyleOptionButton::QStyleOptionButton(QStyleOptionButton)
*/
public QStyleOptionButton(io.qt.widgets.QStyleOptionButton other){
super((QPrivateConstructor)null);
initialize_native(this, other);
}
private native static void initialize_native(QStyleOptionButton instance, io.qt.widgets.QStyleOptionButton other);
@io.qt.QtUninvokable
public final void set(io.qt.widgets.QStyleOptionButton arg__1){
set_native_cref_QStyleOptionButton(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(arg__1));
}
@io.qt.QtUninvokable
private native void set_native_cref_QStyleOptionButton(long __this__nativeId, long arg__1);
/**
* Overloaded function for {@link #setFeatures(io.qt.widgets.QStyleOptionButton.ButtonFeatures)}.
*/
@io.qt.QtUninvokable
public final void setFeatures(io.qt.widgets.QStyleOptionButton.ButtonFeature ... features){
setFeatures(new io.qt.widgets.QStyleOptionButton.ButtonFeatures(features));
}
/**
* Bitwise OR of the features that describe this button
* See QStyleOptionButton::features
*/
@io.qt.QtUninvokable
public final void setFeatures(io.qt.widgets.QStyleOptionButton.ButtonFeatures features){
setFeatures_native_cref_QFlags_QStyleOptionButton_ButtonFeature_(QtJambi_LibraryUtilities.internal.nativeId(this), features.value());
}
@io.qt.QtUninvokable
private native void setFeatures_native_cref_QFlags_QStyleOptionButton_ButtonFeature_(long __this__nativeId, int features);
/**
* Bitwise OR of the features that describe this button
* See QStyleOptionButton::features
*/
@io.qt.QtUninvokable
public final io.qt.widgets.QStyleOptionButton.ButtonFeatures features(){
return new io.qt.widgets.QStyleOptionButton.ButtonFeatures(features_native(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@io.qt.QtUninvokable
private native int features_native(long __this__nativeId);
/**
* The icon of the button
*
*/
@io.qt.QtUninvokable
public final void setIcon(io.qt.gui.QIcon icon){
setIcon_native_cref_QIcon(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(icon));
}
@io.qt.QtUninvokable
private native void setIcon_native_cref_QIcon(long __this__nativeId, long icon);
/**
* The icon of the button
*
*/
@io.qt.QtUninvokable
public final io.qt.gui.QIcon icon(){
return icon_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native io.qt.gui.QIcon icon_native(long __this__nativeId);
/**
* The size of the icon for the button
* See QStyleOptionButton::iconSize
*/
@io.qt.QtUninvokable
public final void setIconSize(io.qt.core.QSize iconSize){
setIconSize_native_cref_QSize(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(iconSize));
}
@io.qt.QtUninvokable
private native void setIconSize_native_cref_QSize(long __this__nativeId, long iconSize);
/**
* The size of the icon for the button
* See QStyleOptionButton::iconSize
*/
@io.qt.QtUninvokable
public final io.qt.core.QSize iconSize(){
return iconSize_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native io.qt.core.QSize iconSize_native(long __this__nativeId);
/**
* The text of the button
*
*/
@io.qt.QtUninvokable
public final void setText(java.lang.String text){
setText_native_cref_QString(QtJambi_LibraryUtilities.internal.nativeId(this), text);
}
@io.qt.QtUninvokable
private native void setText_native_cref_QString(long __this__nativeId, java.lang.String text);
/**
* The text of the button
*
*/
@io.qt.QtUninvokable
public final java.lang.String text(){
return text_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native java.lang.String text_native(long __this__nativeId);
/**
* Constructor for internal use only.
* @param p expected to be null
.
*/
@io.qt.NativeAccess
protected QStyleOptionButton(QPrivateConstructor p) { super(p); }
@Override
public QStyleOptionButton clone() {
return clone_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
private native QStyleOptionButton clone_native(long __this_nativeId);
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy