]> git.lyx.org Git - lyx.git/blobdiff - src/kbsequence.h
Continue to improve GtkLengthEntry
[lyx.git] / src / kbsequence.h
index 9aab03675caa6fa471075a308d92f6cdef783e82..3d894a1ec31c54d1fe602cb7db77656a7d757095 100644 (file)
@@ -1,29 +1,33 @@
 // -*- C++ -*-
 /**
  * \file kbsequence.h
- * Copyright 2001 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 Lars Gullik Bjønnes
+ * \author Jean-Marc Lasgouttes
+ *
+ * Full author contact details are available in file CREDITS.
  */
 
 #ifndef KBSEQUENCE_H
 #define KBSEQUENCE_H
 
-#ifdef __GNUG__
-#pragma interface
-#endif
+#include "frontends/key_state.h"
 
-#include <config.h>
+#include <boost/shared_ptr.hpp>
 
-#include "frontends/key_state.h"
-#include "frontends/LyXKeySym.h"
-#include "LString.h"
+#include <string>
 #include <vector>
 
 class kb_keymap;
+class LyXKeySym;
+class FuncRequest;
 
 /// Holds a key sequence and the current and standard keymaps
 class kb_sequence {
 public:
+       typedef boost::shared_ptr<LyXKeySym> LyXKeySymPtr;
        typedef std::vector<LyXKeySymPtr> KeySequence;
 
        friend class kb_keymap;
@@ -40,8 +44,9 @@ public:
         * @param nmod which modifiers to mask out for equality test
         * @return the action matching this key sequence or LFUN_UNKNOWN_ACTION
         */
-       int addkey(LyXKeySymPtr keysym, key_modifier::state mod,
-                  key_modifier::state nmod = key_modifier::none);
+       FuncRequest const &
+       addkey(LyXKeySymPtr keysym, key_modifier::state mod,
+              key_modifier::state nmod = key_modifier::none);
 
        /**
         * Add a sequence of keys from a string to the sequence
@@ -54,30 +59,23 @@ public:
         * Prefixes can also be ignored by using the Tilde "~"
         * f.ex.: "~S-Space".
         */
-       string::size_type parse(string const & s);
+       std::string::size_type parse(std::string const & s);
 
        /**
         * Return the current sequence as a string.
         * @see parse()
         */
-       string const print() const;
+       std::string const print() const;
 
        /**
         * Return the current sequence and available options as
         * a string. No options are added if no curmap kb map exists.
         */
-       string const printOptions() const;
+       std::string const printOptions() const;
 
        /// Mark the sequence as deleted.
        void mark_deleted();
 
-       /**
-        * Return the value of the last keysym in the sequence
-        * in the local ISO encoding. If it does not encode
-        * in this encoding, return 0.
-        */
-       char getLastKeyEncoded() const;
-
        /// Reset sequence to become "deleted"
        void reset();
 
@@ -100,9 +98,6 @@ public:
        kb_keymap * curmap;
 
 private:
-       /// get the keysym of last in sequence
-       LyXKeySymPtr getsym() const;
-
        /**
         * Array holding the current key sequence as KeySyms.
         * If sequence[length - 1] < 0xff it can be used as ISO8859 char