]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlCommandBuffer.h
Compilation fix.
[lyx.git] / src / frontends / controllers / ControlCommandBuffer.h
1 // -*- C++ -*-
2 /**
3  * \file ControlCommandBuffer.h
4  * Copyright 1995-2002 the LyX Team
5  * Read the file COPYING
6  *
7  * \author Lars
8  * \author Asger and Juergen
9  * \author John Levon <levon@movementarian.org>
10  */
11
12 #ifndef CONTROLCOMMANDBUFFER_H
13 #define CONTROLCOMMANDBUFFER_H
14
15 #include <config.h>
16  
17 #include "LString.h"
18
19 #include <vector>
20
21 #ifdef __GNUG__
22 #pragma interface
23 #endif
24
25 class LyXFunc;
26
27 /**
28  * ControlCommandBuffer
29  *
30  * This provides methods for the use of a toolkit's
31  * minibuffer/command buffer 
32  */
33 class ControlCommandBuffer {
34 public:
35         ControlCommandBuffer(LyXFunc & lf);
36         
37         /// return the previous history entry if any
38         string const historyUp();
39
40         /// return the next history entry if any
41         string const historyDown();
42
43         /// return the possible completions
44         std::vector<string> const completions(string const & prefix, string & new_prefix);
45  
46         /// dispatch a command
47         void dispatch(string const & str);
48  
49 private:
50         /// controlling lyxfunc
51         LyXFunc & lyxfunc_;
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