4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Angus Leeming
9 * Full author contact details are available in file CREDITS.
15 #include "dimension.h"
25 class RenderMonitoredPreview;
29 virtual ~RenderBase() {}
31 virtual std::auto_ptr<RenderBase> clone() const = 0;
33 /// compute the size of the object returned in dim
34 virtual void metrics(MetricsInfo & mi, Dimension & dim) const = 0;
35 /// draw inset and update (xo, yo)-cache
36 virtual void draw(PainterInfo & pi, int x, int y) const = 0;
38 /// equivalent to dynamic_cast
39 virtual RenderButton * asButton() { return 0; }
40 virtual RenderGraphic * asGraphic() { return 0; }
41 virtual RenderPreview * asPreview() { return 0; }
42 virtual RenderMonitoredPreview * asMonitoredPreview() { return 0; }
46 RenderBase(RenderBase const &) {}
47 void operator=(RenderBase const &) {}
50 mutable Dimension dim_;
53 #endif // NOT RENDER_BASE_H