]> git.lyx.org Git - lyx.git/blobdiff - src/kbmap.h
Fix working of the spellchecker dialog with ispell when there are no
[lyx.git] / src / kbmap.h
index 4cd1b0845ba3f40f400620db8703077aed50c8c5..3a0ae1e70c63b648480908209d7ef569fc0cccd5 100644 (file)
@@ -14,7 +14,7 @@
 #endif
 
 #include <list>
-using std::list;
+#include <boost/smart_ptr.hpp>
 
 #include "LString.h"
 
@@ -23,13 +23,10 @@ class kb_sequence;
 /// Defines key maps and actions for key sequences
 class kb_keymap {
 public:
-       ///
-       ~kb_keymap();
-       
        /** Bind a key-sequence to an action.
            Returns 0 on success. Otherwise, position in string where
            error occured. */
-       int bind(char const * seq, int action);
+       int bind(string const & seq, int action);
 
        ///
        void print(string & buf) const;
@@ -39,7 +36,8 @@ public:
                   unsigned int mod, kb_sequence * seq) const;
 
        /// Given an action, find all keybindings.
-       string findbinding(int action) const;
+       string const findbinding(int action,
+                                string const & prefix = string()) const;
 private:
        ///
        struct kb_key {
@@ -50,7 +48,7 @@ private:
                unsigned int mod;
                
                /// Keymap for prefix keys
-               kb_keymap * table;
+               boost::shared_ptr<kb_keymap> table;
                
                /// Action for !prefix keys
                int action;
@@ -60,7 +58,7 @@ private:
        /// Define a new key sequence
        int defkey(kb_sequence * seq, int action, int idx = 0);
        ///
-       static string keyname(kb_key const & k);
+       static string const keyname(kb_key const & k);
        
        ///
        static
@@ -70,7 +68,7 @@ private:
                return table.empty();
        }
        ///
-       typedef list<kb_key> Table;
+       typedef std::list<kb_key> Table;
        ///
        Table table;
 };