]> git.lyx.org Git - lyx.git/blobdiff - src/Paragraph.h
Help avoiding shortcut clashes by discriminating strings.
[lyx.git] / src / Paragraph.h
index 526529fbf38631af277c53e7f0379dffd609ca93..9ab52ed01b0f0f8b8b77fd47483224c69d8b31ed 100644 (file)
@@ -55,6 +55,7 @@ class TexRow;
 class Toc;
 class WordLangTuple;
 class XHTMLStream;
+class otexstream;
 
 class FontSpan {
 public:
@@ -82,6 +83,10 @@ public:
                return first <= p && p <= last;
        }
 
+       inline bool empty() const
+       {
+               return first > last;
+       }
 };
 
 ///
@@ -102,8 +107,7 @@ enum AsStringParameter
        AS_STR_LABEL = 1, ///< Prefix with paragraph label.
        AS_STR_INSETS = 2, ///< Go into insets.
        AS_STR_NEWLINES = 4, ///< Get also newline characters.
-       AS_STR_SKIPDELETE = 8, ///< Skip deleted text in change tracking.
-       AS_STR_INTOC = 16 ///< Skip insets that are not supposed to go into the TOC
+       AS_STR_SKIPDELETE = 8 ///< Skip deleted text in change tracking.
 };
 
 
@@ -151,6 +155,8 @@ public:
        ///
        docstring asString(pos_type beg, pos_type end,
                int options = AS_STR_NONE) const;
+       ///
+       void forToc(docstring &, size_t maxlen) const;
 
        /// Extract only the explicitly visible text (without any formatting),
        /// descending into insets
@@ -163,7 +169,7 @@ public:
        void validate(LaTeXFeatures &) const;
 
        /// \param force means: output even if layout.inpreamble is true.
-       void latex(BufferParams const &, Font const & outerfont, odocstream &,
+       void latex(BufferParams const &, Font const & outerfont, otexstream &,
                   TexRow & texrow, OutputParams const &,
                   int start_pos = 0, int end_pos = -1, bool force = false) const;
 
@@ -208,6 +214,8 @@ public:
        ///
        bool usePlainLayout() const;
        ///
+       bool isPassThru() const;
+       ///
        pos_type size() const;
        ///
        bool empty() const;
@@ -448,8 +456,15 @@ public:
                bool check_learned = false) const;
 
        /// Spell checker status at position \p pos.
-       /// \return true if pointed position is misspelled.
-       bool isMisspelled(pos_type pos) const;
+       /// If \p check_boundary is true the status of position immediately
+       /// before \p pos is tested too if it is at word boundary.
+       /// \return true if one of the tested positions is misspelled.
+       bool isMisspelled(pos_type pos, bool check_boundary = false) const;
+
+       /// \return true if both positions are inside the same
+       /// spell range - i.e. the same word.
+       /// use it for positions inside misspelled range only.
+       bool isSameSpellRange(pos_type pos1, pos_type pos2) const;
 
        /// spell check of whole paragraph
        /// remember results until call of requestSpellCheck()