WebNotificationDelegate

The WebNotificationDelegate class contains methods that describe page and link information. Moreover, the WebNotificationDelegate class is a delegate class that you can override to define custom behavior for things like page loading, user interactions (such as mouse hover info, and tool tips), and general page and link information.

A WebNotificationDelegate instance must be associated with a WebView instance in order to return information.

The following code snippet associates a WebNotificationDelegate with a WebView.

MainWebNotificationDelegate* mainWebNotificationDelegate =
new MainWebNotificationDelegate();
webView->setWebNotificationDelegate(mainWebNotificationDelegate);

In the sample application, the WebNotificationDelegate class is implemented to define custom browser behavior. In the following example, the hoverOverLink() method is extended to display a message on the screen whenever the user hovers over a given WebFrame.

virtual void hoverOverLink(WebFrame*, const char* title, const char* message)
    {
      sprintf(cur_notification, "NOTIFY: Hover: %s:%s", title ? title :
      "NA", message ? message : "NA");
      ui_statusbar_draw(layer_surface);
    }

The WebNotificationDelegate contains the following methods and types (listed alphabetically):

finishedLoadNotification()
hoverOverlink()
loadError()
progressNotification()
startLoadNotification()
setTitle()
showToolTip()
showStatus()
unknownContentType()