2000-11-04 08:21:20 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 3; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
2012-05-21 11:12:37 +00: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/. */
|
2000-11-04 08:21:20 +00:00
|
|
|
|
|
|
|
#ifndef nsWindowRoot_h__
|
|
|
|
#define nsWindowRoot_h__
|
|
|
|
|
2010-02-20 16:07:03 +00:00
|
|
|
class nsPIDOMWindow;
|
2000-11-04 08:21:20 +00:00
|
|
|
class nsIDOMEventListener;
|
2011-06-24 02:18:01 +00:00
|
|
|
class nsEventListenerManager;
|
2000-11-04 08:21:20 +00:00
|
|
|
class nsIDOMEvent;
|
2006-03-07 17:08:51 +00:00
|
|
|
class nsEventChainPreVisitor;
|
|
|
|
class nsEventChainPostVisitor;
|
2000-11-04 08:21:20 +00:00
|
|
|
|
2007-05-14 09:11:38 +00:00
|
|
|
#include "nsIDOMEventTarget.h"
|
2011-06-24 02:18:01 +00:00
|
|
|
#include "nsEventListenerManager.h"
|
2000-11-04 08:21:20 +00:00
|
|
|
#include "nsPIWindowRoot.h"
|
2007-01-04 22:31:26 +00:00
|
|
|
#include "nsCycleCollectionParticipant.h"
|
2000-11-04 08:21:20 +00:00
|
|
|
|
2011-06-24 02:18:02 +00:00
|
|
|
class nsWindowRoot : public nsPIWindowRoot
|
2000-11-04 08:21:20 +00:00
|
|
|
{
|
|
|
|
public:
|
2010-02-20 16:07:03 +00:00
|
|
|
nsWindowRoot(nsPIDOMWindow* aWindow);
|
2000-11-04 08:21:20 +00:00
|
|
|
virtual ~nsWindowRoot();
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
|
2007-01-04 22:31:26 +00:00
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
NS_DECL_NSIDOMEVENTTARGET
|
2007-02-15 23:04:33 +00:00
|
|
|
|
2000-11-04 08:21:20 +00:00
|
|
|
// nsPIWindowRoot
|
|
|
|
|
2010-02-20 16:07:03 +00:00
|
|
|
virtual nsPIDOMWindow* GetWindow();
|
|
|
|
|
|
|
|
virtual nsresult GetControllers(nsIControllers** aResult);
|
|
|
|
virtual nsresult GetControllerForCommand(const char * aCommand,
|
|
|
|
nsIController** _retval);
|
|
|
|
|
2010-08-09 16:17:19 +00:00
|
|
|
virtual nsIDOMNode* GetPopupNode();
|
2010-02-20 16:07:03 +00:00
|
|
|
virtual void SetPopupNode(nsIDOMNode* aNode);
|
2007-07-06 13:47:50 +00:00
|
|
|
|
2011-06-24 02:18:00 +00:00
|
|
|
virtual void SetParentTarget(nsIDOMEventTarget* aTarget)
|
2010-02-20 17:05:20 +00:00
|
|
|
{
|
|
|
|
mParent = aTarget;
|
|
|
|
}
|
2011-06-24 02:18:00 +00:00
|
|
|
virtual nsIDOMEventTarget* GetParentTarget() { return mParent; }
|
2010-02-20 17:05:20 +00:00
|
|
|
|
2007-05-14 09:11:38 +00:00
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsWindowRoot, nsIDOMEventTarget)
|
2007-01-04 22:31:26 +00:00
|
|
|
|
2000-11-04 08:21:20 +00:00
|
|
|
protected:
|
|
|
|
// Members
|
2010-02-20 16:07:03 +00:00
|
|
|
nsPIDOMWindow* mWindow; // [Weak]. The window will hold on to us and let go when it dies.
|
2011-06-24 02:18:01 +00:00
|
|
|
nsRefPtr<nsEventListenerManager> mListenerManager; // [Strong]. We own the manager, which owns event listeners attached
|
2000-11-04 08:21:20 +00:00
|
|
|
// to us.
|
2010-02-20 16:07:03 +00:00
|
|
|
|
|
|
|
nsCOMPtr<nsIDOMNode> mPopupNode; // [OWNER]
|
2010-02-20 17:05:20 +00:00
|
|
|
|
2011-06-24 02:18:00 +00:00
|
|
|
nsCOMPtr<nsIDOMEventTarget> mParent;
|
2000-11-04 08:21:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern nsresult
|
2010-02-20 16:07:03 +00:00
|
|
|
NS_NewWindowRoot(nsPIDOMWindow* aWindow,
|
2011-06-24 02:18:00 +00:00
|
|
|
nsIDOMEventTarget** aResult);
|
2000-11-04 08:21:20 +00:00
|
|
|
|
|
|
|
#endif
|