/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIXPCSecurityManager.idl
 */

#ifndef __gen_nsIXPCSecurityManager_h__
#define __gen_nsIXPCSecurityManager_h__

#include "nsISupports.h"

class nsIInterfaceInfo; /* forward declaration */


/* starting interface:    nsIXPCSecurityManager */
#define NS_IXPCSECURITYMANAGER_IID_STR "31431440-f1ce-11d2-985a-006008962422"

#define NS_IXPCSECURITYMANAGER_IID \
  {0x31431440, 0xf1ce, 0x11d2, \
    { 0x98, 0x5a, 0x00, 0x60, 0x08, 0x96, 0x24, 0x22 }}

class NS_NO_VTABLE nsIXPCSecurityManager : public nsISupports {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(NS_IXPCSECURITYMANAGER_IID)

  /**
    * These flags are used when calling nsIXPConnect::SetSecurityManager
    */
  enum { HOOK_CREATE_WRAPPER = 1 };

  enum { HOOK_CREATE_INSTANCE = 2 };

  enum { HOOK_GET_SERVICE = 4 };

  enum { HOOK_CALL_METHOD = 8 };

  enum { HOOK_GET_PROPERTY = 16 };

  enum { HOOK_SET_PROPERTY = 32 };

  enum { HOOK_ALL = 63 };

  /**
    * For each of these hooks returning NS_OK means 'let the action continue'.
    * Returning an error code means 'veto the action'. XPConnect will do its
    * best to fail silently if the action is vetoed. The implementor of this
    * interface is responsible for setting a JS exception into the JSContext
    * if that is appropriate.
    */
  /* void CanCreateWrapper (in JSContext aJSContext, in nsIIDRef aIID, in nsISupports aObj); */
  NS_IMETHOD CanCreateWrapper(JSContext * aJSContext, const nsIID & aIID, nsISupports *aObj) = 0;

  /* void CanCreateInstance (in JSContext aJSContext, in nsCIDRef aCID); */
  NS_IMETHOD CanCreateInstance(JSContext * aJSContext, const nsCID & aCID) = 0;

  /* void CanGetService (in JSContext aJSContext, in nsCIDRef aCID); */
  NS_IMETHOD CanGetService(JSContext * aJSContext, const nsCID & aCID) = 0;

  /* void CanCallMethod (in JSContext aJSContext, in nsIIDRef aIID, in nsISupports aObj, in nsIInterfaceInfo aInterfaceInfo, in PRUint16 aMethodIndex, [const] in jsid aName); */
  NS_IMETHOD CanCallMethod(JSContext * aJSContext, const nsIID & aIID, nsISupports *aObj, nsIInterfaceInfo *aInterfaceInfo, PRUint16 aMethodIndex, const jsid aName) = 0;

  /* void CanGetProperty (in JSContext aJSContext, in nsIIDRef aIID, in nsISupports aObj, in nsIInterfaceInfo aInterfaceInfo, in PRUint16 aMethodIndex, [const] in jsid aName); */
  NS_IMETHOD CanGetProperty(JSContext * aJSContext, const nsIID & aIID, nsISupports *aObj, nsIInterfaceInfo *aInterfaceInfo, PRUint16 aMethodIndex, const jsid aName) = 0;

  /* void CanSetProperty (in JSContext aJSContext, in nsIIDRef aIID, in nsISupports aObj, in nsIInterfaceInfo aInterfaceInfo, in PRUint16 aMethodIndex, [const] in jsid aName); */
  NS_IMETHOD CanSetProperty(JSContext * aJSContext, const nsIID & aIID, nsISupports *aObj, nsIInterfaceInfo *aInterfaceInfo, PRUint16 aMethodIndex, const jsid aName) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIXPCSECURITYMANAGER \
  NS_IMETHOD CanCreateWrapper(JSContext * aJSContext, const nsIID & aIID, nsISupports *aObj); \
  NS_IMETHOD CanCreateInstance(JSContext * aJSContext, const nsCID & aCID); \
  NS_IMETHOD CanGetService(JSContext * aJSContext, const nsCID & aCID); \
  NS_IMETHOD CanCallMethod(JSContext * aJSContext, const nsIID & aIID, nsISupports *aObj, nsIInterfaceInfo *aInterfaceInfo, PRUint16 aMethodIndex, const jsid aName); \
  NS_IMETHOD CanGetProperty(JSContext * aJSContext, const nsIID & aIID, nsISupports *aObj, nsIInterfaceInfo *aInterfaceInfo, PRUint16 aMethodIndex, const jsid aName); \
  NS_IMETHOD CanSetProperty(JSContext * aJSContext, const nsIID & aIID, nsISupports *aObj, nsIInterfaceInfo *aInterfaceInfo, PRUint16 aMethodIndex, const jsid aName); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIXPCSECURITYMANAGER(_to) \
  NS_IMETHOD CanCreateWrapper(JSContext * aJSContext, const nsIID & aIID, nsISupports *aObj) { return _to ## CanCreateWrapper(aJSContext, aIID, aObj); } \
  NS_IMETHOD CanCreateInstance(JSContext * aJSContext, const nsCID & aCID) { return _to ## CanCreateInstance(aJSContext, aCID); } \
  NS_IMETHOD CanGetService(JSContext * aJSContext, const nsCID & aCID) { return _to ## CanGetService(aJSContext, aCID); } \
  NS_IMETHOD CanCallMethod(JSContext * aJSContext, const nsIID & aIID, nsISupports *aObj, nsIInterfaceInfo *aInterfaceInfo, PRUint16 aMethodIndex, const jsid aName) { return _to ## CanCallMethod(aJSContext, aIID, aObj, aInterfaceInfo, aMethodIndex, aName); } \
  NS_IMETHOD CanGetProperty(JSContext * aJSContext, const nsIID & aIID, nsISupports *aObj, nsIInterfaceInfo *aInterfaceInfo, PRUint16 aMethodIndex, const jsid aName) { return _to ## CanGetProperty(aJSContext, aIID, aObj, aInterfaceInfo, aMethodIndex, aName); } \
  NS_IMETHOD CanSetProperty(JSContext * aJSContext, const nsIID & aIID, nsISupports *aObj, nsIInterfaceInfo *aInterfaceInfo, PRUint16 aMethodIndex, const jsid aName) { return _to ## CanSetProperty(aJSContext, aIID, aObj, aInterfaceInfo, aMethodIndex, aName); } 

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

/* Header file */
class nsXPCSecurityManager : public nsIXPCSecurityManager
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIXPCSECURITYMANAGER

  nsXPCSecurityManager();
  virtual ~nsXPCSecurityManager();
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsXPCSecurityManager, nsIXPCSecurityManager)

nsXPCSecurityManager::nsXPCSecurityManager()
{
  NS_INIT_ISUPPORTS();
  /* member initializers and constructor code */
}

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

/* void CanCreateWrapper (in JSContext aJSContext, in nsIIDRef aIID, in nsISupports aObj); */
NS_IMETHODIMP nsXPCSecurityManager::CanCreateWrapper(JSContext * aJSContext, const nsIID & aIID, nsISupports *aObj)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void CanCreateInstance (in JSContext aJSContext, in nsCIDRef aCID); */
NS_IMETHODIMP nsXPCSecurityManager::CanCreateInstance(JSContext * aJSContext, const nsCID & aCID)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void CanGetService (in JSContext aJSContext, in nsCIDRef aCID); */
NS_IMETHODIMP nsXPCSecurityManager::CanGetService(JSContext * aJSContext, const nsCID & aCID)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void CanCallMethod (in JSContext aJSContext, in nsIIDRef aIID, in nsISupports aObj, in nsIInterfaceInfo aInterfaceInfo, in PRUint16 aMethodIndex, [const] in jsid aName); */
NS_IMETHODIMP nsXPCSecurityManager::CanCallMethod(JSContext * aJSContext, const nsIID & aIID, nsISupports *aObj, nsIInterfaceInfo *aInterfaceInfo, PRUint16 aMethodIndex, const jsid aName)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void CanGetProperty (in JSContext aJSContext, in nsIIDRef aIID, in nsISupports aObj, in nsIInterfaceInfo aInterfaceInfo, in PRUint16 aMethodIndex, [const] in jsid aName); */
NS_IMETHODIMP nsXPCSecurityManager::CanGetProperty(JSContext * aJSContext, const nsIID & aIID, nsISupports *aObj, nsIInterfaceInfo *aInterfaceInfo, PRUint16 aMethodIndex, const jsid aName)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void CanSetProperty (in JSContext aJSContext, in nsIIDRef aIID, in nsISupports aObj, in nsIInterfaceInfo aInterfaceInfo, in PRUint16 aMethodIndex, [const] in jsid aName); */
NS_IMETHODIMP nsXPCSecurityManager::CanSetProperty(JSContext * aJSContext, const nsIID & aIID, nsISupports *aObj, nsIInterfaceInfo *aInterfaceInfo, PRUint16 aMethodIndex, const jsid aName)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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


#endif /* __gen_nsIXPCSecurityManager_h__ */
