2001-09-25 01:32:19 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
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/. */
|
1999-12-05 23:04:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
This is the focus manager for XUL documents.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef nsXULCommandDispatcher_h__
|
|
|
|
#define nsXULCommandDispatcher_h__
|
|
|
|
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsIDOMXULCommandDispatcher.h"
|
|
|
|
#include "nsWeakReference.h"
|
|
|
|
#include "nsIDOMNode.h"
|
|
|
|
#include "nsString.h"
|
2007-03-24 10:53:07 +00:00
|
|
|
#include "nsCycleCollectionParticipant.h"
|
1999-12-05 23:04:22 +00:00
|
|
|
|
|
|
|
class nsIDOMElement;
|
2010-02-20 16:07:03 +00:00
|
|
|
class nsPIWindowRoot;
|
1999-12-05 23:04:22 +00:00
|
|
|
|
|
|
|
class nsXULCommandDispatcher : public nsIDOMXULCommandDispatcher,
|
|
|
|
public nsSupportsWeakReference
|
|
|
|
{
|
2007-03-24 10:53:07 +00:00
|
|
|
public:
|
2014-09-02 00:49:25 +00:00
|
|
|
explicit nsXULCommandDispatcher(nsIDocument* aDocument);
|
2000-11-04 08:21:20 +00:00
|
|
|
|
1999-12-05 23:04:22 +00:00
|
|
|
// nsISupports
|
2007-03-24 10:53:07 +00:00
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsXULCommandDispatcher,
|
|
|
|
nsIDOMXULCommandDispatcher)
|
1999-12-05 23:04:22 +00:00
|
|
|
|
|
|
|
// nsIDOMXULCommandDispatcher interface
|
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 16:46:42 +00:00
|
|
|
NS_DECL_NSIDOMXULCOMMANDDISPATCHER
|
1999-12-05 23:04:22 +00:00
|
|
|
|
2007-03-24 10:53:07 +00:00
|
|
|
void Disconnect();
|
1999-12-08 04:56:56 +00:00
|
|
|
protected:
|
2014-06-25 02:09:15 +00:00
|
|
|
virtual ~nsXULCommandDispatcher();
|
|
|
|
|
2010-02-20 16:07:03 +00:00
|
|
|
already_AddRefed<nsPIWindowRoot> GetWindowRoot();
|
2007-03-24 10:53:07 +00:00
|
|
|
|
Bug 178324, refactor focus by moving all focus handling into one place and simplifying it, add many tests, fixes many other bugs too numerous to mention in this small checkin comment, r=josh,smichaud,ere,dbaron,marco,neil,gavin,smaug,sr=smaug (CLOSED TREE)
2009-06-10 18:00:39 +00:00
|
|
|
nsIContent* GetRootFocusedContentAndWindow(nsPIDOMWindow** aWindow);
|
|
|
|
|
2007-03-24 10:53:07 +00:00
|
|
|
nsCOMPtr<nsIDocument> mDocument;
|
1999-12-05 23:04:22 +00:00
|
|
|
|
|
|
|
class Updater {
|
|
|
|
public:
|
2000-11-04 08:21:20 +00:00
|
|
|
Updater(nsIDOMElement* aElement,
|
2002-03-23 22:46:13 +00:00
|
|
|
const nsAString& aEvents,
|
|
|
|
const nsAString& aTargets)
|
2000-11-04 08:21:20 +00:00
|
|
|
: mElement(aElement),
|
|
|
|
mEvents(aEvents),
|
|
|
|
mTargets(aTargets),
|
2012-07-30 14:20:58 +00:00
|
|
|
mNext(nullptr)
|
2000-11-04 08:21:20 +00:00
|
|
|
{}
|
|
|
|
|
2007-03-24 10:53:07 +00:00
|
|
|
nsCOMPtr<nsIDOMElement> mElement;
|
|
|
|
nsString mEvents;
|
|
|
|
nsString mTargets;
|
|
|
|
Updater* mNext;
|
1999-12-05 23:04:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
Updater* mUpdaters;
|
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
bool Matches(const nsString& aList,
|
2002-03-23 22:46:13 +00:00
|
|
|
const nsAString& aElement);
|
1999-12-05 23:04:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // nsXULCommandDispatcher_h__
|