2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07: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/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#include "nsAutoPtr.h"
|
|
|
|
#include "nsWeakReference.h"
|
|
|
|
|
|
|
|
#include "nsIDOMWindowUtils.h"
|
2012-04-24 20:00:02 -07:00
|
|
|
#include "nsEvent.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
class nsGlobalWindow;
|
2010-09-03 13:10:45 -07:00
|
|
|
class nsIPresShell;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
class nsDOMWindowUtils : public nsIDOMWindowUtils,
|
|
|
|
public nsSupportsWeakReference
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsDOMWindowUtils(nsGlobalWindow *aWindow);
|
|
|
|
~nsDOMWindowUtils();
|
2012-04-01 19:23:51 -07:00
|
|
|
NS_DECL_ISUPPORTS
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_DECL_NSIDOMWINDOWUTILS
|
|
|
|
|
|
|
|
protected:
|
2012-04-01 19:23:51 -07:00
|
|
|
nsWeakPtr mWindow;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-07-18 19:23:48 -07: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.
|
2008-11-26 13:52:42 -08:00
|
|
|
nsIWidget* GetWidget(nsPoint* aOffset = nsnull);
|
2009-09-22 19:31:37 -07:00
|
|
|
nsIWidget* GetWidgetForElement(nsIDOMElement* aElement);
|
2009-01-05 17:15:13 -08:00
|
|
|
|
2010-09-03 13:10:45 -07:00
|
|
|
nsIPresShell* GetPresShell();
|
2009-01-05 17:15:13 -08:00
|
|
|
nsPresContext* GetPresContext();
|
2010-08-27 16:15:07 -07:00
|
|
|
|
|
|
|
NS_IMETHOD SendMouseEventCommon(const nsAString& aType,
|
|
|
|
float aX,
|
|
|
|
float aY,
|
|
|
|
PRInt32 aButton,
|
|
|
|
PRInt32 aClickCount,
|
|
|
|
PRInt32 aModifiers,
|
2011-09-28 23:19:26 -07:00
|
|
|
bool aIgnoreRootScrollFrame,
|
|
|
|
bool aToWindow);
|
2012-04-24 20:00:02 -07:00
|
|
|
|
|
|
|
static mozilla::widget::Modifiers GetWidgetModifiers(PRInt32 aModifiers);
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|