
io.qt.gui.QInputDevice Maven / Gradle / Ivy
package io.qt.gui;
/**
* Describes a device from which a QInputEvent originates
* Java wrapper for Qt class QInputDevice
*/
public class QInputDevice extends io.qt.core.QObject
{
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* This variable stores the meta-object for the class.
*/
public static final io.qt.core.QMetaObject staticMetaObject = io.qt.core.QMetaObject.forType(QInputDevice.class);
/**
* Java wrapper for Qt enum QInputDevice::Capability
*
* @see Capabilities
*/
public enum Capability implements io.qt.QtFlagEnumerator {
None(0),
Position(1),
Area(2),
Pressure(4),
Velocity(8),
NormalizedPosition(32),
MouseEmulation(64),
PixelScroll(128),
Scroll(256),
Hover(512),
Rotation(1024),
XTilt(2048),
YTilt(4096),
TangentialPressure(8192),
ZPosition(16384),
All(2147483647);
private Capability(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
public int value() {
return value;
}
/**
* Create a QFlags of the enum entry.
* @return QFlags
*/
public Capabilities asFlags() {
return new Capabilities(value);
}
/**
* Combines this entry with other enum entry.
* @param e enum entry
* @return new flag
*/
public Capabilities combined(Capability e) {
return new Capabilities(this, e);
}
/**
* Creates a new {@link Capabilities} from the entries.
* @param values entries
* @return new flag
*/
public static Capabilities flags(Capability ... values) {
return new Capabilities(values);
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static Capability resolve(int value) {
switch (value) {
case 0: return None;
case 1: return Position;
case 2: return Area;
case 4: return Pressure;
case 8: return Velocity;
case 32: return NormalizedPosition;
case 64: return MouseEmulation;
case 128: return PixelScroll;
case 256: return Scroll;
case 512: return Hover;
case 1024: return Rotation;
case 2048: return XTilt;
case 4096: return YTilt;
case 8192: return TangentialPressure;
case 16384: return ZPosition;
case 2147483647: return All;
default: throw new io.qt.QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* QFlags type for enum {@link Capability}
*/
public static final class Capabilities extends io.qt.QFlags implements Comparable {
private static final long serialVersionUID = 0x956707b38f6e6caeL;
/**
* Creates a new Capabilities where the flags in args
are set.
* @param args enum entries
*/
public Capabilities(Capability ... args){
super(args);
}
/**
* Creates a new Capabilities with given value
.
* @param value
*/
public Capabilities(int value) {
super(value);
}
/**
* Combines this flags with enum entry.
* @param e enum entry
* @return new Capabilities
*/
@Override
public final Capabilities combined(Capability e){
return new Capabilities(value() | e.value());
}
/**
* Sets the flag e
* @param e enum entry
* @return this
*/
public final Capabilities setFlag(Capability 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 Capabilities setFlag(Capability e, boolean on){
super.setFlag(e, on);
return this;
}
/**
* Returns an array of flag objects represented by this Capabilities.
* @return array of enum entries
*/
@Override
public final Capability[] flags(){
return super.flags(Capability.values());
}
/**
* {@inheritDoc}
*/
@Override
public final Capabilities clone(){
return new Capabilities(value());
}
/**
* {@inheritDoc}
*/
@Override
public final int compareTo(Capabilities other){
return Integer.compare(value(), other.value());
}
}
/**
* Java wrapper for Qt enum QInputDevice::DeviceType
*
* @see DeviceTypes
*/
public enum DeviceType implements io.qt.QtFlagEnumerator {
Unknown(0),
Mouse(1),
TouchScreen(2),
TouchPad(4),
Puck(8),
Stylus(16),
Airbrush(32),
Keyboard(4096),
AllDevices(2147483647);
private DeviceType(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
public int value() {
return value;
}
/**
* Create a QFlags of the enum entry.
* @return QFlags
*/
public DeviceTypes asFlags() {
return new DeviceTypes(value);
}
/**
* Combines this entry with other enum entry.
* @param e enum entry
* @return new flag
*/
public DeviceTypes combined(DeviceType e) {
return new DeviceTypes(this, e);
}
/**
* Creates a new {@link DeviceTypes} from the entries.
* @param values entries
* @return new flag
*/
public static DeviceTypes flags(DeviceType ... values) {
return new DeviceTypes(values);
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static DeviceType resolve(int value) {
switch (value) {
case 0: return Unknown;
case 1: return Mouse;
case 2: return TouchScreen;
case 4: return TouchPad;
case 8: return Puck;
case 16: return Stylus;
case 32: return Airbrush;
case 4096: return Keyboard;
case 2147483647: return AllDevices;
default: throw new io.qt.QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* QFlags type for enum {@link DeviceType}
*/
public static final class DeviceTypes extends io.qt.QFlags implements Comparable {
private static final long serialVersionUID = 0xd632ea65f9eb037cL;
/**
* Creates a new DeviceTypes where the flags in args
are set.
* @param args enum entries
*/
public DeviceTypes(DeviceType ... args){
super(args);
}
/**
* Creates a new DeviceTypes with given value
.
* @param value
*/
public DeviceTypes(int value) {
super(value);
}
/**
* Combines this flags with enum entry.
* @param e enum entry
* @return new DeviceTypes
*/
@Override
public final DeviceTypes combined(DeviceType e){
return new DeviceTypes(value() | e.value());
}
/**
* Sets the flag e
* @param e enum entry
* @return this
*/
public final DeviceTypes setFlag(DeviceType 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 DeviceTypes setFlag(DeviceType e, boolean on){
super.setFlag(e, on);
return this;
}
/**
* Returns an array of flag objects represented by this DeviceTypes.
* @return array of enum entries
*/
@Override
public final DeviceType[] flags(){
return super.flags(DeviceType.values());
}
/**
* {@inheritDoc}
*/
@Override
public final DeviceTypes clone(){
return new DeviceTypes(value());
}
/**
* {@inheritDoc}
*/
@Override
public final int compareTo(DeviceTypes other){
return Integer.compare(value(), other.value());
}
}
/**
* See QInputDevice::availableVirtualGeometryChanged(QRect)
*/
@io.qt.QtPropertyNotify(name="availableVirtualGeometry")
public final Signal1 availableVirtualGeometryChanged = new Signal1<>();
/**
* Overloaded constructor for {@link #QInputDevice(io.qt.core.QObject)}
* with parent = null
.
*/
public QInputDevice() {
this((io.qt.core.QObject)null);
}
/**
* See QInputDevice::QInputDevice(QObject*)
*/
public QInputDevice(io.qt.core.QObject parent){
super((QPrivateConstructor)null);
initialize_native(this, parent);
}
private native static void initialize_native(QInputDevice instance, io.qt.core.QObject parent);
/**
* Overloaded constructor for {@link #QInputDevice(java.lang.String, long, io.qt.gui.QInputDevice.DeviceType, java.lang.String, io.qt.core.QObject)}
* with parent = null
.
*/
public QInputDevice(java.lang.String name, long systemId, io.qt.gui.QInputDevice.DeviceType type, java.lang.String seatName) {
this(name, systemId, type, seatName, (io.qt.core.QObject)null);
}
/**
* Overloaded constructor for {@link #QInputDevice(java.lang.String, long, io.qt.gui.QInputDevice.DeviceType, java.lang.String, io.qt.core.QObject)}
* with:
* seatName = ""
* parent = null
*
*/
public QInputDevice(java.lang.String name, long systemId, io.qt.gui.QInputDevice.DeviceType type) {
this(name, systemId, type, "", (io.qt.core.QObject)null);
}
/**
* See QInputDevice::QInputDevice(QString,qint64,QInputDevice::DeviceType,QString,QObject*)
*/
public QInputDevice(java.lang.String name, long systemId, io.qt.gui.QInputDevice.DeviceType type, java.lang.String seatName, io.qt.core.QObject parent){
super((QPrivateConstructor)null);
initialize_native(this, name, systemId, type, seatName, parent);
}
private native static void initialize_native(QInputDevice instance, java.lang.String name, long systemId, io.qt.gui.QInputDevice.DeviceType type, java.lang.String seatName, io.qt.core.QObject parent);
/**
* See QInputDevice::availableVirtualGeometry()const
*/
@io.qt.QtPropertyReader(name="availableVirtualGeometry")
@io.qt.QtUninvokable
public final io.qt.core.QRect availableVirtualGeometry(){
return availableVirtualGeometry_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native io.qt.core.QRect availableVirtualGeometry_native_constfct(long __this__nativeId);
/**
* See QInputDevice::capabilities()const
*/
@io.qt.QtPropertyReader(name="capabilities")
@io.qt.QtPropertyConstant
@io.qt.QtUninvokable
public final io.qt.gui.QInputDevice.Capabilities capabilities(){
return new io.qt.gui.QInputDevice.Capabilities(capabilities_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@io.qt.QtUninvokable
private native int capabilities_native_constfct(long __this__nativeId);
/**
* See QInputDevice::hasCapability(QInputDevice::Capability)const
*/
@io.qt.QtUninvokable
public final boolean hasCapability(io.qt.gui.QInputDevice.Capability cap){
return hasCapability_native_QInputDevice_Capability_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), cap.value());
}
@io.qt.QtUninvokable
private native boolean hasCapability_native_QInputDevice_Capability_constfct(long __this__nativeId, int cap);
/**
*
*/
@io.qt.QtPropertyReader(name="name")
@io.qt.QtPropertyConstant
@io.qt.QtUninvokable
public final java.lang.String name(){
return name_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native java.lang.String name_native_constfct(long __this__nativeId);
@io.qt.QtUninvokable
private final boolean operator_equal(io.qt.gui.QInputDevice other){
return operator_equal_native_cref_QInputDevice_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(other));
}
@io.qt.QtUninvokable
private native boolean operator_equal_native_cref_QInputDevice_constfct(long __this__nativeId, long other);
/**
* See QInputDevice::seatName()const
*/
@io.qt.QtPropertyReader(name="seatName")
@io.qt.QtPropertyConstant
@io.qt.QtUninvokable
public final java.lang.String seatName(){
return seatName_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native java.lang.String seatName_native_constfct(long __this__nativeId);
/**
* See QInputDevice::systemId()const
*/
@io.qt.QtPropertyReader(name="systemId")
@io.qt.QtPropertyConstant
@io.qt.QtUninvokable
public final long systemId(){
return systemId_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private native long systemId_native_constfct(long __this__nativeId);
/**
*
*/
@io.qt.QtPropertyReader(name="type")
@io.qt.QtPropertyConstant
@io.qt.QtUninvokable
public final io.qt.gui.QInputDevice.DeviceType type(){
return io.qt.gui.QInputDevice.DeviceType.resolve(type_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@io.qt.QtUninvokable
private native int type_native_constfct(long __this__nativeId);
/**
*
*/
public native static io.qt.core.QList devices();
/**
* Overloaded function for {@link #primaryKeyboard(java.lang.String)}
* with seatName = ""
.
*/
public static io.qt.gui.QInputDevice primaryKeyboard() {
return primaryKeyboard("");
}
/**
* See QInputDevice::primaryKeyboard(QString)
*/
public native static io.qt.gui.QInputDevice primaryKeyboard(java.lang.String seatName);
/**
* Constructor for internal use only.
* @param p expected to be null
.
*/
@io.qt.NativeAccess
protected QInputDevice(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 QInputDevice(QDeclarativeConstructor constructor) {
super((QPrivateConstructor)null);
initialize_native(this, constructor);
}
@io.qt.QtUninvokable
private static native void initialize_native(QInputDevice instance, QDeclarativeConstructor constructor);
@Override
@io.qt.QtUninvokable
public boolean equals(Object other) {
if (other instanceof io.qt.gui.QInputDevice) {
return operator_equal((io.qt.gui.QInputDevice) other);
}
return false;
}
@Override
@io.qt.QtUninvokable
public String toString() {
return toString_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@io.qt.QtUninvokable
private static native String toString_native(long __this_nativeId);
}