]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlCommandBuffer.h
Add a buffer_path arg to InsetGraphicsMailer's params2string, string2params.
[lyx.git] / src / frontends / controllers / ControlCommandBuffer.h
1 // -*- C++ -*-
2 /**
3  * \file ControlCommandBuffer.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Lars
8  * \author Asger and Juergen
9  * \author John Levon
10  *
11  * Full author contact details are available in file CREDITS
12  */
13
14 #ifndef CONTROLCOMMANDBUFFER_H
15 #define CONTROLCOMMANDBUFFER_H
16
17 #include "LString.h"
18
19 #include <vector>
20
21
22 class LyXView;
23
24 /**
25  * ControlCommandBuffer
26  *
27  * This provides methods for the use of a toolkit's
28  * minibuffer/command buffer
29  */
30 class ControlCommandBuffer {
31 public:
32         ControlCommandBuffer(LyXView & lv);
33
34         /// return the previous history entry if any
35         string const historyUp();
36
37         /// return the next history entry if any
38         string const historyDown();
39
40         /// return the font and depth in the active BufferView as a message.
41         string const getCurrentState() const;
42
43         /// return the possible completions
44         std::vector<string> const completions(string const & prefix,
45                                               string & new_prefix);
46
47         /// dispatch a command
48         void dispatch(string const & str);
49 private:
50         /// controlling LyXView
51         LyXView & lv_;
52
53         /// available command names
54         std::vector<string> commands_;
55
56         /// command history
57         std::vector<string> history_;
58
59         /// current position in command history
60         std::vector<string>::const_iterator history_pos_;
61 };
62
63 #endif // CONTROLCOMMANDBUFFER_H