Copy as Markdown

Other Tools

/*
* DO NOT EDIT. THIS FILE IS GENERATED FROM $SRCDIR/toolkit/components/cookiebanners/nsICookieBannerService.idl
*/
#ifndef __gen_nsICookieBannerService_h__
#define __gen_nsICookieBannerService_h__
#include "nsISupports.h"
#include "nsIClickRule.h"
#include "nsICookieBannerRule.h"
#include "nsICookieRule.h"
#include "nsIURI.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
namespace mozilla {
namespace dom {
class BrowsingContext; /* webidl BrowsingContext */
} // namespace dom
} // namespace mozilla
/* starting interface: nsICookieBannerService */
#define NS_ICOOKIEBANNERSERVICE_IID_STR "eac9cdc4-ecee-49f2-91da-7627e15c1f3c"
#define NS_ICOOKIEBANNERSERVICE_IID \
{0xeac9cdc4, 0xecee, 0x49f2, \
{ 0x91, 0xda, 0x76, 0x27, 0xe1, 0x5c, 0x1f, 0x3c }}
class NS_NO_VTABLE nsICookieBannerService : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICOOKIEBANNERSERVICE_IID)
/* Used by ToJSValue to check which scriptable interface is implemented. */
using ScriptableInterfaceType = nsICookieBannerService;
enum Modes : uint8_t {
MODE_DISABLED = 0,
MODE_REJECT = 1,
MODE_REJECT_OR_ACCEPT = 2,
MODE_UNSET = 3,
};
/* readonly attribute boolean isEnabled; */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetIsEnabled(bool *aIsEnabled) = 0;
/* readonly attribute Array<nsICookieBannerRule> rules; */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetRules(nsTArray<RefPtr<nsICookieBannerRule>>& aRules) = 0;
/* void resetRules ([optional] in boolean doImport); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD ResetRules(bool doImport) = 0;
/* Array<nsICookieRule> getCookiesForURI (in nsIURI aURI, in boolean aIsPrivateBrowsing); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetCookiesForURI(nsIURI *aURI, bool aIsPrivateBrowsing, nsTArray<RefPtr<nsICookieRule>>& _retval) = 0;
/* Array<nsIClickRule> getClickRulesForDomain (in ACString aDomain, in boolean aIsTopLevel); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetClickRulesForDomain(const nsACString& aDomain, bool aIsTopLevel, nsTArray<RefPtr<nsIClickRule>>& _retval) = 0;
/* void insertRule (in nsICookieBannerRule aRule); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD InsertRule(nsICookieBannerRule *aRule) = 0;
/* void removeRule (in nsICookieBannerRule aRule); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD RemoveRule(nsICookieBannerRule *aRule) = 0;
/* boolean hasRuleForBrowsingContextTree (in BrowsingContext aBrowsingContext); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD HasRuleForBrowsingContextTree(mozilla::dom::BrowsingContext *aBrowsingContext, bool *_retval) = 0;
/* nsICookieBannerService_Modes getDomainPref (in nsIURI aTopLevelURI, in boolean aIsPrivate); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetDomainPref(nsIURI *aTopLevelURI, bool aIsPrivate, nsICookieBannerService::Modes *_retval) = 0;
/* void setDomainPref (in nsIURI aTopLevelURI, in nsICookieBannerService_Modes aMode, in boolean aIsPrivate); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD SetDomainPref(nsIURI *aTopLevelURI, nsICookieBannerService::Modes aMode, bool aIsPrivate) = 0;
/* void setDomainPrefAndPersistInPrivateBrowsing (in nsIURI aTopLevelURI, in nsICookieBannerService_Modes aMode); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD SetDomainPrefAndPersistInPrivateBrowsing(nsIURI *aTopLevelURI, nsICookieBannerService::Modes aMode) = 0;
/* void removeDomainPref (in nsIURI aTopLevelURI, in boolean aIsPrivate); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD RemoveDomainPref(nsIURI *aTopLevelURI, bool aIsPrivate) = 0;
/* void removeAllDomainPrefs (in boolean aIsPrivate); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD RemoveAllDomainPrefs(bool aIsPrivate) = 0;
/* boolean shouldStopBannerClickingForSite (in ACString aSite, in boolean aIsTopLevel, in boolean aIsPrivate); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD ShouldStopBannerClickingForSite(const nsACString& aSite, bool aIsTopLevel, bool aIsPrivate, bool *_retval) = 0;
/* void markSiteExecuted (in ACString aSite, in boolean aIsTopLevel, in boolean aIsPrivate); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD MarkSiteExecuted(const nsACString& aSite, bool aIsTopLevel, bool aIsPrivate) = 0;
/* void removeExecutedRecordForSite (in ACString aSite, in boolean aIsPrivate); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD RemoveExecutedRecordForSite(const nsACString& aSite, bool aIsPrivate) = 0;
/* void removeAllExecutedRecords (in boolean aIsPrivate); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD RemoveAllExecutedRecords(bool aIsPrivate) = 0;
/* void resetDomainTelemetryRecord ([optional] in ACString aDomain); */
JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD ResetDomainTelemetryRecord(const nsACString& aDomain) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsICookieBannerService, NS_ICOOKIEBANNERSERVICE_IID)
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSICOOKIEBANNERSERVICE \
NS_IMETHOD GetIsEnabled(bool *aIsEnabled) override; \
NS_IMETHOD GetRules(nsTArray<RefPtr<nsICookieBannerRule>>& aRules) override; \
NS_IMETHOD ResetRules(bool doImport) override; \
NS_IMETHOD GetCookiesForURI(nsIURI *aURI, bool aIsPrivateBrowsing, nsTArray<RefPtr<nsICookieRule>>& _retval) override; \
NS_IMETHOD GetClickRulesForDomain(const nsACString& aDomain, bool aIsTopLevel, nsTArray<RefPtr<nsIClickRule>>& _retval) override; \
NS_IMETHOD InsertRule(nsICookieBannerRule *aRule) override; \
NS_IMETHOD RemoveRule(nsICookieBannerRule *aRule) override; \
NS_IMETHOD HasRuleForBrowsingContextTree(mozilla::dom::BrowsingContext *aBrowsingContext, bool *_retval) override; \
NS_IMETHOD GetDomainPref(nsIURI *aTopLevelURI, bool aIsPrivate, nsICookieBannerService::Modes *_retval) override; \
NS_IMETHOD SetDomainPref(nsIURI *aTopLevelURI, nsICookieBannerService::Modes aMode, bool aIsPrivate) override; \
NS_IMETHOD SetDomainPrefAndPersistInPrivateBrowsing(nsIURI *aTopLevelURI, nsICookieBannerService::Modes aMode) override; \
NS_IMETHOD RemoveDomainPref(nsIURI *aTopLevelURI, bool aIsPrivate) override; \
NS_IMETHOD RemoveAllDomainPrefs(bool aIsPrivate) override; \
NS_IMETHOD ShouldStopBannerClickingForSite(const nsACString& aSite, bool aIsTopLevel, bool aIsPrivate, bool *_retval) override; \
NS_IMETHOD MarkSiteExecuted(const nsACString& aSite, bool aIsTopLevel, bool aIsPrivate) override; \
NS_IMETHOD RemoveExecutedRecordForSite(const nsACString& aSite, bool aIsPrivate) override; \
NS_IMETHOD RemoveAllExecutedRecords(bool aIsPrivate) override; \
NS_IMETHOD ResetDomainTelemetryRecord(const nsACString& aDomain) 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_NSICOOKIEBANNERSERVICE \
nsresult GetIsEnabled(bool *aIsEnabled); \
nsresult GetRules(nsTArray<RefPtr<nsICookieBannerRule>>& aRules); \
nsresult ResetRules(bool doImport); \
nsresult GetCookiesForURI(nsIURI *aURI, bool aIsPrivateBrowsing, nsTArray<RefPtr<nsICookieRule>>& _retval); \
nsresult GetClickRulesForDomain(const nsACString& aDomain, bool aIsTopLevel, nsTArray<RefPtr<nsIClickRule>>& _retval); \
nsresult InsertRule(nsICookieBannerRule *aRule); \
nsresult RemoveRule(nsICookieBannerRule *aRule); \
nsresult HasRuleForBrowsingContextTree(mozilla::dom::BrowsingContext *aBrowsingContext, bool *_retval); \
nsresult GetDomainPref(nsIURI *aTopLevelURI, bool aIsPrivate, nsICookieBannerService::Modes *_retval); \
nsresult SetDomainPref(nsIURI *aTopLevelURI, nsICookieBannerService::Modes aMode, bool aIsPrivate); \
nsresult SetDomainPrefAndPersistInPrivateBrowsing(nsIURI *aTopLevelURI, nsICookieBannerService::Modes aMode); \
nsresult RemoveDomainPref(nsIURI *aTopLevelURI, bool aIsPrivate); \
nsresult RemoveAllDomainPrefs(bool aIsPrivate); \
nsresult ShouldStopBannerClickingForSite(const nsACString& aSite, bool aIsTopLevel, bool aIsPrivate, bool *_retval); \
nsresult MarkSiteExecuted(const nsACString& aSite, bool aIsTopLevel, bool aIsPrivate); \
nsresult RemoveExecutedRecordForSite(const nsACString& aSite, bool aIsPrivate); \
nsresult RemoveAllExecutedRecords(bool aIsPrivate); \
nsresult ResetDomainTelemetryRecord(const nsACString& aDomain);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSICOOKIEBANNERSERVICE(_to) \
NS_IMETHOD GetIsEnabled(bool *aIsEnabled) override { return _to GetIsEnabled(aIsEnabled); } \
NS_IMETHOD GetRules(nsTArray<RefPtr<nsICookieBannerRule>>& aRules) override { return _to GetRules(aRules); } \
NS_IMETHOD ResetRules(bool doImport) override { return _to ResetRules(doImport); } \
NS_IMETHOD GetCookiesForURI(nsIURI *aURI, bool aIsPrivateBrowsing, nsTArray<RefPtr<nsICookieRule>>& _retval) override { return _to GetCookiesForURI(aURI, aIsPrivateBrowsing, _retval); } \
NS_IMETHOD GetClickRulesForDomain(const nsACString& aDomain, bool aIsTopLevel, nsTArray<RefPtr<nsIClickRule>>& _retval) override { return _to GetClickRulesForDomain(aDomain, aIsTopLevel, _retval); } \
NS_IMETHOD InsertRule(nsICookieBannerRule *aRule) override { return _to InsertRule(aRule); } \
NS_IMETHOD RemoveRule(nsICookieBannerRule *aRule) override { return _to RemoveRule(aRule); } \
NS_IMETHOD HasRuleForBrowsingContextTree(mozilla::dom::BrowsingContext *aBrowsingContext, bool *_retval) override { return _to HasRuleForBrowsingContextTree(aBrowsingContext, _retval); } \
NS_IMETHOD GetDomainPref(nsIURI *aTopLevelURI, bool aIsPrivate, nsICookieBannerService::Modes *_retval) override { return _to GetDomainPref(aTopLevelURI, aIsPrivate, _retval); } \
NS_IMETHOD SetDomainPref(nsIURI *aTopLevelURI, nsICookieBannerService::Modes aMode, bool aIsPrivate) override { return _to SetDomainPref(aTopLevelURI, aMode, aIsPrivate); } \
NS_IMETHOD SetDomainPrefAndPersistInPrivateBrowsing(nsIURI *aTopLevelURI, nsICookieBannerService::Modes aMode) override { return _to SetDomainPrefAndPersistInPrivateBrowsing(aTopLevelURI, aMode); } \
NS_IMETHOD RemoveDomainPref(nsIURI *aTopLevelURI, bool aIsPrivate) override { return _to RemoveDomainPref(aTopLevelURI, aIsPrivate); } \
NS_IMETHOD RemoveAllDomainPrefs(bool aIsPrivate) override { return _to RemoveAllDomainPrefs(aIsPrivate); } \
NS_IMETHOD ShouldStopBannerClickingForSite(const nsACString& aSite, bool aIsTopLevel, bool aIsPrivate, bool *_retval) override { return _to ShouldStopBannerClickingForSite(aSite, aIsTopLevel, aIsPrivate, _retval); } \
NS_IMETHOD MarkSiteExecuted(const nsACString& aSite, bool aIsTopLevel, bool aIsPrivate) override { return _to MarkSiteExecuted(aSite, aIsTopLevel, aIsPrivate); } \
NS_IMETHOD RemoveExecutedRecordForSite(const nsACString& aSite, bool aIsPrivate) override { return _to RemoveExecutedRecordForSite(aSite, aIsPrivate); } \
NS_IMETHOD RemoveAllExecutedRecords(bool aIsPrivate) override { return _to RemoveAllExecutedRecords(aIsPrivate); } \
NS_IMETHOD ResetDomainTelemetryRecord(const nsACString& aDomain) override { return _to ResetDomainTelemetryRecord(aDomain); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSICOOKIEBANNERSERVICE(_to) \
NS_IMETHOD GetIsEnabled(bool *aIsEnabled) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsEnabled(aIsEnabled); } \
NS_IMETHOD GetRules(nsTArray<RefPtr<nsICookieBannerRule>>& aRules) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRules(aRules); } \
NS_IMETHOD ResetRules(bool doImport) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ResetRules(doImport); } \
NS_IMETHOD GetCookiesForURI(nsIURI *aURI, bool aIsPrivateBrowsing, nsTArray<RefPtr<nsICookieRule>>& _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCookiesForURI(aURI, aIsPrivateBrowsing, _retval); } \
NS_IMETHOD GetClickRulesForDomain(const nsACString& aDomain, bool aIsTopLevel, nsTArray<RefPtr<nsIClickRule>>& _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetClickRulesForDomain(aDomain, aIsTopLevel, _retval); } \
NS_IMETHOD InsertRule(nsICookieBannerRule *aRule) override { return !_to ? NS_ERROR_NULL_POINTER : _to->InsertRule(aRule); } \
NS_IMETHOD RemoveRule(nsICookieBannerRule *aRule) override { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveRule(aRule); } \
NS_IMETHOD HasRuleForBrowsingContextTree(mozilla::dom::BrowsingContext *aBrowsingContext, bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->HasRuleForBrowsingContextTree(aBrowsingContext, _retval); } \
NS_IMETHOD GetDomainPref(nsIURI *aTopLevelURI, bool aIsPrivate, nsICookieBannerService::Modes *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDomainPref(aTopLevelURI, aIsPrivate, _retval); } \
NS_IMETHOD SetDomainPref(nsIURI *aTopLevelURI, nsICookieBannerService::Modes aMode, bool aIsPrivate) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetDomainPref(aTopLevelURI, aMode, aIsPrivate); } \
NS_IMETHOD SetDomainPrefAndPersistInPrivateBrowsing(nsIURI *aTopLevelURI, nsICookieBannerService::Modes aMode) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetDomainPrefAndPersistInPrivateBrowsing(aTopLevelURI, aMode); } \
NS_IMETHOD RemoveDomainPref(nsIURI *aTopLevelURI, bool aIsPrivate) override { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveDomainPref(aTopLevelURI, aIsPrivate); } \
NS_IMETHOD RemoveAllDomainPrefs(bool aIsPrivate) override { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveAllDomainPrefs(aIsPrivate); } \
NS_IMETHOD ShouldStopBannerClickingForSite(const nsACString& aSite, bool aIsTopLevel, bool aIsPrivate, bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ShouldStopBannerClickingForSite(aSite, aIsTopLevel, aIsPrivate, _retval); } \
NS_IMETHOD MarkSiteExecuted(const nsACString& aSite, bool aIsTopLevel, bool aIsPrivate) override { return !_to ? NS_ERROR_NULL_POINTER : _to->MarkSiteExecuted(aSite, aIsTopLevel, aIsPrivate); } \
NS_IMETHOD RemoveExecutedRecordForSite(const nsACString& aSite, bool aIsPrivate) override { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveExecutedRecordForSite(aSite, aIsPrivate); } \
NS_IMETHOD RemoveAllExecutedRecords(bool aIsPrivate) override { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveAllExecutedRecords(aIsPrivate); } \
NS_IMETHOD ResetDomainTelemetryRecord(const nsACString& aDomain) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ResetDomainTelemetryRecord(aDomain); }
#endif /* __gen_nsICookieBannerService_h__ */