widget/windows/winrt/APZController.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/widget/windows/winrt/APZController.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,73 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +#pragma once
     1.9 +
    1.10 +#include "mozwrlbase.h"
    1.11 +
    1.12 +#include "mozilla/layers/GeckoContentController.h"
    1.13 +#include "mozilla/layers/APZCTreeManager.h"
    1.14 +#include "mozilla/EventForwards.h"
    1.15 +#include "FrameMetrics.h"
    1.16 +#include "Units.h"
    1.17 +
    1.18 +class nsIWidgetListener;
    1.19 +
    1.20 +namespace mozilla {
    1.21 +namespace widget {
    1.22 +namespace winrt {
    1.23 +
    1.24 +class APZController :
    1.25 +  public mozilla::layers::GeckoContentController
    1.26 +{
    1.27 +  typedef mozilla::layers::FrameMetrics FrameMetrics;
    1.28 +  typedef mozilla::layers::ScrollableLayerGuid ScrollableLayerGuid;
    1.29 +  typedef mozilla::layers::ZoomConstraints ZoomConstraints;
    1.30 +
    1.31 +public:
    1.32 +  APZController() :
    1.33 +    mWidgetListener(nullptr)
    1.34 +  {
    1.35 +  }
    1.36 +
    1.37 +  // GeckoContentController interface
    1.38 +  virtual void RequestContentRepaint(const FrameMetrics& aFrameMetrics);
    1.39 +  virtual void AcknowledgeScrollUpdate(const FrameMetrics::ViewID& aScrollId, const uint32_t& aScrollGeneration);
    1.40 +  virtual void HandleDoubleTap(const mozilla::CSSPoint& aPoint,
    1.41 +                               int32_t aModifiers,
    1.42 +                               const mozilla::layers::ScrollableLayerGuid& aGuid);
    1.43 +  virtual void HandleSingleTap(const mozilla::CSSPoint& aPoint,
    1.44 +                               int32_t aModifiers,
    1.45 +                               const mozilla::layers::ScrollableLayerGuid& aGuid);
    1.46 +  virtual void HandleLongTap(const mozilla::CSSPoint& aPoint,
    1.47 +                             int32_t aModifiers,
    1.48 +                             const mozilla::layers::ScrollableLayerGuid& aGuid);
    1.49 +  virtual void HandleLongTapUp(const mozilla::CSSPoint& aPoint,
    1.50 +                               int32_t aModifiers,
    1.51 +                               const mozilla::layers::ScrollableLayerGuid& aGuid);
    1.52 +  virtual void SendAsyncScrollDOMEvent(bool aIsRoot, const mozilla::CSSRect &aContentRect, const mozilla::CSSSize &aScrollableSize);
    1.53 +  virtual void PostDelayedTask(Task* aTask, int aDelayMs);
    1.54 +  virtual bool GetRootZoomConstraints(ZoomConstraints* aOutConstraints);
    1.55 +  virtual void NotifyAPZStateChange(const ScrollableLayerGuid& aGuid,
    1.56 +                                    APZStateChange aChange,
    1.57 +                                    int aArg);
    1.58 +  
    1.59 +  void SetWidgetListener(nsIWidgetListener* aWidgetListener);
    1.60 +
    1.61 +  bool HitTestAPZC(mozilla::ScreenIntPoint& aPoint);
    1.62 +  void TransformCoordinateToGecko(const mozilla::ScreenIntPoint& aPoint,
    1.63 +                                  LayoutDeviceIntPoint* aRefPointOut);
    1.64 +  void ContentReceivedTouch(const ScrollableLayerGuid& aGuid, bool aPreventDefault);
    1.65 +  nsEventStatus ReceiveInputEvent(mozilla::WidgetInputEvent* aEvent,
    1.66 +                                  ScrollableLayerGuid* aOutTargetGuid);
    1.67 +
    1.68 +public:
    1.69 +  // todo: make this a member variable as prep for multiple views
    1.70 +  static nsRefPtr<mozilla::layers::APZCTreeManager> sAPZC;
    1.71 +
    1.72 +private:
    1.73 +  nsIWidgetListener* mWidgetListener;
    1.74 +};
    1.75 +
    1.76 +} } }

mercurial