]> git.lyx.org Git - lyx.git/blob - src/insets/insetminipage.h
get rid of same_id from function signatures
[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 #include "insetcollapsable.h"
17 #include "lyxlength.h"
18
19 /** The minipage inset
20
21 */
22 class InsetMinipage : public InsetCollapsable {
23 public:
24         ///
25         enum Position {
26                 top,
27                 center,
28                 bottom
29         };
30         ///
31         enum InnerPosition {
32                 inner_center,
33                 inner_top,
34                 inner_bottom,
35                 inner_stretch
36         };
37
38         ///
39         struct Params {
40                 ///
41                 Params();
42                 ///
43                 Position pos;
44                 ///
45                 InnerPosition inner_pos;
46                 ///
47                 LyXLength height;
48                 ///
49                 LyXLength width;
50                 ///
51                 void write(std::ostream & os) const;
52                 ///
53                 void read(LyXLex & lex);
54         };
55
56         ///
57         InsetMinipage(BufferParams const &);
58         ///
59         InsetMinipage(InsetMinipage const &);
60         ///
61         //InsetMinipage(InsetMinipage const &, bool same_id);
62         ///
63         ~InsetMinipage();
64         ///
65         virtual dispatch_result localDispatch(FuncRequest const & cmd);
66         ///
67         void write(Buffer const * buf, std::ostream & os) const;
68         ///
69         void read(Buffer const * buf, LyXLex & lex);
70         ///
71         Inset * clone(Buffer const &) const;
72         ///
73         //Inset * clone(Buffer const &, bool same_id) const;
74         ///
75         void dimension(BufferView *, LyXFont const &, Dimension &) const;
76         ///
77         Inset::Code lyxCode() const { return Inset::MINIPAGE_CODE; }
78         ///
79         int latex(Buffer const *, std::ostream &,
80                   LatexRunParams const &) const;
81         ///
82         string const editMessage() const;
83         ///
84         bool insetAllowed(Inset::Code) const;
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         void params(Params const & p) { params_ = p; }
99         ///
100         Params const & params() const { return params_; }
101 private:
102         ///
103         Params params_;
104 };
105
106
107 #include "mailinset.h"
108
109
110 class InsetMinipageMailer : public MailInset {
111 public:
112         ///
113         InsetMinipageMailer(InsetMinipage & inset);
114         ///
115         virtual InsetBase & inset() const { return inset_; }
116         ///
117         virtual string const & name() const { return name_; }
118         ///
119         virtual string const inset2string() const;
120         ///
121         static void string2params(string const &, InsetMinipage::Params &);
122         ///
123         static string const params2string(InsetMinipage::Params const &);
124 private:
125         ///
126         static string const name_;
127         ///
128         InsetMinipage & inset_;
129 };
130
131 #endif