2000-11-04 11:21:20 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 3; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
2004-04-18 01:52:36 +04:00
|
|
|
* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
2000-11-04 11:21:20 +03:00
|
|
|
* The Original Code is the Mozilla browser.
|
2004-04-18 01:52:36 +04:00
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Netscape Communications, Inc.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1999
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
2000-11-04 11:21:20 +03:00
|
|
|
* Contributor(s):
|
|
|
|
* David W. Hyatt <hyatt@netscape.com> (Original Author)
|
2004-04-18 01:52:36 +04:00
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
|
|
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
2000-11-04 11:21:20 +03:00
|
|
|
|
|
|
|
#ifndef nsWindowRoot_h__
|
|
|
|
#define nsWindowRoot_h__
|
|
|
|
|
2010-02-20 19:07:03 +03:00
|
|
|
class nsPIDOMWindow;
|
2000-11-04 11:21:20 +03:00
|
|
|
class nsIDOMEventListener;
|
|
|
|
class nsIEventListenerManager;
|
|
|
|
class nsIDOMEvent;
|
2006-03-07 20:08:51 +03:00
|
|
|
class nsEventChainPreVisitor;
|
|
|
|
class nsEventChainPostVisitor;
|
2000-11-04 11:21:20 +03:00
|
|
|
|
2007-05-14 13:11:38 +04:00
|
|
|
#include "nsIDOMEventTarget.h"
|
2002-11-09 03:25:25 +03:00
|
|
|
#include "nsIDOM3EventTarget.h"
|
2005-04-29 03:48:28 +04:00
|
|
|
#include "nsIDOMNSEventTarget.h"
|
2000-11-04 11:21:20 +03:00
|
|
|
#include "nsIEventListenerManager.h"
|
|
|
|
#include "nsPIWindowRoot.h"
|
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 21:42:36 +04:00
|
|
|
#include "nsIDOMEventTarget.h"
|
2007-01-05 01:31:26 +03:00
|
|
|
#include "nsCycleCollectionParticipant.h"
|
2000-11-04 11:21:20 +03:00
|
|
|
|
2007-05-14 13:11:38 +04:00
|
|
|
class nsWindowRoot : public nsIDOMEventTarget,
|
2005-04-29 03:48:28 +04:00
|
|
|
public nsIDOM3EventTarget,
|
|
|
|
public nsIDOMNSEventTarget,
|
|
|
|
public nsPIWindowRoot
|
2000-11-04 11:21:20 +03:00
|
|
|
{
|
|
|
|
public:
|
2010-02-20 19:07:03 +03:00
|
|
|
nsWindowRoot(nsPIDOMWindow* aWindow);
|
2000-11-04 11:21:20 +03: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 21:42:36 +04:00
|
|
|
|
2007-01-05 01:31:26 +03: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 21:42:36 +04:00
|
|
|
NS_DECL_NSIDOMEVENTTARGET
|
2002-11-09 03:25:25 +03:00
|
|
|
NS_DECL_NSIDOM3EVENTTARGET
|
2005-04-29 03:48:28 +04:00
|
|
|
NS_DECL_NSIDOMNSEVENTTARGET
|
2007-02-16 02:04:33 +03:00
|
|
|
|
|
|
|
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor);
|
|
|
|
virtual nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor);
|
|
|
|
virtual nsresult DispatchDOMEvent(nsEvent* aEvent,
|
|
|
|
nsIDOMEvent* aDOMEvent,
|
|
|
|
nsPresContext* aPresContext,
|
|
|
|
nsEventStatus* aEventStatus);
|
2009-06-23 15:23:52 +04:00
|
|
|
virtual nsIEventListenerManager* GetListenerManager(PRBool aCreateIfNotFound);
|
2007-05-14 13:11:38 +04:00
|
|
|
virtual nsresult AddEventListenerByIID(nsIDOMEventListener *aListener,
|
|
|
|
const nsIID& aIID);
|
|
|
|
virtual nsresult RemoveEventListenerByIID(nsIDOMEventListener *aListener,
|
|
|
|
const nsIID& aIID);
|
|
|
|
virtual nsresult GetSystemEventGroup(nsIDOMEventGroup** aGroup);
|
2009-04-24 13:18:37 +04:00
|
|
|
virtual nsIScriptContext* GetContextForEventHandlers(nsresult* aRv)
|
2008-07-19 19:11:37 +04:00
|
|
|
{
|
2009-04-24 13:18:37 +04:00
|
|
|
*aRv = NS_OK;
|
|
|
|
return nsnull;
|
2008-07-19 19:11:37 +04:00
|
|
|
}
|
2000-11-04 11:21:20 +03:00
|
|
|
|
|
|
|
// nsPIWindowRoot
|
|
|
|
|
2010-02-20 19:07:03 +03:00
|
|
|
virtual nsPIDOMWindow* GetWindow();
|
|
|
|
|
|
|
|
virtual nsresult GetControllers(nsIControllers** aResult);
|
|
|
|
virtual nsresult GetControllerForCommand(const char * aCommand,
|
|
|
|
nsIController** _retval);
|
|
|
|
|
|
|
|
virtual void GetPopupNode(nsIDOMNode** aNode);
|
|
|
|
virtual void SetPopupNode(nsIDOMNode* aNode);
|
2007-07-06 17:47:50 +04:00
|
|
|
|
2010-02-20 20:05:20 +03:00
|
|
|
virtual void SetParentTarget(nsPIDOMEventTarget* aTarget)
|
|
|
|
{
|
|
|
|
mParent = aTarget;
|
|
|
|
}
|
2010-03-01 17:47:27 +03:00
|
|
|
virtual nsPIDOMEventTarget* GetParentTarget() { return mParent; }
|
2010-02-20 20:05:20 +03:00
|
|
|
|
2007-05-14 13:11:38 +04:00
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsWindowRoot, nsIDOMEventTarget)
|
2007-01-05 01:31:26 +03:00
|
|
|
|
2000-11-04 11:21:20 +03:00
|
|
|
protected:
|
|
|
|
// Members
|
2010-02-20 19:07:03 +03:00
|
|
|
nsPIDOMWindow* mWindow; // [Weak]. The window will hold on to us and let go when it dies.
|
2000-11-04 11:21:20 +03:00
|
|
|
nsCOMPtr<nsIEventListenerManager> mListenerManager; // [Strong]. We own the manager, which owns event listeners attached
|
|
|
|
// to us.
|
2010-02-20 19:07:03 +03:00
|
|
|
|
|
|
|
nsCOMPtr<nsIDOMNode> mPopupNode; // [OWNER]
|
2010-02-20 20:05:20 +03:00
|
|
|
|
|
|
|
nsCOMPtr<nsPIDOMEventTarget> mParent;
|
2000-11-04 11:21:20 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
extern nsresult
|
2010-02-20 19:07:03 +03:00
|
|
|
NS_NewWindowRoot(nsPIDOMWindow* aWindow,
|
2007-02-16 02:04:33 +03:00
|
|
|
nsPIDOMEventTarget** aResult);
|
2000-11-04 11:21:20 +03:00
|
|
|
|
|
|
|
#endif
|