2012-05-23 09:44:48 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef TestBindingHeader_h
|
|
|
|
#define TestBindingHeader_h
|
|
|
|
|
|
|
|
#include "nsWrapperCache.h"
|
2012-05-23 09:44:48 -07:00
|
|
|
#include "mozilla/ErrorResult.h"
|
2012-05-23 09:44:48 -07:00
|
|
|
#include "mozilla/dom/BindingUtils.h"
|
2012-05-29 20:45:18 -07:00
|
|
|
#include "mozilla/dom/TypedArray.h"
|
2012-05-23 09:44:48 -07:00
|
|
|
#include "nsCOMPtr.h"
|
2012-05-29 20:45:18 -07:00
|
|
|
// We don't export TestCodeGenBinding.h, but it's right in our parent dir.
|
|
|
|
#include "../TestCodeGenBinding.h"
|
2012-05-18 14:25:47 -07:00
|
|
|
#include "mozilla/dom/UnionTypes.h"
|
2012-05-23 09:44:48 -07:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2012-05-29 20:45:18 -07:00
|
|
|
// IID for the TestNonCastableInterface
|
|
|
|
#define NS_TEST_NONCASTABLE_INTERFACE_IID \
|
|
|
|
{ 0x7c9f8ee2, 0xc9bf, 0x46ca, \
|
|
|
|
{ 0xa0, 0xa9, 0x03, 0xa8, 0xd6, 0x30, 0x0e, 0xde } }
|
|
|
|
|
|
|
|
class TestNonCastableInterface : public nsISupports,
|
|
|
|
public nsWrapperCache
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECLARE_STATIC_IID_ACCESSOR(NS_TEST_NONCASTABLE_INTERFACE_IID)
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
|
|
|
// We need a GetParentObject to make binding codegen happy
|
|
|
|
virtual nsISupports* GetParentObject();
|
|
|
|
};
|
|
|
|
|
2012-07-19 11:48:58 -07:00
|
|
|
// IID for the IndirectlyImplementedInterface
|
|
|
|
#define NS_INDIRECTLY_IMPLEMENTED_INTERFACE_IID \
|
|
|
|
{ 0xfed55b69, 0x7012, 0x4849, \
|
|
|
|
{ 0xaf, 0x56, 0x4b, 0xa9, 0xee, 0x41, 0x30, 0x89 } }
|
|
|
|
|
|
|
|
class IndirectlyImplementedInterface : public nsISupports,
|
|
|
|
public nsWrapperCache
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECLARE_STATIC_IID_ACCESSOR(NS_INDIRECTLY_IMPLEMENTED_INTERFACE_IID)
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
|
|
|
// We need a GetParentObject to make binding codegen happy
|
|
|
|
virtual nsISupports* GetParentObject();
|
|
|
|
|
2012-09-11 12:08:24 -07:00
|
|
|
bool IndirectlyImplementedProperty();
|
|
|
|
void IndirectlyImplementedProperty(bool);
|
2012-09-05 06:21:33 -07:00
|
|
|
void IndirectlyImplementedMethod();
|
2012-07-19 11:48:58 -07:00
|
|
|
};
|
|
|
|
|
2012-05-29 20:45:18 -07:00
|
|
|
// IID for the TestExternalInterface
|
|
|
|
#define NS_TEST_EXTERNAL_INTERFACE_IID \
|
|
|
|
{ 0xd5ba0c99, 0x9b1d, 0x4e71, \
|
|
|
|
{ 0x8a, 0x94, 0x56, 0x38, 0x6c, 0xa3, 0xda, 0x3d } }
|
|
|
|
class TestExternalInterface : public nsISupports
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECLARE_STATIC_IID_ACCESSOR(NS_TEST_EXTERNAL_INTERFACE_IID)
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
};
|
|
|
|
|
2012-07-19 11:48:58 -07:00
|
|
|
// IID for the TestCallbackInterface
|
|
|
|
#define NS_TEST_CALLBACK_INTERFACE_IID \
|
|
|
|
{ 0xbf711ba4, 0xc8f6, 0x46cf, \
|
|
|
|
{ 0xba, 0x5b, 0xaa, 0xe2, 0x78, 0x18, 0xe6, 0x4a } }
|
|
|
|
class TestCallbackInterface : public nsISupports
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECLARE_STATIC_IID_ACCESSOR(NS_TEST_CALLBACK_INTERFACE_IID)
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
};
|
|
|
|
|
2012-06-15 13:25:50 -07:00
|
|
|
class TestNonWrapperCacheInterface : public nsISupports
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
|
|
|
virtual JSObject* WrapObject(JSContext* cx, JSObject* scope);
|
|
|
|
};
|
|
|
|
|
2012-07-26 21:09:10 -07:00
|
|
|
class OnlyForUseInConstructor : public nsISupports,
|
|
|
|
public nsWrapperCache
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
// We need a GetParentObject to make binding codegen happy
|
|
|
|
virtual nsISupports* GetParentObject();
|
|
|
|
};
|
|
|
|
|
2012-05-23 09:44:48 -07:00
|
|
|
class TestInterface : public nsISupports,
|
2012-05-29 20:45:18 -07:00
|
|
|
public nsWrapperCache
|
2012-05-23 09:44:48 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
2012-05-23 09:44:48 -07:00
|
|
|
// We need a GetParentObject to make binding codegen happy
|
2012-05-23 09:44:48 -07:00
|
|
|
virtual nsISupports* GetParentObject();
|
|
|
|
|
2012-05-23 09:44:48 -07:00
|
|
|
// And now our actual WebIDL API
|
2012-06-01 18:26:20 -07:00
|
|
|
// Constructors
|
|
|
|
static
|
|
|
|
already_AddRefed<TestInterface> Constructor(nsISupports*, ErrorResult&);
|
|
|
|
static
|
|
|
|
already_AddRefed<TestInterface> Constructor(nsISupports*, const nsAString&,
|
|
|
|
ErrorResult&);
|
|
|
|
static
|
|
|
|
already_AddRefed<TestInterface> Constructor(nsISupports*, uint32_t,
|
|
|
|
Nullable<bool>&, ErrorResult&);
|
2012-06-04 18:30:00 -07:00
|
|
|
static
|
|
|
|
already_AddRefed<TestInterface> Constructor(nsISupports*, TestInterface*,
|
|
|
|
ErrorResult&);
|
|
|
|
static
|
|
|
|
already_AddRefed<TestInterface> Constructor(nsISupports*,
|
2012-07-26 21:09:10 -07:00
|
|
|
TestNonCastableInterface&,
|
2012-06-04 18:30:00 -07:00
|
|
|
ErrorResult&);
|
2012-07-26 21:09:10 -07:00
|
|
|
/* static
|
|
|
|
already_AddRefed<TestInterface> Constructor(nsISupports*,
|
|
|
|
uint32_t, uint32_t,
|
|
|
|
const TestInterfaceOrOnlyForUseInConstructor&,
|
|
|
|
ErrorResult&);
|
|
|
|
*/
|
|
|
|
|
2012-05-29 20:45:18 -07:00
|
|
|
// Integer types
|
2012-09-11 12:08:24 -07:00
|
|
|
int8_t ReadonlyByte();
|
|
|
|
int8_t WritableByte();
|
2012-09-05 06:21:33 -07:00
|
|
|
void SetWritableByte(int8_t);
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassByte(int8_t);
|
|
|
|
int8_t ReceiveByte();
|
|
|
|
void PassOptionalByte(const Optional<int8_t>&);
|
|
|
|
void PassOptionalByteWithDefault(int8_t);
|
|
|
|
void PassNullableByte(Nullable<int8_t>&);
|
|
|
|
void PassOptionalNullableByte(const Optional< Nullable<int8_t> >&);
|
2012-05-23 09:44:48 -07:00
|
|
|
|
2012-09-11 12:08:24 -07:00
|
|
|
int16_t ReadonlyShort();
|
|
|
|
int16_t WritableShort();
|
2012-09-05 06:21:33 -07:00
|
|
|
void SetWritableShort(int16_t);
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassShort(int16_t);
|
|
|
|
int16_t ReceiveShort();
|
|
|
|
void PassOptionalShort(const Optional<int16_t>&);
|
|
|
|
void PassOptionalShortWithDefault(int16_t);
|
2012-05-23 09:44:48 -07:00
|
|
|
|
2012-09-11 12:08:24 -07:00
|
|
|
int32_t ReadonlyLong();
|
|
|
|
int32_t WritableLong();
|
2012-09-05 06:21:33 -07:00
|
|
|
void SetWritableLong(int32_t);
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassLong(int32_t);
|
|
|
|
int16_t ReceiveLong();
|
|
|
|
void PassOptionalLong(const Optional<int32_t>&);
|
|
|
|
void PassOptionalLongWithDefault(int32_t);
|
2012-05-23 09:44:48 -07:00
|
|
|
|
2012-09-11 12:08:24 -07:00
|
|
|
int64_t ReadonlyLongLong();
|
|
|
|
int64_t WritableLongLong();
|
2012-09-05 06:21:33 -07:00
|
|
|
void SetWritableLongLong(int64_t);
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassLongLong(int64_t);
|
|
|
|
int64_t ReceiveLongLong();
|
|
|
|
void PassOptionalLongLong(const Optional<int64_t>&);
|
|
|
|
void PassOptionalLongLongWithDefault(int64_t);
|
2012-05-23 09:44:48 -07:00
|
|
|
|
2012-09-11 12:08:24 -07:00
|
|
|
uint8_t ReadonlyOctet();
|
|
|
|
uint8_t WritableOctet();
|
2012-09-05 06:21:33 -07:00
|
|
|
void SetWritableOctet(uint8_t);
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassOctet(uint8_t);
|
|
|
|
uint8_t ReceiveOctet();
|
|
|
|
void PassOptionalOctet(const Optional<uint8_t>&);
|
|
|
|
void PassOptionalOctetWithDefault(uint8_t);
|
2012-05-23 09:44:48 -07:00
|
|
|
|
2012-09-11 12:08:24 -07:00
|
|
|
uint16_t ReadonlyUnsignedShort();
|
|
|
|
uint16_t WritableUnsignedShort();
|
2012-09-05 06:21:33 -07:00
|
|
|
void SetWritableUnsignedShort(uint16_t);
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassUnsignedShort(uint16_t);
|
|
|
|
uint16_t ReceiveUnsignedShort();
|
|
|
|
void PassOptionalUnsignedShort(const Optional<uint16_t>&);
|
|
|
|
void PassOptionalUnsignedShortWithDefault(uint16_t);
|
2012-05-23 09:44:48 -07:00
|
|
|
|
2012-09-11 12:08:24 -07:00
|
|
|
uint32_t ReadonlyUnsignedLong();
|
|
|
|
uint32_t WritableUnsignedLong();
|
2012-09-05 06:21:33 -07:00
|
|
|
void SetWritableUnsignedLong(uint32_t);
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassUnsignedLong(uint32_t);
|
|
|
|
uint32_t ReceiveUnsignedLong();
|
|
|
|
void PassOptionalUnsignedLong(const Optional<uint32_t>&);
|
|
|
|
void PassOptionalUnsignedLongWithDefault(uint32_t);
|
2012-05-23 09:44:48 -07:00
|
|
|
|
2012-09-11 12:08:24 -07:00
|
|
|
uint64_t ReadonlyUnsignedLongLong();
|
|
|
|
uint64_t WritableUnsignedLongLong();
|
2012-09-05 06:21:33 -07:00
|
|
|
void SetWritableUnsignedLongLong(uint64_t);
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassUnsignedLongLong(uint64_t);
|
|
|
|
uint64_t ReceiveUnsignedLongLong();
|
|
|
|
void PassOptionalUnsignedLongLong(const Optional<uint64_t>&);
|
|
|
|
void PassOptionalUnsignedLongLongWithDefault(uint64_t);
|
2012-05-23 09:44:48 -07:00
|
|
|
|
2012-05-29 20:45:18 -07:00
|
|
|
// Interface types
|
2012-09-05 06:21:33 -07:00
|
|
|
already_AddRefed<TestInterface> ReceiveSelf();
|
|
|
|
already_AddRefed<TestInterface> ReceiveNullableSelf();
|
|
|
|
TestInterface* ReceiveWeakSelf();
|
|
|
|
TestInterface* ReceiveWeakNullableSelf();
|
|
|
|
void PassSelf(TestInterface&);
|
|
|
|
void PassSelf2(NonNull<TestInterface>&);
|
|
|
|
void PassNullableSelf(TestInterface*);
|
2012-09-11 12:08:24 -07:00
|
|
|
already_AddRefed<TestInterface> NonNullSelf();
|
2012-09-05 06:21:33 -07:00
|
|
|
void SetNonNullSelf(TestInterface&);
|
|
|
|
already_AddRefed<TestInterface> GetNullableSelf();
|
|
|
|
void SetNullableSelf(TestInterface*);
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassOptionalSelf(const Optional<TestInterface*> &);
|
|
|
|
void PassOptionalNonNullSelf(const Optional<NonNull<TestInterface> >&);
|
|
|
|
void PassOptionalSelfWithDefault(TestInterface*);
|
|
|
|
|
|
|
|
already_AddRefed<TestNonWrapperCacheInterface> ReceiveNonWrapperCacheInterface();
|
|
|
|
already_AddRefed<TestNonWrapperCacheInterface> ReceiveNullableNonWrapperCacheInterface();
|
|
|
|
void ReceiveNonWrapperCacheInterfaceSequence(nsTArray<nsRefPtr<TestNonWrapperCacheInterface> >&);
|
|
|
|
void ReceiveNullableNonWrapperCacheInterfaceSequence(nsTArray<nsRefPtr<TestNonWrapperCacheInterface> >&);
|
|
|
|
void ReceiveNonWrapperCacheInterfaceNullableSequence(Nullable<nsTArray<nsRefPtr<TestNonWrapperCacheInterface> > >&);
|
|
|
|
void ReceiveNullableNonWrapperCacheInterfaceNullableSequence(Nullable<nsTArray<nsRefPtr<TestNonWrapperCacheInterface> > >&);
|
|
|
|
|
|
|
|
already_AddRefed<TestNonCastableInterface> ReceiveOther();
|
|
|
|
already_AddRefed<TestNonCastableInterface> ReceiveNullableOther();
|
|
|
|
TestNonCastableInterface* ReceiveWeakOther();
|
|
|
|
TestNonCastableInterface* ReceiveWeakNullableOther();
|
|
|
|
void PassOther(TestNonCastableInterface&);
|
|
|
|
void PassOther2(NonNull<TestNonCastableInterface>&);
|
|
|
|
void PassNullableOther(TestNonCastableInterface*);
|
2012-09-11 12:08:24 -07:00
|
|
|
already_AddRefed<TestNonCastableInterface> NonNullOther();
|
2012-09-05 06:21:33 -07:00
|
|
|
void SetNonNullOther(TestNonCastableInterface&);
|
|
|
|
already_AddRefed<TestNonCastableInterface> GetNullableOther();
|
|
|
|
void SetNullableOther(TestNonCastableInterface*);
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassOptionalOther(const Optional<TestNonCastableInterface*>&);
|
|
|
|
void PassOptionalNonNullOther(const Optional<NonNull<TestNonCastableInterface> >&);
|
|
|
|
void PassOptionalOtherWithDefault(TestNonCastableInterface*);
|
|
|
|
|
|
|
|
already_AddRefed<TestExternalInterface> ReceiveExternal();
|
|
|
|
already_AddRefed<TestExternalInterface> ReceiveNullableExternal();
|
|
|
|
TestExternalInterface* ReceiveWeakExternal();
|
|
|
|
TestExternalInterface* ReceiveWeakNullableExternal();
|
|
|
|
void PassExternal(TestExternalInterface*);
|
|
|
|
void PassExternal2(TestExternalInterface*);
|
|
|
|
void PassNullableExternal(TestExternalInterface*);
|
2012-09-11 12:08:24 -07:00
|
|
|
already_AddRefed<TestExternalInterface> NonNullExternal();
|
2012-09-05 06:21:33 -07:00
|
|
|
void SetNonNullExternal(TestExternalInterface*);
|
|
|
|
already_AddRefed<TestExternalInterface> GetNullableExternal();
|
|
|
|
void SetNullableExternal(TestExternalInterface*);
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassOptionalExternal(const Optional<TestExternalInterface*>&);
|
|
|
|
void PassOptionalNonNullExternal(const Optional<TestExternalInterface*>&);
|
|
|
|
void PassOptionalExternalWithDefault(TestExternalInterface*);
|
|
|
|
|
|
|
|
already_AddRefed<TestCallbackInterface> ReceiveCallbackInterface();
|
|
|
|
already_AddRefed<TestCallbackInterface> ReceiveNullableCallbackInterface();
|
|
|
|
TestCallbackInterface* ReceiveWeakCallbackInterface();
|
|
|
|
TestCallbackInterface* ReceiveWeakNullableCallbackInterface();
|
|
|
|
void PassCallbackInterface(TestCallbackInterface&);
|
|
|
|
void PassCallbackInterface2(OwningNonNull<TestCallbackInterface>);
|
|
|
|
void PassNullableCallbackInterface(TestCallbackInterface*);
|
2012-09-11 12:08:24 -07:00
|
|
|
already_AddRefed<TestCallbackInterface> NonNullCallbackInterface();
|
2012-09-05 06:21:33 -07:00
|
|
|
void SetNonNullCallbackInterface(TestCallbackInterface&);
|
|
|
|
already_AddRefed<TestCallbackInterface> GetNullableCallbackInterface();
|
|
|
|
void SetNullableCallbackInterface(TestCallbackInterface*);
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassOptionalCallbackInterface(const Optional<nsRefPtr<TestCallbackInterface> >&);
|
|
|
|
void PassOptionalNonNullCallbackInterface(const Optional<OwningNonNull<TestCallbackInterface> >&);
|
|
|
|
void PassOptionalCallbackInterfaceWithDefault(TestCallbackInterface*);
|
2012-07-19 11:48:58 -07:00
|
|
|
|
2012-09-05 06:21:33 -07:00
|
|
|
already_AddRefed<IndirectlyImplementedInterface> ReceiveConsequentialInterface();
|
|
|
|
void PassConsequentialInterface(IndirectlyImplementedInterface&);
|
2012-07-19 11:48:58 -07:00
|
|
|
|
2012-05-29 20:45:18 -07:00
|
|
|
// Sequence types
|
2012-09-05 06:21:33 -07:00
|
|
|
void ReceiveSequence(nsTArray<int32_t>&);
|
|
|
|
void ReceiveNullableSequence(Nullable< nsTArray<int32_t> >&);
|
|
|
|
void ReceiveSequenceOfNullableInts(nsTArray< Nullable<int32_t> >&);
|
|
|
|
void ReceiveNullableSequenceOfNullableInts(Nullable< nsTArray< Nullable<int32_t> > >&);
|
|
|
|
void PassSequence(const Sequence<int32_t> &);
|
|
|
|
void PassNullableSequence(const Nullable< Sequence<int32_t> >&);
|
|
|
|
void PassSequenceOfNullableInts(const Sequence<Nullable<int32_t> >&);
|
|
|
|
void PassOptionalSequenceOfNullableInts(const Optional<Sequence<Nullable<int32_t> > > &);
|
|
|
|
void PassOptionalNullableSequenceOfNullableInts(const Optional<Nullable<Sequence<Nullable<int32_t> > > > &);
|
|
|
|
void ReceiveCastableObjectSequence(nsTArray< nsRefPtr<TestInterface> > &);
|
2012-10-10 12:57:57 -07:00
|
|
|
void ReceiveCallbackObjectSequence(nsTArray< nsRefPtr<TestCallbackInterface> > &);
|
2012-09-05 06:21:33 -07:00
|
|
|
void ReceiveNullableCastableObjectSequence(nsTArray< nsRefPtr<TestInterface> > &);
|
2012-10-10 12:57:57 -07:00
|
|
|
void ReceiveNullableCallbackObjectSequence(nsTArray< nsRefPtr<TestCallbackInterface> > &);
|
2012-09-05 06:21:33 -07:00
|
|
|
void ReceiveCastableObjectNullableSequence(Nullable< nsTArray< nsRefPtr<TestInterface> > >&);
|
|
|
|
void ReceiveNullableCastableObjectNullableSequence(Nullable< nsTArray< nsRefPtr<TestInterface> > >&);
|
|
|
|
void ReceiveWeakCastableObjectSequence(nsTArray<TestInterface*> &);
|
|
|
|
void ReceiveWeakNullableCastableObjectSequence(nsTArray<TestInterface*> &);
|
|
|
|
void ReceiveWeakCastableObjectNullableSequence(Nullable< nsTArray<TestInterface*> >&);
|
|
|
|
void ReceiveWeakNullableCastableObjectNullableSequence(Nullable< nsTArray<TestInterface*> >&);
|
|
|
|
void PassCastableObjectSequence(const Sequence< OwningNonNull<TestInterface> >&);
|
|
|
|
void PassNullableCastableObjectSequence(const Sequence< nsRefPtr<TestInterface> > &);
|
|
|
|
void PassCastableObjectNullableSequence(const Nullable< Sequence< OwningNonNull<TestInterface> > >&);
|
|
|
|
void PassNullableCastableObjectNullableSequence(const Nullable< Sequence< nsRefPtr<TestInterface> > >&);
|
|
|
|
void PassOptionalSequence(const Optional<Sequence<int32_t> >&);
|
|
|
|
void PassOptionalNullableSequence(const Optional<Nullable<Sequence<int32_t> > >&);
|
|
|
|
void PassOptionalNullableSequenceWithDefaultValue(const Nullable< Sequence<int32_t> >&);
|
|
|
|
void PassOptionalObjectSequence(const Optional<Sequence<OwningNonNull<TestInterface> > >&);
|
|
|
|
|
|
|
|
void ReceiveStringSequence(nsTArray<nsString>&);
|
|
|
|
void PassStringSequence(const Sequence<nsString>&);
|
2012-06-12 07:22:05 -07:00
|
|
|
|
2012-06-13 08:15:05 -07:00
|
|
|
void ReceiveAnySequence(JSContext*, nsTArray<JS::Value>&);
|
2012-09-20 19:47:47 -07:00
|
|
|
void ReceiveNullableAnySequence(JSContext*, Nullable<nsTArray<JS::Value> >);
|
2012-06-13 08:15:05 -07:00
|
|
|
|
2012-05-29 20:45:18 -07:00
|
|
|
// Typed array types
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassArrayBuffer(ArrayBuffer&);
|
|
|
|
void PassNullableArrayBuffer(ArrayBuffer*);
|
|
|
|
void PassOptionalArrayBuffer(const Optional<ArrayBuffer>&);
|
|
|
|
void PassOptionalNullableArrayBuffer(const Optional<ArrayBuffer*>&);
|
|
|
|
void PassOptionalNullableArrayBufferWithDefaultValue(ArrayBuffer*);
|
|
|
|
void PassArrayBufferView(ArrayBufferView&);
|
|
|
|
void PassInt8Array(Int8Array&);
|
|
|
|
void PassInt16Array(Int16Array&);
|
|
|
|
void PassInt32Array(Int32Array&);
|
|
|
|
void PassUint8Array(Uint8Array&);
|
|
|
|
void PassUint16Array(Uint16Array&);
|
|
|
|
void PassUint32Array(Uint32Array&);
|
|
|
|
void PassUint8ClampedArray(Uint8ClampedArray&);
|
|
|
|
void PassFloat32Array(Float32Array&);
|
|
|
|
void PassFloat64Array(Float64Array&);
|
2012-09-20 19:47:47 -07:00
|
|
|
JSObject* ReceiveUint8Array(JSContext*);
|
2012-05-29 20:45:18 -07:00
|
|
|
|
|
|
|
// String types
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassString(const nsAString&);
|
|
|
|
void PassNullableString(const nsAString&);
|
|
|
|
void PassOptionalString(const Optional<nsAString>&);
|
|
|
|
void PassOptionalStringWithDefaultValue(const nsAString&);
|
|
|
|
void PassOptionalNullableString(const Optional<nsAString>&);
|
|
|
|
void PassOptionalNullableStringWithDefaultValue(const nsAString&);
|
2012-05-29 20:45:18 -07:00
|
|
|
|
|
|
|
// Enumarated types
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassEnum(TestEnum);
|
|
|
|
void PassOptionalEnum(const Optional<TestEnum>&);
|
|
|
|
void PassEnumWithDefault(TestEnum);
|
|
|
|
TestEnum ReceiveEnum();
|
2012-09-11 12:08:24 -07:00
|
|
|
TestEnum EnumAttribute();
|
|
|
|
TestEnum ReadonlyEnumAttribute();
|
2012-09-05 06:21:33 -07:00
|
|
|
void SetEnumAttribute(TestEnum);
|
2012-05-29 20:45:18 -07:00
|
|
|
|
|
|
|
// Callback types
|
2012-10-10 12:53:02 -07:00
|
|
|
void PassCallback(JSContext*, JSObject&);
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassNullableCallback(JSContext*, JSObject*);
|
2012-10-10 12:53:02 -07:00
|
|
|
void PassOptionalCallback(JSContext*, const Optional<NonNull<JSObject> >&);
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassOptionalNullableCallback(JSContext*, const Optional<JSObject*>&);
|
|
|
|
void PassOptionalNullableCallbackWithDefaultValue(JSContext*, JSObject*);
|
|
|
|
JSObject* ReceiveCallback(JSContext*);
|
|
|
|
JSObject* ReceiveNullableCallback(JSContext*);
|
2012-10-10 12:53:02 -07:00
|
|
|
void PassNullableTreatAsNullCallback(JSContext*, JSObject*);
|
|
|
|
void PassOptionalNullableTreatAsNullCallback(JSContext*, const Optional<JSObject*>&);
|
|
|
|
void PassOptionalNullableTreatAsNullCallbackWithDefaultValue(JSContext*, JSObject*);
|
2012-05-29 20:45:18 -07:00
|
|
|
|
|
|
|
// Any types
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassAny(JSContext*, JS::Value);
|
|
|
|
void PassOptionalAny(JSContext*, const Optional<JS::Value>&);
|
|
|
|
void PassAnyDefaultNull(JSContext*, JS::Value);
|
|
|
|
JS::Value ReceiveAny(JSContext*);
|
2012-05-29 20:45:18 -07:00
|
|
|
|
2012-05-18 14:25:47 -07:00
|
|
|
// object types
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassObject(JSContext*, JSObject&);
|
|
|
|
void PassNullableObject(JSContext*, JSObject*);
|
|
|
|
void PassOptionalObject(JSContext*, const Optional<NonNull<JSObject> >&);
|
|
|
|
void PassOptionalNullableObject(JSContext*, const Optional<JSObject*>&);
|
|
|
|
void PassOptionalNullableObjectWithDefaultValue(JSContext*, JSObject*);
|
|
|
|
JSObject* ReceiveObject(JSContext*);
|
|
|
|
JSObject* ReceiveNullableObject(JSContext*);
|
2012-05-29 20:45:18 -07:00
|
|
|
|
2012-05-18 14:25:47 -07:00
|
|
|
// Union types
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassUnion(JSContext*, const ObjectOrLong& arg);
|
|
|
|
void PassUnionWithNullable(JSContext*, const ObjectOrNullOrLong& arg)
|
2012-05-18 14:25:47 -07:00
|
|
|
{
|
|
|
|
ObjectOrLong returnValue;
|
|
|
|
if (arg.IsNull()) {
|
|
|
|
} else if (arg.IsObject()) {
|
|
|
|
JSObject& obj = (JSObject&)arg.GetAsObject();
|
|
|
|
JS_GetClass(&obj);
|
|
|
|
//returnValue.SetAsObject(&obj);
|
|
|
|
} else {
|
|
|
|
int32_t i = arg.GetAsLong();
|
|
|
|
i += 1;
|
|
|
|
}
|
|
|
|
}
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassNullableUnion(JSContext*, const Nullable<ObjectOrLong>&);
|
|
|
|
void PassOptionalUnion(JSContext*, const Optional<ObjectOrLong>&);
|
|
|
|
void PassOptionalNullableUnion(JSContext*, const Optional<Nullable<ObjectOrLong> >&);
|
|
|
|
void PassOptionalNullableUnionWithDefaultValue(JSContext*, const Nullable<ObjectOrLong>&);
|
|
|
|
//void PassUnionWithInterfaces(const TestInterfaceOrTestExternalInterface& arg);
|
|
|
|
//void PassUnionWithInterfacesAndNullable(const TestInterfaceOrNullOrTestExternalInterface& arg);
|
|
|
|
void PassUnionWithArrayBuffer(const ArrayBufferOrLong&);
|
|
|
|
void PassUnionWithString(JSContext*, const StringOrObject&);
|
|
|
|
//void PassUnionWithEnum(JSContext*, const TestEnumOrObject&);
|
|
|
|
void PassUnionWithCallback(JSContext*, const TestCallbackOrLong&);
|
|
|
|
void PassUnionWithObject(JSContext*, const ObjectOrLong&);
|
2012-05-18 14:25:47 -07:00
|
|
|
|
2012-05-18 14:25:47 -07:00
|
|
|
// binaryNames tests
|
2012-09-05 06:21:33 -07:00
|
|
|
void MethodRenamedTo();
|
|
|
|
void MethodRenamedTo(int8_t);
|
2012-09-11 12:08:24 -07:00
|
|
|
int8_t AttributeGetterRenamedTo();
|
|
|
|
int8_t AttributeRenamedTo();
|
2012-09-05 06:21:33 -07:00
|
|
|
void SetAttributeRenamedTo(int8_t);
|
2012-05-18 14:25:47 -07:00
|
|
|
|
2012-06-12 07:22:05 -07:00
|
|
|
// Dictionary tests
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassDictionary(const Dict&);
|
|
|
|
void PassOtherDictionary(const GrandparentDict&);
|
|
|
|
void PassSequenceOfDictionaries(const Sequence<Dict>&);
|
|
|
|
void PassDictionaryOrLong(const Dict&);
|
|
|
|
void PassDictionaryOrLong(int32_t);
|
|
|
|
void PassDictContainingDict(const DictContainingDict&);
|
2012-09-18 20:24:27 -07:00
|
|
|
void PassDictContainingSequence(const DictContainingSequence&);
|
2012-06-12 07:22:05 -07:00
|
|
|
|
2012-09-06 07:23:51 -07:00
|
|
|
// Typedefs
|
|
|
|
void ExerciseTypedefInterfaces1(TestInterface&);
|
|
|
|
already_AddRefed<TestInterface> ExerciseTypedefInterfaces2(TestInterface*);
|
|
|
|
void ExerciseTypedefInterfaces3(TestInterface&);
|
|
|
|
|
2012-09-12 09:24:58 -07:00
|
|
|
// Miscellania
|
|
|
|
int32_t AttrWithLenientThis();
|
|
|
|
void SetAttrWithLenientThis(int32_t);
|
|
|
|
|
2012-06-11 15:21:35 -07:00
|
|
|
// Methods and properties imported via "implements"
|
2012-09-11 12:08:24 -07:00
|
|
|
bool ImplementedProperty();
|
2012-09-05 06:21:33 -07:00
|
|
|
void SetImplementedProperty(bool);
|
2012-09-05 06:21:33 -07:00
|
|
|
void ImplementedMethod();
|
2012-09-11 12:08:24 -07:00
|
|
|
bool ImplementedParentProperty();
|
2012-09-05 06:21:33 -07:00
|
|
|
void SetImplementedParentProperty(bool);
|
2012-09-05 06:21:33 -07:00
|
|
|
void ImplementedParentMethod();
|
2012-09-11 12:08:24 -07:00
|
|
|
bool IndirectlyImplementedProperty();
|
2012-09-05 06:21:33 -07:00
|
|
|
void SetIndirectlyImplementedProperty(bool);
|
2012-09-05 06:21:33 -07:00
|
|
|
void IndirectlyImplementedMethod();
|
2012-09-11 12:08:24 -07:00
|
|
|
uint32_t DiamondImplementedProperty();
|
2012-09-06 00:25:03 -07:00
|
|
|
|
|
|
|
// Test EnforceRange/Clamp
|
|
|
|
void DontEnforceRangeOrClamp(int8_t);
|
|
|
|
void DoEnforceRange(int8_t);
|
|
|
|
void DoClamp(int8_t);
|
2012-06-11 15:21:35 -07:00
|
|
|
|
2012-05-23 09:44:48 -07:00
|
|
|
private:
|
2012-05-23 09:44:48 -07:00
|
|
|
// We add signatures here that _could_ start matching if the codegen
|
|
|
|
// got data types wrong. That way if it ever does we'll have a call
|
|
|
|
// to these private deleted methods and compilation will fail.
|
2012-09-05 06:21:33 -07:00
|
|
|
void SetReadonlyByte(int8_t) MOZ_DELETE;
|
2012-05-23 09:44:48 -07:00
|
|
|
template<typename T>
|
2012-09-05 06:21:33 -07:00
|
|
|
void SetWritableByte(T) MOZ_DELETE;
|
2012-05-23 09:44:48 -07:00
|
|
|
template<typename T>
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassByte(T) MOZ_DELETE;
|
2012-05-29 20:45:18 -07:00
|
|
|
template<typename T>
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassOptionalByte(const Optional<T>&) MOZ_DELETE;
|
2012-05-29 20:45:18 -07:00
|
|
|
template<typename T>
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassOptionalByteWithDefault(T) MOZ_DELETE;
|
2012-05-23 09:44:48 -07:00
|
|
|
|
2012-09-05 06:21:33 -07:00
|
|
|
void SetReadonlyShort(int16_t) MOZ_DELETE;
|
2012-05-23 09:44:48 -07:00
|
|
|
template<typename T>
|
2012-09-05 06:21:33 -07:00
|
|
|
void SetWritableShort(T) MOZ_DELETE;
|
2012-05-23 09:44:48 -07:00
|
|
|
template<typename T>
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassShort(T) MOZ_DELETE;
|
2012-05-29 20:45:18 -07:00
|
|
|
template<typename T>
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassOptionalShort(const Optional<T>&) MOZ_DELETE;
|
2012-05-29 20:45:18 -07:00
|
|
|
template<typename T>
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassOptionalShortWithDefault(T) MOZ_DELETE;
|
2012-05-23 09:44:48 -07:00
|
|
|
|
2012-09-05 06:21:33 -07:00
|
|
|
void SetReadonlyLong(int32_t) MOZ_DELETE;
|
2012-05-23 09:44:48 -07:00
|
|
|
template<typename T>
|
2012-09-05 06:21:33 -07:00
|
|
|
void SetWritableLong(T) MOZ_DELETE;
|
2012-05-23 09:44:48 -07:00
|
|
|
template<typename T>
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassLong(T) MOZ_DELETE;
|
2012-05-29 20:45:18 -07:00
|
|
|
template<typename T>
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassOptionalLong(const Optional<T>&) MOZ_DELETE;
|
2012-05-29 20:45:18 -07:00
|
|
|
template<typename T>
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassOptionalLongWithDefault(T) MOZ_DELETE;
|
2012-05-23 09:44:48 -07:00
|
|
|
|
2012-09-05 06:21:33 -07:00
|
|
|
void SetReadonlyLongLong(int64_t) MOZ_DELETE;
|
2012-05-23 09:44:48 -07:00
|
|
|
template<typename T>
|
2012-09-05 06:21:33 -07:00
|
|
|
void SetWritableLongLong(T) MOZ_DELETE;
|
2012-05-23 09:44:48 -07:00
|
|
|
template<typename T>
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassLongLong(T) MOZ_DELETE;
|
2012-05-29 20:45:18 -07:00
|
|
|
template<typename T>
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassOptionalLongLong(const Optional<T>&) MOZ_DELETE;
|
2012-05-29 20:45:18 -07:00
|
|
|
template<typename T>
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassOptionalLongLongWithDefault(T) MOZ_DELETE;
|
2012-05-23 09:44:48 -07:00
|
|
|
|
2012-09-05 06:21:33 -07:00
|
|
|
void SetReadonlyOctet(uint8_t) MOZ_DELETE;
|
2012-05-23 09:44:48 -07:00
|
|
|
template<typename T>
|
2012-09-05 06:21:33 -07:00
|
|
|
void SetWritableOctet(T) MOZ_DELETE;
|
2012-05-23 09:44:48 -07:00
|
|
|
template<typename T>
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassOctet(T) MOZ_DELETE;
|
2012-05-29 20:45:18 -07:00
|
|
|
template<typename T>
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassOptionalOctet(const Optional<T>&) MOZ_DELETE;
|
2012-05-29 20:45:18 -07:00
|
|
|
template<typename T>
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassOptionalOctetWithDefault(T) MOZ_DELETE;
|
2012-05-23 09:44:48 -07:00
|
|
|
|
2012-09-05 06:21:33 -07:00
|
|
|
void SetReadonlyUnsignedShort(uint16_t) MOZ_DELETE;
|
2012-05-23 09:44:48 -07:00
|
|
|
template<typename T>
|
2012-09-05 06:21:33 -07:00
|
|
|
void SetWritableUnsignedShort(T) MOZ_DELETE;
|
2012-05-23 09:44:48 -07:00
|
|
|
template<typename T>
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassUnsignedShort(T) MOZ_DELETE;
|
2012-05-29 20:45:18 -07:00
|
|
|
template<typename T>
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassOptionalUnsignedShort(const Optional<T>&) MOZ_DELETE;
|
2012-05-29 20:45:18 -07:00
|
|
|
template<typename T>
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassOptionalUnsignedShortWithDefault(T) MOZ_DELETE;
|
2012-05-23 09:44:48 -07:00
|
|
|
|
2012-09-05 06:21:33 -07:00
|
|
|
void SetReadonlyUnsignedLong(uint32_t) MOZ_DELETE;
|
2012-05-23 09:44:48 -07:00
|
|
|
template<typename T>
|
2012-09-05 06:21:33 -07:00
|
|
|
void SetWritableUnsignedLong(T) MOZ_DELETE;
|
2012-05-23 09:44:48 -07:00
|
|
|
template<typename T>
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassUnsignedLong(T) MOZ_DELETE;
|
2012-05-29 20:45:18 -07:00
|
|
|
template<typename T>
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassOptionalUnsignedLong(const Optional<T>&) MOZ_DELETE;
|
2012-05-29 20:45:18 -07:00
|
|
|
template<typename T>
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassOptionalUnsignedLongWithDefault(T) MOZ_DELETE;
|
2012-05-23 09:44:48 -07:00
|
|
|
|
2012-09-05 06:21:33 -07:00
|
|
|
void SetReadonlyUnsignedLongLong(uint64_t) MOZ_DELETE;
|
2012-05-23 09:44:48 -07:00
|
|
|
template<typename T>
|
2012-09-05 06:21:33 -07:00
|
|
|
void SetWritableUnsignedLongLong(T) MOZ_DELETE;
|
2012-05-23 09:44:48 -07:00
|
|
|
template<typename T>
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassUnsignedLongLong(T) MOZ_DELETE;
|
2012-05-29 20:45:18 -07:00
|
|
|
template<typename T>
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassOptionalUnsignedLongLong(const Optional<T>&) MOZ_DELETE;
|
2012-05-29 20:45:18 -07:00
|
|
|
template<typename T>
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassOptionalUnsignedLongLongWithDefault(T) MOZ_DELETE;
|
2012-05-24 22:08:26 -07:00
|
|
|
|
2012-05-29 20:45:18 -07:00
|
|
|
// Enforce that only const things are passed for sequences
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassSequence(Sequence<int32_t> &) MOZ_DELETE;
|
|
|
|
void PassNullableSequence(Nullable< Sequence<int32_t> >&) MOZ_DELETE;
|
|
|
|
void PassOptionalNullableSequenceWithDefaultValue(Nullable< Sequence<int32_t> >&) MOZ_DELETE;
|
2012-05-29 20:45:18 -07:00
|
|
|
|
|
|
|
// Enforce that only const things are passed for optional
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassOptionalByte(Optional<int8_t>&) MOZ_DELETE;
|
|
|
|
void PassOptionalNullableByte(Optional<Nullable<int8_t> >&) MOZ_DELETE;
|
|
|
|
void PassOptionalShort(Optional<int16_t>&) MOZ_DELETE;
|
|
|
|
void PassOptionalLong(Optional<int32_t>&) MOZ_DELETE;
|
|
|
|
void PassOptionalLongLong(Optional<int64_t>&) MOZ_DELETE;
|
|
|
|
void PassOptionalOctet(Optional<uint8_t>&) MOZ_DELETE;
|
|
|
|
void PassOptionalUnsignedShort(Optional<uint16_t>&) MOZ_DELETE;
|
|
|
|
void PassOptionalUnsignedLong(Optional<uint32_t>&) MOZ_DELETE;
|
|
|
|
void PassOptionalUnsignedLongLong(Optional<uint64_t>&) MOZ_DELETE;
|
|
|
|
void PassOptionalSelf(Optional<TestInterface*> &) MOZ_DELETE;
|
|
|
|
void PassOptionalNonNullSelf(Optional<NonNull<TestInterface> >&) MOZ_DELETE;
|
|
|
|
void PassOptionalOther(Optional<TestNonCastableInterface*>&);
|
|
|
|
void PassOptionalNonNullOther(Optional<NonNull<TestNonCastableInterface> >&);
|
|
|
|
void PassOptionalExternal(Optional<TestExternalInterface*>&) MOZ_DELETE;
|
|
|
|
void PassOptionalNonNullExternal(Optional<TestExternalInterface*>&) MOZ_DELETE;
|
|
|
|
void PassOptionalSequence(Optional<Sequence<int32_t> >&) MOZ_DELETE;
|
|
|
|
void PassOptionalNullableSequence(Optional<Nullable<Sequence<int32_t> > >&) MOZ_DELETE;
|
|
|
|
void PassOptionalObjectSequence(Optional<Sequence<OwningNonNull<TestInterface> > >&) MOZ_DELETE;
|
|
|
|
void PassOptionalArrayBuffer(Optional<ArrayBuffer>&) MOZ_DELETE;
|
|
|
|
void PassOptionalNullableArrayBuffer(Optional<ArrayBuffer*>&) MOZ_DELETE;
|
|
|
|
void PassOptionalEnum(Optional<TestEnum>&) MOZ_DELETE;
|
|
|
|
void PassOptionalCallback(JSContext*, Optional<JSObject*>&) MOZ_DELETE;
|
|
|
|
void PassOptionalNullableCallback(JSContext*, Optional<JSObject*>&) MOZ_DELETE;
|
|
|
|
void PassOptionalAny(Optional<JS::Value>&) MOZ_DELETE;
|
2012-05-29 20:45:18 -07:00
|
|
|
|
|
|
|
// And test that string stuff is always const
|
2012-09-05 06:21:33 -07:00
|
|
|
void PassString(nsAString&) MOZ_DELETE;
|
|
|
|
void PassNullableString(nsAString&) MOZ_DELETE;
|
|
|
|
void PassOptionalString(Optional<nsAString>&) MOZ_DELETE;
|
|
|
|
void PassOptionalStringWithDefaultValue(nsAString&) MOZ_DELETE;
|
|
|
|
void PassOptionalNullableString(Optional<nsAString>&) MOZ_DELETE;
|
|
|
|
void PassOptionalNullableStringWithDefaultValue(nsAString&) MOZ_DELETE;
|
2012-05-29 20:45:18 -07:00
|
|
|
|
2012-05-23 09:44:48 -07:00
|
|
|
};
|
|
|
|
|
2012-05-22 06:46:20 -07:00
|
|
|
class TestIndexedGetterInterface : public nsISupports,
|
|
|
|
public nsWrapperCache
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
|
|
|
// We need a GetParentObject to make binding codegen happy
|
|
|
|
virtual nsISupports* GetParentObject();
|
|
|
|
|
2012-09-05 06:21:33 -07:00
|
|
|
uint32_t IndexedGetter(uint32_t, bool&);
|
|
|
|
uint32_t IndexedGetter(uint32_t&) MOZ_DELETE;
|
|
|
|
uint32_t Item(uint32_t&);
|
|
|
|
uint32_t Item(uint32_t, bool&) MOZ_DELETE;
|
2012-09-11 12:08:24 -07:00
|
|
|
uint32_t Length();
|
2012-05-22 06:46:20 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
class TestNamedGetterInterface : public nsISupports,
|
|
|
|
public nsWrapperCache
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
|
|
|
// We need a GetParentObject to make binding codegen happy
|
|
|
|
virtual nsISupports* GetParentObject();
|
|
|
|
|
2012-09-05 06:21:33 -07:00
|
|
|
void NamedGetter(const nsAString&, bool&, nsAString&);
|
2012-05-22 06:46:20 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
class TestIndexedAndNamedGetterInterface : public nsISupports,
|
|
|
|
public nsWrapperCache
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
|
|
|
// We need a GetParentObject to make binding codegen happy
|
|
|
|
virtual nsISupports* GetParentObject();
|
|
|
|
|
2012-09-05 06:21:33 -07:00
|
|
|
uint32_t IndexedGetter(uint32_t, bool&);
|
|
|
|
void NamedGetter(const nsAString&, bool&, nsAString&);
|
|
|
|
void NamedItem(const nsAString&, nsAString&);
|
2012-09-11 12:08:24 -07:00
|
|
|
uint32_t Length();
|
2012-05-22 06:46:20 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
class TestIndexedSetterInterface : public nsISupports,
|
|
|
|
public nsWrapperCache
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
|
|
|
// We need a GetParentObject to make binding codegen happy
|
|
|
|
virtual nsISupports* GetParentObject();
|
|
|
|
|
2012-09-05 06:21:33 -07:00
|
|
|
void IndexedSetter(uint32_t, const nsAString&);
|
|
|
|
void SetItem(uint32_t, const nsAString&);
|
2012-05-22 06:46:20 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
class TestNamedSetterInterface : public nsISupports,
|
|
|
|
public nsWrapperCache
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
|
|
|
// We need a GetParentObject to make binding codegen happy
|
|
|
|
virtual nsISupports* GetParentObject();
|
|
|
|
|
2012-09-05 06:21:33 -07:00
|
|
|
void NamedSetter(const nsAString&, TestIndexedSetterInterface&);
|
2012-05-22 06:46:20 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
class TestIndexedAndNamedSetterInterface : public nsISupports,
|
|
|
|
public nsWrapperCache
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
|
|
|
// We need a GetParentObject to make binding codegen happy
|
|
|
|
virtual nsISupports* GetParentObject();
|
|
|
|
|
2012-09-05 06:21:33 -07:00
|
|
|
void IndexedSetter(uint32_t, TestIndexedSetterInterface&);
|
|
|
|
void NamedSetter(const nsAString&, TestIndexedSetterInterface&);
|
|
|
|
void SetNamedItem(const nsAString&, TestIndexedSetterInterface&);
|
2012-05-22 06:46:20 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
class TestIndexedAndNamedGetterAndSetterInterface : public TestIndexedSetterInterface
|
|
|
|
{
|
|
|
|
public:
|
2012-09-05 06:21:33 -07:00
|
|
|
uint32_t IndexedGetter(uint32_t, bool&);
|
|
|
|
uint32_t Item(uint32_t);
|
|
|
|
void NamedGetter(const nsAString&, bool&, nsAString&);
|
|
|
|
void NamedItem(const nsAString&, nsAString&);
|
|
|
|
void IndexedSetter(uint32_t, int32_t&);
|
|
|
|
void IndexedSetter(uint32_t, const nsAString&) MOZ_DELETE;
|
|
|
|
void NamedSetter(const nsAString&, const nsAString&);
|
2012-05-22 06:46:20 -07:00
|
|
|
void Stringify(nsAString&);
|
2012-09-11 12:08:24 -07:00
|
|
|
uint32_t Length();
|
2012-05-22 06:46:20 -07:00
|
|
|
};
|
|
|
|
|
2012-05-23 09:44:48 -07:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif /* TestBindingHeader_h */
|