#ifndef FrameView_H
#define FrameView_H
#include "ScrollView.h"
#include "IntSize.h"
#include "PlatformString.h"
namespace WebCore {
class AtomicString;
class CSSProperty;
class CSSStyleSelector;
class Clipboard;
class DeprecatedStringList;
class Document;
class Element;
class Event;
class EventTargetNode;
class Frame;
class FrameViewPrivate;
class GraphicsContext;
class HTMLAnchorElement;
class HTMLDocument;
class HTMLElement;
class HTMLFormElement;
class HTMLFrameSetElement;
class HTMLGenericFormElement;
class HTMLTitleElement;
class InlineBox;
class IntRect;
class PlatformKeyboardEvent;
class FrameMac;
class PlatformMouseEvent;
class MouseEventWithHitTestResults;
class Node;
class RenderBox;
class RenderView;
class RenderLineEdit;
class RenderObject;
class RenderPart;
class RenderPartObject;
class RenderStyle;
class RenderWidget;
class PlatformWheelEvent;
class String;
template <typename T> class Timer;
void applyRule(CSSProperty*);
class FrameView : public ScrollView {
friend class CSSStyleSelector;
friend class Document;
friend class Frame;
friend class HTMLAnchorElement;
friend class HTMLDocument;
friend class HTMLFormElement;
friend class HTMLGenericFormElement;
friend class HTMLTitleElement;
friend class FrameMac;
friend class RenderBox;
friend class RenderView;
friend class RenderLineEdit;
friend class RenderObject;
friend class RenderPart;
friend class RenderPartObject;
friend class RenderWidget;
friend void applyRule(CSSProperty *prop);
public:
FrameView(Frame*);
virtual ~FrameView();
Frame* frame() const { return m_frame.get(); }
int frameWidth() const { return m_size.width(); }
int marginWidth() const { return m_margins.width(); }
int marginHeight() { return m_margins.height(); }
void setMarginWidth(int);
void setMarginHeight(int);
virtual void setVScrollBarMode(ScrollBarMode);
virtual void setHScrollBarMode(ScrollBarMode);
virtual void setScrollBarsMode(ScrollBarMode);
void print();
void layout(bool allowSubtree = true);
Node* layoutRoot() const;
int layoutCount() const;
bool needsFullRepaint() const;
void addRepaintInfo(RenderObject*, const IntRect&);
void resetScrollBars();
void clear();
public:
void clearPart();
void handleMousePressEvent(const PlatformMouseEvent&);
void handleMouseDoubleClickEvent(const PlatformMouseEvent&);
void handleMouseMoveEvent(const PlatformMouseEvent&);
void handleMouseReleaseEvent(const PlatformMouseEvent&);
void handleWheelEvent(PlatformWheelEvent&);
bool mousePressed();
void doAutoScroll();
bool updateDragAndDrop(const PlatformMouseEvent&, Clipboard*);
void cancelDragAndDrop(const PlatformMouseEvent&, Clipboard*);
bool performDragAndDrop(const PlatformMouseEvent&, Clipboard*);
void layoutTimerFired(Timer<FrameView>*);
void hoverTimerFired(Timer<FrameView>*);
void repaintRectangle(const IntRect& r, bool immediate);
bool isTransparent() const;
void setTransparent(bool isTransparent);
void scheduleRelayout();
void scheduleRelayoutOfSubtree(Node*);
void unscheduleRelayout();
bool haveDelayedLayoutScheduled();
bool layoutPending() const;
void scheduleHoverStateUpdate();
void adjustViewSize();
void initScrollBars();
void setHasBorder(bool);
bool hasBorder() const;
void setResizingFrameSet(HTMLFrameSetElement *);
#if __APPLE__
void updateDashboardRegions();
#endif
void invalidateClick();
virtual void scrollPointRecursively(int x, int y);
virtual void setContentsPos(int x, int y);
void scheduleEvent(PassRefPtr<Event>, PassRefPtr<EventTargetNode>, bool tempEvent);
void ref() { ++m_refCount; }
void deref() { if (!--m_refCount) delete this; }
bool hasOneRef() { return m_refCount == 1; }
private:
void cleared();
void scrollBarMoved();
void resetCursor();
void setMediaType(const String&);
String mediaType() const;
bool scrollTo(const IntRect&);
void focusNextPrevNode(bool next);
void useSlowRepaints();
void setIgnoreWheelEvents(bool e);
void init();
Node *nodeUnderMouse() const;
void restoreScrollBar();
DeprecatedStringList formCompletionItems(const String& name) const;
void addFormCompletionItem(const String& name, const String& value);
MouseEventWithHitTestResults prepareMouseEvent(bool readonly, bool active, bool mouseMove, const PlatformMouseEvent&);
bool dispatchMouseEvent(const AtomicString& eventType, Node* target,
bool cancelable, int clickCount, const PlatformMouseEvent&, bool setUnder);
bool dispatchDragEvent(const AtomicString& eventType, Node* target,
const PlatformMouseEvent&, Clipboard*);
void applyOverflowToViewport(RenderObject* o, ScrollBarMode& hMode, ScrollBarMode& vMode);
virtual bool isFrameView() const;
void updateBorder();
void updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow);
void dispatchScheduledEvents();
float minimumZoomFontSize();
CGSize visibleSize();
unsigned m_refCount;
IntSize m_size;
IntSize m_margins;
RefPtr<Frame> m_frame;
FrameViewPrivate* d;
};
}
#endif