X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsetminipage.h;h=5b2fcc52c02612300c554882c410718d41ff401e;hb=6ce86e2bfe0a403e0e811b66fdddb2d56cfe0f83;hp=54f9d23d0c981bdba2227086d8ba38a700913f6c;hpb=3de10d0174eb3859b0080026fbf39e9467da8b26;p=lyx.git diff --git a/src/insets/insetminipage.h b/src/insets/insetminipage.h index 54f9d23d0c..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 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 +#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 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