LCOV - code coverage report
Current view: top level - dom/base - nsDOMWindowUtils.h (source / functions) Hit Total Coverage
Test: output.info Lines: 0 12 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 3 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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 nsDOMWindowUtils_h_
       8             : #define nsDOMWindowUtils_h_
       9             : 
      10             : #include "nsWeakReference.h"
      11             : 
      12             : #include "nsIDOMWindowUtils.h"
      13             : #include "mozilla/Attributes.h"
      14             : #include "mozilla/BasicEvents.h"
      15             : 
      16             : class nsGlobalWindow;
      17             : class nsIPresShell;
      18             : class nsIWidget;
      19             : class nsPresContext;
      20             : class nsIDocument;
      21             : class nsView;
      22             : struct nsPoint;
      23             : 
      24             : namespace mozilla {
      25             :   namespace layers {
      26             :     class LayerTransactionChild;
      27             :     class WebRenderBridgeChild;
      28             :   } // namespace layers
      29             : } // namespace mozilla
      30             : 
      31             : class nsTranslationNodeList final : public nsITranslationNodeList
      32             : {
      33             : public:
      34           0 :   nsTranslationNodeList()
      35           0 :   {
      36           0 :     mNodes.SetCapacity(1000);
      37           0 :     mNodeIsRoot.SetCapacity(1000);
      38           0 :     mLength = 0;
      39           0 :   }
      40             : 
      41             :   NS_DECL_ISUPPORTS
      42             :   NS_DECL_NSITRANSLATIONNODELIST
      43             : 
      44           0 :   void AppendElement(nsIDOMNode* aElement, bool aIsRoot)
      45             :   {
      46           0 :     mNodes.AppendElement(aElement);
      47           0 :     mNodeIsRoot.AppendElement(aIsRoot);
      48           0 :     mLength++;
      49           0 :   }
      50             : 
      51             : private:
      52           0 :   ~nsTranslationNodeList() {}
      53             : 
      54             :   nsTArray<nsCOMPtr<nsIDOMNode> > mNodes;
      55             :   nsTArray<bool> mNodeIsRoot;
      56             :   uint32_t mLength;
      57             : };
      58             : 
      59             : class nsDOMWindowUtils final : public nsIDOMWindowUtils,
      60             :                                public nsSupportsWeakReference
      61             : {
      62             :   typedef mozilla::widget::TextEventDispatcher
      63             :     TextEventDispatcher;
      64             : public:
      65             :   explicit nsDOMWindowUtils(nsGlobalWindow *aWindow);
      66             :   NS_DECL_ISUPPORTS
      67             :   NS_DECL_NSIDOMWINDOWUTILS
      68             : 
      69             : protected:
      70             :   ~nsDOMWindowUtils();
      71             : 
      72             :   nsWeakPtr mWindow;
      73             : 
      74             :   // If aOffset is non-null, it gets filled in with the offset of the root
      75             :   // frame of our window to the nearest widget in the app units of our window.
      76             :   // Add this offset to any event offset we're given to make it relative to the
      77             :   // widget returned by GetWidget.
      78             :   nsIWidget* GetWidget(nsPoint* aOffset = nullptr);
      79             :   nsIWidget* GetWidgetForElement(nsIDOMElement* aElement);
      80             : 
      81             :   nsIPresShell* GetPresShell();
      82             :   nsPresContext* GetPresContext();
      83             :   nsIDocument* GetDocument();
      84             :   mozilla::layers::LayerTransactionChild* GetLayerTransaction();
      85             :   mozilla::layers::WebRenderBridgeChild* GetWebRenderBridge();
      86             : 
      87             :   NS_IMETHOD SendMouseEventCommon(const nsAString& aType,
      88             :                                   float aX,
      89             :                                   float aY,
      90             :                                   int32_t aButton,
      91             :                                   int32_t aClickCount,
      92             :                                   int32_t aModifiers,
      93             :                                   bool aIgnoreRootScrollFrame,
      94             :                                   float aPressure,
      95             :                                   unsigned short aInputSourceArg,
      96             :                                   uint32_t aIdentifier,
      97             :                                   bool aToWindow,
      98             :                                   bool *aPreventDefault,
      99             :                                   bool aIsDOMEventSynthesized,
     100             :                                   bool aIsWidgetEventSynthesized,
     101             :                                   int32_t aButtons);
     102             : 
     103             :   NS_IMETHOD SendPointerEventCommon(const nsAString& aType,
     104             :                                     float aX,
     105             :                                     float aY,
     106             :                                     int32_t aButton,
     107             :                                     int32_t aClickCount,
     108             :                                     int32_t aModifiers,
     109             :                                     bool aIgnoreRootScrollFrame,
     110             :                                     float aPressure,
     111             :                                     unsigned short aInputSourceArg,
     112             :                                     int32_t aPointerId,
     113             :                                     int32_t aWidth,
     114             :                                     int32_t aHeight,
     115             :                                     int32_t aTiltX,
     116             :                                     int32_t aTiltY,
     117             :                                     bool aIsPrimary,
     118             :                                     bool aIsSynthesized,
     119             :                                     uint8_t aOptionalArgCount,
     120             :                                     bool aToWindow,
     121             :                                     bool* aPreventDefault);
     122             : 
     123             :   NS_IMETHOD SendTouchEventCommon(const nsAString& aType,
     124             :                                   uint32_t* aIdentifiers,
     125             :                                   int32_t* aXs,
     126             :                                   int32_t* aYs,
     127             :                                   uint32_t* aRxs,
     128             :                                   uint32_t* aRys,
     129             :                                   float* aRotationAngles,
     130             :                                   float* aForces,
     131             :                                   uint32_t aCount,
     132             :                                   int32_t aModifiers,
     133             :                                   bool aIgnoreRootScrollFrame,
     134             :                                   bool aToWindow,
     135             :                                   bool* aPreventDefault);
     136             : };
     137             : 
     138             : #endif

Generated by: LCOV version 1.13