Generated file
Copy as Markdown
Other Tools
/* THIS FILE IS AUTOGENERATED FROM HighlightRegistry.webidl BY Codegen.py - DO NOT EDIT */
#ifndef DOM_HIGHLIGHTREGISTRYBINDING_H_
#define DOM_HIGHLIGHTREGISTRYBINDING_H_
#include "js/CallAndConstruct.h"
#include "js/RootingAPI.h"
#include "js/TypeDecls.h"
#include "mozilla/dom/AbstractRange.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/Highlight.h"
#include "mozilla/dom/Nullable.h"
#include "mozilla/dom/PrototypeList.h"
#include "mozilla/dom/ShadowRoot.h"
#include "nsCycleCollectionParticipant.h"
namespace mozilla {
namespace dom {
class AbstractRange;
class Highlight;
struct HighlightHitResultAtoms;
class HighlightRegistry;
struct HighlightsFromPointOptionsAtoms;
struct NativePropertyHooks;
class ProtoAndIfaceCache;
class ShadowRoot;
} // namespace dom
} // namespace mozilla
namespace mozilla::dom {
struct HighlightHitResult : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR Optional<OwningNonNull<mozilla::dom::Highlight>> mHighlight;
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<OwningNonNull<mozilla::dom::AbstractRange>>> mRanges;
HighlightHitResult();
explicit inline HighlightHitResult(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
HighlightHitResult(HighlightHitResult&& aOther) = default;
explicit inline HighlightHitResult(const HighlightHitResult& aOther)
{
*this = aOther;
}
bool
Init(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, mHighlight, "mHighlight", aFlags);
ImplCycleCollectionTraverse(aCallback, mRanges, "mRanges", aFlags);
}
inline void
UnlinkForCC()
{
ImplCycleCollectionUnlink(mHighlight);
ImplCycleCollectionUnlink(mRanges);
}
HighlightHitResult&
operator=(const HighlightHitResult& aOther);
private:
static bool
InitIds(JSContext* cx, HighlightHitResultAtoms* atomsCache);
};
namespace binding_detail {
struct FastHighlightHitResult : public HighlightHitResult
{
inline FastHighlightHitResult()
: HighlightHitResult(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct HighlightsFromPointOptions : public MaybeEmptyDictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR Sequence<OwningNonNull<mozilla::dom::ShadowRoot>> mShadowRoots;
HighlightsFromPointOptions();
explicit inline HighlightsFromPointOptions(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
HighlightsFromPointOptions(HighlightsFromPointOptions&& aOther) = default;
explicit inline HighlightsFromPointOptions(const HighlightsFromPointOptions& aOther)
{
*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);
void
TraceDictionary(JSTracer* trc);
inline void
TraverseForCC(nsCycleCollectionTraversalCallback& aCallback, uint32_t aFlags)
{
ImplCycleCollectionTraverse(aCallback, mShadowRoots, "mShadowRoots", aFlags);
}
inline void
UnlinkForCC()
{
ImplCycleCollectionUnlink(mShadowRoots);
}
HighlightsFromPointOptions&
operator=(const HighlightsFromPointOptions& aOther);
private:
static bool
InitIds(JSContext* cx, HighlightsFromPointOptionsAtoms* atomsCache);
};
namespace binding_detail {
struct FastHighlightsFromPointOptions : public HighlightsFromPointOptions
{
inline FastHighlightsFromPointOptions()
: HighlightsFromPointOptions(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
namespace HighlightRegistry_Binding {
typedef mozilla::dom::HighlightRegistry NativeType;
namespace MaplikeHelpers {
void
Clear(mozilla::dom::HighlightRegistry* self, ErrorResult& aRv);
bool
Delete(mozilla::dom::HighlightRegistry* self, const nsAString& aKey, ErrorResult& aRv);
bool
Has(mozilla::dom::HighlightRegistry* self, const nsAString& aKey, ErrorResult& aRv);
void
Set(mozilla::dom::HighlightRegistry* self, const nsAString& aKey, Highlight& aValue, ErrorResult& aRv);
already_AddRefed<Highlight>
Get(mozilla::dom::HighlightRegistry* self, const nsAString& aKey, ErrorResult& aRv);
} // namespace MaplikeHelpers
bool
Wrap(JSContext* aCx, mozilla::dom::HighlightRegistry* 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::HighlightRegistry,
&CreateInterfaceObjects,
DefineInterfaceProperty::Always);
}
} // namespace HighlightRegistry_Binding
} // namespace mozilla::dom
#endif // DOM_HIGHLIGHTREGISTRYBINDING_H_