APZCTreeManagerParent.h (2919B)
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/. */ 6 7 #ifndef mozilla_layers_APZCTreeManagerParent_h 8 #define mozilla_layers_APZCTreeManagerParent_h 9 10 #include "mozilla/layers/PAPZCTreeManagerParent.h" 11 12 namespace mozilla { 13 namespace layers { 14 15 class APZCTreeManager; 16 class APZUpdater; 17 18 class APZCTreeManagerParent : public PAPZCTreeManagerParent { 19 public: 20 APZCTreeManagerParent(LayersId aLayersId, 21 RefPtr<APZCTreeManager> aAPZCTreeManager, 22 RefPtr<APZUpdater> mAPZUpdater); 23 virtual ~APZCTreeManagerParent(); 24 25 LayersId GetLayersId() const { return mLayersId; } 26 27 /** 28 * Called when the layer tree that this protocol is connected to 29 * is adopted by another compositor, and we need to switch APZCTreeManagers. 30 */ 31 void ChildAdopted(RefPtr<APZCTreeManager> aAPZCTreeManager, 32 RefPtr<APZUpdater> aAPZUpdater); 33 34 mozilla::ipc::IPCResult RecvSetKeyboardMap(const KeyboardMap& aKeyboardMap); 35 36 mozilla::ipc::IPCResult RecvZoomToRect(const ScrollableLayerGuid& aGuid, 37 const ZoomTarget& aZoomTarget, 38 const uint32_t& aFlags); 39 40 mozilla::ipc::IPCResult RecvContentReceivedInputBlock( 41 const uint64_t& aInputBlockId, const bool& aPreventDefault); 42 43 mozilla::ipc::IPCResult RecvSetTargetAPZC( 44 const uint64_t& aInputBlockId, nsTArray<ScrollableLayerGuid>&& aTargets); 45 46 mozilla::ipc::IPCResult RecvUpdateZoomConstraints( 47 const ScrollableLayerGuid& aGuid, 48 const Maybe<ZoomConstraints>& aConstraints); 49 50 mozilla::ipc::IPCResult RecvSetDPI(const float& aDpiValue); 51 52 mozilla::ipc::IPCResult RecvSetAllowedTouchBehavior( 53 const uint64_t& aInputBlockId, nsTArray<TouchBehaviorFlags>&& aValues); 54 55 mozilla::ipc::IPCResult RecvSetBrowserGestureResponse( 56 const uint64_t& aInputBlockId, const BrowserGestureResponse& aResponse); 57 58 mozilla::ipc::IPCResult RecvStartScrollbarDrag( 59 const ScrollableLayerGuid& aGuid, const AsyncDragMetrics& aDragMetrics); 60 61 mozilla::ipc::IPCResult RecvStartAutoscroll( 62 const ScrollableLayerGuid& aGuid, const ScreenPoint& aAnchorLocation); 63 64 mozilla::ipc::IPCResult RecvStopAutoscroll(const ScrollableLayerGuid& aGuid); 65 66 mozilla::ipc::IPCResult RecvSetLongTapEnabled(const bool& aTapGestureEnabled); 67 68 void ActorDestroy(ActorDestroyReason aWhy) override {} 69 70 private: 71 bool IsGuidValid(const ScrollableLayerGuid& aGuid); 72 73 LayersId mLayersId; 74 RefPtr<APZCTreeManager> mTreeManager; 75 RefPtr<APZUpdater> mUpdater; 76 }; 77 78 } // namespace layers 79 } // namespace mozilla 80 81 #endif // mozilla_layers_APZCTreeManagerParent_h