Bug 1880216 - Migrate Fenix docs into Sphinx. r=owlish,geckoview-reviewers,android...
[gecko.git] / dom / html / HTMLOptGroupElement.h
blob47596e520e22744be9d924585701864cf0cc202f
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 file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_HTMLOptGroupElement_h
8 #define mozilla_dom_HTMLOptGroupElement_h
10 #include "mozilla/Attributes.h"
11 #include "nsGenericHTMLElement.h"
13 namespace mozilla {
14 class ErrorResult;
15 class EventChainPreVisitor;
16 namespace dom {
18 class HTMLOptGroupElement final : public nsGenericHTMLElement {
19 public:
20 explicit HTMLOptGroupElement(
21 already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
23 NS_IMPL_FROMNODE_HTML_WITH_TAG(HTMLOptGroupElement, optgroup)
25 // nsISupports
26 NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLOptGroupElement,
27 nsGenericHTMLElement)
29 // nsINode
30 virtual void InsertChildBefore(nsIContent* aKid, nsIContent* aBeforeThis,
31 bool aNotify, ErrorResult& aRv) override;
32 virtual void RemoveChildNode(nsIContent* aKid, bool aNotify) override;
34 // nsIContent
35 void GetEventTargetParent(EventChainPreVisitor& aVisitor) override;
37 virtual nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;
39 virtual void AfterSetAttr(int32_t aNameSpaceID, nsAtom* aName,
40 const nsAttrValue* aValue,
41 const nsAttrValue* aOldValue,
42 nsIPrincipal* aSubjectPrincipal,
43 bool aNotify) override;
45 bool Disabled() const { return GetBoolAttr(nsGkAtoms::disabled); }
46 void SetDisabled(bool aValue, ErrorResult& aError) {
47 SetHTMLBoolAttr(nsGkAtoms::disabled, aValue, aError);
50 void GetLabel(nsAString& aValue) const {
51 GetHTMLAttr(nsGkAtoms::label, aValue);
53 void SetLabel(const nsAString& aLabel, ErrorResult& aError) {
54 SetHTMLAttr(nsGkAtoms::label, aLabel, aError);
57 protected:
58 virtual ~HTMLOptGroupElement();
60 virtual JSObject* WrapNode(JSContext* aCx,
61 JS::Handle<JSObject*> aGivenProto) override;
63 protected:
64 /**
65 * Get the select content element that contains this option
66 * @param aSelectElement the select element [OUT]
68 Element* GetSelect();
71 } // namespace dom
72 } // namespace mozilla
74 #endif /* mozilla_dom_HTMLOptGroupElement_h */