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