Copy as Markdown

Other Tools

/*
* DO NOT EDIT. THIS FILE IS GENERATED FROM $SRCDIR/toolkit/components/kvstore/nsIKeyValue.idl
*/
#ifndef __gen_nsIKeyValue_h__
#define __gen_nsIKeyValue_h__
#include "nsISupports.h"
#include "nsIVariant.h"
#include "nsTArray.h"
#include "js/GCAnnotations.h"
/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
class nsIKeyValueImporter; /* forward declaration */
class nsIKeyValueDatabaseImportOptions; /* forward declaration */
class nsIKeyValueDatabaseCallback; /* forward declaration */
class nsIKeyValueEnumeratorCallback; /* forward declaration */
class nsIKeyValuePairCallback; /* forward declaration */
class nsIKeyValueVariantCallback; /* forward declaration */
class nsIKeyValueVoidCallback; /* forward declaration */
class nsIKeyValuePair; /* forward declaration */
/* starting interface: nsIKeyValueService */
#define NS_IKEYVALUESERVICE_IID_STR "46c893dd-4c14-4de0-b33d-a1be18c6d062"
#define NS_IKEYVALUESERVICE_IID \
{0x46c893dd, 0x4c14, 0x4de0, \
{ 0xb3, 0x3d, 0xa1, 0xbe, 0x18, 0xc6, 0xd0, 0x62 }}
class NS_NO_VTABLE nsIKeyValueService : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IKEYVALUESERVICE_IID)
/* Used by ToJSValue to check which scriptable interface is implemented. */
using ScriptableInterfaceType = nsIKeyValueService;
enum RecoveryStrategy : uint8_t {
ERROR = 0,
DISCARD = 1,
RENAME = 2,
};
/* void getOrCreate (in nsIKeyValueDatabaseCallback callback, in AString path, in AUTF8String name); */
NS_IMETHOD GetOrCreate(nsIKeyValueDatabaseCallback *callback, const nsAString& path, const nsACString& name) = 0;
/* void getOrCreateWithOptions (in nsIKeyValueDatabaseCallback callback, in AString path, in AUTF8String name, [optional] in nsIKeyValueService_RecoveryStrategy recoveryStrategy); */
NS_IMETHOD GetOrCreateWithOptions(nsIKeyValueDatabaseCallback *callback, const nsAString& path, const nsACString& name, nsIKeyValueService::RecoveryStrategy recoveryStrategy) = 0;
/* nsIKeyValueImporter createImporter (in AUTF8String type, in AString path); */
NS_IMETHOD CreateImporter(const nsACString& type, const nsAString& path, nsIKeyValueImporter **_retval) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIKeyValueService, NS_IKEYVALUESERVICE_IID)namespace mozilla::detail {
template <>
class InterfaceNeedsThreadSafeRefCnt<nsIKeyValueService> : public std::true_type {};
}
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIKEYVALUESERVICE \
NS_IMETHOD GetOrCreate(nsIKeyValueDatabaseCallback *callback, const nsAString& path, const nsACString& name) override; \
NS_IMETHOD GetOrCreateWithOptions(nsIKeyValueDatabaseCallback *callback, const nsAString& path, const nsACString& name, nsIKeyValueService::RecoveryStrategy recoveryStrategy) override; \
NS_IMETHOD CreateImporter(const nsACString& type, const nsAString& path, nsIKeyValueImporter **_retval) override;
/* Use this macro when declaring the members of this interface when the
class doesn't implement the interface. This is useful for forwarding. */
#define NS_DECL_NON_VIRTUAL_NSIKEYVALUESERVICE \
nsresult GetOrCreate(nsIKeyValueDatabaseCallback *callback, const nsAString& path, const nsACString& name); \
nsresult GetOrCreateWithOptions(nsIKeyValueDatabaseCallback *callback, const nsAString& path, const nsACString& name, nsIKeyValueService::RecoveryStrategy recoveryStrategy); \
nsresult CreateImporter(const nsACString& type, const nsAString& path, nsIKeyValueImporter **_retval);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIKEYVALUESERVICE(_to) \
NS_IMETHOD GetOrCreate(nsIKeyValueDatabaseCallback *callback, const nsAString& path, const nsACString& name) override { return _to GetOrCreate(callback, path, name); } \
NS_IMETHOD GetOrCreateWithOptions(nsIKeyValueDatabaseCallback *callback, const nsAString& path, const nsACString& name, nsIKeyValueService::RecoveryStrategy recoveryStrategy) override { return _to GetOrCreateWithOptions(callback, path, name, recoveryStrategy); } \
NS_IMETHOD CreateImporter(const nsACString& type, const nsAString& path, nsIKeyValueImporter **_retval) override { return _to CreateImporter(type, path, _retval); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIKEYVALUESERVICE(_to) \
NS_IMETHOD GetOrCreate(nsIKeyValueDatabaseCallback *callback, const nsAString& path, const nsACString& name) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetOrCreate(callback, path, name); } \
NS_IMETHOD GetOrCreateWithOptions(nsIKeyValueDatabaseCallback *callback, const nsAString& path, const nsACString& name, nsIKeyValueService::RecoveryStrategy recoveryStrategy) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetOrCreateWithOptions(callback, path, name, recoveryStrategy); } \
NS_IMETHOD CreateImporter(const nsACString& type, const nsAString& path, nsIKeyValueImporter **_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateImporter(type, path, _retval); }
/* starting interface: nsIKeyValueImportSourceSpec */
#define NS_IKEYVALUEIMPORTSOURCESPEC_IID_STR "ed0980f5-64e8-4ca6-af97-b49a766fe016"
#define NS_IKEYVALUEIMPORTSOURCESPEC_IID \
{0xed0980f5, 0x64e8, 0x4ca6, \
{ 0xaf, 0x97, 0xb4, 0x9a, 0x76, 0x6f, 0xe0, 0x16 }}
class NS_NO_VTABLE nsIKeyValueImportSourceSpec : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IKEYVALUEIMPORTSOURCESPEC_IID)
/* Used by ToJSValue to check which scriptable interface is implemented. */
using ScriptableInterfaceType = nsIKeyValueImportSourceSpec;
/* readonly attribute AString path; */
NS_IMETHOD GetPath(nsAString& aPath) = 0;
/* nsIKeyValueDatabaseImportOptions addDatabase (in AUTF8String name); */
NS_IMETHOD AddDatabase(const nsACString& name, nsIKeyValueDatabaseImportOptions **_retval) = 0;
/* nsIKeyValueDatabaseImportOptions addAllDatabases (); */
NS_IMETHOD AddAllDatabases(nsIKeyValueDatabaseImportOptions **_retval) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIKeyValueImportSourceSpec, NS_IKEYVALUEIMPORTSOURCESPEC_IID)namespace mozilla::detail {
template <>
class InterfaceNeedsThreadSafeRefCnt<nsIKeyValueImportSourceSpec> : public std::true_type {};
}
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIKEYVALUEIMPORTSOURCESPEC \
NS_IMETHOD GetPath(nsAString& aPath) override; \
NS_IMETHOD AddDatabase(const nsACString& name, nsIKeyValueDatabaseImportOptions **_retval) override; \
NS_IMETHOD AddAllDatabases(nsIKeyValueDatabaseImportOptions **_retval) override;
/* Use this macro when declaring the members of this interface when the
class doesn't implement the interface. This is useful for forwarding. */
#define NS_DECL_NON_VIRTUAL_NSIKEYVALUEIMPORTSOURCESPEC \
nsresult GetPath(nsAString& aPath); \
nsresult AddDatabase(const nsACString& name, nsIKeyValueDatabaseImportOptions **_retval); \
nsresult AddAllDatabases(nsIKeyValueDatabaseImportOptions **_retval);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIKEYVALUEIMPORTSOURCESPEC(_to) \
NS_IMETHOD GetPath(nsAString& aPath) override { return _to GetPath(aPath); } \
NS_IMETHOD AddDatabase(const nsACString& name, nsIKeyValueDatabaseImportOptions **_retval) override { return _to AddDatabase(name, _retval); } \
NS_IMETHOD AddAllDatabases(nsIKeyValueDatabaseImportOptions **_retval) override { return _to AddAllDatabases(_retval); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIKEYVALUEIMPORTSOURCESPEC(_to) \
NS_IMETHOD GetPath(nsAString& aPath) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPath(aPath); } \
NS_IMETHOD AddDatabase(const nsACString& name, nsIKeyValueDatabaseImportOptions **_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->AddDatabase(name, _retval); } \
NS_IMETHOD AddAllDatabases(nsIKeyValueDatabaseImportOptions **_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->AddAllDatabases(_retval); }
/* starting interface: nsIKeyValueImporter */
#define NS_IKEYVALUEIMPORTER_IID_STR "470d71c0-d601-4867-8c09-810af7ffa67e"
#define NS_IKEYVALUEIMPORTER_IID \
{0x470d71c0, 0xd601, 0x4867, \
{ 0x8c, 0x09, 0x81, 0x0a, 0xf7, 0xff, 0xa6, 0x7e }}
class NS_NO_VTABLE nsIKeyValueImporter : public nsIKeyValueImportSourceSpec {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IKEYVALUEIMPORTER_IID)
/* Used by ToJSValue to check which scriptable interface is implemented. */
using ScriptableInterfaceType = nsIKeyValueImporter;
enum ConflictPolicy : uint8_t {
ERROR_ON_CONFLICT = 0,
IGNORE_ON_CONFLICT = 1,
REPLACE_ON_CONFLICT = 2,
};
enum CleanupPolicy : uint8_t {
KEEP_AFTER_IMPORT = 0,
DELETE_AFTER_IMPORT = 1,
};
/* readonly attribute AUTF8String type; */
NS_IMETHOD GetType(nsACString& aType) = 0;
/* nsIKeyValueImportSourceSpec addPath (in AString path); */
NS_IMETHOD AddPath(const nsAString& path, nsIKeyValueImportSourceSpec **_retval) = 0;
/* void import (in nsIKeyValueVoidCallback callback); */
NS_IMETHOD Import(nsIKeyValueVoidCallback *callback) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIKeyValueImporter, NS_IKEYVALUEIMPORTER_IID)namespace mozilla::detail {
template <>
class InterfaceNeedsThreadSafeRefCnt<nsIKeyValueImporter> : public std::true_type {};
}
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIKEYVALUEIMPORTER \
NS_IMETHOD GetType(nsACString& aType) override; \
NS_IMETHOD AddPath(const nsAString& path, nsIKeyValueImportSourceSpec **_retval) override; \
NS_IMETHOD Import(nsIKeyValueVoidCallback *callback) override;
/* Use this macro when declaring the members of this interface when the
class doesn't implement the interface. This is useful for forwarding. */
#define NS_DECL_NON_VIRTUAL_NSIKEYVALUEIMPORTER \
nsresult GetType(nsACString& aType); \
nsresult AddPath(const nsAString& path, nsIKeyValueImportSourceSpec **_retval); \
nsresult Import(nsIKeyValueVoidCallback *callback);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIKEYVALUEIMPORTER(_to) \
NS_IMETHOD GetType(nsACString& aType) override { return _to GetType(aType); } \
NS_IMETHOD AddPath(const nsAString& path, nsIKeyValueImportSourceSpec **_retval) override { return _to AddPath(path, _retval); } \
NS_IMETHOD Import(nsIKeyValueVoidCallback *callback) override { return _to Import(callback); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIKEYVALUEIMPORTER(_to) \
NS_IMETHOD GetType(nsACString& aType) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetType(aType); } \
NS_IMETHOD AddPath(const nsAString& path, nsIKeyValueImportSourceSpec **_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->AddPath(path, _retval); } \
NS_IMETHOD Import(nsIKeyValueVoidCallback *callback) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Import(callback); }
/* starting interface: nsIKeyValueDatabaseImportOptions */
#define NS_IKEYVALUEDATABASEIMPORTOPTIONS_IID_STR "8e983362-fb16-4811-b1fe-8f9921932fd5"
#define NS_IKEYVALUEDATABASEIMPORTOPTIONS_IID \
{0x8e983362, 0xfb16, 0x4811, \
{ 0xb1, 0xfe, 0x8f, 0x99, 0x21, 0x93, 0x2f, 0xd5 }}
class NS_NO_VTABLE nsIKeyValueDatabaseImportOptions : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IKEYVALUEDATABASEIMPORTOPTIONS_IID)
/* Used by ToJSValue to check which scriptable interface is implemented. */
using ScriptableInterfaceType = nsIKeyValueDatabaseImportOptions;
/* nsIKeyValueDatabaseImportOptions setConflictPolicy (in nsIKeyValueImporter_ConflictPolicy conflictPolicy); */
NS_IMETHOD SetConflictPolicy(nsIKeyValueImporter::ConflictPolicy conflictPolicy, nsIKeyValueDatabaseImportOptions **_retval) = 0;
/* nsIKeyValueDatabaseImportOptions setCleanupPolicy (in nsIKeyValueImporter_CleanupPolicy cleanupPolicy); */
NS_IMETHOD SetCleanupPolicy(nsIKeyValueImporter::CleanupPolicy cleanupPolicy, nsIKeyValueDatabaseImportOptions **_retval) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIKeyValueDatabaseImportOptions, NS_IKEYVALUEDATABASEIMPORTOPTIONS_IID)namespace mozilla::detail {
template <>
class InterfaceNeedsThreadSafeRefCnt<nsIKeyValueDatabaseImportOptions> : public std::true_type {};
}
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIKEYVALUEDATABASEIMPORTOPTIONS \
NS_IMETHOD SetConflictPolicy(nsIKeyValueImporter::ConflictPolicy conflictPolicy, nsIKeyValueDatabaseImportOptions **_retval) override; \
NS_IMETHOD SetCleanupPolicy(nsIKeyValueImporter::CleanupPolicy cleanupPolicy, nsIKeyValueDatabaseImportOptions **_retval) override;
/* Use this macro when declaring the members of this interface when the
class doesn't implement the interface. This is useful for forwarding. */
#define NS_DECL_NON_VIRTUAL_NSIKEYVALUEDATABASEIMPORTOPTIONS \
nsresult SetConflictPolicy(nsIKeyValueImporter::ConflictPolicy conflictPolicy, nsIKeyValueDatabaseImportOptions **_retval); \
nsresult SetCleanupPolicy(nsIKeyValueImporter::CleanupPolicy cleanupPolicy, nsIKeyValueDatabaseImportOptions **_retval);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIKEYVALUEDATABASEIMPORTOPTIONS(_to) \
NS_IMETHOD SetConflictPolicy(nsIKeyValueImporter::ConflictPolicy conflictPolicy, nsIKeyValueDatabaseImportOptions **_retval) override { return _to SetConflictPolicy(conflictPolicy, _retval); } \
NS_IMETHOD SetCleanupPolicy(nsIKeyValueImporter::CleanupPolicy cleanupPolicy, nsIKeyValueDatabaseImportOptions **_retval) override { return _to SetCleanupPolicy(cleanupPolicy, _retval); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIKEYVALUEDATABASEIMPORTOPTIONS(_to) \
NS_IMETHOD SetConflictPolicy(nsIKeyValueImporter::ConflictPolicy conflictPolicy, nsIKeyValueDatabaseImportOptions **_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetConflictPolicy(conflictPolicy, _retval); } \
NS_IMETHOD SetCleanupPolicy(nsIKeyValueImporter::CleanupPolicy cleanupPolicy, nsIKeyValueDatabaseImportOptions **_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetCleanupPolicy(cleanupPolicy, _retval); }
/* starting interface: nsIKeyValueDatabase */
#define NS_IKEYVALUEDATABASE_IID_STR "c449398e-174c-425b-8195-da6aa0ccd9a5"
#define NS_IKEYVALUEDATABASE_IID \
{0xc449398e, 0x174c, 0x425b, \
{ 0x81, 0x95, 0xda, 0x6a, 0xa0, 0xcc, 0xd9, 0xa5 }}
class NS_NO_VTABLE nsIKeyValueDatabase : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IKEYVALUEDATABASE_IID)
/* Used by ToJSValue to check which scriptable interface is implemented. */
using ScriptableInterfaceType = nsIKeyValueDatabase;
/* void isEmpty (in nsIKeyValueVariantCallback callback); */
NS_IMETHOD IsEmpty(nsIKeyValueVariantCallback *callback) = 0;
/* void count (in nsIKeyValueVariantCallback callback); */
NS_IMETHOD Count(nsIKeyValueVariantCallback *callback) = 0;
/* void size (in nsIKeyValueVariantCallback callback); */
NS_IMETHOD Size(nsIKeyValueVariantCallback *callback) = 0;
/* void put (in nsIKeyValueVoidCallback callback, in AUTF8String key, in nsIVariant value); */
NS_IMETHOD Put(nsIKeyValueVoidCallback *callback, const nsACString& key, nsIVariant *value) = 0;
/* void writeMany (in nsIKeyValueVoidCallback callback, in Array<nsIKeyValuePair> pairs); */
NS_IMETHOD WriteMany(nsIKeyValueVoidCallback *callback, const nsTArray<RefPtr<nsIKeyValuePair>>& pairs) = 0;
/* void get (in nsIKeyValueVariantCallback callback, in AUTF8String key, [optional] in nsIVariant defaultValue); */
NS_IMETHOD Get(nsIKeyValueVariantCallback *callback, const nsACString& key, nsIVariant *defaultValue) = 0;
/* void has (in nsIKeyValueVariantCallback callback, in AUTF8String key); */
NS_IMETHOD Has(nsIKeyValueVariantCallback *callback, const nsACString& key) = 0;
/* void delete (in nsIKeyValueVoidCallback callback, in AUTF8String key); */
NS_IMETHOD Delete(nsIKeyValueVoidCallback *callback, const nsACString& key) = 0;
/* void deleteRange (in nsIKeyValueVoidCallback callback, [optional] in AUTF8String fromKey, [optional] in AUTF8String toKey); */
NS_IMETHOD DeleteRange(nsIKeyValueVoidCallback *callback, const nsACString& fromKey, const nsACString& toKey) = 0;
/* void clear (in nsIKeyValueVoidCallback callback); */
NS_IMETHOD Clear(nsIKeyValueVoidCallback *callback) = 0;
/* void enumerate (in nsIKeyValueEnumeratorCallback callback, [optional] in AUTF8String fromKey, [optional] in AUTF8String toKey); */
NS_IMETHOD Enumerate(nsIKeyValueEnumeratorCallback *callback, const nsACString& fromKey, const nsACString& toKey) = 0;
/* void close (in nsIKeyValueVoidCallback callback); */
NS_IMETHOD Close(nsIKeyValueVoidCallback *callback) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIKeyValueDatabase, NS_IKEYVALUEDATABASE_IID)namespace mozilla::detail {
template <>
class InterfaceNeedsThreadSafeRefCnt<nsIKeyValueDatabase> : public std::true_type {};
}
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIKEYVALUEDATABASE \
NS_IMETHOD IsEmpty(nsIKeyValueVariantCallback *callback) override; \
NS_IMETHOD Count(nsIKeyValueVariantCallback *callback) override; \
NS_IMETHOD Size(nsIKeyValueVariantCallback *callback) override; \
NS_IMETHOD Put(nsIKeyValueVoidCallback *callback, const nsACString& key, nsIVariant *value) override; \
NS_IMETHOD WriteMany(nsIKeyValueVoidCallback *callback, const nsTArray<RefPtr<nsIKeyValuePair>>& pairs) override; \
NS_IMETHOD Get(nsIKeyValueVariantCallback *callback, const nsACString& key, nsIVariant *defaultValue) override; \
NS_IMETHOD Has(nsIKeyValueVariantCallback *callback, const nsACString& key) override; \
NS_IMETHOD Delete(nsIKeyValueVoidCallback *callback, const nsACString& key) override; \
NS_IMETHOD DeleteRange(nsIKeyValueVoidCallback *callback, const nsACString& fromKey, const nsACString& toKey) override; \
NS_IMETHOD Clear(nsIKeyValueVoidCallback *callback) override; \
NS_IMETHOD Enumerate(nsIKeyValueEnumeratorCallback *callback, const nsACString& fromKey, const nsACString& toKey) override; \
NS_IMETHOD Close(nsIKeyValueVoidCallback *callback) override;
/* Use this macro when declaring the members of this interface when the
class doesn't implement the interface. This is useful for forwarding. */
#define NS_DECL_NON_VIRTUAL_NSIKEYVALUEDATABASE \
nsresult IsEmpty(nsIKeyValueVariantCallback *callback); \
nsresult Count(nsIKeyValueVariantCallback *callback); \
nsresult Size(nsIKeyValueVariantCallback *callback); \
nsresult Put(nsIKeyValueVoidCallback *callback, const nsACString& key, nsIVariant *value); \
nsresult WriteMany(nsIKeyValueVoidCallback *callback, const nsTArray<RefPtr<nsIKeyValuePair>>& pairs); \
nsresult Get(nsIKeyValueVariantCallback *callback, const nsACString& key, nsIVariant *defaultValue); \
nsresult Has(nsIKeyValueVariantCallback *callback, const nsACString& key); \
nsresult Delete(nsIKeyValueVoidCallback *callback, const nsACString& key); \
nsresult DeleteRange(nsIKeyValueVoidCallback *callback, const nsACString& fromKey, const nsACString& toKey); \
nsresult Clear(nsIKeyValueVoidCallback *callback); \
nsresult Enumerate(nsIKeyValueEnumeratorCallback *callback, const nsACString& fromKey, const nsACString& toKey); \
nsresult Close(nsIKeyValueVoidCallback *callback);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIKEYVALUEDATABASE(_to) \
NS_IMETHOD IsEmpty(nsIKeyValueVariantCallback *callback) override { return _to IsEmpty(callback); } \
NS_IMETHOD Count(nsIKeyValueVariantCallback *callback) override { return _to Count(callback); } \
NS_IMETHOD Size(nsIKeyValueVariantCallback *callback) override { return _to Size(callback); } \
NS_IMETHOD Put(nsIKeyValueVoidCallback *callback, const nsACString& key, nsIVariant *value) override { return _to Put(callback, key, value); } \
NS_IMETHOD WriteMany(nsIKeyValueVoidCallback *callback, const nsTArray<RefPtr<nsIKeyValuePair>>& pairs) override { return _to WriteMany(callback, pairs); } \
NS_IMETHOD Get(nsIKeyValueVariantCallback *callback, const nsACString& key, nsIVariant *defaultValue) override { return _to Get(callback, key, defaultValue); } \
NS_IMETHOD Has(nsIKeyValueVariantCallback *callback, const nsACString& key) override { return _to Has(callback, key); } \
NS_IMETHOD Delete(nsIKeyValueVoidCallback *callback, const nsACString& key) override { return _to Delete(callback, key); } \
NS_IMETHOD DeleteRange(nsIKeyValueVoidCallback *callback, const nsACString& fromKey, const nsACString& toKey) override { return _to DeleteRange(callback, fromKey, toKey); } \
NS_IMETHOD Clear(nsIKeyValueVoidCallback *callback) override { return _to Clear(callback); } \
NS_IMETHOD Enumerate(nsIKeyValueEnumeratorCallback *callback, const nsACString& fromKey, const nsACString& toKey) override { return _to Enumerate(callback, fromKey, toKey); } \
NS_IMETHOD Close(nsIKeyValueVoidCallback *callback) override { return _to Close(callback); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIKEYVALUEDATABASE(_to) \
NS_IMETHOD IsEmpty(nsIKeyValueVariantCallback *callback) override { return !_to ? NS_ERROR_NULL_POINTER : _to->IsEmpty(callback); } \
NS_IMETHOD Count(nsIKeyValueVariantCallback *callback) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Count(callback); } \
NS_IMETHOD Size(nsIKeyValueVariantCallback *callback) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Size(callback); } \
NS_IMETHOD Put(nsIKeyValueVoidCallback *callback, const nsACString& key, nsIVariant *value) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Put(callback, key, value); } \
NS_IMETHOD WriteMany(nsIKeyValueVoidCallback *callback, const nsTArray<RefPtr<nsIKeyValuePair>>& pairs) override { return !_to ? NS_ERROR_NULL_POINTER : _to->WriteMany(callback, pairs); } \
NS_IMETHOD Get(nsIKeyValueVariantCallback *callback, const nsACString& key, nsIVariant *defaultValue) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Get(callback, key, defaultValue); } \
NS_IMETHOD Has(nsIKeyValueVariantCallback *callback, const nsACString& key) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Has(callback, key); } \
NS_IMETHOD Delete(nsIKeyValueVoidCallback *callback, const nsACString& key) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Delete(callback, key); } \
NS_IMETHOD DeleteRange(nsIKeyValueVoidCallback *callback, const nsACString& fromKey, const nsACString& toKey) override { return !_to ? NS_ERROR_NULL_POINTER : _to->DeleteRange(callback, fromKey, toKey); } \
NS_IMETHOD Clear(nsIKeyValueVoidCallback *callback) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Clear(callback); } \
NS_IMETHOD Enumerate(nsIKeyValueEnumeratorCallback *callback, const nsACString& fromKey, const nsACString& toKey) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Enumerate(callback, fromKey, toKey); } \
NS_IMETHOD Close(nsIKeyValueVoidCallback *callback) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Close(callback); }
/* starting interface: nsIKeyValuePair */
#define NS_IKEYVALUEPAIR_IID_STR "bc37b06a-23b5-4b32-8281-4b8479601c7e"
#define NS_IKEYVALUEPAIR_IID \
{0xbc37b06a, 0x23b5, 0x4b32, \
{ 0x82, 0x81, 0x4b, 0x84, 0x79, 0x60, 0x1c, 0x7e }}
class NS_NO_VTABLE nsIKeyValuePair : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IKEYVALUEPAIR_IID)
/* Used by ToJSValue to check which scriptable interface is implemented. */
using ScriptableInterfaceType = nsIKeyValuePair;
/* readonly attribute AUTF8String key; */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetKey(nsACString& aKey) = 0;
/* readonly attribute nsIVariant value; */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetValue(nsIVariant **aValue) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIKeyValuePair, NS_IKEYVALUEPAIR_IID)
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIKEYVALUEPAIR \
NS_IMETHOD GetKey(nsACString& aKey) override; \
NS_IMETHOD GetValue(nsIVariant **aValue) override;
/* Use this macro when declaring the members of this interface when the
class doesn't implement the interface. This is useful for forwarding. */
#define NS_DECL_NON_VIRTUAL_NSIKEYVALUEPAIR \
nsresult GetKey(nsACString& aKey); \
nsresult GetValue(nsIVariant **aValue);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIKEYVALUEPAIR(_to) \
NS_IMETHOD GetKey(nsACString& aKey) override { return _to GetKey(aKey); } \
NS_IMETHOD GetValue(nsIVariant **aValue) override { return _to GetValue(aValue); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIKEYVALUEPAIR(_to) \
NS_IMETHOD GetKey(nsACString& aKey) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetKey(aKey); } \
NS_IMETHOD GetValue(nsIVariant **aValue) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetValue(aValue); }
/* starting interface: nsIKeyValueEnumerator */
#define NS_IKEYVALUEENUMERATOR_IID_STR "b9ba7116-b7ff-4717-9a28-a08e6879b199"
#define NS_IKEYVALUEENUMERATOR_IID \
{0xb9ba7116, 0xb7ff, 0x4717, \
{ 0x9a, 0x28, 0xa0, 0x8e, 0x68, 0x79, 0xb1, 0x99 }}
class NS_NO_VTABLE nsIKeyValueEnumerator : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IKEYVALUEENUMERATOR_IID)
/* Used by ToJSValue to check which scriptable interface is implemented. */
using ScriptableInterfaceType = nsIKeyValueEnumerator;
/* boolean hasMoreElements (); */
NS_IMETHOD HasMoreElements(bool *_retval) = 0;
/* nsIKeyValuePair getNext (); */
NS_IMETHOD GetNext(nsIKeyValuePair **_retval) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIKeyValueEnumerator, NS_IKEYVALUEENUMERATOR_IID)namespace mozilla::detail {
template <>
class InterfaceNeedsThreadSafeRefCnt<nsIKeyValueEnumerator> : public std::true_type {};
}
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIKEYVALUEENUMERATOR \
NS_IMETHOD HasMoreElements(bool *_retval) override; \
NS_IMETHOD GetNext(nsIKeyValuePair **_retval) override;
/* Use this macro when declaring the members of this interface when the
class doesn't implement the interface. This is useful for forwarding. */
#define NS_DECL_NON_VIRTUAL_NSIKEYVALUEENUMERATOR \
nsresult HasMoreElements(bool *_retval); \
nsresult GetNext(nsIKeyValuePair **_retval);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIKEYVALUEENUMERATOR(_to) \
NS_IMETHOD HasMoreElements(bool *_retval) override { return _to HasMoreElements(_retval); } \
NS_IMETHOD GetNext(nsIKeyValuePair **_retval) override { return _to GetNext(_retval); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIKEYVALUEENUMERATOR(_to) \
NS_IMETHOD HasMoreElements(bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->HasMoreElements(_retval); } \
NS_IMETHOD GetNext(nsIKeyValuePair **_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetNext(_retval); }
/* starting interface: nsIKeyValueDatabaseCallback */
#define NS_IKEYVALUEDATABASECALLBACK_IID_STR "2becc1f8-2d80-4b63-92a8-24ee8f79ee45"
#define NS_IKEYVALUEDATABASECALLBACK_IID \
{0x2becc1f8, 0x2d80, 0x4b63, \
{ 0x92, 0xa8, 0x24, 0xee, 0x8f, 0x79, 0xee, 0x45 }}
class NS_NO_VTABLE nsIKeyValueDatabaseCallback : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IKEYVALUEDATABASECALLBACK_IID)
/* Used by ToJSValue to check which scriptable interface is implemented. */
using ScriptableInterfaceType = nsIKeyValueDatabaseCallback;
/* void resolve (in nsIKeyValueDatabase database); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Resolve(nsIKeyValueDatabase *database) = 0;
/* void reject (in AUTF8String message); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Reject(const nsACString& message) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIKeyValueDatabaseCallback, NS_IKEYVALUEDATABASECALLBACK_IID)
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIKEYVALUEDATABASECALLBACK \
NS_IMETHOD Resolve(nsIKeyValueDatabase *database) override; \
NS_IMETHOD Reject(const nsACString& message) override;
/* Use this macro when declaring the members of this interface when the
class doesn't implement the interface. This is useful for forwarding. */
#define NS_DECL_NON_VIRTUAL_NSIKEYVALUEDATABASECALLBACK \
nsresult Resolve(nsIKeyValueDatabase *database); \
nsresult Reject(const nsACString& message);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIKEYVALUEDATABASECALLBACK(_to) \
NS_IMETHOD Resolve(nsIKeyValueDatabase *database) override { return _to Resolve(database); } \
NS_IMETHOD Reject(const nsACString& message) override { return _to Reject(message); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIKEYVALUEDATABASECALLBACK(_to) \
NS_IMETHOD Resolve(nsIKeyValueDatabase *database) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Resolve(database); } \
NS_IMETHOD Reject(const nsACString& message) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Reject(message); }
/* starting interface: nsIKeyValueEnumeratorCallback */
#define NS_IKEYVALUEENUMERATORCALLBACK_IID_STR "b7ea2183-880b-4424-ab24-5aa1555b775d"
#define NS_IKEYVALUEENUMERATORCALLBACK_IID \
{0xb7ea2183, 0x880b, 0x4424, \
{ 0xab, 0x24, 0x5a, 0xa1, 0x55, 0x5b, 0x77, 0x5d }}
class NS_NO_VTABLE nsIKeyValueEnumeratorCallback : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IKEYVALUEENUMERATORCALLBACK_IID)
/* Used by ToJSValue to check which scriptable interface is implemented. */
using ScriptableInterfaceType = nsIKeyValueEnumeratorCallback;
/* void resolve (in nsIKeyValueEnumerator enumerator); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Resolve(nsIKeyValueEnumerator *enumerator) = 0;
/* void reject (in AUTF8String message); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Reject(const nsACString& message) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIKeyValueEnumeratorCallback, NS_IKEYVALUEENUMERATORCALLBACK_IID)
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIKEYVALUEENUMERATORCALLBACK \
NS_IMETHOD Resolve(nsIKeyValueEnumerator *enumerator) override; \
NS_IMETHOD Reject(const nsACString& message) override;
/* Use this macro when declaring the members of this interface when the
class doesn't implement the interface. This is useful for forwarding. */
#define NS_DECL_NON_VIRTUAL_NSIKEYVALUEENUMERATORCALLBACK \
nsresult Resolve(nsIKeyValueEnumerator *enumerator); \
nsresult Reject(const nsACString& message);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIKEYVALUEENUMERATORCALLBACK(_to) \
NS_IMETHOD Resolve(nsIKeyValueEnumerator *enumerator) override { return _to Resolve(enumerator); } \
NS_IMETHOD Reject(const nsACString& message) override { return _to Reject(message); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIKEYVALUEENUMERATORCALLBACK(_to) \
NS_IMETHOD Resolve(nsIKeyValueEnumerator *enumerator) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Resolve(enumerator); } \
NS_IMETHOD Reject(const nsACString& message) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Reject(message); }
/* starting interface: nsIKeyValuePairCallback */
#define NS_IKEYVALUEPAIRCALLBACK_IID_STR "50f65485-ec1e-4307-812b-b8a15e1f382e"
#define NS_IKEYVALUEPAIRCALLBACK_IID \
{0x50f65485, 0xec1e, 0x4307, \
{ 0x81, 0x2b, 0xb8, 0xa1, 0x5e, 0x1f, 0x38, 0x2e }}
class NS_NO_VTABLE nsIKeyValuePairCallback : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IKEYVALUEPAIRCALLBACK_IID)
/* Used by ToJSValue to check which scriptable interface is implemented. */
using ScriptableInterfaceType = nsIKeyValuePairCallback;
/* void resolve (in nsIKeyValuePair pair); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Resolve(nsIKeyValuePair *pair) = 0;
/* void reject (in AUTF8String message); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Reject(const nsACString& message) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIKeyValuePairCallback, NS_IKEYVALUEPAIRCALLBACK_IID)
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIKEYVALUEPAIRCALLBACK \
NS_IMETHOD Resolve(nsIKeyValuePair *pair) override; \
NS_IMETHOD Reject(const nsACString& message) override;
/* Use this macro when declaring the members of this interface when the
class doesn't implement the interface. This is useful for forwarding. */
#define NS_DECL_NON_VIRTUAL_NSIKEYVALUEPAIRCALLBACK \
nsresult Resolve(nsIKeyValuePair *pair); \
nsresult Reject(const nsACString& message);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIKEYVALUEPAIRCALLBACK(_to) \
NS_IMETHOD Resolve(nsIKeyValuePair *pair) override { return _to Resolve(pair); } \
NS_IMETHOD Reject(const nsACString& message) override { return _to Reject(message); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIKEYVALUEPAIRCALLBACK(_to) \
NS_IMETHOD Resolve(nsIKeyValuePair *pair) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Resolve(pair); } \
NS_IMETHOD Reject(const nsACString& message) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Reject(message); }
/* starting interface: nsIKeyValueVariantCallback */
#define NS_IKEYVALUEVARIANTCALLBACK_IID_STR "174ebfa1-74ea-42a7-aa90-85bbaf1da4bf"
#define NS_IKEYVALUEVARIANTCALLBACK_IID \
{0x174ebfa1, 0x74ea, 0x42a7, \
{ 0xaa, 0x90, 0x85, 0xbb, 0xaf, 0x1d, 0xa4, 0xbf }}
class NS_NO_VTABLE nsIKeyValueVariantCallback : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IKEYVALUEVARIANTCALLBACK_IID)
/* Used by ToJSValue to check which scriptable interface is implemented. */
using ScriptableInterfaceType = nsIKeyValueVariantCallback;
/* void resolve (in nsIVariant result); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Resolve(nsIVariant *result) = 0;
/* void reject (in AUTF8String message); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Reject(const nsACString& message) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIKeyValueVariantCallback, NS_IKEYVALUEVARIANTCALLBACK_IID)
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIKEYVALUEVARIANTCALLBACK \
NS_IMETHOD Resolve(nsIVariant *result) override; \
NS_IMETHOD Reject(const nsACString& message) override;
/* Use this macro when declaring the members of this interface when the
class doesn't implement the interface. This is useful for forwarding. */
#define NS_DECL_NON_VIRTUAL_NSIKEYVALUEVARIANTCALLBACK \
nsresult Resolve(nsIVariant *result); \
nsresult Reject(const nsACString& message);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIKEYVALUEVARIANTCALLBACK(_to) \
NS_IMETHOD Resolve(nsIVariant *result) override { return _to Resolve(result); } \
NS_IMETHOD Reject(const nsACString& message) override { return _to Reject(message); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIKEYVALUEVARIANTCALLBACK(_to) \
NS_IMETHOD Resolve(nsIVariant *result) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Resolve(result); } \
NS_IMETHOD Reject(const nsACString& message) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Reject(message); }
/* starting interface: nsIKeyValueVoidCallback */
#define NS_IKEYVALUEVOIDCALLBACK_IID_STR "0c17497a-ccf8-451a-838d-9dfa7f846379"
#define NS_IKEYVALUEVOIDCALLBACK_IID \
{0x0c17497a, 0xccf8, 0x451a, \
{ 0x83, 0x8d, 0x9d, 0xfa, 0x7f, 0x84, 0x63, 0x79 }}
class NS_NO_VTABLE nsIKeyValueVoidCallback : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IKEYVALUEVOIDCALLBACK_IID)
/* Used by ToJSValue to check which scriptable interface is implemented. */
using ScriptableInterfaceType = nsIKeyValueVoidCallback;
/* void resolve (); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Resolve(void) = 0;
/* void reject (in AUTF8String message); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Reject(const nsACString& message) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIKeyValueVoidCallback, NS_IKEYVALUEVOIDCALLBACK_IID)
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIKEYVALUEVOIDCALLBACK \
NS_IMETHOD Resolve(void) override; \
NS_IMETHOD Reject(const nsACString& message) override;
/* Use this macro when declaring the members of this interface when the
class doesn't implement the interface. This is useful for forwarding. */
#define NS_DECL_NON_VIRTUAL_NSIKEYVALUEVOIDCALLBACK \
nsresult Resolve(void); \
nsresult Reject(const nsACString& message);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIKEYVALUEVOIDCALLBACK(_to) \
NS_IMETHOD Resolve(void) override { return _to Resolve(); } \
NS_IMETHOD Reject(const nsACString& message) override { return _to Reject(message); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIKEYVALUEVOIDCALLBACK(_to) \
NS_IMETHOD Resolve(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Resolve(); } \
NS_IMETHOD Reject(const nsACString& message) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Reject(message); }
#endif /* __gen_nsIKeyValue_h__ */