
io.qt.widgets.QStyleOptionMenuItem Maven / Gradle / Ivy
package io.qt.widgets;
/**
* 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 io.qt.QtEnumerator {
NotCheckable(0),
Exclusive(1),
NonExclusive(2);
private CheckType(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 CheckType resolve(int value) {
switch (value) {
case 0: return NotCheckable;
case 1: return Exclusive;
case 2: return NonExclusive;
default: throw new io.qt.QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* Java wrapper for Qt enum QStyleOptionMenuItem::MenuItemType
*/
public enum MenuItemType implements io.qt.QtEnumerator {
Normal(0),
DefaultItem(1),
Separator(2),
SubMenu(3),
Scroller(4),
TearOff(5),
Margin(6),
EmptyArea(7);
private MenuItemType(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 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 io.qt.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.QStyleOptionMenuItem other){
super((QPrivateConstructor)null);
initialize_native(this, other);
}
private native static void initialize_native(QStyleOptionMenuItem instance, io.qt.widgets.QStyleOptionMenuItem other);
@io.qt.QtUninvokable
public final void set(io.qt.widgets.QStyleOptionMenuItem arg__1){
set_native_cref_QStyleOptionMenuItem(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(arg__1));
}
@io.qt.QtUninvokable
private native void set_native_cref_QStyleOptionMenuItem(long __this__nativeId, long arg__1);
/**
* The type of checkmark of the menu item
* See QStyleOptionMenuItem::checkType
*/
@io.qt.QtUninvokable
public final void setCheckType(io.qt.widgets.QStyleOptionMenuItem.CheckType checkType){
setCheckType_native_cref_QStyleOptionMenuItem_CheckType(QtJambi_LibraryUtilities.internal.nativeId(this), checkType.value());
}
@io.qt.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
*/
@io.qt.QtUninvokable
public final io.qt.widgets.QStyleOptionMenuItem.CheckType checkType(){
return io.qt.widgets.QStyleOptionMenuItem.CheckType.resolve(checkType_native(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@io.qt.QtUninvokable
private native int checkType_native(long __this__nativeId);
/**
* Whether the menu item is checked or not
* See QStyleOptionMenuItem::checked
*/
@io.qt.QtUninvokable
public final void setChecked(boolean checked){
setChecked_native_bool(QtJambi_LibraryUtilities.internal.nativeId(this), checked);
}
@io.qt.QtUninvokable
private native void setChecked_native_bool(long __this__nativeId, boolean checked);
/**
* Whether the menu item is checked or not
* See QStyleOptionMenuItem::checked
*/
@io.qt.QtUninvokable
public final boolean checked(){
return checked_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native boolean checked_native(long __this__nativeId);
/**
* The font used for the menu item text
* See QStyleOptionMenuItem::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 used for the menu item text
* See QStyleOptionMenuItem::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 menu item
* See QStyleOptionMenuItem::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 menu item
* See QStyleOptionMenuItem::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 maximum icon width for the icon in the menu item
* See QStyleOptionMenuItem::maxIconWidth
*/
@io.qt.QtUninvokable
public final void setMaxIconWidth(int maxIconWidth){
setMaxIconWidth_native_int(QtJambi_LibraryUtilities.internal.nativeId(this), maxIconWidth);
}
@io.qt.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
*/
@io.qt.QtUninvokable
public final int maxIconWidth(){
return maxIconWidth_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native int maxIconWidth_native(long __this__nativeId);
/**
* Whether the menu as a whole has checkable items or not
* See QStyleOptionMenuItem::menuHasCheckableItems
*/
@io.qt.QtUninvokable
public final void setMenuHasCheckableItems(boolean menuHasCheckableItems){
setMenuHasCheckableItems_native_bool(QtJambi_LibraryUtilities.internal.nativeId(this), menuHasCheckableItems);
}
@io.qt.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
*/
@io.qt.QtUninvokable
public final boolean menuHasCheckableItems(){
return menuHasCheckableItems_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native boolean menuHasCheckableItems_native(long __this__nativeId);
/**
* The type of menu item
* See QStyleOptionMenuItem::menuItemType
*/
@io.qt.QtUninvokable
public final void setMenuItemType(io.qt.widgets.QStyleOptionMenuItem.MenuItemType menuItemType){
setMenuItemType_native_cref_QStyleOptionMenuItem_MenuItemType(QtJambi_LibraryUtilities.internal.nativeId(this), menuItemType.value());
}
@io.qt.QtUninvokable
private native void setMenuItemType_native_cref_QStyleOptionMenuItem_MenuItemType(long __this__nativeId, int menuItemType);
/**
* The type of menu item
* See QStyleOptionMenuItem::menuItemType
*/
@io.qt.QtUninvokable
public final io.qt.widgets.QStyleOptionMenuItem.MenuItemType menuItemType(){
return io.qt.widgets.QStyleOptionMenuItem.MenuItemType.resolve(menuItemType_native(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@io.qt.QtUninvokable
private native int menuItemType_native(long __this__nativeId);
/**
* The rectangle for the entire menu
* See QStyleOptionMenuItem::menuRect
*/
@io.qt.QtUninvokable
public final void setMenuRect(io.qt.core.QRect menuRect){
setMenuRect_native_cref_QRect(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(menuRect));
}
@io.qt.QtUninvokable
private native void setMenuRect_native_cref_QRect(long __this__nativeId, long menuRect);
/**
* The rectangle for the entire menu
* See QStyleOptionMenuItem::menuRect
*/
@io.qt.QtUninvokable
public final io.qt.core.QRect menuRect(){
return menuRect_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native io.qt.core.QRect menuRect_native(long __this__nativeId);
/**
* The reserved width for the menu item's shortcut
* See QStyleOptionMenuItem::reservedShortcutWidth
*/
@io.qt.QtUninvokable
public final void setReservedShortcutWidth(int reservedShortcutWidth){
setReservedShortcutWidth_native_int(QtJambi_LibraryUtilities.internal.nativeId(this), reservedShortcutWidth);
}
@io.qt.QtUninvokable
private native void setReservedShortcutWidth_native_int(long __this__nativeId, int reservedShortcutWidth);
/**
* The reserved width for the menu item's shortcut
* See QStyleOptionMenuItem::reservedShortcutWidth
*/
@io.qt.QtUninvokable
public final int reservedShortcutWidth(){
return reservedShortcutWidth_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native int reservedShortcutWidth_native(long __this__nativeId);
/**
* The text for the menu item
* See QStyleOptionMenuItem::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 for the menu item
* See QStyleOptionMenuItem::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);
/**
* Constructor for internal use only.
* @param p expected to be null
.
*/
@io.qt.NativeAccess
protected QStyleOptionMenuItem(QPrivateConstructor p) { super(p); }
@Override
public QStyleOptionMenuItem clone() {
return clone_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
private native QStyleOptionMenuItem clone_native(long __this_nativeId);
}