widget/windows/winrt/APZController.h

Wed, 31 Dec 2014 07:22:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:22:50 +0100
branch
TOR_BUG_3246
changeset 4
fc2d59ddac77
permissions
-rw-r--r--

Correct previous dual key logic pending first delivery installment.

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 #pragma once
     7 #include "mozwrlbase.h"
     9 #include "mozilla/layers/GeckoContentController.h"
    10 #include "mozilla/layers/APZCTreeManager.h"
    11 #include "mozilla/EventForwards.h"
    12 #include "FrameMetrics.h"
    13 #include "Units.h"
    15 class nsIWidgetListener;
    17 namespace mozilla {
    18 namespace widget {
    19 namespace winrt {
    21 class APZController :
    22   public mozilla::layers::GeckoContentController
    23 {
    24   typedef mozilla::layers::FrameMetrics FrameMetrics;
    25   typedef mozilla::layers::ScrollableLayerGuid ScrollableLayerGuid;
    26   typedef mozilla::layers::ZoomConstraints ZoomConstraints;
    28 public:
    29   APZController() :
    30     mWidgetListener(nullptr)
    31   {
    32   }
    34   // GeckoContentController interface
    35   virtual void RequestContentRepaint(const FrameMetrics& aFrameMetrics);
    36   virtual void AcknowledgeScrollUpdate(const FrameMetrics::ViewID& aScrollId, const uint32_t& aScrollGeneration);
    37   virtual void HandleDoubleTap(const mozilla::CSSPoint& aPoint,
    38                                int32_t aModifiers,
    39                                const mozilla::layers::ScrollableLayerGuid& aGuid);
    40   virtual void HandleSingleTap(const mozilla::CSSPoint& aPoint,
    41                                int32_t aModifiers,
    42                                const mozilla::layers::ScrollableLayerGuid& aGuid);
    43   virtual void HandleLongTap(const mozilla::CSSPoint& aPoint,
    44                              int32_t aModifiers,
    45                              const mozilla::layers::ScrollableLayerGuid& aGuid);
    46   virtual void HandleLongTapUp(const mozilla::CSSPoint& aPoint,
    47                                int32_t aModifiers,
    48                                const mozilla::layers::ScrollableLayerGuid& aGuid);
    49   virtual void SendAsyncScrollDOMEvent(bool aIsRoot, const mozilla::CSSRect &aContentRect, const mozilla::CSSSize &aScrollableSize);
    50   virtual void PostDelayedTask(Task* aTask, int aDelayMs);
    51   virtual bool GetRootZoomConstraints(ZoomConstraints* aOutConstraints);
    52   virtual void NotifyAPZStateChange(const ScrollableLayerGuid& aGuid,
    53                                     APZStateChange aChange,
    54                                     int aArg);
    56   void SetWidgetListener(nsIWidgetListener* aWidgetListener);
    58   bool HitTestAPZC(mozilla::ScreenIntPoint& aPoint);
    59   void TransformCoordinateToGecko(const mozilla::ScreenIntPoint& aPoint,
    60                                   LayoutDeviceIntPoint* aRefPointOut);
    61   void ContentReceivedTouch(const ScrollableLayerGuid& aGuid, bool aPreventDefault);
    62   nsEventStatus ReceiveInputEvent(mozilla::WidgetInputEvent* aEvent,
    63                                   ScrollableLayerGuid* aOutTargetGuid);
    65 public:
    66   // todo: make this a member variable as prep for multiple views
    67   static nsRefPtr<mozilla::layers::APZCTreeManager> sAPZC;
    69 private:
    70   nsIWidgetListener* mWidgetListener;
    71 };
    73 } } }

mercurial