2013-09-06 12:56:14 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "mozwrlbase.h"
|
|
|
|
|
|
|
|
#include "mozilla/layers/GeckoContentController.h"
|
2013-11-01 03:09:37 -07:00
|
|
|
#include "mozilla/layers/APZCTreeManager.h"
|
2013-11-10 08:43:18 -08:00
|
|
|
#include "mozilla/EventForwards.h"
|
2013-09-06 12:56:14 -07:00
|
|
|
#include "FrameMetrics.h"
|
|
|
|
#include "Units.h"
|
|
|
|
|
2013-11-01 03:09:37 -07:00
|
|
|
class nsIWidgetListener;
|
|
|
|
|
2013-09-06 12:56:14 -07:00
|
|
|
namespace mozilla {
|
|
|
|
namespace widget {
|
|
|
|
namespace winrt {
|
|
|
|
|
2013-11-01 03:09:37 -07:00
|
|
|
class APZController :
|
|
|
|
public mozilla::layers::GeckoContentController
|
2013-09-06 12:56:14 -07:00
|
|
|
{
|
|
|
|
typedef mozilla::layers::FrameMetrics FrameMetrics;
|
2013-11-10 08:43:18 -08:00
|
|
|
typedef mozilla::layers::ScrollableLayerGuid ScrollableLayerGuid;
|
2013-09-06 12:56:14 -07:00
|
|
|
|
|
|
|
public:
|
2013-11-18 07:14:08 -08:00
|
|
|
APZController() :
|
|
|
|
mWidgetListener(nullptr)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2013-11-01 03:09:37 -07:00
|
|
|
// GeckoContentController interface
|
2013-09-06 12:56:14 -07:00
|
|
|
virtual void RequestContentRepaint(const FrameMetrics& aFrameMetrics);
|
|
|
|
virtual void HandleDoubleTap(const mozilla::CSSIntPoint& aPoint);
|
|
|
|
virtual void HandleSingleTap(const mozilla::CSSIntPoint& aPoint);
|
|
|
|
virtual void HandleLongTap(const mozilla::CSSIntPoint& aPoint);
|
2013-11-08 16:07:00 -08:00
|
|
|
virtual void SendAsyncScrollDOMEvent(bool aIsRoot, const mozilla::CSSRect &aContentRect, const mozilla::CSSSize &aScrollableSize);
|
2013-09-06 12:56:14 -07:00
|
|
|
virtual void PostDelayedTask(Task* aTask, int aDelayMs);
|
|
|
|
virtual void HandlePanBegin();
|
|
|
|
virtual void HandlePanEnd();
|
2013-11-01 03:09:37 -07:00
|
|
|
|
|
|
|
void SetWidgetListener(nsIWidgetListener* aWidgetListener);
|
|
|
|
void UpdateScrollOffset(const mozilla::layers::ScrollableLayerGuid& aScrollLayerId, CSSIntPoint& aScrollOffset);
|
|
|
|
|
2013-11-10 08:43:18 -08:00
|
|
|
bool HitTestAPZC(mozilla::ScreenIntPoint& aPoint);
|
|
|
|
void TransformCoordinateToGecko(const mozilla::ScreenIntPoint& aPoint,
|
|
|
|
LayoutDeviceIntPoint* aRefPointOut);
|
2013-11-10 08:43:18 -08:00
|
|
|
void ContentReceivedTouch(const ScrollableLayerGuid& aGuid, bool aPreventDefault);
|
|
|
|
nsEventStatus ReceiveInputEvent(mozilla::WidgetInputEvent* aEvent,
|
|
|
|
ScrollableLayerGuid* aOutTargetGuid);
|
|
|
|
nsEventStatus ReceiveInputEvent(mozilla::WidgetInputEvent* aInEvent,
|
|
|
|
ScrollableLayerGuid* aOutTargetGuid,
|
|
|
|
mozilla::WidgetInputEvent* aOutEvent);
|
|
|
|
|
2013-11-01 03:09:37 -07:00
|
|
|
public:
|
2013-11-10 08:43:18 -08:00
|
|
|
// todo: make this a member variable as prep for multiple views
|
2013-11-01 03:09:37 -07:00
|
|
|
static nsRefPtr<mozilla::layers::APZCTreeManager> sAPZC;
|
|
|
|
|
|
|
|
private:
|
|
|
|
nsIWidgetListener* mWidgetListener;
|
2013-11-18 07:14:08 -08:00
|
|
|
ScrollableLayerGuid mLastScrollLayerGuid;
|
2013-11-01 03:09:37 -07:00
|
|
|
CSSIntPoint mLastScrollOffset;
|
2013-09-06 12:56:14 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
} } }
|