io.qt.widgets.QGestureRecognizer Maven / Gradle / Ivy
Show all versions of qtjambi Show documentation
package io.qt.widgets;
import io.qt.*;
/**
* The infrastructure for gesture recognition
* Java wrapper for Qt class QGestureRecognizer
*/
public abstract class QGestureRecognizer extends QtObject
{
static {
QtJambi_LibraryUtilities.initialize();
}
@NativeAccess
private static final class ConcreteWrapper extends QGestureRecognizer {
@NativeAccess
private ConcreteWrapper(QPrivateConstructor p) { super(p); }
@Override
@QtUninvokable
public io.qt.widgets.QGestureRecognizer.@NonNull Result recognize(io.qt.widgets.@Nullable QGesture state, io.qt.core.@Nullable QObject watched, io.qt.core.@Nullable QEvent event){
return new io.qt.widgets.QGestureRecognizer.Result(recognize_native_QGesture_ptr_QObject_ptr_QEvent_ptr(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(state), QtJambi_LibraryUtilities.internal.checkedNativeId(watched), QtJambi_LibraryUtilities.internal.checkedNativeId(event)));
}
@QtUninvokable
private native int recognize_native_QGesture_ptr_QObject_ptr_QEvent_ptr(long __this__nativeId, long state, long watched, long event);
}
/**
* Java wrapper for Qt enum QGestureRecognizer::ResultFlag
*
* @see Result
*/
public enum ResultFlag implements QtFlagEnumerator {
/**
* Representing QGestureRecognizer:: Ignore
*/
Ignore(1),
/**
* Representing QGestureRecognizer:: MayBeGesture
*/
MayBeGesture(2),
/**
* Representing QGestureRecognizer:: TriggerGesture
*/
TriggerGesture(4),
/**
* Representing QGestureRecognizer:: FinishGesture
*/
FinishGesture(8),
/**
* Representing QGestureRecognizer:: CancelGesture
*/
CancelGesture(16),
/**
* Representing QGestureRecognizer:: ResultState_Mask
*/
ResultState_Mask(255),
/**
* Representing QGestureRecognizer:: ConsumeEventHint
*/
ConsumeEventHint(256),
/**
* Representing QGestureRecognizer:: ResultHint_Mask
*/
ResultHint_Mask(65280);
static {
QtJambi_LibraryUtilities.initialize();
}
private ResultFlag(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
@Override
public int value() {
return value;
}
/**
* Create a QFlags of the enum entry.
* @return QFlags
*/
@Override
public @NonNull Result asFlags() {
return new Result(value);
}
/**
* Combines this entry with other enum entry.
* @param e enum entry
* @return new flag
*/
public @NonNull Result combined(@NonNull ResultFlag 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 Result cleared(@NonNull ResultFlag e) {
return asFlags().setFlag(e, false);
}
/**
* Creates a new {@link Result} from the entries.
* @param values entries
* @return new flag
*/
public static @NonNull Result flags(@Nullable ResultFlag @NonNull... values) {
return new Result(values);
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static @NonNull ResultFlag resolve(int value) {
switch (value) {
case 1: return Ignore;
case 2: return MayBeGesture;
case 4: return TriggerGesture;
case 8: return FinishGesture;
case 16: return CancelGesture;
case 255: return ResultState_Mask;
case 256: return ConsumeEventHint;
case 65280: return ResultHint_Mask;
default: throw new QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* {@link QFlags} type for enum {@link ResultFlag}
*/
public static final class Result extends QFlags implements Comparable {
private static final long serialVersionUID = 0x60dbc384dfadb9b1L;
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* Creates a new Result where the flags in args
are set.
* @param args enum entries
*/
public Result(@Nullable ResultFlag @NonNull... args){
super(args);
}
/**
* Creates a new Result with given value
.
* @param value
*/
public Result(int value) {
super(value);
}
/**
* Combines this flags with enum entry.
* @param e enum entry
* @return new Result
*/
@Override
public final @NonNull Result combined(@StrictNonNull ResultFlag e){
return new Result(value() | e.value());
}
/**
* Sets the flag e
* @param e enum entry
* @return this
*/
@Override
public final @NonNull Result setFlag(@Nullable ResultFlag e){
return setFlag(e, true);
}
/**
* Sets or clears the flag flag
* @param e enum entry
* @param on set (true) or clear (false)
* @return this
*/
@Override
public final @NonNull Result setFlag(@Nullable ResultFlag 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 Result.
* @return array of enum entries
*/
@Override
public final @NonNull ResultFlag @NonNull[] flags(){
return super.flags(ResultFlag.values());
}
/**
* {@inheritDoc}
*/
@Override
public final @NonNull Result clone(){
return new Result(value());
}
/**
* {@inheritDoc}
*/
@Override
public final int compareTo(@StrictNonNull Result other){
return Integer.compare(value(), other.value());
}
}
/**
* See QGestureRecognizer:: QGestureRecognizer()
*/
public QGestureRecognizer(){
super((QPrivateConstructor)null);
initialize_native(this);
}
private native static void initialize_native(QGestureRecognizer instance);
/**
* See QGestureRecognizer:: create(QObject*)
* @param target
* @return
*/
@QtUninvokable
public io.qt.widgets.@Nullable QGesture create(io.qt.core.@Nullable QObject target){
return create_native_QObject_ptr(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(target));
}
@QtUninvokable
private native io.qt.widgets.QGesture create_native_QObject_ptr(long __this__nativeId, long target);
/**
* See QGestureRecognizer:: recognize(QGesture*, QObject*, QEvent*)
* @param state
* @param watched
* @param event
* @return
*/
@QtUninvokable
public abstract io.qt.widgets.QGestureRecognizer.@NonNull Result recognize(io.qt.widgets.@Nullable QGesture state, io.qt.core.@Nullable QObject watched, io.qt.core.@Nullable QEvent event);
@QtUninvokable
private native int recognize_native_QGesture_ptr_QObject_ptr_QEvent_ptr(long __this__nativeId, long state, long watched, long event);
/**
* See QGestureRecognizer:: reset(QGesture*)
* @param state
*/
@QtUninvokable
public void reset(io.qt.widgets.@Nullable QGesture state){
reset_native_QGesture_ptr(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(state));
}
@QtUninvokable
private native void reset_native_QGesture_ptr(long __this__nativeId, long state);
/**
* See QGestureRecognizer:: registerRecognizer(QGestureRecognizer*)
* @param recognizer
* @return
*/
public static io.qt.core.Qt.@NonNull GestureType registerRecognizer(io.qt.widgets.@Nullable QGestureRecognizer recognizer){
io.qt.core.Qt.@NonNull GestureType __qt_return_value = io.qt.core.Qt.GestureType.resolve(registerRecognizer_native_QGestureRecognizer_ptr(QtJambi_LibraryUtilities.internal.checkedNativeId(recognizer)));
QtJambi_LibraryUtilities.internal.setCppOwnership(recognizer);
return __qt_return_value;
}
private native static int registerRecognizer_native_QGestureRecognizer_ptr(long recognizer);
/**
* See QGestureRecognizer:: unregisterRecognizer(Qt::GestureType)
* @param type
*/
public static void unregisterRecognizer(io.qt.core.Qt.@NonNull GestureType type){
unregisterRecognizer_native_Qt_GestureType(type.value());
}
private native static void unregisterRecognizer_native_Qt_GestureType(int type);
/**
* Constructor for internal use only.
* @param p expected to be null
.
* @hidden
*/
@NativeAccess
protected QGestureRecognizer(QPrivateConstructor p) { super(p); }
}