io.qt.core.QEventLoop Maven / Gradle / Ivy
Show all versions of qtjambi Show documentation
package io.qt.core;
import io.qt.*;
/**
* Means of entering and leaving an event loop
* Java wrapper for Qt class QEventLoop
*/
public class QEventLoop extends io.qt.core.QObject
{
/**
* This variable stores the meta-object for the class.
*/
public static final io.qt.core.@NonNull QMetaObject staticMetaObject = io.qt.core.QMetaObject.forType(QEventLoop.class);
/**
* Java wrapper for Qt enum QEventLoop::ProcessEventsFlag
*
* @see ProcessEventsFlags
*/
public enum ProcessEventsFlag implements QtFlagEnumerator {
/**
* Representing QEventLoop:: AllEvents
*/
AllEvents(0),
/**
* Representing QEventLoop:: ExcludeUserInputEvents
*/
ExcludeUserInputEvents(1),
/**
* Representing QEventLoop:: ExcludeSocketNotifiers
*/
ExcludeSocketNotifiers(2),
/**
* Representing QEventLoop:: WaitForMoreEvents
*/
WaitForMoreEvents(4),
/**
* Representing QEventLoop:: X11ExcludeTimers
*/
X11ExcludeTimers(8),
/**
* Representing QEventLoop:: EventLoopExec
*/
EventLoopExec(32),
/**
* Representing QEventLoop:: DialogExec
*/
DialogExec(64),
/**
* Representing QEventLoop:: ApplicationExec
*/
ApplicationExec(128);
static {
QtJambi_LibraryUtilities.initialize();
}
private ProcessEventsFlag(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
public int value() {
return value;
}
/**
* Create a QFlags of the enum entry.
* @return QFlags
*/
public @NonNull ProcessEventsFlags asFlags() {
return new ProcessEventsFlags(value);
}
/**
* Combines this entry with other enum entry.
* @param e enum entry
* @return new flag
*/
public @NonNull ProcessEventsFlags combined(@NonNull ProcessEventsFlag 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 ProcessEventsFlags cleared(@NonNull ProcessEventsFlag e) {
return asFlags().setFlag(e, false);
}
/**
* Creates a new {@link ProcessEventsFlags} from the entries.
* @param values entries
* @return new flag
*/
public static @NonNull ProcessEventsFlags flags(@Nullable ProcessEventsFlag @NonNull... values) {
return new ProcessEventsFlags(values);
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static @NonNull ProcessEventsFlag resolve(int value) {
switch (value) {
case 0: return AllEvents;
case 1: return ExcludeUserInputEvents;
case 2: return ExcludeSocketNotifiers;
case 4: return WaitForMoreEvents;
case 8: return X11ExcludeTimers;
case 32: return EventLoopExec;
case 64: return DialogExec;
case 128: return ApplicationExec;
default: throw new QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* {@link QFlags} type for enum {@link ProcessEventsFlag}
*/
public static final class ProcessEventsFlags extends QFlags implements Comparable {
private static final long serialVersionUID = 0xf6b9be84f034fdcaL;
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* Creates a new ProcessEventsFlags where the flags in args
are set.
* @param args enum entries
*/
public ProcessEventsFlags(@Nullable ProcessEventsFlag @NonNull... args){
super(args);
}
/**
* Creates a new ProcessEventsFlags with given value
.
* @param value
*/
public ProcessEventsFlags(int value) {
super(value);
}
/**
* Combines this flags with enum entry.
* @param e enum entry
* @return new ProcessEventsFlags
*/
@Override
public final @NonNull ProcessEventsFlags combined(@StrictNonNull ProcessEventsFlag e){
return new ProcessEventsFlags(value() | e.value());
}
/**
* Sets the flag e
* @param e enum entry
* @return this
*/
public final @NonNull ProcessEventsFlags setFlag(@Nullable ProcessEventsFlag 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 ProcessEventsFlags setFlag(@Nullable ProcessEventsFlag 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 ProcessEventsFlags.
* @return array of enum entries
*/
@Override
public final @NonNull ProcessEventsFlag @NonNull[] flags(){
return super.flags(ProcessEventsFlag.values());
}
/**
* {@inheritDoc}
*/
@Override
public final @NonNull ProcessEventsFlags clone(){
return new ProcessEventsFlags(value());
}
/**
* {@inheritDoc}
*/
@Override
public final int compareTo(@StrictNonNull ProcessEventsFlags other){
return Integer.compare(value(), other.value());
}
}
/**
* See QEventLoop:: QEventLoop(QObject*)
*/
public QEventLoop(io.qt.core.@Nullable QObject parent){
super((QPrivateConstructor)null);
initialize_native(this, parent);
}
private native static void initialize_native(QEventLoop instance, io.qt.core.QObject parent);
/**
* See QEventLoop:: exec(QEventLoop::ProcessEventsFlags)
*/
@QtUninvokable
public final int exec(io.qt.core.QEventLoop.@NonNull ProcessEventsFlags flags){
return exec_native_QEventLoop_ProcessEventsFlags(QtJambi_LibraryUtilities.internal.nativeId(this), flags.value());
}
@QtUninvokable
private native int exec_native_QEventLoop_ProcessEventsFlags(long __this__nativeId, int flags);
/**
*
*/
public final void exit(int returnCode){
exit_native_int(QtJambi_LibraryUtilities.internal.nativeId(this), returnCode);
}
private native void exit_native_int(long __this__nativeId, int returnCode);
/**
* See QEventLoop:: isRunning()const
*/
@QtUninvokable
public final boolean isRunning(){
return isRunning_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean isRunning_native_constfct(long __this__nativeId);
/**
* See QEventLoop:: processEvents(QEventLoop::ProcessEventsFlags)
*/
@QtUninvokable
public final boolean processEvents(io.qt.core.QEventLoop.@NonNull ProcessEventsFlags flags){
return processEvents_native_QEventLoop_ProcessEventsFlags(QtJambi_LibraryUtilities.internal.nativeId(this), flags.value());
}
@QtUninvokable
private native boolean processEvents_native_QEventLoop_ProcessEventsFlags(long __this__nativeId, int flags);
/**
* See QEventLoop:: processEvents(QEventLoop::ProcessEventsFlags, int)
*/
@QtUninvokable
public final void processEvents(io.qt.core.QEventLoop.@NonNull ProcessEventsFlags flags, int maximumTime){
processEvents_native_QEventLoop_ProcessEventsFlags_int(QtJambi_LibraryUtilities.internal.nativeId(this), flags.value(), maximumTime);
}
@QtUninvokable
private native void processEvents_native_QEventLoop_ProcessEventsFlags_int(long __this__nativeId, int flags, int maximumTime);
/**
*
*/
public final void quit(){
quit_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
private native void quit_native(long __this__nativeId);
/**
*
*/
@QtUninvokable
public final void wakeUp(){
wakeUp_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native void wakeUp_native(long __this__nativeId);
/**
*
*/
@QtUninvokable
@Override
public boolean event(io.qt.core.@Nullable QEvent event){
return event_native_QEvent_ptr(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(event));
}
@QtUninvokable
private native boolean event_native_QEvent_ptr(long __this__nativeId, long event);
/**
* Constructor for internal use only.
* @param p expected to be null
.
* @hidden
*/
@NativeAccess
protected QEventLoop(QPrivateConstructor p) { super(p); }
/**
* Constructor for internal use only.
* It is not allowed to call the declarative constructor from inside Java.
* @hidden
*/
@NativeAccess
protected QEventLoop(QDeclarativeConstructor constructor) {
super((QPrivateConstructor)null);
initialize_native(this, constructor);
}
@QtUninvokable
private static native void initialize_native(QEventLoop instance, QDeclarativeConstructor constructor);
/**
* Overloaded constructor for {@link #QEventLoop(io.qt.core.QObject)}
* with parent = null
.
*/
public QEventLoop() {
this((io.qt.core.QObject)null);
}
/**
* Overloaded function for {@link #exec(io.qt.core.QEventLoop.ProcessEventsFlags)}
* with flags = new io.qt.core.QEventLoop.ProcessEventsFlags(0)
.
*/
@QtUninvokable
public final int exec() {
return exec(new io.qt.core.QEventLoop.ProcessEventsFlags(0));
}
/**
* Overloaded function for {@link #exec(io.qt.core.QEventLoop.ProcessEventsFlags)}.
*/
@QtUninvokable
public final int exec(io.qt.core.QEventLoop.@NonNull ProcessEventsFlag @NonNull... flags) {
return exec(new io.qt.core.QEventLoop.ProcessEventsFlags(flags));
}
/**
* Overloaded function for {@link #exit(int)}
* with returnCode = 0
.
*/
public final void exit() {
exit((int)0);
}
/**
* Overloaded function for {@link #processEvents(io.qt.core.QEventLoop.ProcessEventsFlags)}
* with flags = new io.qt.core.QEventLoop.ProcessEventsFlags(0)
.
*/
@QtUninvokable
public final boolean processEvents() {
return processEvents(new io.qt.core.QEventLoop.ProcessEventsFlags(0));
}
/**
* Overloaded function for {@link #processEvents(io.qt.core.QEventLoop.ProcessEventsFlags)}.
*/
@QtUninvokable
public final boolean processEvents(io.qt.core.QEventLoop.@NonNull ProcessEventsFlag @NonNull... flags) {
return processEvents(new io.qt.core.QEventLoop.ProcessEventsFlags(flags));
}
}