Browse Source

Fix typography

Neal Wilson 11 years ago
parent
commit
8d6a83d759
1 changed files with 30 additions and 28 deletions
  1. 30
    28
      src/webview.w

+ 30
- 28
src/webview.w View File

9
 In order to simplify the implementation of certain features, we subclass
9
 In order to simplify the implementation of certain features, we subclass
10
 |QWebView| and provide some additional functionality.
10
 |QWebView| and provide some additional functionality.
11
 
11
 
12
+@s QWebElement int
13
+
12
 @(webview.h@>=
14
 @(webview.h@>=
13
 #include <QWebView>
15
 #include <QWebView>
14
 #include <QFile>
16
 #include <QFile>
22
 #ifndef TypicaWebViewHeader
24
 #ifndef TypicaWebViewHeader
23
 #define TypicaWebViewHeader
25
 #define TypicaWebViewHeader
24
 
26
 
25
-class TypicaWebView : public QWebView
27
+class TypicaWebView : public QWebView@/
26
 {
28
 {
27
-	Q_OBJECT
28
-	public:
29
+	@[Q_OBJECT@]@;
30
+	public:@/
29
 		TypicaWebView();
31
 		TypicaWebView();
30
-		Q_INVOKABLE void load(const QString &url);
31
-		Q_INVOKABLE void print();
32
-		Q_INVOKABLE void setHtml(const QString &html, const QUrl &baseUrl = QUrl());
33
-		Q_INVOKABLE void setContent(QIODevice *device);
34
-		Q_INVOKABLE QString saveXml();
35
-		Q_INVOKABLE QWebElement documentElement();
36
-		Q_INVOKABLE QWebElement findFirstElement(const QString &selector);
37
-	signals:
32
+		@[Q_INVOKABLE@,@, void@]@, load(const QString &url);@t\2\2@>@/
33
+		@[Q_INVOKABLE@,@, void@]@, print();@t\2\2@>@/
34
+		@[Q_INVOKABLE@,@, void@]@, setHtml(const QString &html, const QUrl &baseUrl = QUrl());@t\2\2@>@/
35
+		@[Q_INVOKABLE@,@, void@]@, setContent(QIODevice *device);@t\2\2@>@/
36
+		@[Q_INVOKABLE@,@, QString@]@, saveXml();@t\2\2@>@/
37
+		@[Q_INVOKABLE@,@, QWebElement@]@, documentElement();@t\2\2@>@/
38
+		@[Q_INVOKABLE@,@, QWebElement@]@, findFirstElement(const QString &selector);@t\2\2@>@/
39
+	@[signals@]:@/
38
 		void scriptLinkClicked(const QString &link);
40
 		void scriptLinkClicked(const QString &link);
39
-	private slots:
41
+	@[private slots@]:@/
40
 		void linkDelegate(const QUrl &url);
42
 		void linkDelegate(const QUrl &url);
41
 };
43
 };
42
 
44
 
228
 
230
 
229
 void QWebElement_fromScriptValue(const QScriptValue &value, QWebElement &element)
231
 void QWebElement_fromScriptValue(const QScriptValue &value, QWebElement &element)
230
 {
232
 {
231
-	element = value.toVariant().value<QWebElement>();
233
+	element = value.toVariant().@[value<QWebElement>()@];
232
 }
234
 }
233
 
235
 
234
 @ These methods must be registered with the engine.
236
 @ These methods must be registered with the engine.
247
 #ifndef TypicaWebElementHeader
249
 #ifndef TypicaWebElementHeader
248
 #define TypicaWebElementHeader
250
 #define TypicaWebElementHeader
249
 
251
 
250
-class TypicaWebElement : public QObject
251
-{
252
-	Q_OBJECT
253
-	public:
252
+class TypicaWebElement : public QObject@/
253
+{@/
254
+	@[Q_OBJECT@]@;
255
+	public:@/
254
 		TypicaWebElement(QWebElement element);
256
 		TypicaWebElement(QWebElement element);
255
-		Q_INVOKABLE void appendInside(const QString &markup);
256
-		Q_INVOKABLE void appendOutside(const QString &markup);
257
-		Q_INVOKABLE void prependInside(const QString &markup);
258
-		Q_INVOKABLE void prependOutside(const QString &markup);
259
-		Q_INVOKABLE void removeFromDocument();
260
-		Q_INVOKABLE void replace(const QString &markup);
261
-		Q_INVOKABLE void setInnerXml(const QString &markup);
262
-		Q_INVOKABLE void setOuterXml(const QString &markup);
263
-		Q_INVOKABLE void setPlainText(const QString &text);
264
-	private:
265
-		QWebElement e;
257
+		@[Q_INVOKABLE@,@, void@]@, appendInside(const QString &markup);@t\2\2@>@/
258
+		@[Q_INVOKABLE@,@, void@]@, appendOutside(const QString &markup);@t\2\2@>@/
259
+		@[Q_INVOKABLE@,@, void@]@, prependInside(const QString &markup);@t\2\2@>@/
260
+		@[Q_INVOKABLE@,@, void@]@, prependOutside(const QString &markup);@t\2\2@>@/
261
+		@[Q_INVOKABLE@,@, void@]@, removeFromDocument();@t\2\2@>@/
262
+		@[Q_INVOKABLE@,@, void@]@, replace(const QString &markup);@t\2\2@>@/
263
+		@[Q_INVOKABLE@,@, void@]@, setInnerXml(const QString &markup);@t\2\2@>@/
264
+		@[Q_INVOKABLE@,@, void@]@, setOuterXml(const QString &markup);@t\2\2@>@/
265
+		@[Q_INVOKABLE@,@, void@]@, setPlainText(const QString &text);@t\2\2@>@/
266
+	private:@/
267
+		QWebElement e;@/
266
 };
268
 };
267
 
269
 
268
 #endif
270
 #endif

Loading…
Cancel
Save