/src/3rdparty/webkit/Source/WebCore/page/Chrome.h

https://bitbucket.org/ultra_iter/qt-vtl · C Header · 189 lines · 123 code · 44 blank · 22 comment · 0 complexity · b201159d86f47ddb714ad6b972a64c41 MD5 · raw file

  1. /*
  2. * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
  3. * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
  4. *
  5. * This library is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Library General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 2 of the License, or (at your option) any later version.
  9. *
  10. * This library is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * Library General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Library General Public License
  16. * along with this library; see the file COPYING.LIB. If not, write to
  17. * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  18. * Boston, MA 02110-1301, USA.
  19. */
  20. #ifndef Chrome_h
  21. #define Chrome_h
  22. #include "Cursor.h"
  23. #include "FileChooser.h"
  24. #include "FocusDirection.h"
  25. #include "HostWindow.h"
  26. #include "PopupMenu.h"
  27. #include "SearchPopupMenu.h"
  28. #include <wtf/Forward.h>
  29. #include <wtf/RefPtr.h>
  30. #if PLATFORM(MAC)
  31. #ifndef __OBJC__
  32. class NSView;
  33. #endif
  34. #endif
  35. namespace WebCore {
  36. class ChromeClient;
  37. class ContextMenu;
  38. class FloatRect;
  39. class Frame;
  40. class Geolocation;
  41. class HitTestResult;
  42. class IntRect;
  43. class NavigationAction;
  44. class Node;
  45. class Page;
  46. class PopupMenuClient;
  47. #if ENABLE(NOTIFICATIONS)
  48. class NotificationPresenter;
  49. #endif
  50. struct FrameLoadRequest;
  51. struct ViewportArguments;
  52. struct WindowFeatures;
  53. class Chrome : public HostWindow {
  54. public:
  55. Chrome(Page*, ChromeClient*);
  56. ~Chrome();
  57. ChromeClient* client() { return m_client; }
  58. // HostWindow methods.
  59. virtual void invalidateWindow(const IntRect&, bool);
  60. virtual void invalidateContentsAndWindow(const IntRect&, bool);
  61. virtual void invalidateContentsForSlowScroll(const IntRect&, bool);
  62. virtual void scroll(const IntSize&, const IntRect&, const IntRect&);
  63. #if ENABLE(TILED_BACKING_STORE)
  64. virtual void delegatedScrollRequested(const IntPoint& scrollPoint);
  65. #endif
  66. virtual IntPoint screenToWindow(const IntPoint&) const;
  67. virtual IntRect windowToScreen(const IntRect&) const;
  68. virtual PlatformPageClient platformPageClient() const;
  69. virtual void scrollbarsModeDidChange() const;
  70. virtual void setCursor(const Cursor&);
  71. #if ENABLE(REQUEST_ANIMATION_FRAME)
  72. virtual void scheduleAnimation();
  73. #endif
  74. void scrollRectIntoView(const IntRect&) const;
  75. void contentsSizeChanged(Frame*, const IntSize&) const;
  76. void setWindowRect(const FloatRect&) const;
  77. FloatRect windowRect() const;
  78. FloatRect pageRect() const;
  79. float scaleFactor();
  80. void focus() const;
  81. void unfocus() const;
  82. bool canTakeFocus(FocusDirection) const;
  83. void takeFocus(FocusDirection) const;
  84. void focusedNodeChanged(Node*) const;
  85. void focusedFrameChanged(Frame*) const;
  86. Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&, const NavigationAction&) const;
  87. void show() const;
  88. bool canRunModal() const;
  89. bool canRunModalNow() const;
  90. void runModal() const;
  91. void setToolbarsVisible(bool) const;
  92. bool toolbarsVisible() const;
  93. void setStatusbarVisible(bool) const;
  94. bool statusbarVisible() const;
  95. void setScrollbarsVisible(bool) const;
  96. bool scrollbarsVisible() const;
  97. void setMenubarVisible(bool) const;
  98. bool menubarVisible() const;
  99. void setResizable(bool) const;
  100. bool canRunBeforeUnloadConfirmPanel();
  101. bool runBeforeUnloadConfirmPanel(const String& message, Frame* frame);
  102. void closeWindowSoon();
  103. void runJavaScriptAlert(Frame*, const String&);
  104. bool runJavaScriptConfirm(Frame*, const String&);
  105. bool runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result);
  106. void setStatusbarText(Frame*, const String&);
  107. bool shouldInterruptJavaScript();
  108. #if ENABLE(REGISTER_PROTOCOL_HANDLER)
  109. void registerProtocolHandler(const String& scheme, const String& baseURL, const String& url, const String& title);
  110. #endif
  111. IntRect windowResizerRect() const;
  112. void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags);
  113. void setToolTip(const HitTestResult&);
  114. void print(Frame*);
  115. // FIXME: Remove once all ports are using client-based geolocation. https://bugs.webkit.org/show_bug.cgi?id=40373
  116. // For client-based geolocation, these two methods have moved to GeolocationClient. https://bugs.webkit.org/show_bug.cgi?id=50061
  117. void requestGeolocationPermissionForFrame(Frame*, Geolocation*);
  118. void cancelGeolocationPermissionRequestForFrame(Frame*, Geolocation*);
  119. void runOpenPanel(Frame*, PassRefPtr<FileChooser>);
  120. void chooseIconForFiles(const Vector<String>&, FileChooser*);
  121. #if ENABLE(DIRECTORY_UPLOAD)
  122. void enumerateChosenDirectory(const String&, FileChooser*);
  123. #endif
  124. void dispatchViewportDataDidChange(const ViewportArguments&) const;
  125. bool requiresFullscreenForVideoPlayback();
  126. #if PLATFORM(MAC)
  127. void focusNSView(NSView*);
  128. #endif
  129. #if ENABLE(NOTIFICATIONS)
  130. NotificationPresenter* notificationPresenter() const;
  131. #endif
  132. bool selectItemWritingDirectionIsNatural();
  133. bool selectItemAlignmentFollowsMenuWritingDirection();
  134. PassRefPtr<PopupMenu> createPopupMenu(PopupMenuClient*) const;
  135. PassRefPtr<SearchPopupMenu> createSearchPopupMenu(PopupMenuClient*) const;
  136. #if ENABLE(CONTEXT_MENUS)
  137. void showContextMenu();
  138. #endif
  139. void willRunModalHTMLDialog(const Frame*) const;
  140. private:
  141. Page* m_page;
  142. ChromeClient* m_client;
  143. };
  144. }
  145. #endif // Chrome_h