/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl\nsIContentSecurityPolicy.idl
 */

#ifndef __gen_nsIContentSecurityPolicy_h__
#define __gen_nsIContentSecurityPolicy_h__


#ifndef __gen_nsISerializable_h__
#include "nsISerializable.h"
#endif

#ifndef __gen_nsIContentPolicy_h__
#include "nsIContentPolicy.h"
#endif

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
class nsIURI; /* forward declaration */

class nsIChannel; /* forward declaration */

class nsIDocShell; /* forward declaration */

class nsIPrincipal; /* forward declaration */

class nsIURI; /* forward declaration */


/* starting interface:    nsIContentSecurityPolicy */
#define NS_ICONTENTSECURITYPOLICY_IID_STR "dc86b261-5e41-4cab-ace3-a0278f5a7ec7"

#define NS_ICONTENTSECURITYPOLICY_IID \
  {0xdc86b261, 0x5e41, 0x4cab, \
    { 0xac, 0xe3, 0xa0, 0x27, 0x8f, 0x5a, 0x7e, 0xc7 }}

class nsIContentSecurityPolicy : public nsISerializable {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICONTENTSECURITYPOLICY_IID)

  /* AString getPolicy (in unsigned long index); */
  NS_IMETHOD GetPolicy(uint32_t index, nsAString & _retval) = 0;

  /* readonly attribute unsigned long policyCount; */
  NS_IMETHOD GetPolicyCount(uint32_t *aPolicyCount) = 0;

  /* void removePolicy (in unsigned long index); */
  NS_IMETHOD RemovePolicy(uint32_t index) = 0;

  /* void appendPolicy (in AString policyString, in boolean reportOnly); */
  NS_IMETHOD AppendPolicy(const nsAString & policyString, bool reportOnly) = 0;

  /* boolean getAllowsInlineScript (out boolean shouldReportViolations); */
  NS_IMETHOD GetAllowsInlineScript(bool *shouldReportViolations, bool *_retval) = 0;

  /* boolean getAllowsEval (out boolean shouldReportViolations); */
  NS_IMETHOD GetAllowsEval(bool *shouldReportViolations, bool *_retval) = 0;

  /* boolean getAllowsInlineStyle (out boolean shouldReportViolations); */
  NS_IMETHOD GetAllowsInlineStyle(bool *shouldReportViolations, bool *_retval) = 0;

  /* boolean getAllowsNonce (in AString aNonce, in unsigned long aContentType, out boolean shouldReportViolation); */
  NS_IMETHOD GetAllowsNonce(const nsAString & aNonce, uint32_t aContentType, bool *shouldReportViolation, bool *_retval) = 0;

  /* boolean getAllowsHash (in AString aContent, in unsigned short aContentType, out boolean shouldReportViolation); */
  NS_IMETHOD GetAllowsHash(const nsAString & aContent, uint16_t aContentType, bool *shouldReportViolation, bool *_retval) = 0;

  /* void logViolationDetails (in unsigned short violationType, in AString sourceFile, in AString scriptSample, in int32_t lineNum, [optional] in AString nonce, [optional] in AString content); */
  NS_IMETHOD LogViolationDetails(uint16_t violationType, const nsAString & sourceFile, const nsAString & scriptSample, int32_t lineNum, const nsAString & nonce, const nsAString & content) = 0;

  enum {
    VIOLATION_TYPE_INLINE_SCRIPT = 1U,
    VIOLATION_TYPE_EVAL = 2U,
    VIOLATION_TYPE_INLINE_STYLE = 3U,
    VIOLATION_TYPE_NONCE_SCRIPT = 4U,
    VIOLATION_TYPE_NONCE_STYLE = 5U,
    VIOLATION_TYPE_HASH_SCRIPT = 6U,
    VIOLATION_TYPE_HASH_STYLE = 7U
  };

  /* void setRequestContext (in nsIURI selfURI, in nsIURI referrer, in nsIChannel aChannel); */
  NS_IMETHOD SetRequestContext(nsIURI *selfURI, nsIURI *referrer, nsIChannel *aChannel) = 0;

  /* boolean permitsAncestry (in nsIDocShell docShell); */
  NS_IMETHOD PermitsAncestry(nsIDocShell *docShell, bool *_retval) = 0;

  /* boolean permitsBaseURI (in nsIURI aURI); */
  NS_IMETHOD PermitsBaseURI(nsIURI *aURI, bool *_retval) = 0;

  /* boolean permitsFormAction (in nsIURI aURI); */
  NS_IMETHOD PermitsFormAction(nsIURI *aURI, bool *_retval) = 0;

  /* short shouldLoad (in nsContentPolicyType aContentType, in nsIURI aContentLocation, in nsIURI aRequestOrigin, in nsISupports aContext, in ACString aMimeTypeGuess, in nsISupports aExtra); */
  NS_IMETHOD ShouldLoad(nsContentPolicyType aContentType, nsIURI *aContentLocation, nsIURI *aRequestOrigin, nsISupports *aContext, const nsACString & aMimeTypeGuess, nsISupports *aExtra, int16_t *_retval) = 0;

 // nsIObserver topic to fire when the policy encounters a violation.
#define CSP_VIOLATION_TOPIC "csp-on-violate-policy"
};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIContentSecurityPolicy, NS_ICONTENTSECURITYPOLICY_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSICONTENTSECURITYPOLICY \
  NS_IMETHOD GetPolicy(uint32_t index, nsAString & _retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetPolicyCount(uint32_t *aPolicyCount) MOZ_OVERRIDE; \
  NS_IMETHOD RemovePolicy(uint32_t index) MOZ_OVERRIDE; \
  NS_IMETHOD AppendPolicy(const nsAString & policyString, bool reportOnly) MOZ_OVERRIDE; \
  NS_IMETHOD GetAllowsInlineScript(bool *shouldReportViolations, bool *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetAllowsEval(bool *shouldReportViolations, bool *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetAllowsInlineStyle(bool *shouldReportViolations, bool *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetAllowsNonce(const nsAString & aNonce, uint32_t aContentType, bool *shouldReportViolation, bool *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetAllowsHash(const nsAString & aContent, uint16_t aContentType, bool *shouldReportViolation, bool *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD LogViolationDetails(uint16_t violationType, const nsAString & sourceFile, const nsAString & scriptSample, int32_t lineNum, const nsAString & nonce, const nsAString & content) MOZ_OVERRIDE; \
  NS_IMETHOD SetRequestContext(nsIURI *selfURI, nsIURI *referrer, nsIChannel *aChannel) MOZ_OVERRIDE; \
  NS_IMETHOD PermitsAncestry(nsIDocShell *docShell, bool *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD PermitsBaseURI(nsIURI *aURI, bool *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD PermitsFormAction(nsIURI *aURI, bool *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD ShouldLoad(nsContentPolicyType aContentType, nsIURI *aContentLocation, nsIURI *aRequestOrigin, nsISupports *aContext, const nsACString & aMimeTypeGuess, nsISupports *aExtra, int16_t *_retval) MOZ_OVERRIDE; \

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSICONTENTSECURITYPOLICY(_to) \
  NS_IMETHOD GetPolicy(uint32_t index, nsAString & _retval) MOZ_OVERRIDE { return _to GetPolicy(index, _retval); } \
  NS_IMETHOD GetPolicyCount(uint32_t *aPolicyCount) MOZ_OVERRIDE { return _to GetPolicyCount(aPolicyCount); } \
  NS_IMETHOD RemovePolicy(uint32_t index) MOZ_OVERRIDE { return _to RemovePolicy(index); } \
  NS_IMETHOD AppendPolicy(const nsAString & policyString, bool reportOnly) MOZ_OVERRIDE { return _to AppendPolicy(policyString, reportOnly); } \
  NS_IMETHOD GetAllowsInlineScript(bool *shouldReportViolations, bool *_retval) MOZ_OVERRIDE { return _to GetAllowsInlineScript(shouldReportViolations, _retval); } \
  NS_IMETHOD GetAllowsEval(bool *shouldReportViolations, bool *_retval) MOZ_OVERRIDE { return _to GetAllowsEval(shouldReportViolations, _retval); } \
  NS_IMETHOD GetAllowsInlineStyle(bool *shouldReportViolations, bool *_retval) MOZ_OVERRIDE { return _to GetAllowsInlineStyle(shouldReportViolations, _retval); } \
  NS_IMETHOD GetAllowsNonce(const nsAString & aNonce, uint32_t aContentType, bool *shouldReportViolation, bool *_retval) MOZ_OVERRIDE { return _to GetAllowsNonce(aNonce, aContentType, shouldReportViolation, _retval); } \
  NS_IMETHOD GetAllowsHash(const nsAString & aContent, uint16_t aContentType, bool *shouldReportViolation, bool *_retval) MOZ_OVERRIDE { return _to GetAllowsHash(aContent, aContentType, shouldReportViolation, _retval); } \
  NS_IMETHOD LogViolationDetails(uint16_t violationType, const nsAString & sourceFile, const nsAString & scriptSample, int32_t lineNum, const nsAString & nonce, const nsAString & content) MOZ_OVERRIDE { return _to LogViolationDetails(violationType, sourceFile, scriptSample, lineNum, nonce, content); } \
  NS_IMETHOD SetRequestContext(nsIURI *selfURI, nsIURI *referrer, nsIChannel *aChannel) MOZ_OVERRIDE { return _to SetRequestContext(selfURI, referrer, aChannel); } \
  NS_IMETHOD PermitsAncestry(nsIDocShell *docShell, bool *_retval) MOZ_OVERRIDE { return _to PermitsAncestry(docShell, _retval); } \
  NS_IMETHOD PermitsBaseURI(nsIURI *aURI, bool *_retval) MOZ_OVERRIDE { return _to PermitsBaseURI(aURI, _retval); } \
  NS_IMETHOD PermitsFormAction(nsIURI *aURI, bool *_retval) MOZ_OVERRIDE { return _to PermitsFormAction(aURI, _retval); } \
  NS_IMETHOD ShouldLoad(nsContentPolicyType aContentType, nsIURI *aContentLocation, nsIURI *aRequestOrigin, nsISupports *aContext, const nsACString & aMimeTypeGuess, nsISupports *aExtra, int16_t *_retval) MOZ_OVERRIDE { return _to ShouldLoad(aContentType, aContentLocation, aRequestOrigin, aContext, aMimeTypeGuess, aExtra, _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_NSICONTENTSECURITYPOLICY(_to) \
  NS_IMETHOD GetPolicy(uint32_t index, nsAString & _retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPolicy(index, _retval); } \
  NS_IMETHOD GetPolicyCount(uint32_t *aPolicyCount) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPolicyCount(aPolicyCount); } \
  NS_IMETHOD RemovePolicy(uint32_t index) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->RemovePolicy(index); } \
  NS_IMETHOD AppendPolicy(const nsAString & policyString, bool reportOnly) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->AppendPolicy(policyString, reportOnly); } \
  NS_IMETHOD GetAllowsInlineScript(bool *shouldReportViolations, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAllowsInlineScript(shouldReportViolations, _retval); } \
  NS_IMETHOD GetAllowsEval(bool *shouldReportViolations, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAllowsEval(shouldReportViolations, _retval); } \
  NS_IMETHOD GetAllowsInlineStyle(bool *shouldReportViolations, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAllowsInlineStyle(shouldReportViolations, _retval); } \
  NS_IMETHOD GetAllowsNonce(const nsAString & aNonce, uint32_t aContentType, bool *shouldReportViolation, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAllowsNonce(aNonce, aContentType, shouldReportViolation, _retval); } \
  NS_IMETHOD GetAllowsHash(const nsAString & aContent, uint16_t aContentType, bool *shouldReportViolation, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAllowsHash(aContent, aContentType, shouldReportViolation, _retval); } \
  NS_IMETHOD LogViolationDetails(uint16_t violationType, const nsAString & sourceFile, const nsAString & scriptSample, int32_t lineNum, const nsAString & nonce, const nsAString & content) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->LogViolationDetails(violationType, sourceFile, scriptSample, lineNum, nonce, content); } \
  NS_IMETHOD SetRequestContext(nsIURI *selfURI, nsIURI *referrer, nsIChannel *aChannel) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetRequestContext(selfURI, referrer, aChannel); } \
  NS_IMETHOD PermitsAncestry(nsIDocShell *docShell, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->PermitsAncestry(docShell, _retval); } \
  NS_IMETHOD PermitsBaseURI(nsIURI *aURI, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->PermitsBaseURI(aURI, _retval); } \
  NS_IMETHOD PermitsFormAction(nsIURI *aURI, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->PermitsFormAction(aURI, _retval); } \
  NS_IMETHOD ShouldLoad(nsContentPolicyType aContentType, nsIURI *aContentLocation, nsIURI *aRequestOrigin, nsISupports *aContext, const nsACString & aMimeTypeGuess, nsISupports *aExtra, int16_t *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->ShouldLoad(aContentType, aContentLocation, aRequestOrigin, aContext, aMimeTypeGuess, aExtra, _retval); } \

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsContentSecurityPolicy : public nsIContentSecurityPolicy
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSICONTENTSECURITYPOLICY

  nsContentSecurityPolicy();

private:
  ~nsContentSecurityPolicy();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS(nsContentSecurityPolicy, nsIContentSecurityPolicy)

nsContentSecurityPolicy::nsContentSecurityPolicy()
{
  /* member initializers and constructor code */
}

nsContentSecurityPolicy::~nsContentSecurityPolicy()
{
  /* destructor code */
}

/* AString getPolicy (in unsigned long index); */
NS_IMETHODIMP nsContentSecurityPolicy::GetPolicy(uint32_t index, nsAString & _retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute unsigned long policyCount; */
NS_IMETHODIMP nsContentSecurityPolicy::GetPolicyCount(uint32_t *aPolicyCount)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void removePolicy (in unsigned long index); */
NS_IMETHODIMP nsContentSecurityPolicy::RemovePolicy(uint32_t index)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void appendPolicy (in AString policyString, in boolean reportOnly); */
NS_IMETHODIMP nsContentSecurityPolicy::AppendPolicy(const nsAString & policyString, bool reportOnly)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* boolean getAllowsInlineScript (out boolean shouldReportViolations); */
NS_IMETHODIMP nsContentSecurityPolicy::GetAllowsInlineScript(bool *shouldReportViolations, bool *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* boolean getAllowsEval (out boolean shouldReportViolations); */
NS_IMETHODIMP nsContentSecurityPolicy::GetAllowsEval(bool *shouldReportViolations, bool *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* boolean getAllowsInlineStyle (out boolean shouldReportViolations); */
NS_IMETHODIMP nsContentSecurityPolicy::GetAllowsInlineStyle(bool *shouldReportViolations, bool *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* boolean getAllowsNonce (in AString aNonce, in unsigned long aContentType, out boolean shouldReportViolation); */
NS_IMETHODIMP nsContentSecurityPolicy::GetAllowsNonce(const nsAString & aNonce, uint32_t aContentType, bool *shouldReportViolation, bool *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* boolean getAllowsHash (in AString aContent, in unsigned short aContentType, out boolean shouldReportViolation); */
NS_IMETHODIMP nsContentSecurityPolicy::GetAllowsHash(const nsAString & aContent, uint16_t aContentType, bool *shouldReportViolation, bool *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void logViolationDetails (in unsigned short violationType, in AString sourceFile, in AString scriptSample, in int32_t lineNum, [optional] in AString nonce, [optional] in AString content); */
NS_IMETHODIMP nsContentSecurityPolicy::LogViolationDetails(uint16_t violationType, const nsAString & sourceFile, const nsAString & scriptSample, int32_t lineNum, const nsAString & nonce, const nsAString & content)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void setRequestContext (in nsIURI selfURI, in nsIURI referrer, in nsIChannel aChannel); */
NS_IMETHODIMP nsContentSecurityPolicy::SetRequestContext(nsIURI *selfURI, nsIURI *referrer, nsIChannel *aChannel)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* boolean permitsAncestry (in nsIDocShell docShell); */
NS_IMETHODIMP nsContentSecurityPolicy::PermitsAncestry(nsIDocShell *docShell, bool *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* boolean permitsBaseURI (in nsIURI aURI); */
NS_IMETHODIMP nsContentSecurityPolicy::PermitsBaseURI(nsIURI *aURI, bool *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* boolean permitsFormAction (in nsIURI aURI); */
NS_IMETHODIMP nsContentSecurityPolicy::PermitsFormAction(nsIURI *aURI, bool *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* short shouldLoad (in nsContentPolicyType aContentType, in nsIURI aContentLocation, in nsIURI aRequestOrigin, in nsISupports aContext, in ACString aMimeTypeGuess, in nsISupports aExtra); */
NS_IMETHODIMP nsContentSecurityPolicy::ShouldLoad(nsContentPolicyType aContentType, nsIURI *aContentLocation, nsIURI *aRequestOrigin, nsISupports *aContext, const nsACString & aMimeTypeGuess, nsISupports *aExtra, int16_t *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif


#endif /* __gen_nsIContentSecurityPolicy_h__ */
