]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/LyXKeySym.h
enable Font cache only for MacOSX and inline width() for other platform.
[lyx.git] / src / frontends / LyXKeySym.h
index b027b07f387b2f4ce9676b50db776b05d15601b4..4bad77316c861d4f34d7f2a2c2c86c2ca33cba30 100644 (file)
 
 #include <string>
 
+#include "key_state.h"
+
+#include <boost/shared_ptr.hpp>
+
 /**
  * This is a base class for representing a keypress.
  * Each frontend has to implement this to provide
@@ -36,17 +40,22 @@ public:
        virtual bool isModifier() const = 0;
 
        /// Is this normal insertable text ? (last ditch attempt only)
-       virtual bool isText() const { return false; }
+       virtual bool isText() const = 0;
 
        /// What is the symbolic name of this key? F.ex. "Return" or "c"
        virtual std::string getSymbolName() const = 0;
 
        /**
-        * Return the value of the keysym into the local ISO encoding.
-        * This converts the LyXKeySym to a 8-bit encoded character.
-        * This relies on user to use the right encoding.
+        * Return the value of the keysym into the UCS-4 encoding.
+        * This converts the LyXKeySym to a 32-bit encoded character.
+        */
+       virtual size_t getUCSEncoded() const = 0;
+
+       /**
+        * Return a string describing the KeySym with modifier mod.
+        * This should use the native UI format when applicable
         */
-       virtual char getISOEncoded(std::string const & encoding) const = 0;
+       virtual std::string const print(key_modifier::state mod) const = 0;
 };
 
 
@@ -56,4 +65,6 @@ public:
  */
 bool operator==(LyXKeySym const & k1, LyXKeySym const & k2);
 
+typedef boost::shared_ptr<LyXKeySym> LyXKeySymPtr;
+
 #endif