1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
1999-11-15 12:01:38 +00:00
|
|
|
#ifndef MINIBUFFER_H
|
|
|
|
#define MINIBUFFER_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2001-04-17 15:15:59 +00:00
|
|
|
#include <sigc++/signal_system.h>
|
|
|
|
#include <vector>
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
#include FORMS_H_LOCATION
|
|
|
|
#include "LString.h"
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
class LyXView;
|
2001-11-05 17:07:23 +00:00
|
|
|
class DropDown;
|
2002-02-18 19:13:48 +00:00
|
|
|
class Timeout;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
///
|
2001-03-15 18:21:56 +00:00
|
|
|
class MiniBuffer : public SigC::Object {
|
1999-09-27 18:44:28 +00:00
|
|
|
public:
|
2001-04-17 15:15:59 +00:00
|
|
|
enum State {
|
|
|
|
spaces,
|
|
|
|
nospaces
|
|
|
|
};
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-04-08 17:02:02 +00:00
|
|
|
MiniBuffer(LyXView * o,
|
|
|
|
FL_Coord x, FL_Coord y, FL_Coord h, FL_Coord w);
|
2000-04-04 00:19:15 +00:00
|
|
|
|
2001-11-05 17:07:23 +00:00
|
|
|
/// destructor
|
|
|
|
~MiniBuffer();
|
|
|
|
|
|
|
|
/// create drop down
|
|
|
|
void dd_init();
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-04-17 15:15:59 +00:00
|
|
|
void addSet(string const &,
|
|
|
|
string const & = string());
|
2000-10-26 00:07:20 +00:00
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-04-17 15:15:59 +00:00
|
|
|
void message(string const & str);
|
|
|
|
///
|
|
|
|
void messagePush(string const & str);
|
|
|
|
///
|
|
|
|
void messagePop();
|
2001-04-06 12:47:50 +00:00
|
|
|
|
2001-04-17 15:15:59 +00:00
|
|
|
/** Makes the minibuffer wait for a string to be inserted.
|
|
|
|
Waits for a string to be inserted into the minibuffer, when
|
2001-11-09 13:44:48 +00:00
|
|
|
the string has been inserted the signal stringReady is
|
2001-04-17 15:15:59 +00:00
|
|
|
emitted.
|
|
|
|
*/
|
|
|
|
void getString(State space,
|
2001-04-18 10:20:17 +00:00
|
|
|
std::vector<string> const & completion,
|
|
|
|
std::vector<string> & history);
|
2001-04-17 15:15:59 +00:00
|
|
|
///
|
|
|
|
void redraw();
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-04-17 15:15:59 +00:00
|
|
|
int peek_event(FL_OBJECT *, int, int);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-04-17 15:15:59 +00:00
|
|
|
SigC::Signal1<void, string const &> stringReady;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-04-17 15:15:59 +00:00
|
|
|
//SigC::Signal0<void> escape;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-04-17 15:15:59 +00:00
|
|
|
SigC::Signal0<void> timeout;
|
|
|
|
private:
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-04-17 15:15:59 +00:00
|
|
|
void activate();
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-04-17 15:15:59 +00:00
|
|
|
void deactivate();
|
1999-10-25 14:18:30 +00:00
|
|
|
///
|
2001-04-17 15:15:59 +00:00
|
|
|
void prepare();
|
1999-10-25 14:18:30 +00:00
|
|
|
///
|
2001-04-17 15:15:59 +00:00
|
|
|
void stored_slot();
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-04-17 15:15:59 +00:00
|
|
|
void stored_set(string const &);
|
2001-11-08 11:46:06 +00:00
|
|
|
/// set the minibuffer content if str non-empty
|
|
|
|
void set_complete_input(string const &);
|
2002-01-14 12:47:17 +00:00
|
|
|
/// append c to the current contents
|
|
|
|
void append_char(char c);
|
2001-11-08 11:46:06 +00:00
|
|
|
/// set the minibuffer content
|
2001-08-04 10:26:01 +00:00
|
|
|
void set_input(string const &);
|
|
|
|
///
|
2001-04-17 15:15:59 +00:00
|
|
|
void init();
|
|
|
|
///
|
|
|
|
string stored_input;
|
|
|
|
///
|
|
|
|
bool stored_;
|
|
|
|
///
|
|
|
|
LyXView * owner_;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string text;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string text_stored;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-08-07 20:58:24 +00:00
|
|
|
FL_OBJECT * add(int, FL_Coord, FL_Coord, FL_Coord, FL_Coord);
|
2000-10-26 00:07:20 +00:00
|
|
|
///
|
2002-02-18 19:13:48 +00:00
|
|
|
Timeout * timer;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2002-02-18 19:13:48 +00:00
|
|
|
Timeout * stored_timer;
|
2001-11-05 17:07:23 +00:00
|
|
|
/// the dropdown menu
|
|
|
|
DropDown * dropdown_;
|
2001-04-17 15:15:59 +00:00
|
|
|
///
|
2000-08-07 20:58:24 +00:00
|
|
|
FL_OBJECT * the_buffer;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-04-18 10:20:17 +00:00
|
|
|
std::vector<string> completion_;
|
2001-04-17 15:15:59 +00:00
|
|
|
///
|
2001-04-18 10:20:17 +00:00
|
|
|
std::vector<string> * history_;
|
2001-04-17 15:15:59 +00:00
|
|
|
///
|
2001-04-18 10:20:17 +00:00
|
|
|
std::vector<string>::iterator hist_iter;
|
2001-04-17 15:15:59 +00:00
|
|
|
///
|
|
|
|
State state_;
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
#endif
|