2000-06-28 13:35:52 +00:00
|
|
|
|
// -*- C++ -*-
|
2002-09-25 14:26:13 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file insetminipage.h
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-03-21 17:09:55 +00:00
|
|
|
|
*
|
2002-09-25 14:26:13 +00:00
|
|
|
|
* \author J<EFBFBD>rgen Vigna
|
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
2000-06-28 13:35:52 +00:00
|
|
|
|
*
|
2002-09-25 14:26:13 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS
|
2000-06-28 13:35:52 +00:00
|
|
|
|
*/
|
|
|
|
|
|
2003-03-13 11:42:12 +00:00
|
|
|
|
#ifndef INSETMINIPAGE_H
|
|
|
|
|
#define INSETMINIPAGE_H
|
2000-06-28 13:35:52 +00:00
|
|
|
|
|
|
|
|
|
#include "insetcollapsable.h"
|
2002-01-17 23:09:31 +00:00
|
|
|
|
#include "lyxlength.h"
|
2002-05-29 16:21:03 +00:00
|
|
|
|
|
2000-07-15 23:51:46 +00:00
|
|
|
|
/** The minipage inset
|
2002-03-21 17:09:55 +00:00
|
|
|
|
|
2000-06-28 13:35:52 +00:00
|
|
|
|
*/
|
|
|
|
|
class InsetMinipage : public InsetCollapsable {
|
|
|
|
|
public:
|
2001-03-14 14:53:55 +00:00
|
|
|
|
///
|
|
|
|
|
enum Position {
|
|
|
|
|
top,
|
2001-03-15 19:03:46 +00:00
|
|
|
|
center,
|
2001-03-14 14:53:55 +00:00
|
|
|
|
bottom
|
|
|
|
|
};
|
|
|
|
|
///
|
|
|
|
|
enum InnerPosition {
|
|
|
|
|
inner_center,
|
|
|
|
|
inner_top,
|
|
|
|
|
inner_bottom,
|
|
|
|
|
inner_stretch
|
|
|
|
|
};
|
2003-03-07 14:08:10 +00:00
|
|
|
|
|
|
|
|
|
///
|
|
|
|
|
struct Params {
|
|
|
|
|
///
|
|
|
|
|
Params();
|
|
|
|
|
///
|
|
|
|
|
Position pos;
|
|
|
|
|
///
|
|
|
|
|
InnerPosition inner_pos;
|
|
|
|
|
///
|
|
|
|
|
LyXLength height;
|
|
|
|
|
///
|
|
|
|
|
LyXLength width;
|
|
|
|
|
///
|
|
|
|
|
void write(std::ostream & os) const;
|
|
|
|
|
///
|
|
|
|
|
void read(LyXLex & lex);
|
|
|
|
|
};
|
|
|
|
|
|
2000-06-28 13:35:52 +00:00
|
|
|
|
///
|
2002-03-03 20:25:07 +00:00
|
|
|
|
InsetMinipage(BufferParams const &);
|
2000-06-28 13:35:52 +00:00
|
|
|
|
///
|
2001-07-24 15:07:09 +00:00
|
|
|
|
InsetMinipage(InsetMinipage const &, bool same_id = false);
|
|
|
|
|
///
|
2001-03-16 15:15:32 +00:00
|
|
|
|
~InsetMinipage();
|
|
|
|
|
///
|
2003-03-07 14:08:10 +00:00
|
|
|
|
virtual dispatch_result localDispatch(FuncRequest const & cmd);
|
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
void write(Buffer const * buf, std::ostream & os) const;
|
2000-06-28 13:35:52 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
void read(Buffer const * buf, LyXLex & lex);
|
2001-03-20 01:22:46 +00:00
|
|
|
|
///
|
2001-07-24 15:07:09 +00:00
|
|
|
|
Inset * clone(Buffer const &, bool same_id = false) const;
|
2000-06-28 13:35:52 +00:00
|
|
|
|
///
|
2003-05-19 17:03:12 +00:00
|
|
|
|
void dimension(BufferView *, LyXFont const &, Dimension &) const;
|
2001-03-22 19:36:21 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
Inset::Code lyxCode() const { return Inset::MINIPAGE_CODE; }
|
2000-06-28 13:35:52 +00:00
|
|
|
|
///
|
2003-05-22 18:59:10 +00:00
|
|
|
|
int latex(Buffer const *, std::ostream &, LatexRunParams const &,
|
|
|
|
|
bool fragile, bool fp) const;
|
2000-06-28 13:35:52 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
string const editMessage() const;
|
2000-06-28 13:35:52 +00:00
|
|
|
|
///
|
2001-07-19 08:52:59 +00:00
|
|
|
|
bool insetAllowed(Inset::Code) const;
|
2001-03-14 14:53:55 +00:00
|
|
|
|
///
|
2001-03-29 15:00:20 +00:00
|
|
|
|
int getMaxWidth(BufferView *, UpdatableInset const *) const;
|
2001-03-22 15:45:15 +00:00
|
|
|
|
///
|
|
|
|
|
bool needFullRow() const { return false; }
|
2002-07-23 21:03:38 +00:00
|
|
|
|
/** returns true if, when outputing LaTeX, font changes should
|
2002-12-01 22:59:25 +00:00
|
|
|
|
be closed before generating this inset. This is needed for
|
|
|
|
|
insets that may contain several paragraphs */
|
2002-07-23 21:03:38 +00:00
|
|
|
|
bool noFontChange() const { return true; }
|
2001-03-26 14:47:34 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
bool showInsetDialog(BufferView *) const;
|
2002-01-19 17:05:24 +00:00
|
|
|
|
///
|
|
|
|
|
int latexTextWidth(BufferView *) const;
|
2003-03-07 14:08:10 +00:00
|
|
|
|
///
|
|
|
|
|
void params(Params const & p) { params_ = p; }
|
|
|
|
|
///
|
|
|
|
|
Params const & params() const { return params_; }
|
2001-03-14 14:53:55 +00:00
|
|
|
|
private:
|
|
|
|
|
///
|
2003-03-07 14:08:10 +00:00
|
|
|
|
Params params_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "mailinset.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class InsetMinipageMailer : public MailInset {
|
|
|
|
|
public:
|
|
|
|
|
///
|
|
|
|
|
InsetMinipageMailer(InsetMinipage & inset);
|
2001-03-14 14:53:55 +00:00
|
|
|
|
///
|
2003-03-10 13:33:39 +00:00
|
|
|
|
virtual InsetBase & inset() const { return inset_; }
|
2003-03-07 14:08:10 +00:00
|
|
|
|
///
|
|
|
|
|
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:
|
2001-03-14 14:53:55 +00:00
|
|
|
|
///
|
2003-03-07 14:08:10 +00:00
|
|
|
|
static string const name_;
|
2001-03-14 14:53:55 +00:00
|
|
|
|
///
|
2003-03-07 14:08:10 +00:00
|
|
|
|
InsetMinipage & inset_;
|
2000-06-28 13:35:52 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|