InRegionScrollableArea.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * Copyright (C) 2011, 2012 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 InRegionScrollableArea_h
  19. #define InRegionScrollableArea_h
  20. #include "IntRect.h"
  21. #include <interaction/ScrollViewBase.h>
  22. namespace WebCore {
  23. class Document;
  24. class LayerWebKitThread;
  25. class Node;
  26. class RenderLayer;
  27. }
  28. namespace BlackBerry {
  29. namespace WebKit {
  30. class WebPagePrivate;
  31. class InRegionScrollableArea : public Platform::ScrollViewBase {
  32. public:
  33. InRegionScrollableArea();
  34. InRegionScrollableArea(WebPagePrivate*, WebCore::RenderLayer*);
  35. virtual ~InRegionScrollableArea();
  36. void setVisibleWindowRect(const WebCore::IntRect&);
  37. Platform::IntRect visibleWindowRect() const;
  38. WebCore::RenderLayer* layer() const;
  39. WebCore::Document* document() const;
  40. WebCore::LayerWebKitThread* cachedScrollableLayer() const;
  41. WebCore::Node* cachedScrollableNode() const;
  42. private:
  43. WebPagePrivate* m_webPage;
  44. WebCore::RenderLayer* m_layer;
  45. WebCore::Document* m_document;
  46. // We either cache one here: in case of a composited scrollable layer
  47. // cache the LayerWebKitThread. Otherwise, the Node.
  48. RefPtr<WebCore::LayerWebKitThread> m_cachedCompositedScrollableLayer;
  49. RefPtr<WebCore::Node> m_cachedNonCompositedScrollableNode;
  50. bool m_hasWindowVisibleRectCalculated;
  51. };
  52. }
  53. }
  54. #endif