2004-06-20 20:42:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2004-06-20 20:42:13 +04:00
|
|
|
|
2012-11-20 05:05:34 +04:00
|
|
|
#ifndef nsDOMWindowUtils_h_
|
|
|
|
#define nsDOMWindowUtils_h_
|
|
|
|
|
2004-06-20 20:42:13 +04:00
|
|
|
#include "nsWeakReference.h"
|
|
|
|
|
|
|
|
#include "nsIDOMWindowUtils.h"
|
2012-06-15 06:31:55 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2004-06-20 20:42:13 +04:00
|
|
|
|
2004-12-10 22:48:22 +03:00
|
|
|
class nsGlobalWindow;
|
2010-09-04 00:10:45 +04:00
|
|
|
class nsIPresShell;
|
2004-06-20 20:42:13 +04:00
|
|
|
|
2012-06-15 06:31:55 +04:00
|
|
|
class nsDOMWindowUtils MOZ_FINAL : public nsIDOMWindowUtils,
|
|
|
|
public nsSupportsWeakReference
|
2004-06-20 20:42:13 +04:00
|
|
|
{
|
|
|
|
public:
|
2004-12-10 22:48:22 +03:00
|
|
|
nsDOMWindowUtils(nsGlobalWindow *aWindow);
|
2004-06-20 20:42:13 +04:00
|
|
|
~nsDOMWindowUtils();
|
2012-04-02 06:23:51 +04:00
|
|
|
NS_DECL_ISUPPORTS
|
2004-06-20 20:42:13 +04:00
|
|
|
NS_DECL_NSIDOMWINDOWUTILS
|
|
|
|
|
|
|
|
protected:
|
2012-04-02 06:23:51 +04:00
|
|
|
nsWeakPtr mWindow;
|
2007-02-27 00:14:19 +03:00
|
|
|
|
2010-07-19 06:23:48 +04:00
|
|
|
// If aOffset is non-null, it gets filled in with the offset of the root
|
|
|
|
// frame of our window to the nearest widget in the app units of our window.
|
|
|
|
// Add this offset to any event offset we're given to make it relative to the
|
|
|
|
// widget returned by GetWidget.
|
2012-07-30 18:20:58 +04:00
|
|
|
nsIWidget* GetWidget(nsPoint* aOffset = nullptr);
|
2009-09-23 06:31:37 +04:00
|
|
|
nsIWidget* GetWidgetForElement(nsIDOMElement* aElement);
|
2009-01-06 04:15:13 +03:00
|
|
|
|
2010-09-04 00:10:45 +04:00
|
|
|
nsIPresShell* GetPresShell();
|
2009-01-06 04:15:13 +03:00
|
|
|
nsPresContext* GetPresContext();
|
2010-08-28 03:15:07 +04:00
|
|
|
|
|
|
|
NS_IMETHOD SendMouseEventCommon(const nsAString& aType,
|
|
|
|
float aX,
|
|
|
|
float aY,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aButton,
|
|
|
|
int32_t aClickCount,
|
|
|
|
int32_t aModifiers,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aIgnoreRootScrollFrame,
|
2012-08-14 18:27:39 +04:00
|
|
|
float aPressure,
|
|
|
|
unsigned short aInputSourceArg,
|
2013-02-06 01:40:34 +04:00
|
|
|
bool aToWindow,
|
2014-01-15 18:28:04 +04:00
|
|
|
bool *aPreventDefault,
|
|
|
|
bool aIsSynthesized);
|
2012-04-25 07:00:02 +04:00
|
|
|
|
2013-12-03 19:10:47 +04:00
|
|
|
NS_IMETHOD SendTouchEventCommon(const nsAString& aType,
|
|
|
|
uint32_t* aIdentifiers,
|
|
|
|
int32_t* aXs,
|
|
|
|
int32_t* aYs,
|
|
|
|
uint32_t* aRxs,
|
|
|
|
uint32_t* aRys,
|
|
|
|
float* aRotationAngles,
|
|
|
|
float* aForces,
|
|
|
|
uint32_t aCount,
|
|
|
|
int32_t aModifiers,
|
|
|
|
bool aIgnoreRootScrollFrame,
|
|
|
|
bool aToWindow,
|
|
|
|
bool* aPreventDefault);
|
|
|
|
|
|
|
|
|
2013-09-14 06:39:41 +04:00
|
|
|
static mozilla::Modifiers GetWidgetModifiers(int32_t aModifiers);
|
2004-06-20 20:42:13 +04:00
|
|
|
};
|
2012-11-20 05:05:34 +04:00
|
|
|
|
|
|
|
#endif
|