]> git.lyx.org Git - lyx.git/blob - src/insets/insetminipage.h
remove Inset::getParagraphs()
[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();
62         ///
63         void write(Buffer const & buf, std::ostream & os) const;
64         ///
65         void read(Buffer const & buf, LyXLex & lex);
66         ///
67         virtual std::auto_ptr<InsetBase> clone() const;
68         ///
69         void metrics(MetricsInfo &, Dimension &) const;
70         ///
71         InsetOld::Code lyxCode() const { return InsetOld::MINIPAGE_CODE; }
72         ///
73         int latex(Buffer const &, std::ostream &,
74                   OutputParams const &) const;
75         ///
76         std::string const editMessage() const;
77         ///
78         bool insetAllowed(InsetOld::Code) const;
79         /** returns true if, when outputing LaTeX, font changes should
80             be closed before generating this inset. This is needed for
81             insets that may contain several paragraphs */
82         bool noFontChange() const { return true; }
83         ///
84         bool showInsetDialog(BufferView *) const;
85         ///
86         void params(Params const & p) { params_ = p; }
87         ///
88         Params const & params() const { return params_; }
89 protected:
90         ///
91         virtual
92         DispatchResult
93         priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
94 private:
95         ///
96         Params params_;
97 };
98
99
100 #include "mailinset.h"
101
102
103 class InsetMinipageMailer : public MailInset {
104 public:
105         ///
106         InsetMinipageMailer(InsetMinipage & inset);
107         ///
108         virtual InsetBase & inset() const { return inset_; }
109         ///
110         virtual std::string const & name() const { return name_; }
111         ///
112         virtual std::string const inset2string(Buffer const &) const;
113         ///
114         static void string2params(std::string const &, InsetMinipage::Params &);
115         ///
116         static std::string const params2string(InsetMinipage::Params const &);
117 private:
118         ///
119         static std::string const name_;
120         ///
121         InsetMinipage & inset_;
122 };
123
124 #endif