4 * Copyright 1995-2002 the LyX Team
5 * Read the file COPYING
8 * \author Asger and Juergen
16 #include <boost/signals/signal0.hpp>
17 #include <boost/signals/signal1.hpp>
18 #include <boost/signals/trackable.hpp>
30 class MiniBuffer : public boost::signals::trackable {
33 MiniBuffer(LyXView *);
36 virtual ~MiniBuffer();
38 /// Displays a text for 6 seconds
39 void message(string const & str);
42 * This will display a message for 6 seconds.
43 * It will remember the previous text that can be restored
44 * with messagePop. (You can only remember one message.)
46 void messagePush(string const & str);
49 * Restore the previous text that was messagePush'ed.
54 /// Adds text to the text already displayed for 6 seconds
55 void addSet(string const &);
57 /** Makes the minibuffer wait for a string to be inserted.
58 Waits for a string to be inserted into the minibuffer, when
59 the string has been inserted the signal stringReady is
62 void prepareForInput(std::vector<string> const & completion,
63 std::vector<string> & history);
65 /// This is signalled when the user has input a string
66 boost::signal1<void, string const &> inputReady;
68 /// This is signalled 6 seconds after a message has been displayed
69 boost::signal0<void> timeout;
72 /// Are we in editing mode?
73 virtual bool isEditingMode() const = 0;
74 /// enter editing mode
75 virtual void editingMode() = 0;
76 /// enter message display mode
77 virtual void messageMode() = 0;
80 * This will show the info string for 1.5 seconds, after
81 * which it will revert to the input string.
82 * Use this in editing mode only. If the user presses a
83 * key in the 1.5 second interval, the information will
86 void show_information(string const & info, string const & input);
89 * This is called after information has been shown for 1.5 seconds
90 * to restore the input as given in the show_information call.
95 * This is called when we tab-completed a command and it adds
96 * a space to the input so that we're ready to input any arguments.
98 void set_complete_input(string const &);
100 /// set the minibuffer content in editing mode
101 virtual void set_input(string const &) = 0;
104 * This when a message has been displayed for 6 seconds and
105 * it will emit the timeout signal.
107 void message_timeout();
110 * This will be the input after the information will timeout
111 * in 1.5 seconds or we press a key and force the information
117 * This is true for 1.5 seconds while information is shown in
118 * editing mode. If the user presses a key while information
119 * is shown, the info will disappear.
121 bool information_displayed_;
126 /// This is the text for the message display
129 /// This is the last text after a messagePush()
133 * This will emit the timeout signal after a message has been
134 * displayed for 6 seconds.
139 * This will call restore_input after 1.5 seconds to restore
140 * the input after an information display.
142 Timeout * information_timer_;
145 std::vector<string> completion_;
147 std::vector<string> * history_;
149 std::vector<string>::iterator hist_iter;