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;
31 class GuiCommandBuffer : public QWidget
36 GuiCommandBuffer(GuiView * view);
39 /// cancel command compose
41 /// dispatch a command
46 void complete_selected(QListWidgetItem *);
51 /// leave and hide the command buffer
57 GuiCommandEdit * edit_;
59 /// return the previous history entry if any
60 std::string const historyUp();
61 /// return the next history entry if any
62 std::string const historyDown();
64 /// return the font and depth in the active BufferView as a message.
65 docstring const getCurrentState() const;
67 /// hide the command buffer.
70 /// return the possible completions
71 std::vector<std::string> const completions(std::string const & prefix,
72 std::string & new_prefix);
74 /// dispatch a command
75 void dispatch(std::string const & str);
77 /// available command names
78 std::vector<std::string> commands_;
81 std::vector<std::string> history_;
83 /// current position in command history
84 std::vector<std::string>::const_iterator history_pos_;
87 } // namespace frontend
90 #endif // GUICOMMANDBUFFER_H