3 * \file render_graphic.h
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.
12 #ifndef RENDER_GRAPHIC_H
13 #define RENDER_GRAPHIC_H
15 #include "render_base.h"
17 #include "graphics/GraphicsLoader.h"
18 #include "graphics/GraphicsParams.h"
21 class RenderGraphic : public RenderBase
24 RenderGraphic(InsetBase const *);
25 RenderGraphic(RenderGraphic const &, InsetBase const *);
26 std::auto_ptr<RenderBase> clone(InsetBase const *) const;
28 /// compute the size of the object returned in dim
29 void metrics(MetricsInfo & mi, Dimension & dim) const;
31 void draw(PainterInfo & pi, int x, int y) const;
33 /// Refresh the info about which file to display and how to display it.
34 void update(lyx::graphics::Params const & params);
36 /// Is the stored checksum different to that of the graphics loader?
37 bool hasFileChanged() const;
39 /// equivalent to dynamic_cast
40 virtual RenderGraphic * asGraphic() { return this; }
44 RenderGraphic & operator=(RenderGraphic const &);
47 lyx::graphics::Loader loader_;
48 lyx::graphics::Params params_;
50 /// Cached variable (not copied).
51 mutable unsigned long checksum_;
55 #endif // NOT RENDER_GRAPHIC_H