#ifdef __OBJC__
@class NSArray;
-@class NSAttributedString;
@class NSDictionary;
@class NSEvent;
-@class NSFileWrapper;
@class NSFont;
@class NSImage;
@class NSMenu;
#else
class NSArray;
-class NSAttributedString;
class NSDictionary;
class NSEvent;
-class NSFileWrapper;
class NSFont;
class NSImage;
class NSMenu;
SelectingPrevious
};
-class FrameMac : public Frame
-{
+class FrameMac : public Frame {
+ friend class Frame;
+
public:
FrameMac(Page*, Element*, PassRefPtr<EditorClient>);
~FrameMac();
- // FIXME: Merge these and move them into FrameLoader.
- virtual void urlSelected(const FrameLoadRequest&, Event*);
- virtual Frame* createFrame(const KURL&, const String& name, Element* ownerElement, const String& referrer);
- virtual void submitForm(const FrameLoadRequest&, Event*);
-
- virtual Plugin* createPlugin(Element*, const KURL&,
- const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType);
+ void setBridge(WebCoreFrameBridge*);
+ WebCoreFrameBridge* bridge() const { return _bridge; }
- virtual void clear(bool clearWindowProperties = true);
+private:
+ WebCoreFrameBridge* _bridge;
- void setBridge(WebCoreFrameBridge* p);
- WebCoreFrameBridge* bridge() const { return _bridge; }
+// === undecided, may or may not belong here
+public:
virtual void setView(FrameView*);
- virtual void frameDetached();
+
+ static WebCoreFrameBridge* bridgeForWidget(const Widget*);
- void advanceToNextMisspelling(bool startBeforeSelection = false);
+ NSString* searchForLabelsAboveCell(RegularExpression*, HTMLTableCellElement*);
+ NSString* searchForLabelsBeforeElement(NSArray* labels, Element*);
+ NSString* matchLabelsAgainstElement(NSArray* labels, Element*);
+
+ virtual KJS::Bindings::Instance* getEmbedInstanceForWidget(Widget*);
+ virtual KJS::Bindings::Instance* getObjectInstanceForWidget(Widget*);
+ virtual KJS::Bindings::Instance* getAppletInstanceForWidget(Widget*);
+ virtual KJS::Bindings::RootObject* bindingRootObject();
+
+ void addPluginRootObject(KJS::Bindings::RootObject*);
- virtual void setTitle(const String&);
- virtual void setStatusBarText(const String&);
+ KJS::Bindings::RootObject* executionContextForDOM();
+
+ WebScriptObject* windowScriptObject();
+ NPObject* windowScriptNPObject();
+
+ NSMutableDictionary* dashboardRegionsDictionary();
+ void dashboardRegionsChanged();
- virtual ObjectContentType objectContentType(const KURL& url, const String& mimeType);
- virtual void redirectDataToPlugin(Widget* pluginWidget);
+ void willPopupMenu(NSMenu *);
- virtual void scheduleClose();
+private:
+ KJS::Bindings::RootObject* _bindingRoot; // The root object used for objects bound outside the context of a plugin.
+ Vector<KJS::Bindings::RootObject*> m_rootObjects;
+ WebScriptObject* _windowScriptObject;
+ NPObject* _windowScriptNPObject;
+
+// === to be moved into Chrome
+
+public:
+ virtual void setStatusBarText(const String&);
virtual void focusWindow();
virtual void unfocusWindow();
- virtual void saveDocumentState();
- virtual void restoreDocumentState();
-
- virtual void addMessageToConsole(const String& message, unsigned int lineNumber, const String& sourceID);
-
- NSView* nextKeyView(Node* startingPoint, SelectionDirection);
- NSView* nextKeyViewInFrameHierarchy(Node* startingPoint, SelectionDirection);
- static NSView* nextKeyViewForWidget(Widget* startingPoint, SelectionDirection);
- static bool currentEventIsKeyboardOptionTab();
- static bool handleKeyboardOptionTabInView(NSView* view);
-
- virtual bool tabsToLinks() const;
- virtual bool tabsToAllControls() const;
-
- static bool currentEventIsMouseDownInWidget(Widget* candidate);
+ virtual void addMessageToConsole(const String& message, unsigned int lineNumber, const String& sourceID);
virtual void runJavaScriptAlert(const String&);
virtual bool runJavaScriptConfirm(const String&);
virtual bool statusbarVisible();
virtual bool toolbarVisible();
- bool shouldClose();
-
- virtual void createEmptyDocument();
-
- static WebCoreFrameBridge* bridgeForWidget(const Widget*);
-
- virtual String userAgent() const;
+ FloatRect customHighlightLineRect(const AtomicString& type, const FloatRect& lineRect);
+ void paintCustomHighlight(const AtomicString& type, const FloatRect& boxRect, const FloatRect& lineRect, bool text, bool line);
- virtual String mimeTypeForFileName(const String&) const;
+ virtual void print();
- NSImage* selectionImage(bool forceWhiteText = false) const;
- NSImage* snapshotDragImage(Node* node, NSRect* imageRect, NSRect* elementRect) const;
+// === to be moved into Editor
- bool dispatchDragSrcEvent(const AtomicString &eventType, const PlatformMouseEvent&) const;
+public:
+ void advanceToNextMisspelling(bool startBeforeSelection = false);
NSFont* fontForSelection(bool* hasMultipleFonts) const;
NSDictionary* fontAttributesForSelectionStart() const;
virtual void markMisspellingsInAdjacentWords(const VisiblePosition&);
virtual void markMisspellings(const Selection&);
- void mouseDown(NSEvent*);
- void mouseDragged(NSEvent*);
- void mouseUp(NSEvent*);
- void mouseMoved(NSEvent*);
- bool keyEvent(NSEvent*);
- bool wheelEvent(NSEvent*);
-
- void sendFakeEventsAfterWidgetTracking(NSEvent* initiatingEvent);
-
- virtual bool lastEventIsMouseUp() const;
- void setActivationEventNumber(int num) { _activationEventNumber = num; }
-
- bool dragHysteresisExceeded(float dragLocationX, float dragLocationY) const;
- bool eventMayStartDrag(NSEvent*) const;
- void dragSourceMovedTo(const PlatformMouseEvent&);
- void dragSourceEndedAt(const PlatformMouseEvent&, NSDragOperation);
-
bool canDHTMLCut();
bool canDHTMLCopy();
bool canDHTMLPaste();
bool tryDHTMLCopy();
bool tryDHTMLPaste();
- bool sendContextMenuEvent(NSEvent*);
-
- bool passWidgetMouseDownEventToWidget(const MouseEventWithHitTestResults&);
- bool passWidgetMouseDownEventToWidget(RenderWidget*);
- bool passMouseDownEventToWidget(Widget*);
- bool passSubframeEventToSubframe(MouseEventWithHitTestResults&, Frame* subframePart);
- bool passWheelEventToWidget(Widget*);
-
- NSString* searchForLabelsAboveCell(RegularExpression*, HTMLTableCellElement*);
- NSString* searchForLabelsBeforeElement(NSArray* labels, Element* element);
- NSString* matchLabelsAgainstElement(NSArray* labels, Element* element);
-
- virtual void tokenizerProcessedData();
-
- virtual String overrideMediaType() const;
-
- WebCoreKeyboardUIMode keyboardUIMode() const;
-
- void didTellBridgeAboutLoad(const String& URL);
- bool haveToldBridgeAboutLoad(const String& URL);
-
- virtual KJS::Bindings::Instance* getEmbedInstanceForWidget(Widget*);
- virtual KJS::Bindings::Instance* getObjectInstanceForWidget(Widget*);
- virtual KJS::Bindings::Instance* getAppletInstanceForWidget(Widget*);
- virtual KJS::Bindings::RootObject* bindingRootObject();
- virtual Widget* createJavaAppletWidget(const IntSize&, Element*, const HashMap<String, String>& args);
-
- void addPluginRootObject(KJS::Bindings::RootObject* root);
-
virtual void registerCommandForUndo(PassRefPtr<EditCommand>);
virtual void registerCommandForRedo(PassRefPtr<EditCommand>);
virtual void clearUndoRedoOperations();
virtual void didBeginEditing() const;
virtual void didEndEditing() const;
- virtual void textFieldDidBeginEditing(Element*);
- virtual void textFieldDidEndEditing(Element*);
- virtual void textDidChangeInTextField(Element*);
- virtual bool doTextFieldCommandFromEvent(Element*, const PlatformKeyboardEvent*);
- virtual void textWillBeDeletedInTextField(Element*);
- virtual void textDidChangeInTextArea(Element*);
-
- virtual bool inputManagerHasMarkedText() const;
-
virtual void setSecureKeyboardEntry(bool);
virtual bool isSecureKeyboardEntry();
- KJS::Bindings::RootObject* executionContextForDOM();
+ void setMarkedTextRange(const Range* , NSArray* attributes, NSArray* ranges);
+ virtual Range* markedTextRange() const { return m_markedTextRange.get(); }
+
+private:
+ bool dispatchCPPEvent(const AtomicString &eventType, ClipboardAccessPolicy policy);
+
+ void freeClipboard();
+
+ void registerCommandForUndoOrRedo(PassRefPtr<EditCommand>, bool isRedo);
+
+ bool _haveUndoRedoOperations;
+ RefPtr<Range> m_markedTextRange;
- WebScriptObject* windowScriptObject();
- NPObject* windowScriptNPObject();
+// === to be moved into EventHandler
+
+public:
+ NSView* nextKeyView(Node* startingPoint, SelectionDirection);
+ NSView* nextKeyViewInFrameHierarchy(Node* startingPoint, SelectionDirection);
+ static NSView* nextKeyViewForWidget(Widget* startingPoint, SelectionDirection);
+ static bool currentEventIsKeyboardOptionTab();
+ static bool handleKeyboardOptionTabInView(NSView* view);
- virtual void partClearedInBegin();
+ virtual bool tabsToLinks() const;
+ virtual bool tabsToAllControls() const;
- // Implementation of CSS property -webkit-user-drag == auto
- virtual bool shouldDragAutoNode(Node*, const IntPoint&) const;
+ static bool currentEventIsMouseDownInWidget(Widget* candidate);
- void setMarkedTextRange(const Range* , NSArray* attributes, NSArray* ranges);
- virtual Range* markedTextRange() const { return m_markedTextRange.get(); }
+ NSImage* selectionImage(bool forceWhiteText = false) const;
+ NSImage* snapshotDragImage(Node* node, NSRect* imageRect, NSRect* elementRect) const;
- virtual void didFirstLayout();
-
- NSMutableDictionary* dashboardRegionsDictionary();
- void dashboardRegionsChanged();
+ bool dispatchDragSrcEvent(const AtomicString &eventType, const PlatformMouseEvent&) const;
- void willPopupMenu(NSMenu *);
+ void mouseDown(NSEvent*);
+ void mouseDragged(NSEvent*);
+ void mouseUp(NSEvent*);
+ void mouseMoved(NSEvent*);
+ bool keyEvent(NSEvent*);
+ bool wheelEvent(NSEvent*);
+
+ void sendFakeEventsAfterWidgetTracking(NSEvent* initiatingEvent);
+
+ virtual bool lastEventIsMouseUp() const;
+ void setActivationEventNumber(int num) { _activationEventNumber = num; }
+
+ bool dragHysteresisExceeded(float dragLocationX, float dragLocationY) const;
+ bool eventMayStartDrag(NSEvent*) const;
+ void dragSourceMovedTo(const PlatformMouseEvent&);
+ void dragSourceEndedAt(const PlatformMouseEvent&, NSDragOperation);
+
+ bool sendContextMenuEvent(NSEvent*);
+
+ bool passWidgetMouseDownEventToWidget(const MouseEventWithHitTestResults&);
+ bool passWidgetMouseDownEventToWidget(RenderWidget*);
+ bool passMouseDownEventToWidget(Widget*);
+ bool passSubframeEventToSubframe(MouseEventWithHitTestResults&, Frame* subframePart);
+ bool passWheelEventToWidget(Widget*);
- virtual bool isCharacterSmartReplaceExempt(UChar, bool);
+ WebCoreKeyboardUIMode keyboardUIMode() const;
+
+ virtual void textFieldDidBeginEditing(Element*);
+ virtual void textFieldDidEndEditing(Element*);
+ virtual void textDidChangeInTextField(Element*);
+ virtual bool doTextFieldCommandFromEvent(Element*, const PlatformKeyboardEvent*);
+ virtual void textWillBeDeletedInTextField(Element*);
+ virtual void textDidChangeInTextArea(Element*);
- virtual bool mouseDownMayStartSelect() const { return _mouseDownMayStartSelect; }
+ virtual bool inputManagerHasMarkedText() const;
- virtual void handledOnloadEvents();
+ // Implementation of CSS property -webkit-user-drag == auto
+ virtual bool shouldDragAutoNode(Node*, const IntPoint&) const;
virtual bool canRedo() const;
virtual bool canUndo() const;
- virtual void print();
- FloatRect customHighlightLineRect(const AtomicString& type, const FloatRect& lineRect);
- void paintCustomHighlight(const AtomicString& type, const FloatRect& boxRect, const FloatRect& lineRect, bool text, bool line);
+ virtual bool mouseDownMayStartSelect() const { return _mouseDownMayStartSelect; }
NSEvent* currentEvent() { return _currentEvent; }
- virtual KURL originalRequestURL() const;
-
- virtual bool canGoBackOrForward(int distance) const;
- virtual void goBackOrForward(int distance);
- virtual int getHistoryLength();
- virtual KURL historyURL(int distance);
-protected:
- virtual void startRedirectionTimer();
- virtual void stopRedirectionTimer();
- virtual void cleanupPluginObjects();
- virtual bool isLoadTypeReload();
-
private:
virtual void handleMousePressEvent(const MouseEventWithHitTestResults&);
virtual void handleMouseMoveEvent(const MouseEventWithHitTestResults&);
NSView* nextKeyViewInFrame(Node* startingPoint, SelectionDirection, bool* focusCallResultedInViewBeingCreated = 0);
static NSView* documentViewForNode(Node*);
-
- bool dispatchCPPEvent(const AtomicString &eventType, ClipboardAccessPolicy policy);
NSImage* imageFromRect(NSRect) const;
- void freeClipboard();
-
- void registerCommandForUndoOrRedo(PassRefPtr<EditCommand>, bool isRedo);
-
- WebCoreFrameBridge* _bridge;
-
NSView* _mouseDownView;
bool _mouseDownWasInSubframe;
bool _sendingEventToSubview;
static NSEvent* _currentEvent;
- bool _haveUndoRedoOperations;
+// === to be moved into FrameLoader
+
+public:
+ virtual void urlSelected(const FrameLoadRequest&, Event*);
+ virtual Frame* createFrame(const KURL&, const String& name, Element* ownerElement, const String& referrer);
+ virtual void submitForm(const FrameLoadRequest&, Event*);
+
+ virtual Plugin* createPlugin(Element*, const KURL&,
+ const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType);
+
+ virtual void clear(bool clearWindowProperties = true);
+
+ virtual void frameDetached();
+
+ virtual void setTitle(const String&);
+
+ virtual void scheduleClose();
+
+ virtual ObjectContentType objectContentType(const KURL& url, const String& mimeType);
+ virtual void redirectDataToPlugin(Widget* pluginWidget);
+
+ virtual void saveDocumentState();
+ virtual void restoreDocumentState();
- HashSet<String> urlsBridgeKnowsAbout;
+ bool shouldClose();
- friend class Frame;
+ virtual void createEmptyDocument();
- KJS::Bindings::RootObject* _bindingRoot; // The root object used for objects
- // bound outside the context of a plugin.
- Vector<KJS::Bindings::RootObject*> m_rootObjects;
- WebScriptObject* _windowScriptObject;
- NPObject* _windowScriptNPObject;
+ virtual String userAgent() const;
- RefPtr<Range> m_markedTextRange;
+ virtual void tokenizerProcessedData();
+
+ virtual String overrideMediaType() const;
+
+ void didTellBridgeAboutLoad(const String& URL);
+ bool haveToldBridgeAboutLoad(const String& URL);
+
+ virtual Widget* createJavaAppletWidget(const IntSize&, Element*, const HashMap<String, String>& args);
+
+ virtual void partClearedInBegin();
+
+ virtual void didFirstLayout();
+
+ virtual void handledOnloadEvents();
+
+ virtual KURL originalRequestURL() const;
+
+ virtual bool canGoBackOrForward(int distance) const;
+ virtual void goBackOrForward(int distance);
+ virtual int getHistoryLength();
+ virtual KURL historyURL(int distance);
+
+private:
+ virtual void startRedirectionTimer();
+ virtual void stopRedirectionTimer();
+ virtual void cleanupPluginObjects();
+ virtual bool isLoadTypeReload();
+
+ HashSet<String> urlsBridgeKnowsAbout;
+
+// === to be moved into the Platform directory
+
+public:
+ virtual String mimeTypeForFileName(const String&) const;
+ virtual bool isCharacterSmartReplaceExempt(UChar, bool);
+
};
inline FrameMac* Mac(Frame* frame) { return static_cast<FrameMac*>(frame); }
-// -*- c-basic-offset: 2 -*-
+// -*- c-basic-offset: 4 -*-
/* This file is part of the KDE project
*
* Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
#include "Color.h"
#include "EditAction.h"
-#include "FrameView.h"
-#include "KURL.h"
-#include "Node.h"
#include "RenderLayer.h"
-#include "ScrollBar.h"
#include "TextAffinity.h"
#include "TextGranularity.h"
+#include "UChar.h"
+#include <wtf/Forward.h>
#include <wtf/Vector.h>
namespace KJS {
namespace WebCore {
-class CommandByName;
class CSSComputedStyleDeclaration;
class CSSMutableStyleDeclaration;
class CSSStyleDeclaration;
-class DrawContentsEvent;
+class CommandByName;
class DOMWindow;
+class Document;
+class DrawContentsEvent;
class EditCommand;
class Editor;
class EditorClient;
+class Element;
+class FloatRect;
class FormData;
-class FramePrivate;
class FrameLoader;
+class FramePrivate;
class FrameTree;
+class FrameView;
+class GraphicsContext;
+class HTMLFormElement;
+class HitTestResult;
+class IntRect;
class KJSProxy;
+class KURL;
+class MouseEventWithHitTestResults;
+class Node;
class Page;
+class PlatformKeyboardEvent;
class Plugin;
-class MouseEventWithHitTestResults;
-class HitTestResult;
class Range;
class RenderLayer;
class RenderObject;
+class RenderPart;
+class RenderStyle;
+class RenderWidget;
class ResourceRequest;
class Selection;
class SelectionController;
class Settings;
class VisiblePosition;
+class Widget;
struct FrameLoadRequest;
class Frame : public Shared<Frame> {
public:
- enum { NoXPosForVerticalArrowNavigation = INT_MIN };
+ Frame(Page*, Element*, PassRefPtr<EditorClient>);
+ void pageDestroyed();
+ virtual ~Frame();
+
+ virtual void setView(FrameView*);
+
+ Page* page() const;
+ Document* document() const;
+ FrameView* view() const;
+ RenderObject* renderer() const; // root renderer for the document contained in this frame
+
+ Element* ownerElement();
+ RenderPart* ownerRenderer(); // renderer for the element that contains this frame
+
+ FrameTree* tree() const;
+ SelectionController* selectionController() const;
+ DOMWindow* domWindow() const;
+ Editor* editor() const;
+ CommandByName* command() const;
+ FrameLoader* loader() const;
+ const Settings* settings() const;
+
+ friend class FrameGdk;
+ friend class FrameLoader;
+ friend class FrameMac;
+ friend class FramePrivate;
+ friend class FrameQt;
+ friend class FrameWin;
- Frame(Page*, Element*, PassRefPtr<EditorClient>);
- virtual ~Frame();
+private:
+ FramePrivate* d;
- // FIXME: Merge these methods and move them into FrameLoader.
- void changeLocation(const DeprecatedString& URL, const String& referrer, bool lockHistory = true, bool userGesture = false);
- void urlSelected(const ResourceRequest&, const String& target, Event*, bool lockHistory = false);
- virtual void urlSelected(const FrameLoadRequest&, Event*) = 0;
-
- bool requestFrame(Element* ownerElement, const String& url, const AtomicString& frameName);
- virtual Frame* createFrame(const KURL& url, const String& name, Element* ownerElement, const String& referrer) = 0;
- Frame* loadSubframe(Element* ownerElement, const KURL& url, const String& name, const String& referrer);
+// === undecided, may or may not belong here
+
+public:
+ bool javaScriptEnabled() const;
+ bool javaEnabled() const;
+ bool pluginsEnabled() const;
+
+ void paint(GraphicsContext*, const IntRect&);
+
+ void setUserStyleSheetLocation(const KURL&);
+ void setUserStyleSheet(const String& styleSheetData);
+
+ void setStandardFont(const String& name);
+ void setFixedFont(const String& name);
+
+ void setZoomFactor(int percent);
+ int zoomFactor() const;
+
+ bool inViewSourceMode() const;
+ void setInViewSourceMode(bool = true) const;
- void submitForm(const char* action, const String& URL, const FormData&, const String& target, const String& contentType, const String& boundary, Event*);
- void submitFormAgain();
- virtual void submitForm(const FrameLoadRequest&, Event*) = 0;
+ void setJSStatusBarText(const String&);
+ void setJSDefaultStatusBarText(const String&);
+ String jsStatusBarText() const;
+ String jsDefaultStatusBarText() const;
+
+ virtual void setupRootForPrinting(bool onOrOff) { }
+ virtual Vector<IntRect> computePageRects(const IntRect& printRect, float userScaleFactor) { return Vector<IntRect>(); }
+
+ void keepAlive(); // Used to keep the frame alive when running a script that might destroy it.
+ static void endAllLifeSupport();
+
+ virtual KJS::Bindings::Instance* getEmbedInstanceForWidget(Widget*) = 0;
+ virtual KJS::Bindings::Instance* getObjectInstanceForWidget(Widget*) = 0;
+ virtual KJS::Bindings::Instance* getAppletInstanceForWidget(Widget*) = 0;
+ virtual KJS::Bindings::RootObject* bindingRootObject() = 0;
+
+ void setDocument(Document*);
+
+ KJSProxy* scriptProxy();
+
+ void setSettings(Settings*);
+
+ bool isFrameSet() const;
+
+ bool scrollOverflow(ScrollDirection, ScrollGranularity);
+
+ void adjustPageHeight(float* newBottom, float oldTop, float oldBottom, float bottomLimit);
+
+ static void clearDocumentFocus(Widget*);
+
+ void forceLayout();
+ void forceLayoutWithPageWidthRange(float minPageWidth, float maxPageWidth);
+
+ void sendResizeEvent();
+ void sendScrollEvent();
+ bool scrollbarsVisible();
+ bool canMouseDownStartSelect(Node*);
+
+ void clearTimers();
+ static void clearTimers(FrameView*);
+
+ bool isActive() const;
+ virtual void setIsActive(bool flag);
+ void setWindowHasFocus(bool flag);
+
+ // Convenience, to avoid repeating the code to dig down to get this.
+ UChar backslashAsCurrencySymbol() const;
+
+ void setNeedsReapplyStyles();
+ String documentTypeString() const;
+
+protected:
+ virtual void cleanupPluginObjects() { }
- void stop();
- void stopLoading(bool sendUnload = false);
- virtual bool closeURL();
private:
- void cancelRedirection(bool newLoadInProgress = false);
+ void lifeSupportTimerFired(Timer<Frame>*);
+ void endLifeSupport();
+
+// === to be moved into Chrome
public:
- void didExplicitOpen();
+ virtual void addMessageToConsole(const String& message, unsigned int lineNumber, const String& sourceID) = 0;
+
+ virtual void runJavaScriptAlert(const String& message) = 0;
+ virtual bool runJavaScriptConfirm(const String& message) = 0;
+ virtual bool runJavaScriptPrompt(const String& message, const String& defaultValue, String& result) = 0;
+ virtual bool shouldInterruptJavaScript() = 0;
+ virtual bool locationbarVisible() = 0;
+ virtual bool menubarVisible() = 0;
+ virtual bool personalbarVisible() = 0;
+ virtual bool statusbarVisible() = 0;
+ virtual bool toolbarVisible() = 0;
+ virtual void scheduleClose() = 0;
+ virtual void focusWindow() = 0;
+ virtual void unfocusWindow() = 0;
+ virtual void print() = 0;
- KURL iconURL();
- void commitIconURLToIconDatabase();
-
- Page* page() const;
- void pageDestroyed();
-
- FrameView* view() const;
- virtual void setView(FrameView*);
-
- /**
- * Returns @p true if Javascript is enabled, @p false otherwise.
- */
- bool javaScriptEnabled() const;
-
- /**
- * Returns true if Java is enabled, false otherwise.
- */
- bool javaEnabled() const;
-
- /**
- * Returns true if plugins are enabled, false otherwise.
- */
- bool pluginsEnabled() const;
-
- /**
- * Execute the specified snippet of JavaScript code.
- */
- KJS::JSValue* executeScript(Node*, const String& script, bool forceUserGesture = false);
-
- /**
- * Implementation of CSS property -webkit-user-drag == auto
- */
- virtual bool shouldDragAutoNode(Node*, const IntPoint&) const;
-
- /**
- * Specifies whether images contained in the document should be loaded
- * automatically or not.
- *
- * @note Request will be ignored if called before @ref begin().
- */
- void setAutoLoadImages(bool enable);
- /**
- * Returns whether images contained in the document are loaded automatically
- * or not.
- * @note that the returned information is unreliable as long as no begin()
- * was called.
- */
- bool autoLoadImages() const;
-
- KURL baseURL() const;
- String baseTarget() const;
-
- /**
- * Schedules a redirection after @p delay seconds.
- */
- void scheduleRedirection(double delay, const DeprecatedString& url, bool lockHistory = true);
-
- /**
- * Make a location change, or schedule one for later.
- * These are used for JavaScript-triggered location changes.
- */
- void scheduleLocationChange(const DeprecatedString& url, const String& referrer, bool lockHistory = true, bool userGesture = false);
- void scheduleRefresh(bool userGesture = false);
- bool isScheduledLocationChangePending() const;
-
- /**
- * Schedules a history navigation operation (go forward, go back, etc.).
- * This is used for JavaScript-triggered location changes.
- */
- void scheduleHistoryNavigation(int steps);
-
- virtual bool canGoBackOrForward(int distance) const = 0;
- virtual void goBackOrForward(int distance) = 0;
- virtual int getHistoryLength() = 0;
- virtual KURL historyURL(int distance) = 0;
-
- /**
- * Clears the widget and prepares it for new content.
- *
- * If you want @ref url() to return
- * for example "file:/tmp/test.html", you can use the following code:
- * <PRE>
- * view->begin(KURL("file:/tmp/test.html"));
- * </PRE>
- *
- * @param url is the url of the document to be displayed. Even if you
- * are generating the HTML on the fly, it may be useful to specify
- * a directory so that any images are found.
- *
- * All child frames and the old document are removed if you call
- * this method.
- */
- virtual void begin(const KURL& url = KURL());
-
- /**
- * Writes another part of the HTML code to the widget.
- *
- * You may call
- * this function many times in sequence. But remember: The fewer calls
- * you make, the faster the widget will be.
- *
- * The HTML code is sent through a decoder which decodes the stream to
- * Unicode.
- *
- * The @p len parameter is needed for streams encoded in utf-16,
- * since these can have \0 chars in them. In case the encoding
- * you're using isn't utf-16, you can safely leave out the length
- * parameter.
- *
- * Attention: Don't mix calls to @ref write(const char*) with calls
- * to @ref write(const String&).
- *
- * The result might not be what you want.
- */
- virtual void write(const char* str, int len = -1);
-
- /**
- * Writes another part of the HTML code to the widget.
- *
- * You may call
- * this function many times in sequence. But remember: The fewer calls
- * you make, the faster the widget will be.
- */
- virtual void write(const String&);
-
- /**
- * Call this after your last call to @ref write().
- */
- virtual void end();
-
- void endIfNotLoading();
-
- void paint(GraphicsContext*, const IntRect&);
-
- void setEncoding(const String& encoding, bool userChosen);
- String encoding() const;
-
- /**
- * Sets a user defined style sheet to be used on top of the HTML4,
- * SVG and printing default style sheets.
- */
- void setUserStyleSheetLocation(const KURL&);
- void setUserStyleSheet(const String& styleSheetData);
-
- /**
- * Sets the standard font style.
- *
- * @param name The font name to use for standard text.
- */
- void setStandardFont(const String& name);
-
- /**
- * Sets the fixed font style.
- *
- * @param name The font name to use for fixed text, e.g.
- * the <tt><pre></tt> tag.
- */
- void setFixedFont(const String& name);
-
- /**
- * Finds the anchor named @p name.
- *
- * If the anchor is found, the widget
- * scrolls to the closest position. Returns @p if the anchor has
- * been found.
- */
- bool gotoAnchor(const String& name);
-
- /**
- * Sets the Zoom factor. The value is given in percent, larger values mean a
- * generally larger font and larger page contents. It is not guaranteed that
- * all parts of the page are scaled with the same factor though.
- *
- * The given value should be in the range of 20..300, values outside that
- * range are not guaranteed to work. A value of 100 will disable all zooming
- * and show the page with the sizes determined via the given lengths in the
- * stylesheets.
- */
- void setZoomFactor(int percent);
-
- /**
- * Returns the current zoom factor.
- */
- int zoomFactor() const;
-
- /**
- * Returns the text the user has marked.
- */
- virtual String selectedText() const;
-
- bool findString(const String&, bool, bool, bool);
+private:
+ virtual void setStatusBarText(const String&);
- /**
- * Returns the granularity of the selection (character, word, line, paragraph).
- */
- TextGranularity selectionGranularity() const;
-
- /**
- * Sets the granularity of the selection (character, word, line, paragraph).
- */
- void setSelectionGranularity(TextGranularity granularity) const;
-
- // FIXME: Replace these with functions on the selection controller.
- bool shouldChangeSelection(const Selection&) const;
- virtual bool shouldDeleteSelection(const Selection&) const;
- void clearCaretRectIfNeeded();
- void setFocusNodeIfNeeded();
- void selectionLayoutChanged();
- void notifyRendererOfSelectionChange(bool userTriggered);
-
- /**
- * Returns a mark, to be used as emacs uses it.
- */
- const Selection& mark() const;
- void setMark(const Selection&);
-
- /**
- * Transposes characters either side of caret selection.
- */
- void transpose();
-
- /**
- * Invalidates the current selection.
- */
- void invalidateSelection();
-
- void setCaretVisible(bool flag = true);
- void paintCaret(GraphicsContext*, const IntRect&) const;
- void paintDragCaret(GraphicsContext*, const IntRect&) const;
-
- /**
- * Set info for vertical arrow navigation.
- */
- void setXPosForVerticalArrowNavigation(int x);
-
- /**
- * Get info for vertical arrow navigation.
- */
- int xPosForVerticalArrowNavigation() const;
-
- /**
- * Returns whether editing should end in the given range
- */
- virtual bool shouldBeginEditing(const Range*) const;
-
- /**
- * Returns whether editing should end in the given range
- */
- virtual bool shouldEndEditing(const Range*) const;
-
- /**
- * Called when editing has begun.
- */
- virtual void didBeginEditing() const {};
-
- /**
- * Called when editing has ended.
- */
- virtual void didEndEditing() const {};
-
- /**
- * Returns the contentEditable "override" value for the part
- */
- virtual bool isContentEditable() const;
-
- virtual void textFieldDidBeginEditing(Element*);
- virtual void textFieldDidEndEditing(Element*);
- virtual void textDidChangeInTextField(Element*);
- virtual bool doTextFieldCommandFromEvent(Element*, const PlatformKeyboardEvent*);
- virtual void textWillBeDeletedInTextField(Element* input);
- virtual void textDidChangeInTextArea(Element*);
-
- virtual bool inputManagerHasMarkedText() const { return false; }
-
- virtual void setSecureKeyboardEntry(bool) {};
- virtual bool isSecureKeyboardEntry() { return false; }
+// === to be moved into Editor
+
+public:
+ virtual String selectedText() const;
+ bool findString(const String&, bool, bool, bool);
+
+ const Selection& mark() const; // Mark, to be used as emacs uses it.
+ void setMark(const Selection&);
+
+ void transpose();
+
+ virtual bool shouldBeginEditing(const Range*) const;
+ virtual bool shouldEndEditing(const Range*) const;
+
+ virtual void didBeginEditing() const {}
+ virtual void didEndEditing() const {}
+
+ void copyToPasteboard();
+ void cutToPasteboard();
+ void pasteFromPasteboard();
+ void pasteAndMatchStyle();
+ void redo();
+ void undo();
+ virtual bool canRedo() const = 0;
+ virtual bool canUndo() const = 0;
+ void computeAndSetTypingStyle(CSSStyleDeclaration* , EditAction = EditActionUnspecified);
+ void applyStyle(CSSStyleDeclaration* , EditAction = EditActionUnspecified);
+ void applyParagraphStyle(CSSStyleDeclaration* , EditAction = EditActionUnspecified);
+ void indent();
+ void outdent();
+ enum TriState { falseTriState, trueTriState, mixedTriState };
+ TriState selectionHasStyle(CSSStyleDeclaration*) const;
+ bool selectionStartHasStyle(CSSStyleDeclaration*) const;
+ String selectionStartStylePropertyValue(int stylePropertyID) const;
+ void applyEditingStyleToBodyElement() const;
+ void removeEditingStyleFromBodyElement() const;
+ void applyEditingStyleToElement(Element*) const;
+ void removeEditingStyleFromElement(Element*) const;
+
+ virtual void markMisspellingsInAdjacentWords(const VisiblePosition&) = 0;
+ virtual void markMisspellings(const Selection&) = 0;
+ virtual Range* markedTextRange() const = 0;
+ virtual void registerCommandForUndo(PassRefPtr<EditCommand>) = 0;
+ virtual void registerCommandForRedo(PassRefPtr<EditCommand>) = 0;
+ virtual void clearUndoRedoOperations() = 0;
+ virtual void issueUndoCommand() = 0;
+ virtual void issueRedoCommand() = 0;
+ virtual void issueCutCommand() = 0;
+ virtual void issueCopyCommand() = 0;
+ virtual void issuePasteCommand() = 0;
+ virtual void issuePasteAndMatchStyleCommand() = 0;
+ virtual void issueTransposeCommand() = 0;
+ virtual void respondToChangedSelection(const Selection& oldSelection, bool closeTyping) = 0;
+ virtual void respondToChangedContents(const Selection& endingSelection) = 0;
+ virtual bool shouldChangeSelection(const Selection& oldSelection, const Selection& newSelection, EAffinity, bool stillSelecting) const = 0;
+
+ void caretBlinkTimerFired(Timer<Frame>*);
+
+ RenderStyle* styleForSelectionStart(Node* &nodeToRemove) const;
+
+ const Vector<MarkedTextUnderline>& markedTextUnderlines() const;
+ bool markedTextUsesUnderlines() const;
- /**
- * Called when editing has been applied.
- */
- void appliedEditing(PassRefPtr<EditCommand>);
-
- /**
- * Called when editing has been unapplied.
- */
- void unappliedEditing(PassRefPtr<EditCommand>);
-
- /**
- * Called when editing has been reapplied.
- */
- void reappliedEditing(PassRefPtr<EditCommand>);
-
- /**
- * Returns the typing style for the document.
- */
- CSSMutableStyleDeclaration* typingStyle() const;
-
- /**
- * Sets the typing style for the document.
- */
- void setTypingStyle(CSSMutableStyleDeclaration*);
-
- /**
- * Clears the typing style for the document.
- */
- void clearTypingStyle();
-
- virtual void tokenizerProcessedData() {}
-
- bool inViewSourceMode() const;
- void setInViewSourceMode(bool = true) const;
-
- const Settings* settings() const;
-
- void setJSStatusBarText(const String&);
- void setJSDefaultStatusBarText(const String&);
- String jsStatusBarText() const;
- String jsDefaultStatusBarText() const;
-
- /**
- * Referrer used for links in this page.
- */
- String referrer() const;
-
- /**
- * Last-modified date (in raw string format), if received in the [HTTP] headers.
- */
- String lastModified() const;
-
- virtual bool tabsToLinks() const;
- virtual bool tabsToAllControls() const;
-
- // Editing operations.
- enum TriState { falseTriState, trueTriState, mixedTriState };
- void copyToPasteboard();
- void cutToPasteboard();
- void pasteFromPasteboard();
- void pasteAndMatchStyle();
- void redo();
- void undo();
- virtual bool canRedo() const = 0;
- virtual bool canUndo() const = 0;
- void computeAndSetTypingStyle(CSSStyleDeclaration* , EditAction editingAction=EditActionUnspecified);
- void applyStyle(CSSStyleDeclaration* , EditAction editingAction=EditActionUnspecified);
- void applyParagraphStyle(CSSStyleDeclaration* , EditAction editingAction=EditActionUnspecified);
- void indent();
- void outdent();
- TriState selectionHasStyle(CSSStyleDeclaration*) const;
- bool selectionStartHasStyle(CSSStyleDeclaration*) const;
- String selectionStartStylePropertyValue(int stylePropertyID) const;
- void applyEditingStyleToBodyElement() const;
- void removeEditingStyleFromBodyElement() const;
- void applyEditingStyleToElement(Element*) const;
- void removeEditingStyleFromElement(Element*) const;
- virtual void print() = 0;
- virtual bool isCharacterSmartReplaceExempt(UChar, bool);
-
- // Used to keep the part alive when running a script that might destroy it.
- void keepAlive();
-
- static void endAllLifeSupport();
-
- /**
- * returns a KURL object for the given url. Use when
- * you know what you're doing.
- */
- KURL completeURL(const DeprecatedString& url);
-
- virtual void handleMousePressEvent(const MouseEventWithHitTestResults&);
- virtual void handleMouseMoveEvent(const MouseEventWithHitTestResults&);
- virtual void handleMouseReleaseEvent(const MouseEventWithHitTestResults&);
+ unsigned markAllMatchesForText(const String&, bool caseFlag, unsigned limit);
+ bool markedTextMatchesAreHighlighted() const;
+ void setMarkedTextMatchesAreHighlighted(bool flag);
- void updateSelectionForMouseDragOverPosition(const VisiblePosition&);
-
- void selectClosestWordFromMouseEvent(const PlatformMouseEvent&, Node* innerNode);
-
- // Methods with platform-specific overrides (and no base class implementation).
- virtual void setTitle(const String&) = 0;
- virtual void handledOnloadEvents() = 0;
- virtual String userAgent() const = 0;
- virtual String mimeTypeForFileName(const String&) const = 0;
- virtual KJS::Bindings::Instance* getEmbedInstanceForWidget(Widget*) = 0;
- virtual KJS::Bindings::Instance* getObjectInstanceForWidget(Widget*) = 0;
- virtual KJS::Bindings::Instance* getAppletInstanceForWidget(Widget*) = 0;
- virtual KJS::Bindings::RootObject* bindingRootObject() = 0;
- virtual Widget* createJavaAppletWidget(const IntSize&, Element*, const HashMap<String, String>& args) = 0;
+ CSSComputedStyleDeclaration* selectionComputedStyle(Node*& nodeToRemove) const;
+
+// === to be moved into EventHandler
+
+public:
+ virtual bool shouldDragAutoNode(Node*, const IntPoint&) const; // -webkit-user-drag == auto
+
+ virtual bool lastEventIsMouseUp() const = 0;
+
+ virtual bool tabsToLinks() const;
+ virtual bool tabsToAllControls() const;
+ virtual void handleMousePressEvent(const MouseEventWithHitTestResults&);
+ virtual void handleMouseMoveEvent(const MouseEventWithHitTestResults&);
+ virtual void handleMouseReleaseEvent(const MouseEventWithHitTestResults&);
+
+ void updateSelectionForMouseDragOverPosition(const VisiblePosition&);
+
+ void selectClosestWordFromMouseEvent(const PlatformMouseEvent&, Node* innerNode);
+
+ virtual bool mouseDownMayStartSelect() const { return true; }
+ bool mouseDownMayStartAutoscroll() const;
+ void setMouseDownMayStartAutoscroll(bool b);
+
+ bool mouseDownMayStartDrag() const;
+ void setMouseDownMayStartDrag(bool b);
+
+ static Frame* frameForWidget(const Widget*);
+ static Node* nodeForWidget(const Widget*);
+ static Frame* frameForNode(Node*);
+
+ // Call this method before handling a new user action, like on a mouse down or key down.
+ // Currently, all this does is clear the "don't submit form twice" data member.
+ void prepareForUserAction();
+ Node* mousePressNode();
+
+ void stopAutoscrollTimer(bool rendererIsBeingDestroyed = false);
+ RenderObject* autoscrollRenderer() const;
+
+ HitTestResult hitTestResultAtPoint(const IntPoint&, bool allowShadowContent);
+
+ bool prohibitsScrolling() const;
+ void setProhibitsScrolling(const bool);
- virtual void markMisspellingsInAdjacentWords(const VisiblePosition&) = 0;
- virtual void markMisspellings(const Selection&) = 0;
- virtual void addMessageToConsole(const String& message, unsigned int lineNumber, const String& sourceID) = 0;
- virtual void runJavaScriptAlert(const String& message) = 0;
- virtual bool runJavaScriptConfirm(const String& message) = 0;
- virtual bool runJavaScriptPrompt(const String& message, const String& defaultValue, String& result) = 0;
- virtual bool shouldInterruptJavaScript() = 0;
- virtual bool locationbarVisible() = 0;
- virtual bool menubarVisible() = 0;
- virtual bool personalbarVisible() = 0;
- virtual bool statusbarVisible() = 0;
- virtual bool toolbarVisible() = 0;
- virtual void scheduleClose() = 0;
- virtual void focusWindow() = 0;
- virtual void unfocusWindow() = 0;
- virtual void createEmptyDocument() = 0;
- virtual Range* markedTextRange() const = 0;
- virtual void registerCommandForUndo(PassRefPtr<EditCommand>) = 0;
- virtual void registerCommandForRedo(PassRefPtr<EditCommand>) = 0;
- virtual void clearUndoRedoOperations() = 0;
- virtual void issueUndoCommand() = 0;
- virtual void issueRedoCommand() = 0;
- virtual void issueCutCommand() = 0;
- virtual void issueCopyCommand() = 0;
- virtual void issuePasteCommand() = 0;
- virtual void issuePasteAndMatchStyleCommand() = 0;
- virtual void issueTransposeCommand() = 0;
- virtual void respondToChangedSelection(const Selection& oldSelection, bool closeTyping) = 0;
- virtual void respondToChangedContents(const Selection& endingSelection) = 0;
- virtual bool shouldChangeSelection(const Selection& oldSelection, const Selection& newSelection, EAffinity affinity, bool stillSelecting) const = 0;
- virtual void partClearedInBegin() = 0;
- virtual void saveDocumentState() = 0;
- virtual void restoreDocumentState() = 0;
- virtual bool lastEventIsMouseUp() const = 0;
- virtual String overrideMediaType() const = 0;
- virtual void redirectDataToPlugin(Widget* pluginWidget) { }
- virtual void setupRootForPrinting(bool onOrOff) { }
- virtual Vector<IntRect> computePageRects(const IntRect& printRect, float userScaleFactor) { return Vector<IntRect>(); }
protected:
- virtual Plugin* createPlugin(Element* node, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType) = 0;
- virtual ObjectContentType objectContentType(const KURL& url, const String& mimeType) = 0;
+ virtual void startRedirectionTimer();
+ virtual void stopRedirectionTimer();
- virtual void redirectionTimerFired(Timer<Frame>*);
-
- virtual bool isLoadTypeReload() = 0;
- virtual KURL originalRequestURL() const = 0;
+private:
+ void handleAutoscroll(RenderObject*);
+ void startAutoscrollTimer();
+ void setAutoscrollRenderer(RenderObject*);
+
+ void autoscrollTimerFired(Timer<Frame>*);
+
+ void handleMousePressEventSingleClick(const MouseEventWithHitTestResults&);
+ void handleMousePressEventDoubleClick(const MouseEventWithHitTestResults&);
+ void handleMousePressEventTripleClick(const MouseEventWithHitTestResults&);
+
+// === to be moved into FrameLoader
public:
- void loadDone();
+ void changeLocation(const DeprecatedString& URL, const String& referrer, bool lockHistory = true, bool userGesture = false);
+ void urlSelected(const ResourceRequest&, const String& target, Event*, bool lockHistory = false);
+ virtual void urlSelected(const FrameLoadRequest&, Event*) = 0;
+
+ bool requestFrame(Element* ownerElement, const String& URL, const AtomicString& frameName);
+ virtual Frame* createFrame(const KURL& URL, const String& name, Element* ownerElement, const String& referrer) = 0;
+ Frame* loadSubframe(Element* ownerElement, const KURL& URL, const String& name, const String& referrer);
- void finishedParsing();
+ void submitForm(const char* action, const String& URL, const FormData&, const String& target, const String& contentType, const String& boundary, Event*);
+ void submitFormAgain();
+ virtual void submitForm(const FrameLoadRequest&, Event*) = 0;
- void checkCompleted();
+ void stop();
+ void stopLoading(bool sendUnload = false);
+ virtual bool closeURL();
- void reparseConfiguration();
+ void didExplicitOpen();
-private:
- void childBegin();
+ KURL iconURL();
+ void commitIconURLToIconDatabase();
- void started();
+ void setAutoLoadImages(bool enable);
+ bool autoLoadImages() const;
- void completed(bool);
- void childCompleted(bool);
- void parentCompleted();
+ KURL baseURL() const;
+ String baseTarget() const;
- void lifeSupportTimerFired(Timer<Frame>*);
- void endLifeSupport();
+ void scheduleRedirection(double delay, const DeprecatedString& URL, bool lockHistory = true);
- virtual void clear(bool clearWindowProperties = true);
+ void scheduleLocationChange(const DeprecatedString& URL, const String& referrer, bool lockHistory = true, bool userGesture = false);
+ void scheduleRefresh(bool userGesture = false);
+ bool isScheduledLocationChangePending() const;
- void caretBlinkTimerFired(Timer<Frame>*);
+ void scheduleHistoryNavigation(int steps);
- bool shouldUsePlugin(Node* element, const KURL& url, const String& mimeType, bool hasFallback, bool& useFallback);
- bool loadPlugin(RenderPart* renderer, const KURL& url, const String& mimeType,
- const Vector<String>& paramNames, const Vector<String>& paramValues, bool useFallback);
+ virtual bool canGoBackOrForward(int distance) const = 0;
+ virtual void goBackOrForward(int distance) = 0;
+ virtual int getHistoryLength() = 0;
+ virtual KURL historyURL(int distance) = 0;
-public:
- bool requestObject(RenderPart* frame, const String& url, const AtomicString& frameName,
- const String& serviceType, const Vector<String>& paramNames, const Vector<String>& paramValues);
- Document* document() const;
- void setDocument(Document* newDoc);
+ void begin();
+ virtual void begin(const KURL&);
+ virtual void write(const char* str, int len = -1);
+ virtual void write(const String&);
+ virtual void end();
- virtual bool mouseDownMayStartSelect() const { return true; }
- bool mouseDownMayStartAutoscroll() const;
- void setMouseDownMayStartAutoscroll(bool b);
+ void endIfNotLoading();
- bool mouseDownMayStartDrag() const;
- void setMouseDownMayStartDrag(bool b);
-
- void handleFallbackContent();
-
- public:
- KJS::JSValue* executeScript(const String& filename, int baseLine, Node*, const String& script);
- KJSProxy* scriptProxy();
- Frame* opener();
- void setOpener(Frame* _opener);
- bool openedByJS();
- void setOpenedByJS(bool _openedByJS);
-
- void setSettings(Settings*);
-
- void provisionalLoadStarted();
- bool userGestureHint();
- void didNotOpenURL(const KURL&);
- void addData(const char* bytes, int length);
- void addMetaData(const String& key, const String& value);
- void setMediaType(const String&);
-
- // root renderer for the document contained in this frame
- RenderObject* renderer() const;
-
- Element* ownerElement();
- // renderer for the element that contains this frame
- RenderPart* ownerRenderer();
+ void setEncoding(const String& encoding, bool userChosen);
+ String encoding() const;
- IntRect selectionRect() const;
- FloatRect visibleSelectionRect() const;
- bool isFrameSet() const;
+ KJS::JSValue* executeScript(Node*, const String& script, bool forceUserGesture = false);
- HTMLFormElement* currentForm() const;
+ bool gotoAnchor(const String& name); // returns true if the anchor was found
+ void scrollToAnchor(const KURL&);
- RenderStyle* styleForSelectionStart(Node* &nodeToRemove) const;
+ virtual void tokenizerProcessedData() {}
- void revealSelection(const RenderLayer::ScrollAlignment& alignment = RenderLayer::gAlignCenterIfNeeded) const;
- void revealCaret(const RenderLayer::ScrollAlignment& alignment = RenderLayer::gAlignCenterIfNeeded) const;
- void setSelectionFromNone();
+ String referrer() const;
+ String lastModified() const;
- bool scrollOverflow(ScrollDirection direction, ScrollGranularity granularity);
+ virtual void setTitle(const String&) = 0;
+ virtual void handledOnloadEvents() = 0;
+ virtual String userAgent() const = 0;
- void adjustPageHeight(float* newBottom, float oldTop, float oldBottom, float bottomLimit);
+ virtual Widget* createJavaAppletWidget(const IntSize&, Element*, const HashMap<String, String>& args) = 0;
- bool canCachePage();
- KJS::PausedTimeouts* pauseTimeouts();
- void resumeTimeouts(KJS::PausedTimeouts*);
- void saveWindowProperties(KJS::SavedProperties* windowProperties);
- void saveLocationProperties(KJS::SavedProperties* locationProperties);
- void restoreWindowProperties(KJS::SavedProperties* windowProperties);
- void restoreLocationProperties(KJS::SavedProperties* locationProperties);
- void saveInterpreterBuiltins(KJS::SavedBuiltins& interpreterBuiltins);
- void restoreInterpreterBuiltins(const KJS::SavedBuiltins& interpreterBuiltins);
+ virtual void createEmptyDocument() = 0;
- static Frame* frameForWidget(const Widget*);
- static Node* nodeForWidget(const Widget*);
- static Frame* frameForNode(Node*);
+ virtual void partClearedInBegin() = 0;
+ virtual void saveDocumentState() = 0;
+ virtual void restoreDocumentState() = 0;
- static void clearDocumentFocus(Widget*);
+ virtual String overrideMediaType() const = 0;
- void updatePolicyBaseURL();
- void setPolicyBaseURL(const String&);
+ virtual void redirectDataToPlugin(Widget* /*pluginWidget*/) { }
- void forceLayout();
- void forceLayoutWithPageWidthRange(float minPageWidth, float maxPageWidth);
+ Frame* opener();
+ void setOpener(Frame*);
+ bool openedByJS();
+ void setOpenedByJS(bool);
- void sendResizeEvent();
- void sendScrollEvent();
- bool scrollbarsVisible();
- void scrollToAnchor(const KURL&);
- bool canMouseDownStartSelect(Node*);
+ void provisionalLoadStarted();
- void clearTimers();
- static void clearTimers(FrameView*);
+ bool userGestureHint();
- bool isActive() const;
- virtual void setIsActive(bool flag);
- void setWindowHasFocus(bool flag);
- // Convenience, to avoid repeating the code to dig down to get this.
+ void didNotOpenURL(const KURL&);
+ void addData(const char* bytes, int length);
+ void addMetaData(const String& key, const String& value);
+ void setMediaType(const String&);
- UChar backslashAsCurrencySymbol() const;
+ bool canCachePage();
- const Vector<MarkedTextUnderline>& markedTextUnderlines() const;
- bool markedTextUsesUnderlines() const;
-
- unsigned markAllMatchesForText(const String&, bool caseFlag, unsigned limit);
- bool markedTextMatchesAreHighlighted() const;
- void setMarkedTextMatchesAreHighlighted(bool flag);
-
- // Call this method before handling a new user action, like on a mouse down or key down.
- // Currently, all this does is clear the "don't submit form twice" data member.
- void prepareForUserAction();
- Node* mousePressNode();
-
- void clearRecordedFormValues();
- void recordFormValue(const String& name, const String& value, PassRefPtr<HTMLFormElement>);
+ KJS::PausedTimeouts* pauseTimeouts();
+ void resumeTimeouts(KJS::PausedTimeouts*);
+ void saveWindowProperties(KJS::SavedProperties*);
+ void saveLocationProperties(KJS::SavedProperties*);
+ void restoreWindowProperties(KJS::SavedProperties*);
+ void restoreLocationProperties(KJS::SavedProperties*);
+ void saveInterpreterBuiltins(KJS::SavedBuiltins&);
+ void restoreInterpreterBuiltins(const KJS::SavedBuiltins&);
- bool isComplete() const;
- bool isLoadingMainResource() const;
-
- void replaceContentsWithScriptResult(const KURL& url);
+ void checkEmitLoadEvent();
+ bool didOpenURL(const KURL&);
+ virtual void didFirstLayout() {}
+
+ virtual void frameDetached();
+
+ void detachChildren();
+
+ KURL url() const;
+
+ void updateBaseURLForEmptyDocument();
- void disconnectOwnerElement();
+ void setResponseMIMEType(const String&);
+ const String& responseMIMEType() const;
- void setNeedsReapplyStyles();
+ bool containsPlugins() const;
- void stopAutoscrollTimer(bool rendererIsBeingDestroyed = false);
- RenderObject* autoscrollRenderer() const;
+ void disconnectOwnerElement();
+
+ void loadDone();
+ void finishedParsing();
+ void checkCompleted();
+ void reparseConfiguration();
+
+ KJS::JSValue* executeScript(const String& filename, int baseLine, Node*, const String& script);
+
+ void clearRecordedFormValues();
+ void recordFormValue(const String& name, const String& value, PassRefPtr<HTMLFormElement>);
+
+ bool isComplete() const;
+ bool isLoadingMainResource() const;
+
+ bool requestObject(RenderPart* frame, const String& URL, const AtomicString& frameName,
+ const String& serviceType, const Vector<String>& paramNames, const Vector<String>& paramValues);
+
+ KURL completeURL(const DeprecatedString& URL);
protected:
- virtual void startRedirectionTimer();
- virtual void stopRedirectionTimer();
- virtual void cleanupPluginObjects() { }
+ virtual Plugin* createPlugin(Element* node, const KURL& URL, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType) = 0;
+ virtual ObjectContentType objectContentType(const KURL& URL, const String& mimeType) = 0;
+
+ virtual void redirectionTimerFired(Timer<Frame>*);
+
+ virtual bool isLoadTypeReload() = 0;
+ virtual KURL originalRequestURL() const = 0;
+
void cancelAndClear();
-
- void handleAutoscroll(RenderObject*);
- void startAutoscrollTimer();
- void setAutoscrollRenderer(RenderObject*);
- private:
- void emitLoadEvent();
-
- void receivedFirstData();
+private:
+ void cancelRedirection(bool newLoadInProgress = false);
- /**
- * @internal Extracts anchor and tries both encoded and decoded form.
- */
- void gotoAnchor();
+ void childBegin();
- void handleMousePressEventSingleClick(const MouseEventWithHitTestResults&);
- void handleMousePressEventDoubleClick(const MouseEventWithHitTestResults&);
- void handleMousePressEventTripleClick(const MouseEventWithHitTestResults&);
+ void started();
- CSSComputedStyleDeclaration* selectionComputedStyle(Node* &nodeToRemove) const;
+ void completed(bool);
+ void childCompleted(bool);
+ void parentCompleted();
- virtual void setStatusBarText(const String&);
-
- void autoscrollTimerFired(Timer<Frame>*);
+ virtual void clear(bool clearWindowProperties = true);
+
+ bool shouldUsePlugin(Node* element, const KURL&, const String& mimeType, bool hasFallback, bool& useFallback);
+ bool loadPlugin(RenderPart*, const KURL&, const String& mimeType,
+ const Vector<String>& paramNames, const Vector<String>& paramValues, bool useFallback);
+
+ void handleFallbackContent();
+
+ void emitLoadEvent();
+
+ void receivedFirstData();
+
+ void gotoAnchor();
+
+ void updatePolicyBaseURL();
+ void setPolicyBaseURL(const String&);
+
+ void replaceContentsWithScriptResult(const KURL&);
+
+// === to be moved into SelectionController
public:
- friend class FrameGdk;
- friend class FrameLoader;
- friend class FrameMac;
- friend class FrameQt;
- friend class FrameWin;
+ TextGranularity selectionGranularity() const;
+ void setSelectionGranularity(TextGranularity) const;
- HitTestResult hitTestResultAtPoint(const IntPoint&, bool allowShadowContent);
- String documentTypeString() const;
+ bool shouldChangeSelection(const Selection&) const;
+ virtual bool shouldDeleteSelection(const Selection&) const;
+ void clearCaretRectIfNeeded();
+ void setFocusNodeIfNeeded();
+ void selectionLayoutChanged();
+ void notifyRendererOfSelectionChange(bool userTriggered);
- void checkEmitLoadEvent();
- bool didOpenURL(const KURL&);
- virtual void didFirstLayout() {}
+ void invalidateSelection();
- virtual void frameDetached();
+ void setCaretVisible(bool = true);
+ void paintCaret(GraphicsContext*, const IntRect&) const;
+ void paintDragCaret(GraphicsContext*, const IntRect&) const;
- void detachChildren();
+ void setXPosForVerticalArrowNavigation(int);
+ int xPosForVerticalArrowNavigation() const;
- void updateBaseURLForEmptyDocument();
+ virtual bool isContentEditable() const; // if true, everything in frame is editable
+
+ virtual void textFieldDidBeginEditing(Element*);
+ virtual void textFieldDidEndEditing(Element*);
+ virtual void textDidChangeInTextField(Element*);
+ virtual bool doTextFieldCommandFromEvent(Element*, const PlatformKeyboardEvent*);
+ virtual void textWillBeDeletedInTextField(Element* input);
+ virtual void textDidChangeInTextArea(Element*);
+
+ virtual bool inputManagerHasMarkedText() const { return false; }
+
+ virtual void setSecureKeyboardEntry(bool) { }
+ virtual bool isSecureKeyboardEntry() { return false; }
+
+ void appliedEditing(PassRefPtr<EditCommand>);
+ void unappliedEditing(PassRefPtr<EditCommand>);
+ void reappliedEditing(PassRefPtr<EditCommand>);
+
+ CSSMutableStyleDeclaration* typingStyle() const;
+ void setTypingStyle(CSSMutableStyleDeclaration*);
+ void clearTypingStyle();
+
+ IntRect selectionRect() const;
+ FloatRect visibleSelectionRect() const;
+
+ HTMLFormElement* currentForm() const;
+
+ void revealSelection(const RenderLayer::ScrollAlignment& = RenderLayer::gAlignCenterIfNeeded) const;
+ void revealCaret(const RenderLayer::ScrollAlignment& = RenderLayer::gAlignCenterIfNeeded) const;
+ void setSelectionFromNone();
+
+// === to be moved into the Platform directory
+
+public:
+ virtual String mimeTypeForFileName(const String&) const = 0;
+ virtual bool isCharacterSmartReplaceExempt(UChar, bool);
+
+// === to be deleted
+
+public:
+ SelectionController* dragCaretController() const;
- KURL url() const;
-
- void setResponseMIMEType(const String&);
- const String& responseMIMEType() const;
-
- bool containsPlugins() const;
-
- bool prohibitsScrolling() const;
- void setProhibitsScrolling(const bool);
-
- // split out controller objects
- FrameTree* tree() const;
- SelectionController* selectionController() const;
- SelectionController* dragCaretController() const;
- DOMWindow* domWindow() const;
- Editor* editor() const;
- CommandByName* command() const;
- FrameLoader* loader() const;
-
- private:
- friend class FramePrivate;
- FramePrivate* d;
};
} // namespace WebCore