]> git.lyx.org Git - lyx.git/blob - src/minibuffer.h
Fix the WorkArea problems.
[lyx.git] / src / minibuffer.h
1 // -*- C++ -*-
2 #ifndef MINIBUFFER_H
3 #define MINIBUFFER_H
4
5 #include <sigc++/signal_system.h>
6 #include <vector>
7
8 #include FORMS_H_LOCATION
9 #include "LString.h"
10 #include "frontends/Timeout.h"
11
12 #ifdef __GNUG__
13 #pragma interface
14 #endif
15
16 class LyXView;
17
18 ///
19 class MiniBuffer : public SigC::Object {
20 public:
21         enum State {
22                 spaces,
23                 nospaces
24         };
25         
26         ///
27         MiniBuffer(LyXView * o,
28                    FL_Coord x, FL_Coord y, FL_Coord h, FL_Coord w);
29
30         ///
31         void addSet(string const &,
32                     string const & = string());
33
34         ///
35         void message(string const & str);
36         ///
37         void messagePush(string const & str);
38         ///
39         void messagePop();
40         
41         /** Makes the minibuffer wait for a string to be inserted.
42             Waits for a string to be inserted into the minibuffer, when
43             the string has been insterted the signal stringReady is
44             emitted.
45         */
46         void getString(State space,
47                        std::vector<string> const & completion,
48                        std::vector<string> & history);
49         ///
50         void redraw();
51         ///
52         int peek_event(FL_OBJECT *, int, int);
53         ///
54         SigC::Signal1<void, string const &> stringReady;
55         ///
56         //SigC::Signal0<void> escape;
57         ///
58         SigC::Signal0<void> timeout;
59 private:
60         ///
61         void activate();
62         ///
63         void deactivate();
64         ///
65         void prepare();
66         ///
67         void stored_slot();
68         ///
69         void stored_set(string const &);
70         ///
71         void set_input(string const &);
72         ///
73         void init();
74         ///
75         string stored_input;
76         ///
77         bool stored_;
78         ///
79         LyXView * owner_;
80         ///
81         string text;
82         ///
83         string text_stored;
84         ///
85         FL_OBJECT * add(int, FL_Coord, FL_Coord, FL_Coord, FL_Coord);
86         ///
87         Timeout timer;
88         ///
89         Timeout stored_timer;
90         ///
91         FL_OBJECT * the_buffer;
92         ///
93         std::vector<string> completion_;
94         ///
95         std::vector<string> * history_;
96         ///
97         std::vector<string>::iterator hist_iter;
98         ///
99         State state_;
100 };
101 #endif