]> git.lyx.org Git - lyx.git/blob - src/insets/insetminipage.h
layout as string
[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 #include <sigc++/signal_system.h>
22
23 /** The minipage inset
24   
25 */
26 class InsetMinipage : public InsetCollapsable {
27 public:
28         ///
29         enum Position {
30                 top,
31                 center,
32                 bottom
33         };
34         ///
35         enum InnerPosition {
36                 inner_center,
37                 inner_top,
38                 inner_bottom,
39                 inner_stretch
40         };
41         ///
42         InsetMinipage();
43         ///
44         InsetMinipage(InsetMinipage const &, bool same_id = false);
45         ///
46         ~InsetMinipage();
47         ///
48         void write(Buffer const * buf, std::ostream & os) const;
49         ///
50         void read(Buffer const * buf, LyXLex & lex);
51         ///
52         Inset * clone(Buffer const &, bool same_id = false) const;
53         ///
54         int ascent(BufferView *, LyXFont const &) const;
55         ///
56         int descent(BufferView *, LyXFont const &) const;
57         ///
58         Inset::Code lyxCode() const { return Inset::MINIPAGE_CODE; }
59         ///
60         int latex(Buffer const *, std::ostream &, bool fragile, bool fp) const;
61         ///
62         string const editMessage() const;
63         ///
64         bool insetAllowed(Inset::Code) const;
65         ///
66         Position pos() const;
67         ///
68         void pos(Position);
69         ///
70         InnerPosition innerPos() const;
71         ///
72         void innerPos(InnerPosition);
73         ///
74         LyXLength const & pageHeight() const;
75         ///
76         void pageHeight(LyXLength const &);
77         ///
78         LyXLength const & pageWidth() const;
79         ///
80         void pageWidth(LyXLength const &);
81         ///
82         SigC::Signal0<void> hideDialog;
83         ///
84         int getMaxWidth(BufferView *, UpdatableInset const *) const;
85         ///
86         bool needFullRow() const { return false; }
87         ///
88         bool showInsetDialog(BufferView *) const;
89         ///
90         int latexTextWidth(BufferView *) const;
91
92 private:
93         ///
94         Position pos_;
95         ///
96         InnerPosition inner_pos_;
97         ///
98         LyXLength height_;
99         ///
100         LyXLength width_;
101 };
102
103 #endif