Changeset View
Changeset View
Standalone View
Standalone View
src/articleviewer-ng/webengine/articlehtmlwebenginewriter.h
Show All 15 Lines | 1 | /* | |||
---|---|---|---|---|---|
16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
17 | Boston, MA 02110-1301, USA. | 17 | Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #ifndef ARTICLEHTMLWEBENGINEWRITER_H | 20 | #ifndef ARTICLEHTMLWEBENGINEWRITER_H | ||
21 | #define ARTICLEHTMLWEBENGINEWRITER_H | 21 | #define ARTICLEHTMLWEBENGINEWRITER_H | ||
22 | 22 | | |||
23 | #include <QObject> | 23 | #include <QObject> | ||
24 | #include <QUrl> | ||||
24 | #include "akregator_export.h" | 25 | #include "akregator_export.h" | ||
25 | namespace Akregator { | 26 | namespace Akregator { | ||
26 | class ArticleViewerWebEngine; | 27 | class ArticleViewerWebEngine; | ||
27 | class AKREGATOR_EXPORT ArticleHtmlWebEngineWriter : public QObject | 28 | class AKREGATOR_EXPORT ArticleHtmlWebEngineWriter : public QObject | ||
28 | { | 29 | { | ||
29 | Q_OBJECT | 30 | Q_OBJECT | ||
30 | public: | 31 | public: | ||
31 | explicit ArticleHtmlWebEngineWriter(ArticleViewerWebEngine *view, QObject *parent = nullptr); | 32 | explicit ArticleHtmlWebEngineWriter(ArticleViewerWebEngine *view, QObject *parent = nullptr); | ||
32 | ~ArticleHtmlWebEngineWriter(); | 33 | ~ArticleHtmlWebEngineWriter(); | ||
33 | 34 | | |||
34 | void begin(); | 35 | void begin(); | ||
35 | void end(); | 36 | void end(); | ||
36 | void reset(); | 37 | void reset(); | ||
37 | void queue(const QString &str); | 38 | void queue(const QString &str); | ||
38 | void flush(); | 39 | void flush(); | ||
40 | void setBaseUrl(const QUrl &url); | ||||
39 | 41 | | |||
40 | Q_SIGNALS: | 42 | Q_SIGNALS: | ||
41 | void finished(); | 43 | void finished(); | ||
42 | 44 | | |||
43 | private: | 45 | private: | ||
44 | enum State { | 46 | enum State { | ||
45 | Begun, | 47 | Begun, | ||
46 | Queued, | 48 | Queued, | ||
47 | Ended | 49 | Ended | ||
48 | } mState; | 50 | } mState; | ||
49 | 51 | | |||
50 | QString mHtml; | 52 | QString mHtml; | ||
53 | QUrl mBaseUrl; | ||||
51 | ArticleViewerWebEngine *mWebView = nullptr; | 54 | ArticleViewerWebEngine *mWebView = nullptr; | ||
52 | }; | 55 | }; | ||
53 | } | 56 | } | ||
54 | 57 | | |||
55 | #endif // ARTICLHTMLWEBENGINEWRITER_H | 58 | #endif // ARTICLHTMLWEBENGINEWRITER_H |