]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetminipage.h
parlist-a-1.diff
[lyx.git] / src / insets / insetminipage.h
index 77aa106e1cf37e6ecd2ed7da8189bd2f55a57e9a..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 2001 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,13 +35,34 @@ 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();
+       InsetMinipage(BufferParams const &);
        ///
        InsetMinipage(InsetMinipage const &, bool same_id = false);
        ///
        ~InsetMinipage();
        ///
+       virtual dispatch_result localDispatch(FuncRequest const & cmd); 
+       ///
        void write(Buffer const * buf, std::ostream & os) const;
        ///
        void read(Buffer const * buf, LyXLex & lex);
@@ -63,40 +81,49 @@ public:
        ///
        bool insetAllowed(Inset::Code) const;
        ///
-       Position pos() const;
+       int getMaxWidth(BufferView *, UpdatableInset const *) const;
        ///
-       void pos(Position);
+       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; }
        ///
-       InnerPosition innerPos() const;
+       bool showInsetDialog(BufferView *) const;
        ///
-       void innerPos(InnerPosition);
+       int latexTextWidth(BufferView *) const;
        ///
-       string const & height() const;
+       void params(Params const & p) { params_ = p; }
        ///
-       void height(string const &);
+       Params const & params() const { return params_; }
+private:
        ///
-       string const & width() const;
+       Params params_;
+};
+
+
+#include "mailinset.h"
+
+
+class InsetMinipageMailer : public MailInset {
+public:
        ///
-       void width(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);
+       virtual string const & name() const { return name_; }
        ///
-       int getMaxWidth(BufferView *, UpdatableInset const *) const;
+       virtual string const inset2string() const;
        ///
-       bool needFullRow() const { return false; }
+       static void string2params(string const &, InsetMinipage::Params &);
        ///
-       bool showInsetDialog(BufferView *) const;
+       static string const params2string(InsetMinipage::Params const &);
 private:
        ///
-       Position pos_;
-       ///
-       InnerPosition inner_pos_;
-       ///
-       string height_;
+       static string const name_;
        ///
-       string width_;
+       InsetMinipage & inset_;
 };
 
 #endif