#ifndef RENDER_IMAGE_H
#define RENDER_IMAGE_H
#include "html/dtd.h"
#include "html/html_elementimpl.h"
#include "rendering/render_replaced.h"
#include "dom/dom_string.h"
#include <qmap.h>
#include <qpixmap.h>
namespace DOM {
class HTMLMapElementImpl;
}
namespace khtml {
class DocLoader;
class RenderImage : public RenderReplaced
{
public:
RenderImage(DOM::NodeImpl*);
virtual ~RenderImage();
virtual const char *renderName() const { return "RenderImage"; }
virtual bool isImage() const { return true; }
virtual bool isImageButton() const { return false; }
virtual void paint(PaintInfo& i, int tx, int ty);
virtual void layout();
virtual void setPixmap( const QPixmap &, const QRect&, CachedImage *);
QPixmap pixmap() const { return pix; }
DOM::HTMLElementImpl* element() const
{ return static_cast<DOM::HTMLElementImpl*>(RenderObject::element()); }
virtual void setStyle(RenderStyle *style);
void updateAltText();
void setImage(CachedImage* image);
CachedImage* getImage() const { return image; }
virtual bool nodeAtPoint(NodeInfo& info, int x, int y, int tx, int ty,
HitTestAction hitTestAction);
virtual int calcReplacedWidth() const;
virtual int calcReplacedHeight() const;
void setContentObject(CachedObject* co);
bool isDisplayingError() const { return berrorPic; }
DOM::HTMLMapElementImpl* imageMap();
#if APPLE_CHANGES
void resetAnimation();
#endif
private:
bool isWidthSpecified() const;
bool isHeightSpecified() const;
QPixmap pix;
QPixmap resizeCache;
DOM::DOMString alt;
CachedImage *image;
bool berrorPic : 1;
};
};
#endif