]> git.lyx.org Git - lyx.git/blob - src/insets/insetminipage.h
Switch from SigC signals to boost::signals
[lyx.git] / src / insets / insetminipage.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ======================================================
4  *
5  *           LyX, The Document Processor
6  *
7  *           Copyright 2001 The LyX Team.
8  *
9  * ======================================================
10  */
11
12 #ifndef InsetMinipage_H
13 #define InsetMinipage_H
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "insetcollapsable.h"
20 #include "lyxlength.h"
21
22 #include <boost/signals/signal0.hpp>
23
24 /** The minipage inset
25
26 */
27 class InsetMinipage : public InsetCollapsable {
28 public:
29         ///
30         enum Position {
31                 top,
32                 center,
33                 bottom
34         };
35         ///
36         enum InnerPosition {
37                 inner_center,
38                 inner_top,
39                 inner_bottom,
40                 inner_stretch
41         };
42         ///
43         InsetMinipage(BufferParams const &);
44         ///
45         InsetMinipage(InsetMinipage const &, bool same_id = false);
46         ///
47         ~InsetMinipage();
48         ///
49         void write(Buffer const * buf, std::ostream & os) const;
50         ///
51         void read(Buffer const * buf, LyXLex & lex);
52         ///
53         Inset * clone(Buffer const &, bool same_id = false) const;
54         ///
55         int ascent(BufferView *, LyXFont const &) const;
56         ///
57         int descent(BufferView *, LyXFont const &) const;
58         ///
59         Inset::Code lyxCode() const { return Inset::MINIPAGE_CODE; }
60         ///
61         int latex(Buffer const *, std::ostream &, bool fragile, bool fp) const;
62         ///
63         string const editMessage() const;
64         ///
65         bool insetAllowed(Inset::Code) const;
66         ///
67         Position pos() const;
68         ///
69         void pos(Position);
70         ///
71         InnerPosition innerPos() const;
72         ///
73         void innerPos(InnerPosition);
74         ///
75         LyXLength const & pageHeight() const;
76         ///
77         void pageHeight(LyXLength const &);
78         ///
79         LyXLength const & pageWidth() const;
80         ///
81         void pageWidth(LyXLength const &);
82         ///
83         boost::signal0<void> hideDialog;
84         ///
85         int getMaxWidth(BufferView *, UpdatableInset const *) const;
86         ///
87         bool needFullRow() const { return false; }
88         ///
89         bool showInsetDialog(BufferView *) const;
90         ///
91         int latexTextWidth(BufferView *) const;
92
93 private:
94         ///
95         Position pos_;
96         ///
97         InnerPosition inner_pos_;
98         ///
99         LyXLength height_;
100         ///
101         LyXLength width_;
102 };
103
104 #endif