ScrollingTreeScrollingNodeDelegateIOS.h [plain text]
#if PLATFORM(IOS_FAMILY) && ENABLE(ASYNC_SCROLLING)
#import <UIKit/UIScrollView.h>
#import <WebCore/ScrollingCoordinator.h>
#import <WebCore/ScrollingTreeScrollingNode.h>
#import <WebCore/ScrollingTreeScrollingNodeDelegate.h>
@class CALayer;
@class UIScrollView;
@class WKScrollingNodeScrollViewDelegate;
namespace WebCore {
class FloatPoint;
class FloatRect;
class FloatSize;
class ScrollingTreeScrollingNode;
}
namespace WebKit {
class ScrollingTreeScrollingNodeDelegateIOS : public WebCore::ScrollingTreeScrollingNodeDelegate {
WTF_MAKE_FAST_ALLOCATED;
public:
explicit ScrollingTreeScrollingNodeDelegateIOS(WebCore::ScrollingTreeScrollingNode&);
~ScrollingTreeScrollingNodeDelegateIOS() final;
void scrollWillStart() const;
void scrollDidEnd() const;
void scrollViewWillStartPanGesture() const;
void scrollViewDidScroll(const WebCore::FloatPoint& scrollOffset, bool inUserInteraction);
void currentSnapPointIndicesDidChange(unsigned horizontal, unsigned vertical) const;
CALayer *scrollLayer() const { return m_scrollLayer.get(); }
void resetScrollViewDelegate();
void commitStateBeforeChildren(const WebCore::ScrollingStateScrollingNode&);
void commitStateAfterChildren(const WebCore::ScrollingStateScrollingNode&);
void repositionScrollingLayers();
#if HAVE(UISCROLLVIEW_ASYNCHRONOUS_SCROLL_EVENT_HANDLING)
void handleAsynchronousCancelableScrollEvent(UIScrollView *, UIScrollEvent *, void (^completion)(BOOL handled));
#endif
OptionSet<WebCore::TouchAction> activeTouchActions() const { return m_activeTouchActions; }
void computeActiveTouchActionsForGestureRecognizer(UIGestureRecognizer*);
void clearActiveTouchActions() { m_activeTouchActions = { }; }
void cancelPointersForGestureRecognizer(UIGestureRecognizer*);
UIScrollView *findActingScrollParent(UIScrollView *);
UIScrollView *scrollView() const;
private:
RetainPtr<CALayer> m_scrollLayer;
RetainPtr<CALayer> m_scrolledContentsLayer;
RetainPtr<WKScrollingNodeScrollViewDelegate> m_scrollViewDelegate;
OptionSet<WebCore::TouchAction> m_activeTouchActions { };
bool m_updatingFromStateNode { false };
};
}
@interface WKScrollingNodeScrollViewDelegate : NSObject <UIScrollViewDelegate> {
WebKit::ScrollingTreeScrollingNodeDelegateIOS* _scrollingTreeNodeDelegate;
}
@property (nonatomic, getter=_isInUserInteraction) BOOL inUserInteraction;
- (instancetype)initWithScrollingTreeNodeDelegate:(WebKit::ScrollingTreeScrollingNodeDelegateIOS*)delegate;
@end
#endif // PLATFORM(IOS_FAMILY) && ENABLE(ASYNC_SCROLLING)