]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetminipage.h
parlist-a-1.diff
[lyx.git] / src / insets / insetminipage.h
index 54f9d23d0c981bdba2227086d8ba38a700913f6c..5b2fcc52c02612300c554882c410718d41ff401e 100644 (file)
@@ -1,27 +1,24 @@
 // -*- 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
+#ifndef INSETMINIPAGE_H
+#define INSETMINIPAGE_H
 
-#ifdef __GNUG__
-#pragma interface
-#endif
 
 #include "insetcollapsable.h"
-#include "vspace.h"
-#include <sigc++/signal_system.h>
+#include "lyxlength.h"
 
 /** The minipage inset
-  
+
 */
 class InsetMinipage : public InsetCollapsable {
 public:
@@ -38,60 +35,95 @@ 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 &, bool same_id = false);
        ///
-       Inset * Clone(Buffer const &) const;
+       ~InsetMinipage();
        ///
-       Inset::Code LyxCode() const { return Inset::MINIPAGE_CODE; }
+       virtual dispatch_result localDispatch(FuncRequest const & cmd); 
        ///
-       int Latex(Buffer const *, std::ostream &, bool fragile, bool fp) const;
+       void write(Buffer const * buf, std::ostream & os) const;
        ///
-       string const EditMessage() const;
+       void read(Buffer const * buf, LyXLex & lex);
        ///
-       bool InsertInsetAllowed(Inset * inset) const;
+       Inset * clone(Buffer const &, bool same_id = false) const;
        ///
-       Position pos() const;
+       int ascent(BufferView *, LyXFont const &) const;
        ///
-       void pos(Position);
+       int descent(BufferView *, LyXFont const &) const;
        ///
-       InnerPosition innerPos() const;
+       Inset::Code lyxCode() const { return Inset::MINIPAGE_CODE; }
        ///
-       void innerPos(InnerPosition);
+       int latex(Buffer const *, std::ostream &, bool fragile, bool fp) const;
        ///
-       LyXLength const & height() const;
+       string const editMessage() const;
        ///
-       void height(LyXLength const &);
+       bool insetAllowed(Inset::Code) const;
        ///
-       string const & width() const;
+       int getMaxWidth(BufferView *, UpdatableInset const *) const;
        ///
-       void width(string 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; }
        ///
-       int widthp() const;
+       bool showInsetDialog(BufferView *) const;
        ///
-       void widthp(int);
+       int latexTextWidth(BufferView *) const;
        ///
-       void widthp(string const &);
+       void params(Params const & p) { params_ = p; }
        ///
-       SigC::Signal0<void> hideDialog;
+       Params const & params() const { return params_; }
+private:
        ///
-       void InsetButtonRelease(BufferView * bv, int x, int y, int button);
+       Params params_;
+};
 
-private:
+
+#include "mailinset.h"
+
+
+class InsetMinipageMailer : public MailInset {
+public:
        ///
-       Position pos_;
+       InsetMinipageMailer(InsetMinipage & inset);
        ///
-       InnerPosition inner_pos_;
+       virtual InsetBase & inset() const { return inset_; }
        ///
-       LyXLength height_;
+       virtual string const & name() const { return name_; }
+       ///
+       virtual string const inset2string() const;
+       ///
+       static void string2params(string const &, InsetMinipage::Params &);
+       ///
+       static string const params2string(InsetMinipage::Params const &);
+private:
        ///
-       string width_;
+       static string const name_;
        ///
-       int widthp_;
+       InsetMinipage & inset_;
 };
 
 #endif