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

#ifndef __gen_nsIEditingSession_h__
#define __gen_nsIEditingSession_h__


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

#ifndef __gen_domstubs_h__
#include "domstubs.h"
#endif

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

class nsIEditingShell; /* forward declaration */


/* starting interface:    nsIEditingSession */
#define NS_IEDITINGSESSION_IID_STR "d3b0aa04-f221-11d4-a73c-eaa4baa8b4fc"

#define NS_IEDITINGSESSION_IID \
  {0xd3b0aa04, 0xf221, 0x11d4, \
    { 0xa7, 0x3c, 0xea, 0xa4, 0xba, 0xa8, 0xb4, 0xfc }}

class NS_NO_VTABLE nsIEditingSession : public nsISupports {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(NS_IEDITINGSESSION_IID)

  /**
   *  Error codes when we fail to create an editor
   *  is placed in attribute editorStatus
   */
  enum { eEditorOK = 0 };

  enum { eEditorCreationInProgress = 1 };

  enum { eEditorErrorCantEditMimeType = 2 };

  enum { eEditorErrorFileNotFound = 3 };

  enum { eEditorErrorCantEditFramesets = 8 };

  enum { eEditorErrorUnknown = 9 };

  /**
   *  Status after editor creation and document loading
   *  Value is one of the above error codes
   */
  /* readonly attribute unsigned long editorStatus; */
  NS_IMETHOD GetEditorStatus(PRUint32 *aEditorStatus) = 0;

  /* void init (in nsIDOMWindow window); */
  NS_IMETHOD Init(nsIDOMWindow *window) = 0;

  /**
   *  Make this window editable
   *  @param aWindow nsIDOMWindow, the window the embedder needs to make editable
   *  @param aEditorType string, "html" "htmlsimple" "text" "textsimple"
   */
  /* void makeWindowEditable (in nsIDOMWindow window, in string aEditorType, in boolean doAfterUriLoad); */
  NS_IMETHOD MakeWindowEditable(nsIDOMWindow *window, const char *aEditorType, PRBool doAfterUriLoad) = 0;

  /**
   *  Test whether a specific window has had its editable flag set; it may have an editor
   *  now, or will get one after the uri load.
   *  
   *  Use this, passing the content root window, to test if we've set up editing
   *  for this content.
   */
  /* boolean windowIsEditable (in nsIDOMWindow window); */
  NS_IMETHOD WindowIsEditable(nsIDOMWindow *window, PRBool *_retval) = 0;

  /**
   *  Get the editor for this window. May return null
   */
  /* nsIEditor getEditorForWindow (in nsIDOMWindow window); */
  NS_IMETHOD GetEditorForWindow(nsIDOMWindow *window, nsIEditor **_retval) = 0;

  /** 
   *  Setup editor and related support objects
   */
  /* void setupEditorOnWindow (in nsIDOMWindow window); */
  NS_IMETHOD SetupEditorOnWindow(nsIDOMWindow *window) = 0;

  /** 
   *   Destroy editor and related support objects
   */
  /* void tearDownEditorOnWindow (in nsIDOMWindow window); */
  NS_IMETHOD TearDownEditorOnWindow(nsIDOMWindow *window) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIEDITINGSESSION \
  NS_IMETHOD GetEditorStatus(PRUint32 *aEditorStatus); \
  NS_IMETHOD Init(nsIDOMWindow *window); \
  NS_IMETHOD MakeWindowEditable(nsIDOMWindow *window, const char *aEditorType, PRBool doAfterUriLoad); \
  NS_IMETHOD WindowIsEditable(nsIDOMWindow *window, PRBool *_retval); \
  NS_IMETHOD GetEditorForWindow(nsIDOMWindow *window, nsIEditor **_retval); \
  NS_IMETHOD SetupEditorOnWindow(nsIDOMWindow *window); \
  NS_IMETHOD TearDownEditorOnWindow(nsIDOMWindow *window); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIEDITINGSESSION(_to) \
  NS_IMETHOD GetEditorStatus(PRUint32 *aEditorStatus) { return _to GetEditorStatus(aEditorStatus); } \
  NS_IMETHOD Init(nsIDOMWindow *window) { return _to Init(window); } \
  NS_IMETHOD MakeWindowEditable(nsIDOMWindow *window, const char *aEditorType, PRBool doAfterUriLoad) { return _to MakeWindowEditable(window, aEditorType, doAfterUriLoad); } \
  NS_IMETHOD WindowIsEditable(nsIDOMWindow *window, PRBool *_retval) { return _to WindowIsEditable(window, _retval); } \
  NS_IMETHOD GetEditorForWindow(nsIDOMWindow *window, nsIEditor **_retval) { return _to GetEditorForWindow(window, _retval); } \
  NS_IMETHOD SetupEditorOnWindow(nsIDOMWindow *window) { return _to SetupEditorOnWindow(window); } \
  NS_IMETHOD TearDownEditorOnWindow(nsIDOMWindow *window) { return _to TearDownEditorOnWindow(window); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIEDITINGSESSION(_to) \
  NS_IMETHOD GetEditorStatus(PRUint32 *aEditorStatus) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetEditorStatus(aEditorStatus); } \
  NS_IMETHOD Init(nsIDOMWindow *window) { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(window); } \
  NS_IMETHOD MakeWindowEditable(nsIDOMWindow *window, const char *aEditorType, PRBool doAfterUriLoad) { return !_to ? NS_ERROR_NULL_POINTER : _to->MakeWindowEditable(window, aEditorType, doAfterUriLoad); } \
  NS_IMETHOD WindowIsEditable(nsIDOMWindow *window, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->WindowIsEditable(window, _retval); } \
  NS_IMETHOD GetEditorForWindow(nsIDOMWindow *window, nsIEditor **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetEditorForWindow(window, _retval); } \
  NS_IMETHOD SetupEditorOnWindow(nsIDOMWindow *window) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetupEditorOnWindow(window); } \
  NS_IMETHOD TearDownEditorOnWindow(nsIDOMWindow *window) { return !_to ? NS_ERROR_NULL_POINTER : _to->TearDownEditorOnWindow(window); } 

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

/* Header file */
class nsEditingSession : public nsIEditingSession
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIEDITINGSESSION

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

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsEditingSession, nsIEditingSession)

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

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

/* readonly attribute unsigned long editorStatus; */
NS_IMETHODIMP nsEditingSession::GetEditorStatus(PRUint32 *aEditorStatus)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void init (in nsIDOMWindow window); */
NS_IMETHODIMP nsEditingSession::Init(nsIDOMWindow *window)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void makeWindowEditable (in nsIDOMWindow window, in string aEditorType, in boolean doAfterUriLoad); */
NS_IMETHODIMP nsEditingSession::MakeWindowEditable(nsIDOMWindow *window, const char *aEditorType, PRBool doAfterUriLoad)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* boolean windowIsEditable (in nsIDOMWindow window); */
NS_IMETHODIMP nsEditingSession::WindowIsEditable(nsIDOMWindow *window, PRBool *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* nsIEditor getEditorForWindow (in nsIDOMWindow window); */
NS_IMETHODIMP nsEditingSession::GetEditorForWindow(nsIDOMWindow *window, nsIEditor **_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void setupEditorOnWindow (in nsIDOMWindow window); */
NS_IMETHODIMP nsEditingSession::SetupEditorOnWindow(nsIDOMWindow *window)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void tearDownEditorOnWindow (in nsIDOMWindow window); */
NS_IMETHODIMP nsEditingSession::TearDownEditorOnWindow(nsIDOMWindow *window)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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


#endif /* __gen_nsIEditingSession_h__ */
