]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/ControlCommandBuffer.h
fix crash due to invalidated iterator
[lyx.git] / src / frontends / controllers / ControlCommandBuffer.h
index 8cd968aa9d969d047d45202c16c4fa24b0dc6f13..0beb3a10e87940e197a1940082d3e1c021cc1301 100644 (file)
@@ -1,61 +1,68 @@
 // -*- C++ -*-
 /**
  * \file ControlCommandBuffer.h
- * Copyright 1995-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 Lars
- * \author Asger and Juergen
- * \author John Levon <levon@movementarian.org>
+ * \author Asger and Jürgen
+ * \author John Levon
+ *
+ * Full author contact details are available in file CREDITS.
  */
 
 #ifndef CONTROLCOMMANDBUFFER_H
 #define CONTROLCOMMANDBUFFER_H
 
-#include "LString.h"
-
+#include <string>
 #include <vector>
 
-#ifdef __GNUG__
-#pragma interface
-#endif
 
-class LyXFunc;
+class LyXView;
+
+namespace lyx {
+namespace frontend {
 
 /**
  * ControlCommandBuffer
  *
  * This provides methods for the use of a toolkit's
- * minibuffer/command buffer 
+ * minibuffer/command buffer
  */
 class ControlCommandBuffer {
 public:
-       ControlCommandBuffer(LyXFunc & lf);
-       
+       ControlCommandBuffer(LyXView & lv);
+
        /// return the previous history entry if any
-       string const historyUp();
+       std::string const historyUp();
 
        /// return the next history entry if any
-       string const historyDown();
+       std::string const historyDown();
+
+       /// return the font and depth in the active BufferView as a message.
+       std::string const getCurrentState() const;
 
        /// return the possible completions
-       std::vector<string> const completions(string const & prefix, string & new_prefix);
+       std::vector<std::string> const completions(std::string const & prefix,
+                                             std::string & new_prefix);
+
        /// dispatch a command
-       void dispatch(string const & str);
+       void dispatch(std::string const & str);
 private:
-       /// controlling lyxfunc
-       LyXFunc & lyxfunc_;
-       
+       /// controlling LyXView
+       LyXView & lv_;
+
        /// available command names
-       std::vector<string> commands_;
+       std::vector<std::string> commands_;
+
        /// command history
-       std::vector<string> history_;
+       std::vector<std::string> history_;
 
        /// current position in command history
-       std::vector<string>::const_iterator history_pos_;
+       std::vector<std::string>::const_iterator history_pos_;
 };
+
+} // namespace frontend
+} // namespace lyx
+
 #endif // CONTROLCOMMANDBUFFER_H