XULMenuElement.h (1176B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef mozilla_dom_XULMenuElement_h 8 #define mozilla_dom_XULMenuElement_h 9 10 #include "XULButtonElement.h" 11 #include "nsINode.h" 12 #include "nsXULElement.h" 13 14 namespace mozilla::dom { 15 16 class KeyboardEvent; 17 18 class XULMenuElement final : public XULButtonElement { 19 public: 20 explicit XULMenuElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo) 21 : XULButtonElement(std::move(aNodeInfo)) {} 22 23 MOZ_CAN_RUN_SCRIPT void SetActiveMenuChild(Element*); 24 Element* GetActiveMenuChild(); 25 26 NS_IMPL_FROMNODE_HELPER(XULMenuElement, 27 IsAnyOfXULElements(nsGkAtoms::menu, 28 nsGkAtoms::menulist)); 29 30 private: 31 virtual ~XULMenuElement() = default; 32 JSObject* WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) final; 33 }; 34 35 } // namespace mozilla::dom 36 37 #endif // XULMenuElement_h