Title: [115830] trunk/Source
Revision
115830
Author
kenn...@webkit.org
Date
2012-05-02 07:37:41 -0700 (Wed, 02 May 2012)

Log Message

[Qt] Add initial QML documentation
https://bugs.webkit.org/show_bug.cgi?id=85370

Reviewed by Simon Hausmann.

Source/WebKit/qt:

* docs/qtwebkit.qdocconf: Add WebKit2 dirs.

Source/WebKit2:

Add initial documentation which also serves as an example on how it
should be done.

* UIProcess/API/qt/qquickwebview.cpp:
* UIProcess/API/qt/qwebloadrequest.cpp:

Modified Paths

Diff

Modified: trunk/Source/WebKit/qt/ChangeLog (115829 => 115830)


--- trunk/Source/WebKit/qt/ChangeLog	2012-05-02 14:19:34 UTC (rev 115829)
+++ trunk/Source/WebKit/qt/ChangeLog	2012-05-02 14:37:41 UTC (rev 115830)
@@ -1,3 +1,12 @@
+2012-05-02  Kenneth Rohde Christiansen  <kenn...@webkit.org>
+
+        [Qt] Add initial QML documentation
+        https://bugs.webkit.org/show_bug.cgi?id=85370
+
+        Reviewed by Simon Hausmann.
+
+        * docs/qtwebkit.qdocconf: Add WebKit2 dirs.
+
 2012-05-02  Csaba Osztrogonác  <o...@webkit.org>
 
         [Qt] Buildfix after r115812 for !ENABLE(DEVICE_ORIENTATION) builds.

Modified: trunk/Source/WebKit/qt/docs/qtwebkit.qdocconf (115829 => 115830)


--- trunk/Source/WebKit/qt/docs/qtwebkit.qdocconf	2012-05-02 14:19:34 UTC (rev 115829)
+++ trunk/Source/WebKit/qt/docs/qtwebkit.qdocconf	2012-05-02 14:37:41 UTC (rev 115830)
@@ -3,8 +3,8 @@
 project     = qtwebkit
 description = "Qt WebKit API Documentation"
 
-headerdirs = $SRCDIR/WebKit/qt/Api $SRCDIR/WebKit/qt/declarative
-sourcedirs = $SRCDIR/WebKit/qt/Api $SRCDIR/WebKit/qt/docs $SRCDIR/Source/_javascript_Core/qt/api $SRCDIR/WebKit/qt/declarative
+headerdirs = $SRCDIR/WebKit/qt/Api $SRCDIR/WebKit/qt/declarative $SRCDIR/WebKit2/UIProcess/API/qt
+sourcedirs = $SRCDIR/WebKit/qt/Api $SRCDIR/WebKit/qt/docs $SRCDIR/Source/_javascript_Core/qt/api $SRCDIR/WebKit/qt/declarative $SRCDIR/WebKit2/UIProcess/API/qt
 outputdir = $OUTPUT_DIR/doc/html
 outputformats = HTML
 sources.fileextensions  = "*.cpp *.doc *.qdoc *.h"

Modified: trunk/Source/WebKit2/ChangeLog (115829 => 115830)


--- trunk/Source/WebKit2/ChangeLog	2012-05-02 14:19:34 UTC (rev 115829)
+++ trunk/Source/WebKit2/ChangeLog	2012-05-02 14:37:41 UTC (rev 115830)
@@ -1,3 +1,16 @@
+2012-05-02  Kenneth Rohde Christiansen  <kenn...@webkit.org>
+
+        [Qt] Add initial QML documentation
+        https://bugs.webkit.org/show_bug.cgi?id=85370
+
+        Reviewed by Simon Hausmann.
+
+        Add initial documentation which also serves as an example on how it
+        should be done.
+
+        * UIProcess/API/qt/qquickwebview.cpp:
+        * UIProcess/API/qt/qwebloadrequest.cpp:
+
 2012-05-02  Zalan Bujtas  <zbuj...@gmail.com>
 
         [Qt][WK2] Remove redundant updateViewportArguments() call from HTMLBodyElement::didNotifyDescendantInseretions()

Modified: trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp (115829 => 115830)


--- trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp	2012-05-02 14:19:34 UTC (rev 115829)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp	2012-05-02 14:37:41 UTC (rev 115830)
@@ -223,6 +223,10 @@
     return pageView->pos();
 }
 
+/*!
+    \qmlsignal WebView::loadingChanged(WebLoadRequest request)
+*/
+
 void QQuickWebViewPrivate::loadDidSucceed()
 {
     Q_Q(QQuickWebView);
@@ -544,6 +548,15 @@
     return WebCore::IntSize(pageView->width(), pageView->height());
 }
 
+/*!
+    \internal
+
+    \qmlsignal WebViewExperimental::onMessageReceived(var message)
+
+    \brief Emitted when _javascript_ code executing on the web page calls navigator.qt.postMessage().
+
+    \sa postMessage
+*/
 void QQuickWebViewPrivate::didReceiveMessageFromNavigatorQtObject(const String& message)
 {
     QVariantMap variantMap;
@@ -808,15 +821,19 @@
 }
 
 /*!
-    \qmlsignal WebView::onNavigationRequested(request)
+    \qmlsignal WebView::onNavigationRequested(WebNavigationRequest request)
 
-    This signal is emitted for every navigation request. The request object contains url, button and modifiers properties
-    describing the navigation action, e.g. "a middle click with shift key pressed to 'http://qt-project.org'".
+    This signal is emitted for every navigation request. The request object contains url,
+    button and modifiers properties describing the navigation action, e.g. "a middle click
+    with shift key pressed to 'http://qt-project.org'".
 
-    The navigation will be accepted by default. To change that, one can set the action property to WebView.IgnoreRequest to reject
-    the request or WebView.DownloadRequest to trigger a download instead of navigating to the url.
+    The navigation will be accepted by default. To change that, one can set the action
+    property to WebView.IgnoreRequest to reject the request or WebView.DownloadRequest to
+    trigger a download instead of navigating to the url.
 
     The request object cannot be used after the signal handler function ends.
+
+    \sa WebNavigationRequest
 */
 
 QQuickWebViewAttached::QQuickWebViewAttached(QObject* object)
@@ -883,20 +900,23 @@
 }
 
 /*!
-   \brief Minimum contents width when not overriden by the page itself.
+    \internal
 
-   Unless the page defines how contents should be laid out, using e.g.
-   the viewport meta tag, it is laid out given the width of the viewport
-   (in CSS units).
+    \qmlproperty int WebViewExperimental::preferredMinimumContentsWidth
+    \brief Minimum contents width when not overriden by the page itself.
 
-   This setting can be used to enforce a minimum width when the page
-   does not define a width itself. This is useful for laying out pages
-   designed for big screens, commonly knows as desktop pages, on small
-   devices.
+    Unless the page defines how contents should be laid out, using e.g.
+    the viewport meta tag, it is laid out given the width of the viewport
+    (in CSS units).
 
-   The default value is 0, but the value of 980 is recommented for small
-   screens as it provides a good trade off between legitable pages and
-   non-broken content.
+    This setting can be used to enforce a minimum width when the page
+    does not define a width itself. This is useful for laying out pages
+    designed for big screens, commonly knows as desktop pages, on small
+    devices.
+
+    The default value is 0, but the value of 980 is recommented for small
+    screens as it provides a good trade off between legitable pages and
+    non-broken content.
  */
 int QQuickWebViewExperimental::preferredMinimumContentsWidth() const
 {
@@ -920,6 +940,17 @@
     return s_flickableViewportEnabled;
 }
 
+/*!
+    \internal
+
+    \qmlmethod void WebViewExperimental::postMessage(string message)
+
+    \brief Post a message to an onmessage function registered with the navigator.qt object
+           by _javascript_ code executing on the page.
+
+    \sa onMessageReceived
+*/
+
 void QQuickWebViewExperimental::postMessage(const QString& message)
 {
     Q_D(QQuickWebView);
@@ -1175,6 +1206,16 @@
     return q_ptr->page();
 }
 
+/*!
+    \qmlclass WebView QWebView
+    \inqmlmodule QtWebKit 3.0
+*/
+
+/*!
+   \qmlmethod WebView(Item parent)
+   \brief Constructs a WebView with a parent.
+*/
+
 QQuickWebView::QQuickWebView(QQuickItem* parent)
     : QQuickFlickable(parent)
     , d_ptr(createPrivateObject(this))
@@ -1283,6 +1324,13 @@
     return d->m_iconURL;
 }
 
+/*!
+    \qmlproperty int WebView::loadProgress
+    \brief The progress of loading the current web page.
+
+    The range is from 0 to 100.
+*/
+
 int QQuickWebView::loadProgress() const
 {
     Q_D(const QQuickWebView);
@@ -1301,6 +1349,11 @@
     return d->webPageProxy->canGoForward();
 }
 
+/*!
+    \qmlproperty bool WebView::loading
+    \brief True if the web view is currently loading a web page, false otherwise.
+*/
+
 bool QQuickWebView::loading() const
 {
     Q_D(const QQuickWebView);
@@ -1308,30 +1361,50 @@
     return mainFrame && !(WebFrameProxy::LoadStateFinished == mainFrame->loadState());
 }
 
+/*!
+    \internal
+ */
+
 QPointF QQuickWebView::mapToWebContent(const QPointF& pointInViewCoordinates) const
 {
     Q_D(const QQuickWebView);
     return d->pageView->transformFromItem().map(pointInViewCoordinates);
 }
 
+/*!
+    \internal
+ */
+
 QRectF QQuickWebView::mapRectToWebContent(const QRectF& rectInViewCoordinates) const
 {
     Q_D(const QQuickWebView);
     return d->pageView->transformFromItem().mapRect(rectInViewCoordinates);
 }
 
+/*!
+    \internal
+ */
+
 QPointF QQuickWebView::mapFromWebContent(const QPointF& pointInCSSCoordinates) const
 {
     Q_D(const QQuickWebView);
     return d->pageView->transformToItem().map(pointInCSSCoordinates);
 }
 
+/*!
+    \internal
+ */
 QRectF QQuickWebView::mapRectFromWebContent(const QRectF& rectInCSSCoordinates) const
 {
     Q_D(const QQuickWebView);
     return d->pageView->transformToItem().mapRect(rectInCSSCoordinates);
 }
 
+/*!
+    \qmlproperty string WebView::title
+    \brief The title of the loaded page.
+*/
+
 QString QQuickWebView::title() const
 {
     Q_D(const QQuickWebView);
@@ -1366,6 +1439,12 @@
     }
 }
 
+/*!
+    \preliminary
+
+    The experimental module consisting on experimental API which will break
+    from version to version.
+*/
 QQuickWebViewExperimental* QQuickWebView::experimental() const
 {
     return m_experimental;
@@ -1376,6 +1455,9 @@
     return new QQuickWebViewAttached(object);
 }
 
+/*!
+    \internal
+*/
 void QQuickWebView::platformInitialize()
 {
     JSC::initializeThreading();
@@ -1578,7 +1660,8 @@
 }
 
 /*!
-    Loads the specified \a html as the content of the web view.
+    \qmlmethod void WebView::loadHtml(string html, url baseUrl, url unreachableUrl)
+    \brief Loads the specified \a html as the content of the web view.
 
     External objects such as stylesheets or images referenced in the HTML
     document are located relative to \a baseUrl.
@@ -1587,8 +1670,9 @@
     content. This is typically used to display error pages for a failed
     load.
 
-    \sa load()
+    \sa WebView::url
 */
+
 void QQuickWebView::loadHtml(const QString& html, const QUrl& baseUrl, const QUrl& unreachableUrl)
 {
     Q_D(QQuickWebView);

Modified: trunk/Source/WebKit2/UIProcess/API/qt/qwebloadrequest.cpp (115829 => 115830)


--- trunk/Source/WebKit2/UIProcess/API/qt/qwebloadrequest.cpp	2012-05-02 14:19:34 UTC (rev 115829)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qwebloadrequest.cpp	2012-05-02 14:37:41 UTC (rev 115830)
@@ -39,6 +39,17 @@
     int errorCode;
 };
 
+/*!
+    \qmlclass WebLoadRequest QWebLoadRequest
+    \brief A utility class for the WebView::loadingChanged signal.
+
+    This class contains information about a requested load of a web page, like the URL and
+    current loading status (started, finished, failed).
+
+    \sa WebView::loadingChanged(WebLoadRequest)
+
+    \inqmlmodule QtWebKit 3.0
+*/
 QWebLoadRequest::QWebLoadRequest(const QUrl& url, QQuickWebView::LoadStatus status, const QString& errorString, QQuickWebView::ErrorDomain errorDomain, int errorCode, QObject* parent)
     : QObject(parent)
     , d(new QWebLoadRequestPrivate(url, status, errorString, errorDomain, errorCode))
@@ -49,16 +60,36 @@
 {
 }
 
+/*!
+    \qmlproperty url WebLoadRequest::url
+    \brief The URL of the load request.
+ */
 QUrl QWebLoadRequest::url() const
 {
     return d->url;
 }
 
+/*!
+    \qmlproperty enumeration WebLoadRequest::status
+
+    The load status of a web page load request.
+
+    \list
+    \li WebView::LoadStartedStatus - the page is currently loading.
+    \li WebView::LoadSucceededStatus - the page has been loaded with success.
+    \li WebView::LoadFailedStatus - the page has failed loading.
+    \endlist
+
+    \sa WebLoadRequest, WebView::loadingChanged(WebLoadRequest)
+*/
 QQuickWebView::LoadStatus QWebLoadRequest::status() const
 {
     return d->status;
 }
 
+/*!
+    \qmlproperty string WebLoadRequest::errorString
+*/
 QString QWebLoadRequest::errorString() const
 {
     return d->errorString;
@@ -69,6 +100,9 @@
     return d->errorDomain;
 }
 
+/*!
+    \qmlproperty int WebLoadRequest::errorCode
+*/
 int QWebLoadRequest::errorCode() const
 {
     return d->errorCode;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to