xref: /haiku/docs/user/interface/InterfaceDefs.dox (revision 850f2d1e58cc443f77353c7fc0ce0c158c1fd328)
1/*
2 * Copyright 2011-2013 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 *		John Scipione, jscipione@gmail.com
7 *
8 * Corresponds to:
9 *		headers/os/interface/InterfaceDefs.h	hrev45737
10 *		src/kits/interface/InterfaceDefs.cpp	hrev45737
11 */
12
13
14/*!
15	\file InterfaceDefs.h
16	\ingroup interface
17	\ingroup libbe
18	\brief Defines standard interface definitions for controls.
19
20	\since BeOS R3
21*/
22
23
24/*!
25	\enum border_style
26	\ingroup interface
27
28	Collection of flags that determine the border style drawn around a BBox.
29
30	\since BeOS R3
31*/
32
33
34/*!
35	\var border_style B_PLAIN_BORDER
36
37	\image html B_PLAIN_BORDER.png
38
39	The right and bottom sides of the box are darker than the top and
40	left sides to produce a shadow effect and make the box look like it
41	is raised slightly above the surrounding surface.
42
43	\since BeOS R3
44*/
45
46
47/*!
48	\var border_style B_FANCY_BORDER
49
50	\image html B_FANCY_BORDER.png
51
52	The border is a bevelled to give it a 3D effect. The border is uniform
53	in appearance on all four sides. This is the default appearance.
54
55	\since BeOS R3
56*/
57
58
59/*!
60	\var border_style B_NO_BORDER
61
62	No border.
63
64	\since BeOS R3
65*/
66
67
68/*!
69	\enum orientation
70
71	Orientation flag sets the layout to either horizontal or vertical
72	alignment.
73
74	\since BeOS R3
75*/
76
77
78/*!
79	\var orientation B_HORIZONTAL
80
81	Horizontal alignment
82*/
83
84	\since BeOS R3
85
86
87/*!
88	\var orientation B_VERTICAL
89
90	Vertical alignment
91
92	\since BeOS R3
93*/
94
95
96/*!
97	\enum button_width
98
99	Collection of flags that determine how wide to draw the buttons in a
100	BAlert dialog.
101
102	\since BeOS R3
103*/
104
105
106/*!
107	\var button_width B_WIDTH_AS_USUAL
108
109	Set the width of each button based on the standard width.
110
111	\since BeOS R3
112*/
113
114
115/*!
116	\var button_width B_WIDTH_FROM_WIDEST
117
118	Set the width of each button based on the width of the widest button.
119
120	\since BeOS R3
121*/
122
123
124/*!
125	\var button_width B_WIDTH_FROM_LABEL
126
127	Set the width of each button to accomidate the width of the button's
128	label.
129
130	\since BeOS R3
131*/
132
133
134// Line join and cap modes
135
136
137/*!
138	\enum join_mode
139
140	PostScript-style line join modes used by BView::SetLineMode()
141
142	\since BeOS R3
143*/
144
145
146/*!
147	\var join_mode B_ROUND_JOIN
148
149	Round join mode.
150
151	\since BeOS R3
152*/
153
154
155/*!
156	\var join_mode B_MITER_JOIN
157
158	Miter join mode.
159
160	\since BeOS R3
161*/
162
163
164/*!
165	\var join_mode B_BEVEL_JOIN
166
167	Bevel join mode.
168
169	\since BeOS R3
170*/
171
172
173/*!
174	\var join_mode B_BUTT_JOIN
175
176	Butt join mode.
177
178	\since BeOS R3
179*/
180
181/*!
182	\var join_mode B_SQUARE_JOIN
183
184	Square join mode.
185
186	\since BeOS R3
187*/
188
189
190/*!
191	\enum cap_mode
192
193	PostScript-style line cap modes used by BView::SetLineMode()
194
195	\since BeOS R3
196*/
197
198
199/*!
200	\var cap_mode B_ROUND_CAP
201
202	Round cap mode.
203
204	\since BeOS R3
205*/
206
207
208/*!
209	\var cap_mode B_BUTT_CAP
210
211	Butt cap mode.
212
213	\since BeOS R3
214*/
215
216
217/*!
218	\var cap_mode B_SQUARE_CAP
219
220	Square cap mode.
221
222	\since BeOS R3
223*/
224
225
226/*!
227	\var B_DEFAULT_MITER_LIMIT
228
229	Default miter limit used to calculate the angle cut off for miter joins.
230
231	\since BeOS R3
232*/
233
234
235///// Keyboard related functions
236
237
238/*!
239	\fn uint32 modifiers()
240	\brief Gets a bitmap of each modifier key pressed down and each active
241		keyboard lock.
242
243	Test the bitmap returned using a bit mask composed of the following
244	modifier key constants:
245		- \c B_CAPS_LOCK
246		- \c B_COMMAND_KEY
247		- \c B_CONTROL_KEY
248		- \c B_MENU_KEY
249		- \c B_NUM_LOCK
250		- \c B_OPTION_KEY
251		- \c B_SCROLL_LOCK
252		- \c B_SHIFT_KEY
253
254	You may use a bit mask of 0 to test that no modifier keys are pressed.
255	If it is important to know if the left or right modifier key is pressed
256	down you can use the following additional constants:
257		- \c B_LEFT_SHIFT_KEY
258		- \c B_RIGHT_SHIFT_KEY
259		- \c B_LEFT_CONTROL_KEY
260		- \c B_RIGHT_CONTROL_KEY
261		- \c B_LEFT_OPTION_KEY
262		- \c B_RIGHT_OPTION_KEY
263		- \c B_LEFT_COMMAND_KEY
264		- \c B_RIGHT_COMMAND_KEY
265
266	\returns A bitmap containing each active modifier keys and locks.
267
268	\since BeOS R3
269*/
270
271
272/*!
273	\fn status_t get_key_info(key_info* info)
274	\brief Fills out the key_info struct with the current state of the
275		keyboard.
276
277	\param info The key_info struct to fill out.
278
279	\retval B_OK Everything went fine.
280	\retval B_ERROR There was an error retrieving the key_info struct.
281
282	\since BeOS R3
283*/
284
285
286/*!
287	\fn void get_key_map(key_map** _map, char** _keyBuffer)
288	\brief Provides a copy of the system keymap.
289
290	\attention You must free \a _map and \a _keyBuffer when you are done
291		with them.
292
293	\param _map A pointer to the system keymap structure.
294	\param _keyBuffer A pointer containing the UTF-8 character encodings.
295
296	\since BeOS R3
297*/
298
299
300/*!
301	\fn status_t get_keyboard_id(uint16* _id)
302	\brief Fills out \a _id with the id of the currently attached keyboard.
303
304	\retval B_OK Everything went fine.
305	\retval B_ERROR There was an error retrieving the keyboard id.
306
307	\since BeOS R3
308*/
309
310
311/*!
312	\fn status_t get_modifier_key(uint32 modifier, uint32 *key)
313	\brief Gets the code of the requested \a modifier key from the
314		system keymap.
315
316	\param modifier The modifier key to get from the system keymap.
317	\param key A pointer to an int32 to store the key code.
318
319	\retval B_OK Everything went fine.
320	\retval B_ERROR There was an error retrieving the modifier key.
321
322	\since BeOS R3
323*/
324
325
326/*!
327	\fn void set_modifier_key(uint32 modifier, uint32 key)
328	\brief Set the \a modifier \a key to the specified code in the
329		system keymap.
330
331	\param modifier The modifier key to set in the system keymap.
332	\param key The key code to set the modifier key to.
333
334	\since BeOS R3
335*/
336
337
338/*!
339	\fn void set_keyboard_locks(uint32 modifiers)
340	\brief Set the keyboard locks.
341
342	Pass in a bit mask containing the following constants:
343		- \c B_CAPS_LOCK
344		- \c B_NUM_LOCK
345		- \c B_SCROLL_LOCK
346
347	The constants present in the bit mask will turn the lock on, those
348	absent will turn the lock off. Pass 0 in to turn off all locks.
349
350	\param modifiers A bitmap of lock keys to set.
351
352	\since BeOS R3
353*/
354