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 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;
49 RenderGraphic & operator=(RenderGraphic const &);
51 /// The message to display instead of the graphic itself.
52 std::string const statusMessage() const;
54 /// Is the image ready to draw, or should we display a message instead?
55 bool readyToDisplay() const;
58 lyx::graphics::Loader loader_;
59 lyx::graphics::Params params_;
61 /// Cached variable (not copied).
62 mutable unsigned long checksum_;
66 #endif // NOT RENDER_GRAPHIC_H