]> git.lyx.org Git - lyx.git/blobdiff - src/Encoding.h
fix a visual cursor edge-case:
[lyx.git] / src / Encoding.h
index 99afe269e5b7f7e22416f1967ae310fd3d934fb4..c78972a1c8b71e0a341f0e9e4a57cce9ec2ec633 100644 (file)
@@ -14,6 +14,7 @@
 #define ENCODING_H
 
 #include "support/docstring.h"
+#include "support/types.h"
 
 #include <map>
 #include <set>
@@ -24,6 +25,17 @@ namespace support { class FileName; }
 
 class LaTeXFeatures;
 
+class EncodingException : public std::exception {
+public:
+       EncodingException(char_type c);
+       virtual ~EncodingException() throw() {}
+       virtual const char * what() const throw();
+       char_type failed_char;
+       int par_id;
+       pos_type pos;
+};
+
 
 ///
 class Encoding {
@@ -58,6 +70,8 @@ public:
        docstring const latexChar(char_type c) const;
        /// Which LaTeX package handles this encoding?
        Package package() const { return package_; }
+       /// A list of all characters usable in this encoding
+       std::set<char_type> getSymbolsList() const;
 private:
        ///
        std::string Name_;
@@ -145,12 +159,12 @@ public:
        /**
         * Is this a known char from some language?
         * If \p preamble is empty and code point \p c is known to belong
-        * to a supported language, true is returned and \p preamble is set
+        * to a supported script, true is returned and \p preamble is set
         * to the corresponding entry in the unicodesymbols file.
         * If \p preamble is not empty, a check is made whether code point
         * \p c is a known character matching the preamble entry.
         */
-       static bool isKnownLangChar(char_type c, std::string & preamble);
+       static bool isKnownScriptChar(char_type const c, std::string & preamble);
        /**
         * Add the preamble snippet needed for the output of \p c to
         * \p features.