PagePopupClient.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * Copyright (C) 2013 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 PagePopupClient_h
  19. #define PagePopupClient_h
  20. #include "DocumentWriter.h"
  21. #include "IntRect.h"
  22. #include <wtf/text/WTFString.h>
  23. namespace WebCore {
  24. class DocumentWriter;
  25. class HTMLInputElement;
  26. }
  27. namespace BlackBerry {
  28. namespace WebKit {
  29. class WebPagePrivate;
  30. class PagePopupClient {
  31. public:
  32. virtual WebCore::IntSize contentSize();
  33. // Provide an HTML source through the specified DocumentWriter. The HTML
  34. // source is rendered in a PagePopup.
  35. // The content HTML supports:
  36. // - No <select> popups
  37. // - window.setValueAndClosePopup(number, string).
  38. virtual void writeDocument(WebCore::DocumentWriter&);
  39. // This is called by the content HTML of a PagePopup.
  40. // An implementation of this function should call closePopup().
  41. virtual void setValueAndClosePopup(const String& stringValue) = 0;
  42. // This is called whenever a PagePopup was closed.
  43. virtual void didClosePopup();
  44. virtual ~PagePopupClient() { }
  45. protected:
  46. PagePopupClient(WebPagePrivate*);
  47. // This is called by the content HTML of a PagePopup.
  48. virtual void closePopup();
  49. WebPagePrivate* m_webPagePrivate;
  50. String m_source;
  51. };
  52. }
  53. }
  54. #endif