]> git.lyx.org Git - lyx.git/blob - src/insets/render_base.h
ws changes only
[lyx.git] / src / insets / render_base.h
1 // -*- C++ -*-
2 /**
3  * \file render_base.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 RENDER_BASE_H
13 #define RENDER_BASE_H
14
15 #include "dimension.h"
16
17 class MetricsInfo;
18 class PainterInfo;
19
20
21 class RenderBase {
22 public:
23         virtual ~RenderBase() {}
24
25         virtual RenderBase * clone() const = 0;
26
27         /// compute the size of the object returned in dim
28         virtual void metrics(MetricsInfo & mi, Dimension & dim) const = 0;
29         /// draw inset and update (xo, yo)-cache
30         virtual void draw(PainterInfo & pi, int x, int y) const = 0;
31
32 protected:
33         RenderBase() {}
34         RenderBase(RenderBase const &) {}
35         void operator=(RenderBase const &) {}
36
37         /// Cached
38         mutable Dimension dim_;
39 };
40
41 #endif // NOT RENDER_BASE_H