io.qt.widgets.QStyleOptionMenuItem Maven / Gradle / Ivy
Show all versions of qtjambi Show documentation
package io.qt.widgets;
import io.qt.*;
/**
* Used to describe the parameter necessary for drawing a menu item
* Java wrapper for Qt class QStyleOptionMenuItem
*/
public class QStyleOptionMenuItem extends io.qt.widgets.QStyleOption
implements java.lang.Cloneable
{
/**
* Java wrapper for Qt enum QStyleOptionMenuItem::CheckType
*/
public enum CheckType implements QtEnumerator {
/**
* Representing QStyleOptionMenuItem:: NotCheckable
*/
NotCheckable(0),
/**
* Representing QStyleOptionMenuItem:: Exclusive
*/
Exclusive(1),
/**
* Representing QStyleOptionMenuItem:: NonExclusive
*/
NonExclusive(2);
static {
QtJambi_LibraryUtilities.initialize();
}
private CheckType(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
@Override
public int value() {
return value;
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static @NonNull CheckType resolve(int value) {
switch (value) {
case 0: return NotCheckable;
case 1: return Exclusive;
case 2: return NonExclusive;
default: throw new QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* Java wrapper for Qt enum QStyleOptionMenuItem::MenuItemType
*/
public enum MenuItemType implements QtEnumerator {
/**
* Representing QStyleOptionMenuItem:: Normal
*/
Normal(0),
/**
* Representing QStyleOptionMenuItem:: DefaultItem
*/
DefaultItem(1),
/**
* Representing QStyleOptionMenuItem:: Separator
*/
Separator(2),
/**
* Representing QStyleOptionMenuItem:: SubMenu
*/
SubMenu(3),
/**
* Representing QStyleOptionMenuItem:: Scroller
*/
Scroller(4),
/**
* Representing QStyleOptionMenuItem:: TearOff
*/
TearOff(5),
/**
* Representing QStyleOptionMenuItem:: Margin
*/
Margin(6),
/**
* Representing QStyleOptionMenuItem:: EmptyArea
*/
EmptyArea(7);
static {
QtJambi_LibraryUtilities.initialize();
}
private MenuItemType(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
@Override
public int value() {
return value;
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static @NonNull MenuItemType resolve(int value) {
switch (value) {
case 0: return Normal;
case 1: return DefaultItem;
case 2: return Separator;
case 3: return SubMenu;
case 4: return Scroller;
case 5: return TearOff;
case 6: return Margin;
case 7: return EmptyArea;
default: throw new QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* See QStyleOptionMenuItem:: QStyleOptionMenuItem()
*/
public QStyleOptionMenuItem(){
super((QPrivateConstructor)null);
initialize_native(this);
}
private native static void initialize_native(QStyleOptionMenuItem instance);
/**
* See QStyleOptionMenuItem:: QStyleOptionMenuItem(QStyleOptionMenuItem)
*/
public QStyleOptionMenuItem(io.qt.widgets.@NonNull QStyleOptionMenuItem other){
super((QPrivateConstructor)null);
initialize_native(this, other);
}
private native static void initialize_native(QStyleOptionMenuItem instance, io.qt.widgets.QStyleOptionMenuItem other);
/**
* See QStyleOptionMenuItem:: operator=(QStyleOptionMenuItem)
*/
@QtUninvokable
public final void assign(io.qt.widgets.@NonNull QStyleOptionMenuItem arg__1){
assign_native_cref_QStyleOptionMenuItem(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(arg__1));
}
@QtUninvokable
private native void assign_native_cref_QStyleOptionMenuItem(long __this__nativeId, long arg__1);
/**
* The type of checkmark of the menu item
* See QStyleOptionMenuItem:: checkType
*/
@QtUninvokable
public final void setCheckType(io.qt.widgets.QStyleOptionMenuItem.@NonNull CheckType checkType){
setCheckType_native_cref_QStyleOptionMenuItem_CheckType(QtJambi_LibraryUtilities.internal.nativeId(this), checkType.value());
}
@QtUninvokable
private native void setCheckType_native_cref_QStyleOptionMenuItem_CheckType(long __this__nativeId, int checkType);
/**
* The type of checkmark of the menu item
* See QStyleOptionMenuItem:: checkType
*/
@QtUninvokable
public final io.qt.widgets.QStyleOptionMenuItem.@NonNull CheckType checkType(){
return io.qt.widgets.QStyleOptionMenuItem.CheckType.resolve(checkType_native(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@QtUninvokable
private native int checkType_native(long __this__nativeId);
/**
* Whether the menu item is checked or not
* See QStyleOptionMenuItem:: checked
*/
@QtUninvokable
public final void setChecked(boolean checked){
setChecked_native_bool(QtJambi_LibraryUtilities.internal.nativeId(this), checked);
}
@QtUninvokable
private native void setChecked_native_bool(long __this__nativeId, boolean checked);
/**
* Whether the menu item is checked or not
* See QStyleOptionMenuItem:: checked
*/
@QtUninvokable
public final boolean checked(){
return checked_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean checked_native(long __this__nativeId);
/**
* The font used for the menu item text
* See QStyleOptionMenuItem:: 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 used for the menu item text
* See QStyleOptionMenuItem:: 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 menu item
* See QStyleOptionMenuItem:: 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 menu item
* See QStyleOptionMenuItem:: 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 maximum icon width for the icon in the menu item
* See QStyleOptionMenuItem:: maxIconWidth
*/
@QtUninvokable
public final void setMaxIconWidth(int maxIconWidth){
setMaxIconWidth_native_int(QtJambi_LibraryUtilities.internal.nativeId(this), maxIconWidth);
}
@QtUninvokable
private native void setMaxIconWidth_native_int(long __this__nativeId, int maxIconWidth);
/**
* The maximum icon width for the icon in the menu item
* See QStyleOptionMenuItem:: maxIconWidth
*/
@QtUninvokable
public final int maxIconWidth(){
return maxIconWidth_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native int maxIconWidth_native(long __this__nativeId);
/**
* Whether the menu as a whole has checkable items or not
* See QStyleOptionMenuItem:: menuHasCheckableItems
*/
@QtUninvokable
public final void setMenuHasCheckableItems(boolean menuHasCheckableItems){
setMenuHasCheckableItems_native_bool(QtJambi_LibraryUtilities.internal.nativeId(this), menuHasCheckableItems);
}
@QtUninvokable
private native void setMenuHasCheckableItems_native_bool(long __this__nativeId, boolean menuHasCheckableItems);
/**
* Whether the menu as a whole has checkable items or not
* See QStyleOptionMenuItem:: menuHasCheckableItems
*/
@QtUninvokable
public final boolean menuHasCheckableItems(){
return menuHasCheckableItems_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean menuHasCheckableItems_native(long __this__nativeId);
/**
* The type of menu item
* See QStyleOptionMenuItem:: menuItemType
*/
@QtUninvokable
public final void setMenuItemType(io.qt.widgets.QStyleOptionMenuItem.@NonNull MenuItemType menuItemType){
setMenuItemType_native_cref_QStyleOptionMenuItem_MenuItemType(QtJambi_LibraryUtilities.internal.nativeId(this), menuItemType.value());
}
@QtUninvokable
private native void setMenuItemType_native_cref_QStyleOptionMenuItem_MenuItemType(long __this__nativeId, int menuItemType);
/**
* The type of menu item
* See QStyleOptionMenuItem:: menuItemType
*/
@QtUninvokable
public final io.qt.widgets.QStyleOptionMenuItem.@NonNull MenuItemType menuItemType(){
return io.qt.widgets.QStyleOptionMenuItem.MenuItemType.resolve(menuItemType_native(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@QtUninvokable
private native int menuItemType_native(long __this__nativeId);
/**
* The rectangle for the entire menu
* See QStyleOptionMenuItem:: menuRect
*/
@QtUninvokable
public final void setMenuRect(io.qt.core.@NonNull QRect menuRect){
setMenuRect_native_cref_QRect(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(menuRect));
}
@QtUninvokable
private native void setMenuRect_native_cref_QRect(long __this__nativeId, long menuRect);
/**
* The rectangle for the entire menu
* See QStyleOptionMenuItem:: menuRect
*/
@QtUninvokable
public final io.qt.core.@NonNull QRect menuRect(){
return menuRect_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.core.QRect menuRect_native(long __this__nativeId);
/**
* The reserved width for the menu item's shortcut
* See QStyleOptionMenuItem:: reservedShortcutWidth
*/
@QtUninvokable
public final void setReservedShortcutWidth(int reservedShortcutWidth){
setReservedShortcutWidth_native_int(QtJambi_LibraryUtilities.internal.nativeId(this), reservedShortcutWidth);
}
@QtUninvokable
private native void setReservedShortcutWidth_native_int(long __this__nativeId, int reservedShortcutWidth);
/**
* The reserved width for the menu item's shortcut
* See QStyleOptionMenuItem:: reservedShortcutWidth
*/
@QtUninvokable
public final int reservedShortcutWidth(){
return reservedShortcutWidth_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native int reservedShortcutWidth_native(long __this__nativeId);
/**
* The text for the menu item
* See QStyleOptionMenuItem:: 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 for the menu item
* See QStyleOptionMenuItem:: 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);
/**
* Constructor for internal use only.
* @param p expected to be null
.
* @hidden
*/
@NativeAccess
protected QStyleOptionMenuItem(QPrivateConstructor p) { super(p); }
/**
* Creates and returns a copy of this object.
See QStyleOptionMenuItem:: QStyleOptionMenuItem(QStyleOptionMenuItem)
*/
@QtUninvokable
@Override
public QStyleOptionMenuItem clone() {
return clone_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
private static native QStyleOptionMenuItem clone_native(long __this_nativeId);
/**
* @deprecated Use {@link #assign(io.qt.widgets.QStyleOptionMenuItem)} instead.
*/
@Deprecated
@QtUninvokable
public final void set(io.qt.widgets.@NonNull QStyleOptionMenuItem arg__1) {
assign(arg__1);
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #checkType()} instead.
*/
@QtUninvokable
public final io.qt.widgets.QStyleOptionMenuItem.@NonNull CheckType getCheckType() {
return checkType();
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #checked()} instead.
*/
@QtUninvokable
public final boolean getChecked() {
return checked();
}
/**
* 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 #maxIconWidth()} instead.
*/
@QtUninvokable
public final int getMaxIconWidth() {
return maxIconWidth();
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #menuHasCheckableItems()} instead.
*/
@QtUninvokable
public final boolean getMenuHasCheckableItems() {
return menuHasCheckableItems();
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #menuItemType()} instead.
*/
@QtUninvokable
public final io.qt.widgets.QStyleOptionMenuItem.@NonNull MenuItemType getMenuItemType() {
return menuItemType();
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #menuRect()} instead.
*/
@QtUninvokable
public final io.qt.core.@NonNull QRect getMenuRect() {
return menuRect();
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #reservedShortcutWidth()} instead.
*/
@QtUninvokable
public final int getReservedShortcutWidth() {
return reservedShortcutWidth();
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #text()} instead.
*/
@QtUninvokable
public final java.lang.@NonNull String getText() {
return text();
}
}