]> git.lyx.org Git - lyx.git/blob - src/insets/inset.h
InsetOld -> InsetBase renaming
[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 class LColor_color;
22 class UpdatableInset;
23
24
25 /// Insets
26 class InsetOld : public InsetBase {
27 public:
28         ///
29         enum {
30                 ///
31                 TEXT_TO_INSET_OFFSET = 2
32         };
33
34         ///
35         InsetOld();
36         ///
37         int ascent() const;
38         ///
39         int descent() const;
40         ///
41         int width() const;
42
43         ///
44         void setInsetName(std::string const & s) { name_ = s; }
45         ///
46         std::string const & getInsetName() const { return name_; }
47         ///
48         virtual void setBackgroundColor(LColor_color);
49         ///
50         LColor_color backgroundColor() const;
51         /// set x/y drawing position cache
52         void setPosCache(PainterInfo const &, int, int) const;
53         /// returns the actual scroll-value
54         virtual int scroll(bool recursive = true) const;
55
56         ///
57         bool forceDefaultParagraphs(InsetBase const * inset) const;
58 protected:
59         ///
60         InsetOld(InsetOld const & in);
61         ///
62         mutable int scx;
63         ///
64         mutable Dimension dim_;
65
66 private:
67         InsetOld & operator=(InsetOld const &) const;
68
69         ///
70         std::string name_;
71         /** We store the LColor::color value as an int to get LColor.h out
72          *  of the header file.
73          */
74         int background_color_;
75 };
76
77
78 /** \c InsetBase_code is a wrapper for InsetBase::Code.
79  *  It can be forward-declared and passed as a function argument without
80  *  having to expose inset.h.
81  */
82 class InsetBase_code {
83         InsetBase::Code val_;
84 public:
85         InsetBase_code(InsetBase::Code val) : val_(val) {}
86         operator InsetBase::Code() const { return val_; }
87 };
88
89 #endif