]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/LyXKeySym.h
hopefully fix tex2lyx linking.
[lyx.git] / src / frontends / LyXKeySym.h
index bee3702ac2efbde52fcbe75161ab355cdad6cfb9..4e1eb406d8e311884c46d66f2eec672e74c9e805 100644 (file)
@@ -1,18 +1,26 @@
 // -*- C++ -*-
 /**
  * \file LyXKeySym.h
- * Copyright 2002 the LyX Team
- * Read the file COPYING
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- * \author Asger and Juergen
+ * \author Asger and Jürgen
+ *
+ * Full author contact details are available in file CREDITS.
  */
 
 #ifndef LYXKEYSYM_H
 #define LYXKEYSYM_H
 
-#include "LString.h"
+#include <string>
+
+#include "key_state.h"
+
 #include <boost/shared_ptr.hpp>
 
+
+namespace lyx {
+
 /**
  * This is a base class for representing a keypress.
  * Each frontend has to implement this to provide
@@ -26,7 +34,7 @@ public:
        virtual ~LyXKeySym() {}
 
        /// Initialize with the name of a key. F. ex. "space" or "a"
-       virtual void init(string const & symbolname) = 0;
+       virtual void init(std::string const & symbolname) = 0;
 
        /// Is this a valid key?
        virtual bool isOK() const = 0;
@@ -34,23 +42,35 @@ public:
        /// Is this a modifier key only?
        virtual bool isModifier() const = 0;
 
+       /// Is this normal insertable text ? (last ditch attempt only)
+       virtual bool isText() const = 0;
+
        /// What is the symbolic name of this key? F.ex. "Return" or "c"
-       virtual string getSymbolName() const = 0;
+       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 char getISOEncoded() const = 0;
+       virtual size_t getUCSEncoded() const = 0;
 
        /**
-        * We need to be able to equality compare these for the
-        * sake of the keymap business.
+        * Return a string describing the KeySym with modifier mod.
+        * This should use the native UI format when applicable
         */
-       virtual bool operator==(LyXKeySym const & k) const = 0;
+       virtual std::string const print(key_modifier::state mod) const = 0;
 };
 
+
+/**
+ * We need to be able to equality compare these for the
+ * sake of the keymap business.
+ */
+bool operator==(LyXKeySym const & k1, LyXKeySym const & k2);
+
 typedef boost::shared_ptr<LyXKeySym> LyXKeySymPtr;
 
+
+} // namespace lyx
+
 #endif