1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef nsDOMWindowUtils_h_
7 #define nsDOMWindowUtils_h_
9 #include "nsWeakReference.h"
11 #include "nsIDOMWindowUtils.h"
12 #include "mozilla/Attributes.h"
17 class nsDOMWindowUtils MOZ_FINAL
: public nsIDOMWindowUtils
,
18 public nsSupportsWeakReference
21 nsDOMWindowUtils(nsGlobalWindow
*aWindow
);
24 NS_DECL_NSIDOMWINDOWUTILS
29 // If aOffset is non-null, it gets filled in with the offset of the root
30 // frame of our window to the nearest widget in the app units of our window.
31 // Add this offset to any event offset we're given to make it relative to the
32 // widget returned by GetWidget.
33 nsIWidget
* GetWidget(nsPoint
* aOffset
= nullptr);
34 nsIWidget
* GetWidgetForElement(nsIDOMElement
* aElement
);
36 nsIPresShell
* GetPresShell();
37 nsPresContext
* GetPresContext();
39 NS_IMETHOD
SendMouseEventCommon(const nsAString
& aType
,
45 bool aIgnoreRootScrollFrame
,
47 unsigned short aInputSourceArg
,
49 bool *aPreventDefault
);
51 NS_IMETHOD
SendTouchEventCommon(const nsAString
& aType
,
52 uint32_t* aIdentifiers
,
57 float* aRotationAngles
,
61 bool aIgnoreRootScrollFrame
,
63 bool* aPreventDefault
);
66 static mozilla::Modifiers
GetWidgetModifiers(int32_t aModifiers
);