]> git.lyx.org Git - lyx.git/blob - src/insets/inset.h
7832a320175be571755316f886b4e666099b50ec
[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         int ascent() const;
40         ///
41         int descent() const;
42         ///
43         int width() const;
44
45         ///
46         void setInsetName(docstring const & s) { name_ = s; }
47         ///
48         virtual docstring const & getInsetName() const { return name_; }
49         ///
50         virtual void setBackgroundColor(LColor_color);
51         ///
52         LColor_color backgroundColor() const;
53         /// set x/y drawing position cache
54         void setPosCache(PainterInfo const &, int, int) const;
55
56 protected:
57         ///
58         InsetOld(InsetOld const & in);
59         ///
60         mutable Dimension dim_;
61
62 private:
63         InsetOld & operator=(InsetOld const &) const;
64
65         ///
66         docstring name_;
67         /** We store the LColor::color value as an int to get LColor.h out
68          *  of the header file.
69          */
70         int background_color_;
71 };
72
73
74 /** \c InsetBase_code is a wrapper for InsetBase::Code.
75  *  It can be forward-declared and passed as a function argument without
76  *  having to expose inset.h.
77  */
78 class InsetBase_code {
79         InsetBase::Code val_;
80 public:
81         InsetBase_code(InsetBase::Code val) : val_(val) {}
82         operator InsetBase::Code() const { return val_; }
83 };
84
85
86 } // namespace lyx
87
88 #endif