]> git.lyx.org Git - features.git/blob - src/frontends/gtk/GMiniBuffer.h
Replace LString.h with support/std_string.h,
[features.git] / src / frontends / gtk / GMiniBuffer.h
1 // -*- C++ -*-
2 /**
3  * \file GMiniBuffer.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Huang Ying
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12
13 #ifndef GMINI_BUFFER_H
14 #define GMINI_BUFFER_H
15
16 #include "frontends/Timeout.h"
17 #include "support/std_string.h"
18 class ControlCommandBuffer;
19
20 class GMiniBuffer : public SigC::Object
21 {
22 public:
23         GMiniBuffer(GView * view, ControlCommandBuffer & control);
24         ~GMiniBuffer();
25         void message(string const & str);
26         /// go into edit mode
27         void editMode();
28 private:
29         bool onKeyPress(GdkEventKey * event);
30         bool onListKeyPress(GdkEventKey * event);
31         void onCommit();
32         bool onListFocusIn(GdkEventFocus * event);
33         bool onFocusIn(GdkEventFocus * event);
34         bool onFocusOut(GdkEventFocus * event);
35         void focusTimeout();
36         void onSelected();
37         /// Are we in edit mode?
38         bool isEditMode() const;
39         /// reset buffer to stored input text
40         void infoTimeout();
41         /// go back to "at rest" message
42         void idleTimeout();
43         /// go into message mode
44         void messageMode();
45         /// show a temporary message whilst in edit mode
46         void showInfo(Glib::ustring const & info, bool append = true);
47         void setInput(Glib::ustring const & input);
48         ControlCommandBuffer & controller_;
49         GView * view_;
50         Gtk::Entry entry_;
51         /// info timer
52         boost::scoped_ptr<Timeout> infoTimer_;
53         boost::signals::connection infoCon_;
54         /// idle timer
55         boost::scoped_ptr<Timeout> idleTimer_;
56         boost::signals::connection idleCon_;
57         Glib::ustring storedInput_;
58         /// are we showing an informational temporary message ?
59         bool infoShown_;
60         boost::scoped_ptr<Timeout> focusTimer_;
61
62         Gtk::ScrolledWindow scrolledWindow_;
63         Gtk::TreeModelColumn<Glib::ustring> listCol_;
64         Gtk::TreeModel::ColumnRecord listCols_;
65         Glib::RefPtr<Gtk::ListStore> listStore_;
66         Gtk::TreeView listView_;
67         Glib::RefPtr<Gtk::TreeSelection> listSel_;
68 };
69
70 #endif