michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: michael@0: /* michael@0: michael@0: This is the focus manager for XUL documents. michael@0: michael@0: */ michael@0: michael@0: #ifndef nsXULCommandDispatcher_h__ michael@0: #define nsXULCommandDispatcher_h__ michael@0: michael@0: #include "nsCOMPtr.h" michael@0: #include "nsIDOMXULCommandDispatcher.h" michael@0: #include "nsWeakReference.h" michael@0: #include "nsIDOMNode.h" michael@0: #include "nsString.h" michael@0: #include "nsCycleCollectionParticipant.h" michael@0: michael@0: class nsIDOMElement; michael@0: class nsPIWindowRoot; michael@0: michael@0: class nsXULCommandDispatcher : public nsIDOMXULCommandDispatcher, michael@0: public nsSupportsWeakReference michael@0: { michael@0: public: michael@0: nsXULCommandDispatcher(nsIDocument* aDocument); michael@0: virtual ~nsXULCommandDispatcher(); michael@0: michael@0: // nsISupports michael@0: NS_DECL_CYCLE_COLLECTING_ISUPPORTS michael@0: NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsXULCommandDispatcher, michael@0: nsIDOMXULCommandDispatcher) michael@0: michael@0: // nsIDOMXULCommandDispatcher interface michael@0: NS_DECL_NSIDOMXULCOMMANDDISPATCHER michael@0: michael@0: void Disconnect(); michael@0: protected: michael@0: already_AddRefed GetWindowRoot(); michael@0: michael@0: nsIContent* GetRootFocusedContentAndWindow(nsPIDOMWindow** aWindow); michael@0: michael@0: nsCOMPtr mDocument; michael@0: michael@0: class Updater { michael@0: public: michael@0: Updater(nsIDOMElement* aElement, michael@0: const nsAString& aEvents, michael@0: const nsAString& aTargets) michael@0: : mElement(aElement), michael@0: mEvents(aEvents), michael@0: mTargets(aTargets), michael@0: mNext(nullptr) michael@0: {} michael@0: michael@0: nsCOMPtr mElement; michael@0: nsString mEvents; michael@0: nsString mTargets; michael@0: Updater* mNext; michael@0: }; michael@0: michael@0: Updater* mUpdaters; michael@0: michael@0: bool Matches(const nsString& aList, michael@0: const nsAString& aElement); michael@0: }; michael@0: michael@0: #endif // nsXULCommandDispatcher_h__