Copy as Markdown

Other Tools

/* THIS FILE IS AUTOGENERATED FROM UIEvent.webidl BY Codegen.py - DO NOT EDIT */
#ifndef DOM_UIEVENTBINDING_H_
#define DOM_UIEVENTBINDING_H_
#include "EventBinding.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"
#include "nsGlobalWindowInner.h"
class nsGlobalWindowInner;
namespace mozilla {
namespace dom {
struct EventModifierInitAtoms;
struct NativePropertyHooks;
class ProtoAndIfaceCache;
class UIEvent;
struct UIEventInitAtoms;
} // namespace dom
} // namespace mozilla
namespace mozilla::dom {
struct UIEventInit : public EventInit
{
MOZ_INIT_OUTSIDE_CTOR int32_t mDetail;
MOZ_INIT_OUTSIDE_CTOR RefPtr<nsGlobalWindowInner> mView;
UIEventInit();
explicit inline UIEventInit(const FastDictionaryInitializer& )
: EventInit(FastDictionaryInitializer())
{
// Do nothing here; this is used by our "Fast" subclass
}
UIEventInit(UIEventInit&& aOther) = default;
explicit inline UIEventInit(const UIEventInit& aOther)
: EventInit(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)
{
ImplCycleCollectionTraverse(aCallback, mView, "mView", aFlags);
}
inline void
UnlinkForCC()
{
ImplCycleCollectionUnlink(mView);
}
UIEventInit&
operator=(const UIEventInit& aOther);
private:
static bool
InitIds(JSContext* cx, UIEventInitAtoms* atomsCache);
};
namespace binding_detail {
struct FastUIEventInit : public UIEventInit
{
inline FastUIEventInit()
: UIEventInit(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct EventModifierInit : public UIEventInit
{
MOZ_INIT_OUTSIDE_CTOR bool mAltKey;
MOZ_INIT_OUTSIDE_CTOR bool mCtrlKey;
MOZ_INIT_OUTSIDE_CTOR bool mMetaKey;
MOZ_INIT_OUTSIDE_CTOR bool mModifierAltGraph;
MOZ_INIT_OUTSIDE_CTOR bool mModifierCapsLock;
MOZ_INIT_OUTSIDE_CTOR bool mModifierFn;
MOZ_INIT_OUTSIDE_CTOR bool mModifierFnLock;
MOZ_INIT_OUTSIDE_CTOR bool mModifierNumLock;
MOZ_INIT_OUTSIDE_CTOR bool mModifierOS;
MOZ_INIT_OUTSIDE_CTOR bool mModifierScrollLock;
MOZ_INIT_OUTSIDE_CTOR bool mModifierSymbol;
MOZ_INIT_OUTSIDE_CTOR bool mModifierSymbolLock;
MOZ_INIT_OUTSIDE_CTOR bool mShiftKey;
EventModifierInit();
explicit inline EventModifierInit(const FastDictionaryInitializer& )
: UIEventInit(FastDictionaryInitializer())
{
// Do nothing here; this is used by our "Fast" subclass
}
EventModifierInit(EventModifierInit&& aOther) = default;
explicit inline EventModifierInit(const EventModifierInit& aOther)
: UIEventInit(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)
{
UIEventInit::TraverseForCC(aCallback, aFlags);
}
inline void
UnlinkForCC()
{
UIEventInit::UnlinkForCC();
}
EventModifierInit&
operator=(const EventModifierInit& aOther);
private:
static bool
InitIds(JSContext* cx, EventModifierInitAtoms* atomsCache);
};
namespace binding_detail {
struct FastEventModifierInit : public EventModifierInit
{
inline FastEventModifierInit()
: EventModifierInit(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
namespace UIEvent_Binding {
typedef mozilla::dom::UIEvent NativeType;
static const int32_t SCROLL_PAGE_UP = -32768;
static const int32_t SCROLL_PAGE_DOWN = 32768;
bool
Wrap(JSContext* aCx, mozilla::dom::UIEvent* 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*>
GetProtoObjectHandle(JSContext* aCx);
JSObject*
GetProtoObject(JSContext* aCx);
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::UIEvent,
&CreateInterfaceObjects,
DefineInterfaceProperty::Always);
}
} // namespace UIEvent_Binding
} // namespace mozilla::dom
#endif // DOM_UIEVENTBINDING_H_