1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_layers_APZCTreeManagerChild_h
8 #define mozilla_layers_APZCTreeManagerChild_h
10 #include "mozilla/layers/APZInputBridge.h"
11 #include "mozilla/layers/IAPZCTreeManager.h"
12 #include "mozilla/layers/PAPZCTreeManagerChild.h"
17 class APZInputBridgeChild
;
18 class RemoteCompositorSession
;
20 class APZCTreeManagerChild
: public IAPZCTreeManager
,
21 public PAPZCTreeManagerChild
{
22 friend class PAPZCTreeManagerChild
;
23 using TapType
= GeckoContentController_TapType
;
26 APZCTreeManagerChild();
28 void SetCompositorSession(RemoteCompositorSession
* aSession
);
29 void SetInputBridge(APZInputBridgeChild
* aInputBridge
);
32 void SetKeyboardMap(const KeyboardMap
& aKeyboardMap
) override
;
34 void ZoomToRect(const ScrollableLayerGuid
& aGuid
, const CSSRect
& aRect
,
35 const uint32_t aFlags
= DEFAULT_BEHAVIOR
) override
;
37 void ContentReceivedInputBlock(uint64_t aInputBlockId
,
38 bool aPreventDefault
) override
;
40 void SetTargetAPZC(uint64_t aInputBlockId
,
41 const nsTArray
<ScrollableLayerGuid
>& aTargets
) override
;
43 void UpdateZoomConstraints(
44 const ScrollableLayerGuid
& aGuid
,
45 const Maybe
<ZoomConstraints
>& aConstraints
) override
;
47 void SetDPI(float aDpiValue
) override
;
49 void SetAllowedTouchBehavior(
50 uint64_t aInputBlockId
,
51 const nsTArray
<TouchBehaviorFlags
>& aValues
) override
;
53 void StartScrollbarDrag(const ScrollableLayerGuid
& aGuid
,
54 const AsyncDragMetrics
& aDragMetrics
) override
;
56 bool StartAutoscroll(const ScrollableLayerGuid
& aGuid
,
57 const ScreenPoint
& aAnchorLocation
) override
;
59 void StopAutoscroll(const ScrollableLayerGuid
& aGuid
) override
;
61 void SetLongTapEnabled(bool aTapGestureEnabled
) override
;
63 APZInputBridge
* InputBridge() override
;
65 void AddInputBlockCallback(uint64_t aInputBlockId
,
66 InputBlockCallback
&& aCallback
) override
;
68 void AddIPDLReference();
69 void ReleaseIPDLReference();
70 void ActorDestroy(ActorDestroyReason aWhy
) override
;
73 MOZ_CAN_RUN_SCRIPT_BOUNDARY
74 mozilla::ipc::IPCResult
RecvHandleTap(const TapType
& aType
,
75 const LayoutDevicePoint
& aPoint
,
76 const Modifiers
& aModifiers
,
77 const ScrollableLayerGuid
& aGuid
,
78 const uint64_t& aInputBlockId
);
80 mozilla::ipc::IPCResult
RecvNotifyPinchGesture(
81 const PinchGestureType
& aType
, const ScrollableLayerGuid
& aGuid
,
82 const LayoutDevicePoint
& aFocusPoint
,
83 const LayoutDeviceCoord
& aSpanChange
, const Modifiers
& aModifiers
);
85 mozilla::ipc::IPCResult
RecvCancelAutoscroll(
86 const ScrollableLayerGuid::ViewID
& aScrollId
);
88 virtual ~APZCTreeManagerChild();
91 MOZ_NON_OWNING_REF RemoteCompositorSession
* mCompositorSession
;
92 RefPtr
<APZInputBridgeChild
> mInputBridge
;
97 } // namespace mozilla
99 #endif // mozilla_layers_APZCTreeManagerChild_h