Guest User

Untitled

a guest
Aug 21st, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 78.47 KB | None | 0 0
  1. commit 9035e63d075099b543d865b42a94f25df0b47667
  2. Author: Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
  3. Date: Wed Nov 16 19:23:17 2011 +0100
  4.  
  5. [Qt] Move WebKit2 C++ APIs to private API and build QML extension plugin on top of that
  6.  
  7. A new extension object has been added to QQuickWebView (the same approach should be used
  8. for other API classes that need experimental APIs). The QML extension mechanism is then
  9. built on top of the experimental object.
  10.  
  11. diff --git a/Source/QtWebKit.pro b/Source/QtWebKit.pro
  12. index ed00ddb..8b27cae 100644
  13. --- a/Source/QtWebKit.pro
  14. +++ b/Source/QtWebKit.pro
  15. @@ -17,12 +17,9 @@ SUBDIRS += api
  16.  
  17. include(WebKit/qt/docs/docs.pri)
  18.  
  19. -SUBDIRS += WebKit/qt/declarative
  20. -haveQt(5) {
  21. - !no_webkit2 {
  22. - SUBDIRS += WebKit/qt/declarative/private
  23. - }
  24. -}
  25. +declarative.file = WebKit/qt/declarative/declarative.pro
  26. +declarative.makefile = Makefile.declarative
  27. +SUBDIRS += declarative
  28.  
  29. tests.file = tests.pri
  30. SUBDIRS += tests
  31. diff --git a/Source/WebKit/qt/declarative/declarative.pro b/Source/WebKit/qt/declarative/declarative.pro
  32. index f81719e..7379283 100644
  33. --- a/Source/WebKit/qt/declarative/declarative.pro
  34. +++ b/Source/WebKit/qt/declarative/declarative.pro
  35. @@ -1,58 +1,18 @@
  36. # -------------------------------------------------------------------
  37. -# Project file for the QtWebKit QML plugin
  38. +# Main project file for the Qt Quick (QML) plugin
  39. #
  40. # See 'Tools/qmake/README' for an overview of the build system
  41. # -------------------------------------------------------------------
  42.  
  43. -TEMPLATE = lib
  44. -TARGET = qmlwebkitplugin
  45. +TEMPLATE = subdirs
  46. +CONFIG += ordered
  47.  
  48. -TARGET.module_name = QtWebKit
  49. +public_api.file = public.pri
  50. +public_api.makefile = Makefile.declarative.public
  51. +SUBDIRS += public_api
  52.  
  53. -CONFIG += qt plugin
  54. -
  55. -win32|mac:!wince*:!win32-msvc:!macx-xcode:CONFIG += debug_and_release
  56. -
  57. -QMLDIRFILE = $${_PRO_FILE_PWD_}/qmldir
  58. -copy2build.input = QMLDIRFILE
  59. -copy2build.output = $${ROOT_BUILD_DIR}/imports/$${TARGET.module_name}/qmldir
  60. -!contains(TEMPLATE_PREFIX, vc):copy2build.variable_out = PRE_TARGETDEPS
  61. -copy2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
  62. -copy2build.name = COPY ${QMAKE_FILE_IN}
  63. -copy2build.CONFIG += no_link
  64. -QMAKE_EXTRA_COMPILERS += copy2build
  65. -
  66. -TARGET = $$qtLibraryTarget($$TARGET)
  67. -contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
  68. -
  69. -wince*:LIBS += $$QMAKE_LIBS_GUI
  70. -
  71. -CONFIG += qtwebkit
  72. -
  73. -QT += declarative
  74. -haveQt(5): QT += widgets
  75. -
  76. -contains(QT_CONFIG, qtquick1): {
  77. - QT += qtquick1
  78. -}
  79. -
  80. -DESTDIR = $${ROOT_BUILD_DIR}/imports/$${TARGET.module_name}
  81. -
  82. -CONFIG += rpath
  83. -RPATHDIR_RELATIVE_TO_DESTDIR = ../../lib
  84. -
  85. -SOURCES += qdeclarativewebview.cpp plugin.cpp
  86. -HEADERS += qdeclarativewebview_p.h
  87. -
  88. -!no_webkit2: {
  89. - DEFINES += HAVE_WEBKIT2
  90. - QT += network
  91. +haveQt(5):!no_webkit2 {
  92. + experimental_api.file = experimental/experimental.pri
  93. + experimental_api.makefile = Makefile.declarative.experimental
  94. + SUBDIRS += experimental_api
  95. }
  96. -
  97. -target.path = $$[QT_INSTALL_IMPORTS]/$${TARGET.module_name}
  98. -
  99. -
  100. -qmldir.files += $$PWD/qmldir
  101. -qmldir.path += $$[QT_INSTALL_IMPORTS]/$${TARGET.module_name}
  102. -
  103. -INSTALLS += target qmldir
  104. diff --git a/Source/WebKit/qt/declarative/experimental/experimental.pri b/Source/WebKit/qt/declarative/experimental/experimental.pri
  105. new file mode 100644
  106. index 0000000..0e8909e
  107. --- /dev/null
  108. +++ b/Source/WebKit/qt/declarative/experimental/experimental.pri
  109. @@ -0,0 +1,52 @@
  110. +# -------------------------------------------------------------------
  111. +# Project file for the Qt Quick (QML) experimental API plugin
  112. +#
  113. +# See 'Tools/qmake/README' for an overview of the build system
  114. +# -------------------------------------------------------------------
  115. +
  116. +TEMPLATE = lib
  117. +TARGET = qmlwebkitexperimentalplugin
  118. +
  119. +TARGET.module_name = QtWebKit/experimental
  120. +
  121. +CONFIG += qt plugin
  122. +
  123. +win32|mac:!wince*:!win32-msvc:!macx-xcode:CONFIG += debug_and_release
  124. +
  125. +QMLDIRFILE = $${_PRO_FILE_PWD_}/qmldir
  126. +copy2build.input = QMLDIRFILE
  127. +copy2build.output = $${ROOT_BUILD_DIR}/imports/$${TARGET.module_name}/qmldir
  128. +!contains(TEMPLATE_PREFIX, vc):copy2build.variable_out = PRE_TARGETDEPS
  129. +copy2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
  130. +copy2build.name = COPY ${QMAKE_FILE_IN}
  131. +copy2build.CONFIG += no_link
  132. +QMAKE_EXTRA_COMPILERS += copy2build
  133. +
  134. +TARGET = $$qtLibraryTarget($$TARGET)
  135. +contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
  136. +
  137. +wince*:LIBS += $$QMAKE_LIBS_GUI
  138. +
  139. +CONFIG += qtwebkit qtwebkit-private
  140. +
  141. +QT += declarative widgets network
  142. +
  143. +DESTDIR = $${ROOT_BUILD_DIR}/imports/$${TARGET.module_name}
  144. +
  145. +CONFIG += rpath
  146. +RPATHDIR_RELATIVE_TO_DESTDIR = ../../lib
  147. +
  148. +SOURCES += plugin.cpp
  149. +
  150. +DEFINES += HAVE_WEBKIT2
  151. +INCLUDEPATH += ../../../../WebKit2/UIProcess/API/qt
  152. +
  153. +target.path = $$[QT_INSTALL_IMPORTS]/$${TARGET.module_name}
  154. +
  155. +
  156. +qmldir.files += $$PWD/qmldir
  157. +qmldir.path += $$[QT_INSTALL_IMPORTS]/$${TARGET.module_name}
  158. +
  159. +INSTALLS += target qmldir
  160. +
  161. +
  162. diff --git a/Source/WebKit/qt/declarative/experimental/plugin.cpp b/Source/WebKit/qt/declarative/experimental/plugin.cpp
  163. new file mode 100644
  164. index 0000000..91e54ce
  165. --- /dev/null
  166. +++ b/Source/WebKit/qt/declarative/experimental/plugin.cpp
  167. @@ -0,0 +1,53 @@
  168. +/*
  169. + Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
  170. +
  171. + This library is free software; you can redistribute it and/or
  172. + modify it under the terms of the GNU Library General Public
  173. + License as published by the Free Software Foundation; either
  174. + version 2 of the License, or (at your option) any later version.
  175. +
  176. + This library is distributed in the hope that it will be useful,
  177. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  178. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  179. + Library General Public License for more details.
  180. +
  181. + You should have received a copy of the GNU Library General Public License
  182. + along with this library; see the file COPYING.LIB. If not, write to
  183. + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  184. + Boston, MA 02110-1301, USA.
  185. +*/
  186. +
  187. +#include "qquickwebpage_p.h"
  188. +#include "qquickwebview_p.h"
  189. +
  190. +#include <QtDeclarative/qdeclarative.h>
  191. +#include <QtDeclarative/qdeclarativeextensionplugin.h>
  192. +
  193. +QT_BEGIN_NAMESPACE
  194. +
  195. +class QQuickWebViewExperimentalExtension : public QObject {
  196. + Q_OBJECT
  197. + Q_PROPERTY(QQuickWebViewExperimental* experimental READ experimental CONSTANT FINAL)
  198. +public:
  199. + QQuickWebViewExperimentalExtension(QObject *parent = 0) : QObject(parent) {}
  200. + QQuickWebViewExperimental* experimental() { return static_cast<QQuickWebView*>(parent())->experimental(); }
  201. +};
  202. +
  203. +class WebKitQmlExperimentalExtensionPlugin: public QDeclarativeExtensionPlugin {
  204. + Q_OBJECT
  205. +public:
  206. + virtual void registerTypes(const char* uri)
  207. + {
  208. + Q_ASSERT(QLatin1String(uri) == QLatin1String("QtWebKit.experimental"));
  209. +
  210. + qmlRegisterExtendedType<QQuickWebView, QQuickWebViewExperimentalExtension>(uri, 3, 0, "WebView");
  211. + qmlRegisterUncreatableType<QQuickWebViewExperimental>(uri, 3, 0, "QQuickWebViewExperimental",
  212. + QObject::tr("Cannot create separate instance of QQuickWebViewExperimental"));
  213. + }
  214. +};
  215. +
  216. +QT_END_NAMESPACE
  217. +
  218. +#include "plugin.moc"
  219. +
  220. +Q_EXPORT_PLUGIN2(qmlwebkitpluginexperimental, QT_PREPEND_NAMESPACE(WebKitQmlExperimentalExtensionPlugin));
  221. diff --git a/Source/WebKit/qt/declarative/experimental/qmldir b/Source/WebKit/qt/declarative/experimental/qmldir
  222. new file mode 100644
  223. index 0000000..9dc8b0e
  224. --- /dev/null
  225. +++ b/Source/WebKit/qt/declarative/experimental/qmldir
  226. @@ -0,0 +1 @@
  227. +plugin qmlwebkitprivateplugin
  228. diff --git a/Source/WebKit/qt/declarative/experimental/qquickwebviewexperimentalextension.cpp b/Source/WebKit/qt/declarative/experimental/qquickwebviewexperimentalextension.cpp
  229. new file mode 100644
  230. index 0000000..86adc34
  231. --- /dev/null
  232. +++ b/Source/WebKit/qt/declarative/experimental/qquickwebviewexperimentalextension.cpp
  233. @@ -0,0 +1,32 @@
  234. +/*
  235. + * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
  236. + *
  237. + * This library is free software; you can redistribute it and/or
  238. + * modify it under the terms of the GNU Library General Public
  239. + * License as published by the Free Software Foundation; either
  240. + * version 2 of the License, or (at your option) any later version.
  241. + *
  242. + * This program is distributed in the hope that it will be useful,
  243. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  244. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  245. + * Library General Public License for more details.
  246. + *
  247. + * You should have received a copy of the GNU Library General Public License
  248. + * along with this program; see the file COPYING.LIB. If not, write to
  249. + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  250. + * Boston, MA 02110-1301, USA.
  251. + *
  252. + */
  253. +
  254. +#include "qquickwebviewexperimentalextension.h"
  255. +
  256. +QQuickWebViewExperimentalExtension::QQuickWebViewExperimentalExtension(QObject* parent)
  257. + : QObject(parent)
  258. +{
  259. +}
  260. +
  261. +void QQuickWebViewExperimentalExtension::setUseTraditionalDesktopBehaviour(bool enable)
  262. +{
  263. + webView()->setUseTraditionalDesktopBehaviour(enable);
  264. +}
  265. +
  266. diff --git a/Source/WebKit/qt/declarative/plugin.cpp b/Source/WebKit/qt/declarative/plugin.cpp
  267. index 379b979..91634ee 100644
  268. --- a/Source/WebKit/qt/declarative/plugin.cpp
  269. +++ b/Source/WebKit/qt/declarative/plugin.cpp
  270. @@ -23,10 +23,10 @@
  271. #include <QtDeclarative/qdeclarativeextensionplugin.h>
  272.  
  273. #if defined(HAVE_WEBKIT2)
  274. -#include "qquickwebpage.h"
  275. -#include "qquickwebview.h"
  276. -#include "qwebdownloaditem.h"
  277. -#include "qwebpreferences.h"
  278. +#include "qquickwebpage_p.h"
  279. +#include "qquickwebview_p.h"
  280. +#include "qwebdownloaditem_p.h"
  281. +#include "qwebpreferences_p.h"
  282.  
  283. #include <QtNetwork/qnetworkreply.h>
  284. #endif
  285. diff --git a/Source/WebKit/qt/declarative/private/plugin.cpp b/Source/WebKit/qt/declarative/private/plugin.cpp
  286. deleted file mode 100644
  287. index 6b11344..0000000
  288. --- a/Source/WebKit/qt/declarative/private/plugin.cpp
  289. +++ /dev/null
  290. @@ -1,47 +0,0 @@
  291. -/*
  292. - Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
  293. -
  294. - This library is free software; you can redistribute it and/or
  295. - modify it under the terms of the GNU Library General Public
  296. - License as published by the Free Software Foundation; either
  297. - version 2 of the License, or (at your option) any later version.
  298. -
  299. - This library is distributed in the hope that it will be useful,
  300. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  301. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  302. - Library General Public License for more details.
  303. -
  304. - You should have received a copy of the GNU Library General Public License
  305. - along with this library; see the file COPYING.LIB. If not, write to
  306. - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  307. - Boston, MA 02110-1301, USA.
  308. -*/
  309. -
  310. -#include "config.h"
  311. -
  312. -#include "qquickwebpage.h"
  313. -#include "qquickwebview.h"
  314. -#include "qquickwebview_p.h"
  315. -#include "qquickwebviewprivateextension_p.h"
  316. -
  317. -#include <QtDeclarative/qdeclarative.h>
  318. -#include <QtDeclarative/qdeclarativeextensionplugin.h>
  319. -
  320. -QT_BEGIN_NAMESPACE
  321. -
  322. -class WebKitQmlPluginPrivate : public QDeclarativeExtensionPlugin {
  323. - Q_OBJECT
  324. -public:
  325. - virtual void registerTypes(const char* uri)
  326. - {
  327. - Q_ASSERT(QLatin1String(uri) == QLatin1String("QtWebKit.private"));
  328. - qmlRegisterExtendedType<QQuickWebView, QQuickWebViewPrivateExtension>(uri, 3, 0, "WebView");
  329. - qmlRegisterUncreatableType<QQuickWebViewPrivate>(uri, 3, 0, "WebViewPrivate", QObject::tr("Cannot create separate instance of WebViewPrivate"));
  330. - }
  331. -};
  332. -
  333. -QT_END_NAMESPACE
  334. -
  335. -#include "plugin.moc"
  336. -
  337. -Q_EXPORT_PLUGIN2(qmlwebkitpluginprivate, QT_PREPEND_NAMESPACE(WebKitQmlPluginPrivate));
  338. diff --git a/Source/WebKit/qt/declarative/private/private.pro b/Source/WebKit/qt/declarative/private/private.pro
  339. deleted file mode 100644
  340. index 886b73b..0000000
  341. --- a/Source/WebKit/qt/declarative/private/private.pro
  342. +++ /dev/null
  343. @@ -1,54 +0,0 @@
  344. -# -------------------------------------------------------------------
  345. -# Project file for the QtWebKit QML private plugin
  346. -#
  347. -# See 'Tools/qmake/README' for an overview of the build system
  348. -# -------------------------------------------------------------------
  349. -
  350. -TEMPLATE = lib
  351. -TARGET = qmlwebkitprivateplugin
  352. -
  353. -TARGET.module_name = QtWebKit/private
  354. -
  355. -CONFIG += qt plugin
  356. -
  357. -win32|mac:!wince*:!win32-msvc:!macx-xcode:CONFIG += debug_and_release
  358. -
  359. -QMLDIRFILE = $${_PRO_FILE_PWD_}/qmldir
  360. -copy2build.input = QMLDIRFILE
  361. -copy2build.output = $${ROOT_BUILD_DIR}/imports/$${TARGET.module_name}/qmldir
  362. -!contains(TEMPLATE_PREFIX, vc):copy2build.variable_out = PRE_TARGETDEPS
  363. -copy2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
  364. -copy2build.name = COPY ${QMAKE_FILE_IN}
  365. -copy2build.CONFIG += no_link
  366. -QMAKE_EXTRA_COMPILERS += copy2build
  367. -
  368. -TARGET = $$qtLibraryTarget($$TARGET)
  369. -contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
  370. -
  371. -wince*:LIBS += $$QMAKE_LIBS_GUI
  372. -
  373. -load(javascriptcore)
  374. -load(webcore)
  375. -load(webkit2)
  376. -CONFIG += qtwebkit
  377. -
  378. -QT += declarative widgets network
  379. -
  380. -DESTDIR = $${ROOT_BUILD_DIR}/imports/$${TARGET.module_name}
  381. -
  382. -CONFIG += rpath
  383. -RPATHDIR_RELATIVE_TO_DESTDIR = ../../lib
  384. -
  385. -SOURCES += plugin.cpp
  386. -
  387. -DEFINES += HAVE_WEBKIT2
  388. -INCLUDEPATH += ../../../../WebKit2/UIProcess/API/qt
  389. -
  390. -target.path = $$[QT_INSTALL_IMPORTS]/$${TARGET.module_name}
  391. -
  392. -
  393. -qmldir.files += $$PWD/qmldir
  394. -qmldir.path += $$[QT_INSTALL_IMPORTS]/$${TARGET.module_name}
  395. -
  396. -INSTALLS += target qmldir
  397. -
  398. diff --git a/Source/WebKit/qt/declarative/private/qmldir b/Source/WebKit/qt/declarative/private/qmldir
  399. deleted file mode 100644
  400. index 9dc8b0e..0000000
  401. --- a/Source/WebKit/qt/declarative/private/qmldir
  402. +++ /dev/null
  403. @@ -1 +0,0 @@
  404. -plugin qmlwebkitprivateplugin
  405. diff --git a/Source/WebKit/qt/declarative/public.pri b/Source/WebKit/qt/declarative/public.pri
  406. new file mode 100644
  407. index 0000000..b331339
  408. --- /dev/null
  409. +++ b/Source/WebKit/qt/declarative/public.pri
  410. @@ -0,0 +1,58 @@
  411. +# -------------------------------------------------------------------
  412. +# Project file for the QtWebKit QML plugin
  413. +#
  414. +# See 'Tools/qmake/README' for an overview of the build system
  415. +# -------------------------------------------------------------------
  416. +
  417. +TEMPLATE = lib
  418. +TARGET = qmlwebkitplugin
  419. +
  420. +TARGET.module_name = QtWebKit
  421. +
  422. +CONFIG += qt plugin
  423. +
  424. +win32|mac:!wince*:!win32-msvc:!macx-xcode:CONFIG += debug_and_release
  425. +
  426. +QMLDIRFILE = $${_PRO_FILE_PWD_}/qmldir
  427. +copy2build.input = QMLDIRFILE
  428. +copy2build.output = $${ROOT_BUILD_DIR}/imports/$${TARGET.module_name}/qmldir
  429. +!contains(TEMPLATE_PREFIX, vc):copy2build.variable_out = PRE_TARGETDEPS
  430. +copy2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
  431. +copy2build.name = COPY ${QMAKE_FILE_IN}
  432. +copy2build.CONFIG += no_link
  433. +QMAKE_EXTRA_COMPILERS += copy2build
  434. +
  435. +TARGET = $$qtLibraryTarget($$TARGET)
  436. +contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
  437. +
  438. +wince*:LIBS += $$QMAKE_LIBS_GUI
  439. +
  440. +CONFIG += qtwebkit qtwebkit-private
  441. +
  442. +QT += declarative
  443. +haveQt(5): QT += widgets
  444. +
  445. +contains(QT_CONFIG, qtquick1): {
  446. + QT += qtquick1
  447. +}
  448. +
  449. +DESTDIR = $${ROOT_BUILD_DIR}/imports/$${TARGET.module_name}
  450. +
  451. +CONFIG += rpath
  452. +RPATHDIR_RELATIVE_TO_DESTDIR = ../../lib
  453. +
  454. +SOURCES += qdeclarativewebview.cpp plugin.cpp
  455. +HEADERS += qdeclarativewebview_p.h
  456. +
  457. +!no_webkit2: {
  458. + DEFINES += HAVE_WEBKIT2
  459. + QT += network
  460. +}
  461. +
  462. +target.path = $$[QT_INSTALL_IMPORTS]/$${TARGET.module_name}
  463. +
  464. +
  465. +qmldir.files += $$PWD/qmldir
  466. +qmldir.path += $$[QT_INSTALL_IMPORTS]/$${TARGET.module_name}
  467. +
  468. +INSTALLS += target qmldir
  469. diff --git a/Source/WebKit2/Target.pri b/Source/WebKit2/Target.pri
  470. index d378c54..d4a7405 100644
  471. --- a/Source/WebKit2/Target.pri
  472. +++ b/Source/WebKit2/Target.pri
  473. @@ -242,15 +242,14 @@ HEADERS += \
  474. UIProcess/API/cpp/WKRetainPtr.h \
  475. UIProcess/API/cpp/qt/WKStringQt.h \
  476. UIProcess/API/cpp/qt/WKURLQt.h \
  477. - UIProcess/API/qt/qwebpreferences.h \
  478. UIProcess/API/qt/qwebpreferences_p.h \
  479. - UIProcess/API/qt/qwebdownloaditem.h \
  480. + UIProcess/API/qt/qwebpreferences_p_p.h \
  481. UIProcess/API/qt/qwebdownloaditem_p.h \
  482. - UIProcess/API/qt/qquickwebpage.h \
  483. + UIProcess/API/qt/qwebdownloaditem_p_p.h \
  484. UIProcess/API/qt/qquickwebpage_p.h \
  485. - UIProcess/API/qt/qquickwebview.h \
  486. + UIProcess/API/qt/qquickwebpage_p_p.h \
  487. UIProcess/API/qt/qquickwebview_p.h \
  488. - UIProcess/API/qt/qquickwebviewprivateextension_p.h \
  489. + UIProcess/API/qt/qquickwebview_p_p.h \
  490. UIProcess/Authentication/AuthenticationChallengeProxy.h \
  491. UIProcess/Authentication/AuthenticationDecisionListener.h \
  492. UIProcess/Authentication/WebCredential.h \
  493. @@ -553,7 +552,6 @@ SOURCES += \
  494. UIProcess/API/qt/qquickwebpage.cpp \
  495. UIProcess/API/qt/qquickwebview.cpp \
  496. UIProcess/API/qt/qwebpreferences.cpp \
  497. - UIProcess/API/qt/qquickwebviewprivateextension.cpp \
  498. UIProcess/Authentication/AuthenticationChallengeProxy.cpp \
  499. UIProcess/Authentication/AuthenticationDecisionListener.cpp \
  500. UIProcess/Authentication/WebCredential.cpp \
  501. diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp b/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp
  502. index a12278f..ef1347e 100644
  503. --- a/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp
  504. +++ b/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp
  505. @@ -19,12 +19,12 @@
  506. */
  507.  
  508. #include "config.h"
  509. -#include "qquickwebpage.h"
  510. +#include "qquickwebpage_p.h"
  511.  
  512. #include "QtWebPageProxy.h"
  513. #include "TransformationMatrix.h"
  514. -#include "qquickwebpage_p.h"
  515. -#include "qquickwebview.h"
  516. +#include "qquickwebpage_p_p.h"
  517. +#include "qquickwebview_p.h"
  518. #include <QtCore/QUrl>
  519. #include <QtDeclarative/QQuickCanvas>
  520. #include <QtDeclarative/QSGEngine>
  521. @@ -243,4 +243,4 @@ void QQuickWebPagePrivate::_q_onSceneGraphInitialized()
  522. QObject::connect(engine, SIGNAL(afterRendering()), q, SLOT(_q_onAfterSceneRender()), Qt::DirectConnection);
  523. }
  524.  
  525. -#include "moc_qquickwebpage.cpp"
  526. +#include "moc_qquickwebpage_p.cpp"
  527. diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebpage.h b/Source/WebKit2/UIProcess/API/qt/qquickwebpage.h
  528. deleted file mode 100644
  529. index 38b9cd4..0000000
  530. --- a/Source/WebKit2/UIProcess/API/qt/qquickwebpage.h
  531. +++ /dev/null
  532. @@ -1,77 +0,0 @@
  533. -/*
  534. - * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
  535. - *
  536. - * This library is free software; you can redistribute it and/or
  537. - * modify it under the terms of the GNU Library General Public
  538. - * License as published by the Free Software Foundation; either
  539. - * version 2 of the License, or (at your option) any later version.
  540. - *
  541. - * This program is distributed in the hope that it will be useful,
  542. - * but WITHOUT ANY WARRANTY; without even the implied warranty of
  543. - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  544. - * Library General Public License for more details.
  545. - *
  546. - * You should have received a copy of the GNU Library General Public License
  547. - * along with this program; see the file COPYING.LIB. If not, write to
  548. - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  549. - * Boston, MA 02110-1301, USA.
  550. - *
  551. - */
  552. -
  553. -#ifndef qquickwebpage_h
  554. -#define qquickwebpage_h
  555. -
  556. -#include "qwebkitglobal.h"
  557. -
  558. -#include <QtCore/QSharedPointer>
  559. -#include <QtDeclarative/QQuickItem>
  560. -
  561. -class QQuickWebView;
  562. -class QQuickWebPagePrivate;
  563. -class QWebPreferences;
  564. -
  565. -namespace WebKit {
  566. -class QtViewInterface;
  567. -}
  568. -
  569. -class QWEBKIT_EXPORT QQuickWebPage : public QQuickItem {
  570. - Q_OBJECT
  571. -public:
  572. - QQuickWebPage(QQuickItem* parent = 0);
  573. - virtual ~QQuickWebPage();
  574. -
  575. -protected:
  576. - virtual void keyPressEvent(QKeyEvent*);
  577. - virtual void keyReleaseEvent(QKeyEvent*);
  578. - virtual void inputMethodEvent(QInputMethodEvent*);
  579. - virtual void focusInEvent(QFocusEvent*);
  580. - virtual void focusOutEvent(QFocusEvent*);
  581. - virtual void mousePressEvent(QMouseEvent*);
  582. - virtual void mouseMoveEvent(QMouseEvent*);
  583. - virtual void mouseReleaseEvent(QMouseEvent *);
  584. - virtual void mouseDoubleClickEvent(QMouseEvent*);
  585. - virtual void wheelEvent(QWheelEvent*);
  586. - virtual void hoverEnterEvent(QHoverEvent*);
  587. - virtual void hoverMoveEvent(QHoverEvent*);
  588. - virtual void hoverLeaveEvent(QHoverEvent*);
  589. - virtual void dragMoveEvent(QDragMoveEvent*);
  590. - virtual void dragEnterEvent(QDragEnterEvent*);
  591. - virtual void dragLeaveEvent(QDragLeaveEvent*);
  592. - virtual void dropEvent(QDropEvent*);
  593. - virtual void touchEvent(QTouchEvent*);
  594. - virtual bool event(QEvent*);
  595. - virtual void geometryChanged(const QRectF&, const QRectF&);
  596. - virtual void itemChange(ItemChange, const ItemChangeData&);
  597. -
  598. -private:
  599. - Q_PRIVATE_SLOT(d, void _q_onAfterSceneRender());
  600. - Q_PRIVATE_SLOT(d, void _q_onSceneGraphInitialized());
  601. -
  602. - QQuickWebPagePrivate* d;
  603. - friend class QQuickWebViewPrivate;
  604. - friend class WebKit::QtViewInterface;
  605. -};
  606. -
  607. -QML_DECLARE_TYPE(QQuickWebPage)
  608. -
  609. -#endif /* qquickwebpage_h */
  610. diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p.h b/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p.h
  611. index 18d818d..bc9cb28 100644
  612. --- a/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p.h
  613. +++ b/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p.h
  614. @@ -21,35 +21,57 @@
  615. #ifndef qquickwebpage_p_h
  616. #define qquickwebpage_p_h
  617.  
  618. -#include "QtSGUpdateQueue.h"
  619. -#include "QtViewInterface.h"
  620. -#include "QtWebPageProxy.h"
  621. -#include "qquickwebpage.h"
  622. +#include "qwebkitglobal.h"
  623.  
  624. -QT_BEGIN_NAMESPACE
  625. -class QRectF;
  626. -class QSGNode;
  627. -class QString;
  628. -QT_END_NAMESPACE
  629. +#include <QtCore/QSharedPointer>
  630. +#include <QtDeclarative/QQuickItem>
  631.  
  632. -class QQuickWebPage;
  633. +class QQuickWebView;
  634. +class QQuickWebPagePrivate;
  635. +class QWebPreferences;
  636.  
  637. -class QQuickWebPagePrivate {
  638. -public:
  639. - QQuickWebPagePrivate(QQuickWebPage* view);
  640. +namespace WebKit {
  641. +class QtViewInterface;
  642. +}
  643.  
  644. - void setPageProxy(QtWebPageProxy*);
  645. +class QWEBKIT_EXPORT QQuickWebPage : public QQuickItem {
  646. + Q_OBJECT
  647. +public:
  648. + QQuickWebPage(QQuickItem* parent = 0);
  649. + virtual ~QQuickWebPage();
  650.  
  651. - void initializeSceneGraphConnections();
  652. +protected:
  653. + virtual void keyPressEvent(QKeyEvent*);
  654. + virtual void keyReleaseEvent(QKeyEvent*);
  655. + virtual void inputMethodEvent(QInputMethodEvent*);
  656. + virtual void focusInEvent(QFocusEvent*);
  657. + virtual void focusOutEvent(QFocusEvent*);
  658. + virtual void mousePressEvent(QMouseEvent*);
  659. + virtual void mouseMoveEvent(QMouseEvent*);
  660. + virtual void mouseReleaseEvent(QMouseEvent *);
  661. + virtual void mouseDoubleClickEvent(QMouseEvent*);
  662. + virtual void wheelEvent(QWheelEvent*);
  663. + virtual void hoverEnterEvent(QHoverEvent*);
  664. + virtual void hoverMoveEvent(QHoverEvent*);
  665. + virtual void hoverLeaveEvent(QHoverEvent*);
  666. + virtual void dragMoveEvent(QDragMoveEvent*);
  667. + virtual void dragEnterEvent(QDragEnterEvent*);
  668. + virtual void dragLeaveEvent(QDragLeaveEvent*);
  669. + virtual void dropEvent(QDropEvent*);
  670. + virtual void touchEvent(QTouchEvent*);
  671. + virtual bool event(QEvent*);
  672. + virtual void geometryChanged(const QRectF&, const QRectF&);
  673. + virtual void itemChange(ItemChange, const ItemChangeData&);
  674.  
  675. - void _q_onAfterSceneRender();
  676. - void _q_onSceneGraphInitialized();
  677. - void paintToCurrentGLContext();
  678. +private:
  679. + Q_PRIVATE_SLOT(d, void _q_onAfterSceneRender());
  680. + Q_PRIVATE_SLOT(d, void _q_onSceneGraphInitialized());
  681.  
  682. - QQuickWebPage* const q;
  683. - QtWebPageProxy* pageProxy;
  684. - WebKit::QtSGUpdateQueue sgUpdateQueue;
  685. - bool paintingIsInitialized;
  686. + QQuickWebPagePrivate* d;
  687. + friend class QQuickWebViewPrivate;
  688. + friend class WebKit::QtViewInterface;
  689. };
  690.  
  691. -#endif /* qquickwebpage_p_h */
  692. +QML_DECLARE_TYPE(QQuickWebPage)
  693. +
  694. +#endif // qquickwebpage_p_h
  695. diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p_p.h b/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p_p.h
  696. new file mode 100644
  697. index 0000000..3926baa
  698. --- /dev/null
  699. +++ b/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p_p.h
  700. @@ -0,0 +1,55 @@
  701. +/*
  702. + * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
  703. + *
  704. + * This library is free software; you can redistribute it and/or
  705. + * modify it under the terms of the GNU Library General Public
  706. + * License as published by the Free Software Foundation; either
  707. + * version 2 of the License, or (at your option) any later version.
  708. + *
  709. + * This program is distributed in the hope that it will be useful,
  710. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  711. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  712. + * Library General Public License for more details.
  713. + *
  714. + * You should have received a copy of the GNU Library General Public License
  715. + * along with this program; see the file COPYING.LIB. If not, write to
  716. + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  717. + * Boston, MA 02110-1301, USA.
  718. + *
  719. + */
  720. +
  721. +#ifndef qquickwebpage_p_p_h
  722. +#define qquickwebpage_p_p_h
  723. +
  724. +#include "QtSGUpdateQueue.h"
  725. +#include "QtViewInterface.h"
  726. +#include "QtWebPageProxy.h"
  727. +#include "qquickwebpage_p.h"
  728. +
  729. +QT_BEGIN_NAMESPACE
  730. +class QRectF;
  731. +class QSGNode;
  732. +class QString;
  733. +QT_END_NAMESPACE
  734. +
  735. +class QQuickWebPage;
  736. +
  737. +class QQuickWebPagePrivate {
  738. +public:
  739. + QQuickWebPagePrivate(QQuickWebPage* view);
  740. +
  741. + void setPageProxy(QtWebPageProxy*);
  742. +
  743. + void initializeSceneGraphConnections();
  744. +
  745. + void _q_onAfterSceneRender();
  746. + void _q_onSceneGraphInitialized();
  747. + void paintToCurrentGLContext();
  748. +
  749. + QQuickWebPage* const q;
  750. + QtWebPageProxy* pageProxy;
  751. + WebKit::QtSGUpdateQueue sgUpdateQueue;
  752. + bool paintingIsInitialized;
  753. +};
  754. +
  755. +#endif // qquickwebpage_p_p_h
  756. diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp b/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
  757. index 6d0a6c6..955fb66 100644
  758. --- a/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
  759. +++ b/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
  760. @@ -19,7 +19,7 @@
  761. */
  762.  
  763. #include "config.h"
  764. -#include "qquickwebview.h"
  765. +#include "qquickwebview_p.h"
  766.  
  767. #include "QtViewInterface.h"
  768. #include "QtWebPageProxy.h"
  769. @@ -27,9 +27,9 @@
  770. #include "WebPageGroup.h"
  771. #include "WebPreferences.h"
  772.  
  773. -#include "qquickwebpage_p.h"
  774. -#include "qquickwebview_p.h"
  775. -#include "qwebpreferences_p.h"
  776. +#include "qquickwebpage_p_p.h"
  777. +#include "qquickwebview_p_p.h"
  778. +#include "qwebpreferences_p_p.h"
  779.  
  780. #include <QtDeclarative/QQuickCanvas>
  781. #include <QtWidgets/QFileDialog>
  782. @@ -355,9 +355,27 @@ void QQuickWebViewPrivate::setPageProxy(QtWebPageProxy* pageProxy)
  783. QObject::connect(pageProxy, SIGNAL(receivedMessageFromNavigatorQtObject(QVariantMap)), q, SIGNAL(messageReceived(QVariantMap)));
  784. }
  785.  
  786. +QQuickWebViewExperimental::QQuickWebViewExperimental(QQuickWebView *webView)
  787. + : QObject(webView)
  788. + , q_ptr(webView)
  789. + , d_ptr(webView->d_ptr.data())
  790. +{
  791. +}
  792. +
  793. +QQuickWebViewExperimental::~QQuickWebViewExperimental()
  794. +{
  795. +}
  796. +
  797. +void QQuickWebViewExperimental::setUseTraditionalDesktopBehaviour(bool enable)
  798. +{
  799. + Q_D(QQuickWebView);
  800. + d->setUseTraditionalDesktopBehaviour(enable);
  801. +}
  802. +
  803. QQuickWebView::QQuickWebView(QQuickItem* parent)
  804. : QQuickItem(parent)
  805. , d_ptr(new QQuickWebViewPrivate)
  806. + , m_experimental(new QQuickWebViewExperimental(this))
  807. {
  808. Q_D(QQuickWebView);
  809. d->initialize(this);
  810. @@ -367,6 +385,7 @@ QQuickWebView::QQuickWebView(QQuickItem* parent)
  811. QQuickWebView::QQuickWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef, QQuickItem* parent)
  812. : QQuickItem(parent)
  813. , d_ptr(new QQuickWebViewPrivate)
  814. + , m_experimental(new QQuickWebViewExperimental(this))
  815. {
  816. Q_D(QQuickWebView);
  817. d->initialize(this, contextRef, pageGroupRef);
  818. @@ -468,6 +487,11 @@ QWebPreferences* QQuickWebView::preferences() const
  819. return d->pageProxy->preferences();
  820. }
  821.  
  822. +QQuickWebViewExperimental* QQuickWebView::experimental() const
  823. +{
  824. + return m_experimental;
  825. +}
  826. +
  827. void QQuickWebView::geometryChanged(const QRectF& newGeometry, const QRectF& oldGeometry)
  828. {
  829. Q_D(QQuickWebView);
  830. @@ -493,5 +517,4 @@ WKPageRef QQuickWebView::pageRef() const
  831. return d->pageProxy->pageRef();
  832. }
  833.  
  834. -#include "moc_qquickwebview.cpp"
  835. #include "moc_qquickwebview_p.cpp"
  836. diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebview.h b/Source/WebKit2/UIProcess/API/qt/qquickwebview.h
  837. deleted file mode 100644
  838. index f8ba817..0000000
  839. --- a/Source/WebKit2/UIProcess/API/qt/qquickwebview.h
  840. +++ /dev/null
  841. @@ -1,138 +0,0 @@
  842. -/*
  843. - * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
  844. - *
  845. - * This library is free software; you can redistribute it and/or
  846. - * modify it under the terms of the GNU Library General Public
  847. - * License as published by the Free Software Foundation; either
  848. - * version 2 of the License, or (at your option) any later version.
  849. - *
  850. - * This program is distributed in the hope that it will be useful,
  851. - * but WITHOUT ANY WARRANTY; without even the implied warranty of
  852. - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  853. - * Library General Public License for more details.
  854. - *
  855. - * You should have received a copy of the GNU Library General Public License
  856. - * along with this program; see the file COPYING.LIB. If not, write to
  857. - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  858. - * Boston, MA 02110-1301, USA.
  859. - *
  860. - */
  861. -
  862. -#ifndef qquickwebview_h
  863. -#define qquickwebview_h
  864. -
  865. -#include "qwebkitglobal.h"
  866. -#include <QtDeclarative/qquickitem.h>
  867. -
  868. -class QQuickWebPage;
  869. -class QQuickWebViewPrivate;
  870. -class QWebDownloadItem;
  871. -class QWebPreferences;
  872. -
  873. -namespace WebKit {
  874. -class QtViewInterface;
  875. -}
  876. -
  877. -namespace WTR {
  878. -class PlatformWebView;
  879. -}
  880. -
  881. -typedef const struct OpaqueWKContext* WKContextRef;
  882. -typedef const struct OpaqueWKPageGroup* WKPageGroupRef;
  883. -typedef const struct OpaqueWKPage* WKPageRef;
  884. -
  885. -QT_BEGIN_NAMESPACE
  886. -class QPainter;
  887. -class QUrl;
  888. -QT_END_NAMESPACE
  889. -
  890. -class QWEBKIT_EXPORT QQuickWebView : public QQuickItem {
  891. - Q_OBJECT
  892. - Q_PROPERTY(QString title READ title NOTIFY titleChanged)
  893. - Q_PROPERTY(QUrl url READ url NOTIFY urlChanged)
  894. - Q_PROPERTY(int loadProgress READ loadProgress NOTIFY loadProgressChanged)
  895. - Q_PROPERTY(bool canGoBack READ canGoBack NOTIFY navigationStateChanged FINAL)
  896. - Q_PROPERTY(bool canGoForward READ canGoForward NOTIFY navigationStateChanged FINAL)
  897. - Q_PROPERTY(bool canStop READ canStop NOTIFY navigationStateChanged FINAL)
  898. - Q_PROPERTY(bool canReload READ canReload NOTIFY navigationStateChanged FINAL)
  899. - Q_PROPERTY(QWebPreferences* preferences READ preferences CONSTANT FINAL)
  900. - Q_PROPERTY(QQuickWebPage* page READ page CONSTANT FINAL)
  901. - Q_ENUMS(NavigationPolicy)
  902. - Q_ENUMS(ErrorType)
  903. -public:
  904. - enum NavigationPolicy {
  905. - UsePolicy,
  906. - DownloadPolicy,
  907. - IgnorePolicy
  908. - };
  909. -
  910. - enum ErrorType {
  911. - EngineError,
  912. - NetworkError,
  913. - HttpError,
  914. - DownloadError
  915. - };
  916. - QQuickWebView(QQuickItem* parent = 0);
  917. - virtual ~QQuickWebView();
  918. -
  919. - QUrl url() const;
  920. - QString title() const;
  921. - int loadProgress() const;
  922. -
  923. - bool canGoBack() const;
  924. - bool canGoForward() const;
  925. - bool canStop() const;
  926. - bool canReload() const;
  927. -
  928. - QWebPreferences* preferences() const;
  929. - QQuickWebPage* page();
  930. -
  931. -public Q_SLOTS:
  932. - void load(const QUrl&);
  933. - void postMessage(const QString&);
  934. -
  935. - void goBack();
  936. - void goForward();
  937. - void stop();
  938. - void reload();
  939. -
  940. -Q_SIGNALS:
  941. - void titleChanged(const QString& title);
  942. - void statusBarMessageChanged(const QString& message);
  943. - void loadStarted();
  944. - void loadSucceeded();
  945. - void loadFailed(QQuickWebView::ErrorType errorType, int errorCode, const QUrl& url);
  946. - void loadProgressChanged(int progress);
  947. - void urlChanged(const QUrl& url);
  948. - void messageReceived(const QVariantMap& message);
  949. - void downloadRequested(QWebDownloadItem* downloadItem);
  950. - void linkHovered(const QUrl& url, const QString& title);
  951. - void viewModeChanged();
  952. - void navigationStateChanged();
  953. -
  954. -protected:
  955. - virtual void geometryChanged(const QRectF&, const QRectF&);
  956. - virtual void touchEvent(QTouchEvent* event);
  957. -
  958. -private:
  959. - Q_DECLARE_PRIVATE(QQuickWebView)
  960. -
  961. - QQuickWebView(WKContextRef, WKPageGroupRef, QQuickItem* parent = 0);
  962. - WKPageRef pageRef() const;
  963. -
  964. - Q_PRIVATE_SLOT(d_func(), void _q_viewportUpdated());
  965. - Q_PRIVATE_SLOT(d_func(), void _q_viewportTrajectoryVectorChanged(const QPointF&));
  966. - Q_PRIVATE_SLOT(d_func(), void _q_onOpenPanelFilesSelected());
  967. - Q_PRIVATE_SLOT(d_func(), void _q_onOpenPanelFinished(int result));
  968. - Q_PRIVATE_SLOT(d_func(), void _q_onVisibleChanged());
  969. - // Hides QObject::d_ptr allowing us to use the convenience macros.
  970. - QScopedPointer<QQuickWebViewPrivate> d_ptr;
  971. -
  972. - friend class QtWebPageProxy;
  973. - friend class WebKit::QtViewInterface;
  974. - friend class WTR::PlatformWebView;
  975. -};
  976. -
  977. -QML_DECLARE_TYPE(QQuickWebView)
  978. -
  979. -#endif /* qquickwebview_h */
  980. diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h b/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h
  981. index 1883c7b..d73faa6 100644
  982. --- a/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h
  983. +++ b/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h
  984. @@ -21,77 +21,138 @@
  985. #ifndef qquickwebview_p_h
  986. #define qquickwebview_p_h
  987.  
  988. -#include "QtPolicyInterface.h"
  989. -#include "QtViewInterface.h"
  990. -#include "QtViewportInteractionEngine.h"
  991. -#include "QtWebPageProxy.h"
  992. +#include "qwebkitglobal.h"
  993. +#include <QtDeclarative/qquickitem.h>
  994.  
  995. -#include "qquickwebview.h"
  996. +class QQuickWebPage;
  997. +class QQuickWebViewPrivate;
  998. +class QQuickWebViewExperimental;
  999. +class QWebDownloadItem;
  1000. +class QWebPreferences;
  1001.  
  1002. -#include <QtCore/QObject>
  1003. -#include <QtCore/QScopedPointer>
  1004. +namespace WebKit {
  1005. +class QtViewInterface;
  1006. +}
  1007.  
  1008. -class QtWebPageProxy;
  1009. +namespace WTR {
  1010. +class PlatformWebView;
  1011. +}
  1012. +
  1013. +typedef const struct OpaqueWKContext* WKContextRef;
  1014. +typedef const struct OpaqueWKPageGroup* WKPageGroupRef;
  1015. +typedef const struct OpaqueWKPage* WKPageRef;
  1016.  
  1017. QT_BEGIN_NAMESPACE
  1018. -class QFileDialog;
  1019. +class QPainter;
  1020. +class QUrl;
  1021. QT_END_NAMESPACE
  1022.  
  1023. -class QWEBKIT_EXPORT QQuickWebViewPrivate : public QObject, public WebKit::QtPolicyInterface {
  1024. +class QWEBKIT_EXPORT QQuickWebView : public QQuickItem {
  1025. Q_OBJECT
  1026. - Q_DECLARE_PUBLIC(QQuickWebView)
  1027. + Q_PROPERTY(QString title READ title NOTIFY titleChanged)
  1028. + Q_PROPERTY(QUrl url READ url NOTIFY urlChanged)
  1029. + Q_PROPERTY(int loadProgress READ loadProgress NOTIFY loadProgressChanged)
  1030. + Q_PROPERTY(bool canGoBack READ canGoBack NOTIFY navigationStateChanged FINAL)
  1031. + Q_PROPERTY(bool canGoForward READ canGoForward NOTIFY navigationStateChanged FINAL)
  1032. + Q_PROPERTY(bool canStop READ canStop NOTIFY navigationStateChanged FINAL)
  1033. + Q_PROPERTY(bool canReload READ canReload NOTIFY navigationStateChanged FINAL)
  1034. + Q_PROPERTY(QWebPreferences* preferences READ preferences CONSTANT FINAL)
  1035. + Q_PROPERTY(QQuickWebPage* page READ page CONSTANT FINAL)
  1036. + Q_ENUMS(NavigationPolicy)
  1037. + Q_ENUMS(ErrorType)
  1038. public:
  1039. - QQuickWebViewPrivate();
  1040. - virtual ~QQuickWebViewPrivate() { }
  1041. - void setPageProxy(QtWebPageProxy*);
  1042. - void initialize(QQuickWebView* viewport, WKContextRef contextRef = 0, WKPageGroupRef pageGroupRef = 0);
  1043. - void initializeTouch(QQuickWebView* viewport);
  1044. - void initializeDesktop(QQuickWebView* viewport);
  1045. - void enableMouseEvents();
  1046. - void disableMouseEvents();
  1047. -
  1048. - void loadDidCommit();
  1049. - void contentSizeChanged(const QSize& newSize);
  1050. - void scrollPositionRequested(const QPoint& pos);
  1051. - void updateViewportSize();
  1052. - void updateViewportConstraints();
  1053. -
  1054. - static QQuickWebViewPrivate* get(QQuickWebView* view)
  1055. - {
  1056. - return view->d_ptr.data();
  1057. - }
  1058. -
  1059. - void _q_viewportUpdated();
  1060. - void _q_viewportTrajectoryVectorChanged(const QPointF&);
  1061. - void _q_onOpenPanelFilesSelected();
  1062. - void _q_onOpenPanelFinished(int result);
  1063. - void _q_onVisibleChanged();
  1064. -
  1065. - // QtPolicyInterface.
  1066. - virtual QtPolicyInterface::PolicyAction navigationPolicyForURL(const QUrl&, Qt::MouseButton, Qt::KeyboardModifiers);
  1067. -
  1068. - void chooseFiles(WKOpenPanelResultListenerRef, const QStringList& selectedFileNames, WebKit::QtViewInterface::FileChooserType);
  1069. - void runJavaScriptAlert(const QString&);
  1070. - bool runJavaScriptConfirm(const QString&);
  1071. - QString runJavaScriptPrompt(const QString&, const QString& defaultValue, bool& ok);
  1072. - void didChangeViewportProperties(const WebCore::ViewportArguments& args);
  1073. -
  1074. -public slots:
  1075. - void setUseTraditionalDesktopBehaviour(bool enable);
  1076. + enum NavigationPolicy {
  1077. + UsePolicy,
  1078. + DownloadPolicy,
  1079. + IgnorePolicy
  1080. + };
  1081. +
  1082. + enum ErrorType {
  1083. + EngineError,
  1084. + NetworkError,
  1085. + HttpError,
  1086. + DownloadError
  1087. + };
  1088. + QQuickWebView(QQuickItem* parent = 0);
  1089. + virtual ~QQuickWebView();
  1090. +
  1091. + QUrl url() const;
  1092. + QString title() const;
  1093. + int loadProgress() const;
  1094. +
  1095. + bool canGoBack() const;
  1096. + bool canGoForward() const;
  1097. + bool canStop() const;
  1098. + bool canReload() const;
  1099. +
  1100. + QWebPreferences* preferences() const;
  1101. + QQuickWebPage* page();
  1102. +
  1103. + QQuickWebViewExperimental* experimental() const;
  1104. +
  1105. +public Q_SLOTS:
  1106. + void load(const QUrl&);
  1107. + void postMessage(const QString&);
  1108. +
  1109. + void goBack();
  1110. + void goForward();
  1111. + void stop();
  1112. + void reload();
  1113. +
  1114. +Q_SIGNALS:
  1115. + void titleChanged(const QString& title);
  1116. + void statusBarMessageChanged(const QString& message);
  1117. + void loadStarted();
  1118. + void loadSucceeded();
  1119. + void loadFailed(QQuickWebView::ErrorType errorType, int errorCode, const QUrl& url);
  1120. + void loadProgressChanged(int progress);
  1121. + void urlChanged(const QUrl& url);
  1122. + void messageReceived(const QVariantMap& message);
  1123. + void downloadRequested(QWebDownloadItem* downloadItem);
  1124. + void linkHovered(const QUrl& url, const QString& title);
  1125. + void viewModeChanged();
  1126. + void navigationStateChanged();
  1127. +
  1128. +protected:
  1129. + virtual void geometryChanged(const QRectF&, const QRectF&);
  1130. + virtual void touchEvent(QTouchEvent* event);
  1131.  
  1132. private:
  1133. - QScopedPointer<QQuickWebPage> pageView;
  1134. - QScopedPointer<WebKit::QtViewInterface> viewInterface;
  1135. - QScopedPointer<QtViewportInteractionEngine> interactionEngine;
  1136. + Q_DECLARE_PRIVATE(QQuickWebView)
  1137. +
  1138. + QQuickWebView(WKContextRef, WKPageGroupRef, QQuickItem* parent = 0);
  1139. + WKPageRef pageRef() const;
  1140. +
  1141. + Q_PRIVATE_SLOT(d_func(), void _q_viewportUpdated());
  1142. + Q_PRIVATE_SLOT(d_func(), void _q_viewportTrajectoryVectorChanged(const QPointF&));
  1143. + Q_PRIVATE_SLOT(d_func(), void _q_onOpenPanelFilesSelected());
  1144. + Q_PRIVATE_SLOT(d_func(), void _q_onOpenPanelFinished(int result));
  1145. + Q_PRIVATE_SLOT(d_func(), void _q_onVisibleChanged());
  1146. + // Hides QObject::d_ptr allowing us to use the convenience macros.
  1147. + QScopedPointer<QQuickWebViewPrivate> d_ptr;
  1148. + QQuickWebViewExperimental* m_experimental;
  1149. +
  1150. + friend class QtWebPageProxy;
  1151. + friend class WebKit::QtViewInterface;
  1152. + friend class WTR::PlatformWebView;
  1153. + friend class QQuickWebViewExperimental;
  1154. +};
  1155. +
  1156. +QML_DECLARE_TYPE(QQuickWebView)
  1157.  
  1158. - WebCore::ViewportArguments viewportArguments;
  1159. +class QWEBKIT_EXPORT QQuickWebViewExperimental : public QObject {
  1160. + Q_OBJECT
  1161. +public:
  1162. + QQuickWebViewExperimental(QQuickWebView* webView);
  1163. + virtual ~QQuickWebViewExperimental();
  1164.  
  1165. + void setUseTraditionalDesktopBehaviour(bool enable);
  1166. +private:
  1167. QQuickWebView* q_ptr;
  1168. - QScopedPointer<QtWebPageProxy> pageProxy;
  1169. + QQuickWebViewPrivate* d_ptr;
  1170.  
  1171. - bool useTraditionalDesktopBehaviour;
  1172. - QFileDialog* fileDialog;
  1173. - WKOpenPanelResultListenerRef openPanelResultListener;
  1174. + Q_DECLARE_PRIVATE(QQuickWebView)
  1175. + Q_DECLARE_PUBLIC(QQuickWebView)
  1176. };
  1177.  
  1178. -#endif /* qquickwebview_p_h */
  1179. +#endif // qquickwebview_p_h
  1180. diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h b/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h
  1181. new file mode 100644
  1182. index 0000000..c6abc16
  1183. --- /dev/null
  1184. +++ b/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h
  1185. @@ -0,0 +1,90 @@
  1186. +/*
  1187. + * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
  1188. + *
  1189. + * This library is free software; you can redistribute it and/or
  1190. + * modify it under the terms of the GNU Library General Public
  1191. + * License as published by the Free Software Foundation; either
  1192. + * version 2 of the License, or (at your option) any later version.
  1193. + *
  1194. + * This program is distributed in the hope that it will be useful,
  1195. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1196. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1197. + * Library General Public License for more details.
  1198. + *
  1199. + * You should have received a copy of the GNU Library General Public License
  1200. + * along with this program; see the file COPYING.LIB. If not, write to
  1201. + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  1202. + * Boston, MA 02110-1301, USA.
  1203. + *
  1204. + */
  1205. +
  1206. +#ifndef qquickwebview_p_p_h
  1207. +#define qquickwebview_p_p_h
  1208. +
  1209. +#include "QtPolicyInterface.h"
  1210. +#include "QtViewInterface.h"
  1211. +#include "QtViewportInteractionEngine.h"
  1212. +#include "QtWebPageProxy.h"
  1213. +
  1214. +#include "qquickwebview_p.h"
  1215. +
  1216. +#include <QtCore/QObject>
  1217. +#include <QtCore/QScopedPointer>
  1218. +
  1219. +class QtWebPageProxy;
  1220. +
  1221. +QT_BEGIN_NAMESPACE
  1222. +class QFileDialog;
  1223. +QT_END_NAMESPACE
  1224. +
  1225. +class QWEBKIT_EXPORT QQuickWebViewPrivate : public WebKit::QtPolicyInterface {
  1226. +
  1227. + Q_DECLARE_PUBLIC(QQuickWebView)
  1228. +public:
  1229. + QQuickWebViewPrivate();
  1230. + virtual ~QQuickWebViewPrivate() { }
  1231. + void setPageProxy(QtWebPageProxy*);
  1232. + void initialize(QQuickWebView* viewport, WKContextRef contextRef = 0, WKPageGroupRef pageGroupRef = 0);
  1233. + void initializeTouch(QQuickWebView* viewport);
  1234. + void initializeDesktop(QQuickWebView* viewport);
  1235. + void enableMouseEvents();
  1236. + void disableMouseEvents();
  1237. +
  1238. + void loadDidCommit();
  1239. + void contentSizeChanged(const QSize& newSize);
  1240. + void scrollPositionRequested(const QPoint& pos);
  1241. + void updateViewportSize();
  1242. + void updateViewportConstraints();
  1243. +
  1244. + void _q_viewportUpdated();
  1245. + void _q_viewportTrajectoryVectorChanged(const QPointF&);
  1246. + void _q_onOpenPanelFilesSelected();
  1247. + void _q_onOpenPanelFinished(int result);
  1248. + void _q_onVisibleChanged();
  1249. +
  1250. + // QtPolicyInterface.
  1251. + virtual QtPolicyInterface::PolicyAction navigationPolicyForURL(const QUrl&, Qt::MouseButton, Qt::KeyboardModifiers);
  1252. +
  1253. + void chooseFiles(WKOpenPanelResultListenerRef, const QStringList& selectedFileNames, WebKit::QtViewInterface::FileChooserType);
  1254. + void runJavaScriptAlert(const QString&);
  1255. + bool runJavaScriptConfirm(const QString&);
  1256. + QString runJavaScriptPrompt(const QString&, const QString& defaultValue, bool& ok);
  1257. + void didChangeViewportProperties(const WebCore::ViewportArguments& args);
  1258. + void setUseTraditionalDesktopBehaviour(bool enable);
  1259. +
  1260. +private:
  1261. + QScopedPointer<QQuickWebPage> pageView;
  1262. + QScopedPointer<WebKit::QtViewInterface> viewInterface;
  1263. + QScopedPointer<QtViewportInteractionEngine> interactionEngine;
  1264. +
  1265. + WebCore::ViewportArguments viewportArguments;
  1266. +
  1267. + QQuickWebView* q_ptr;
  1268. + QScopedPointer<QtWebPageProxy> pageProxy;
  1269. +
  1270. + bool useTraditionalDesktopBehaviour;
  1271. + QFileDialog* fileDialog;
  1272. + WKOpenPanelResultListenerRef openPanelResultListener;
  1273. +};
  1274. +
  1275. +#endif // qquickwebview_p_p_h
  1276. diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebviewprivateextension.cpp b/Source/WebKit2/UIProcess/API/qt/qquickwebviewprivateextension.cpp
  1277. deleted file mode 100644
  1278. index 7ac4395..0000000
  1279. --- a/Source/WebKit2/UIProcess/API/qt/qquickwebviewprivateextension.cpp
  1280. +++ /dev/null
  1281. @@ -1,36 +0,0 @@
  1282. -/*
  1283. - * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
  1284. - *
  1285. - * This library is free software; you can redistribute it and/or
  1286. - * modify it under the terms of the GNU Library General Public
  1287. - * License as published by the Free Software Foundation; either
  1288. - * version 2 of the License, or (at your option) any later version.
  1289. - *
  1290. - * This program is distributed in the hope that it will be useful,
  1291. - * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1292. - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1293. - * Library General Public License for more details.
  1294. - *
  1295. - * You should have received a copy of the GNU Library General Public License
  1296. - * along with this program; see the file COPYING.LIB. If not, write to
  1297. - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  1298. - * Boston, MA 02110-1301, USA.
  1299. - *
  1300. - */
  1301. -
  1302. -#include "config.h"
  1303. -#include "qquickwebviewprivateextension_p.h"
  1304. -
  1305. -#include "qquickwebpage.h"
  1306. -#include "qquickwebview.h"
  1307. -#include "qquickwebview_p.h"
  1308. -
  1309. -QQuickWebViewPrivateExtension::QQuickWebViewPrivateExtension(QObject* parent)
  1310. - : QObject(parent)
  1311. -{
  1312. -}
  1313. -
  1314. -QQuickWebViewPrivate* QQuickWebViewPrivateExtension::viewPrivate()
  1315. -{
  1316. - return QQuickWebViewPrivate::get(static_cast<QQuickWebView*>(parent()));
  1317. -}
  1318. diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebviewprivateextension_p.h b/Source/WebKit2/UIProcess/API/qt/qquickwebviewprivateextension_p.h
  1319. deleted file mode 100644
  1320. index 1066552..0000000
  1321. --- a/Source/WebKit2/UIProcess/API/qt/qquickwebviewprivateextension_p.h
  1322. +++ /dev/null
  1323. @@ -1,38 +0,0 @@
  1324. -/*
  1325. - * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
  1326. - *
  1327. - * This library is free software; you can redistribute it and/or
  1328. - * modify it under the terms of the GNU Library General Public
  1329. - * License as published by the Free Software Foundation; either
  1330. - * version 2 of the License, or (at your option) any later version.
  1331. - *
  1332. - * This program is distributed in the hope that it will be useful,
  1333. - * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1334. - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1335. - * Library General Public License for more details.
  1336. - *
  1337. - * You should have received a copy of the GNU Library General Public License
  1338. - * along with this program; see the file COPYING.LIB. If not, write to
  1339. - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  1340. - * Boston, MA 02110-1301, USA.
  1341. - *
  1342. - */
  1343. -
  1344. -#ifndef qquickwebviewprivateextension_p_h
  1345. -#define qquickwebviewprivateextension_p_h
  1346. -
  1347. -#include "qwebkitglobal.h"
  1348. -
  1349. -#include <QObject>
  1350. -
  1351. -class QQuickWebViewPrivate;
  1352. -
  1353. -class QWEBKIT_EXPORT QQuickWebViewPrivateExtension : public QObject {
  1354. - Q_OBJECT
  1355. - Q_PROPERTY(QQuickWebViewPrivate* privateObject READ viewPrivate CONSTANT FINAL)
  1356. -public:
  1357. - QQuickWebViewPrivateExtension(QObject *parent = 0);
  1358. - QQuickWebViewPrivate* viewPrivate();
  1359. -};
  1360. -
  1361. -#endif // qquickwebviewprivateextension_p_h
  1362. diff --git a/Source/WebKit2/UIProcess/API/qt/qwebdownloaditem.cpp b/Source/WebKit2/UIProcess/API/qt/qwebdownloaditem.cpp
  1363. index 6590b74..8547643 100644
  1364. --- a/Source/WebKit2/UIProcess/API/qt/qwebdownloaditem.cpp
  1365. +++ b/Source/WebKit2/UIProcess/API/qt/qwebdownloaditem.cpp
  1366. @@ -19,10 +19,10 @@
  1367. */
  1368.  
  1369. #include "config.h"
  1370. -#include "qwebdownloaditem.h"
  1371. +#include "qwebdownloaditem_p.h"
  1372.  
  1373. #include "DownloadProxy.h"
  1374. -#include "qwebdownloaditem_p.h"
  1375. +#include "qwebdownloaditem_p_p.h"
  1376.  
  1377. QWebDownloadItemPrivate::QWebDownloadItemPrivate(QWebDownloadItem* qq)
  1378. : q(qq)
  1379. diff --git a/Source/WebKit2/UIProcess/API/qt/qwebdownloaditem.h b/Source/WebKit2/UIProcess/API/qt/qwebdownloaditem.h
  1380. deleted file mode 100644
  1381. index b44c5b0..0000000
  1382. --- a/Source/WebKit2/UIProcess/API/qt/qwebdownloaditem.h
  1383. +++ /dev/null
  1384. @@ -1,86 +0,0 @@
  1385. -/*
  1386. - * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
  1387. - *
  1388. - * This library is free software; you can redistribute it and/or
  1389. - * modify it under the terms of the GNU Library General Public
  1390. - * License as published by the Free Software Foundation; either
  1391. - * version 2 of the License, or (at your option) any later version.
  1392. - *
  1393. - * This program is distributed in the hope that it will be useful,
  1394. - * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1395. - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1396. - * Library General Public License for more details.
  1397. - *
  1398. - * You should have received a copy of the GNU Library General Public License
  1399. - * along with this program; see the file COPYING.LIB. If not, write to
  1400. - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  1401. - * Boston, MA 02110-1301, USA.
  1402. - *
  1403. - */
  1404. -
  1405. -#ifndef qwebdownloaditem_h
  1406. -#define qwebdownloaditem_h
  1407. -
  1408. -#include "qwebkitglobal.h"
  1409. -#include <QObject>
  1410. -#include <QUrl>
  1411. -
  1412. -class QWebDownloadItemPrivate;
  1413. -class QtWebError;
  1414. -
  1415. -QT_BEGIN_NAMESPACE
  1416. -class QString;
  1417. -QT_END_NAMESPACE
  1418. -
  1419. -namespace WebKit {
  1420. -class QtDownloadManager;
  1421. -}
  1422. -
  1423. -class QWEBKIT_EXPORT QWebDownloadItem : public QObject {
  1424. - Q_OBJECT
  1425. - Q_PROPERTY(quint64 expectedContentLength READ expectedContentLength CONSTANT FINAL)
  1426. - Q_PROPERTY(QString destinationPath READ destinationPath WRITE setDestinationPath)
  1427. - Q_PROPERTY(QString suggestedFilename READ suggestedFilename CONSTANT FINAL)
  1428. - Q_PROPERTY(quint64 totalBytesReceived READ totalBytesReceived NOTIFY totalBytesReceivedChanged FINAL)
  1429. - Q_PROPERTY(QUrl url READ url CONSTANT FINAL)
  1430. - Q_ENUMS(DownloadError)
  1431. -public:
  1432. - virtual ~QWebDownloadItem();
  1433. -
  1434. - enum DownloadError {
  1435. - Aborted = 0,
  1436. - CannotWriteToFile,
  1437. - CannotOpenFile,
  1438. - DestinationAlreadyExists,
  1439. - Cancelled,
  1440. - CannotDetermineFilename,
  1441. - NetworkFailure
  1442. - };
  1443. -
  1444. - QUrl url() const;
  1445. - QString destinationPath() const;
  1446. - QString suggestedFilename() const;
  1447. - QString mimeType() const;
  1448. - quint64 expectedContentLength() const;
  1449. - quint64 totalBytesReceived() const;
  1450. - void setDestinationPath(const QString& destination);
  1451. -
  1452. -public Q_SLOTS:
  1453. - void start();
  1454. - void cancel();
  1455. -
  1456. -Q_SIGNALS:
  1457. - void destinationFileCreated(const QString& destinationPath);
  1458. - void totalBytesReceivedChanged(quint64 bytesReceived);
  1459. - void succeeded();
  1460. - void failed(QWebDownloadItem::DownloadError error, const QUrl& url, const QString& description);
  1461. -
  1462. -private:
  1463. - QWebDownloadItem(QObject* parent = 0);
  1464. - QWebDownloadItemPrivate* d;
  1465. -
  1466. - friend class WebKit::QtDownloadManager;
  1467. - friend class QtWebPageProxy;
  1468. -};
  1469. -
  1470. -#endif /* qwebdownloaditem_h */
  1471. diff --git a/Source/WebKit2/UIProcess/API/qt/qwebdownloaditem_p.h b/Source/WebKit2/UIProcess/API/qt/qwebdownloaditem_p.h
  1472. index bb8c252..e809236 100644
  1473. --- a/Source/WebKit2/UIProcess/API/qt/qwebdownloaditem_p.h
  1474. +++ b/Source/WebKit2/UIProcess/API/qt/qwebdownloaditem_p.h
  1475. @@ -1,53 +1,86 @@
  1476. /*
  1477. - Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
  1478. -
  1479. - This library is free software; you can redistribute it and/or
  1480. - modify it under the terms of the GNU Library General Public
  1481. - License as published by the Free Software Foundation; either
  1482. - version 2 of the License, or (at your option) any later version.
  1483. -
  1484. - This library is distributed in the hope that it will be useful,
  1485. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  1486. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1487. - Library General Public License for more details.
  1488. -
  1489. - You should have received a copy of the GNU Library General Public License
  1490. - along with this library; see the file COPYING.LIB. If not, write to
  1491. - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  1492. - Boston, MA 02110-1301, USA.
  1493. -*/
  1494. -
  1495. + * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
  1496. + *
  1497. + * This library is free software; you can redistribute it and/or
  1498. + * modify it under the terms of the GNU Library General Public
  1499. + * License as published by the Free Software Foundation; either
  1500. + * version 2 of the License, or (at your option) any later version.
  1501. + *
  1502. + * This program is distributed in the hope that it will be useful,
  1503. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1504. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1505. + * Library General Public License for more details.
  1506. + *
  1507. + * You should have received a copy of the GNU Library General Public License
  1508. + * along with this program; see the file COPYING.LIB. If not, write to
  1509. + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  1510. + * Boston, MA 02110-1301, USA.
  1511. + *
  1512. + */
  1513.  
  1514. #ifndef qwebdownloaditem_p_h
  1515. #define qwebdownloaditem_p_h
  1516.  
  1517. -#include "qwebdownloaditem.h"
  1518. +#include "qwebkitglobal.h"
  1519. +#include <QObject>
  1520. #include <QUrl>
  1521.  
  1522. +class QWebDownloadItemPrivate;
  1523. +class QtWebError;
  1524. +
  1525. +QT_BEGIN_NAMESPACE
  1526. +class QString;
  1527. +QT_END_NAMESPACE
  1528. +
  1529. namespace WebKit {
  1530. -class DownloadProxy;
  1531. +class QtDownloadManager;
  1532. }
  1533.  
  1534. -class QWebDownloadItemPrivate : public QObject {
  1535. +class QWEBKIT_EXPORT QWebDownloadItem : public QObject {
  1536. Q_OBJECT
  1537. + Q_PROPERTY(quint64 expectedContentLength READ expectedContentLength CONSTANT FINAL)
  1538. + Q_PROPERTY(QString destinationPath READ destinationPath WRITE setDestinationPath)
  1539. + Q_PROPERTY(QString suggestedFilename READ suggestedFilename CONSTANT FINAL)
  1540. + Q_PROPERTY(quint64 totalBytesReceived READ totalBytesReceived NOTIFY totalBytesReceivedChanged FINAL)
  1541. + Q_PROPERTY(QUrl url READ url CONSTANT FINAL)
  1542. + Q_ENUMS(DownloadError)
  1543. public:
  1544. - QWebDownloadItemPrivate(QWebDownloadItem*);
  1545. -
  1546. - void didReceiveResponse(QWebDownloadItem* download) { emit receivedResponse(download); }
  1547. + virtual ~QWebDownloadItem();
  1548.  
  1549. - QWebDownloadItem* q;
  1550. + enum DownloadError {
  1551. + Aborted = 0,
  1552. + CannotWriteToFile,
  1553. + CannotOpenFile,
  1554. + DestinationAlreadyExists,
  1555. + Cancelled,
  1556. + CannotDetermineFilename,
  1557. + NetworkFailure
  1558. + };
  1559.  
  1560. - WebKit::DownloadProxy* downloadProxy;
  1561. + QUrl url() const;
  1562. + QString destinationPath() const;
  1563. + QString suggestedFilename() const;
  1564. + QString mimeType() const;
  1565. + quint64 expectedContentLength() const;
  1566. + quint64 totalBytesReceived() const;
  1567. + void setDestinationPath(const QString& destination);
  1568.  
  1569. - QUrl sourceUrl;
  1570. - QString suggestedFilename;
  1571. - QString destinationPath;
  1572. - QString mimeType;
  1573. - quint64 expectedContentLength;
  1574. - quint64 totalBytesReceived;
  1575. +public Q_SLOTS:
  1576. + void start();
  1577. + void cancel();
  1578.  
  1579. Q_SIGNALS:
  1580. - void receivedResponse(QWebDownloadItem*);
  1581. + void destinationFileCreated(const QString& destinationPath);
  1582. + void totalBytesReceivedChanged(quint64 bytesReceived);
  1583. + void succeeded();
  1584. + void failed(QWebDownloadItem::DownloadError error, const QUrl& url, const QString& description);
  1585. +
  1586. +private:
  1587. + QWebDownloadItem(QObject* parent = 0);
  1588. + QWebDownloadItemPrivate* d;
  1589. +
  1590. + friend class WebKit::QtDownloadManager;
  1591. + friend class QtWebPageProxy;
  1592. };
  1593.  
  1594. -#endif /* qwebdownloaditem_p_h */
  1595. +#endif // qwebdownloaditem_p_h
  1596. diff --git a/Source/WebKit2/UIProcess/API/qt/qwebdownloaditem_p_p.h b/Source/WebKit2/UIProcess/API/qt/qwebdownloaditem_p_p.h
  1597. new file mode 100644
  1598. index 0000000..780848b
  1599. --- /dev/null
  1600. +++ b/Source/WebKit2/UIProcess/API/qt/qwebdownloaditem_p_p.h
  1601. @@ -0,0 +1,53 @@
  1602. +/*
  1603. + Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
  1604. +
  1605. + This library is free software; you can redistribute it and/or
  1606. + modify it under the terms of the GNU Library General Public
  1607. + License as published by the Free Software Foundation; either
  1608. + version 2 of the License, or (at your option) any later version.
  1609. +
  1610. + This library is distributed in the hope that it will be useful,
  1611. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  1612. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1613. + Library General Public License for more details.
  1614. +
  1615. + You should have received a copy of the GNU Library General Public License
  1616. + along with this library; see the file COPYING.LIB. If not, write to
  1617. + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  1618. + Boston, MA 02110-1301, USA.
  1619. +*/
  1620. +
  1621. +
  1622. +#ifndef qwebdownloaditem_p_p_h
  1623. +#define qwebdownloaditem_p_p_h
  1624. +
  1625. +#include "qwebdownloaditem_p.h"
  1626. +#include <QUrl>
  1627. +
  1628. +namespace WebKit {
  1629. +class DownloadProxy;
  1630. +}
  1631. +
  1632. +class QWebDownloadItemPrivate : public QObject {
  1633. + Q_OBJECT
  1634. +public:
  1635. + QWebDownloadItemPrivate(QWebDownloadItem*);
  1636. +
  1637. + void didReceiveResponse(QWebDownloadItem* download) { emit receivedResponse(download); }
  1638. +
  1639. + QWebDownloadItem* q;
  1640. +
  1641. + WebKit::DownloadProxy* downloadProxy;
  1642. +
  1643. + QUrl sourceUrl;
  1644. + QString suggestedFilename;
  1645. + QString destinationPath;
  1646. + QString mimeType;
  1647. + quint64 expectedContentLength;
  1648. + quint64 totalBytesReceived;
  1649. +
  1650. +Q_SIGNALS:
  1651. + void receivedResponse(QWebDownloadItem*);
  1652. +};
  1653. +
  1654. +#endif // qwebdownloaditem_p_p_h
  1655. diff --git a/Source/WebKit2/UIProcess/API/qt/qwebpreferences.cpp b/Source/WebKit2/UIProcess/API/qt/qwebpreferences.cpp
  1656. index ccef9eb..2071bae 100644
  1657. --- a/Source/WebKit2/UIProcess/API/qt/qwebpreferences.cpp
  1658. +++ b/Source/WebKit2/UIProcess/API/qt/qwebpreferences.cpp
  1659. @@ -18,7 +18,7 @@
  1660. */
  1661.  
  1662. #include "config.h"
  1663. -#include "qwebpreferences.h"
  1664. +#include "qwebpreferences_p.h"
  1665.  
  1666. #include "QtWebPageProxy.h"
  1667. #include "WKPageGroup.h"
  1668. @@ -26,7 +26,7 @@
  1669. #include "WKPreferencesPrivate.h"
  1670. #include "WKRetainPtr.h"
  1671. #include "WKStringQt.h"
  1672. -#include "qwebpreferences_p.h"
  1673. +#include "qwebpreferences_p_p.h"
  1674.  
  1675. QWebPreferences* QWebPreferencesPrivate::createPreferences(QtWebPageProxy* qtWebPageProxy)
  1676. {
  1677. diff --git a/Source/WebKit2/UIProcess/API/qt/qwebpreferences.h b/Source/WebKit2/UIProcess/API/qt/qwebpreferences.h
  1678. deleted file mode 100644
  1679. index 4e20073..0000000
  1680. --- a/Source/WebKit2/UIProcess/API/qt/qwebpreferences.h
  1681. +++ /dev/null
  1682. @@ -1,141 +0,0 @@
  1683. -/*
  1684. - Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
  1685. -
  1686. - This library is free software; you can redistribute it and/or
  1687. - modify it under the terms of the GNU Library General Public
  1688. - License as published by the Free Software Foundation; either
  1689. - version 2 of the License, or (at your option) any later version.
  1690. -
  1691. - This library is distributed in the hope that it will be useful,
  1692. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  1693. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1694. - Library General Public License for more details.
  1695. -
  1696. - You should have received a copy of the GNU Library General Public License
  1697. - along with this library; see the file COPYING.LIB. If not, write to
  1698. - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  1699. - Boston, MA 02110-1301, USA.
  1700. -*/
  1701. -
  1702. -#ifndef qwebpreferences_h
  1703. -#define qwebpreferences_h
  1704. -
  1705. -#include "qwebkitglobal.h"
  1706. -
  1707. -#include <QtCore/QObject>
  1708. -
  1709. -class QWebPreferencesPrivate;
  1710. -
  1711. -class QWEBKIT_EXPORT QWebPreferences : public QObject {
  1712. - Q_OBJECT
  1713. -public:
  1714. - ~QWebPreferences();
  1715. -
  1716. - Q_PROPERTY(bool autoLoadImages READ autoLoadImages WRITE setAutoLoadImages NOTIFY autoLoadImagesChanged FINAL)
  1717. - Q_PROPERTY(bool javascriptEnabled READ javascriptEnabled WRITE setJavascriptEnabled NOTIFY javascriptEnabledChanged FINAL)
  1718. - Q_PROPERTY(bool pluginsEnabled READ pluginsEnabled WRITE setPluginsEnabled NOTIFY pluginsEnabledChanged FINAL)
  1719. - Q_PROPERTY(bool offlineWebApplicationCacheEnabled READ offlineWebApplicationCacheEnabled WRITE setOfflineWebApplicationCacheEnabled NOTIFY offlineWebApplicationCacheEnabledChanged FINAL)
  1720. - Q_PROPERTY(bool localStorageEnabled READ localStorageEnabled WRITE setLocalStorageEnabled NOTIFY localStorageEnabledChanged FINAL)
  1721. - Q_PROPERTY(bool xssAuditingEnabled READ xssAuditingEnabled WRITE setXssAuditingEnabled NOTIFY xssAuditingEnabledChanged FINAL)
  1722. - Q_PROPERTY(bool privateBrowsingEnabled READ privateBrowsingEnabled WRITE setPrivateBrowsingEnabled NOTIFY privateBrowsingEnabledChanged FINAL)
  1723. - Q_PROPERTY(bool dnsPrefetchEnabled READ dnsPrefetchEnabled WRITE setDnsPrefetchEnabled NOTIFY dnsPrefetchEnabledChanged FINAL)
  1724. - Q_PROPERTY(bool navigatorQtObjectEnabled READ navigatorQtObjectEnabled WRITE setNavigatorQtObjectEnabled NOTIFY navigatorQtObjectEnabledChanged FINAL)
  1725. -
  1726. - Q_PROPERTY(QString standardFontFamily READ standardFontFamily WRITE setStandardFontFamily NOTIFY standardFontFamilyChanged FINAL)
  1727. - Q_PROPERTY(QString fixedFontFamily READ fixedFontFamily WRITE setFixedFontFamily NOTIFY fixedFontFamilyChanged FINAL)
  1728. - Q_PROPERTY(QString serifFontFamily READ serifFontFamily WRITE setSerifFontFamily NOTIFY serifFontFamilyChanged FINAL)
  1729. - Q_PROPERTY(QString sansSerifFontFamily READ sansSerifFontFamily WRITE setSansSerifFontFamily NOTIFY sansSerifFontFamilyChanged FINAL)
  1730. - Q_PROPERTY(QString cursiveFontFamily READ cursiveFontFamily WRITE setCursiveFontFamily NOTIFY cursiveFontFamilyChanged FINAL)
  1731. - Q_PROPERTY(QString fantasyFontFamily READ fantasyFontFamily WRITE setFantasyFontFamily NOTIFY fantasyFontFamilyChanged FINAL)
  1732. -
  1733. - Q_PROPERTY(unsigned minimumFontSize READ minimumFontSize WRITE setMinimumFontSize NOTIFY minimumFontSizeChanged FINAL)
  1734. - Q_PROPERTY(unsigned defaultFontSize READ defaultFontSize WRITE setDefaultFontSize NOTIFY defaultFontSizeChanged FINAL)
  1735. - Q_PROPERTY(unsigned defaultFixedFontSize READ defaultFixedFontSize WRITE setDefaultFixedFontSize NOTIFY defaultFixedFontSizeChanged FINAL)
  1736. -
  1737. - bool autoLoadImages() const;
  1738. - void setAutoLoadImages(bool enable);
  1739. -
  1740. - bool javascriptEnabled() const;
  1741. - void setJavascriptEnabled(bool enable);
  1742. -
  1743. - bool pluginsEnabled() const;
  1744. - void setPluginsEnabled(bool enable);
  1745. -
  1746. - bool offlineWebApplicationCacheEnabled() const;
  1747. - void setOfflineWebApplicationCacheEnabled(bool enable);
  1748. -
  1749. - bool localStorageEnabled() const;
  1750. - void setLocalStorageEnabled(bool enable);
  1751. -
  1752. - bool xssAuditingEnabled() const;
  1753. - void setXssAuditingEnabled(bool enable);
  1754. -
  1755. - bool privateBrowsingEnabled() const;
  1756. - void setPrivateBrowsingEnabled(bool enable);
  1757. -
  1758. - bool dnsPrefetchEnabled() const;
  1759. - void setDnsPrefetchEnabled(bool enable);
  1760. -
  1761. - bool navigatorQtObjectEnabled() const;
  1762. - void setNavigatorQtObjectEnabled(bool);
  1763. -
  1764. - QString standardFontFamily() const;
  1765. - void setStandardFontFamily(const QString& family);
  1766. -
  1767. - QString fixedFontFamily() const;
  1768. - void setFixedFontFamily(const QString& family);
  1769. -
  1770. - QString serifFontFamily() const;
  1771. - void setSerifFontFamily(const QString& family);
  1772. -
  1773. - QString sansSerifFontFamily() const;
  1774. - void setSansSerifFontFamily(const QString& family);
  1775. -
  1776. - QString cursiveFontFamily() const;
  1777. - void setCursiveFontFamily(const QString& family);
  1778. -
  1779. - QString fantasyFontFamily() const;
  1780. - void setFantasyFontFamily(const QString& family);
  1781. -
  1782. - unsigned minimumFontSize() const;
  1783. - void setMinimumFontSize(unsigned size);
  1784. -
  1785. - unsigned defaultFontSize() const;
  1786. - void setDefaultFontSize(unsigned size);
  1787. -
  1788. - unsigned defaultFixedFontSize() const;
  1789. - void setDefaultFixedFontSize(unsigned size);
  1790. -
  1791. -Q_SIGNALS:
  1792. - void autoLoadImagesChanged();
  1793. - void pluginsEnabledChanged();
  1794. - void javascriptEnabledChanged();
  1795. - void offlineWebApplicationCacheEnabledChanged();
  1796. - void localStorageEnabledChanged();
  1797. - void xssAuditingEnabledChanged();
  1798. - void privateBrowsingEnabledChanged();
  1799. - void dnsPrefetchEnabledChanged();
  1800. - void navigatorQtObjectEnabledChanged();
  1801. -
  1802. - void standardFontFamilyChanged();
  1803. - void fixedFontFamilyChanged();
  1804. - void serifFontFamilyChanged();
  1805. - void sansSerifFontFamilyChanged();
  1806. - void cursiveFontFamilyChanged();
  1807. - void fantasyFontFamilyChanged();
  1808. -
  1809. - void minimumFontSizeChanged();
  1810. - void defaultFontSizeChanged();
  1811. - void defaultFixedFontSizeChanged();
  1812. -
  1813. -private:
  1814. - Q_DISABLE_COPY(QWebPreferences)
  1815. -
  1816. - QWebPreferences();
  1817. -
  1818. - QWebPreferencesPrivate *d;
  1819. -
  1820. - friend class QWebPreferencesPrivate;
  1821. -};
  1822. -
  1823. -#endif // qwebpreferences_h
  1824. diff --git a/Source/WebKit2/UIProcess/API/qt/qwebpreferences_p.h b/Source/WebKit2/UIProcess/API/qt/qwebpreferences_p.h
  1825. index bda2f4a..29df04c 100644
  1826. --- a/Source/WebKit2/UIProcess/API/qt/qwebpreferences_p.h
  1827. +++ b/Source/WebKit2/UIProcess/API/qt/qwebpreferences_p.h
  1828. @@ -1,5 +1,5 @@
  1829. /*
  1830. - Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
  1831. + Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
  1832.  
  1833. This library is free software; you can redistribute it and/or
  1834. modify it under the terms of the GNU Library General Public
  1835. @@ -17,55 +17,125 @@
  1836. Boston, MA 02110-1301, USA.
  1837. */
  1838.  
  1839. -#include "WKPreferences.h"
  1840. +#ifndef qwebpreferences_p_h
  1841. +#define qwebpreferences_p_h
  1842.  
  1843. -class QtWebPageProxy;
  1844. +#include "qwebkitglobal.h"
  1845.  
  1846. -class QWebPreferencesPrivate {
  1847. +#include <QtCore/QObject>
  1848. +
  1849. +class QWebPreferencesPrivate;
  1850. +
  1851. +class QWEBKIT_EXPORT QWebPreferences : public QObject {
  1852. + Q_OBJECT
  1853. public:
  1854. + ~QWebPreferences();
  1855. +
  1856. + Q_PROPERTY(bool autoLoadImages READ autoLoadImages WRITE setAutoLoadImages NOTIFY autoLoadImagesChanged FINAL)
  1857. + Q_PROPERTY(bool javascriptEnabled READ javascriptEnabled WRITE setJavascriptEnabled NOTIFY javascriptEnabledChanged FINAL)
  1858. + Q_PROPERTY(bool pluginsEnabled READ pluginsEnabled WRITE setPluginsEnabled NOTIFY pluginsEnabledChanged FINAL)
  1859. + Q_PROPERTY(bool offlineWebApplicationCacheEnabled READ offlineWebApplicationCacheEnabled WRITE setOfflineWebApplicationCacheEnabled NOTIFY offlineWebApplicationCacheEnabledChanged FINAL)
  1860. + Q_PROPERTY(bool localStorageEnabled READ localStorageEnabled WRITE setLocalStorageEnabled NOTIFY localStorageEnabledChanged FINAL)
  1861. + Q_PROPERTY(bool xssAuditingEnabled READ xssAuditingEnabled WRITE setXssAuditingEnabled NOTIFY xssAuditingEnabledChanged FINAL)
  1862. + Q_PROPERTY(bool privateBrowsingEnabled READ privateBrowsingEnabled WRITE setPrivateBrowsingEnabled NOTIFY privateBrowsingEnabledChanged FINAL)
  1863. + Q_PROPERTY(bool dnsPrefetchEnabled READ dnsPrefetchEnabled WRITE setDnsPrefetchEnabled NOTIFY dnsPrefetchEnabledChanged FINAL)
  1864. + Q_PROPERTY(bool navigatorQtObjectEnabled READ navigatorQtObjectEnabled WRITE setNavigatorQtObjectEnabled NOTIFY navigatorQtObjectEnabledChanged FINAL)
  1865. +
  1866. + Q_PROPERTY(QString standardFontFamily READ standardFontFamily WRITE setStandardFontFamily NOTIFY standardFontFamilyChanged FINAL)
  1867. + Q_PROPERTY(QString fixedFontFamily READ fixedFontFamily WRITE setFixedFontFamily NOTIFY fixedFontFamilyChanged FINAL)
  1868. + Q_PROPERTY(QString serifFontFamily READ serifFontFamily WRITE setSerifFontFamily NOTIFY serifFontFamilyChanged FINAL)
  1869. + Q_PROPERTY(QString sansSerifFontFamily READ sansSerifFontFamily WRITE setSansSerifFontFamily NOTIFY sansSerifFontFamilyChanged FINAL)
  1870. + Q_PROPERTY(QString cursiveFontFamily READ cursiveFontFamily WRITE setCursiveFontFamily NOTIFY cursiveFontFamilyChanged FINAL)
  1871. + Q_PROPERTY(QString fantasyFontFamily READ fantasyFontFamily WRITE setFantasyFontFamily NOTIFY fantasyFontFamilyChanged FINAL)
  1872. +
  1873. + Q_PROPERTY(unsigned minimumFontSize READ minimumFontSize WRITE setMinimumFontSize NOTIFY minimumFontSizeChanged FINAL)
  1874. + Q_PROPERTY(unsigned defaultFontSize READ defaultFontSize WRITE setDefaultFontSize NOTIFY defaultFontSizeChanged FINAL)
  1875. + Q_PROPERTY(unsigned defaultFixedFontSize READ defaultFixedFontSize WRITE setDefaultFixedFontSize NOTIFY defaultFixedFontSizeChanged FINAL)
  1876. +
  1877. + bool autoLoadImages() const;
  1878. + void setAutoLoadImages(bool enable);
  1879. +
  1880. + bool javascriptEnabled() const;
  1881. + void setJavascriptEnabled(bool enable);
  1882. +
  1883. + bool pluginsEnabled() const;
  1884. + void setPluginsEnabled(bool enable);
  1885. +
  1886. + bool offlineWebApplicationCacheEnabled() const;
  1887. + void setOfflineWebApplicationCacheEnabled(bool enable);
  1888. +
  1889. + bool localStorageEnabled() const;
  1890. + void setLocalStorageEnabled(bool enable);
  1891. +
  1892. + bool xssAuditingEnabled() const;
  1893. + void setXssAuditingEnabled(bool enable);
  1894. +
  1895. + bool privateBrowsingEnabled() const;
  1896. + void setPrivateBrowsingEnabled(bool enable);
  1897. +
  1898. + bool dnsPrefetchEnabled() const;
  1899. + void setDnsPrefetchEnabled(bool enable);
  1900. +
  1901. + bool navigatorQtObjectEnabled() const;
  1902. + void setNavigatorQtObjectEnabled(bool);
  1903. +
  1904. + QString standardFontFamily() const;
  1905. + void setStandardFontFamily(const QString& family);
  1906.  
  1907. - enum WebAttribute {
  1908. - AutoLoadImages,
  1909. - JavascriptEnabled,
  1910. - PluginsEnabled,
  1911. - OfflineWebApplicationCacheEnabled,
  1912. - LocalStorageEnabled,
  1913. - XSSAuditingEnabled,
  1914. - FrameFlatteningEnabled,
  1915. - PrivateBrowsingEnabled,
  1916. - AcceleratedCompositingEnabled,
  1917. - DnsPrefetchEnabled
  1918. - };
  1919. -
  1920. - enum FontFamily {
  1921. - StandardFont,
  1922. - FixedFont,
  1923. - SerifFont,
  1924. - SansSerifFont,
  1925. - CursiveFont,
  1926. - FantasyFont
  1927. - };
  1928. -
  1929. - enum FontSizeType {
  1930. - MinimumFontSize,
  1931. - DefaultFontSize,
  1932. - DefaultFixedFontSize
  1933. - };
  1934. -
  1935. - static QWebPreferences* createPreferences(QtWebPageProxy*);
  1936. -
  1937. - void setAttribute(WebAttribute attr, bool enable);
  1938. - bool testAttribute(WebAttribute attr) const;
  1939. -
  1940. - void setFontFamily(FontFamily which, const QString& family);
  1941. - QString fontFamily(FontFamily which) const;
  1942. -
  1943. - void setFontSize(FontSizeType type, unsigned size);
  1944. - unsigned fontSize(FontSizeType type) const;
  1945. -
  1946. - WKPreferencesRef preferencesRef() const;
  1947. -
  1948. - QtWebPageProxy* qtWebPageProxy;
  1949. -
  1950. - static QWebPreferencesPrivate* get(QWebPreferences*);
  1951. + QString fixedFontFamily() const;
  1952. + void setFixedFontFamily(const QString& family);
  1953. +
  1954. + QString serifFontFamily() const;
  1955. + void setSerifFontFamily(const QString& family);
  1956. +
  1957. + QString sansSerifFontFamily() const;
  1958. + void setSansSerifFontFamily(const QString& family);
  1959. +
  1960. + QString cursiveFontFamily() const;
  1961. + void setCursiveFontFamily(const QString& family);
  1962. +
  1963. + QString fantasyFontFamily() const;
  1964. + void setFantasyFontFamily(const QString& family);
  1965. +
  1966. + unsigned minimumFontSize() const;
  1967. + void setMinimumFontSize(unsigned size);
  1968. +
  1969. + unsigned defaultFontSize() const;
  1970. + void setDefaultFontSize(unsigned size);
  1971. +
  1972. + unsigned defaultFixedFontSize() const;
  1973. + void setDefaultFixedFontSize(unsigned size);
  1974. +
  1975. +Q_SIGNALS:
  1976. + void autoLoadImagesChanged();
  1977. + void pluginsEnabledChanged();
  1978. + void javascriptEnabledChanged();
  1979. + void offlineWebApplicationCacheEnabledChanged();
  1980. + void localStorageEnabledChanged();
  1981. + void xssAuditingEnabledChanged();
  1982. + void privateBrowsingEnabledChanged();
  1983. + void dnsPrefetchEnabledChanged();
  1984. + void navigatorQtObjectEnabledChanged();
  1985. +
  1986. + void standardFontFamilyChanged();
  1987. + void fixedFontFamilyChanged();
  1988. + void serifFontFamilyChanged();
  1989. + void sansSerifFontFamilyChanged();
  1990. + void cursiveFontFamilyChanged();
  1991. + void fantasyFontFamilyChanged();
  1992. +
  1993. + void minimumFontSizeChanged();
  1994. + void defaultFontSizeChanged();
  1995. + void defaultFixedFontSizeChanged();
  1996. +
  1997. +private:
  1998. + Q_DISABLE_COPY(QWebPreferences)
  1999. +
  2000. + QWebPreferences();
  2001. +
  2002. + QWebPreferencesPrivate *d;
  2003. +
  2004. + friend class QWebPreferencesPrivate;
  2005. };
  2006. +
  2007. +#endif // qwebpreferences_p_h
  2008. diff --git a/Source/WebKit2/UIProcess/API/qt/tests/qmltests/qmltests.pro b/Source/WebKit2/UIProcess/API/qt/tests/qmltests/qmltests.pro
  2009. index 64037e4..59947b0 100644
  2010. --- a/Source/WebKit2/UIProcess/API/qt/tests/qmltests/qmltests.pro
  2011. +++ b/Source/WebKit2/UIProcess/API/qt/tests/qmltests/qmltests.pro
  2012. @@ -1,5 +1,6 @@
  2013. include(../tests.pri)
  2014.  
  2015. +CONFIG += qtwebkit-private
  2016. CONFIG += warn_on testcase
  2017.  
  2018. QT -= testlib
  2019. diff --git a/Source/WebKit2/UIProcess/API/qt/tests/qmltests/tst_qmltests.cpp b/Source/WebKit2/UIProcess/API/qt/tests/qmltests/tst_qmltests.cpp
  2020. index 526644b..ec6fd45 100644
  2021. --- a/Source/WebKit2/UIProcess/API/qt/tests/qmltests/tst_qmltests.cpp
  2022. +++ b/Source/WebKit2/UIProcess/API/qt/tests/qmltests/tst_qmltests.cpp
  2023. @@ -20,8 +20,7 @@
  2024. #include "config.h"
  2025. #include "../util.h"
  2026.  
  2027. -#include "qquickwebpage.h"
  2028. -#include "qquickwebview.h"
  2029. +#include "qquickwebpage_p.h"
  2030. #include "qquickwebview_p.h"
  2031.  
  2032. #include <QVarLengthArray>
  2033. @@ -33,7 +32,7 @@ public:
  2034. DesktopWebView(QQuickItem* parent = 0)
  2035. : QQuickWebView(parent)
  2036. {
  2037. - QQuickWebViewPrivate::get(this)->setUseTraditionalDesktopBehaviour(true);
  2038. + experimental()->setUseTraditionalDesktopBehaviour(true);
  2039. }
  2040. };
  2041.  
  2042. diff --git a/Source/WebKit2/UIProcess/API/qt/tests/qquickwebview/qquickwebview.pro b/Source/WebKit2/UIProcess/API/qt/tests/qquickwebview/qquickwebview.pro
  2043. index e99c7f4..728521f 100644
  2044. --- a/Source/WebKit2/UIProcess/API/qt/tests/qquickwebview/qquickwebview.pro
  2045. +++ b/Source/WebKit2/UIProcess/API/qt/tests/qquickwebview/qquickwebview.pro
  2046. @@ -1 +1,2 @@
  2047. include(../tests.pri)
  2048. +CONFIG += qtwebkit-private
  2049. diff --git a/Source/WebKit2/UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp b/Source/WebKit2/UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp
  2050. index eb49f2e..e43e665 100644
  2051. --- a/Source/WebKit2/UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp
  2052. +++ b/Source/WebKit2/UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp
  2053. @@ -22,8 +22,8 @@
  2054.  
  2055. #include <QScopedPointer>
  2056. #include <QtTest/QtTest>
  2057. -#include <qquickwebpage.h>
  2058. -#include <qquickwebview.h>
  2059. +#include <qquickwebpage_p.h>
  2060. +#include <qquickwebview_p.h>
  2061.  
  2062. class tst_QQuickWebView : public QObject {
  2063. Q_OBJECT
  2064. diff --git a/Source/WebKit2/UIProcess/qt/QtDownloadManager.cpp b/Source/WebKit2/UIProcess/qt/QtDownloadManager.cpp
  2065. index 3f97fc6..10a40e2 100644
  2066. --- a/Source/WebKit2/UIProcess/qt/QtDownloadManager.cpp
  2067. +++ b/Source/WebKit2/UIProcess/qt/QtDownloadManager.cpp
  2068. @@ -27,8 +27,8 @@
  2069. #include "WKStringQt.h"
  2070. #include "WKURLQt.h"
  2071. #include "WebContext.h"
  2072. -#include "qwebdownloaditem.h"
  2073. #include "qwebdownloaditem_p.h"
  2074. +#include "qwebdownloaditem_p_p.h"
  2075.  
  2076. namespace WebKit {
  2077.  
  2078. diff --git a/Source/WebKit2/UIProcess/qt/QtViewInterface.cpp b/Source/WebKit2/UIProcess/qt/QtViewInterface.cpp
  2079. index 6d8329b..c096b1b 100644
  2080. --- a/Source/WebKit2/UIProcess/qt/QtViewInterface.cpp
  2081. +++ b/Source/WebKit2/UIProcess/qt/QtViewInterface.cpp
  2082. @@ -22,10 +22,10 @@
  2083. #include "QtViewInterface.h"
  2084.  
  2085. #include "QtWebError.h"
  2086. -#include "qquickwebpage.h"
  2087. #include "qquickwebpage_p.h"
  2088. -#include "qquickwebview.h"
  2089. +#include "qquickwebpage_p_p.h"
  2090. #include "qquickwebview_p.h"
  2091. +#include "qquickwebview_p_p.h"
  2092.  
  2093. #include <QtDeclarative/QDeclarativeEngine>
  2094. #include <QtDeclarative/QQuickView>
  2095. diff --git a/Source/WebKit2/UIProcess/qt/QtWebError.h b/Source/WebKit2/UIProcess/qt/QtWebError.h
  2096. index 91187e9..389b50f 100644
  2097. --- a/Source/WebKit2/UIProcess/qt/QtWebError.h
  2098. +++ b/Source/WebKit2/UIProcess/qt/QtWebError.h
  2099. @@ -21,7 +21,7 @@
  2100. #ifndef QtWebError_h
  2101. #define QtWebError_h
  2102.  
  2103. -#include "qwebdownloaditem.h"
  2104. +#include "qwebdownloaditem_p.h"
  2105. #include "qwebkitglobal.h"
  2106. #include <QtNetwork/QNetworkReply>
  2107. #include <WKError.h>
  2108. diff --git a/Source/WebKit2/UIProcess/qt/QtWebPageProxy.cpp b/Source/WebKit2/UIProcess/qt/QtWebPageProxy.cpp
  2109. index 3564dd6..2a66170 100644
  2110. --- a/Source/WebKit2/UIProcess/qt/QtWebPageProxy.cpp
  2111. +++ b/Source/WebKit2/UIProcess/qt/QtWebPageProxy.cpp
  2112. @@ -22,10 +22,10 @@
  2113. #include "QtWebPageProxy.h"
  2114.  
  2115. #include "QtWebError.h"
  2116. -#include "qwebdownloaditem.h"
  2117. #include "qwebdownloaditem_p.h"
  2118. -#include "qwebpreferences.h"
  2119. +#include "qwebdownloaditem_p_p.h"
  2120. #include "qwebpreferences_p.h"
  2121. +#include "qwebpreferences_p_p.h"
  2122.  
  2123. #include "ClientImpl.h"
  2124. #include "DownloadProxy.h"
  2125. diff --git a/Source/api.pri b/Source/api.pri
  2126. index b128187..1519c6a 100644
  2127. --- a/Source/api.pri
  2128. +++ b/Source/api.pri
  2129. @@ -161,15 +161,12 @@ contains(CONFIG, texmap) {
  2130.  
  2131. # ------------- Install rules -------------
  2132.  
  2133. -modulefile.files = $${ROOT_WEBKIT_DIR}/Tools/qmake/mkspecs/modules/qt_webkit.pri
  2134. +modulefile.files = $$QT.webkit.modulefile
  2135. mkspecs = $$[QMAKE_MKSPECS]
  2136. mkspecs = $$split(mkspecs, :)
  2137. modulefile.path = $$last(mkspecs)/modules
  2138. INSTALLS += modulefile
  2139.  
  2140. -include($$first(modulefile.files))
  2141. -VERSION = $${QT.webkit.VERSION}
  2142. -
  2143. # Syncqt has already run at this point, so we can use headers.pri
  2144. # as a basis for our install-rules
  2145. HEADERS_PRI = $${ROOT_BUILD_DIR}/include/$$TARGET/headers.pri
  2146. diff --git a/Tools/MiniBrowser/qt/BrowserWindow.cpp b/Tools/MiniBrowser/qt/BrowserWindow.cpp
  2147. index f5613b6..58e5894 100644
  2148. --- a/Tools/MiniBrowser/qt/BrowserWindow.cpp
  2149. +++ b/Tools/MiniBrowser/qt/BrowserWindow.cpp
  2150. @@ -29,7 +29,7 @@
  2151. #include "BrowserWindow.h"
  2152.  
  2153. #include "config.h"
  2154. -#include "qquickwebpage.h"
  2155. +#include "qquickwebpage_p.h"
  2156. #include "qquickwebview_p.h"
  2157. #include "utils.h"
  2158.  
  2159. @@ -53,7 +53,7 @@ BrowserWindow::BrowserWindow(WindowOptions* options)
  2160. setSource(QUrl("qrc:/qml/BrowserWindow.qml"));
  2161. connect(rootObject(), SIGNAL(pageTitleChanged(QString)), this, SLOT(setWindowTitle(QString)));
  2162. if (!options->useTouchWebView())
  2163. - QQuickWebViewPrivate::get(rootObject()->property("webview").value<QQuickWebView*>())->setUseTraditionalDesktopBehaviour(true);
  2164. + webView()->experimental()->setUseTraditionalDesktopBehaviour(true);
  2165. if (options->startMaximized())
  2166. setWindowState(Qt::WindowMaximized);
  2167. else
  2168. @@ -61,7 +61,7 @@ BrowserWindow::BrowserWindow(WindowOptions* options)
  2169. show();
  2170. }
  2171.  
  2172. -QObject* BrowserWindow::webView() const
  2173. +QQuickWebView* BrowserWindow::webView() const
  2174. {
  2175. return rootObject()->property("webview").value<QQuickWebView*>();
  2176. }
  2177. diff --git a/Tools/MiniBrowser/qt/BrowserWindow.h b/Tools/MiniBrowser/qt/BrowserWindow.h
  2178. index 651ea07..769e97d 100644
  2179. --- a/Tools/MiniBrowser/qt/BrowserWindow.h
  2180. +++ b/Tools/MiniBrowser/qt/BrowserWindow.h
  2181. @@ -33,6 +33,8 @@
  2182. #include <QStringList>
  2183. #include <QtDeclarative/QQuickView>
  2184.  
  2185. +class QQuickWebView;
  2186. +
  2187. class BrowserWindow : public QQuickView {
  2188. Q_OBJECT
  2189.  
  2190. @@ -40,7 +42,7 @@ public:
  2191. BrowserWindow(WindowOptions* = 0);
  2192. ~BrowserWindow();
  2193. void load(const QString& url);
  2194. - QObject* webView() const;
  2195. + QQuickWebView* webView() const;
  2196.  
  2197. public slots:
  2198. BrowserWindow* newWindow(const QString& url = "about:blank");
  2199. diff --git a/Tools/MiniBrowser/qt/UrlLoader.cpp b/Tools/MiniBrowser/qt/UrlLoader.cpp
  2200. index ebd670e..daf5628 100644
  2201. --- a/Tools/MiniBrowser/qt/UrlLoader.cpp
  2202. +++ b/Tools/MiniBrowser/qt/UrlLoader.cpp
  2203. @@ -27,6 +27,7 @@
  2204. */
  2205.  
  2206. #include "UrlLoader.h"
  2207. +#include "qquickwebview_p.h"
  2208.  
  2209. #include <QDebug>
  2210. #include <QFile>
  2211. diff --git a/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp b/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp
  2212. index 9661b57..bad074d 100644
  2213. --- a/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp
  2214. +++ b/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp
  2215. @@ -27,8 +27,8 @@
  2216. #include "config.h"
  2217.  
  2218. #include "PlatformWebView.h"
  2219. -#include "qquickwebview.h"
  2220. -#include "qquickwebpage.h"
  2221. +#include "qquickwebview_p.h"
  2222. +#include "qquickwebpage_p.h"
  2223.  
  2224. #include <QApplication>
  2225. #include <QDeclarativeProperty>
  2226. diff --git a/Tools/qmake/mkspecs/features/default_post.prf b/Tools/qmake/mkspecs/features/default_post.prf
  2227. index c9493aa..82a3bbd 100644
  2228. --- a/Tools/qmake/mkspecs/features/default_post.prf
  2229. +++ b/Tools/qmake/mkspecs/features/default_post.prf
  2230. @@ -37,7 +37,6 @@ DEPENDPATH += $$OUT_PWD
  2231.  
  2232. INCLUDEPATH += \
  2233. $${ROOT_WEBKIT_DIR}/Source \
  2234. - $${ROOT_BUILD_DIR}/include/QtWebKit \
  2235. $$buildDirForSource(Source/include) \
  2236. $${QT.script.includes}
  2237.  
  2238. diff --git a/Tools/qmake/mkspecs/features/default_pre.prf b/Tools/qmake/mkspecs/features/default_pre.prf
  2239. index f8d8c7b..6dca683 100644
  2240. --- a/Tools/qmake/mkspecs/features/default_pre.prf
  2241. +++ b/Tools/qmake/mkspecs/features/default_pre.prf
  2242. @@ -101,5 +101,9 @@ haveQt(5): {
  2243. }
  2244. }
  2245.  
  2246. +QT.webkit.modulefile = $${ROOT_WEBKIT_DIR}/Tools/qmake/mkspecs/modules/qt_webkit.pri
  2247. +include($$QT.webkit.modulefile)
  2248. +VERSION = $${QT.webkit.VERSION}
  2249. +
  2250. # Set some defaults for specific platforms
  2251. CONFIG += include_webinspector
  2252. diff --git a/Tools/qmake/mkspecs/features/qtwebkit-private.prf b/Tools/qmake/mkspecs/features/qtwebkit-private.prf
  2253. new file mode 100644
  2254. index 0000000..05c68d9
  2255. --- /dev/null
  2256. +++ b/Tools/qmake/mkspecs/features/qtwebkit-private.prf
  2257. @@ -0,0 +1,12 @@
  2258. +# -------------------------------------------------------------------
  2259. +# This file is used by tools that rely on private APIs of
  2260. +# the QtWebKit library
  2261. +#
  2262. +# FIXME: Can we use the same way as client applications would use?
  2263. +#
  2264. +# See 'Tools/qmake/README' for an overview of the build system
  2265. +# -------------------------------------------------------------------
  2266. +
  2267. +config_step {
  2268. + INCLUDEPATH += $${ROOT_BUILD_DIR}/include/$${QT.webkit.name}/$${QT.webkit.VERSION}/$${QT.webkit.name}/private
  2269. +}
  2270. diff --git a/Tools/qmake/mkspecs/features/qtwebkit.prf b/Tools/qmake/mkspecs/features/qtwebkit.prf
  2271. index a4320b3..90cbd6e 100644
  2272. --- a/Tools/qmake/mkspecs/features/qtwebkit.prf
  2273. +++ b/Tools/qmake/mkspecs/features/qtwebkit.prf
  2274. @@ -24,5 +24,6 @@ config_step {
  2275. }
  2276.  
  2277. DEPENDPATH += $$ROOT_WEBKIT_DIR/Source/WebKit/qt/Api
  2278. + INCLUDEPATH += $${ROOT_BUILD_DIR}/include/QtWebKit
  2279. }
Add Comment
Please, Sign In to add comment