1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 This is the focus manager for XUL documents.
12 #ifndef nsXULCommandDispatcher_h__
13 #define nsXULCommandDispatcher_h__
16 #include "nsIDOMXULCommandDispatcher.h"
17 #include "nsWeakReference.h"
19 #include "nsCycleCollectionParticipant.h"
21 #include "mozilla/RefPtr.h"
23 class nsPIDOMWindowOuter
;
26 namespace mozilla::dom
{
29 } // namespace mozilla::dom
31 class nsXULCommandDispatcher
: public nsIDOMXULCommandDispatcher
,
32 public nsSupportsWeakReference
{
33 using Document
= mozilla::dom::Document
;
34 using Element
= mozilla::dom::Element
;
37 explicit nsXULCommandDispatcher(Document
* aDocument
);
40 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
41 NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsXULCommandDispatcher
,
42 nsIDOMXULCommandDispatcher
)
44 // nsIDOMXULCommandDispatcher interface
45 NS_DECL_NSIDOMXULCOMMANDDISPATCHER
50 virtual ~nsXULCommandDispatcher();
52 already_AddRefed
<nsPIWindowRoot
> GetWindowRoot();
54 Element
* GetRootFocusedContentAndWindow(nsPIDOMWindowOuter
** aWindow
);
55 nsresult
MoveFocusIntoSubtree(Element
*, bool aForward
);
57 RefPtr
<Document
> mDocument
;
61 Updater(Element
* aElement
, const nsAString
& aEvents
,
62 const nsAString
& aTargets
)
68 RefPtr
<Element
> mElement
;
76 bool Matches(const nsString
& aList
, const nsAString
& aElement
);
79 nsTArray
<nsString
> mPendingUpdates
;
82 #endif // nsXULCommandDispatcher_h__