All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.qt.widgets.QFontDialog Maven / Gradle / Ivy

There is a newer version: 6.8.2
Show newest version
package io.qt.widgets;


/**
 * 

Dialog widget for selecting a font

*

Java wrapper for Qt class QFontDialog

*/ public class QFontDialog extends io.qt.widgets.QDialog { /** * This variable stores the meta-object for the class. */ public static final io.qt.core.QMetaObject staticMetaObject = io.qt.core.QMetaObject.forType(QFontDialog.class); /** *

Java wrapper for Qt enum QFontDialog::FontDialogOption

* * @see FontDialogOptions */ public enum FontDialogOption implements io.qt.QtFlagEnumerator { NoButtons(1), DontUseNativeDialog(2), ScalableFonts(4), NonScalableFonts(8), MonospacedFonts(16), ProportionalFonts(32); private FontDialogOption(int value) { this.value = value; } /** * {@inheritDoc} */ public int value() { return value; } /** * Create a QFlags of the enum entry. * @return QFlags */ public FontDialogOptions asFlags() { return new FontDialogOptions(value); } /** * Combines this entry with other enum entry. * @param e enum entry * @return new flag */ public FontDialogOptions combined(FontDialogOption e) { return new FontDialogOptions(this, e); } /** * Creates a new {@link FontDialogOptions} from the entries. * @param values entries * @return new flag */ public static FontDialogOptions flags(FontDialogOption ... values) { return new FontDialogOptions(values); } /** * Returns the corresponding enum entry for the given value. * @param value * @return enum entry */ public static FontDialogOption resolve(int value) { switch (value) { case 1: return NoButtons; case 2: return DontUseNativeDialog; case 4: return ScalableFonts; case 8: return NonScalableFonts; case 16: return MonospacedFonts; case 32: return ProportionalFonts; default: throw new io.qt.QNoSuchEnumValueException(value); } } private final int value; } /** * QFlags type for enum {@link FontDialogOption} */ public static final class FontDialogOptions extends io.qt.QFlags implements Comparable { private static final long serialVersionUID = 0x71e027b2661fdcbfL; /** * Creates a new FontDialogOptions where the flags in args are set. * @param args enum entries */ public FontDialogOptions(FontDialogOption ... args){ super(args); } /** * Creates a new FontDialogOptions with given value. * @param value */ public FontDialogOptions(int value) { super(value); } /** * Combines this flags with enum entry. * @param e enum entry * @return new FontDialogOptions */ @Override public final FontDialogOptions combined(FontDialogOption e){ return new FontDialogOptions(value() | e.value()); } /** * Sets the flag e * @param e enum entry * @return this */ public final FontDialogOptions setFlag(FontDialogOption 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 FontDialogOptions setFlag(FontDialogOption e, boolean on){ super.setFlag(e, on); return this; } /** * Returns an array of flag objects represented by this FontDialogOptions. * @return array of enum entries */ @Override public final FontDialogOption[] flags(){ return super.flags(FontDialogOption.values()); } /** * {@inheritDoc} */ @Override public final FontDialogOptions clone(){ return new FontDialogOptions(value()); } /** * {@inheritDoc} */ @Override public final int compareTo(FontDialogOptions other){ return Integer.compare(value(), other.value()); } } /** *

See QFontDialog::currentFontChanged(QFont)

*/ @io.qt.QtPropertyNotify(name="currentFont") public final Signal1 currentFontChanged = new Signal1<>(); /** *

See QFontDialog::fontSelected(QFont)

*/ public final Signal1 fontSelected = new Signal1<>(); /** *

Overloaded constructor for {@link #QFontDialog(io.qt.widgets.QWidget)} * with parent = null.

*/ public QFontDialog() { this((io.qt.widgets.QWidget)null); } /** *

See QFontDialog::QFontDialog(QWidget*)

*/ public QFontDialog(io.qt.widgets.QWidget parent){ super((QPrivateConstructor)null); initialize_native(this, parent); } private native static void initialize_native(QFontDialog instance, io.qt.widgets.QWidget parent); /** *

Overloaded constructor for {@link #QFontDialog(io.qt.gui.QFont, io.qt.widgets.QWidget)} * with parent = null.

*/ public QFontDialog(io.qt.gui.QFont initial) { this(initial, (io.qt.widgets.QWidget)null); } /** *

See QFontDialog::QFontDialog(QFont,QWidget*)

*/ public QFontDialog(io.qt.gui.QFont initial, io.qt.widgets.QWidget parent){ super((QPrivateConstructor)null); initialize_native(this, initial, parent); } private native static void initialize_native(QFontDialog instance, io.qt.gui.QFont initial, io.qt.widgets.QWidget parent); /** *

See QFontDialog::currentFont()const

*/ @io.qt.QtPropertyReader(name="currentFont") @io.qt.QtUninvokable public final io.qt.gui.QFont currentFont(){ return currentFont_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)); } @io.qt.QtUninvokable private native io.qt.gui.QFont currentFont_native_constfct(long __this__nativeId); /** *

See QFontDialog::open(QObject*,const char*)

*/ @io.qt.QtUninvokable public final void open(io.qt.core.QObject receiver, java.lang.String member){ if(!member.startsWith("1") || !member.startsWith("2")) member = '1'+member; open_native_QObject_ptr_const_char_ptr(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(receiver), member); } @io.qt.QtUninvokable private native void open_native_QObject_ptr_const_char_ptr(long __this__nativeId, long receiver, java.lang.String member); /** *

See QFontDialog::options()const

*/ @io.qt.QtPropertyReader(name="options") @io.qt.QtUninvokable public final io.qt.widgets.QFontDialog.FontDialogOptions options(){ return new io.qt.widgets.QFontDialog.FontDialogOptions(options_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this))); } @io.qt.QtUninvokable private native int options_native_constfct(long __this__nativeId); /** *

See QFontDialog::selectedFont()const

*/ @io.qt.QtUninvokable public final io.qt.gui.QFont selectedFont(){ return selectedFont_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)); } @io.qt.QtUninvokable private native io.qt.gui.QFont selectedFont_native_constfct(long __this__nativeId); /** *

See QFontDialog::setCurrentFont(QFont)

*/ @io.qt.QtPropertyWriter(name="currentFont") @io.qt.QtUninvokable public final void setCurrentFont(io.qt.gui.QFont font){ setCurrentFont_native_cref_QFont(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(font)); } @io.qt.QtUninvokable private native void setCurrentFont_native_cref_QFont(long __this__nativeId, long font); /** *

Overloaded function for {@link #setOption(io.qt.widgets.QFontDialog.FontDialogOption, boolean)} * with on = true.

*/ @io.qt.QtUninvokable public final void setOption(io.qt.widgets.QFontDialog.FontDialogOption option) { setOption(option, (boolean)true); } /** *

See QFontDialog::setOption(QFontDialog::FontDialogOption,bool)

*/ @io.qt.QtUninvokable public final void setOption(io.qt.widgets.QFontDialog.FontDialogOption option, boolean on){ setOption_native_QFontDialog_FontDialogOption_bool(QtJambi_LibraryUtilities.internal.nativeId(this), option.value(), on); } @io.qt.QtUninvokable private native void setOption_native_QFontDialog_FontDialogOption_bool(long __this__nativeId, int option, boolean on); /** *

Overloaded function for {@link #setOptions(io.qt.widgets.QFontDialog.FontDialogOptions)}.

*/ @io.qt.QtUninvokable public final void setOptions(io.qt.widgets.QFontDialog.FontDialogOption ... options){ setOptions(new io.qt.widgets.QFontDialog.FontDialogOptions(options)); } /** *

See QFontDialog::setOptions(FontDialogOptions)

*/ @io.qt.QtPropertyWriter(name="options") @io.qt.QtUninvokable public final void setOptions(io.qt.widgets.QFontDialog.FontDialogOptions options){ setOptions_native_QFlags_QFontDialog_FontDialogOption_(QtJambi_LibraryUtilities.internal.nativeId(this), options.value()); } @io.qt.QtUninvokable private native void setOptions_native_QFlags_QFontDialog_FontDialogOption_(long __this__nativeId, int options); /** *

See QFontDialog::testOption(QFontDialog::FontDialogOption)const

*/ @io.qt.QtUninvokable public final boolean testOption(io.qt.widgets.QFontDialog.FontDialogOption option){ return testOption_native_QFontDialog_FontDialogOption_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), option.value()); } @io.qt.QtUninvokable private native boolean testOption_native_QFontDialog_FontDialogOption_constfct(long __this__nativeId, int option); /** *

See QWidget::changeEvent(QEvent*)

*/ @io.qt.QtUninvokable protected void changeEvent(io.qt.core.QEvent event){ changeEvent_native_QEvent_ptr(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(event)); } @io.qt.QtUninvokable private native void changeEvent_native_QEvent_ptr(long __this__nativeId, long event); /** *

See QDialog::done(int)

*/ @io.qt.QtUninvokable public void done(int result){ done_native_int(QtJambi_LibraryUtilities.internal.nativeId(this), result); } @io.qt.QtUninvokable private native void done_native_int(long __this__nativeId, int result); /** *

See QObject::eventFilter(QObject*,QEvent*)

*/ @io.qt.QtUninvokable public boolean eventFilter(io.qt.core.QObject object, io.qt.core.QEvent event){ return eventFilter_native_QObject_ptr_QEvent_ptr(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(object), QtJambi_LibraryUtilities.internal.checkedNativeId(event)); } @io.qt.QtUninvokable private native boolean eventFilter_native_QObject_ptr_QEvent_ptr(long __this__nativeId, long object, long event); /** *

See QWidget::setVisible(bool)

*/ @io.qt.QtUninvokable public void setVisible(boolean visible){ setVisible_native_bool(QtJambi_LibraryUtilities.internal.nativeId(this), visible); } @io.qt.QtUninvokable private native void setVisible_native_bool(long __this__nativeId, boolean visible); /** *

Overloaded function for {@link #getFont(io.qt.widgets.QWidget)} * with parent = null.

*/ public static io.qt.gui.QFont getFont() { return getFont((io.qt.widgets.QWidget)null); } /** *

See QFontDialog::getFont(bool*,QWidget*)

*/ public static io.qt.gui.QFont getFont(io.qt.widgets.QWidget parent){ return getFont_native_bool_ptr_QWidget_ptr(QtJambi_LibraryUtilities.internal.checkedNativeId(parent)); } private native static io.qt.gui.QFont getFont_native_bool_ptr_QWidget_ptr(long parent); /** *

Overloaded function for {@link #getFont(io.qt.gui.QFont, io.qt.widgets.QWidget, java.lang.String, io.qt.widgets.QFontDialog.FontDialogOptions)}.

*/ public static io.qt.gui.QFont getFont(io.qt.gui.QFont initial, io.qt.widgets.QWidget parent, java.lang.String title, io.qt.widgets.QFontDialog.FontDialogOption ... options){ return getFont(initial, parent, title, new io.qt.widgets.QFontDialog.FontDialogOptions(options)); } /** *

Overloaded function for {@link #getFont(io.qt.gui.QFont, io.qt.widgets.QWidget, java.lang.String, io.qt.widgets.QFontDialog.FontDialogOptions)} * with options = new io.qt.widgets.QFontDialog.FontDialogOptions(0).

*/ public static io.qt.gui.QFont getFont(io.qt.gui.QFont initial, io.qt.widgets.QWidget parent, java.lang.String title) { return getFont(initial, parent, title, new io.qt.widgets.QFontDialog.FontDialogOptions(0)); } /** *

Overloaded function for {@link #getFont(io.qt.gui.QFont, io.qt.widgets.QWidget, java.lang.String, io.qt.widgets.QFontDialog.FontDialogOptions)}

*

with:

    *
  • title = ""
  • *
  • options = new io.qt.widgets.QFontDialog.FontDialogOptions(0)
  • *
*/ public static io.qt.gui.QFont getFont(io.qt.gui.QFont initial, io.qt.widgets.QWidget parent) { return getFont(initial, parent, "", new io.qt.widgets.QFontDialog.FontDialogOptions(0)); } /** *

Overloaded function for {@link #getFont(io.qt.gui.QFont, io.qt.widgets.QWidget, java.lang.String, io.qt.widgets.QFontDialog.FontDialogOptions)}

*

with:

    *
  • parent = null
  • *
  • title = ""
  • *
  • options = new io.qt.widgets.QFontDialog.FontDialogOptions(0)
  • *
*/ public static io.qt.gui.QFont getFont(io.qt.gui.QFont initial) { return getFont(initial, (io.qt.widgets.QWidget)null, "", new io.qt.widgets.QFontDialog.FontDialogOptions(0)); } /** *

See QFontDialog::getFont(bool*,QFont,QWidget*,QString,FontDialogOptions)

*/ public static io.qt.gui.QFont getFont(io.qt.gui.QFont initial, io.qt.widgets.QWidget parent, java.lang.String title, io.qt.widgets.QFontDialog.FontDialogOptions options){ return getFont_native_bool_ptr_cref_QFont_QWidget_ptr_cref_QString_QFlags_QFontDialog_FontDialogOption_(QtJambi_LibraryUtilities.internal.checkedNativeId(initial), QtJambi_LibraryUtilities.internal.checkedNativeId(parent), title, options.value()); } private native static io.qt.gui.QFont getFont_native_bool_ptr_cref_QFont_QWidget_ptr_cref_QString_QFlags_QFontDialog_FontDialogOption_(long initial, long parent, java.lang.String title, int options); /** * Constructor for internal use only. * @param p expected to be null. */ @io.qt.NativeAccess protected QFontDialog(QPrivateConstructor p) { super(p); } /** * Constructor for internal use only. * It is not allowed to call the declarative constructor from inside Java. */ @io.qt.NativeAccess protected QFontDialog(QDeclarativeConstructor constructor) { super((QPrivateConstructor)null); initialize_native(this, constructor); } @io.qt.QtUninvokable private static native void initialize_native(QFontDialog instance, QDeclarativeConstructor constructor); /** *

See QFontDialog::open(QObject *, const char *)

*/ @io.qt.QtUninvokable public final void open(io.qt.core.QMetaObject.Slot1 selectedSlot) { io.qt.core.QMetaMethod metaMethod = io.qt.core.QMetaMethod.fromMethod(java.util.Objects.requireNonNull(selectedSlot)); if(metaMethod==null || !metaMethod.isValid()) { throw new IllegalArgumentException("Unable to detect slot for given handle."); } if(metaMethod.parameterCount()!=1) { throw new IllegalArgumentException("Connected method does not take a single argument: "+metaMethod.cppMethodSignature()); } if(metaMethod.parameterType(0)!=io.qt.core.QMetaType.Type.QFont.value()) { throw new IllegalArgumentException("Method does not take a single QFont argument: "+metaMethod.cppMethodSignature()); } io.qt.core.QObject object = QtJambi_LibraryUtilities.internal.lambdaContext(selectedSlot); if(object==null) { throw new IllegalArgumentException("Unable to determine QObject from given slot handle."); } open(object, metaMethod); } /** *

See QFontDialog::open(QObject *, const char *)

*/ @io.qt.QtUninvokable public final void open(io.qt.core.QMetaObject.Connectable1 selectedSignal) { io.qt.core.QMetaMethod metaMethod = io.qt.core.QMetaMethod.fromSignal(selectedSignal); if(metaMethod==null || !metaMethod.isValid()) { throw new IllegalArgumentException("Unable to detect signal for given handle."); } if(metaMethod.parameterCount()!=1) { throw new IllegalArgumentException("Connected method does not take a single argument: "+metaMethod.cppMethodSignature()); } if(metaMethod.parameterType(0)!=io.qt.core.QMetaType.Type.QFont.value()) { throw new IllegalArgumentException("Method does not take a single QFont argument: "+metaMethod.cppMethodSignature()); } if(!(selectedSignal.containingObject() instanceof io.qt.core.QObject)) { throw new IllegalArgumentException("Unable to determine QObject from given signal handle."); } open((io.qt.core.QObject)selectedSignal.containingObject(), metaMethod); } private native void open(io.qt.core.QObject obj, io.qt.core.QMetaMethod metaMethod); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy