2000-02-25 12:06:15 +00:00
|
|
|
|
// -*- C++ -*-
|
2002-09-25 14:26:13 +00:00
|
|
|
|
/**
|
2007-04-25 01:24:38 +00:00
|
|
|
|
* \file InsetERT.h
|
2002-09-25 14:26:13 +00:00
|
|
|
|
* 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
|
|
|
|
|
|
2007-04-25 01:24:38 +00:00
|
|
|
|
#include "InsetCollapsable.h"
|
|
|
|
|
#include "MailInset.h"
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace lyx {
|
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);
|
2006-02-27 12:22:36 +00:00
|
|
|
|
#if 0
|
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);
|
2006-02-27 12:22:36 +00:00
|
|
|
|
#endif
|
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
|
|
|
|
///
|
2007-04-29 12:32:14 +00:00
|
|
|
|
docstring getInsetName() const { return from_ascii("ERT"); }
|
|
|
|
|
///
|
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
|
|
|
|
///
|
2007-04-26 11:30:54 +00:00
|
|
|
|
void read(Buffer const & buf, Lexer & lex);
|
2006-02-27 12:22:36 +00:00
|
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
|
virtual docstring 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
|
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
|
int latex(Buffer const &, odocstream &,
|
2003-11-05 12:06:20 +00:00
|
|
|
|
OutputParams const &) const;
|
2001-06-27 14:10:35 +00:00
|
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
|
int plaintext(Buffer const &, odocstream &,
|
2007-02-15 22:27:45 +00:00
|
|
|
|
OutputParams const &) const;
|
2001-06-27 14:10:35 +00:00
|
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
|
int docbook(Buffer const &, odocstream &,
|
2007-02-15 22:27:45 +00:00
|
|
|
|
OutputParams const &) const;
|
2001-06-27 14:10:35 +00:00
|
|
|
|
///
|
2001-08-18 15:01:09 +00:00
|
|
|
|
void validate(LaTeXFeatures &) const {}
|
|
|
|
|
///
|
2006-11-28 15:15:49 +00:00
|
|
|
|
bool 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;
|
|
|
|
|
///
|
2005-11-17 08:41:56 +00:00
|
|
|
|
bool forceDefaultParagraphs(idx_type) const { return true; }
|
2005-09-10 06:51:58 +00:00
|
|
|
|
/// should paragraph indendation be ommitted in any case?
|
Move BufferView cached pointer out of LyXText:
* LyXText
- bv(), bv_owner, : deleted.
- These methods now need a (Buffer const &) argument: getFont(), applyOuterFont(), getLayoutFont(), getLabelFont(), setCharFont(), setLayout(), singleWidth(), leftMargin(), rightMargin(), computeRowMetrics(), isMainText(), spacing(), isRTL(), cursorX(), rowBreakPoint(), setRowWidth(), labelFill(), labelEnd().
- These methods now need a (BufferView const &) argument and are propably candidates for future removal when 1.6 is opened for development: redoParagraph(), x2pos(), getRowNearY(), getColumnNearX(), checkInsetHit(), setHeightOfRow().
- recUndo(): now need a LCursor argument.
* CoordCache::get(LyXText const *, pit_type):
- now const.
- use const_iterator instead of iterator.
* FontIterator:
- add (Buffer const &) argument to ctor
- buffer_: new const reference to applicable BufferView.
* InsetBase
- xo(), yo(), covers() and neverIndent() are now const.
* InsetText::setViewCache(): deleted
All other changes are due to the LyXText and InsetBase API changes.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15618 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-30 12:45:33 +00:00
|
|
|
|
bool neverIndent(Buffer 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
|
|
|
|
///
|
2007-04-26 14:56:30 +00:00
|
|
|
|
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
|
2004-11-04 19:50:04 +00:00
|
|
|
|
///
|
2007-04-26 14:56:30 +00:00
|
|
|
|
bool getStatus(Cursor & 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
|
|
|
|
|
|
|
|
|
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_;
|
|
|
|
|
};
|
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
2000-02-25 12:06:15 +00:00
|
|
|
|
#endif
|