]> git.lyx.org Git - lyx.git/blobdiff - src/Paragraph.h
LogUi.ui: string redundancy.
[lyx.git] / src / Paragraph.h
index 9d7e5f1d4c86063c990994a60f3c2c87302bdbd1..dec527cbc85590ec8963ad4d5b11057e514d81a7 100644 (file)
@@ -5,10 +5,10 @@
  * Licence details can be found in the file COPYING.
  *
  * \author Asger Alstrup
- * \author Lars Gullik Bjønnes
+ * \author Lars Gullik Bjønnes
  * \author John Levon
- * \author André Pönitz
- * \author Jürgen Vigna
+ * \author André Pönitz
+ * \author Jürgen Vigna
  *
  * Full author contact details are available in file CREDITS.
  */
@@ -34,6 +34,7 @@ class Counters;
 class Cursor;
 class CursorSlice;
 class DocIterator;
+class docstring_list;
 class DocumentClass;
 class Inset;
 class InsetBibitem;
@@ -49,6 +50,7 @@ class PainterInfo;
 class ParagraphParameters;
 class TexRow;
 class Toc;
+class WordLangTuple;
 
 class FontSpan {
 public:
@@ -124,6 +126,10 @@ public:
        docstring asString(pos_type beg, pos_type end,
                int options = AS_STR_NONE) const;
 
+       /// Extract only the explicitly visible text (without any formatting),
+       /// descending into insets
+       docstring stringify(pos_type beg, pos_type end, int options, OutputParams & runparams) const;
+
        ///
        void write(std::ostream &, BufferParams const &,
                   depth_type & depth) const;
@@ -132,7 +138,8 @@ public:
 
        ///
        bool latex(BufferParams const &, Font const & outerfont, odocstream &,
-               TexRow & texrow, OutputParams const &) const;
+                  TexRow & texrow, OutputParams const &,
+                  int start_pos = 0, int end_pos = -1) const;
 
        /// Can we drop the standard paragraph wrapper?
        bool emptyTag() const;
@@ -140,8 +147,11 @@ public:
        /// Get the id of the paragraph, usefull for docbook
        std::string getID(Buffer const & buf, OutputParams const & runparams) const;
 
-       /// Get the first word of a paragraph, return the position where it left
-       pos_type firstWord(odocstream & os, OutputParams const & runparams) const;
+       /// Output the first word of a paragraph, return the position where it left.
+       pos_type firstWordDocBook(odocstream & os, OutputParams const & runparams) const;
+
+       /// Output the first word of a paragraph, return the position where it left.
+       pos_type firstWordLyXHTML(odocstream & os, OutputParams const & runparams) const;
 
        /// Writes to stream the docbook representation
        void simpleDocBookOnePar(Buffer const & buf,
@@ -149,6 +159,13 @@ public:
                                 OutputParams const & runparams,
                                 Font const & outerfont,
                                 pos_type initial = 0) const;
+       /// \return any material that has had to be deferred until after the
+       /// paragraph has closed.
+       docstring simpleLyXHTMLOnePar(Buffer const & buf,
+                                odocstream &,
+                                OutputParams const & runparams,
+                                Font const & outerfont,
+                                pos_type initial = 0) const;
 
        ///
        bool hasSameLayout(Paragraph const & par) const;
@@ -179,6 +196,10 @@ public:
        void setLayout(Layout const & layout);
        ///
        void setPlainOrDefaultLayout(DocumentClass const & tc);
+       ///
+       void setDefaultLayout(DocumentClass const & tc);
+       ///
+       void setPlainLayout(DocumentClass const & tc);
 
        /// This is the item depth, only used by enumerate and itemize
        signed char itemdepth;
@@ -194,6 +215,8 @@ public:
        bool isInserted(pos_type pos) const;
        /// is there a deletion at the given pos ?
        bool isDeleted(pos_type pos) const;
+       /// is the whole paragraph deleted ?
+       bool isFullyDeleted(pos_type start, pos_type end) const;
 
        /// will the paragraph be physically merged with the next
        /// one if the imaginary end-of-par character is logically deleted?
@@ -341,9 +364,9 @@ public:
        bool isSeparator(pos_type pos) const;
        ///
        bool isLineSeparator(pos_type pos) const;
-       /// True if the character/inset at this point can be part of a word.
-       /// Note that digits in particular are considered as letters
-       bool isLetter(pos_type pos) const;
+       /// True if the character/inset at this point is a word separator.
+       /// Note that digits in particular are not considered as word separator.
+       bool isWordSeparator(pos_type pos) const;
        /// True if the element at this point is a character that is not a letter.
        bool isChar(pos_type pos) const;
        /// True if the element at this point is a space
@@ -392,14 +415,25 @@ public:
                pos_type pos, ///< start from here.
                bool del = true) const;
        
+       void locateWord(pos_type & from, pos_type & to,
+               word_location const loc) const;
        ///
-       void updateWords(CursorSlice const & sl);
+       void updateWords();
+
+       /// Spellcheck word at position \p from and fill in found misspelled word.
+       /// \return true if pointed word is misspelled.
+       bool spellCheck(pos_type & from, pos_type & to, WordLangTuple & wl,
+               docstring_list & suggestions) const;
+
+       /// Spellcheck word at position \p pos.
+       /// \return true if pointed word is misspelled.
+       bool isMisspelled(pos_type pos) const;
 
 private:
        ///
        void deregisterWords();
        ///
-       void collectWords(CursorSlice const & sl);
+       void collectWords();
        ///
        void registerWords();