]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlCommandBuffer.h
dont use pragma impementation and interface anymore
[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 LyXFunc;
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(LyXFunc & lf);
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 possible completions
41         std::vector<string> const completions(string const & prefix,
42                                               string & new_prefix);
43
44         /// dispatch a command
45         void dispatch(string const & str);
46 private:
47         /// controlling lyxfunc
48         LyXFunc & lyxfunc_;
49
50         /// available command names
51         std::vector<string> commands_;
52
53         /// command history
54         std::vector<string> history_;
55
56         /// current position in command history
57         std::vector<string>::const_iterator history_pos_;
58 };
59
60 #endif // CONTROLCOMMANDBUFFER_H