michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #pragma once michael@0: michael@0: #include "mozwrlbase.h" michael@0: michael@0: #include "mozilla/layers/GeckoContentController.h" michael@0: #include "mozilla/layers/APZCTreeManager.h" michael@0: #include "mozilla/EventForwards.h" michael@0: #include "FrameMetrics.h" michael@0: #include "Units.h" michael@0: michael@0: class nsIWidgetListener; michael@0: michael@0: namespace mozilla { michael@0: namespace widget { michael@0: namespace winrt { michael@0: michael@0: class APZController : michael@0: public mozilla::layers::GeckoContentController michael@0: { michael@0: typedef mozilla::layers::FrameMetrics FrameMetrics; michael@0: typedef mozilla::layers::ScrollableLayerGuid ScrollableLayerGuid; michael@0: typedef mozilla::layers::ZoomConstraints ZoomConstraints; michael@0: michael@0: public: michael@0: APZController() : michael@0: mWidgetListener(nullptr) michael@0: { michael@0: } michael@0: michael@0: // GeckoContentController interface michael@0: virtual void RequestContentRepaint(const FrameMetrics& aFrameMetrics); michael@0: virtual void AcknowledgeScrollUpdate(const FrameMetrics::ViewID& aScrollId, const uint32_t& aScrollGeneration); michael@0: virtual void HandleDoubleTap(const mozilla::CSSPoint& aPoint, michael@0: int32_t aModifiers, michael@0: const mozilla::layers::ScrollableLayerGuid& aGuid); michael@0: virtual void HandleSingleTap(const mozilla::CSSPoint& aPoint, michael@0: int32_t aModifiers, michael@0: const mozilla::layers::ScrollableLayerGuid& aGuid); michael@0: virtual void HandleLongTap(const mozilla::CSSPoint& aPoint, michael@0: int32_t aModifiers, michael@0: const mozilla::layers::ScrollableLayerGuid& aGuid); michael@0: virtual void HandleLongTapUp(const mozilla::CSSPoint& aPoint, michael@0: int32_t aModifiers, michael@0: const mozilla::layers::ScrollableLayerGuid& aGuid); michael@0: virtual void SendAsyncScrollDOMEvent(bool aIsRoot, const mozilla::CSSRect &aContentRect, const mozilla::CSSSize &aScrollableSize); michael@0: virtual void PostDelayedTask(Task* aTask, int aDelayMs); michael@0: virtual bool GetRootZoomConstraints(ZoomConstraints* aOutConstraints); michael@0: virtual void NotifyAPZStateChange(const ScrollableLayerGuid& aGuid, michael@0: APZStateChange aChange, michael@0: int aArg); michael@0: michael@0: void SetWidgetListener(nsIWidgetListener* aWidgetListener); michael@0: michael@0: bool HitTestAPZC(mozilla::ScreenIntPoint& aPoint); michael@0: void TransformCoordinateToGecko(const mozilla::ScreenIntPoint& aPoint, michael@0: LayoutDeviceIntPoint* aRefPointOut); michael@0: void ContentReceivedTouch(const ScrollableLayerGuid& aGuid, bool aPreventDefault); michael@0: nsEventStatus ReceiveInputEvent(mozilla::WidgetInputEvent* aEvent, michael@0: ScrollableLayerGuid* aOutTargetGuid); michael@0: michael@0: public: michael@0: // todo: make this a member variable as prep for multiple views michael@0: static nsRefPtr sAPZC; michael@0: michael@0: private: michael@0: nsIWidgetListener* mWidgetListener; michael@0: }; michael@0: michael@0: } } }