]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/XMiniBuffer.h
remove defaults stuff, let Qt handle no toolbar
[lyx.git] / src / frontends / xforms / XMiniBuffer.h
1 // -*- C++ -*-
2 /**
3  * \file XMiniBuffer.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Lars
8  * \author Asger and Juergen
9  * \author John Levon
10  *
11  * Full author contact details are available in file CREDITS
12  */
13
14 #ifndef XMINIBUFFER_H
15 #define XMINIBUFFER_H
16
17 #include FORMS_H_LOCATION
18
19 #include "LString.h"
20 #include <boost/scoped_ptr.hpp>
21 #include <boost/shared_ptr.hpp>
22 #include <boost/signals/connection.hpp>
23
24 struct fl_freebrowser_;
25 typedef fl_freebrowser_ FL_FREEBROWSER;
26
27 class ControlCommandBuffer;
28 class Timeout;
29
30 /// in xforms, the minibuffer is both a status bar and a command buffer
31 class XMiniBuffer {
32 public:
33         ///
34         XMiniBuffer(ControlCommandBuffer & control,
35                     FL_Coord x, FL_Coord y, FL_Coord h, FL_Coord w);
36
37         ///
38         ~XMiniBuffer();
39
40         /// repaint the minibuffer
41         void redraw();
42
43         /// command completion, history, etc. management
44         int peek_event(FL_OBJECT *, int, int, XEvent * xev);
45
46         /// show a message
47         void message(string const & str);
48
49         /// focus the buffer for editing mode
50         void focus() { messageMode(false); }
51
52         /// disable event management
53         void freeze();
54
55         /// xforms callback routine
56         void freebrowserCB(int action);
57
58 private:
59         /// Are we in editing mode?
60         bool isEditingMode() const;
61
62         /// reset buffer to stored input text
63         void info_timeout();
64
65         /// go back to "at rest" message
66         void idle_timeout();
67
68         /// set the minibuffer content in editing mode
69         void set_input(string const &);
70
71         /// go into message mode
72         void messageMode(bool on = true);
73
74         /// show a temporary message whilst in edit mode
75         void show_info(string const & info, string const & input, bool append = true);
76
77         /// the dropdown menu
78         boost::shared_ptr<FL_FREEBROWSER> freebrowser_;
79
80         /// info timer
81         boost::scoped_ptr<Timeout> info_timer_;
82
83         /// idle timer
84         boost::scoped_ptr<Timeout> idle_timer_;
85
86         ///
87         boost::signals::connection info_con;
88         ///
89         boost::signals::connection idle_con;
90         ///
91         boost::signals::connection result_con;
92         ///
93         boost::signals::connection keypress_con;
94
95         /// This is the input widget object
96         FL_OBJECT * input_;
97
98         /// the controller we use
99         ControlCommandBuffer & controller_;
100
101         /// stored input when showing info
102         string stored_input_;
103
104         /// are we showing an informational temporary message ?
105         bool info_shown_;
106 };
107
108 #endif // XMINIBUFFER_H