2003-10-07 07:42:15 +00:00
|
|
|
|
// -*- C++ -*-
|
|
|
|
|
/**
|
|
|
|
|
* \file insetbox.h
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author Angus Leeming
|
|
|
|
|
* \author Martin Vermeer
|
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef INSETBOX_H
|
|
|
|
|
#define INSETBOX_H
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "insetcollapsable.h"
|
|
|
|
|
#include "lyxlength.h"
|
|
|
|
|
|
|
|
|
|
|
2005-01-19 15:03:31 +00:00
|
|
|
|
class InsetBoxParams {
|
|
|
|
|
public:
|
2003-10-07 07:42:15 +00:00
|
|
|
|
///
|
|
|
|
|
InsetBoxParams(std::string const &);
|
2003-10-13 02:10:45 +00:00
|
|
|
|
///
|
2003-10-07 07:42:15 +00:00
|
|
|
|
void write(std::ostream & os) const;
|
|
|
|
|
///
|
|
|
|
|
void read(LyXLex & lex);
|
|
|
|
|
///
|
|
|
|
|
std::string type;
|
|
|
|
|
/// Use a parbox (true) or minipage (false)
|
|
|
|
|
bool use_parbox;
|
|
|
|
|
/// Do we have an inner parbox or minipage to format paragraphs to
|
|
|
|
|
/// columnwidth?
|
|
|
|
|
bool inner_box;
|
|
|
|
|
///
|
|
|
|
|
LyXLength width;
|
|
|
|
|
/// "special" widths, see usrguide.dvi <20>3.5
|
|
|
|
|
std::string special;
|
|
|
|
|
///
|
|
|
|
|
char pos;
|
|
|
|
|
///
|
|
|
|
|
char hor_pos;
|
|
|
|
|
///
|
|
|
|
|
char inner_pos;
|
|
|
|
|
///
|
|
|
|
|
LyXLength height;
|
|
|
|
|
///
|
|
|
|
|
std::string height_special;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** The fbox/fancybox inset
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
class InsetBox : public InsetCollapsable {
|
|
|
|
|
public:
|
|
|
|
|
///
|
|
|
|
|
InsetBox(BufferParams const &, std::string const &);
|
|
|
|
|
///
|
|
|
|
|
~InsetBox();
|
|
|
|
|
///
|
|
|
|
|
std::string const editMessage() const;
|
|
|
|
|
///
|
2004-11-25 19:13:07 +00:00
|
|
|
|
InsetBase::Code lyxCode() const { return InsetBase::BOX_CODE; }
|
2003-10-07 07:42:15 +00:00
|
|
|
|
///
|
|
|
|
|
void write(Buffer const &, std::ostream &) const;
|
|
|
|
|
///
|
|
|
|
|
void read(Buffer const & buf, LyXLex & lex);
|
|
|
|
|
///
|
|
|
|
|
void setButtonLabel();
|
|
|
|
|
///
|
|
|
|
|
void metrics(MetricsInfo &, Dimension &) const;
|
|
|
|
|
/// show the Box dialog
|
|
|
|
|
bool showInsetDialog(BufferView * bv) const;
|
|
|
|
|
///
|
2003-11-10 09:06:48 +00:00
|
|
|
|
bool display() const { return false; }
|
|
|
|
|
///
|
2005-12-05 15:03:38 +00:00
|
|
|
|
bool forceDefaultParagraphs(idx_type) const;
|
|
|
|
|
///
|
|
|
|
|
bool neverIndent() const { return true; }
|
|
|
|
|
///
|
2003-10-07 07:42:15 +00:00
|
|
|
|
int latex(Buffer const &, std::ostream &,
|
2003-11-05 12:06:20 +00:00
|
|
|
|
OutputParams const &) const;
|
2003-10-07 07:42:15 +00:00
|
|
|
|
///
|
2003-10-31 18:45:43 +00:00
|
|
|
|
int linuxdoc(Buffer const &, std::ostream &,
|
2003-11-05 12:06:20 +00:00
|
|
|
|
OutputParams const &) const;
|
2003-10-07 07:42:15 +00:00
|
|
|
|
///
|
2003-10-31 18:45:43 +00:00
|
|
|
|
int docbook(Buffer const &, std::ostream &,
|
2003-11-05 12:06:20 +00:00
|
|
|
|
OutputParams const &) const;
|
2003-10-07 07:42:15 +00:00
|
|
|
|
///
|
2003-11-05 12:06:20 +00:00
|
|
|
|
int plaintext(Buffer const &, std::ostream &,
|
|
|
|
|
OutputParams const & runparams) const;
|
2003-10-07 07:42:15 +00:00
|
|
|
|
///
|
|
|
|
|
void validate(LaTeXFeatures &) const;
|
|
|
|
|
///
|
|
|
|
|
InsetBoxParams const & params() const { return params_; }
|
2003-10-13 02:10:45 +00:00
|
|
|
|
///
|
2005-04-22 08:57:22 +00:00
|
|
|
|
bool getStatus(LCursor &, FuncRequest const &, FuncStatus &) const;
|
|
|
|
|
///
|
2003-10-07 07:42:15 +00:00
|
|
|
|
enum BoxType {
|
|
|
|
|
Frameless,
|
|
|
|
|
Boxed,
|
|
|
|
|
ovalbox,
|
|
|
|
|
Ovalbox,
|
|
|
|
|
Shadowbox,
|
|
|
|
|
Doublebox
|
|
|
|
|
};
|
2003-10-17 18:01:15 +00:00
|
|
|
|
protected:
|
2004-11-23 23:04:52 +00:00
|
|
|
|
InsetBox(InsetBox const &);
|
2004-11-24 21:58:42 +00:00
|
|
|
|
virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
|
2003-10-07 07:42:15 +00:00
|
|
|
|
private:
|
|
|
|
|
friend class InsetBoxParams;
|
|
|
|
|
|
2004-11-23 23:04:52 +00:00
|
|
|
|
virtual std::auto_ptr<InsetBase> doClone() const;
|
|
|
|
|
|
2003-10-07 07:42:15 +00:00
|
|
|
|
/// used by the constructors
|
|
|
|
|
void init();
|
|
|
|
|
///
|
|
|
|
|
InsetBoxParams params_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "mailinset.h"
|
|
|
|
|
|
|
|
|
|
class InsetBoxMailer : public MailInset {
|
|
|
|
|
public:
|
|
|
|
|
///
|
|
|
|
|
InsetBoxMailer(InsetBox & inset);
|
|
|
|
|
///
|
|
|
|
|
virtual InsetBase & inset() const { return inset_; }
|
|
|
|
|
///
|
|
|
|
|
virtual std::string const & name() const { return name_; }
|
|
|
|
|
///
|
|
|
|
|
virtual std::string const inset2string(Buffer const &) const;
|
|
|
|
|
///
|
|
|
|
|
static std::string const params2string(InsetBoxParams const &);
|
|
|
|
|
///
|
|
|
|
|
static void string2params(std::string const &, InsetBoxParams &);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
///
|
|
|
|
|
static std::string const name_;
|
|
|
|
|
///
|
|
|
|
|
InsetBox & inset_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // INSET_BOX_H
|