]> git.lyx.org Git - lyx.git/blob - src/insets/insetminipage.h
Added various inset functions for Jean-Marc (see Changelog). Small fix in
[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 "vspace.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();
45         ///
46         void write(Buffer const * buf, std::ostream & os) const;
47         ///
48         void read(Buffer const * buf, LyXLex & lex);
49         ///
50         virtual Inset * clone(Buffer const &, bool same_id = false) const;
51         ///
52         int ascent(BufferView *, LyXFont const &) const;
53         ///
54         int descent(BufferView *, LyXFont const &) const;
55         ///
56         Inset::Code lyxCode() const { return Inset::MINIPAGE_CODE; }
57         ///
58         int latex(Buffer const *, std::ostream &, bool fragile, bool fp) const;
59         ///
60         string const editMessage() const;
61         ///
62         bool insertInsetAllowed(Inset * inset) const;
63         bool insertInsetAllowed(Inset::Code) const;
64         ///
65         Position pos() const;
66         ///
67         void pos(Position);
68         ///
69         InnerPosition innerPos() const;
70         ///
71         void innerPos(InnerPosition);
72         ///
73         string const & height() const;
74         ///
75         void height(string const &);
76         ///
77         string const & width() const;
78         ///
79         void width(string const &);
80         ///
81         SigC::Signal0<void> hideDialog;
82         ///
83         void insetButtonRelease(BufferView * bv, int x, int y, int button);
84         ///
85         int getMaxWidth(BufferView *, UpdatableInset const *) const;
86         ///
87         bool needFullRow() const { return false; }
88         ///
89         bool showInsetDialog(BufferView *) const;
90 private:
91         ///
92         Position pos_;
93         ///
94         InnerPosition inner_pos_;
95         ///
96         string height_;
97         ///
98         string width_;
99 };
100
101 #endif