]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/DropDown.h
Really dull and boring header shit
[lyx.git] / src / frontends / xforms / DropDown.h
1 // -*- C++ -*-
2 /**
3  * \file DropDown.h
4  * Read the file COPYING
5  *
6  * \author John Levon
7  *
8  * Full author contact details are available in file CREDITS
9  */
10
11 #ifndef DROPDOWN_H
12 #define DROPDOWN_H
13
14 #ifdef __GNUG__
15 #pragma interface
16 #endif
17
18 #include "forms_fwd.h"
19 #include <X11/Xlib.h>
20
21 #include <boost/signals/signal1.hpp>
22
23 #include "LString.h"
24 #include <vector>
25
26 class DropDown {
27 public:
28         /// constructor
29         DropDown(FL_OBJECT * ob);
30         /// destructor
31         ~DropDown();
32
33         /// choose from the list of choices.
34         void select(std::vector<string> const & choices, int x, int y, int w);
35
36         /// user completed action
37         void completed();
38
39         /// a key was pressed. Act on it.
40         void key_pressed(char c);
41
42         /// signal for completion
43         boost::signal1<void, string const &> result;
44
45         /// signal that a key was pressed
46         boost::signal1<void, char> keypress;
47
48         /// X event
49         int peek(XEvent *);
50
51 private:
52         /// move up a browser line
53         void line_up();
54
55         /// move down a browser line
56         void line_down();
57
58         /// our form
59         FL_FORM * form_;
60
61         /// the browser
62         FL_OBJECT * browser_;
63 };
64
65 #endif // DROPDOWN_H