X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsetert.h;h=77f81aef220a049bcaf6f5d780c4770c5c28c2d8;hb=e28331ed63062dea10d0a21b9ec12034b4b17b9a;hp=5d633bced2879d2bedb1e247344d6530bcfb62fa;hpb=fd054e60b18496cef6527be18a99cd2ec3e48346;p=lyx.git diff --git a/src/insets/insetert.h b/src/insets/insetert.h index 5d633bced2..77f81aef22 100644 --- a/src/insets/insetert.h +++ b/src/insets/insetert.h @@ -1,67 +1,119 @@ // -*- C++ -*- -/* This file is part of - * ====================================================== - * - * LyX, The Document Processor +/** + * \file insetert.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. */ -// The pristine updatable inset: Text - #ifndef INSETERT_H #define INSETERT_H -#ifdef __GNUG__ -#pragma interface -#endif - #include "insetcollapsable.h" +#include "mailinset.h" + + +namespace lyx { + +/** A collapsable text inset for LaTeX insertions. -/** A colapsable text inset - To write full ert (including styles and other insets) in a given - space. + space. + + Note that collapsed_ encompasses both the inline and collapsed button + versions of this inset. */ + +class Language; + class InsetERT : public InsetCollapsable { public: /// - InsetERT(); + InsetERT(BufferParams const &, CollapseStatus status = Open); +#if 0 + /// + InsetERT(BufferParams const &, + Language const *, std::string const & contents, CollapseStatus status); +#endif + /// + ~InsetERT(); /// - InsetERT(string const & contents, bool collapsed); + InsetBase::Code lyxCode() const { return InsetBase::ERT_CODE; } /// - void write(Buffer const * buf, std::ostream & os) const; + void write(Buffer const & buf, std::ostream & os) const; /// - string const editMessage() const; + void read(Buffer const & buf, LyXLex & lex); /// - bool insertInset(BufferView *, Inset *); + virtual docstring const editMessage() const; /// - bool insetAllowed(Inset::Code) const { return false; } + bool insetAllowed(InsetBase::Code code) const; /// - void setFont(BufferView *, LyXFont const &, - bool toggleall = false, bool selectall = false); + int latex(Buffer const &, odocstream &, + OutputParams const &) const; /// - void edit(BufferView *, int, int, unsigned int); + int plaintext(Buffer const &, odocstream &, + OutputParams const & runparams) const; /// - void edit(BufferView * bv, bool front = true); + int docbook(Buffer const &, odocstream &, + OutputParams const & runparams) const; /// - int latex(Buffer const *, std::ostream &, bool fragile, - bool free_spc) const; + void validate(LaTeXFeatures &) const {} /// - int ascii(Buffer const *, - std::ostream &, int linelen = 0) const; + bool metrics(MetricsInfo &, Dimension &) const; /// - int linuxdoc(Buffer const *, std::ostream &) const; + void draw(PainterInfo & pi, int x, int y) const; /// - int docBook(Buffer const *, std::ostream &) const; + bool showInsetDialog(BufferView *) const; /// - UpdatableInset::RESULT localDispatch(BufferView *, kb_action, - string const &); + void getDrawFont(LyXFont &) const; + /// + bool forceDefaultParagraphs(idx_type) const { return true; } + /// should paragraph indendation be ommitted in any case? + bool neverIndent(Buffer const &) const { return true; } +protected: + InsetERT(InsetERT const &); + /// + virtual void doDispatch(LCursor & cur, FuncRequest & cmd); + /// + bool getStatus(LCursor & cur, FuncRequest const & cmd, FuncStatus &) const; private: + virtual std::auto_ptr doClone() const; /// void init(); + /// + void setButtonLabel(); + /// + bool allowSpellCheck() const { return false; } +}; + + +class InsetERTMailer : public MailInset { +public: + /// + InsetERTMailer(InsetERT & inset); + /// + virtual InsetBase & inset() const { return inset_; } + /// + virtual std::string const & name() const { return name_; } + /// + virtual std::string const inset2string(Buffer const &) const; + /// + static void string2params(std::string const &, + InsetCollapsable::CollapseStatus &); + /// + static std::string const params2string(InsetCollapsable::CollapseStatus); +private: + /// + static std::string const name_; + /// + InsetERT & inset_; }; + +} // namespace lyx + #endif