io.qt.core.QLibrary Maven / Gradle / Ivy
Show all versions of qtjambi Show documentation
package io.qt.core;
import io.qt.*;
/**
* Loads shared libraries at runtime
* Java wrapper for Qt class QLibrary
*/
public class QLibrary 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(QLibrary.class);
/**
* Java wrapper for Qt enum QLibrary::LoadHint
*
* @see LoadHints
*/
public enum LoadHint implements QtFlagEnumerator {
/**
* Representing QLibrary:: ResolveAllSymbolsHint
*/
ResolveAllSymbolsHint(1),
/**
* Representing QLibrary:: ExportExternalSymbolsHint
*/
ExportExternalSymbolsHint(2),
/**
* Representing QLibrary:: LoadArchiveMemberHint
*/
LoadArchiveMemberHint(4),
/**
* Representing QLibrary:: PreventUnloadHint
*/
PreventUnloadHint(8),
/**
* Representing QLibrary:: DeepBindHint
*/
DeepBindHint(16);
static {
QtJambi_LibraryUtilities.initialize();
}
private LoadHint(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
public int value() {
return value;
}
/**
* Create a QFlags of the enum entry.
* @return QFlags
*/
public @NonNull LoadHints asFlags() {
return new LoadHints(value);
}
/**
* Combines this entry with other enum entry.
* @param e enum entry
* @return new flag
*/
public @NonNull LoadHints combined(@NonNull LoadHint 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 LoadHints cleared(@NonNull LoadHint e) {
return asFlags().setFlag(e, false);
}
/**
* Creates a new {@link LoadHints} from the entries.
* @param values entries
* @return new flag
*/
public static @NonNull LoadHints flags(@Nullable LoadHint @NonNull... values) {
return new LoadHints(values);
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static @NonNull LoadHint resolve(int value) {
switch (value) {
case 1: return ResolveAllSymbolsHint;
case 2: return ExportExternalSymbolsHint;
case 4: return LoadArchiveMemberHint;
case 8: return PreventUnloadHint;
case 16: return DeepBindHint;
default: throw new QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* {@link QFlags} type for enum {@link LoadHint}
*/
public static final class LoadHints extends QFlags implements Comparable {
private static final long serialVersionUID = 0xbf8c7a8a4cfb8918L;
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* Creates a new LoadHints where the flags in args
are set.
* @param args enum entries
*/
public LoadHints(@Nullable LoadHint @NonNull... args){
super(args);
}
/**
* Creates a new LoadHints with given value
.
* @param value
*/
public LoadHints(int value) {
super(value);
}
/**
* Combines this flags with enum entry.
* @param e enum entry
* @return new LoadHints
*/
@Override
public final @NonNull LoadHints combined(@StrictNonNull LoadHint e){
return new LoadHints(value() | e.value());
}
/**
* Sets the flag e
* @param e enum entry
* @return this
*/
public final @NonNull LoadHints setFlag(@Nullable LoadHint 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 LoadHints setFlag(@Nullable LoadHint 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 LoadHints.
* @return array of enum entries
*/
@Override
public final @NonNull LoadHint @NonNull[] flags(){
return super.flags(LoadHint.values());
}
/**
* {@inheritDoc}
*/
@Override
public final @NonNull LoadHints clone(){
return new LoadHints(value());
}
/**
* {@inheritDoc}
*/
@Override
public final int compareTo(@StrictNonNull LoadHints other){
return Integer.compare(value(), other.value());
}
}
/**
* See QLibrary:: QLibrary(QObject*)
*/
public QLibrary(io.qt.core.@Nullable QObject parent){
super((QPrivateConstructor)null);
initialize_native(this, parent);
}
private native static void initialize_native(QLibrary instance, io.qt.core.QObject parent);
/**
* See QLibrary:: QLibrary(QString, QObject*)
*/
public QLibrary(java.lang.@NonNull String fileName, io.qt.core.@Nullable QObject parent){
super((QPrivateConstructor)null);
initialize_native(this, fileName, parent);
}
private native static void initialize_native(QLibrary instance, java.lang.String fileName, io.qt.core.QObject parent);
/**
* See QLibrary:: QLibrary(QString, QString, QObject*)
*/
public QLibrary(java.lang.@NonNull String fileName, java.lang.@NonNull String version, io.qt.core.@Nullable QObject parent){
super((QPrivateConstructor)null);
initialize_native(this, fileName, version, parent);
}
private native static void initialize_native(QLibrary instance, java.lang.String fileName, java.lang.String version, io.qt.core.QObject parent);
/**
* See QLibrary:: QLibrary(QString, int, QObject*)
*/
public QLibrary(java.lang.@NonNull String fileName, int verNum, io.qt.core.@Nullable QObject parent){
super((QPrivateConstructor)null);
initialize_native(this, fileName, verNum, parent);
}
private native static void initialize_native(QLibrary instance, java.lang.String fileName, int verNum, io.qt.core.QObject parent);
/**
* See QLibrary:: errorString()const
*/
@QtUninvokable
public final java.lang.@NonNull String errorString(){
return errorString_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native java.lang.String errorString_native_constfct(long __this__nativeId);
/**
*
*/
@QtPropertyReader(name="fileName")
@QtUninvokable
public final java.lang.@NonNull String fileName(){
return fileName_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native java.lang.String fileName_native_constfct(long __this__nativeId);
/**
*
*/
@QtUninvokable
public final boolean isLoaded(){
return isLoaded_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean isLoaded_native_constfct(long __this__nativeId);
/**
* See QLibrary:: load()
*/
@QtUninvokable
public final boolean load(){
return load_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean load_native(long __this__nativeId);
/**
* See QLibrary:: loadHints()const
*/
@QtPropertyReader(name="loadHints")
@QtUninvokable
public final io.qt.core.QLibrary.@NonNull LoadHints loadHints(){
return new io.qt.core.QLibrary.LoadHints(loadHints_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@QtUninvokable
private native int loadHints_native_constfct(long __this__nativeId);
/**
* See QLibrary:: resolve(const char*)
*/
@QtUninvokable
public final io.qt.core.@Nullable QFunctionPointer resolve(java.lang.@Nullable String symbol){
return resolve_native_const_char_ptr(QtJambi_LibraryUtilities.internal.nativeId(this), symbol);
}
@QtUninvokable
private native io.qt.core.QFunctionPointer resolve_native_const_char_ptr(long __this__nativeId, java.lang.String symbol);
/**
* See QLibrary:: setFileName(QString)
*/
@QtPropertyWriter(name="fileName")
@QtUninvokable
public final void setFileName(java.lang.@NonNull String fileName){
setFileName_native_cref_QString(QtJambi_LibraryUtilities.internal.nativeId(this), fileName);
}
@QtUninvokable
private native void setFileName_native_cref_QString(long __this__nativeId, java.lang.String fileName);
/**
* See QLibrary:: setFileNameAndVersion(QString, QString)
*/
@QtUninvokable
public final void setFileNameAndVersion(java.lang.@NonNull String fileName, java.lang.@NonNull String version){
setFileNameAndVersion_native_cref_QString_cref_QString(QtJambi_LibraryUtilities.internal.nativeId(this), fileName, version);
}
@QtUninvokable
private native void setFileNameAndVersion_native_cref_QString_cref_QString(long __this__nativeId, java.lang.String fileName, java.lang.String version);
/**
* See QLibrary:: setFileNameAndVersion(QString, int)
*/
@QtUninvokable
public final void setFileNameAndVersion(java.lang.@NonNull String fileName, int verNum){
setFileNameAndVersion_native_cref_QString_int(QtJambi_LibraryUtilities.internal.nativeId(this), fileName, verNum);
}
@QtUninvokable
private native void setFileNameAndVersion_native_cref_QString_int(long __this__nativeId, java.lang.String fileName, int verNum);
/**
* See QLibrary:: setLoadHints(QLibrary::LoadHints)
*/
@QtPropertyWriter(name="loadHints")
@QtUninvokable
public final void setLoadHints(io.qt.core.QLibrary.@NonNull LoadHints hints){
setLoadHints_native_QLibrary_LoadHints(QtJambi_LibraryUtilities.internal.nativeId(this), hints.value());
}
@QtUninvokable
private native void setLoadHints_native_QLibrary_LoadHints(long __this__nativeId, int hints);
/**
*
*/
@QtUninvokable
public final boolean unload(){
return unload_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean unload_native(long __this__nativeId);
/**
* See QLibrary:: isLibrary(QString)
*/
public native static boolean isLibrary(java.lang.@NonNull String fileName);
/**
* See QLibrary:: resolve(QString, QString, const char*)
*/
public native static io.qt.core.@Nullable QFunctionPointer resolve(java.lang.@NonNull String fileName, java.lang.@NonNull String version, java.lang.@Nullable String symbol);
/**
* See QLibrary:: resolve(QString, const char*)
*/
public native static io.qt.core.@Nullable QFunctionPointer resolve(java.lang.@NonNull String fileName, java.lang.@Nullable String symbol);
/**
* See QLibrary:: resolve(QString, int, const char*)
*/
public native static io.qt.core.@Nullable QFunctionPointer resolve(java.lang.@NonNull String fileName, int verNum, java.lang.@Nullable String symbol);
/**
* Constructor for internal use only.
* @param p expected to be null
.
* @hidden
*/
@NativeAccess
protected QLibrary(QPrivateConstructor p) { super(p); }
/**
* Constructor for internal use only.
* It is not allowed to call the declarative constructor from inside Java.
* @hidden
*/
@NativeAccess
protected QLibrary(QDeclarativeConstructor constructor) {
super((QPrivateConstructor)null);
initialize_native(this, constructor);
}
@QtUninvokable
private static native void initialize_native(QLibrary instance, QDeclarativeConstructor constructor);
/**
* Overloaded constructor for {@link #QLibrary(io.qt.core.QObject)}
* with parent = null
.
*/
public QLibrary() {
this((io.qt.core.QObject)null);
}
/**
* Overloaded constructor for {@link #QLibrary(java.lang.String, io.qt.core.QObject)}
* with parent = null
.
*/
public QLibrary(java.lang.@NonNull String fileName) {
this(fileName, (io.qt.core.QObject)null);
}
/**
* Overloaded constructor for {@link #QLibrary(java.lang.String, java.lang.String, io.qt.core.QObject)}
* with parent = null
.
*/
public QLibrary(java.lang.@NonNull String fileName, java.lang.@NonNull String version) {
this(fileName, version, (io.qt.core.QObject)null);
}
/**
* Overloaded constructor for {@link #QLibrary(java.lang.String, int, io.qt.core.QObject)}
* with parent = null
.
*/
public QLibrary(java.lang.@NonNull String fileName, int verNum) {
this(fileName, verNum, (io.qt.core.QObject)null);
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #fileName()} instead.
*/
@QtPropertyReader(enabled=false)
@QtUninvokable
public final java.lang.@NonNull String getFileName() {
return fileName();
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #loadHints()} instead.
*/
@QtPropertyReader(enabled=false)
@QtUninvokable
public final io.qt.core.QLibrary.@NonNull LoadHints getLoadHints() {
return loadHints();
}
/**
* Overloaded function for {@link #setLoadHints(io.qt.core.QLibrary.LoadHints)}.
*/
@QtUninvokable
public final void setLoadHints(io.qt.core.QLibrary.@NonNull LoadHint @NonNull... hints) {
setLoadHints(new io.qt.core.QLibrary.LoadHints(hints));
}
}