3 * \file GuiCommandBuffer.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
8 * \author Asger and Jürgen
11 * Full author contact details are available in file CREDITS.
14 #ifndef GUICOMMANDBUFFER_H
15 #define GUICOMMANDBUFFER_H
17 #include "support/docstring.h"
23 class QListWidgetItem;
32 class GuiCommandBuffer : public QWidget
37 GuiCommandBuffer(GuiViewBase * view);
40 /// cancel command compose
42 /// dispatch a command
47 void complete_selected(QListWidgetItem *);
52 /// leave and hide the command buffer
60 GuiCommandEdit * edit_;
62 /// return the previous history entry if any
63 std::string const historyUp();
64 /// return the next history entry if any
65 std::string const historyDown();
67 /// return the font and depth in the active BufferView as a message.
68 docstring const getCurrentState() const;
70 /// hide the command buffer.
73 /// return the possible completions
74 std::vector<std::string> const completions(std::string const & prefix,
75 std::string & new_prefix);
77 /// dispatch a command
78 void dispatch(std::string const & str);
80 /// available command names
81 std::vector<std::string> commands_;
84 std::vector<std::string> history_;
86 /// current position in command history
87 std::vector<std::string>::const_iterator history_pos_;
90 } // namespace frontend
93 #endif // GUICOMMANDBUFFER_H