2003-09-02 10:29:05 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file GMiniBuffer.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Huang Ying
|
|
|
|
*
|
2003-09-02 17:02:32 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2003-09-02 10:29:05 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef GMINI_BUFFER_H
|
|
|
|
#define GMINI_BUFFER_H
|
|
|
|
|
|
|
|
#include "frontends/Timeout.h"
|
2003-10-06 15:43:21 +00:00
|
|
|
|
2004-05-19 15:11:37 +00:00
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
2003-09-02 10:29:05 +00:00
|
|
|
class ControlCommandBuffer;
|
|
|
|
|
2004-09-26 13:18:29 +00:00
|
|
|
class GMiniBuffer : public SigC::Object {
|
2003-09-02 10:29:05 +00:00
|
|
|
public:
|
|
|
|
GMiniBuffer(GView * view, ControlCommandBuffer & control);
|
|
|
|
~GMiniBuffer();
|
2003-10-06 15:43:21 +00:00
|
|
|
void message(std::string const & str);
|
2003-09-02 10:29:05 +00:00
|
|
|
/// go into edit mode
|
|
|
|
void editMode();
|
|
|
|
private:
|
|
|
|
bool onKeyPress(GdkEventKey * event);
|
|
|
|
bool onListKeyPress(GdkEventKey * event);
|
|
|
|
void onCommit();
|
|
|
|
bool onListFocusIn(GdkEventFocus * event);
|
|
|
|
bool onFocusIn(GdkEventFocus * event);
|
|
|
|
bool onFocusOut(GdkEventFocus * event);
|
|
|
|
void focusTimeout();
|
|
|
|
void onSelected();
|
|
|
|
/// Are we in edit mode?
|
|
|
|
bool isEditMode() const;
|
|
|
|
/// reset buffer to stored input text
|
|
|
|
void infoTimeout();
|
|
|
|
/// go back to "at rest" message
|
|
|
|
void idleTimeout();
|
|
|
|
/// go into message mode
|
|
|
|
void messageMode();
|
|
|
|
/// show a temporary message whilst in edit mode
|
|
|
|
void showInfo(Glib::ustring const & info, bool append = true);
|
|
|
|
void setInput(Glib::ustring const & input);
|
|
|
|
ControlCommandBuffer & controller_;
|
|
|
|
GView * view_;
|
|
|
|
Gtk::Entry entry_;
|
|
|
|
/// info timer
|
|
|
|
boost::scoped_ptr<Timeout> infoTimer_;
|
|
|
|
boost::signals::connection infoCon_;
|
|
|
|
/// idle timer
|
|
|
|
boost::scoped_ptr<Timeout> idleTimer_;
|
|
|
|
boost::signals::connection idleCon_;
|
|
|
|
Glib::ustring storedInput_;
|
|
|
|
/// are we showing an informational temporary message ?
|
|
|
|
bool infoShown_;
|
|
|
|
boost::scoped_ptr<Timeout> focusTimer_;
|
|
|
|
|
|
|
|
Gtk::ScrolledWindow scrolledWindow_;
|
|
|
|
Gtk::TreeModelColumn<Glib::ustring> listCol_;
|
|
|
|
Gtk::TreeModel::ColumnRecord listCols_;
|
|
|
|
Glib::RefPtr<Gtk::ListStore> listStore_;
|
|
|
|
Gtk::TreeView listView_;
|
|
|
|
Glib::RefPtr<Gtk::TreeSelection> listSel_;
|
|
|
|
};
|
|
|
|
|
2004-05-19 15:11:37 +00:00
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
2003-09-02 10:29:05 +00:00
|
|
|
#endif
|