]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlCommandBuffer.h
convert author names and status messages to docstring
[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 Jürgen
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 "support/docstring.h"
18
19 #include <vector>
20
21
22 namespace lyx {
23
24 class LyXView;
25
26 namespace frontend {
27
28 /**
29  * ControlCommandBuffer
30  *
31  * This provides methods for the use of a toolkit's
32  * minibuffer/command buffer
33  */
34 class ControlCommandBuffer {
35 public:
36         ControlCommandBuffer(LyXView & lv);
37
38         /// return the previous history entry if any
39         std::string const historyUp();
40
41         /// return the next history entry if any
42         std::string const historyDown();
43
44         /// return the font and depth in the active BufferView as a message.
45         docstring const getCurrentState() const;
46
47         /// return the possible completions
48         std::vector<std::string> const completions(std::string const & prefix,
49                                               std::string & new_prefix);
50
51         /// dispatch a command
52         void dispatch(std::string const & str);
53 private:
54         /// controlling LyXView
55         LyXView & lv_;
56
57         /// available command names
58         std::vector<std::string> commands_;
59
60         /// command history
61         std::vector<std::string> history_;
62
63         /// current position in command history
64         std::vector<std::string>::const_iterator history_pos_;
65 };
66
67 } // namespace frontend
68 } // namespace lyx
69
70 #endif // CONTROLCOMMANDBUFFER_H