]> git.lyx.org Git - lyx.git/blobdiff - src/kbmap.h
add config.h
[lyx.git] / src / kbmap.h
index bde8793a20c8ab124a9ca1b336b8ef9d8e918dec..2ffe6885f15c2c452fb40a0f1b7a0364e4fcaa57 100644 (file)
 #include "funcrequest.h"
 
 #include "frontends/key_state.h"
+#include "frontends/LyXKeySym.h"
+
+#include "support/docstream.h"
 
 #include <boost/shared_ptr.hpp>
 
 #include <vector>
 #include <deque>
 
+
+namespace lyx {
+
 class kb_sequence;
-class LyXKeySym;
 
 /// Defines key maps and actions for key sequences
 class kb_keymap {
@@ -40,17 +45,19 @@ public:
        // Parse a bind file
        bool read(std::string const & bind_file);
 
-       /// print all available keysyms
-       std::string const print() const;
+       /**
+        * print all available keysyms
+        * @param forgui true if the string should use translations and 
+        *   special characters. 
+        */
+       docstring const print(bool forgui) const;
 
-       ///
-       typedef boost::shared_ptr<LyXKeySym> LyXKeySymPtr;
        /**
         * Look up a key press in the keymap.
         * @param key the keysym
         * @param mod the modifiers
         * @param seq the current key sequence so far
-        * @return the action / LFUN_PREFIX / LFUN_UNKNOWN_ACTION
+        * @return the action / LFUN_COMMAND_PREFIX / LFUN_UNKNOWN_ACTION
         */
        FuncRequest const &
        lookup(LyXKeySymPtr key,
@@ -63,7 +70,7 @@ public:
        Bindings findbindings(FuncRequest const & func) const;
 
        /// Given an action, print the keybindings.
-       std::string const printbindings(FuncRequest const & func) const;
+       docstring const printbindings(FuncRequest const & func) const;
 
        /**
         *  Given an action, find the first 1-key binding (if it exists).
@@ -107,9 +114,6 @@ private:
        void defkey(kb_sequence * seq, FuncRequest const & func,
                    unsigned int r = 0);
 
-       ///  Returns a string of the given key
-       std::string const printKey(kb_key const & key) const;
-
        /**
         * Given an action, find all keybindings
         * @param func the action
@@ -128,4 +132,10 @@ private:
        Table table;
 };
 
+/// Implementation is in lyx_main.C
+extern kb_keymap & theTopLevelKeymap();
+
+
+} // namespace lyx
+
 #endif // KBMAP_H