]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/combox.h
the doxygen patch
[lyx.git] / src / frontends / xforms / combox.h
1 /**
2  * \file combox.h
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Angus Leeming
7  *
8  * Full author contact details are available in file CREDITS
9  *
10  * A combination of two objects (a button and a browser) is encapsulated to
11  * get a combobox-like object.
12  */
13
14 #ifndef FL_COMBOX_H
15 #define FL_COMBOX_H
16
17 #if defined(__cplusplus)
18 extern "C"
19 {
20 #endif
21
22 /** This will eventually be moved into the enum of in-built widgets
23     in forms.h. */
24 enum {
25     FL_COMBOX = 200
26 };
27
28 /** The various types of combox. */
29 typedef enum {
30     FL_NORMAL_COMBOX,
31     FL_DROPLIST_COMBOX
32 } FL_COMBOX_TYPE;
33
34 /** How the browser should be displayed relative to the buttons. */
35 typedef enum {
36     FL_COMBOX_BELOW,
37     FL_COMBOX_ABOVE
38 } FL_COMBOX_POSITION;
39
40 /** A function to create a combox widget.
41  *  \param type is, as yet, unused. there is only one type of combox.
42  *  \param x the x coordinate of the upper left hand corner of the widget,
43  *  relative to the parent form'd origin.
44  *  \param y the y coordinate of the upper left hand corner of the widget,
45  *  relative to the parent form'd origin.
46  *  \param w the widget's width
47  *  \param h the widget's height
48  *  \param label the widget's label as it appears on the GUI.
49  */
50 FL_EXPORT FL_OBJECT *
51 fl_create_combox(FL_COMBOX_TYPE type,
52                  FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h,
53                  char const * label);
54
55 /** A function to create a combox widget and add it to the parent form.
56  *  \see fl_create_combox() for an explanation of the argument list.
57  */
58 FL_EXPORT FL_OBJECT *
59 fl_add_combox(FL_COMBOX_TYPE type,
60               FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h,
61               char const * label);
62
63 /** The combox browser has a default height of 100 pixels. Adjust to suit. */
64 FL_EXPORT void
65 fl_set_combox_browser_height(FL_OBJECT * ob, int bh);
66
67 /** The browser will be displayed either below or above the button,
68  *  dependent upon \c position.
69  */
70 FL_EXPORT void
71 fl_set_combox_position(FL_OBJECT * ob, FL_COMBOX_POSITION position);
72
73 /** Empty the browser and the combox. */
74 FL_EXPORT void
75 fl_clear_combox(FL_OBJECT * ob);
76
77 /** Add a line to the combox browser. */
78 FL_EXPORT void
79 fl_addto_combox(FL_OBJECT * ob, char const * text);
80
81 /** Set the combox to return line \c choice of the combox browser. */
82 FL_EXPORT void
83 fl_set_combox(FL_OBJECT * ob, int choice);
84
85 /** \return the currently selected line of the combox browser. */
86 FL_EXPORT int
87 fl_get_combox(FL_OBJECT * ob);
88
89 /** \return the contents of the combox.
90  *  (Also the contents of currently selected line of the combox browser.)
91  */
92 FL_EXPORT char const *
93 fl_get_combox_text(FL_OBJECT * ob);
94
95 /** \return the contents of \c line of the combox browser. */
96 FL_EXPORT char const *
97 fl_get_combox_line(FL_OBJECT * ob, int line);
98
99 /** \return the number of items in the combox browser. */
100 FL_EXPORT int
101 fl_get_combox_maxitems(FL_OBJECT * ob);
102
103 /** Show the browser */
104 FL_EXPORT void
105 fl_show_combox_browser(FL_OBJECT * ob);
106
107 /** Hide the browser */
108 FL_EXPORT void
109 fl_hide_combox_browser(FL_OBJECT * ob);
110
111 #if defined(__cplusplus)
112 }
113 #endif
114
115 #endif /* not FL_COMBOX_H */