]> git.lyx.org Git - lyx.git/blob - src/insets/inset.h
Trying to solve bug-2452, I optimized some of the most significant problems outlined...
[lyx.git] / src / insets / inset.h
1 // -*- C++ -*-
2 /**
3  * \file inset.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Alejandro Aguilar Sierra
8  * \author Jürgen Vigna
9  * \author Lars Gullik Bjønnes
10  * \author Matthias Ettrich
11  *
12  * Full author contact details are available in file CREDITS.
13  */
14
15 #ifndef INSETOLD_H
16 #define INSETOLD_H
17
18 #include "insetbase.h"
19 #include "dimension.h"
20
21
22 namespace lyx {
23
24 class LColor_color;
25
26
27 /// Insets
28 class InsetOld : public InsetBase {
29 public:
30         ///
31         enum {
32                 ///
33                 TEXT_TO_INSET_OFFSET = 4
34         };
35
36         ///
37         InsetOld();
38
39         ///
40         void setInsetName(docstring const & s) { name_ = s; }
41         ///
42         virtual docstring const & getInsetName() const { return name_; }
43         ///
44         virtual void setBackgroundColor(LColor_color);
45         ///
46         LColor_color backgroundColor() const;
47         /// set x/y drawing position cache
48         void setPosCache(PainterInfo const &, int, int) const;
49
50 protected:
51         ///
52         InsetOld(InsetOld const & in);
53
54 private:
55         InsetOld & operator=(InsetOld const &) const;
56
57         ///
58         docstring name_;
59         /** We store the LColor::color value as an int to get LColor.h out
60          *  of the header file.
61          */
62         int background_color_;
63 };
64
65
66 /** \c InsetBase_code is a wrapper for InsetBase::Code.
67  *  It can be forward-declared and passed as a function argument without
68  *  having to expose inset.h.
69  */
70 class InsetBase_code {
71         InsetBase::Code val_;
72 public:
73         InsetBase_code(InsetBase::Code val) : val_(val) {}
74         operator InsetBase::Code() const { return val_; }
75 };
76
77
78 } // namespace lyx
79
80 #endif