All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.qt.InternalAccess Maven / Gradle / Ivy

There is a newer version: 6.8.0
Show newest version
/****************************************************************************
**
** Copyright (C) 2009-2024 Dr. Peter Droste, Omix Visualization GmbH & Co. KG. All rights reserved.
**
** This file is part of Qt Jambi.
**
** $BEGIN_LICENSE$
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file.  Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
** 
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.  Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
** $END_LICENSE$

**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
****************************************************************************/
package io.qt;

import java.lang.invoke.MethodType;
import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Parameter;
import java.lang.reflect.Type;
import java.util.Collection;
import java.util.Map;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.function.Supplier;

import io.qt.core.QMetaObject;
import io.qt.core.QObject;

/**
 * @hidden
 */
public interface InternalAccess {
	
	 & io.qt.QtEnumerator> E resolveEnum(Class cl, int value, String name);
	
	 & io.qt.QtByteEnumerator> E resolveEnum(Class cl, byte value, String name);
	
	 & io.qt.QtShortEnumerator> E resolveEnum(Class cl, short value, String name);
	
	 & io.qt.QtLongEnumerator> E resolveEnum(Class cl, long value, String name);

    boolean isJavaOwnership(io.qt.QtObject object);

    boolean isJavaOwnership(io.qt.QtObjectInterface object);
    
    boolean isSplitOwnership(io.qt.QtObject object);
    
    boolean isSplitOwnership(io.qt.QtObjectInterface object);
    
    boolean isCppOwnership(io.qt.QtObject object);
    
    boolean isCppOwnership(io.qt.QtObjectInterface object);

    void setCppOwnership(io.qt.QtObject object);

    void setCppOwnership(io.qt.QtObjectInterface object);

    void setJavaOwnership(io.qt.QtObject object);

    void setJavaOwnership(io.qt.QtObjectInterface object);
    
    void setDefaultOwnership(io.qt.QtObject object);
    
    void setDefaultOwnership(io.qt.QtObjectInterface object);

    long nativeId(io.qt.QtObject object);

    long nativeId(io.qt.QtObjectInterface object);
    
    long checkedNativeId(io.qt.QtObject object);
    
    long checkedNativeId(io.qt.QtObjectInterface object);
    
    java.nio.ByteBuffer mutableData(io.qt.core.QByteArray byteArray);

    void removeFromMapReferenceCount(io.qt.QtObjectInterface owner, Class declaringClass, String fieldName, boolean isStatic, Object value);

    void removeFromCollectionReferenceCount(io.qt.QtObjectInterface owner, Class declaringClass, String fieldName, boolean isStatic, Object value);
    
    void addAllReferenceCount(io.qt.QtObjectInterface owner, Class declaringClass, String fieldName, boolean isThreadSafe, boolean isStatic, Collection values);
    
    void putReferenceCount(io.qt.QtObjectInterface owner, Class declaringClass, String fieldName, boolean isThreadSafe, boolean isStatic, Object key, Object value);
    
    void clearReferenceCount(io.qt.QtObjectInterface owner, Class declaringClass, String fieldName, boolean isStatic);
    
    java.util.function.Supplier> callerClassProvider();

    java.util.Map newRCMap();

    java.util.List newRCList();

    void addReferenceCount(io.qt.QtObjectInterface owner, Class declaringClass, String fieldName, boolean isThreadSafe, boolean isStatic, Object value);

    void registerDependentObject(io.qt.QtObject dependentObject, io.qt.QtObjectInterface owner);

    void registerDependentObject(io.qt.QtObjectInterface dependentObject, io.qt.QtObjectInterface owner);

	void registerDependentObject(QtObjectInterface dependentObject, QtObject owner);

	void registerDependentObject(QtObject dependentObject, QtObject owner);

	void unregisterDependentObject(QtObjectInterface dependentObject, QtObjectInterface owner);

	void unregisterDependentObject(QtObject dependentObject, QtObjectInterface owner);

	void unregisterDependentObject(QtObjectInterface dependentObject, QtObject owner);

	void unregisterDependentObject(QtObject dependentObject, QtObject owner);

    void setReferenceCount(io.qt.QtObjectInterface owner, Class declaringClass, String fieldName, boolean threadSafe, boolean isStatic, Object newValue);
    
    void invalidateObject(io.qt.QtObject object);
    
    void invalidateObject(io.qt.QtObjectInterface object);
    
    /**
     * @hidden
     */
    public interface Cleanable {
        void clean();
    }
    
    Cleanable registerCleaner(Object object, Runnable action);
    
     io.qt.core.QObject lambdaContext(S lambdaExpression);
    
     Class lambdaReturnType(Class type, S lambdaExpression);
    
     int[] lambdaMetaTypes(Class type, S lambdaExpression);
    
     Class[] lambdaClassTypes(Class type, S lambdaExpression);
    
     java.lang.reflect.Executable lambdaExecutable(S lambdaExpression);
    
     Class getClass(T object);
    
    Object readField(Object owner, Field f);
    
     V readField(Object owner, Class declaringClass, String fieldName, Class fieldType);
    
    void writeField(Object owner, Field f, Object newValue);
    
    void writeField(Object owner, Class declaringClass, String fieldName, Object newValue);
    
    int registerMetaType(Parameter parameter);
    
    int findMetaType(String name);
    
    Class toClass(Type type);
    
    Class findGeneratedSuperclass(Class clazz);
    
    boolean isGeneratedClass(Class clazz);
    
    int registerMetaType(Class clazz, Type genericType, AnnotatedElement annotatedType, boolean isPointer, boolean isReference);
    
    /**
     * @hidden
     */
    public final class CallerContext{
        public CallerContext(Class declaringClass, String methodName, String methodDescriptor, MethodType methodType, int lineNumber) {
            super();
            this.declaringClass = declaringClass;
            this.methodName = methodName;
            this.methodDescriptor = methodDescriptor;
            this.methodType = methodType;
            this.lineNumber = lineNumber;
        }

        public final Class declaringClass;
        public final String methodName;
        public final String methodDescriptor;
        public final MethodType methodType;
        public final int lineNumber;
    }

    Supplier callerContextProvider();
    
    boolean hasOwnerFunction(QtObject object);
    boolean hasOwnerFunction(QtObjectInterface object);
    
    public QObject owner(QtObject object);
    public QObject owner(QtObjectInterface object);
    
     M findMemberAccess(Q ifc, Class interfaceClass, Class accessClass);
    
     Supplier getFactory0(Constructor constructor);
    
     Function getFactory1(Constructor constructor);
    
     BiFunction getFactory2(Constructor constructor);
    
     QMetaObject.Method3 getFactory3(Constructor constructor);
    
     QMetaObject.Method4 getFactory4(Constructor constructor);
    
     QMetaObject.Method5 getFactory5(Constructor constructor);
    
     T invokeContructor(Constructor constructor, Object... args) throws Throwable;
    
    Object invokeMethod(Method method, Object object, Object... args) throws Throwable;
    
    Package getDefinedPackage(ClassLoader cl, String pkg);
    
    void setQmlClassInfoGeneratorFunction(Function, Map> qmlClassInfogeneratorFunction);
}