X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiCommandBuffer.h;h=07370875f31cea00c653f266247bae721cb49a2e;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=370c937b9f80e3fd3cdb9be2e7450d3a5518460e;hpb=a1cec91afaca91968b46e695533c10ad2a3f73d3;p=lyx.git diff --git a/src/frontends/qt4/GuiCommandBuffer.h b/src/frontends/qt4/GuiCommandBuffer.h index 370c937b9f..07370875f3 100644 --- a/src/frontends/qt4/GuiCommandBuffer.h +++ b/src/frontends/qt4/GuiCommandBuffer.h @@ -4,30 +4,37 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * + * \author Lars + * \author Asger and Jürgen * \author John Levon * * Full author contact details are available in file CREDITS. */ -#ifndef QCOMMANDBUFFER_H -#define QCOMMANDBUFFER_H +#ifndef GUICOMMANDBUFFER_H +#define GUICOMMANDBUFFER_H -#include "controllers/ControlCommandBuffer.h" +#include "support/docstring.h" +#include #include +#include + class QListWidgetItem; namespace lyx { namespace frontend { -class GuiCommandEdit; class GuiView; +class GuiCommandEdit; -class GuiCommandBuffer : public QWidget { +class GuiCommandBuffer : public QWidget +{ Q_OBJECT + public: - GuiCommandBuffer(GuiViewBase * view); + GuiCommandBuffer(GuiView * view); public Q_SLOTS: /// cancel command compose @@ -36,8 +43,10 @@ public Q_SLOTS: void dispatch(); /// tab-complete void complete(); - /// select-complete - void complete_selected(QListWidgetItem *); + /// show history + void listHistoryUp(); + /// called when an item in a list is selected + void itemSelected(QListWidgetItem *); /// up void up(); /// down @@ -46,16 +55,50 @@ public Q_SLOTS: void hideParent(); private: /// owning view - GuiViewBase * view_; - - /// controller - ControlCommandBuffer controller_; - + GuiView * view_; /// command widget GuiCommandEdit * edit_; + + /// return the previous history entry if any + std::string const historyUp(); + /// return the next history entry if any + std::string const historyDown(); + + /// return the font and depth in the active BufferView as a message. + docstring const getCurrentState() const; + + /// hide the command buffer. + void hide() const; + + /// open a listbox and show the contents of the list. When reversed + /// is true, the contents of the list is filled bottom-up. + void showList(std::vector const & list, + QPoint const & pos, bool reversed = false) const; + + /// return the possible completions + std::vector const completions(std::string const & prefix, + std::string & new_prefix); + + /// dispatch a command + void dispatch(std::string const & str); + + /// available command names + std::vector commands_; + + /// command history + std::vector history_; + + /// current position in command history + std::vector::const_iterator history_pos_; + + /// the button up + QPushButton * upPB; + + /// the button down + QPushButton * downPB; }; } // namespace frontend } // namespace lyx -#endif // QCOMMANDBUFFER_H +#endif // GUICOMMANDBUFFER_H