// -*- C++ -*-
-/* This file is part of
- * ======================================================
- *
- * LyX, The Document Processor
+/**
+ * \file insetminipage.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
*
- * Copyright 1998 The LyX Team.
+ * \author Jürgen Vigna
+ * \author Lars Gullik Bjønnes
*
- *======================================================
+ * Full author contact details are available in file CREDITS.
*/
-#ifndef InsetMinipage_H
-#define InsetMinipage_H
-
-#ifdef __GNUG__
-#pragma interface
-#endif
+#ifndef INSETMINIPAGE_H
+#define INSETMINIPAGE_H
#include "insetcollapsable.h"
-#include "vspace.h"
+#include "lyxlength.h"
/** The minipage inset
-
+
*/
class InsetMinipage : public InsetCollapsable {
public:
inner_bottom,
inner_stretch
};
+
+ ///
+ struct Params {
+ ///
+ Params();
+ ///
+ Position pos;
+ ///
+ InnerPosition inner_pos;
+ ///
+ LyXLength height;
+ ///
+ LyXLength width;
+ ///
+ void write(std::ostream & os) const;
+ ///
+ void read(LyXLex & lex);
+ };
+
+ ///
+ InsetMinipage(BufferParams const &);
///
- InsetMinipage();
+ InsetMinipage(InsetMinipage const &);
///
- void Write(Buffer const * buf, std::ostream & os) const;
+ ~InsetMinipage();
///
- Inset * Clone(Buffer const &) const;
+ virtual dispatch_result localDispatch(FuncRequest const & cmd);
///
- Inset::Code LyxCode() const { return Inset::MINIPAGE_CODE; }
+ void write(Buffer const & buf, std::ostream & os) const;
///
- int Latex(Buffer const *, std::ostream &, bool fragile, bool fp) const;
+ void read(Buffer const & buf, LyXLex & lex);
///
- string const EditMessage() const;
+ virtual std::auto_ptr<InsetBase> clone() const;
///
- bool InsertInsetAllowed(Inset * inset) const;
+ void metrics(MetricsInfo &, Dimension &) const;
///
- Position pos() const;
+ InsetOld::Code lyxCode() const { return InsetOld::MINIPAGE_CODE; }
///
- void pos(Position);
+ int latex(Buffer const &, std::ostream &,
+ LatexRunParams const &) const;
///
- InnerPosition innerPos() const;
+ string const editMessage() const;
///
- void innerPos(InnerPosition);
+ bool insetAllowed(InsetOld::Code) const;
+ /** returns true if, when outputing LaTeX, font changes should
+ be closed before generating this inset. This is needed for
+ insets that may contain several paragraphs */
+ bool noFontChange() const { return true; }
///
- LyXLength const & height() const;
+ bool showInsetDialog(BufferView *) const;
///
- void height(LyXLength const &);
+ int latexTextWidth(BufferView *) const;
///
- LyXLength const & width() const;
+ void params(Params const & p) { params_ = p; }
///
- void width(LyXLength const &);
+ Params const & params() const { return params_; }
private:
///
- Position pos_;
+ Params params_;
+};
+
+
+#include "mailinset.h"
+
+
+class InsetMinipageMailer : public MailInset {
+public:
+ ///
+ InsetMinipageMailer(InsetMinipage & inset);
///
- InnerPosition inner_pos_;
+ virtual InsetBase & inset() const { return inset_; }
+ ///
+ virtual string const & name() const { return name_; }
+ ///
+ virtual string const inset2string(Buffer const &) const;
+ ///
+ static void string2params(string const &, InsetMinipage::Params &);
+ ///
+ static string const params2string(InsetMinipage::Params const &);
+private:
///
- LyXLength height_;
+ static string const name_;
///
- LyXLength width_;
+ InsetMinipage & inset_;
};
#endif