DumpRenderTreeClient.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. * Copyright (C) 2009, 2010, 2011 Research In Motion Limited. All rights reserved.
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser 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.
  8. *
  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. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. #ifndef DumpRenderTreeClient_h
  19. #define DumpRenderTreeClient_h
  20. #include "BlackBerryGlobal.h"
  21. #include <JavaScriptCore/JSObjectRef.h>
  22. #include <wtf/text/WTFString.h>
  23. namespace WebCore {
  24. class Credential;
  25. class Frame;
  26. class DOMWrapperWorld;
  27. class NavigationAction;
  28. class Node;
  29. class Range;
  30. class ResourceRequest;
  31. class ResourceResponse;
  32. class SecurityOrigin;
  33. }
  34. namespace BlackBerry {
  35. namespace WebKit {
  36. class WebPage;
  37. class BLACKBERRY_EXPORT DumpRenderTreeClient {
  38. public:
  39. virtual ~DumpRenderTreeClient() { }
  40. virtual void runTests() = 0;
  41. // FrameLoaderClient delegates
  42. virtual void didStartProvisionalLoadForFrame(WebCore::Frame*) = 0;
  43. virtual void didReceiveResponseForFrame(WebCore::Frame*, const WebCore::ResourceResponse&) = 0;
  44. virtual void didCommitLoadForFrame(WebCore::Frame*) = 0;
  45. virtual void didFailProvisionalLoadForFrame(WebCore::Frame*) = 0;
  46. virtual void didFailLoadForFrame(WebCore::Frame*) = 0;
  47. virtual void didFinishLoadForFrame(WebCore::Frame*) = 0;
  48. virtual void didFinishDocumentLoadForFrame(WebCore::Frame*) = 0;
  49. virtual void didClearWindowObjectInWorld(WebCore::DOMWrapperWorld*, JSGlobalContextRef, JSObjectRef windowObject) = 0;
  50. virtual void didReceiveTitleForFrame(const String& title, WebCore::Frame*) = 0;
  51. virtual void didDecidePolicyForNavigationAction(const WebCore::NavigationAction&, const WebCore::ResourceRequest&, WebCore::Frame*) = 0;
  52. virtual void didDecidePolicyForResponse(const WebCore::ResourceResponse&) = 0;
  53. virtual void didDispatchWillPerformClientRedirect() = 0;
  54. virtual void didHandleOnloadEventsForFrame(WebCore::Frame*) = 0;
  55. // ChromeClient delegates
  56. virtual void addMessageToConsole(const String& message, unsigned lineNumber, unsigned columnNumber, const String& sourceID) = 0;
  57. virtual void runJavaScriptAlert(const String& message) = 0;
  58. virtual bool runJavaScriptConfirm(const String& message) = 0;
  59. virtual String runJavaScriptPrompt(const String& message, const String& defaultValue) = 0;
  60. virtual bool runBeforeUnloadConfirmPanel(const String& message) = 0;
  61. virtual void setStatusText(const String&) = 0;
  62. virtual void exceededDatabaseQuota(WebCore::SecurityOrigin*, const String& name) = 0;
  63. virtual bool allowsOpeningWindow() = 0;
  64. virtual void windowCreated(WebPage*) = 0;
  65. // EditorClient delegates
  66. virtual void setAcceptsEditing(bool) = 0;
  67. virtual void didBeginEditing() = 0;
  68. virtual void didEndEditing() = 0;
  69. virtual void didChange() = 0;
  70. virtual void didChangeSelection() = 0;
  71. virtual bool shouldBeginEditingInDOMRange(WebCore::Range*) = 0;
  72. virtual bool shouldEndEditingInDOMRange(WebCore::Range*) = 0;
  73. virtual bool shouldDeleteDOMRange(WebCore::Range*) = 0;
  74. virtual bool shouldChangeSelectedDOMRangeToDOMRangeAffinityStillSelecting(WebCore::Range* fromRange, WebCore::Range* toRange, int affinity, bool stillSelecting) = 0;
  75. virtual bool shouldInsertNode(WebCore::Node*, WebCore::Range*, int insertAction) = 0;
  76. virtual bool shouldInsertText(const String&, WebCore::Range*, int insertAction) = 0;
  77. virtual bool didReceiveAuthenticationChallenge(WebCore::Credential&) = 0;
  78. };
  79. }
  80. }
  81. #endif // DumpRenderTreeClient_h