Copy as Markdown

Other Tools

/* THIS FILE IS AUTOGENERATED FROM KeyboardEvent.webidl BY Codegen.py - DO NOT EDIT */
#ifndef DOM_KEYBOARDEVENTBINDING_H_
#define DOM_KEYBOARDEVENTBINDING_H_
#include "UIEventBinding.h"
#include "js/CallAndConstruct.h"
#include "js/RootingAPI.h"
#include "js/TypeDecls.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/Nullable.h"
#include "mozilla/dom/PrototypeList.h"
namespace mozilla {
namespace dom {
class KeyboardEvent;
struct KeyboardEventInitAtoms;
struct NativePropertyHooks;
class ProtoAndIfaceCache;
} // namespace dom
} // namespace mozilla
namespace mozilla::dom {
struct KeyboardEventInit : public EventModifierInit
{
MOZ_INIT_OUTSIDE_CTOR uint32_t mCharCode;
MOZ_INIT_OUTSIDE_CTOR nsAutoString mCode;
MOZ_INIT_OUTSIDE_CTOR bool mIsComposing;
MOZ_INIT_OUTSIDE_CTOR nsAutoString mKey;
MOZ_INIT_OUTSIDE_CTOR uint32_t mKeyCode;
MOZ_INIT_OUTSIDE_CTOR uint32_t mLocation;
MOZ_INIT_OUTSIDE_CTOR bool mRepeat;
MOZ_INIT_OUTSIDE_CTOR uint32_t mWhich;
KeyboardEventInit();
explicit inline KeyboardEventInit(const FastDictionaryInitializer& )
: EventModifierInit(FastDictionaryInitializer())
{
// Do nothing here; this is used by our "Fast" subclass
}
KeyboardEventInit(KeyboardEventInit&& aOther) = default;
explicit inline KeyboardEventInit(const KeyboardEventInit& aOther)
: EventModifierInit(FastDictionaryInitializer())
{
*this = aOther;
}
bool
Init(BindingCallContext& cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(JSContext* cx_, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
void
TraceDictionary(JSTracer* trc);
inline void
TraverseForCC(nsCycleCollectionTraversalCallback& aCallback, uint32_t aFlags)
{
EventModifierInit::TraverseForCC(aCallback, aFlags);
}
inline void
UnlinkForCC()
{
EventModifierInit::UnlinkForCC();
}
KeyboardEventInit&
operator=(const KeyboardEventInit& aOther);
private:
static bool
InitIds(JSContext* cx, KeyboardEventInitAtoms* atomsCache);
};
namespace binding_detail {
struct FastKeyboardEventInit : public KeyboardEventInit
{
inline FastKeyboardEventInit()
: KeyboardEventInit(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
namespace KeyboardEvent_Binding {
typedef mozilla::dom::KeyboardEvent NativeType;
static const uint32_t DOM_KEY_LOCATION_STANDARD = 0;
static const uint32_t DOM_KEY_LOCATION_LEFT = 1;
static const uint32_t DOM_KEY_LOCATION_RIGHT = 2;
static const uint32_t DOM_KEY_LOCATION_NUMPAD = 3;
static const uint32_t DOM_VK_CANCEL = 3;
static const uint32_t DOM_VK_HELP = 6;
static const uint32_t DOM_VK_BACK_SPACE = 8;
static const uint32_t DOM_VK_TAB = 9;
static const uint32_t DOM_VK_CLEAR = 12;
static const uint32_t DOM_VK_RETURN = 13;
static const uint32_t DOM_VK_SHIFT = 16;
static const uint32_t DOM_VK_CONTROL = 17;
static const uint32_t DOM_VK_ALT = 18;
static const uint32_t DOM_VK_PAUSE = 19;
static const uint32_t DOM_VK_CAPS_LOCK = 20;
static const uint32_t DOM_VK_KANA = 21;
static const uint32_t DOM_VK_HANGUL = 21;
static const uint32_t DOM_VK_EISU = 22;
static const uint32_t DOM_VK_JUNJA = 23;
static const uint32_t DOM_VK_FINAL = 24;
static const uint32_t DOM_VK_HANJA = 25;
static const uint32_t DOM_VK_KANJI = 25;
static const uint32_t DOM_VK_ESCAPE = 27;
static const uint32_t DOM_VK_CONVERT = 28;
static const uint32_t DOM_VK_NONCONVERT = 29;
static const uint32_t DOM_VK_ACCEPT = 30;
static const uint32_t DOM_VK_MODECHANGE = 31;
static const uint32_t DOM_VK_SPACE = 32;
static const uint32_t DOM_VK_PAGE_UP = 33;
static const uint32_t DOM_VK_PAGE_DOWN = 34;
static const uint32_t DOM_VK_END = 35;
static const uint32_t DOM_VK_HOME = 36;
static const uint32_t DOM_VK_LEFT = 37;
static const uint32_t DOM_VK_UP = 38;
static const uint32_t DOM_VK_RIGHT = 39;
static const uint32_t DOM_VK_DOWN = 40;
static const uint32_t DOM_VK_SELECT = 41;
static const uint32_t DOM_VK_PRINT = 42;
static const uint32_t DOM_VK_EXECUTE = 43;
static const uint32_t DOM_VK_PRINTSCREEN = 44;
static const uint32_t DOM_VK_INSERT = 45;
static const uint32_t DOM_VK_DELETE = 46;
static const uint32_t DOM_VK_0 = 48;
static const uint32_t DOM_VK_1 = 49;
static const uint32_t DOM_VK_2 = 50;
static const uint32_t DOM_VK_3 = 51;
static const uint32_t DOM_VK_4 = 52;
static const uint32_t DOM_VK_5 = 53;
static const uint32_t DOM_VK_6 = 54;
static const uint32_t DOM_VK_7 = 55;
static const uint32_t DOM_VK_8 = 56;
static const uint32_t DOM_VK_9 = 57;
static const uint32_t DOM_VK_COLON = 58;
static const uint32_t DOM_VK_SEMICOLON = 59;
static const uint32_t DOM_VK_LESS_THAN = 60;
static const uint32_t DOM_VK_EQUALS = 61;
static const uint32_t DOM_VK_GREATER_THAN = 62;
static const uint32_t DOM_VK_QUESTION_MARK = 63;
static const uint32_t DOM_VK_AT = 64;
static const uint32_t DOM_VK_A = 65;
static const uint32_t DOM_VK_B = 66;
static const uint32_t DOM_VK_C = 67;
static const uint32_t DOM_VK_D = 68;
static const uint32_t DOM_VK_E = 69;
static const uint32_t DOM_VK_F = 70;
static const uint32_t DOM_VK_G = 71;
static const uint32_t DOM_VK_H = 72;
static const uint32_t DOM_VK_I = 73;
static const uint32_t DOM_VK_J = 74;
static const uint32_t DOM_VK_K = 75;
static const uint32_t DOM_VK_L = 76;
static const uint32_t DOM_VK_M = 77;
static const uint32_t DOM_VK_N = 78;
static const uint32_t DOM_VK_O = 79;
static const uint32_t DOM_VK_P = 80;
static const uint32_t DOM_VK_Q = 81;
static const uint32_t DOM_VK_R = 82;
static const uint32_t DOM_VK_S = 83;
static const uint32_t DOM_VK_T = 84;
static const uint32_t DOM_VK_U = 85;
static const uint32_t DOM_VK_V = 86;
static const uint32_t DOM_VK_W = 87;
static const uint32_t DOM_VK_X = 88;
static const uint32_t DOM_VK_Y = 89;
static const uint32_t DOM_VK_Z = 90;
static const uint32_t DOM_VK_WIN = 91;
static const uint32_t DOM_VK_CONTEXT_MENU = 93;
static const uint32_t DOM_VK_SLEEP = 95;
static const uint32_t DOM_VK_NUMPAD0 = 96;
static const uint32_t DOM_VK_NUMPAD1 = 97;
static const uint32_t DOM_VK_NUMPAD2 = 98;
static const uint32_t DOM_VK_NUMPAD3 = 99;
static const uint32_t DOM_VK_NUMPAD4 = 100;
static const uint32_t DOM_VK_NUMPAD5 = 101;
static const uint32_t DOM_VK_NUMPAD6 = 102;
static const uint32_t DOM_VK_NUMPAD7 = 103;
static const uint32_t DOM_VK_NUMPAD8 = 104;
static const uint32_t DOM_VK_NUMPAD9 = 105;
static const uint32_t DOM_VK_MULTIPLY = 106;
static const uint32_t DOM_VK_ADD = 107;
static const uint32_t DOM_VK_SEPARATOR = 108;
static const uint32_t DOM_VK_SUBTRACT = 109;
static const uint32_t DOM_VK_DECIMAL = 110;
static const uint32_t DOM_VK_DIVIDE = 111;
static const uint32_t DOM_VK_F1 = 112;
static const uint32_t DOM_VK_F2 = 113;
static const uint32_t DOM_VK_F3 = 114;
static const uint32_t DOM_VK_F4 = 115;
static const uint32_t DOM_VK_F5 = 116;
static const uint32_t DOM_VK_F6 = 117;
static const uint32_t DOM_VK_F7 = 118;
static const uint32_t DOM_VK_F8 = 119;
static const uint32_t DOM_VK_F9 = 120;
static const uint32_t DOM_VK_F10 = 121;
static const uint32_t DOM_VK_F11 = 122;
static const uint32_t DOM_VK_F12 = 123;
static const uint32_t DOM_VK_F13 = 124;
static const uint32_t DOM_VK_F14 = 125;
static const uint32_t DOM_VK_F15 = 126;
static const uint32_t DOM_VK_F16 = 127;
static const uint32_t DOM_VK_F17 = 128;
static const uint32_t DOM_VK_F18 = 129;
static const uint32_t DOM_VK_F19 = 130;
static const uint32_t DOM_VK_F20 = 131;
static const uint32_t DOM_VK_F21 = 132;
static const uint32_t DOM_VK_F22 = 133;
static const uint32_t DOM_VK_F23 = 134;
static const uint32_t DOM_VK_F24 = 135;
static const uint32_t DOM_VK_NUM_LOCK = 144;
static const uint32_t DOM_VK_SCROLL_LOCK = 145;
static const uint32_t DOM_VK_WIN_OEM_FJ_JISHO = 146;
static const uint32_t DOM_VK_WIN_OEM_FJ_MASSHOU = 147;
static const uint32_t DOM_VK_WIN_OEM_FJ_TOUROKU = 148;
static const uint32_t DOM_VK_WIN_OEM_FJ_LOYA = 149;
static const uint32_t DOM_VK_WIN_OEM_FJ_ROYA = 150;
static const uint32_t DOM_VK_CIRCUMFLEX = 160;
static const uint32_t DOM_VK_EXCLAMATION = 161;
static const uint32_t DOM_VK_DOUBLE_QUOTE = 162;
static const uint32_t DOM_VK_HASH = 163;
static const uint32_t DOM_VK_DOLLAR = 164;
static const uint32_t DOM_VK_PERCENT = 165;
static const uint32_t DOM_VK_AMPERSAND = 166;
static const uint32_t DOM_VK_UNDERSCORE = 167;
static const uint32_t DOM_VK_OPEN_PAREN = 168;
static const uint32_t DOM_VK_CLOSE_PAREN = 169;
static const uint32_t DOM_VK_ASTERISK = 170;
static const uint32_t DOM_VK_PLUS = 171;
static const uint32_t DOM_VK_PIPE = 172;
static const uint32_t DOM_VK_HYPHEN_MINUS = 173;
static const uint32_t DOM_VK_OPEN_CURLY_BRACKET = 174;
static const uint32_t DOM_VK_CLOSE_CURLY_BRACKET = 175;
static const uint32_t DOM_VK_TILDE = 176;
static const uint32_t DOM_VK_VOLUME_MUTE = 181;
static const uint32_t DOM_VK_VOLUME_DOWN = 182;
static const uint32_t DOM_VK_VOLUME_UP = 183;
static const uint32_t DOM_VK_COMMA = 188;
static const uint32_t DOM_VK_PERIOD = 190;
static const uint32_t DOM_VK_SLASH = 191;
static const uint32_t DOM_VK_BACK_QUOTE = 192;
static const uint32_t DOM_VK_OPEN_BRACKET = 219;
static const uint32_t DOM_VK_BACK_SLASH = 220;
static const uint32_t DOM_VK_CLOSE_BRACKET = 221;
static const uint32_t DOM_VK_QUOTE = 222;
static const uint32_t DOM_VK_META = 224;
static const uint32_t DOM_VK_ALTGR = 225;
static const uint32_t DOM_VK_WIN_ICO_HELP = 227;
static const uint32_t DOM_VK_WIN_ICO_00 = 228;
static const uint32_t DOM_VK_PROCESSKEY = 229;
static const uint32_t DOM_VK_WIN_ICO_CLEAR = 230;
static const uint32_t DOM_VK_WIN_OEM_RESET = 233;
static const uint32_t DOM_VK_WIN_OEM_JUMP = 234;
static const uint32_t DOM_VK_WIN_OEM_PA1 = 235;
static const uint32_t DOM_VK_WIN_OEM_PA2 = 236;
static const uint32_t DOM_VK_WIN_OEM_PA3 = 237;
static const uint32_t DOM_VK_WIN_OEM_WSCTRL = 238;
static const uint32_t DOM_VK_WIN_OEM_CUSEL = 239;
static const uint32_t DOM_VK_WIN_OEM_ATTN = 240;
static const uint32_t DOM_VK_WIN_OEM_FINISH = 241;
static const uint32_t DOM_VK_WIN_OEM_COPY = 242;
static const uint32_t DOM_VK_WIN_OEM_AUTO = 243;
static const uint32_t DOM_VK_WIN_OEM_ENLW = 244;
static const uint32_t DOM_VK_WIN_OEM_BACKTAB = 245;
static const uint32_t DOM_VK_ATTN = 246;
static const uint32_t DOM_VK_CRSEL = 247;
static const uint32_t DOM_VK_EXSEL = 248;
static const uint32_t DOM_VK_EREOF = 249;
static const uint32_t DOM_VK_PLAY = 250;
static const uint32_t DOM_VK_ZOOM = 251;
static const uint32_t DOM_VK_PA1 = 253;
static const uint32_t DOM_VK_WIN_OEM_CLEAR = 254;
bool
Wrap(JSContext* aCx, mozilla::dom::KeyboardEvent* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
template <class T>
inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
{
JS::Rooted<JSObject*> reflector(aCx);
return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
}
void
CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, DefineInterfaceProperty aDefineOnGlobal);
JS::Handle<JSObject*>
GetConstructorObjectHandle(JSContext* aCx);
inline bool CreateAndDefineOnGlobal(JSContext* aCx)
{
// Get the interface or namespace object for this class. This will
// create the object as needed and always define the properties for
// it on the global. The caller should make sure the interface or
// namespace is exposed on the global before calling this.
return GetPerInterfaceObjectHandle(aCx, constructors::id::KeyboardEvent,
&CreateInterfaceObjects,
DefineInterfaceProperty::Always);
}
} // namespace KeyboardEvent_Binding
} // namespace mozilla::dom
#endif // DOM_KEYBOARDEVENTBINDING_H_