io.qt.widgets.QStyleOptionToolButton Maven / Gradle / Ivy
Show all versions of qtjambi Show documentation
package io.qt.widgets;
/**
* Used to describe the parameters for drawing a tool button
* Java wrapper for Qt class QStyleOptionToolButton
*/
public class QStyleOptionToolButton extends io.qt.widgets.QStyleOptionComplex
implements java.lang.Cloneable
{
/**
* Java wrapper for Qt enum QStyleOptionToolButton::ToolButtonFeature
*
* @see ToolButtonFeatures
*/
@io.qt.QtRejectedEntries({"MenuButtonPopup"})
public enum ToolButtonFeature implements io.qt.QtFlagEnumerator {
None(0),
Arrow(1),
Menu(4),
MenuButtonPopup(4),
PopupDelay(8),
HasMenu(16);
private ToolButtonFeature(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
public int value() {
return value;
}
/**
* Create a QFlags of the enum entry.
* @return QFlags
*/
public ToolButtonFeatures asFlags() {
return new ToolButtonFeatures(value);
}
/**
* Combines this entry with other enum entry.
* @param e enum entry
* @return new flag
*/
public ToolButtonFeatures combined(ToolButtonFeature e) {
return new ToolButtonFeatures(this, e);
}
/**
* Creates a new {@link ToolButtonFeatures} from the entries.
* @param values entries
* @return new flag
*/
public static ToolButtonFeatures flags(ToolButtonFeature ... values) {
return new ToolButtonFeatures(values);
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static ToolButtonFeature resolve(int value) {
switch (value) {
case 0: return None;
case 1: return Arrow;
case 4: return Menu;
case 8: return PopupDelay;
case 16: return HasMenu;
default: throw new io.qt.QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* QFlags type for enum {@link ToolButtonFeature}
*/
public static final class ToolButtonFeatures extends io.qt.QFlags implements Comparable {
private static final long serialVersionUID = 0xd8647a03b34eedb0L;
/**
* Creates a new ToolButtonFeatures where the flags in args
are set.
* @param args enum entries
*/
public ToolButtonFeatures(ToolButtonFeature ... args){
super(args);
}
/**
* Creates a new ToolButtonFeatures with given value
.
* @param value
*/
public ToolButtonFeatures(int value) {
super(value);
}
/**
* Combines this flags with enum entry.
* @param e enum entry
* @return new ToolButtonFeatures
*/
@Override
public final ToolButtonFeatures combined(ToolButtonFeature e){
return new ToolButtonFeatures(value() | e.value());
}
/**
* Sets the flag e
* @param e enum entry
* @return this
*/
public final ToolButtonFeatures setFlag(ToolButtonFeature 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 ToolButtonFeatures setFlag(ToolButtonFeature e, boolean on){
super.setFlag(e, on);
return this;
}
/**
* Returns an array of flag objects represented by this ToolButtonFeatures.
* @return array of enum entries
*/
@Override
public final ToolButtonFeature[] flags(){
return super.flags(ToolButtonFeature.values());
}
/**
* {@inheritDoc}
*/
@Override
public final ToolButtonFeatures clone(){
return new ToolButtonFeatures(value());
}
/**
* {@inheritDoc}
*/
@Override
public final int compareTo(ToolButtonFeatures other){
return Integer.compare(value(), other.value());
}
}
/**
* See QStyleOptionToolButton::QStyleOptionToolButton()
*/
public QStyleOptionToolButton(){
super((QPrivateConstructor)null);
initialize_native(this);
}
private native static void initialize_native(QStyleOptionToolButton instance);
/**
* See QStyleOptionToolButton::QStyleOptionToolButton(QStyleOptionToolButton)
*/
public QStyleOptionToolButton(io.qt.widgets.QStyleOptionToolButton other){
super((QPrivateConstructor)null);
initialize_native(this, other);
}
private native static void initialize_native(QStyleOptionToolButton instance, io.qt.widgets.QStyleOptionToolButton other);
@io.qt.QtUninvokable
public final void set(io.qt.widgets.QStyleOptionToolButton arg__1){
set_native_cref_QStyleOptionToolButton(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(arg__1));
}
@io.qt.QtUninvokable
private native void set_native_cref_QStyleOptionToolButton(long __this__nativeId, long arg__1);
/**
* The direction of the arrow for the tool button
* See QStyleOptionToolButton::arrowType
*/
@io.qt.QtUninvokable
public final void setArrowType(io.qt.core.Qt.ArrowType arrowType){
setArrowType_native_cref_Qt_ArrowType(QtJambi_LibraryUtilities.internal.nativeId(this), arrowType.value());
}
@io.qt.QtUninvokable
private native void setArrowType_native_cref_Qt_ArrowType(long __this__nativeId, int arrowType);
/**
* The direction of the arrow for the tool button
* See QStyleOptionToolButton::arrowType
*/
@io.qt.QtUninvokable
public final io.qt.core.Qt.ArrowType arrowType(){
return io.qt.core.Qt.ArrowType.resolve(arrowType_native(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@io.qt.QtUninvokable
private native int arrowType_native(long __this__nativeId);
/**
* Overloaded function for {@link #setFeatures(io.qt.widgets.QStyleOptionToolButton.ToolButtonFeatures)}.
*/
@io.qt.QtUninvokable
public final void setFeatures(io.qt.widgets.QStyleOptionToolButton.ToolButtonFeature ... features){
setFeatures(new io.qt.widgets.QStyleOptionToolButton.ToolButtonFeatures(features));
}
/**
* OR combination of the tool button's features
* See QStyleOptionToolButton::features
*/
@io.qt.QtUninvokable
public final void setFeatures(io.qt.widgets.QStyleOptionToolButton.ToolButtonFeatures features){
setFeatures_native_cref_QFlags_QStyleOptionToolButton_ToolButtonFeature_(QtJambi_LibraryUtilities.internal.nativeId(this), features.value());
}
@io.qt.QtUninvokable
private native void setFeatures_native_cref_QFlags_QStyleOptionToolButton_ToolButtonFeature_(long __this__nativeId, int features);
/**
* OR combination of the tool button's features
* See QStyleOptionToolButton::features
*/
@io.qt.QtUninvokable
public final io.qt.widgets.QStyleOptionToolButton.ToolButtonFeatures features(){
return new io.qt.widgets.QStyleOptionToolButton.ToolButtonFeatures(features_native(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@io.qt.QtUninvokable
private native int features_native(long __this__nativeId);
/**
* The font that is used for the text
* See QStyleOptionToolButton::font
*/
@io.qt.QtUninvokable
public final void setFont(io.qt.gui.QFont font){
setFont_native_cref_QFont(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(font));
}
@io.qt.QtUninvokable
private native void setFont_native_cref_QFont(long __this__nativeId, long font);
/**
* The font that is used for the text
* See QStyleOptionToolButton::font
*/
@io.qt.QtUninvokable
public final io.qt.gui.QFont font(){
return font_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native io.qt.gui.QFont font_native(long __this__nativeId);
/**
* The icon for the tool button
* See QStyleOptionToolButton::icon
*/
@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 for the tool button
* See QStyleOptionToolButton::icon
*/
@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 tool button
* See QStyleOptionToolButton::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 tool button
* See QStyleOptionToolButton::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 position of the tool button
* See QStyleOptionToolButton::pos
*/
@io.qt.QtUninvokable
public final void setPos(io.qt.core.QPoint pos){
setPos_native_cref_QPoint(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(pos));
}
@io.qt.QtUninvokable
private native void setPos_native_cref_QPoint(long __this__nativeId, long pos);
/**
* The position of the tool button
* See QStyleOptionToolButton::pos
*/
@io.qt.QtUninvokable
public final io.qt.core.QPoint pos(){
return pos_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native io.qt.core.QPoint pos_native(long __this__nativeId);
/**
* The text of the tool button
* See QStyleOptionToolButton::text
*/
@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 tool button
* See QStyleOptionToolButton::text
*/
@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);
/**
* Qt::ToolButtonStyle value describing the appearance of the tool button
* See QStyleOptionToolButton::toolButtonStyle
*/
@io.qt.QtUninvokable
public final void setToolButtonStyle(io.qt.core.Qt.ToolButtonStyle toolButtonStyle){
setToolButtonStyle_native_cref_Qt_ToolButtonStyle(QtJambi_LibraryUtilities.internal.nativeId(this), toolButtonStyle.value());
}
@io.qt.QtUninvokable
private native void setToolButtonStyle_native_cref_Qt_ToolButtonStyle(long __this__nativeId, int toolButtonStyle);
/**
* Qt::ToolButtonStyle value describing the appearance of the tool button
* See QStyleOptionToolButton::toolButtonStyle
*/
@io.qt.QtUninvokable
public final io.qt.core.Qt.ToolButtonStyle toolButtonStyle(){
return io.qt.core.Qt.ToolButtonStyle.resolve(toolButtonStyle_native(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@io.qt.QtUninvokable
private native int toolButtonStyle_native(long __this__nativeId);
/**
* Constructor for internal use only.
* @param p expected to be null
.
*/
@io.qt.NativeAccess
protected QStyleOptionToolButton(QPrivateConstructor p) { super(p); }
@Override
public QStyleOptionToolButton clone() {
return clone_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
private native QStyleOptionToolButton clone_native(long __this_nativeId);
}