]> git.lyx.org Git - features.git/blobdiff - src/insets/InsetERT.h
InsetIndex: Some comments and indentation fixes
[features.git] / src / insets / InsetERT.h
index 8b3b64498be25db4f31cb291e8c9cd99d9f84c5b..72220d07d0c7aeec383533c681a6071fd63cb9ce 100644 (file)
@@ -4,8 +4,8 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author Jürgen Vigna
- * \author Lars Gullik Bjønnes
+ * \author Jürgen Vigna
+ * \author Lars Gullik Bjønnes
  *
  * Full author contact details are available in file CREDITS.
  */
 #ifndef INSETERT_H
 #define INSETERT_H
 
-#include "InsetCollapsable.h"
-#include "MailInset.h"
-
+#include "InsetCollapsible.h"
 
 namespace lyx {
 
-/** A collapsable text inset for LaTeX insertions.
+/** A collapsible text inset for LaTeX insertions.
 
   To write full ert (including styles and other insets) in a given
   space.
@@ -28,89 +26,49 @@ namespace lyx {
   versions of this inset.
 */
 
-class Language;
-
-class InsetERT : public InsetCollapsable {
+class InsetERT : public InsetCollapsible {
 public:
        ///
-       InsetERT(BufferParams const &, CollapseStatus status = Open);
-#if 0
-       ///
-       InsetERT(BufferParams const &,
-                Language const *, std::string const & contents, CollapseStatus status);
-#endif
-       ///
-       ~InsetERT();
-       ///
-       InsetBase::Code lyxCode() const { return InsetBase::ERT_CODE; }
-       ///
-       void write(Buffer const & buf, std::ostream & os) const;
-       ///
-       void read(Buffer const & buf, Lexer & lex);
-       ///
-       virtual docstring const editMessage() const;
-       ///
-       bool insetAllowed(InsetBase::Code code) const;
-       ///
-       int latex(Buffer const &, odocstream &,
-                 OutputParams const &) const;
-       ///
-       int plaintext(Buffer const &, odocstream &,
-                     OutputParams const &) const;
-       ///
-       int docbook(Buffer const &, odocstream &,
-                   OutputParams const &) const;
+       InsetERT(Buffer *, CollapseStatus status = Open);
        ///
-       void validate(LaTeXFeatures &) const {}
+       InsetERT(InsetERT const & old);
        ///
-       bool metrics(MetricsInfo &, Dimension &) const;
+       static CollapseStatus string2params(std::string const &);
        ///
-       void draw(PainterInfo & pi, int x, int y) const;
-       ///
-       bool showInsetDialog(BufferView *) 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(Cursor & cur, FuncRequest & cmd);
-       ///
-       bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
+       static std::string params2string(CollapseStatus);
+
+       std::string contextMenuName() const override
+               { return "context-ert"; }
 private:
-       virtual std::auto_ptr<InsetBase> doClone() const;
        ///
-       void init();
+       InsetCode lyxCode() const override { return ERT_CODE; }
        ///
-       void setButtonLabel();
+       docstring layoutName() const override { return from_ascii("ERT"); }
        ///
-       bool allowSpellCheck() const { return false; }
-};
-
-
-class InsetERTMailer : public MailInset {
-public:
+       void write(std::ostream & os) const override;
        ///
-       InsetERTMailer(InsetERT & inset);
+       int plaintext(odocstringstream & ods, OutputParams const & op,
+                     size_t max_length = INT_MAX) const override;
        ///
-       virtual InsetBase & inset() const { return inset_; }
+       void docbook(XMLStream &, OutputParams const &) const override;
        ///
-       virtual std::string const & name() const { return name_; }
+       docstring xhtml(XMLStream &, OutputParams const &) const override;
        ///
-       virtual std::string const inset2string(Buffer const &) const;
+       void validate(LaTeXFeatures &) const override {}
+       /// should paragraph indentation be omitted in any case?
+       bool neverIndent() const override { return true; }
        ///
-       static void string2params(std::string const &,
-               InsetCollapsable::CollapseStatus &);
+       void doDispatch(Cursor & cur, FuncRequest & cmd) override;
        ///
-       static std::string const params2string(InsetCollapsable::CollapseStatus);
-private:
+       bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const override;
+       ///
+       Inset * clone() const override { return new InsetERT(*this); }
+       ///
+       docstring const buttonLabel(BufferView const & bv) const override;
        ///
-       static std::string const name_;
+       bool allowSpellCheck() const override { return false; }
        ///
-       InsetERT & inset_;
+       bool insetAllowed(InsetCode code) const override { return code == QUOTE_CODE; }
 };