| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 #ifndef WebView_h | 31 #ifndef WebView_h |
| 32 #define WebView_h | 32 #define WebView_h |
| 33 | 33 |
| 34 #include "WebDragOperation.h" | 34 #include "WebDragOperation.h" |
| 35 #include "WebWidget.h" | 35 #include "WebWidget.h" |
| 36 | 36 |
| 37 namespace WebKit { | 37 namespace WebKit { |
| 38 class WebDragData; | 38 class WebDragData; |
| 39 class WebFrame; | 39 class WebFrame; |
| 40 class WebFrameClient; | |
| 41 class WebSettings; | 40 class WebSettings; |
| 42 class WebString; | 41 class WebString; |
| 43 class WebViewClient; | 42 class WebViewClient; |
| 44 struct WebPoint; | 43 struct WebPoint; |
| 45 | 44 |
| 46 class WebView : public WebWidget { | 45 class WebView : public WebWidget { |
| 47 public: | 46 public: |
| 48 // Initialization ------------------------------------------------------ | 47 WEBKIT_API WebView* create(WebViewClient*); |
| 49 | |
| 50 // FIXME enable this once WebViewDelegate has been eliminated. | |
| 51 //WEBKIT_API WebView* create(WebViewClient*); | |
| 52 | |
| 53 // After creating a WebView, you should immediately call this method. | |
| 54 // You can optionally modify the settings before calling this method. | |
| 55 // The WebFrameClient will receive events for the main frame and any | |
| 56 // child frames. | |
| 57 virtual void initializeMainFrame(WebFrameClient*) = 0; | |
| 58 | 48 |
| 59 | 49 |
| 60 // Options ------------------------------------------------------------- | 50 // Options ------------------------------------------------------------- |
| 61 | 51 |
| 62 // The returned pointer is valid for the lifetime of the WebView. | 52 // The returned pointer is valid for the lifetime of the WebView. |
| 63 virtual WebSettings* settings() = 0; | 53 virtual WebSettings* settings() = 0; |
| 64 | 54 |
| 65 // Corresponds to the encoding of the main frame. Setting the page | 55 // Corresponds to the encoding of the main frame. Setting the page |
| 66 // encoding may cause the main frame to reload. | 56 // encoding may cause the main frame to reload. |
| 67 virtual WebString pageEncoding() const = 0; | 57 virtual WebString pageEncoding() const = 0; |
| 68 virtual void setPageEncoding(const WebString&) = 0; | 58 virtual void setPageEncoding(const WebString&) = 0; |
| 69 | 59 |
| 70 // Makes the WebView transparent. This is useful if you want to have | |
| 71 // some custom background rendered behind it. | |
| 72 virtual bool isTransparent() const = 0; | |
| 73 virtual void setIsTransparent(bool) = 0; | |
| 74 | |
| 75 // Controls whether pressing Tab key advances focus to links. | |
| 76 virtual bool tabsToLinks() const = 0; | |
| 77 virtual void setTabsToLinks(bool) = 0; | |
| 78 | |
| 79 // Method that controls whether pressing Tab key cycles through page | |
| 80 // elements or inserts a '\t' char in the focused text area. | |
| 81 virtual bool tabKeyCyclesThroughElements() const = 0; | |
| 82 virtual void setTabKeyCyclesThroughElements(bool) = 0; | |
| 83 | |
| 84 // Controls the WebView's active state, which may affect the rendering | |
| 85 // of elements on the page (i.e., tinting of input elements). | |
| 86 virtual bool isActive() const = 0; | |
| 87 virtual void setIsActive(bool) = 0; | |
| 88 | |
| 89 | 60 |
| 90 // Closing ------------------------------------------------------------- | 61 // Closing ------------------------------------------------------------- |
| 91 | 62 |
| 92 // Runs beforeunload handlers for the current page, returning false if | 63 // Runs beforeunload handlers for the current page, returning false if |
| 93 // any handler suppressed unloading. | 64 // any handler suppressed unloading. |
| 94 virtual bool dispatchBeforeUnloadEvent() = 0; | 65 virtual bool dispatchBeforeUnloadEvent() = 0; |
| 95 | 66 |
| 96 // Runs unload handlers for the current page. | 67 // Runs unload handlers for the current page. |
| 97 virtual void dispatchUnloadEvent() = 0; | 68 virtual void dispatchUnloadEvent() = 0; |
| 98 | 69 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 WebDragOperationsMask operationsAllowed) = 0; | 139 WebDragOperationsMask operationsAllowed) = 0; |
| 169 virtual WebDragOperation dragTargetDragOver( | 140 virtual WebDragOperation dragTargetDragOver( |
| 170 const WebPoint& clientPoint, const WebPoint& screenPoint, | 141 const WebPoint& clientPoint, const WebPoint& screenPoint, |
| 171 WebDragOperationsMask operationsAllowed) = 0; | 142 WebDragOperationsMask operationsAllowed) = 0; |
| 172 virtual void dragTargetDragLeave() = 0; | 143 virtual void dragTargetDragLeave() = 0; |
| 173 virtual void dragTargetDrop( | 144 virtual void dragTargetDrop( |
| 174 const WebPoint& clientPoint, const WebPoint& screenPoint) = 0; | 145 const WebPoint& clientPoint, const WebPoint& screenPoint) = 0; |
| 175 | 146 |
| 176 virtual int dragIdentity() = 0; | 147 virtual int dragIdentity() = 0; |
| 177 | 148 |
| 178 // Helper method for drag and drop target operations: override the | |
| 179 // default drop effect with either a "copy" (accept true) or "none" | |
| 180 // (accept false) effect. Return true on success. | |
| 181 virtual bool setDropEffect(bool accept) = 0; | |
| 182 | |
| 183 | 149 |
| 184 // Developer tools ----------------------------------------------------- | 150 // Developer tools ----------------------------------------------------- |
| 185 | 151 |
| 186 // Inspect a particular point in the WebView. (x = -1 || y = -1) is a | 152 // Inspect a particular point in the WebView. (x = -1 || y = -1) is a |
| 187 // special case, meaning inspect the current page and not a specific | 153 // special case, meaning inspect the current page and not a specific |
| 188 // point. | 154 // point. |
| 189 virtual void inspectElementAt(const WebPoint&) = 0; | 155 virtual void inspectElementAt(const WebPoint&) = 0; |
| 190 | 156 |
| 191 | 157 |
| 192 // FIXME what about: | 158 // FIXME what about: |
| 193 // StoreFocusForFrame | 159 // StoreFocusForFrame |
| 194 // DownloadImage | 160 // DownloadImage |
| 195 // Get/SetDelegate | 161 // Get/SetDelegate |
| 196 // InsertText -> should move to WebTextInput | 162 // InsertText -> should move to WebTextInput |
| 197 // AutofillSuggestionsForNode | 163 // AutofillSuggestionsForNode |
| 198 // HideAutofillPopup | 164 // HideAutofillPopup |
| 199 | 165 |
| 200 protected: | 166 protected: |
| 201 ~WebView() {} | 167 ~WebView() {} |
| 202 }; | 168 }; |
| 203 | 169 |
| 204 } // namespace WebKit | 170 } // namespace WebKit |
| 205 | 171 |
| 206 #endif | 172 #endif |
| OLD | NEW |