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"
29 class RenderMonitoredPreview;
33 virtual ~RenderBase() {}
35 virtual RenderBase * clone(Inset const *) const = 0;
37 /// compute the size of the object returned in dim.
38 /// \retval true if the metrics has changed.
39 virtual void metrics(MetricsInfo & mi, Dimension & dim) const = 0;
40 /// draw inset and update (xo, yo)-cache
41 virtual void draw(PainterInfo & pi, int x, int y) const = 0;
43 Dimension const & dimension() const { return dim_; };
45 /// render state, exact meaning of state is render-specific
46 void setRenderState(int state) { state_ = state; }
48 int renderState() const { return state_; }
50 /// equivalent to dynamic_cast
51 virtual RenderButton * asButton() { return 0; }
52 virtual RenderGraphic * asGraphic() { return 0; }
53 virtual RenderPreview * asPreview() { return 0; }
54 virtual RenderMonitoredPreview * asMonitoredPreview() { return 0; }
58 RenderBase(RenderBase const &) {}
59 RenderBase & operator=(RenderBase const &) { return *this; }
61 /// render state. currently, render_button uses this to store mouse_hover_
64 mutable Dimension dim_;
70 #endif // NOT RENDERBASE_H