io.qt.widgets.QFontDialog Maven / Gradle / Ivy
Show all versions of qtjambi Show documentation
package io.qt.widgets;
import io.qt.*;
/**
* 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.@NonNull QMetaObject staticMetaObject = io.qt.core.QMetaObject.forType(QFontDialog.class);
/**
* Java wrapper for Qt enum QFontDialog::FontDialogOption
*
* @see FontDialogOptions
*/
public enum FontDialogOption implements QtFlagEnumerator {
/**
* Representing QFontDialog:: NoButtons
*/
NoButtons(1),
/**
* Representing QFontDialog:: DontUseNativeDialog
*/
DontUseNativeDialog(2),
/**
* Representing QFontDialog:: ScalableFonts
*/
ScalableFonts(4),
/**
* Representing QFontDialog:: NonScalableFonts
*/
NonScalableFonts(8),
/**
* Representing QFontDialog:: MonospacedFonts
*/
MonospacedFonts(16),
/**
* Representing QFontDialog:: ProportionalFonts
*/
ProportionalFonts(32);
static {
QtJambi_LibraryUtilities.initialize();
}
private FontDialogOption(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
public int value() {
return value;
}
/**
* Create a QFlags of the enum entry.
* @return QFlags
*/
public @NonNull FontDialogOptions asFlags() {
return new FontDialogOptions(value);
}
/**
* Combines this entry with other enum entry.
* @param e enum entry
* @return new flag
*/
public @NonNull FontDialogOptions combined(@NonNull FontDialogOption 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 FontDialogOptions cleared(@NonNull FontDialogOption e) {
return asFlags().setFlag(e, false);
}
/**
* Creates a new {@link FontDialogOptions} from the entries.
* @param values entries
* @return new flag
*/
public static @NonNull FontDialogOptions flags(@Nullable FontDialogOption @NonNull... values) {
return new FontDialogOptions(values);
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static @NonNull 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 QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* {@link QFlags} type for enum {@link FontDialogOption}
*/
public static final class FontDialogOptions extends QFlags implements Comparable {
private static final long serialVersionUID = 0x71e027b2661fdcbfL;
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* Creates a new FontDialogOptions where the flags in args
are set.
* @param args enum entries
*/
public FontDialogOptions(@Nullable FontDialogOption @NonNull... 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 @NonNull FontDialogOptions combined(@StrictNonNull FontDialogOption e){
return new FontDialogOptions(value() | e.value());
}
/**
* Sets the flag e
* @param e enum entry
* @return this
*/
public final @NonNull FontDialogOptions setFlag(@Nullable FontDialogOption e){
return setFlag(e, true);
}
/**
* Sets or clears the flag flag
* @param e enum entry
* @param on set (true) or clear (false)
* @return this
*/
public final @NonNull FontDialogOptions setFlag(@Nullable FontDialogOption 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 FontDialogOptions.
* @return array of enum entries
*/
@Override
public final @NonNull FontDialogOption @NonNull[] flags(){
return super.flags(FontDialogOption.values());
}
/**
* {@inheritDoc}
*/
@Override
public final @NonNull FontDialogOptions clone(){
return new FontDialogOptions(value());
}
/**
* {@inheritDoc}
*/
@Override
public final int compareTo(@StrictNonNull FontDialogOptions other){
return Integer.compare(value(), other.value());
}
}
/**
* See QFontDialog:: currentFontChanged(QFont)
*/
@QtPropertyNotify(name="currentFont")
public final @NonNull Signal1 currentFontChanged = new Signal1<>();
/**
* See QFontDialog:: fontSelected(QFont)
*/
public final @NonNull Signal1 fontSelected = new Signal1<>();
/**
* See QFontDialog:: QFontDialog(QFont, QWidget*)
*/
public QFontDialog(io.qt.gui.@NonNull QFont initial, io.qt.widgets.@Nullable 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:: QFontDialog(QWidget*)
*/
public QFontDialog(io.qt.widgets.@Nullable QWidget parent){
super((QPrivateConstructor)null);
initialize_native(this, parent);
}
private native static void initialize_native(QFontDialog instance, io.qt.widgets.QWidget parent);
/**
* See QFontDialog:: currentFont()const
*/
@QtPropertyReader(name="currentFont")
@QtUninvokable
public final io.qt.gui.@NonNull QFont currentFont(){
return currentFont_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.gui.QFont currentFont_native_constfct(long __this__nativeId);
/**
* See QFontDialog:: open(QObject*, const char*)
*/
@QtUninvokable
public final void open(io.qt.core.@Nullable QObject receiver, java.lang.@Nullable 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);
}
@QtUninvokable
private native void open_native_QObject_ptr_const_char_ptr(long __this__nativeId, long receiver, java.lang.String member);
/**
* See QFontDialog:: options()const
*/
@QtPropertyReader(name="options")
@QtUninvokable
public final io.qt.widgets.QFontDialog.@NonNull FontDialogOptions options(){
return new io.qt.widgets.QFontDialog.FontDialogOptions(options_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@QtUninvokable
private native int options_native_constfct(long __this__nativeId);
/**
* See QFontDialog:: selectedFont()const
*/
@QtUninvokable
public final io.qt.gui.@NonNull QFont selectedFont(){
return selectedFont_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.gui.QFont selectedFont_native_constfct(long __this__nativeId);
/**
* See QFontDialog:: setCurrentFont(QFont)
*/
@QtPropertyWriter(name="currentFont")
@QtUninvokable
public final void setCurrentFont(io.qt.gui.@NonNull QFont font){
setCurrentFont_native_cref_QFont(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(font));
}
@QtUninvokable
private native void setCurrentFont_native_cref_QFont(long __this__nativeId, long font);
/**
* See QFontDialog:: setOption(QFontDialog::FontDialogOption, bool)
*/
@QtUninvokable
public final void setOption(io.qt.widgets.QFontDialog.@NonNull FontDialogOption option, boolean on){
setOption_native_QFontDialog_FontDialogOption_bool(QtJambi_LibraryUtilities.internal.nativeId(this), option.value(), on);
}
@QtUninvokable
private native void setOption_native_QFontDialog_FontDialogOption_bool(long __this__nativeId, int option, boolean on);
/**
* See QFontDialog:: setOptions(QFontDialog::FontDialogOptions)
*/
@QtPropertyWriter(name="options")
@QtUninvokable
public final void setOptions(io.qt.widgets.QFontDialog.@NonNull FontDialogOptions options){
setOptions_native_QFontDialog_FontDialogOptions(QtJambi_LibraryUtilities.internal.nativeId(this), options.value());
}
@QtUninvokable
private native void setOptions_native_QFontDialog_FontDialogOptions(long __this__nativeId, int options);
/**
* See QFontDialog:: testOption(QFontDialog::FontDialogOption)const
*/
@QtUninvokable
public final boolean testOption(io.qt.widgets.QFontDialog.@NonNull FontDialogOption option){
return testOption_native_QFontDialog_FontDialogOption_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), option.value());
}
@QtUninvokable
private native boolean testOption_native_QFontDialog_FontDialogOption_constfct(long __this__nativeId, int option);
/**
* See QWidget:: changeEvent(QEvent*)
*/
@QtUninvokable
@Override
protected void changeEvent(io.qt.core.@Nullable QEvent event){
changeEvent_native_QEvent_ptr(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(event));
}
@QtUninvokable
private native void changeEvent_native_QEvent_ptr(long __this__nativeId, long event);
/**
*
*/
@QtUninvokable
@Override
public void done(int result){
done_native_int(QtJambi_LibraryUtilities.internal.nativeId(this), result);
}
@QtUninvokable
private native void done_native_int(long __this__nativeId, int result);
/**
* See QObject:: eventFilter(QObject*, QEvent*)
*/
@QtUninvokable
@Override
public boolean eventFilter(io.qt.core.@Nullable QObject object, io.qt.core.@Nullable QEvent event){
return eventFilter_native_QObject_ptr_QEvent_ptr(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(object), QtJambi_LibraryUtilities.internal.checkedNativeId(event));
}
@QtUninvokable
private native boolean eventFilter_native_QObject_ptr_QEvent_ptr(long __this__nativeId, long object, long event);
/**
*
*/
@QtUninvokable
@Override
public void setVisible(boolean visible){
setVisible_native_bool(QtJambi_LibraryUtilities.internal.nativeId(this), visible);
}
@QtUninvokable
private native void setVisible_native_bool(long __this__nativeId, boolean visible);
/**
* See QFontDialog:: getFont(bool*, QFont, QWidget*, QString, QFontDialog::FontDialogOptions)
*/
public static io.qt.gui.@NonNull QFont getFont(io.qt.gui.@NonNull QFont initial, io.qt.widgets.@Nullable QWidget parent, java.lang.@NonNull String title, io.qt.widgets.QFontDialog.@NonNull FontDialogOptions options){
return getFont_native_bool_ptr_cref_QFont_QWidget_ptr_cref_QString_QFontDialog_FontDialogOptions(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_QFontDialog_FontDialogOptions(long initial, long parent, java.lang.String title, int options);
/**
* See QFontDialog:: getFont(bool*, QWidget*)
*/
public static io.qt.gui.@NonNull QFont getFont(io.qt.widgets.@Nullable 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);
/**
* Constructor for internal use only.
* @param p expected to be null
.
* @hidden
*/
@NativeAccess
protected QFontDialog(QPrivateConstructor p) { super(p); }
/**
* Constructor for internal use only.
* It is not allowed to call the declarative constructor from inside Java.
* @hidden
*/
@NativeAccess
protected QFontDialog(QDeclarativeConstructor constructor) {
super((QPrivateConstructor)null);
initialize_native(this, constructor);
}
@QtUninvokable
private static native void initialize_native(QFontDialog instance, QDeclarativeConstructor constructor);
/**
* See QFontDialog::open(QObject *, const char *)
*/
@QtUninvokable
public final void open(io.qt.core.QMetaObject.@StrictNonNull 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 *)
*/
@QtUninvokable
public final void open(io.qt.core.QMetaObject.@StrictNonNull 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);
/**
* Overloaded constructor for {@link #QFontDialog(io.qt.gui.QFont, io.qt.widgets.QWidget)}
* with parent = null
.
*/
public QFontDialog(io.qt.gui.@NonNull QFont initial) {
this(initial, (io.qt.widgets.QWidget)null);
}
/**
* Overloaded constructor for {@link #QFontDialog(java.lang.String, io.qt.widgets.QWidget)}
* with parent = null
.
*/
public QFontDialog(java.lang.@NonNull String initial) {
this(initial, (io.qt.widgets.QWidget)null);
}
/**
* Overloaded constructor for {@link #QFontDialog(io.qt.gui.QFont, io.qt.widgets.QWidget)}.
*/
public QFontDialog(java.lang.@NonNull String initial, io.qt.widgets.@Nullable QWidget parent) {
this(new io.qt.gui.QFont(initial), parent);
}
/**
* Overloaded constructor for {@link #QFontDialog(io.qt.widgets.QWidget)}
* with parent = null
.
*/
public QFontDialog() {
this((io.qt.widgets.QWidget)null);
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #currentFont()} instead.
*/
@QtPropertyReader(enabled=false)
@QtUninvokable
public final io.qt.gui.@NonNull QFont getCurrentFont() {
return currentFont();
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #options()} instead.
*/
@QtPropertyReader(enabled=false)
@QtUninvokable
public final io.qt.widgets.QFontDialog.@NonNull FontDialogOptions getOptions() {
return options();
}
/**
* Overloaded function for {@link #setCurrentFont(io.qt.gui.QFont)}.
*/
@QtUninvokable
public final void setCurrentFont(java.lang.@NonNull String font) {
setCurrentFont(new io.qt.gui.QFont(font));
}
/**
* Overloaded function for {@link #setOption(io.qt.widgets.QFontDialog.FontDialogOption, boolean)}
* with on = true
.
*/
@QtUninvokable
public final void setOption(io.qt.widgets.QFontDialog.@NonNull FontDialogOption option) {
setOption(option, (boolean)true);
}
/**
* Overloaded function for {@link #setOptions(io.qt.widgets.QFontDialog.FontDialogOptions)}.
*/
@QtUninvokable
public final void setOptions(io.qt.widgets.QFontDialog.@NonNull FontDialogOption @NonNull... options) {
setOptions(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.@NonNull QFont getFont(io.qt.gui.@NonNull QFont initial, io.qt.widgets.@Nullable QWidget parent, java.lang.@NonNull 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 = (String)null
* options = new io.qt.widgets.QFontDialog.FontDialogOptions(0)
*
*/
public static io.qt.gui.@NonNull QFont getFont(io.qt.gui.@NonNull QFont initial, io.qt.widgets.@Nullable QWidget parent) {
return getFont(initial, parent, (String)null, 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 = (String)null
* options = new io.qt.widgets.QFontDialog.FontDialogOptions(0)
*
*/
public static io.qt.gui.@NonNull QFont getFont(io.qt.gui.@NonNull QFont initial) {
return getFont(initial, (io.qt.widgets.QWidget)null, (String)null, new io.qt.widgets.QFontDialog.FontDialogOptions(0));
}
/**
* Overloaded function for {@link #getFont(java.lang.String, 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.@NonNull QFont getFont(java.lang.@NonNull String initial, io.qt.widgets.@Nullable QWidget parent, java.lang.@NonNull String title) {
return getFont(initial, parent, title, new io.qt.widgets.QFontDialog.FontDialogOptions(0));
}
/**
* Overloaded function for {@link #getFont(java.lang.String, io.qt.widgets.QWidget, java.lang.String, io.qt.widgets.QFontDialog.FontDialogOptions)}
* with:
* title = (String)null
* options = new io.qt.widgets.QFontDialog.FontDialogOptions(0)
*
*/
public static io.qt.gui.@NonNull QFont getFont(java.lang.@NonNull String initial, io.qt.widgets.@Nullable QWidget parent) {
return getFont(initial, parent, (String)null, new io.qt.widgets.QFontDialog.FontDialogOptions(0));
}
/**
* Overloaded function for {@link #getFont(java.lang.String, io.qt.widgets.QWidget, java.lang.String, io.qt.widgets.QFontDialog.FontDialogOptions)}
* with:
* parent = null
* title = (String)null
* options = new io.qt.widgets.QFontDialog.FontDialogOptions(0)
*
*/
public static io.qt.gui.@NonNull QFont getFont(java.lang.@NonNull String initial) {
return getFont(initial, (io.qt.widgets.QWidget)null, (String)null, 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)}.
*/
public static io.qt.gui.@NonNull QFont getFont(java.lang.@NonNull String initial, io.qt.widgets.@Nullable QWidget parent, java.lang.@NonNull String title, io.qt.widgets.QFontDialog.@NonNull FontDialogOptions options) {
return getFont(new io.qt.gui.QFont(initial), parent, title, options);
}
/**
* 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.@NonNull QFont getFont(io.qt.gui.@NonNull QFont initial, io.qt.widgets.@Nullable QWidget parent, java.lang.@NonNull String title, io.qt.widgets.QFontDialog.@NonNull FontDialogOption @NonNull... 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)}.
*/
public static io.qt.gui.@NonNull QFont getFont(java.lang.@NonNull String initial, io.qt.widgets.@Nullable QWidget parent, java.lang.@NonNull String title, io.qt.widgets.QFontDialog.@NonNull FontDialogOption @NonNull... options) {
return getFont(new io.qt.gui.QFont(initial), parent, title, new io.qt.widgets.QFontDialog.FontDialogOptions(options));
}
}