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

#ifndef __gen_nsISVGRendererCanvas_h__
#define __gen_nsISVGRendererCanvas_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
struct nsRect;
typedef PRUint32 nscolor;

class nsIRenderingContext; /* forward declaration */

class nsIPresContext; /* forward declaration */


/* starting interface:    nsISVGRendererCanvas */
#define NS_ISVGRENDERERCANVAS_IID_STR "a1d9f15e-ee63-4ce1-9fe7-b6cdb09a48a0"

#define NS_ISVGRENDERERCANVAS_IID \
  {0xa1d9f15e, 0xee63, 0x4ce1, \
    { 0x9f, 0xe7, 0xb6, 0xcd, 0xb0, 0x9a, 0x48, 0xa0 }}

/**
 * \addtogroup renderer_interfaces Rendering Engine Interfaces
 * @{
 */
/**
 * One of a number of interfaces (all starting with nsISVGRenderer*)
 * to be implemented by an SVG rendering engine. See nsISVGRenderer
 * for more details.
 *
 * This interface abstracts a rendering engine-native canvas object
 * onto which path and glyph geometries can be painted.
 *
 * A canvas object is instantiated by the backend for a given
 * Mozilla-native rendering object with a call to
 * nsISVGRenderer::createCanvas().
 */
class NS_NO_VTABLE nsISVGRendererCanvas : public nsISupports {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISVGRENDERERCANVAS_IID)

  /**
   * Lock a portion of the canvas and obtain a rendering context onto
   * which Mozilla can paint non-svg content. This is needed for
   * (partial) foreignObject support.
   *
   * lockRenderingContext() calls are paired with
   * unlockRenderingContext() calls.
   *
   * @param rect Area to be locked.
   * @return Mozilla-native rendering context for the locked area.
   */
  /* [noscript] nsIRenderingContext lockRenderingContext ([const] in nsRectRef rect); */
  NS_IMETHOD LockRenderingContext(const nsRect & rect, nsIRenderingContext **_retval) = 0;

  /**
   * Unlock the canvas portion locked with a previous call to
   * lockRenderingContext(). 
   */
  /* void unlockRenderingContext (); */
  NS_IMETHOD UnlockRenderingContext(void) = 0;

  /* nsIPresContext getPresContext (); */
  NS_IMETHOD GetPresContext(nsIPresContext **_retval) = 0;

  /**
   * Fill the canvas with the given color.
   *
   * @param color Fill color.
   */
  /* void clear (in nscolor color); */
  NS_IMETHOD Clear(nscolor color) = 0;

  /**
   * Ensure that all renderings on the canvas have been flushed to the
   * Mozilla-native rendering context.
   */
  /* void flush (); */
  NS_IMETHOD Flush(void) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSISVGRENDERERCANVAS \
  NS_IMETHOD LockRenderingContext(const nsRect & rect, nsIRenderingContext **_retval); \
  NS_IMETHOD UnlockRenderingContext(void); \
  NS_IMETHOD GetPresContext(nsIPresContext **_retval); \
  NS_IMETHOD Clear(nscolor color); \
  NS_IMETHOD Flush(void); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSISVGRENDERERCANVAS(_to) \
  NS_IMETHOD LockRenderingContext(const nsRect & rect, nsIRenderingContext **_retval) { return _to LockRenderingContext(rect, _retval); } \
  NS_IMETHOD UnlockRenderingContext(void) { return _to UnlockRenderingContext(); } \
  NS_IMETHOD GetPresContext(nsIPresContext **_retval) { return _to GetPresContext(_retval); } \
  NS_IMETHOD Clear(nscolor color) { return _to Clear(color); } \
  NS_IMETHOD Flush(void) { return _to Flush(); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSISVGRENDERERCANVAS(_to) \
  NS_IMETHOD LockRenderingContext(const nsRect & rect, nsIRenderingContext **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->LockRenderingContext(rect, _retval); } \
  NS_IMETHOD UnlockRenderingContext(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->UnlockRenderingContext(); } \
  NS_IMETHOD GetPresContext(nsIPresContext **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPresContext(_retval); } \
  NS_IMETHOD Clear(nscolor color) { return !_to ? NS_ERROR_NULL_POINTER : _to->Clear(color); } \
  NS_IMETHOD Flush(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Flush(); } 

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

/* Header file */
class nsSVGRendererCanvas : public nsISVGRendererCanvas
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSISVGRENDERERCANVAS

  nsSVGRendererCanvas();

private:
  ~nsSVGRendererCanvas();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsSVGRendererCanvas, nsISVGRendererCanvas)

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

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

/* [noscript] nsIRenderingContext lockRenderingContext ([const] in nsRectRef rect); */
NS_IMETHODIMP nsSVGRendererCanvas::LockRenderingContext(const nsRect & rect, nsIRenderingContext **_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void unlockRenderingContext (); */
NS_IMETHODIMP nsSVGRendererCanvas::UnlockRenderingContext()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* nsIPresContext getPresContext (); */
NS_IMETHODIMP nsSVGRendererCanvas::GetPresContext(nsIPresContext **_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void clear (in nscolor color); */
NS_IMETHODIMP nsSVGRendererCanvas::Clear(nscolor color)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void flush (); */
NS_IMETHODIMP nsSVGRendererCanvas::Flush()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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


#endif /* __gen_nsISVGRendererCanvas_h__ */
