4#ifndef QANDROIDAPKFILEENGINE_H
5#define QANDROIDAPKFILEENGINE_H
7#include <QtCore/private/qabstractfileengine_p.h>
8#include <QtCore/qjnitypes.h>
9#include <QtCore/QJniObject>
13Q_DECLARE_JNI_CLASS(QtApkFileEngine,
"org/qtproject/qt/android/QtApkFileEngine")
15class QAndroidApkFileEngine :
public QAbstractFileEngine
18 QAndroidApkFileEngine(
const QString &fileName);
19 ~QAndroidApkFileEngine();
28 bool open(QIODevice::OpenMode openMode, std::optional<QFile::Permissions> permissions) override;
29 bool close() override;
30 qint64 size()
const override;
31 qint64 pos()
const override;
32 bool seek(qint64 pos) override;
33 qint64 read(
char *data, qint64 maxlen) override;
34 FileFlags fileFlags(FileFlags type = FileInfoAll)
const override;
35 bool caseSensitive()
const override {
return true; }
36 QString fileName(FileName file = DefaultName)
const override;
37 void setFileName(
const QString &file) override;
39 uchar *map(qint64 offset, qint64 size, QFile::MemoryMapFlags flags);
40 bool extension(Extension extension,
const ExtensionOption *option =
nullptr,
41 ExtensionReturn *output =
nullptr) override;
42 bool supportsExtension(Extension extension)
const override;
44 static QString apkPath();
45 static QString relativePath(
const QString &filePath);
47#ifndef QT_NO_FILESYSTEMITERATOR
48 IteratorUniquePtr beginEntryList(
const QString &, QDirListing::IteratorFlags filters,
49 const QStringList &filterNames) override;
54 FileInfo *m_fileInfo =
nullptr;
55 QtJniTypes::QtApkFileEngine m_apkFileEngine;
58#ifndef QT_NO_FILESYSTEMITERATOR
63 QDirListing::IteratorFlags filters,
64 const QStringList &filterNames);
73 QList<QAndroidApkFileEngine::FileInfo *> m_infos;
#define GET_AND_CHECK_STATIC_METHOD(VAR, CLASS, METHOD_NAME, METHOD_SIGNATURE)
static bool initJavaReferences(QJniEnvironment &env)
static const char m_qtTag[]
static sem_t m_exitSemaphore
#define GET_AND_CHECK_STATIC_FIELD(VAR, CLASS, FIELD_NAME, FIELD_SIGNATURE)
static jclass m_qtActivityClass
static AndroidAssetsFileEngineHandler * m_androidAssetsFileEngineHandler
static jclass m_bitmapClass
static void terminateQtNativeApplication(JNIEnv *env, jclass)
static jclass m_bitmapDrawableClass
static void handleLayoutSizeChanged(JNIEnv *, jclass, jint availableWidth, jint availableHeight)
static jobject m_resourcesObj
static jmethodID m_bitmapDrawableConstructorMethodID
static void handleScreenChanged(JNIEnv *, jclass, jint displayId)
static QAndroidPlatformIntegration * m_androidPlatformIntegration
static AndroidContentFileEngineHandler * m_androidContentFileEngineHandler
static bool registerNatives(QJniEnvironment &env)
static JNINativeMethod methods[]
static AndroidBackendRegister * m_backendRegister
static void onNewIntent(JNIEnv *env, jclass, jobject data)
static void initializeBackends()
#define FIND_AND_CHECK_CLASS(CLASS_NAME)
#define GET_AND_CHECK_METHOD(VAR, CLASS, METHOD_NAME, METHOD_SIGNATURE)
static void handleUiDarkModeChanged(JNIEnv *, jobject, jint newUiMode)
static int m_pendingApplicationState
static void handleRefreshRateChanged(JNIEnv *, jclass, jfloat refreshRate)
static QBasicMutex m_platformMutex
static void updateApplicationState(JNIEnv *, jobject, jint state)
static bool initCleanupHandshakeSemaphores()
static void clearJavaReferences(JNIEnv *env)
int(* Main)(int, char **)
static void handleOrientationChanged(JNIEnv *, jobject, jint newRotation, jint nativeOrientation)
static void startQtNativeApplication(JNIEnv *jenv, jobject object, jstring paramsString)
static const char m_methodErrorMsg[]
static void handleScreenRemoved(JNIEnv *, jclass, jint displayId)
static void updateLocale(JNIEnv *, jobject)
static jobject m_RGB_565_BitmapConfigValue
static const char m_classErrorMsg[]
static jobject m_ARGB_8888_BitmapConfigValue
static sem_t m_stopQtSemaphore
static jclass m_qtServiceClass
static AAssetManager * m_assetManager
static jmethodID m_createBitmapMethodID
static jobject onBind(JNIEnv *, jclass, jobject intent)
static void onActivityResult(JNIEnv *, jclass, jint requestCode, jint resultCode, jobject data)
static void handleScreenDensityChanged(JNIEnv *, jclass, jdouble density)
static QAndroidApkFileEngineHandler * m_androidApkFileEngineHandler
static void handleScreenAdded(JNIEnv *, jclass, jint displayId)
std::unique_ptr< QAbstractFileEngine > create(const QString &fileName) const override
If this file handler can handle fileName, this method creates a file engine and returns it wrapped in...
QString currentFileName() const override
This pure virtual function returns the name of the current directory entry, excluding the path.
QString currentFilePath() const override
Returns the path to the current directory entry.
bool advance() override
This pure virtual function advances the iterator to the next directory entry; if the operation was su...
~QAndroidApkFileEngineIterator()
QAndroidApkFileEngineIterator(const QString &path, QDirListing::IteratorFlags filters, const QStringList &filterNames)
static QAndroidEventDispatcherStopper * instance()
void goingToStop(bool stop)
\inmodule QtCore\reentrant
const char * classErrorMsgFmt()
void setViewVisibility(jobject view, bool visible)
void setAndroidPlatformIntegration(QAndroidPlatformIntegration *androidPlatformIntegration)
QBasicMutex * platformInterfaceMutex()
jobject createBitmap(int width, int height, QImage::Format format, JNIEnv *env)
jobject createBitmapDrawable(jobject bitmap, JNIEnv *env=nullptr)
QWindow * topLevelWindowAt(const QPoint &globalPos)
QAndroidPlatformIntegration * androidPlatformIntegration()
jobject createBitmap(QImage img, JNIEnv *env=nullptr)
AndroidBackendRegister * backendRegister()
bool blockEventLoopsWhenSuspended()
QWindow * windowFromId(int windowId)
jclass applicationClass()
void notifyNativePluginIntegrationReady(bool ready)
AAssetManager * assetManager()
const char * methodErrorMsgFmt()
Q_DECLARE_JNI_CLASS(MotionEvent, "android/view/MotionEvent")