]> git.lyx.org Git - lyx.git/blob - src/frontends/gtk/GMiniBuffer.h
Change glob() API to accept a dir parameter.
[lyx.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
18 namespace lyx {
19 namespace frontend {
20
21 class ControlCommandBuffer;
22
23 class GMiniBuffer : public sigc::trackable {
24 public:
25         GMiniBuffer(GView * view, ControlCommandBuffer & control);
26         ~GMiniBuffer();
27         void message(std::string const & str);
28         /// go into edit mode
29         void editMode();
30 private:
31         bool onKeyPress(GdkEventKey * event);
32         bool onListKeyPress(GdkEventKey * event);
33         void onCommit();
34         bool onListFocusIn(GdkEventFocus * event);
35         bool onFocusIn(GdkEventFocus * event);
36         bool onFocusOut(GdkEventFocus * event);
37         void focusTimeout();
38         void onSelected();
39         /// Are we in edit mode?
40         bool isEditMode() const;
41         /// reset buffer to stored input text
42         void infoTimeout();
43         /// go back to "at rest" message
44         void idleTimeout();
45         /// go into message mode
46         void messageMode();
47         /// show a temporary message whilst in edit mode
48         void showInfo(Glib::ustring const & info, bool append = true);
49         void setInput(Glib::ustring const & input);
50         ControlCommandBuffer & controller_;
51         GView * view_;
52         Gtk::Entry entry_;
53         /// info timer
54         boost::scoped_ptr<Timeout> infoTimer_;
55         boost::signals::connection infoCon_;
56         /// idle timer
57         boost::scoped_ptr<Timeout> idleTimer_;
58         boost::signals::connection idleCon_;
59         Glib::ustring storedInput_;
60         /// are we showing an informational temporary message ?
61         bool infoShown_;
62         boost::scoped_ptr<Timeout> focusTimer_;
63
64         Gtk::ScrolledWindow scrolledWindow_;
65         Gtk::TreeModelColumn<Glib::ustring> listCol_;
66         Gtk::TreeModel::ColumnRecord listCols_;
67         Glib::RefPtr<Gtk::ListStore> listStore_;
68         Gtk::TreeView listView_;
69         Glib::RefPtr<Gtk::TreeSelection> listSel_;
70 };
71
72 } // namespace frontend
73 } // namespace lyx
74
75 #endif