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

#ifndef __gen_nsIPopupWindowManager_h__
#define __gen_nsIPopupWindowManager_h__


#ifndef __gen_nsISupports_h__
#include "nsISupports.h"
#endif

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

class nsISimpleEnumerator; /* forward declaration */

class nsIURI; /* forward declaration */


/* starting interface:    nsIPopupWindowManager */
#define NS_IPOPUPWINDOWMANAGER_IID_STR "2e14fec9-e8e9-44cc-8c86-c8673c2383cc"

#define NS_IPOPUPWINDOWMANAGER_IID \
  {0x2e14fec9, 0xe8e9, 0x44cc, \
    { 0x8c, 0x86, 0xc8, 0x67, 0x3c, 0x23, 0x83, 0xcc }}

class NS_NO_VTABLE nsIPopupWindowManager : public nsISupports {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(NS_IPOPUPWINDOWMANAGER_IID)

  /**
   * These values are returned by the testPermission method
   */
  enum { ALLOW_POPUP = 1U };

  enum { DENY_POPUP = 2U };

  enum { ALLOW_POPUP_WITH_PREJUDICE = 3U };

  /**
   * The manager's default permission can be ALLOW_POPUP (a blacklist)
   * or DENY_POPUP (a whitelist).
   */
  /* attribute PRUint32 defaultPermission; */
  NS_IMETHOD GetDefaultPermission(PRUint32 *aDefaultPermission) = 0;
  NS_IMETHOD SetDefaultPermission(PRUint32 aDefaultPermission) = 0;

  /**
   * Add permission information for a website.
   * @param aURI the website to be blocked
   * @param aPermit true to grant permission to the website
   *                false to refuse permission
   */
  /* void add (in nsIURI aURI, in boolean aPermit); */
  NS_IMETHOD Add(nsIURI *aURI, PRBool aPermit) = 0;

  /**
   * Remove permission information for a website. Popups will be permitted
   * or not depending on whether this is a white- or black-list.
   * is permitted to show popups.)
   * @param aURI the website to be unblocked
   */
  /* void remove (in nsIURI aURI); */
  NS_IMETHOD Remove(nsIURI *aURI) = 0;

  /**
   * Clear permission information for all websites.
   */
  /* void removeAll (); */
  NS_IMETHOD RemoveAll(void) = 0;

  /**
   * Test whether a website is suitable for popup permission storage.
   * @param aURI the website to be tested
   * @return true if permission can be stored for the website
   */
  /* boolean testSuitability (in nsIURI aURI); */
  NS_IMETHOD TestSuitability(nsIURI *aURI, PRBool *_retval) = 0;

  /**
   * Test whether a website has permission to show a popup window.
   * @param aURI the website to be tested
   * @return one of the ALLOW/DENY consts defined above
   */
  /* PRUint32 testPermission (in nsIURI aURI); */
  NS_IMETHOD TestPermission(nsIURI *aURI, PRUint32 *_retval) = 0;

  /**
   * Enumerates all stored permissions
   * @return an enumerator which itself returns nsISupports objects which
   *         can be QIed to an nsIPermission
   */
  /* nsISimpleEnumerator getEnumerator (); */
  NS_IMETHOD GetEnumerator(nsISimpleEnumerator **_retval) = 0;

  /**
   * This service broadcasts a PPM_CHANGE_NOTIFICATION notification
   * when any popup permission changes. Add yourself as an observer.
   * @param observer the observer
   */
  /* void addObserver (in nsIObserver aObserver); */
  NS_IMETHOD AddObserver(nsIObserver *aObserver) = 0;

  /**
   * This service broadcasts a PPM_CHANGE_NOTIFICATION notification
   * when any popup permission changes. Remove yourself as an observer.
   * @param observer the observer
   */
  /* void removeObserver (in nsIObserver aObserver); */
  NS_IMETHOD RemoveObserver(nsIObserver *aObserver) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIPOPUPWINDOWMANAGER \
  NS_IMETHOD GetDefaultPermission(PRUint32 *aDefaultPermission); \
  NS_IMETHOD SetDefaultPermission(PRUint32 aDefaultPermission); \
  NS_IMETHOD Add(nsIURI *aURI, PRBool aPermit); \
  NS_IMETHOD Remove(nsIURI *aURI); \
  NS_IMETHOD RemoveAll(void); \
  NS_IMETHOD TestSuitability(nsIURI *aURI, PRBool *_retval); \
  NS_IMETHOD TestPermission(nsIURI *aURI, PRUint32 *_retval); \
  NS_IMETHOD GetEnumerator(nsISimpleEnumerator **_retval); \
  NS_IMETHOD AddObserver(nsIObserver *aObserver); \
  NS_IMETHOD RemoveObserver(nsIObserver *aObserver); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIPOPUPWINDOWMANAGER(_to) \
  NS_IMETHOD GetDefaultPermission(PRUint32 *aDefaultPermission) { return _to GetDefaultPermission(aDefaultPermission); } \
  NS_IMETHOD SetDefaultPermission(PRUint32 aDefaultPermission) { return _to SetDefaultPermission(aDefaultPermission); } \
  NS_IMETHOD Add(nsIURI *aURI, PRBool aPermit) { return _to Add(aURI, aPermit); } \
  NS_IMETHOD Remove(nsIURI *aURI) { return _to Remove(aURI); } \
  NS_IMETHOD RemoveAll(void) { return _to RemoveAll(); } \
  NS_IMETHOD TestSuitability(nsIURI *aURI, PRBool *_retval) { return _to TestSuitability(aURI, _retval); } \
  NS_IMETHOD TestPermission(nsIURI *aURI, PRUint32 *_retval) { return _to TestPermission(aURI, _retval); } \
  NS_IMETHOD GetEnumerator(nsISimpleEnumerator **_retval) { return _to GetEnumerator(_retval); } \
  NS_IMETHOD AddObserver(nsIObserver *aObserver) { return _to AddObserver(aObserver); } \
  NS_IMETHOD RemoveObserver(nsIObserver *aObserver) { return _to RemoveObserver(aObserver); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIPOPUPWINDOWMANAGER(_to) \
  NS_IMETHOD GetDefaultPermission(PRUint32 *aDefaultPermission) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDefaultPermission(aDefaultPermission); } \
  NS_IMETHOD SetDefaultPermission(PRUint32 aDefaultPermission) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetDefaultPermission(aDefaultPermission); } \
  NS_IMETHOD Add(nsIURI *aURI, PRBool aPermit) { return !_to ? NS_ERROR_NULL_POINTER : _to->Add(aURI, aPermit); } \
  NS_IMETHOD Remove(nsIURI *aURI) { return !_to ? NS_ERROR_NULL_POINTER : _to->Remove(aURI); } \
  NS_IMETHOD RemoveAll(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveAll(); } \
  NS_IMETHOD TestSuitability(nsIURI *aURI, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->TestSuitability(aURI, _retval); } \
  NS_IMETHOD TestPermission(nsIURI *aURI, PRUint32 *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->TestPermission(aURI, _retval); } \
  NS_IMETHOD GetEnumerator(nsISimpleEnumerator **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetEnumerator(_retval); } \
  NS_IMETHOD AddObserver(nsIObserver *aObserver) { return !_to ? NS_ERROR_NULL_POINTER : _to->AddObserver(aObserver); } \
  NS_IMETHOD RemoveObserver(nsIObserver *aObserver) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveObserver(aObserver); } 

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

/* Header file */
class nsPopupWindowManager : public nsIPopupWindowManager
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIPOPUPWINDOWMANAGER

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

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsPopupWindowManager, nsIPopupWindowManager)

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

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

/* attribute PRUint32 defaultPermission; */
NS_IMETHODIMP nsPopupWindowManager::GetDefaultPermission(PRUint32 *aDefaultPermission)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsPopupWindowManager::SetDefaultPermission(PRUint32 aDefaultPermission)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void add (in nsIURI aURI, in boolean aPermit); */
NS_IMETHODIMP nsPopupWindowManager::Add(nsIURI *aURI, PRBool aPermit)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void remove (in nsIURI aURI); */
NS_IMETHODIMP nsPopupWindowManager::Remove(nsIURI *aURI)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void removeAll (); */
NS_IMETHODIMP nsPopupWindowManager::RemoveAll()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* boolean testSuitability (in nsIURI aURI); */
NS_IMETHODIMP nsPopupWindowManager::TestSuitability(nsIURI *aURI, PRBool *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* PRUint32 testPermission (in nsIURI aURI); */
NS_IMETHODIMP nsPopupWindowManager::TestPermission(nsIURI *aURI, PRUint32 *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* nsISimpleEnumerator getEnumerator (); */
NS_IMETHODIMP nsPopupWindowManager::GetEnumerator(nsISimpleEnumerator **_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void addObserver (in nsIObserver aObserver); */
NS_IMETHODIMP nsPopupWindowManager::AddObserver(nsIObserver *aObserver)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void removeObserver (in nsIObserver aObserver); */
NS_IMETHODIMP nsPopupWindowManager::RemoveObserver(nsIObserver *aObserver)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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

// {2e14fec9-e8e9-44cc-8c86-c8673c2383cc}
#define NS_POPUPWINDOWMANAGER_IID \
{ 0x2e14fec9, 0xe8e9, 0x44cc, { 0x8c, 0x86, 0xc8, 0x67, 0x3c, 0x23, 0x83,0xcc }}
#define NS_POPUPWINDOWMANAGER_CONTRACTID "@mozilla.org/PopupWindowManager;1"
#define PPM_CHANGE_NOTIFICATION "popup-perm-change"

#endif /* __gen_nsIPopupWindowManager_h__ */
