]> git.lyx.org Git - lyx.git/blobdiff - src/Paragraph.h
Compile fix.
[lyx.git] / src / Paragraph.h
index 35c149fbc1cca91b663525cb43c1c08ba34864af..2c2e77246fc1c951d03da27171da2be5bad06b94 100644 (file)
 #define PARAGRAPH_H
 
 #include "FontEnums.h"
-//#include "Layout.h"
+#include "SpellChecker.h"
 
 #include "insets/InsetCode.h"
 
 #include "support/strfwd.h"
 #include "support/types.h"
 
+#include <set>
+
 namespace lyx {
 
 class AuthorList;
@@ -64,6 +66,22 @@ public:
 public:
        /// Range including first and last.
        pos_type first, last;
+
+       inline bool operator<(FontSpan const & s) const
+       {
+               return first < s.first;
+       }
+       
+       inline bool operator==(FontSpan const & s) const
+       {
+               return first == s.first && last == s.last;
+       }
+       
+       inline bool inside(pos_type p) const
+       {
+               return first <= p && p <= last;
+       }
+
 };
 
 ///
@@ -83,7 +101,8 @@ enum AsStringParameter
        AS_STR_NONE = 0, ///< No option, only printable characters.
        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_NEWLINES = 4, ///< Get also newline characters.
+       AS_STR_SKIPDELETE = 8 ///< Skip deleted text in change tracking.
 };
 
 
@@ -118,6 +137,8 @@ public:
                            Language const * from, Language const * to);
        ///
        bool isMultiLingual(BufferParams const &) const;
+       ///
+       void getLanguages(std::set<Language const *> &) const;
 
        /// Convert the paragraph to a string.
        /// \param AsStringParameter options. This can contain any combination of
@@ -140,10 +161,10 @@ public:
        ///
        void validate(LaTeXFeatures &) const;
 
-       ///
-       bool latex(BufferParams const &, Font const & outerfont, odocstream &,
+       /// \param force means: output even if layout.inpreamble is true.
+       void latex(BufferParams const &, Font const & outerfont, odocstream &,
                   TexRow & texrow, OutputParams const &,
-                  int start_pos = 0, int end_pos = -1) const;
+                  int start_pos = 0, int end_pos = -1, bool force = false) const;
 
        /// Can we drop the standard paragraph wrapper?
        bool emptyTag() const;
@@ -419,13 +440,25 @@ public:
 
        /// Spellcheck word at position \p from and fill in found misspelled word
        /// and \p suggestions if \p do_suggestion is true.
-       /// \return true if pointed word is misspelled.
-       bool spellCheck(pos_type & from, pos_type & to, WordLangTuple & wl,
-               docstring_list & suggestions, bool do_suggestion =  true) const;
+       /// \return result from spell checker, SpellChecker::UNKNOWN_WORD when misspelled.
+       SpellChecker::Result spellCheck(pos_type & from, pos_type & to, WordLangTuple & wl,
+               docstring_list & suggestions, bool do_suggestion =  true,
+               bool check_learned = false) const;
 
-       /// Spellcheck word at position \p pos.
-       /// \return true if pointed word is misspelled.
+       /// Spell checker status at position \p pos.
+       /// \return true if pointed position is misspelled.
        bool isMisspelled(pos_type pos) const;
+
+       /// spell check of whole paragraph
+       /// remember results until call of requestSpellCheck()
+       void spellCheck() const;
+
+       /// query state of spell checker results
+       bool needsSpellCheck() const;
+       /// mark position of text manipulation to inform the spell checker
+       /// default value -1 marks the whole paragraph to be checked (again)
+       void requestSpellCheck(pos_type pos = -1);
+
        /// an automatically generated identifying label for this paragraph.
        /// presently used only in the XHTML output routines.
        std::string magicLabel() const;