| 1 |
#ifndef HTML5GUIDISPLAY_H |
| 2 |
#define HTML5GUIDISPLAY_H |
| 3 |
|
| 4 |
#if defined(QCS_QTHTML) |
| 5 |
|
| 6 |
#include <atomic> |
| 7 |
#include <QDebug> |
| 8 |
#include <QDockWidget> |
| 9 |
#include "csoundhtmlwrapper.h" |
| 10 |
#include "CsoundHtmlOnlyWrapper.h" |
| 11 |
|
| 12 |
#ifdef USE_WEBKIT |
| 13 |
#include <QtWebKit> |
| 14 |
#include <QWebView> |
| 15 |
#include <QWebFrame> |
| 16 |
#include <QWebInspector> |
| 17 |
#endif |
| 18 |
#ifdef USE_WEBENGINE |
| 19 |
#include <QtWebEngineWidgets> |
| 20 |
#include <QtWebChannel/QtWebChannel> |
| 21 |
#include <QWebEngineView> |
| 22 |
#endif |
| 23 |
|
| 24 |
|
| 25 |
#include <QTemporaryFile> |
| 26 |
|
| 27 |
|
| 28 |
namespace Ui { |
| 29 |
class Html5GuiDisplay; |
| 30 |
} |
| 31 |
|
| 32 |
class DocumentPage; |
| 33 |
|
| 34 |
class CsoundHtmlView : public QDockWidget |
| 35 |
{ |
| 36 |
Q_OBJECT |
| 37 |
public: |
| 38 |
explicit CsoundHtmlView(QWidget *parent = 0); |
| 39 |
~CsoundHtmlView(); |
| 40 |
void loadFromUrl(const QUrl &url); |
| 41 |
void load(DocumentPage *documentPage); |
| 42 |
void stop(); |
| 43 |
void setCsoundEngine(CsoundEngine *csEngine); |
| 44 |
void clear(); |
| 45 |
void setOptions(CsoundOptions * options); |
| 46 |
#ifdef USE_WEBKIT |
| 47 |
QWebView *webView; |
| 48 |
#endif |
| 49 |
#ifdef USE_WEBENGINE |
| 50 |
QWebChannel channel ; |
| 51 |
QWebEngineView *webView; |
| 52 |
#endif |
| 53 |
|
| 54 |
public slots: |
| 55 |
#ifdef USE_WEBKIT |
| 56 |
void addJSObject(); |
| 57 |
#endif |
| 58 |
#ifdef USE_WEBENGINE |
| 59 |
void showDebugWindow(); |
| 60 |
#endif |
| 61 |
void removeTemporaryHtmlFile(bool ok); |
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
private: |
| 66 |
Ui::Html5GuiDisplay *ui; |
| 67 |
std::atomic<DocumentPage *> documentPage; |
| 68 |
|
| 69 |
CsoundHtmlWrapper csoundHtmlWrapper; |
| 70 |
|
| 71 |
CsoundHtmlOnlyWrapper csoundHtmlOnlyWrapper; |
| 72 |
CsoundEngine *m_csoundEngine; |
| 73 |
|
| 74 |
QFile htmlFile; |
| 75 |
CsoundOptions * m_options; |
| 76 |
#ifdef USE_WEBENGINE |
| 77 |
QString m_debugPort; |
| 78 |
#endif |
| 79 |
}; |
| 80 |
|
| 81 |
#endif |
| 82 |
#endif |