/* * DO NOT EDIT. THIS FILE IS GENERATED FROM $SRCDIR/modules/libpref/nsIPrefService.idl */ #ifndef __gen_nsIPrefService_h__ #define __gen_nsIPrefService_h__ #include "nsISupports.h" #include "nsIPrefBranch.h" #include "nsTArray.h" #include "js/Value.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 nsIFile; /* forward declaration */ class nsIPrefOverrideMap; /* forward declaration */ /* starting interface: nsIPrefStatsCallback */ #define NS_IPREFSTATSCALLBACK_IID_STR "c3f0cedc-e244-4316-b33a-80306a1c35a1" #define NS_IPREFSTATSCALLBACK_IID \ {0xc3f0cedc, 0xe244, 0x4316, \ { 0xb3, 0x3a, 0x80, 0x30, 0x6a, 0x1c, 0x35, 0xa1 }} class NS_NO_VTABLE MOZ_BINDING(binding_to, idl, class, XPIDL_nsIPrefStatsCallback) nsIPrefStatsCallback : public nsISupports { public: NS_INLINE_DECL_STATIC_IID(NS_IPREFSTATSCALLBACK_IID) /* Used by ToJSValue to check which scriptable interface is implemented. */ using ScriptableInterfaceType = nsIPrefStatsCallback; /* void visit (in ACString prefName, in unsigned long accessCount); */ MOZ_BINDING(binding_to, idl, method, XPIDL_nsIPrefStatsCallback_visit) JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Visit(const nsACString& prefName, uint32_t accessCount) = 0; }; /* Use this macro when declaring classes that implement this interface. */ #define NS_DECL_NSIPREFSTATSCALLBACK \ NS_IMETHOD Visit(const nsACString& prefName, uint32_t accessCount) 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_NSIPREFSTATSCALLBACK \ MOZ_BINDING(binding_to, idl, method, XPIDL_nsIPrefStatsCallback_visit)\ nsresult Visit(const nsACString& prefName, uint32_t accessCount); /* Use this macro to declare functions that forward the behavior of this interface to another object. */ #define NS_FORWARD_NSIPREFSTATSCALLBACK(_to) \ NS_IMETHOD Visit(const nsACString& prefName, uint32_t accessCount) override { return _to Visit(prefName, accessCount); } /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ #define NS_FORWARD_SAFE_NSIPREFSTATSCALLBACK(_to) \ NS_IMETHOD Visit(const nsACString& prefName, uint32_t accessCount) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Visit(prefName, accessCount); } /* starting interface: nsIPrefObserver */ #define NS_IPREFOBSERVER_IID_STR "0a2dbc02-2218-4687-b151-33d890676e00" #define NS_IPREFOBSERVER_IID \ {0x0a2dbc02, 0x2218, 0x4687, \ { 0xb1, 0x51, 0x33, 0xd8, 0x90, 0x67, 0x6e, 0x00 }} class NS_NO_VTABLE MOZ_BINDING(binding_to, idl, class, XPIDL_nsIPrefObserver) nsIPrefObserver : public nsISupports { public: NS_INLINE_DECL_STATIC_IID(NS_IPREFOBSERVER_IID) /* Used by ToJSValue to check which scriptable interface is implemented. */ using ScriptableInterfaceType = nsIPrefObserver; /* void onStringPref (in string kind, in string name, in string value, in boolean isSticky, in boolean isLocked); */ MOZ_BINDING(binding_to, idl, method, XPIDL_nsIPrefObserver_onStringPref) JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD OnStringPref(const char * kind, const char * name, const char * value, bool isSticky, bool isLocked) = 0; /* void onIntPref (in string kind, in string name, in long value, in boolean isSticky, in boolean isLocked); */ MOZ_BINDING(binding_to, idl, method, XPIDL_nsIPrefObserver_onIntPref) JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD OnIntPref(const char * kind, const char * name, int32_t value, bool isSticky, bool isLocked) = 0; /* void onBoolPref (in string kind, in string name, in boolean value, in boolean isSticky, in boolean isLocked); */ MOZ_BINDING(binding_to, idl, method, XPIDL_nsIPrefObserver_onBoolPref) JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD OnBoolPref(const char * kind, const char * name, bool value, bool isSticky, bool isLocked) = 0; /* void onError (in string message); */ MOZ_BINDING(binding_to, idl, method, XPIDL_nsIPrefObserver_onError) JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD OnError(const char * message) = 0; }; /* Use this macro when declaring classes that implement this interface. */ #define NS_DECL_NSIPREFOBSERVER \ NS_IMETHOD OnStringPref(const char * kind, const char * name, const char * value, bool isSticky, bool isLocked) override; \ NS_IMETHOD OnIntPref(const char * kind, const char * name, int32_t value, bool isSticky, bool isLocked) override; \ NS_IMETHOD OnBoolPref(const char * kind, const char * name, bool value, bool isSticky, bool isLocked) override; \ NS_IMETHOD OnError(const char * 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_NSIPREFOBSERVER \ MOZ_BINDING(binding_to, idl, method, XPIDL_nsIPrefObserver_onStringPref)\ nsresult OnStringPref(const char * kind, const char * name, const char * value, bool isSticky, bool isLocked); \ MOZ_BINDING(binding_to, idl, method, XPIDL_nsIPrefObserver_onIntPref)\ nsresult OnIntPref(const char * kind, const char * name, int32_t value, bool isSticky, bool isLocked); \ MOZ_BINDING(binding_to, idl, method, XPIDL_nsIPrefObserver_onBoolPref)\ nsresult OnBoolPref(const char * kind, const char * name, bool value, bool isSticky, bool isLocked); \ MOZ_BINDING(binding_to, idl, method, XPIDL_nsIPrefObserver_onError)\ nsresult OnError(const char * message); /* Use this macro to declare functions that forward the behavior of this interface to another object. */ #define NS_FORWARD_NSIPREFOBSERVER(_to) \ NS_IMETHOD OnStringPref(const char * kind, const char * name, const char * value, bool isSticky, bool isLocked) override { return _to OnStringPref(kind, name, value, isSticky, isLocked); } \ NS_IMETHOD OnIntPref(const char * kind, const char * name, int32_t value, bool isSticky, bool isLocked) override { return _to OnIntPref(kind, name, value, isSticky, isLocked); } \ NS_IMETHOD OnBoolPref(const char * kind, const char * name, bool value, bool isSticky, bool isLocked) override { return _to OnBoolPref(kind, name, value, isSticky, isLocked); } \ NS_IMETHOD OnError(const char * message) override { return _to OnError(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_NSIPREFOBSERVER(_to) \ NS_IMETHOD OnStringPref(const char * kind, const char * name, const char * value, bool isSticky, bool isLocked) override { return !_to ? NS_ERROR_NULL_POINTER : _to->OnStringPref(kind, name, value, isSticky, isLocked); } \ NS_IMETHOD OnIntPref(const char * kind, const char * name, int32_t value, bool isSticky, bool isLocked) override { return !_to ? NS_ERROR_NULL_POINTER : _to->OnIntPref(kind, name, value, isSticky, isLocked); } \ NS_IMETHOD OnBoolPref(const char * kind, const char * name, bool value, bool isSticky, bool isLocked) override { return !_to ? NS_ERROR_NULL_POINTER : _to->OnBoolPref(kind, name, value, isSticky, isLocked); } \ NS_IMETHOD OnError(const char * message) override { return !_to ? NS_ERROR_NULL_POINTER : _to->OnError(message); } /* starting interface: nsIPrefService */ #define NS_IPREFSERVICE_IID_STR "1f84fd56-3956-40df-b86a-1ea01402ee96" #define NS_IPREFSERVICE_IID \ {0x1f84fd56, 0x3956, 0x40df, \ { 0xb8, 0x6a, 0x1e, 0xa0, 0x14, 0x02, 0xee, 0x96 }} class NS_NO_VTABLE MOZ_BINDING(binding_to, idl, class, XPIDL_nsIPrefService) nsIPrefService : public nsISupports { public: NS_INLINE_DECL_STATIC_IID(NS_IPREFSERVICE_IID) /* Used by ToJSValue to check which scriptable interface is implemented. */ using ScriptableInterfaceType = nsIPrefService; /* void resetPrefs (); */ MOZ_BINDING(binding_to, idl, method, XPIDL_nsIPrefService_resetPrefs) JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD ResetPrefs(void) = 0; /* void savePrefFile (in nsIFile aFile); */ MOZ_BINDING(binding_to, idl, method, XPIDL_nsIPrefService_savePrefFile) JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD SavePrefFile(nsIFile *aFile) = 0; /* [implicit_jscontext] Promise backupPrefFile (in nsIFile aFile, [optional] in nsIPrefOverrideMap aOverrideMap); */ MOZ_BINDING(binding_to, idl, method, XPIDL_nsIPrefService_backupPrefFile) JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD BackupPrefFile(nsIFile *aFile, nsIPrefOverrideMap *aOverrideMap, JSContext* cx, ::mozilla::dom::Promise * * _retval) = 0; /* nsIPrefBranch getBranch (in string aPrefRoot); */ MOZ_BINDING(binding_to, idl, method, XPIDL_nsIPrefService_getBranch) JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetBranch(const char * aPrefRoot, nsIPrefBranch **_retval) = 0; /* nsIPrefBranch getDefaultBranch (in string aPrefRoot); */ MOZ_BINDING(binding_to, idl, method, XPIDL_nsIPrefService_getDefaultBranch) JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetDefaultBranch(const char * aPrefRoot, nsIPrefBranch **_retval) = 0; /* readonly attribute boolean dirty; */ MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIPrefService_dirty) JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetDirty(bool *aDirty) = 0; /* void readDefaultPrefsFromFile (in nsIFile aFile); */ MOZ_BINDING(binding_to, idl, method, XPIDL_nsIPrefService_readDefaultPrefsFromFile) JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD ReadDefaultPrefsFromFile(nsIFile *aFile) = 0; /* void readUserPrefsFromFile (in nsIFile aFile); */ MOZ_BINDING(binding_to, idl, method, XPIDL_nsIPrefService_readUserPrefsFromFile) JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD ReadUserPrefsFromFile(nsIFile *aFile) = 0; /* void readStats (in nsIPrefStatsCallback callback); */ MOZ_BINDING(binding_to, idl, method, XPIDL_nsIPrefService_readStats) JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD ReadStats(nsIPrefStatsCallback *callback) = 0; /* void resetStats (); */ MOZ_BINDING(binding_to, idl, method, XPIDL_nsIPrefService_resetStats) JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD ResetStats(void) = 0; /* void parsePrefsFromBuffer (in Array bytes, in nsIPrefObserver observer, [optional] in string pathLabel); */ MOZ_BINDING(binding_to, idl, method, XPIDL_nsIPrefService_parsePrefsFromBuffer) JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD ParsePrefsFromBuffer(const nsTArray& bytes, nsIPrefObserver *observer, const char * pathLabel) = 0; /* readonly attribute PRTime userPrefsFileLastModifiedAtStartup; */ MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIPrefService_userPrefsFileLastModifiedAtStartup) JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetUserPrefsFileLastModifiedAtStartup(PRTime *aUserPrefsFileLastModifiedAtStartup) = 0; /* readonly attribute ACString prefsJsPreamble; */ MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIPrefService_prefsJsPreamble) JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetPrefsJsPreamble(nsACString& aPrefsJsPreamble) = 0; }; /* Use this macro when declaring classes that implement this interface. */ #define NS_DECL_NSIPREFSERVICE \ NS_IMETHOD ResetPrefs(void) override; \ NS_IMETHOD SavePrefFile(nsIFile *aFile) override; \ NS_IMETHOD BackupPrefFile(nsIFile *aFile, nsIPrefOverrideMap *aOverrideMap, JSContext* cx, ::mozilla::dom::Promise * * _retval) override; \ NS_IMETHOD GetBranch(const char * aPrefRoot, nsIPrefBranch **_retval) override; \ NS_IMETHOD GetDefaultBranch(const char * aPrefRoot, nsIPrefBranch **_retval) override; \ NS_IMETHOD GetDirty(bool *aDirty) override; \ NS_IMETHOD ReadDefaultPrefsFromFile(nsIFile *aFile) override; \ NS_IMETHOD ReadUserPrefsFromFile(nsIFile *aFile) override; \ NS_IMETHOD ReadStats(nsIPrefStatsCallback *callback) override; \ NS_IMETHOD ResetStats(void) override; \ NS_IMETHOD ParsePrefsFromBuffer(const nsTArray& bytes, nsIPrefObserver *observer, const char * pathLabel) override; \ NS_IMETHOD GetUserPrefsFileLastModifiedAtStartup(PRTime *aUserPrefsFileLastModifiedAtStartup) override; \ NS_IMETHOD GetPrefsJsPreamble(nsACString& aPrefsJsPreamble) 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_NSIPREFSERVICE \ MOZ_BINDING(binding_to, idl, method, XPIDL_nsIPrefService_resetPrefs)\ nsresult ResetPrefs(void); \ MOZ_BINDING(binding_to, idl, method, XPIDL_nsIPrefService_savePrefFile)\ nsresult SavePrefFile(nsIFile *aFile); \ MOZ_BINDING(binding_to, idl, method, XPIDL_nsIPrefService_backupPrefFile)\ nsresult BackupPrefFile(nsIFile *aFile, nsIPrefOverrideMap *aOverrideMap, JSContext* cx, ::mozilla::dom::Promise * * _retval); \ MOZ_BINDING(binding_to, idl, method, XPIDL_nsIPrefService_getBranch)\ nsresult GetBranch(const char * aPrefRoot, nsIPrefBranch **_retval); \ MOZ_BINDING(binding_to, idl, method, XPIDL_nsIPrefService_getDefaultBranch)\ nsresult GetDefaultBranch(const char * aPrefRoot, nsIPrefBranch **_retval); \ MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIPrefService_dirty)\ nsresult GetDirty(bool *aDirty); \ MOZ_BINDING(binding_to, idl, method, XPIDL_nsIPrefService_readDefaultPrefsFromFile)\ nsresult ReadDefaultPrefsFromFile(nsIFile *aFile); \ MOZ_BINDING(binding_to, idl, method, XPIDL_nsIPrefService_readUserPrefsFromFile)\ nsresult ReadUserPrefsFromFile(nsIFile *aFile); \ MOZ_BINDING(binding_to, idl, method, XPIDL_nsIPrefService_readStats)\ nsresult ReadStats(nsIPrefStatsCallback *callback); \ MOZ_BINDING(binding_to, idl, method, XPIDL_nsIPrefService_resetStats)\ nsresult ResetStats(void); \ MOZ_BINDING(binding_to, idl, method, XPIDL_nsIPrefService_parsePrefsFromBuffer)\ nsresult ParsePrefsFromBuffer(const nsTArray& bytes, nsIPrefObserver *observer, const char * pathLabel); \ MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIPrefService_userPrefsFileLastModifiedAtStartup)\ nsresult GetUserPrefsFileLastModifiedAtStartup(PRTime *aUserPrefsFileLastModifiedAtStartup); \ MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIPrefService_prefsJsPreamble)\ nsresult GetPrefsJsPreamble(nsACString& aPrefsJsPreamble); /* Use this macro to declare functions that forward the behavior of this interface to another object. */ #define NS_FORWARD_NSIPREFSERVICE(_to) \ NS_IMETHOD ResetPrefs(void) override { return _to ResetPrefs(); } \ NS_IMETHOD SavePrefFile(nsIFile *aFile) override { return _to SavePrefFile(aFile); } \ NS_IMETHOD BackupPrefFile(nsIFile *aFile, nsIPrefOverrideMap *aOverrideMap, JSContext* cx, ::mozilla::dom::Promise * * _retval) override { return _to BackupPrefFile(aFile, aOverrideMap, cx, _retval); } \ NS_IMETHOD GetBranch(const char * aPrefRoot, nsIPrefBranch **_retval) override { return _to GetBranch(aPrefRoot, _retval); } \ NS_IMETHOD GetDefaultBranch(const char * aPrefRoot, nsIPrefBranch **_retval) override { return _to GetDefaultBranch(aPrefRoot, _retval); } \ NS_IMETHOD GetDirty(bool *aDirty) override { return _to GetDirty(aDirty); } \ NS_IMETHOD ReadDefaultPrefsFromFile(nsIFile *aFile) override { return _to ReadDefaultPrefsFromFile(aFile); } \ NS_IMETHOD ReadUserPrefsFromFile(nsIFile *aFile) override { return _to ReadUserPrefsFromFile(aFile); } \ NS_IMETHOD ReadStats(nsIPrefStatsCallback *callback) override { return _to ReadStats(callback); } \ NS_IMETHOD ResetStats(void) override { return _to ResetStats(); } \ NS_IMETHOD ParsePrefsFromBuffer(const nsTArray& bytes, nsIPrefObserver *observer, const char * pathLabel) override { return _to ParsePrefsFromBuffer(bytes, observer, pathLabel); } \ NS_IMETHOD GetUserPrefsFileLastModifiedAtStartup(PRTime *aUserPrefsFileLastModifiedAtStartup) override { return _to GetUserPrefsFileLastModifiedAtStartup(aUserPrefsFileLastModifiedAtStartup); } \ NS_IMETHOD GetPrefsJsPreamble(nsACString& aPrefsJsPreamble) override { return _to GetPrefsJsPreamble(aPrefsJsPreamble); } /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ #define NS_FORWARD_SAFE_NSIPREFSERVICE(_to) \ NS_IMETHOD ResetPrefs(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ResetPrefs(); } \ NS_IMETHOD SavePrefFile(nsIFile *aFile) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SavePrefFile(aFile); } \ NS_IMETHOD BackupPrefFile(nsIFile *aFile, nsIPrefOverrideMap *aOverrideMap, JSContext* cx, ::mozilla::dom::Promise * * _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->BackupPrefFile(aFile, aOverrideMap, cx, _retval); } \ NS_IMETHOD GetBranch(const char * aPrefRoot, nsIPrefBranch **_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetBranch(aPrefRoot, _retval); } \ NS_IMETHOD GetDefaultBranch(const char * aPrefRoot, nsIPrefBranch **_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDefaultBranch(aPrefRoot, _retval); } \ NS_IMETHOD GetDirty(bool *aDirty) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDirty(aDirty); } \ NS_IMETHOD ReadDefaultPrefsFromFile(nsIFile *aFile) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ReadDefaultPrefsFromFile(aFile); } \ NS_IMETHOD ReadUserPrefsFromFile(nsIFile *aFile) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ReadUserPrefsFromFile(aFile); } \ NS_IMETHOD ReadStats(nsIPrefStatsCallback *callback) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ReadStats(callback); } \ NS_IMETHOD ResetStats(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ResetStats(); } \ NS_IMETHOD ParsePrefsFromBuffer(const nsTArray& bytes, nsIPrefObserver *observer, const char * pathLabel) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ParsePrefsFromBuffer(bytes, observer, pathLabel); } \ NS_IMETHOD GetUserPrefsFileLastModifiedAtStartup(PRTime *aUserPrefsFileLastModifiedAtStartup) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetUserPrefsFileLastModifiedAtStartup(aUserPrefsFileLastModifiedAtStartup); } \ NS_IMETHOD GetPrefsJsPreamble(nsACString& aPrefsJsPreamble) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPrefsJsPreamble(aPrefsJsPreamble); } // %{C++:218-238 #define NS_PREFSERVICE_CID \ { /* {1cd91b88-1dd2-11b2-92e1-ed22ed298000} */ \ 0x91ca2441, \ 0x050f, \ 0x4f7c, \ { 0x9d, 0xf8, 0x75, 0xb4, 0x0e, 0xa4, 0x01, 0x56 } \ } #define NS_PREFSERVICE_CONTRACTID "@mozilla.org/preferences-service;1" /** * Notification sent before reading the default user preferences files. */ #define NS_PREFSERVICE_READ_TOPIC_ID "prefservice:before-read-userprefs" /** * Notification sent when after reading app-provided default * preferences, but before user profile override defaults are loaded. */ #define NS_PREFSERVICE_APPDEFAULTS_TOPIC_ID "prefservice:after-app-defaults" // %} #endif /* __gen_nsIPrefService_h__ */