]> git.lyx.org Git - lyx.git/blob - src/insets/insetminipage.h
Copyright notices
[lyx.git] / src / insets / insetminipage.h
1 // -*- C++ -*-
2 /**
3  * \file insetminipage.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Jürgen Vigna
8  * \author Lars Gullik Bjønnes
9  *
10  * Full author contact details are available in file CREDITS
11  */
12
13 #ifndef InsetMinipage_H
14 #define InsetMinipage_H
15
16 #ifdef __GNUG__
17 #pragma interface
18 #endif
19
20 #include "insetcollapsable.h"
21 #include "lyxlength.h"
22
23 #include <boost/signals/signal0.hpp>
24
25 /** The minipage inset
26
27 */
28 class InsetMinipage : public InsetCollapsable {
29 public:
30         ///
31         enum Position {
32                 top,
33                 center,
34                 bottom
35         };
36         ///
37         enum InnerPosition {
38                 inner_center,
39                 inner_top,
40                 inner_bottom,
41                 inner_stretch
42         };
43         ///
44         InsetMinipage(BufferParams const &);
45         ///
46         InsetMinipage(InsetMinipage const &, bool same_id = false);
47         ///
48         ~InsetMinipage();
49         ///
50         void write(Buffer const * buf, std::ostream & os) const;
51         ///
52         void read(Buffer const * buf, LyXLex & lex);
53         ///
54         Inset * clone(Buffer const &, bool same_id = false) const;
55         ///
56         int ascent(BufferView *, LyXFont const &) const;
57         ///
58         int descent(BufferView *, LyXFont const &) const;
59         ///
60         Inset::Code lyxCode() const { return Inset::MINIPAGE_CODE; }
61         ///
62         int latex(Buffer const *, std::ostream &, bool fragile, bool fp) const;
63         ///
64         string const editMessage() const;
65         ///
66         bool insetAllowed(Inset::Code) const;
67         ///
68         Position pos() const;
69         ///
70         void pos(Position);
71         ///
72         InnerPosition innerPos() const;
73         ///
74         void innerPos(InnerPosition);
75         ///
76         LyXLength const & pageHeight() const;
77         ///
78         void pageHeight(LyXLength const &);
79         ///
80         LyXLength const & pageWidth() const;
81         ///
82         void pageWidth(LyXLength const &);
83         ///
84         boost::signal0<void> hideDialog;
85         ///
86         int getMaxWidth(BufferView *, UpdatableInset const *) const;
87         ///
88         bool needFullRow() const { return false; }
89         /** returns true if, when outputing LaTeX, font changes should
90             be closed before generating this inset. This is needed for
91             insets that may contain several paragraphs */
92         bool noFontChange() const { return true; }
93         ///
94         bool showInsetDialog(BufferView *) const;
95         ///
96         int latexTextWidth(BufferView *) const;
97
98 private:
99         ///
100         Position pos_;
101         ///
102         InnerPosition inner_pos_;
103         ///
104         LyXLength height_;
105         ///
106         LyXLength width_;
107 };
108
109 #endif