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 /// open a listbox and show the contents of the list. When reversed
69 /// is true, the contents of the list is filled bottom-up.
70 void showList(std::vector<std::string> const & list,
71 QPoint const & pos, bool reversed = false) const;
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 DispatchResult const & dispatch(std::string const & str);
80 /// current position in command history
81 std::vector<std::string>::const_iterator history_pos_;
90 } // namespace frontend
93 #endif // GUICOMMANDBUFFER_H