Add to git.
[monolith.git] / src / ml_select_layout.h
1 /* Monolith select layout class.
2  * - by Richard W.M. Jones <rich@annexia.org>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the Free
16  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17  *
18  * $Id: ml_select_layout.h,v 1.2 2002/11/29 10:43:03 rich Exp $
19  */
20
21 #ifndef ML_SELECT_LAYOUT_H
22 #define ML_SELECT_LAYOUT_H
23
24 #include <ml_widget.h>
25
26 struct ml_select_layout;
27 typedef struct ml_select_layout *ml_select_layout;
28
29 /* Function: new_ml_select_layout - monolith select layout widget
30  * Function: ml_select_layout_push_back
31  * Function: ml_select_layout_pop_back
32  * Function: ml_select_layout_push_front
33  * Function: ml_select_layout_pop_front
34  * Function: ml_select_layout_get
35  * Function: ml_select_layout_insert
36  * Function: ml_select_layout_replace
37  * Function: ml_select_layout_erase
38  * Function: ml_select_layout_clear
39  * Function: ml_select_layout_size
40  * Function: ml_select_layout_pack
41  * Function: ml_select_layout_set_selection
42  * Function: ml_select_layout_get_selection
43  *
44  * This is the select layout widget. The appearance of select layouts
45  * is similar to the "preferences" dialog in versions of the Netscape
46  * browser. On the left is a list of items to choose from. On the right,
47  * the chosen item is displayed. The user may click an item from the
48  * list on the left in order to change the widget which is shown on the
49  * right.
50  *
51  * @code{new_ml_select_layout} creates a new, empty select layout widget.
52  *
53  * The following properties can be changed on select layout widgets (see
54  * @ref{ml_widget_set_property(3)}):
55  *
56  * @code{class}: The stylesheet class.
57  *
58  * @code{select_layout.top} (a widget): A widget displayed above
59  * the list of selections (the default is @code{NULL} meaning nothing
60  * is displayed there).
61  *
62  * @code{select_layout.bottom} (a widget): A widget displayed below
63  * the list of selections (the default is @code{NULL} meaning nothing
64  * is displayed there).
65  *
66  * Underlying the select layout widget is a simple c2lib vector, and the
67  * other access functions use the same notation as the equivalent
68  * c2lib @code{vector_*} functions. Go to the SEE ALSO section
69  * below to see how to manipulate widgets within a flow layout.
70  *
71  * @code{ml_select_layout_pack} is equivalent to
72  * @code{ml_select_layout_push_back}: it appends the item to the
73  * end of the current vector of widgets.
74  *
75  * @code{ml_select_layout_set_selection} sets the currently selected
76  * widget. This highlights the selection name on the left and displays
77  * the corresponding widget on the right. The default is that the first
78  * (index 0) widget is displayed.
79  *
80  * @code{ml_select_layout_get_selection} returns the currently selected
81  * widget.
82  *
83  * See also: @ref{vector_push_back(3)}, @ref{vector_pop_back(3)},
84  * @ref{vector_push_front(3)}, @ref{vector_pop_front(3)},
85  * @ref{vector_get(3)}, @ref{vector_insert(3)}, @ref{vector_replace(3)},
86  * @ref{vector_erase(3)}, @ref{vector_clear(3)}, @ref{vector_size(3)}.
87  */
88 extern ml_select_layout new_ml_select_layout (pool pool, ml_session session);
89 extern void ml_select_layout_push_back (ml_select_layout, const char *name, ml_widget);
90 extern ml_widget ml_select_layout_pop_back (ml_select_layout);
91 extern void ml_select_layout_push_front (ml_select_layout, const char *name, ml_widget);
92 extern ml_widget ml_select_layout_pop_front (ml_select_layout);
93 extern ml_widget ml_select_layout_get (ml_select_layout, int i);
94 extern void ml_select_layout_insert (ml_select_layout, int i, const char *name, ml_widget);
95 extern void ml_select_layout_replace (ml_select_layout, int i, const char *name, ml_widget);
96 extern void ml_select_layout_erase (ml_select_layout, int i);
97 extern void ml_select_layout_clear (ml_select_layout);
98 extern int ml_select_layout_size (ml_select_layout);
99 extern void ml_select_layout_pack (ml_select_layout, const char *name, ml_widget);
100 extern void ml_select_layout_set_selection (ml_select_layout, int i);
101 extern int ml_select_layout_get_selection (ml_select_layout);
102
103 #endif /* ML_SELECT_LAYOUT_H */