]> git.lyx.org Git - lyx.git/blob - src/insets/inset.h
* src/LyXAction.C: mark goto-clear-bookmark as working without buffer
[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 private:
61         InsetOld & operator=(InsetOld const &) const;
62
63         ///
64         docstring name_;
65         /** We store the LColor::color value as an int to get LColor.h out
66          *  of the header file.
67          */
68         int background_color_;
69 };
70
71
72 /** \c InsetBase_code is a wrapper for InsetBase::Code.
73  *  It can be forward-declared and passed as a function argument without
74  *  having to expose inset.h.
75  */
76 class InsetBase_code {
77         InsetBase::Code val_;
78 public:
79         InsetBase_code(InsetBase::Code val) : val_(val) {}
80         operator InsetBase::Code() const { return val_; }
81 };
82
83
84 } // namespace lyx
85
86 #endif