]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetText.h
HTML output code for a handful of easy insets.
[lyx.git] / src / insets / InsetText.h
index eb57b63cfae6d9dbcd76ca0460f3a659311ca81f..6f509ada4572c470fad3b69b39a9b0c51ae8c640 100644 (file)
@@ -4,7 +4,7 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author Jürgen Vigna
+ * \author Jürgen Vigna
  *
  * Full author contact details are available in file CREDITS.
  */
@@ -22,6 +22,7 @@ namespace lyx {
 class Buffer;
 class BufferParams;
 class BufferView;
+class CompletionList;
 class CursorSlice;
 class Dimension;
 class ParagraphList;
@@ -33,14 +34,19 @@ class InsetTabular;
  */
 class InsetText : public Inset {
 public:
-       ///
-       explicit InsetText(Buffer const & buffer);
-       ///
-       InsetText();
+       enum UsePlain {
+               DefaultLayout,
+               PlainLayout
+       };
+       /// \param buffer
+       /// \param useplain whether to use the plain layout
+       /// This is needed because we cannot call the virtual function
+       /// usePlainLayout() from within the constructor.
+       explicit InsetText(Buffer const & buffer, UsePlain type = DefaultLayout);
        ///
        InsetText(InsetText const &);
        ///
-       void initParagraphs(Buffer const & buffer);
+       void setBuffer(Buffer &);
 
        ///
        Dimension const dimension(BufferView const &) const;
@@ -58,7 +64,7 @@ public:
        ///
        docstring editMessage() const;
        ///
-       EDITABLE editable() const { return HIGHLY_EDITABLE; }
+       bool editable() const { return true; }
        ///
        bool canTrackChanges() const { return true; }
        ///
@@ -66,12 +72,17 @@ public:
        ///
        InsetText const * asInsetText() const { return this; }
        ///
+       Text & text() { return text_; }
+       Text const & text() const { return text_; }
+       ///
        int latex(odocstream &, OutputParams const &) const;
        ///
        int plaintext(odocstream &, OutputParams const &) const;
        ///
        int docbook(odocstream &, OutputParams const &) const;
        ///
+       int xhtml(odocstream &, OutputParams const &) const;
+       ///
        void validate(LaTeXFeatures & features) const;
 
        /// return x,y of given position relative to the inset's baseline
@@ -129,10 +140,6 @@ public:
        ///
        bool allowSpellCheck() const { return true; }
        ///
-       bool isTableCell() const;
-       /// should paragraph indendation be ommitted in any case?
-       bool neverIndent() const;
-       ///
        virtual bool isMacroScope() const { return false; }
        ///
        virtual bool allowMultiPar() const { return true; }
@@ -140,6 +147,8 @@ public:
        // Update the counters of this inset and of its contents
        void updateLabels(ParIterator const &);
        ///
+       void addToToc(DocIterator const &);
+       ///
        Inset * clone() const { return new InsetText(*this); }
        ///
        bool notifyCursorLeaves(Cursor const & old, Cursor & cur);
@@ -153,6 +162,8 @@ public:
        ///
        bool automaticPopupCompletion() const;
        ///
+       bool showCompletionCursor() const;
+       ///
        CompletionList const * createCompletionList(Cursor const & cur) const;
        ///
        docstring completionPrefix(Cursor const & cur) const;
@@ -166,6 +177,8 @@ public:
        ///
        void doDispatch(Cursor & cur, FuncRequest & cmd);
 private:
+       ///
+       void initParagraphs(UsePlain type);
        ///
        void setParagraphOwner();
        ///
@@ -174,10 +187,6 @@ private:
        ColorCode frame_color_;
        ///
        mutable pit_type old_pit;
-       ///
-       docstring previousWord(CursorSlice const & sl) const;
-
-public:
        ///
        mutable Text text_;
 };