]> git.lyx.org Git - lyx.git/blob - src/insets/RenderGraphic.h
Streamlining CollapseStatus stuff
[lyx.git] / src / insets / RenderGraphic.h
1 // -*- C++ -*-
2 /**
3  * \file RenderGraphic.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Angus Leeming
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef RENDERGRAPHIC_H
13 #define RENDERGRAPHIC_H
14
15 #include "RenderBase.h"
16
17 #include "graphics/GraphicsLoader.h"
18 #include "graphics/GraphicsParams.h"
19
20 #include <boost/signal.hpp>
21
22 namespace lyx {
23
24
25 class RenderGraphic : public RenderBase
26 {
27 public:
28         RenderGraphic(Inset const *);
29         RenderGraphic(RenderGraphic const &, Inset const *);
30         std::auto_ptr<RenderBase> clone(Inset const *) const;
31
32         ~RenderGraphic() { loader_connection_.disconnect(); }
33
34         /// compute the size of the object returned in dim
35         bool metrics(MetricsInfo & mi, Dimension & dim) const;
36         /// draw inset
37         void draw(PainterInfo & pi, int x, int y) const;
38
39         /// Refresh the info about which file to display and how to display it.
40         void update(graphics::Params const & params);
41
42         /// equivalent to dynamic_cast
43         virtual RenderGraphic * asGraphic() { return this; }
44
45 private:
46         /// Not implemented.
47         RenderGraphic & operator=(RenderGraphic const &);
48
49         /// The stored data.
50         graphics::Loader loader_;
51         graphics::Params params_;
52
53         //
54         boost::signals::connection loader_connection_;
55 };
56
57
58
59 } // namespace lyx
60
61 #endif // NOT RENDERGRAPHIC_H