]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlCommandBuffer.h
Really dull and boring header shit
[lyx.git] / src / frontends / controllers / ControlCommandBuffer.h
1 // -*- C++ -*-
2 /**
3  * \file ControlCommandBuffer.h
4  * Read the file COPYING
5  *
6  * \author Lars
7  * \author Asger and Juergen
8  * \author John Levon 
9  *
10  * Full author contact details are available in file CREDITS
11  */
12
13 #ifndef CONTROLCOMMANDBUFFER_H
14 #define CONTROLCOMMANDBUFFER_H
15
16 #include "LString.h"
17
18 #include <vector>
19
20 #ifdef __GNUG__
21 #pragma interface
22 #endif
23
24 class LyXFunc;
25
26 /**
27  * ControlCommandBuffer
28  *
29  * This provides methods for the use of a toolkit's
30  * minibuffer/command buffer 
31  */
32 class ControlCommandBuffer {
33 public:
34         ControlCommandBuffer(LyXFunc & lf);
35         
36         /// return the previous history entry if any
37         string const historyUp();
38
39         /// return the next history entry if any
40         string const historyDown();
41
42         /// return the possible completions
43         std::vector<string> const completions(string const & prefix, string & new_prefix);
44  
45         /// dispatch a command
46         void dispatch(string const & str);
47  
48 private:
49         /// controlling lyxfunc
50         LyXFunc & lyxfunc_;
51         
52         /// available command names
53         std::vector<string> commands_;
54  
55         /// command history
56         std::vector<string> history_;
57
58         /// current position in command history
59         std::vector<string>::const_iterator history_pos_;
60 };
61  
62 #endif // CONTROLCOMMANDBUFFER_H