io.qt.widgets.QStyleOptionToolButton Maven / Gradle / Ivy
Show all versions of qtjambi Show documentation
package io.qt.widgets;
import io.qt.*;
/**
* 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
*/
@QtRejectedEntries({"MenuButtonPopup"})
public enum ToolButtonFeature implements QtFlagEnumerator {
/**
* Representing QStyleOptionToolButton:: None
*/
None(0),
/**
* Representing QStyleOptionToolButton:: Arrow
*/
Arrow(1),
/**
* Representing QStyleOptionToolButton:: Menu
*/
Menu(4),
/**
* Representing QStyleOptionToolButton:: MenuButtonPopup
*/
MenuButtonPopup(4),
/**
* Representing QStyleOptionToolButton:: PopupDelay
*/
PopupDelay(8),
/**
* Representing QStyleOptionToolButton:: HasMenu
*/
HasMenu(16);
static {
QtJambi_LibraryUtilities.initialize();
}
private ToolButtonFeature(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
@Override
public int value() {
return value;
}
/**
* Create a QFlags of the enum entry.
* @return QFlags
*/
@Override
public @NonNull ToolButtonFeatures asFlags() {
return new ToolButtonFeatures(value);
}
/**
* Combines this entry with other enum entry.
* @param e enum entry
* @return new flag
*/
public @NonNull ToolButtonFeatures combined(@NonNull ToolButtonFeature 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 ToolButtonFeatures cleared(@NonNull ToolButtonFeature e) {
return asFlags().setFlag(e, false);
}
/**
* Creates a new {@link ToolButtonFeatures} from the entries.
* @param values entries
* @return new flag
*/
public static @NonNull ToolButtonFeatures flags(@Nullable ToolButtonFeature @NonNull... values) {
return new ToolButtonFeatures(values);
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static @NonNull 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 QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* {@link QFlags} type for enum {@link ToolButtonFeature}
*/
public static final class ToolButtonFeatures extends QFlags implements Comparable {
private static final long serialVersionUID = 0xd8647a03b34eedb0L;
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* Creates a new ToolButtonFeatures where the flags in args
are set.
* @param args enum entries
*/
public ToolButtonFeatures(@Nullable ToolButtonFeature @NonNull... 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 @NonNull ToolButtonFeatures combined(@StrictNonNull ToolButtonFeature e){
return new ToolButtonFeatures(value() | e.value());
}
/**
* Sets the flag e
* @param e enum entry
* @return this
*/
@Override
public final @NonNull ToolButtonFeatures setFlag(@Nullable ToolButtonFeature e){
return setFlag(e, true);
}
/**
* Sets or clears the flag flag
* @param e enum entry
* @param on set (true) or clear (false)
* @return this
*/
@Override
public final @NonNull ToolButtonFeatures setFlag(@Nullable ToolButtonFeature 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 ToolButtonFeatures.
* @return array of enum entries
*/
@Override
public final @NonNull ToolButtonFeature @NonNull[] flags(){
return super.flags(ToolButtonFeature.values());
}
/**
* {@inheritDoc}
*/
@Override
public final @NonNull ToolButtonFeatures clone(){
return new ToolButtonFeatures(value());
}
/**
* {@inheritDoc}
*/
@Override
public final int compareTo(@StrictNonNull 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.@NonNull QStyleOptionToolButton other){
super((QPrivateConstructor)null);
initialize_native(this, other);
}
private native static void initialize_native(QStyleOptionToolButton instance, io.qt.widgets.QStyleOptionToolButton other);
/**
* See QStyleOptionToolButton:: operator=(QStyleOptionToolButton)
*/
@QtUninvokable
public final void assign(io.qt.widgets.@NonNull QStyleOptionToolButton arg__1){
assign_native_cref_QStyleOptionToolButton(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(arg__1));
}
@QtUninvokable
private native void assign_native_cref_QStyleOptionToolButton(long __this__nativeId, long arg__1);
/**
* The direction of the arrow for the tool button
* See QStyleOptionToolButton:: arrowType
*/
@QtUninvokable
public final void setArrowType(io.qt.core.Qt.@NonNull ArrowType arrowType){
setArrowType_native_cref_Qt_ArrowType(QtJambi_LibraryUtilities.internal.nativeId(this), arrowType.value());
}
@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
*/
@QtUninvokable
public final io.qt.core.Qt.@NonNull ArrowType arrowType(){
return io.qt.core.Qt.ArrowType.resolve(arrowType_native(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@QtUninvokable
private native int arrowType_native(long __this__nativeId);
/**
* OR combination of the tool button's features
* See QStyleOptionToolButton:: features
*/
@QtUninvokable
public final void setFeatures(io.qt.widgets.QStyleOptionToolButton.@NonNull ToolButtonFeatures features){
setFeatures_native_cref_QStyleOptionToolButton_ToolButtonFeatures(QtJambi_LibraryUtilities.internal.nativeId(this), features.value());
}
@QtUninvokable
private native void setFeatures_native_cref_QStyleOptionToolButton_ToolButtonFeatures(long __this__nativeId, int features);
/**
* OR combination of the tool button's features
* See QStyleOptionToolButton:: features
*/
@QtUninvokable
public final io.qt.widgets.QStyleOptionToolButton.@NonNull ToolButtonFeatures features(){
return new io.qt.widgets.QStyleOptionToolButton.ToolButtonFeatures(features_native(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@QtUninvokable
private native int features_native(long __this__nativeId);
/**
* The font that is used for the text
* See QStyleOptionToolButton:: font
*/
@QtUninvokable
public final void setFont(io.qt.gui.@NonNull QFont font){
setFont_native_cref_QFont(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(font));
}
@QtUninvokable
private native void setFont_native_cref_QFont(long __this__nativeId, long font);
/**
* The font that is used for the text
* See QStyleOptionToolButton:: font
*/
@QtUninvokable
public final io.qt.gui.@NonNull QFont font(){
return font_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.gui.QFont font_native(long __this__nativeId);
/**
* The icon for the tool button
* See QStyleOptionToolButton:: icon
*/
@QtUninvokable
public final void setIcon(io.qt.gui.@NonNull QIcon icon){
setIcon_native_cref_QIcon(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(icon));
}
@QtUninvokable
private native void setIcon_native_cref_QIcon(long __this__nativeId, long icon);
/**
* The icon for the tool button
* See QStyleOptionToolButton:: icon
*/
@QtUninvokable
public final io.qt.gui.@NonNull QIcon icon(){
return icon_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.gui.QIcon icon_native(long __this__nativeId);
/**
* The size of the icon for the tool button
* See QStyleOptionToolButton:: iconSize
*/
@QtUninvokable
public final void setIconSize(io.qt.core.@NonNull QSize iconSize){
setIconSize_native_cref_QSize(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(iconSize));
}
@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
*/
@QtUninvokable
public final io.qt.core.@NonNull QSize iconSize(){
return iconSize_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.core.QSize iconSize_native(long __this__nativeId);
/**
* The position of the tool button
* See QStyleOptionToolButton:: pos
*/
@QtUninvokable
public final void setPos(io.qt.core.@NonNull QPoint pos){
setPos_native_cref_QPoint(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(pos));
}
@QtUninvokable
private native void setPos_native_cref_QPoint(long __this__nativeId, long pos);
/**
* The position of the tool button
* See QStyleOptionToolButton:: pos
*/
@QtUninvokable
public final io.qt.core.@NonNull QPoint pos(){
return pos_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.core.QPoint pos_native(long __this__nativeId);
/**
* The text of the tool button
* See QStyleOptionToolButton:: text
*/
@QtUninvokable
public final void setText(java.lang.@NonNull String text){
setText_native_cref_QString(QtJambi_LibraryUtilities.internal.nativeId(this), text);
}
@QtUninvokable
private native void setText_native_cref_QString(long __this__nativeId, java.lang.String text);
/**
* The text of the tool button
* See QStyleOptionToolButton:: text
*/
@QtUninvokable
public final java.lang.@NonNull String text(){
return text_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native java.lang.String text_native(long __this__nativeId);
/**
* Qt::ToolButtonStyle value describing the appearance of the tool button
* See QStyleOptionToolButton:: toolButtonStyle
*/
@QtUninvokable
public final void setToolButtonStyle(io.qt.core.Qt.@NonNull ToolButtonStyle toolButtonStyle){
setToolButtonStyle_native_cref_Qt_ToolButtonStyle(QtJambi_LibraryUtilities.internal.nativeId(this), toolButtonStyle.value());
}
@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
*/
@QtUninvokable
public final io.qt.core.Qt.@NonNull ToolButtonStyle toolButtonStyle(){
return io.qt.core.Qt.ToolButtonStyle.resolve(toolButtonStyle_native(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@QtUninvokable
private native int toolButtonStyle_native(long __this__nativeId);
/**
* Constructor for internal use only.
* @param p expected to be null
.
* @hidden
*/
@NativeAccess
protected QStyleOptionToolButton(QPrivateConstructor p) { super(p); }
/**
* Creates and returns a copy of this object.
See QStyleOptionToolButton:: QStyleOptionToolButton(QStyleOptionToolButton)
*/
@QtUninvokable
@Override
public QStyleOptionToolButton clone() {
return clone_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
private static native QStyleOptionToolButton clone_native(long __this_nativeId);
/**
* @deprecated Use {@link #assign(io.qt.widgets.QStyleOptionToolButton)} instead.
*/
@Deprecated
@QtUninvokable
public final void set(io.qt.widgets.@NonNull QStyleOptionToolButton arg__1) {
assign(arg__1);
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #arrowType()} instead.
*/
@QtUninvokable
public final io.qt.core.Qt.@NonNull ArrowType getArrowType() {
return arrowType();
}
/**
* Overloaded function for {@link #setFeatures(io.qt.widgets.QStyleOptionToolButton.ToolButtonFeatures)}.
*/
@QtUninvokable
public final void setFeatures(io.qt.widgets.QStyleOptionToolButton.@NonNull ToolButtonFeature @NonNull... features) {
setFeatures(new io.qt.widgets.QStyleOptionToolButton.ToolButtonFeatures(features));
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #features()} instead.
*/
@QtUninvokable
public final io.qt.widgets.QStyleOptionToolButton.@NonNull ToolButtonFeatures getFeatures() {
return features();
}
/**
* Overloaded function for {@link #setFont(io.qt.gui.QFont)}.
*/
@QtUninvokable
public final void setFont(java.lang.@NonNull String font) {
setFont(new io.qt.gui.QFont(font));
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #font()} instead.
*/
@QtUninvokable
public final io.qt.gui.@NonNull QFont getFont() {
return font();
}
/**
* Overloaded function for {@link #setIcon(io.qt.gui.QIcon)}.
*/
@QtUninvokable
public final void setIcon(io.qt.gui.@NonNull QPixmap icon) {
setIcon(new io.qt.gui.QIcon(icon));
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #icon()} instead.
*/
@QtUninvokable
public final io.qt.gui.@NonNull QIcon getIcon() {
return icon();
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #iconSize()} instead.
*/
@QtUninvokable
public final io.qt.core.@NonNull QSize getIconSize() {
return iconSize();
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #pos()} instead.
*/
@QtUninvokable
public final io.qt.core.@NonNull QPoint getPos() {
return pos();
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #text()} instead.
*/
@QtUninvokable
public final java.lang.@NonNull String getText() {
return text();
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #toolButtonStyle()} instead.
*/
@QtUninvokable
public final io.qt.core.Qt.@NonNull ToolButtonStyle getToolButtonStyle() {
return toolButtonStyle();
}
}