X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsetert.h;h=77f81aef220a049bcaf6f5d780c4770c5c28c2d8;hb=e28331ed63062dea10d0a21b9ec12034b4b17b9a;hp=546b6fe46e3402eba3c223514c365ab8364b8bd2;hpb=d32d0cbb9552186e0d69ee2320baf2570402fc72;p=lyx.git diff --git a/src/insets/insetert.h b/src/insets/insetert.h index 546b6fe46e..77f81aef22 100644 --- a/src/insets/insetert.h +++ b/src/insets/insetert.h @@ -1,84 +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. - + 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(InsetERT const &, bool same_id = false); + InsetERT(BufferParams const &, CollapseStatus status = Open); +#if 0 /// - Inset * clone(Buffer const &, bool same_id = false) const; + InsetERT(BufferParams const &, + Language const *, std::string const & contents, CollapseStatus status); +#endif /// - InsetERT(string const & contents, bool collapsed); + ~InsetERT(); /// - Inset::Code lyxCode() const { return Inset::ERT_CODE; } + InsetBase::Code lyxCode() const { return InsetBase::ERT_CODE; } /// - void read(Buffer const * buf, LyXLex & lex); + void write(Buffer const & buf, std::ostream & os) const; /// - void write(Buffer const * buf, std::ostream & os) const; + void read(Buffer const & buf, LyXLex & lex); /// - string const editMessage() const; + virtual docstring const editMessage() const; /// - bool insertInset(BufferView *, Inset *); + bool insetAllowed(InsetBase::Code code) const; /// - bool insetAllowed(Inset::Code) const { return false; } + int latex(Buffer const &, odocstream &, + OutputParams const &) const; /// - void setFont(BufferView *, LyXFont const &, - bool toggleall = false, bool selectall = false); + int plaintext(Buffer const &, odocstream &, + OutputParams const & runparams) const; /// - void edit(BufferView *, int, int, unsigned int); + int docbook(Buffer const &, odocstream &, + OutputParams const & runparams) const; /// - void edit(BufferView * bv, bool front = true); + void validate(LaTeXFeatures &) const {} /// - void insetButtonRelease(BufferView * bv, int x, int y, int button); + bool metrics(MetricsInfo &, Dimension &) const; /// - int latex(Buffer const *, std::ostream &, bool fragile, - bool free_spc) const; + void draw(PainterInfo & pi, int x, int y) const; /// - int ascii(Buffer const *, - std::ostream &, int linelen = 0) const; + bool showInsetDialog(BufferView *) const; /// - int linuxdoc(Buffer const *, std::ostream &) const; + void getDrawFont(LyXFont &) const; /// - int docBook(Buffer const *, std::ostream &) 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 &); /// - UpdatableInset::RESULT localDispatch(BufferView *, kb_action, - string const &); + virtual void doDispatch(LCursor & cur, FuncRequest & cmd); /// - bool checkInsertChar(LyXFont &); - + bool getStatus(LCursor & cur, FuncRequest const & cmd, FuncStatus &) const; private: + virtual std::auto_ptr doClone() const; /// void init(); /// - string const get_new_label() const; - /// 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