// -*- 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 <sigc++/signal_system.h>
+#include "lyxlength.h"
/** The minipage inset
-
+
*/
class InsetMinipage : public InsetCollapsable {
public:
inner_bottom,
inner_stretch
};
+
///
- InsetMinipage();
+ struct Params {
+ ///
+ Params();
+ ///
+ Position pos;
+ ///
+ InnerPosition inner_pos;
+ ///
+ LyXLength height;
+ ///
+ LyXLength width;
+ ///
+ void write(std::ostream & os) const;
+ ///
+ void read(LyXLex & lex);
+ };
+
///
- ~InsetMinipage();
+ InsetMinipage(BufferParams const &);
///
- void Write(Buffer const * buf, std::ostream & os) const;
+ InsetMinipage(InsetMinipage const &);
///
- void Read(Buffer const * buf, LyXLex & lex);
+ ~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;
///
- LyXLength const & height() const;
+ bool needFullRow() const { return false; }
+ /** 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; }
///
- void height(LyXLength const &);
+ bool showInsetDialog(BufferView *) const;
///
- string const & width() const;
+ int latexTextWidth(BufferView *) const;
///
- void width(string const &);
+ void params(Params const & p) { params_ = p; }
///
- int widthp() const;
+ Params const & params() const { return params_; }
+private:
///
- void widthp(int);
+ Params params_;
+};
+
+
+#include "mailinset.h"
+
+
+class InsetMinipageMailer : public MailInset {
+public:
///
- void widthp(string const &);
+ InsetMinipageMailer(InsetMinipage & inset);
///
- SigC::Signal0<void> hideDialog;
+ virtual InsetBase & inset() const { return inset_; }
///
- void InsetButtonRelease(BufferView * bv, int x, int y, int button);
-
-private:
+ virtual string const & name() const { return name_; }
///
- Position pos_;
+ virtual string const inset2string(Buffer const &) const;
///
- InnerPosition inner_pos_;
+ static void string2params(string const &, InsetMinipage::Params &);
///
- LyXLength height_;
+ static string const params2string(InsetMinipage::Params const &);
+private:
///
- string width_;
+ static string const name_;
///
- int widthp_;
+ InsetMinipage & inset_;
};
#endif