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"
20 #include <boost/signals/signal0.hpp>
23 class RenderGraphic : public RenderBase
27 RenderGraphic(RenderGraphic const &);
28 std::auto_ptr<RenderBase> clone() const;
30 /// compute the size of the object returned in dim
31 void metrics(MetricsInfo & mi, Dimension & dim) const;
32 /// draw inset and update (xo, yo)-cache
33 void draw(PainterInfo & pi, int x, int y) const;
35 /// Refresh the info about which file to display and how to display it.
36 void update(lyx::graphics::Params const & params);
38 /// Is the stored checksum different to that of the graphics loader?
39 bool hasFileChanged() const;
41 /** Connect and you'll be informed when the loading status of the image
44 typedef boost::signal0<void>::slot_type slot_type;
45 boost::signals::connection connect(slot_type const &) const;
47 /// equivalent to dynamic_cast
48 virtual RenderGraphic * asGraphic() { return this; }
52 RenderGraphic & operator=(RenderGraphic const &);
55 lyx::graphics::Loader loader_;
56 lyx::graphics::Params params_;
58 /// Cached variable (not copied).
59 mutable unsigned long checksum_;
63 #endif // NOT RENDER_GRAPHIC_H