Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qwasmdom.h
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QWASMDOM_H
5#define QWASMDOM_H
6
7#include <QtCore/qtconfigmacros.h>
8#include <QtCore/QPointF>
9#include <private/qstdweb_p.h>
10#include <QtCore/qnamespace.h>
11
12#include <emscripten/val.h>
13
14#include <functional>
15#include <memory>
16#include <string>
17
18#include <QMimeData>
19QT_BEGIN_NAMESPACE
20
21namespace qstdweb {
22 struct CancellationFlag;
23}
24
25
26class QPoint;
27class QRect;
28
29namespace dom {
31{
32 explicit DataTransfer(emscripten::val webDataTransfer);
38
39 void toMimeDataWithFile(std::function<void(QMimeData *)> callback);
41 void setDragImage(emscripten::val element, const QPoint &hotspot);
42 void setData(std::string format, std::string data);
43 void setDropAction(Qt::DropAction dropAction);
44 void setDataFromMimeData(const QMimeData &mimeData);
45
47};
48
49inline emscripten::val document()
50{
51 return emscripten::val::global("document");
52}
53
54void syncCSSClassWith(emscripten::val element, std::string cssClassName, bool flag);
55
56QPointF mapPoint(emscripten::val source, emscripten::val target, const QPointF &point);
57
58void drawImageToWebImageDataArray(const QImage &source, emscripten::val destinationImageData,
59 const QRect &sourceRect);
60} // namespace dom
61
62QT_END_NAMESPACE
63#endif // QWASMDOM_H
\inmodule QtCore\reentrant
Definition qpoint.h:25
emscripten::val getUpdatedWebImage(QWasmWindow *window)
void beginPaint(const QRegion &) override
This function is called before painting onto the surface begins, with the region in which the paintin...
void resize(const QSize &size, const QRegion &staticContents) override
void updateTexture(QWasmWindow *window)
QPaintDevice * paintDevice() override
Implement this function to return the appropriate paint device.
const QImage & getImageRef() const
QImage toImage() const override
Implemented in subclasses to return the content of the backingstore as a QImage.
static QWasmIntegration * get()
friend class QWasmCompositor
void setBackingStore(QWasmBackingStore *store)
Definition qwasmwindow.h:90
Combined button and popup list for selecting options.
Definition qwasmdom.h:29
void drawImageToWebImageDataArray(const QImage &source, emscripten::val destinationImageData, const QRect &sourceRect)
Definition qwasmdom.cpp:267
void syncCSSClassWith(emscripten::val element, std::string cssClassName, bool flag)
Definition qwasmdom.cpp:246
QPointF mapPoint(emscripten::val source, emscripten::val target, const QPointF &point)
Definition qwasmdom.cpp:256
emscripten::val document()
Definition qwasmdom.h:49
DataTransfer(emscripten::val webDataTransfer)
Definition qwasmdom.cpp:40
DataTransfer(DataTransfer &&other)
void toMimeDataWithFile(std::function< void(QMimeData *)> callback)
Definition qwasmdom.cpp:87
void setDragImage(emscripten::val element, const QPoint &hotspot)
Definition qwasmdom.cpp:54
DataTransfer(const DataTransfer &other)
void setDataFromMimeData(const QMimeData &mimeData)
Definition qwasmdom.cpp:71
QMimeData * toMimeDataPreview()
Definition qwasmdom.cpp:228
DataTransfer & operator=(const DataTransfer &other)
emscripten::val webDataTransfer
Definition qwasmdom.h:46
DataTransfer & operator=(DataTransfer &&other)
void setData(std::string format, std::string data)
Definition qwasmdom.cpp:60
void setDropAction(Qt::DropAction dropAction)
Definition qwasmdom.cpp:66