2000-02-25 12:06:15 +00:00
|
|
|
|
// -*- C++ -*-
|
2002-09-25 14:26:13 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file insetert.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-02-25 12:06:15 +00:00
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
2000-02-25 12:06:15 +00:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef INSETERT_H
|
|
|
|
|
#define INSETERT_H
|
|
|
|
|
|
|
|
|
|
|
2000-03-08 13:52:57 +00:00
|
|
|
|
#include "insetcollapsable.h"
|
2002-05-29 16:21:03 +00:00
|
|
|
|
|
2001-07-24 22:08:49 +00:00
|
|
|
|
/** A collapsable text inset for LaTeX insertions.
|
2002-03-21 17:09:55 +00:00
|
|
|
|
|
2000-02-25 12:06:15 +00:00
|
|
|
|
To write full ert (including styles and other insets) in a given
|
2001-10-31 15:19:49 +00:00
|
|
|
|
space.
|
|
|
|
|
|
|
|
|
|
Note that collapsed_ encompasses both the inline and collapsed button
|
2002-03-21 17:09:55 +00:00
|
|
|
|
versions of this inset.
|
2000-02-25 12:06:15 +00:00
|
|
|
|
*/
|
2002-02-20 14:55:17 +00:00
|
|
|
|
|
|
|
|
|
class Language;
|
|
|
|
|
|
2000-03-08 13:52:57 +00:00
|
|
|
|
class InsetERT : public InsetCollapsable {
|
2000-02-25 12:06:15 +00:00
|
|
|
|
public:
|
2001-08-06 14:55:02 +00:00
|
|
|
|
///
|
2003-12-12 14:02:14 +00:00
|
|
|
|
InsetERT(BufferParams const &, CollapseStatus status = Open);
|
2000-06-28 13:35:52 +00:00
|
|
|
|
///
|
2002-03-03 20:25:07 +00:00
|
|
|
|
InsetERT(BufferParams const &,
|
2003-12-12 14:02:14 +00:00
|
|
|
|
Language const *, std::string const & contents, CollapseStatus status);
|
2001-07-08 12:52:16 +00:00
|
|
|
|
///
|
2001-08-06 14:55:02 +00:00
|
|
|
|
~InsetERT();
|
|
|
|
|
///
|
2004-11-25 19:13:07 +00:00
|
|
|
|
InsetBase::Code lyxCode() const { return InsetBase::ERT_CODE; }
|
2001-07-27 12:03:36 +00:00
|
|
|
|
///
|
2003-08-28 07:41:31 +00:00
|
|
|
|
void write(Buffer const & buf, std::ostream & os) const;
|
2000-06-28 13:35:52 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string const editMessage() const;
|
2000-06-28 13:35:52 +00:00
|
|
|
|
///
|
2004-11-25 19:13:07 +00:00
|
|
|
|
bool insetAllowed(InsetBase::Code code) const;
|
2001-08-06 14:55:02 +00:00
|
|
|
|
///
|
2003-08-28 07:41:31 +00:00
|
|
|
|
int latex(Buffer const &, std::ostream &,
|
2003-11-05 12:06:20 +00:00
|
|
|
|
OutputParams const &) const;
|
2001-06-27 14:10:35 +00:00
|
|
|
|
///
|
2003-11-05 12:06:20 +00:00
|
|
|
|
int plaintext(Buffer const &, std::ostream &,
|
|
|
|
|
OutputParams const & runparams) const;
|
2001-06-27 14:10:35 +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;
|
2001-07-24 15:07:09 +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 & runparams) const;
|
2001-06-27 14:10:35 +00:00
|
|
|
|
///
|
2001-08-18 15:01:09 +00:00
|
|
|
|
void validate(LaTeXFeatures &) const {}
|
|
|
|
|
///
|
2003-06-02 10:03:27 +00:00
|
|
|
|
void metrics(MetricsInfo &, Dimension &) const;
|
2001-07-31 09:53:40 +00:00
|
|
|
|
///
|
2003-05-30 06:48:24 +00:00
|
|
|
|
void draw(PainterInfo & pi, int x, int y) const;
|
2001-08-06 14:55:02 +00:00
|
|
|
|
///
|
|
|
|
|
bool showInsetDialog(BufferView *) const;
|
2002-01-20 16:49:37 +00:00
|
|
|
|
///
|
2002-02-20 14:55:17 +00:00
|
|
|
|
void getDrawFont(LyXFont &) const;
|
|
|
|
|
///
|
2004-01-26 10:13:15 +00:00
|
|
|
|
bool forceDefaultParagraphs(InsetBase const *) const { return true; }
|
2003-10-17 18:01:15 +00:00
|
|
|
|
protected:
|
2004-11-23 23:04:52 +00:00
|
|
|
|
InsetERT(InsetERT const &);
|
2003-10-17 18:01:15 +00:00
|
|
|
|
///
|
2004-11-24 21:58:42 +00:00
|
|
|
|
virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
|
2004-11-04 19:50:04 +00:00
|
|
|
|
///
|
|
|
|
|
bool getStatus(LCursor & cur, FuncRequest const & cmd, FuncStatus &) const;
|
2001-07-24 10:13:19 +00:00
|
|
|
|
private:
|
2004-11-23 23:04:52 +00:00
|
|
|
|
virtual std::auto_ptr<InsetBase> doClone() const;
|
2001-07-24 10:13:19 +00:00
|
|
|
|
///
|
|
|
|
|
void init();
|
2001-07-24 22:08:49 +00:00
|
|
|
|
///
|
2003-12-12 14:02:14 +00:00
|
|
|
|
void setButtonLabel();
|
2003-11-07 09:40:49 +00:00
|
|
|
|
///
|
|
|
|
|
bool allowSpellCheck() const { return false; }
|
2000-02-25 12:06:15 +00:00
|
|
|
|
};
|
|
|
|
|
|
2003-02-25 14:51:38 +00:00
|
|
|
|
|
|
|
|
|
#include "mailinset.h"
|
|
|
|
|
|
|
|
|
|
class InsetERTMailer : public MailInset {
|
|
|
|
|
public:
|
|
|
|
|
///
|
|
|
|
|
InsetERTMailer(InsetERT & inset);
|
|
|
|
|
///
|
2003-03-10 13:33:39 +00:00
|
|
|
|
virtual InsetBase & inset() const { return inset_; }
|
2003-02-25 14:51:38 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
virtual std::string const & name() const { return name_; }
|
2003-02-25 14:51:38 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
virtual std::string const inset2string(Buffer const &) const;
|
2003-02-25 14:51:38 +00:00
|
|
|
|
///
|
2003-12-02 07:15:42 +00:00
|
|
|
|
static void string2params(std::string const &,
|
|
|
|
|
InsetCollapsable::CollapseStatus &);
|
2003-02-25 14:51:38 +00:00
|
|
|
|
///
|
2003-12-02 07:15:42 +00:00
|
|
|
|
static std::string const params2string(InsetCollapsable::CollapseStatus);
|
2003-02-25 14:51:38 +00:00
|
|
|
|
private:
|
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
static std::string const name_;
|
2003-02-25 14:51:38 +00:00
|
|
|
|
///
|
|
|
|
|
InsetERT & inset_;
|
|
|
|
|
};
|
|
|
|
|
|
2000-02-25 12:06:15 +00:00
|
|
|
|
#endif
|