]> git.saurik.com Git - wxWidgets.git/blobdiff - interface/wx/webview.h
Implement extended history api in gtk
[wxWidgets.git] / interface / wx / webview.h
index b3f47cc13316cae0ffa74ab37003c14e4749897b..55f3708bf5945acc41223e955a03c24eb8351a55 100644 (file)
@@ -40,22 +40,22 @@ enum wxWebViewZoomType
 enum wxWebNavigationError\r
 {\r
     /** Connection error (timeout, etc.) */\r
-    wxWEB_NAV_ERR_CONNECTION = 1,\r
+    wxWEB_NAV_ERR_CONNECTION,\r
     /** Invalid certificate */\r
-    wxWEB_NAV_ERR_CERTIFICATE = 2,\r
+    wxWEB_NAV_ERR_CERTIFICATE,\r
     /** Authentication required */\r
-    wxWEB_NAV_ERR_AUTH = 3,\r
+    wxWEB_NAV_ERR_AUTH,\r
     /** Other security error */\r
-    wxWEB_NAV_ERR_SECURITY = 4,\r
+    wxWEB_NAV_ERR_SECURITY,\r
     /** Requested resource not found */\r
-    wxWEB_NAV_ERR_NOT_FOUND = 5,\r
+    wxWEB_NAV_ERR_NOT_FOUND,\r
     /** Invalid request/parameters (e.g. bad URL, bad protocol,\r
         unsupported resource type) */\r
-    wxWEB_NAV_ERR_REQUEST = 6,\r
+    wxWEB_NAV_ERR_REQUEST,\r
     /** The user cancelled (e.g. in a dialog) */\r
-    wxWEB_NAV_ERR_USER_CANCELLED = 7,\r
+    wxWEB_NAV_ERR_USER_CANCELLED,\r
     /** Another (exotic) type of error that didn't fit in other categories*/\r
-    wxWEB_NAV_ERR_OTHER = 8\r
+    wxWEB_NAV_ERR_OTHER\r
 };\r
 \r
 /** \r
@@ -64,7 +64,7 @@ enum wxWebNavigationError
 enum wxWebViewReloadFlags\r
 {\r
     /** Default reload, will access cache */\r
-    wxWEB_VIEW_RELOAD_DEFAULT = 0,\r
+    wxWEB_VIEW_RELOAD_DEFAULT,\r
     /** Reload the current view without accessing the cache */\r
     wxWEB_VIEW_RELOAD_NO_CACHE \r
 };\r
@@ -119,6 +119,10 @@ enum wxWebViewBackend
        The integer associated with this event will be a wxWebNavigationError item.\r
        The string associated with this event may contain a backend-specific more\r
        precise error message/code.\r
+    @event{EVT_WEB_VIEW_NEWWINDOW(id, func)}\r
+       Process a @c wxEVT_COMMAND_WEB_VIEW_NEWWINDOW event, generated when a new\r
+       window is created. This event may be vetoed to prevent a new window showing,\r
+       for example if you want to open the url in the existing window or a new tab.\r
     @endEventTable\r
    \r
     @library{wxweb}\r
@@ -195,6 +199,34 @@ public:
     */\r
     virtual void GoForward() = 0;\r
 \r
+    /**\r
+        Clear the history, this will also remove the visible page.\r
+    */\r
+    virtual void ClearHistory() = 0;\r
+    \r
+    /**\r
+        Enable or disable the history. This will also clear the history.\r
+    */\r
+    virtual void EnableHistory(bool enable = true) = 0;\r
+\r
+    /**\r
+        Returns a list of items in the back history. The first item in the\r
+        vector is the first page that was loaded by the control.\r
+    */\r
+    virtual wxVector<wxSharedPtr<wxWebHistoryItem> > GetBackwardHistory() = 0;\r
+    \r
+    /**\r
+        Returns a list of items in the forward history. The first item in the \r
+        vector is the next item in the history with respect to the curently \r
+        loaded page.\r
+    */\r
+    virtual wxVector<wxSharedPtr<wxWebHistoryItem> > GetForwardHistory() = 0;\r
+    \r
+    /**\r
+        Loads a history item. \r
+    */\r
+    virtual void LoadHistoryItem(wxSharedPtr<wxWebHistoryItem> item) = 0;\r
+    \r
     /**\r
         Load a HTMl document (web page) from a URL\r
         @param url the URL where the HTML document to display can be found\r
@@ -333,6 +365,10 @@ public:
        The integer associated with this event will be a wxWebNavigationError item.\r
        The string associated with this event may contain a backend-specific more\r
        precise error message/code.\r
+    @event{EVT_WEB_VIEW_NEWWINDOW(id, func)}\r
+       Process a @c wxEVT_COMMAND_WEB_VIEW_NEWWINDOW event, generated when a new\r
+       window is created. This event may be vetoed to prevent a new window showing,\r
+       for example if you want to open the url in the existing window or a new tab.\r
     @endEventTable\r
 \r
     @library{wxweb}\r
@@ -357,24 +393,25 @@ public:
     */\r
     const wxString& GetTarget() const;\r
 \r
-    // default copy ctor, assignment operator and dtor are ok\r
     virtual wxEvent* Clone() const;\r
 \r
     /** \r
         Get whether this event may be vetoed (stopped/prevented). Only\r
-        meaningful for events fired before navigation takes place.\r
+        meaningful for events fired before navigation takes place or new \r
+        window events.\r
      */\r
     bool CanVeto() const;\r
 \r
     /** \r
         Whether this event was vetoed (stopped/prevented). Only meaningful for\r
-        events fired before navigation takes place.\r
+        events fired before navigation takes place or new window events.\r
      */\r
     bool IsVetoed() const;\r
 \r
     /** \r
         Veto (prevent/stop) this event. Only meaningful for events fired\r
-        before navigation takes place. Only valid if CanVeto() returned true.\r
+        before navigation takes place or new window events. Only valid \r
+        if CanVeto() returned true.\r
      */\r
     void Veto();\r
 };
\ No newline at end of file