4#ifndef QQMLPREVIEWFILEENGINE_H
5#define QQMLPREVIEWFILEENGINE_H
20#include <QtCore/qpointer.h>
21#include <private/qabstractfileengine_p.h>
22#include <private/qfsfileengine_p.h>
23#include <QtCore/qbuffer.h>
29class QQmlPreviewFileEngine :
public QAbstractFileEngine
32 QQmlPreviewFileEngine(
const QString &file,
const QString &absolute,
35 void setFileName(
const QString &file)
override;
37 bool open(QIODevice::OpenMode flags, std::optional<QFile::Permissions> permissions)
override;
38 bool close() override;
39 qint64 size()
const override;
40 qint64 pos()
const override;
41 bool seek(qint64)
override;
42 qint64 read(
char *data, qint64 maxlen)
override;
44 FileFlags fileFlags(FileFlags type)
const override;
45 QString fileName(QAbstractFileEngine::FileName file)
const override;
46 uint ownerId(FileOwner)
const override;
48 IteratorUniquePtr beginEntryList(
const QString &path, QDirListing::IteratorFlags filters,
49 const QStringList &filterNames)
override;
50 IteratorUniquePtr endEntryList()
override;
53 bool flush() override;
54 bool syncToDisk() override;
55 bool isSequential()
const override;
56 bool remove() override;
57 bool copy(
const QString &newName)
override;
58 bool rename(
const QString &newName)
override;
59 bool renameOverwrite(
const QString &newName)
override;
60 bool link(
const QString &newName)
override;
61 bool mkdir(
const QString &dirName,
bool createParentDirectories,
62 std::optional<QFile::Permissions> permissions = std::nullopt)
const override;
63 bool rmdir(
const QString &dirName,
bool recurseParentDirectories)
const override;
64 bool setSize(qint64 size)
override;
65 bool caseSensitive()
const override;
66 bool isRelativePath()
const override;
67 bool setPermissions(uint perms) override;
68 QByteArray id()
const override;
69 QString owner(FileOwner)
const override;
70 QDateTime fileTime(QFile::FileTime time)
const override;
71 int handle()
const override;
72 qint64 readLine(
char *data, qint64 maxlen)
override;
73 qint64 write(
const char *data, qint64 len)
override;
74 bool extension(Extension extension,
const ExtensionOption *option, ExtensionReturn *output)
override;
75 bool supportsExtension(Extension extension)
const override;
82 QPointer<QQmlPreviewFileLoader> m_loader;
84 mutable QBuffer m_contents;
85 mutable QStringList m_entries;
86 mutable std::unique_ptr<QAbstractFileEngine> m_fallback;
87 mutable QQmlPreviewFileLoader::Result m_result = QQmlPreviewFileLoader::Unknown;
98 QPointer<QQmlPreviewFileLoader> m_loader;
void messageReceived(const QByteArray &message) override
void foundTranslationBinding(const TranslationBindingInformation &translationBindingInformation) override
void engineAboutToBeAdded(QJSEngine *engine) override
~QQmlDebugTranslationServiceImpl()
void state(const QString &stateName)
void engineAboutToBeRemoved(QJSEngine *engine) override
void watchTextElides(bool)
void sendTranslatableTextOccurrences()
void elidedTranslations()
QQuickItem * currentRootItem()
QMultiMap< QObject *, TranslationBindingInformation > objectTranslationBindingMultiMap
QQuickView * currentQuickView
QList< QPointer< QQuickItem > > translatableTextOccurrences
ProxyTranslator * proxyTranslator
bool enableWatchTranslations
QTimer translatableTextOccurrenceTimer
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...
void dropCU(const QUrl &url)
void zoom(qreal newFactor)
QQuickItem * currentRootItem()
bool eventFilter(QObject *obj, QEvent *event) override
Filters events if this object has been installed as an event filter for the watched object.
void fps(const FpsInfo &info)
void removeEngine(QQmlEngine *engine)
void addEngine(QQmlEngine *engine)
void loadUrl(const QUrl &url)
bool operator==(const QQmlPreviewPosition::ScreenData &other) const
void loadWindowPositionSettings(const QUrl &url)
void takePosition(QWindow *window, InitializeState state=PositionInitialized)
void initLastSavedWindowPosition(QWindow *window)
void forwardRequest(const QString &file)
void drop(const QUrl &url)
void engineAboutToBeRemoved(QJSEngine *engine) override
QQuickItem * currentRootItem()
QQmlPreviewServiceImpl(QObject *parent=nullptr)
void file(const QString &file, const QByteArray &contents)
void directory(const QString &file, const QStringList &entries)
virtual ~QQmlPreviewServiceImpl()
void engineAboutToBeAdded(QJSEngine *engine) override
void forwardFps(const QQmlPreviewHandler::FpsInfo &frames)
static const QString s_key
void load(const QUrl &url)
void stateChanged(State state) override
void forwardError(const QString &error)
void messageReceived(const QByteArray &message) override
QDebug operator<<(QDebug dbg, const QFileInfo &fi)
static QString translationIdString(const QQmlTranslation::QsTrData &data)