Source code

Revision control

Other Tools

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 XULTextElement_h__
8
#define XULTextElement_h__
9
10
#include "nsXULElement.h"
11
12
namespace mozilla {
13
namespace dom {
14
15
class XULTextElement final : public nsXULElement {
16
public:
17
explicit XULTextElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
18
: nsXULElement(std::move(aNodeInfo)) {}
19
20
bool Disabled() { return GetXULBoolAttr(nsGkAtoms::disabled); }
21
MOZ_CAN_RUN_SCRIPT void SetDisabled(bool aValue) {
22
SetXULBoolAttr(nsGkAtoms::disabled, aValue);
23
}
24
void GetValue(DOMString& aValue) const {
25
GetXULAttr(nsGkAtoms::value, aValue);
26
}
27
MOZ_CAN_RUN_SCRIPT void SetValue(const nsAString& aValue) {
28
SetAttr(kNameSpaceID_None, nsGkAtoms::value, aValue, true);
29
}
30
void GetAccessKey(DOMString& aValue) const {
31
GetXULAttr(nsGkAtoms::accesskey, aValue);
32
}
33
MOZ_CAN_RUN_SCRIPT void SetAccessKey(const nsAString& aValue) {
34
SetAttr(kNameSpaceID_None, nsGkAtoms::accesskey, aValue, true);
35
}
36
37
protected:
38
virtual ~XULTextElement() {}
39
JSObject* WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) final;
40
};
41
42
} // namespace dom
43
} // namespace mozilla
44
45
#endif // XULTextElement_h