X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsetminipage.h;h=5b2fcc52c02612300c554882c410718d41ff401e;hb=6ce86e2bfe0a403e0e811b66fdddb2d56cfe0f83;hp=4b1797d804c7b32789d984a7ef1692a31b378a9b;hpb=bc2017704562ca48a2c6a646c5ea27d2024ef917;p=lyx.git diff --git a/src/insets/insetminipage.h b/src/insets/insetminipage.h index 4b1797d804..5b2fcc52c0 100644 --- a/src/insets/insetminipage.h +++ b/src/insets/insetminipage.h @@ -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 +#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,39 +81,49 @@ public: /// bool insetAllowed(Inset::Code) const; /// - Position pos() const; - /// - void pos(Position); + int getMaxWidth(BufferView *, UpdatableInset const *) const; /// - InnerPosition innerPos() 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 innerPos(InnerPosition); + bool showInsetDialog(BufferView *) const; /// - string const & height() const; + int latexTextWidth(BufferView *) const; /// - void height(string const &); + void params(Params const & p) { params_ = p; } /// - string const & width() const; + Params const & params() const { return params_; } +private: /// - void width(string const &); + Params params_; +}; + + +#include "mailinset.h" + + +class InsetMinipageMailer : public MailInset { +public: /// - SigC::Signal0 hideDialog; + InsetMinipageMailer(InsetMinipage & inset); /// - int getMaxWidth(BufferView *, UpdatableInset const *) const; + virtual InsetBase & inset() const { return inset_; } /// - bool needFullRow() const { return false; } + virtual string const & name() const { return name_; } /// - bool showInsetDialog(BufferView *) const; - -private: + virtual string const inset2string() const; /// - Position pos_; + static void string2params(string const &, InsetMinipage::Params &); /// - InnerPosition inner_pos_; + static string const params2string(InsetMinipage::Params const &); +private: /// - string height_; + static string const name_; /// - string width_; + InsetMinipage & inset_; }; #endif