]> git.lyx.org Git - lyx.git/blob - src/minibuffer.h
Don't launch that Alert if the graphics file isn't found. It doesn't work
[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
11 #ifdef __GNUG__
12 #pragma interface
13 #endif
14
15 class LyXView;
16 class DropDown;
17 class Timeout;
18
19 ///
20 class MiniBuffer : public SigC::Object {
21 public:
22         enum State {
23                 spaces,
24                 nospaces
25         };
26
27         ///
28         MiniBuffer(LyXView * o,
29                    FL_Coord x, FL_Coord y, FL_Coord h, FL_Coord w);
30
31         /// destructor
32         ~MiniBuffer();
33
34         /// create drop down
35         void dd_init();
36
37         ///
38         void addSet(string const &,
39                     string const & = string());
40
41         ///
42         void message(string const & str);
43         ///
44         void messagePush(string const & str);
45         ///
46         void messagePop();
47
48         /** Makes the minibuffer wait for a string to be inserted.
49             Waits for a string to be inserted into the minibuffer, when
50             the string has been inserted the signal stringReady is
51             emitted.
52         */
53         void getString(State space,
54                        std::vector<string> const & completion,
55                        std::vector<string> & history);
56         ///
57         void redraw();
58         ///
59         int peek_event(FL_OBJECT *, int, int);
60         ///
61         SigC::Signal1<void, string const &> stringReady;
62         ///
63         //SigC::Signal0<void> escape;
64         ///
65         SigC::Signal0<void> timeout;
66 private:
67         ///
68         void activate();
69         ///
70         void deactivate();
71         ///
72         void prepare();
73         ///
74         void stored_slot();
75         ///
76         void stored_set(string const &);
77         /// set the minibuffer content if str non-empty
78         void set_complete_input(string const &);
79         /// append c to the current contents
80         void append_char(char c);
81         /// set the minibuffer content
82         void set_input(string const &);
83         ///
84         void init();
85         ///
86         string stored_input;
87         ///
88         bool stored_;
89         ///
90         LyXView * owner_;
91         ///
92         string text;
93         ///
94         string text_stored;
95         ///
96         FL_OBJECT * add(int, FL_Coord, FL_Coord, FL_Coord, FL_Coord);
97         ///
98         Timeout * timer;
99         ///
100         Timeout * stored_timer;
101         /// the dropdown menu
102         DropDown * dropdown_;
103         ///
104         FL_OBJECT * the_buffer;
105         ///
106         std::vector<string> completion_;
107         ///
108         std::vector<string> * history_;
109         ///
110         std::vector<string>::iterator hist_iter;
111         ///
112         State state_;
113 };
114 #endif