summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKirill Burtsev <kirill.burtsev@qt.io>2019-08-09 17:11:55 +0200
committerKirill Burtsev <kirill.burtsev@qt.io>2019-08-29 16:29:28 +0000
commitec3c4c7ed8101d14cafd114cb5396f2d586df047 (patch)
tree125e6138861744922d8f7f6e30882da106769f22
parent759085eb6ae57bc9c2bc35095798501824482da3 (diff)
Add missing doc for WebEngineNotification QML type
Change-Id: I3090b7cbbb9b913f147aaba8f39cefcd41e30d46 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
-rw-r--r--src/core/api/qwebenginenotification.cpp77
1 files changed, 73 insertions, 4 deletions
diff --git a/src/core/api/qwebenginenotification.cpp b/src/core/api/qwebenginenotification.cpp
index f91eabd25..5cc4bc7b4 100644
--- a/src/core/api/qwebenginenotification.cpp
+++ b/src/core/api/qwebenginenotification.cpp
@@ -48,6 +48,19 @@ QT_BEGIN_NAMESPACE
using QtWebEngineCore::UserNotificationController;
/*!
+ \qmltype WebEngineNotification
+ \instantiates QWebEngineNotification
+ \inqmlmodule QtWebEngine
+ \since QtWebEngine 1.9
+ \brief Encapsulates the data of an HTML5 web notification.
+
+ This type contains the information and API for HTML5 desktop and push notifications.
+
+ Web engine notifications are passed to the user in the
+ \l WebEngineProfile::presentNotification() signal.
+*/
+
+/*!
\class QWebEngineNotification
\brief The QWebEngineNotification class encapsulates the data of an HTML5 web notification.
\since 5.13
@@ -56,10 +69,8 @@ using QtWebEngineCore::UserNotificationController;
This class contains the information and API for HTML5 desktop and push notifications.
- Web engine notifications are passed to the user in the
- \l QWebEngineProfile::setNotificationPresenter() and
- \l QQuickWebEngineProfile::presentNotification() calls and the
- \l WebEngineProfile::presentNotification() signal.
+ Web engine notifications are passed to the user through the custom handler
+ provided with the \l QWebEngineProfile::setNotificationPresenter() call.
*/
class QWebEngineNotificationPrivate : public UserNotificationController::Client {
@@ -115,6 +126,10 @@ bool QWebEngineNotification::matches(const QWebEngineNotification *other) const
}
/*!
+ \qmlproperty bool WebEngineNotification::title
+ \brief The title of the notification.
+*/
+/*!
\property QWebEngineNotification::title
\brief The title of the notification.
\sa message()
@@ -126,6 +141,10 @@ QString QWebEngineNotification::title() const
}
/*!
+ \qmlproperty string WebEngineNotification::message
+ \brief The body of the notification message.
+*/
+/*!
\property QWebEngineNotification::message
\brief The body of the notification message.
\sa title()
@@ -138,6 +157,13 @@ QString QWebEngineNotification::message() const
}
/*!
+ \qmlproperty string WebEngineNotification::tag
+ \brief The tag of the notification message.
+
+ New notifications that have the same tag and origin URL as an existing
+ one should replace or update the old notification with the same tag.
+*/
+/*!
\property QWebEngineNotification::tag
\brief The tag of the notification message.
@@ -153,6 +179,10 @@ QString QWebEngineNotification::tag() const
}
/*!
+ \qmlproperty url WebEngineNotification::origin
+ \brief The URL of the page sending the notification.
+*/
+/*!
\property QWebEngineNotification::origin
\brief The URL of the page sending the notification.
*/
@@ -175,6 +205,12 @@ QImage QWebEngineNotification::icon() const
}
/*!
+ \qmlproperty string WebEngineNotification::language
+ \brief The primary language for the notification's title and body.
+
+ Its value is a valid BCP 47 language tag, or the empty string.
+*/
+/*!
\property QWebEngineNotification::language
\brief The primary language for the notification's title and body.
@@ -189,6 +225,14 @@ QString QWebEngineNotification::language() const
}
/*!
+ \qmlproperty enumeration WebEngineNotification::direction
+ \brief The text direction for the notification's title and body.
+
+ \value Qt.LeftToRight Items are laid out from left to right.
+ \value Qt.RightToLeft Items are laid out from right to left.
+ \value Qt.LayoutDirectionAuto The direction to lay out items is determined automatically.
+*/
+/*!
\property QWebEngineNotification::direction
\brief The text direction for the notification's title and body.
\sa title(), message()
@@ -200,6 +244,12 @@ Qt::LayoutDirection QWebEngineNotification::direction() const
}
/*!
+ \qmlmethod void WebEngineNotification::show()
+ Creates and dispatches a JavaScript \e {show event} on notification.
+
+ Should be called by the notification platform when the notification has been shown to user.
+*/
+/*!
Creates and dispatches a JavaScript \e {show event} on notification.
Should be called by the notification platform when the notification has been shown to user.
@@ -212,6 +262,12 @@ void QWebEngineNotification::show() const
}
/*!
+ \qmlmethod void WebEngineNotification::click()
+ Creates and dispatches a JavaScript \e {click event} on notification.
+
+ Should be called by the notification platform when the notification is activated by the user.
+*/
+/*!
Creates and dispatches a JavaScript \e {click event} on notification.
Should be called by the notification platform when the notification is activated by the user.
@@ -224,6 +280,13 @@ void QWebEngineNotification::click() const
}
/*!
+ \qmlmethod void WebEngineNotification::close()
+ Creates and dispatches a JavaScript \e {close event} on notification.
+
+ Should be called by the notification platform when the notification is closed,
+ either by the underlying platform or by the user.
+*/
+/*!
Creates and dispatches a JavaScript \e {close event} on notification.
Should be called by the notification platform when the notification is closed,
@@ -237,6 +300,12 @@ void QWebEngineNotification::close() const
}
/*!
+ \qmlsignal WebEngineNotification::closed()
+
+ This signal is emitted when the web page calls close steps for the notification,
+ and it no longer needs to be shown.
+*/
+/*!
\fn void QWebEngineNotification::closed()
This signal is emitted when the web page calls close steps for the notification,