summaryrefslogtreecommitdiffstats
path: root/WebCore/page/ChromeClient.h
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-03 19:30:52 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-03 19:30:52 -0800
commit8e35f3cfc7fba1d1c829dc557ebad6409cbe16a2 (patch)
tree11425ea0b299d6fb89c6d3618a22d97d5bf68d0f /WebCore/page/ChromeClient.h
parent648161bb0edfc3d43db63caed5cc5213bc6cb78f (diff)
downloadexternal_webkit-8e35f3cfc7fba1d1c829dc557ebad6409cbe16a2.zip
external_webkit-8e35f3cfc7fba1d1c829dc557ebad6409cbe16a2.tar.gz
external_webkit-8e35f3cfc7fba1d1c829dc557ebad6409cbe16a2.tar.bz2
auto import from //depot/cupcake/@135843
Diffstat (limited to 'WebCore/page/ChromeClient.h')
-rw-r--r--WebCore/page/ChromeClient.h166
1 files changed, 166 insertions, 0 deletions
diff --git a/WebCore/page/ChromeClient.h b/WebCore/page/ChromeClient.h
new file mode 100644
index 0000000..7678dc2
--- /dev/null
+++ b/WebCore/page/ChromeClient.h
@@ -0,0 +1,166 @@
+/*
+ * Copyright (C) 2006, 2007, 2008 Apple, Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef ChromeClient_h
+#define ChromeClient_h
+
+#include "GraphicsContext.h"
+#include "FocusDirection.h"
+#include "ScrollTypes.h"
+#include "HostWindow.h"
+#include <wtf/Forward.h>
+#include <wtf/Vector.h>
+
+#if PLATFORM(MAC)
+#include "WebCoreKeyboardUIMode.h"
+#endif
+
+#ifndef __OBJC__
+class NSMenu;
+class NSResponder;
+#endif
+
+namespace WebCore {
+
+ class AtomicString;
+ class FileChooser;
+ class FloatRect;
+ class Frame;
+ class HitTestResult;
+ class IntRect;
+ class Node;
+ class Page;
+ class String;
+ class Widget;
+
+ struct FrameLoadRequest;
+ struct WindowFeatures;
+
+ class ChromeClient {
+ public:
+ virtual void chromeDestroyed() = 0;
+
+ virtual void setWindowRect(const FloatRect&) = 0;
+ virtual FloatRect windowRect() = 0;
+
+ virtual FloatRect pageRect() = 0;
+
+ virtual float scaleFactor() = 0;
+
+ virtual void focus() = 0;
+ virtual void unfocus() = 0;
+
+ virtual bool canTakeFocus(FocusDirection) = 0;
+ virtual void takeFocus(FocusDirection) = 0;
+
+ // The Frame pointer provides the ChromeClient with context about which
+ // Frame wants to create the new Page. Also, the newly created window
+ // should not be shown to the user until the ChromeClient of the newly
+ // created Page has its show method called.
+ virtual Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&) = 0;
+ virtual void show() = 0;
+
+ virtual bool canRunModal() = 0;
+ virtual void runModal() = 0;
+
+ virtual void setToolbarsVisible(bool) = 0;
+ virtual bool toolbarsVisible() = 0;
+
+ virtual void setStatusbarVisible(bool) = 0;
+ virtual bool statusbarVisible() = 0;
+
+ virtual void setScrollbarsVisible(bool) = 0;
+ virtual bool scrollbarsVisible() = 0;
+
+ virtual void setMenubarVisible(bool) = 0;
+ virtual bool menubarVisible() = 0;
+
+ virtual void setResizable(bool) = 0;
+
+ virtual void addMessageToConsole(const String& message, unsigned int lineNumber, const String& sourceID) = 0;
+
+ virtual bool canRunBeforeUnloadConfirmPanel() = 0;
+ virtual bool runBeforeUnloadConfirmPanel(const String& message, Frame* frame) = 0;
+
+ virtual void closeWindowSoon() = 0;
+
+ virtual void runJavaScriptAlert(Frame*, const String&) = 0;
+ virtual bool runJavaScriptConfirm(Frame*, const String&) = 0;
+ virtual bool runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result) = 0;
+ virtual void setStatusbarText(const String&) = 0;
+ virtual bool shouldInterruptJavaScript() = 0;
+ virtual bool tabsToLinks() const = 0;
+
+ virtual IntRect windowResizerRect() const = 0;
+
+ // Methods used by HostWindow.
+ virtual void repaint(const IntRect&, bool contentChanged, bool immediate = false, bool repaintContentOnly = false) = 0;
+ virtual void scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect) = 0;
+ virtual IntPoint screenToWindow(const IntPoint&) const = 0;
+ virtual IntRect windowToScreen(const IntRect&) const = 0;
+ virtual PlatformWidget platformWindow() const = 0;
+ // End methods used by HostWindow.
+
+ virtual void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags) = 0;
+
+ virtual void setToolTip(const String&) = 0;
+
+ virtual void print(Frame*) = 0;
+
+ virtual void exceededDatabaseQuota(Frame*, const String& databaseName) = 0;
+
+#if ENABLE(DASHBOARD_SUPPORT)
+ virtual void dashboardRegionsChanged();
+#endif
+
+ virtual void populateVisitedLinks();
+
+ virtual FloatRect customHighlightRect(Node*, const AtomicString& type, const FloatRect& lineRect);
+ virtual void paintCustomHighlight(Node*, const AtomicString& type, const FloatRect& boxRect, const FloatRect& lineRect,
+ bool behindText, bool entireLine);
+
+ virtual bool shouldReplaceWithGeneratedFileForUpload(const String& path, String& generatedFilename);
+ virtual String generateReplacementFile(const String& path);
+
+ virtual void enableSuddenTermination();
+ virtual void disableSuddenTermination();
+
+ virtual bool paintCustomScrollbar(GraphicsContext*, const FloatRect&, ScrollbarControlSize,
+ ScrollbarControlState, ScrollbarPart pressedPart, bool vertical,
+ float value, float proportion, ScrollbarControlPartMask);
+ virtual bool paintCustomScrollCorner(GraphicsContext*, const FloatRect&);
+
+ virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>) = 0;
+
+#if PLATFORM(MAC)
+ virtual KeyboardUIMode keyboardUIMode() { return KeyboardAccessDefault; }
+
+ virtual NSResponder *firstResponder() { return 0; }
+ virtual void makeFirstResponder(NSResponder *) { }
+
+ virtual void willPopUpMenu(NSMenu *) { }
+#endif
+
+ protected:
+ virtual ~ChromeClient() { }
+ };
+
+}
+
+#endif // ChromeClient_h