]>
git.saurik.com Git - iphone-api.git/blob - WebCore/Chrome.h
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
23 #include "FileChooser.h"
24 #include "FocusDirection.h"
25 #include "HostWindow.h"
26 #include <wtf/Forward.h>
27 #include <wtf/RefPtr.h>
53 struct FrameLoadRequest
;
54 struct WindowFeatures
;
56 class Chrome
: public HostWindow
{
58 Chrome(Page
*, ChromeClient
*);
61 ChromeClient
* client() { return m_client
; }
63 // HostWindow methods.
64 virtual void repaint(const IntRect
&, bool contentChanged
, bool immediate
= false, bool repaintContentOnly
= false);
65 virtual void scroll(const IntSize
& scrollDelta
, const IntRect
& rectToScroll
, const IntRect
& clipRect
);
66 virtual IntPoint
screenToWindow(const IntPoint
&) const;
67 virtual IntRect
windowToScreen(const IntRect
&) const;
68 virtual PlatformWidget
platformWindow() const;
69 virtual void scrollRectIntoView(const IntRect
&, const ScrollView
*) const;
71 void contentsSizeChanged(Frame
*, const IntSize
&) const;
73 void setWindowRect(const FloatRect
&) const;
74 FloatRect
windowRect() const;
76 FloatRect
pageRect() const;
80 void focus(bool userGesture
) const;
83 bool canTakeFocus(FocusDirection
) const;
84 void takeFocus(FocusDirection
) const;
86 Page
* createWindow(Frame
*, const FrameLoadRequest
&, const WindowFeatures
&, const bool) const;
89 bool canRunModal() const;
90 bool canRunModalNow() const;
91 void runModal() const;
93 void setToolbarsVisible(bool) const;
94 bool toolbarsVisible() const;
96 void setStatusbarVisible(bool) const;
97 bool statusbarVisible() const;
99 void setScrollbarsVisible(bool) const;
100 bool scrollbarsVisible() const;
102 void setMenubarVisible(bool) const;
103 bool menubarVisible() const;
105 void setResizable(bool) const;
107 bool canRunBeforeUnloadConfirmPanel();
108 bool runBeforeUnloadConfirmPanel(const String
& message
, Frame
* frame
);
110 void closeWindowSoon();
112 void runJavaScriptAlert(Frame
*, const String
&);
113 bool runJavaScriptConfirm(Frame
*, const String
&);
114 bool runJavaScriptPrompt(Frame
*, const String
& message
, const String
& defaultValue
, String
& result
);
115 void setStatusbarText(Frame
*, const String
&);
116 bool shouldInterruptJavaScript();
118 IntRect
windowResizerRect() const;
120 void mouseDidMoveOverElement(const HitTestResult
&, unsigned modifierFlags
);
122 void setToolTip(const HitTestResult
&);
126 void enableSuddenTermination();
127 void disableSuddenTermination();
129 bool requestGeolocationPermissionForFrame(Frame
*, Geolocation
*);
131 void runOpenPanel(Frame
*, PassRefPtr
<FileChooser
>);
134 void focusNSView(NSView
*);
139 ChromeClient
* m_client
;