3 * \file RenderGraphic.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 RENDERGRAPHIC_H
13 #define RENDERGRAPHIC_H
15 #include "RenderBase.h"
17 #include "graphics/GraphicsLoader.h"
18 #include "graphics/GraphicsParams.h"
20 #include <boost/signal.hpp>
25 class RenderGraphic : public RenderBase
28 RenderGraphic(Inset const *);
29 RenderGraphic(RenderGraphic const &, Inset const *);
30 std::auto_ptr<RenderBase> clone(Inset const *) const;
32 ~RenderGraphic() { loader_connection_.disconnect(); }
34 /// compute the size of the object returned in dim
35 bool metrics(MetricsInfo & mi, Dimension & dim) const;
37 void draw(PainterInfo & pi, int x, int y) const;
39 /// Refresh the info about which file to display and how to display it.
40 void update(graphics::Params const & params);
42 /// equivalent to dynamic_cast
43 virtual RenderGraphic * asGraphic() { return this; }
47 RenderGraphic & operator=(RenderGraphic const &);
50 graphics::Loader loader_;
51 graphics::Params params_;
54 boost::signals::connection loader_connection_;
61 #endif // NOT RENDERGRAPHIC_H