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"
19 #include <QPushButton>
24 class QListWidgetItem;
35 class GuiCommandBuffer : public QWidget
40 GuiCommandBuffer(GuiView * view);
43 /// dispatch a command
49 /// called when an item in a list is selected
50 void itemSelected(QListWidgetItem *);
55 /// leave and hide the command buffer
61 GuiCommandEdit * edit_;
63 /// return the previous history entry if any
64 std::string const historyUp();
65 /// return the next history entry if any
66 std::string const historyDown();
68 /// return the font and depth in the active BufferView as a message.
69 docstring const getCurrentState() const;
71 /// open a listbox and show the contents of the list. When reversed
72 /// is true, the contents of the list is filled bottom-up.
73 void showList(std::vector<std::string> const & list,
74 QPoint const & pos, bool reversed = false) const;
76 /// return the possible completions
77 std::vector<std::string> const completions(std::string const & prefix,
78 std::string & new_prefix);
80 /// dispatch a command
81 DispatchResult const & dispatch(std::string const & str);
83 /// available command names
84 std::vector<std::string> commands_;
87 std::vector<std::string> history_;
89 /// current position in command history
90 std::vector<std::string>::const_iterator history_pos_;
99 } // namespace frontend
102 #endif // GUICOMMANDBUFFER_H