xref: /haiku/docs/user/interface/InterfaceDefs.dox (revision 02354704729d38c3b078c696adc1bbbd33cbcf72)
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	\since BeOS R3
84*/
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 accommodate the label.
128
129	\since BeOS R5
130*/
131
132
133// Line join and cap modes
134
135
136/*!
137	\enum join_mode
138
139	PostScript-style line join modes used by BView::SetLineMode()
140
141	\since BeOS R3
142*/
143
144
145/*!
146	\var join_mode B_ROUND_JOIN
147
148	Round join mode.
149
150	\since BeOS R3
151*/
152
153
154/*!
155	\var join_mode B_MITER_JOIN
156
157	Miter join mode.
158
159	\since BeOS R3
160*/
161
162
163/*!
164	\var join_mode B_BEVEL_JOIN
165
166	Bevel join mode.
167
168	\since BeOS R3
169*/
170
171
172/*!
173	\var join_mode B_BUTT_JOIN
174
175	Butt join mode.
176
177	\since BeOS R3
178*/
179
180/*!
181	\var join_mode B_SQUARE_JOIN
182
183	Square join mode.
184
185	\since BeOS R3
186*/
187
188
189/*!
190	\enum cap_mode
191
192	PostScript-style line cap modes used by BView::SetLineMode()
193
194	\since BeOS R3
195*/
196
197
198/*!
199	\var cap_mode B_ROUND_CAP
200
201	Round cap mode.
202
203	\since BeOS R3
204*/
205
206
207/*!
208	\var cap_mode B_BUTT_CAP
209
210	Butt cap mode.
211
212	\since BeOS R3
213*/
214
215
216/*!
217	\var cap_mode B_SQUARE_CAP
218
219	Square cap mode.
220
221	\since BeOS R3
222*/
223
224
225/*!
226	\var B_DEFAULT_MITER_LIMIT
227
228	Default miter limit used to calculate the angle cut off for miter joins.
229
230	\since BeOS R3
231*/
232
233
234///// Keyboard related functions
235
236
237/*!
238	\fn uint32 modifiers()
239	\brief Gets a bitmap of each modifier key pressed down and each active
240		keyboard lock.
241
242	Test the bitmap returned using a bit mask composed of the following
243	modifier key constants:
244		- \c B_CAPS_LOCK
245		- \c B_COMMAND_KEY
246		- \c B_CONTROL_KEY
247		- \c B_MENU_KEY
248		- \c B_NUM_LOCK
249		- \c B_OPTION_KEY
250		- \c B_SCROLL_LOCK
251		- \c B_SHIFT_KEY
252
253	You may use a bit mask of 0 to test that no modifier keys are pressed.
254	If it is important to know if the left or right modifier key is pressed
255	down you can use the following additional constants:
256		- \c B_LEFT_SHIFT_KEY
257		- \c B_RIGHT_SHIFT_KEY
258		- \c B_LEFT_CONTROL_KEY
259		- \c B_RIGHT_CONTROL_KEY
260		- \c B_LEFT_OPTION_KEY
261		- \c B_RIGHT_OPTION_KEY
262		- \c B_LEFT_COMMAND_KEY
263		- \c B_RIGHT_COMMAND_KEY
264
265	\returns A bitmap containing each active modifier keys and locks.
266
267	\since BeOS R3
268*/
269
270
271/*!
272	\fn status_t get_key_info(key_info* info)
273	\brief Fills out the key_info struct with the current state of the
274		keyboard.
275
276	\param info The key_info struct to fill out.
277
278	\retval B_OK Everything went fine.
279	\retval B_ERROR There was an error retrieving the key_info struct.
280
281	\since BeOS R3
282*/
283
284
285/*!
286	\fn void get_key_map(key_map** _map, char** _keyBuffer)
287	\brief Provides a copy of the system keymap.
288
289	\attention You must free \a _map and \a _keyBuffer when you are done
290		with them.
291
292	\param _map A pointer to the system keymap structure.
293	\param _keyBuffer A pointer containing the UTF-8 character encodings.
294
295	\since BeOS R3
296*/
297
298
299/*!
300	\fn status_t get_keyboard_id(uint16* _id)
301	\brief Fills out \a _id with the id of the currently attached keyboard.
302
303	\retval B_OK Everything went fine.
304	\retval B_ERROR There was an error retrieving the keyboard id.
305
306	\since BeOS R3
307*/
308
309
310/*!
311	\fn status_t get_modifier_key(uint32 modifier, uint32 *key)
312	\brief Gets the code of the requested \a modifier key from the
313		system keymap.
314
315	\param modifier The modifier key to get from the system keymap.
316	\param key A pointer to an int32 to store the key code.
317
318	\retval B_OK Everything went fine.
319	\retval B_ERROR There was an error retrieving the modifier key.
320
321	\since BeOS R3
322*/
323
324
325/*!
326	\fn void set_modifier_key(uint32 modifier, uint32 key)
327	\brief Set the \a modifier \a key to the specified code in the
328		system keymap.
329
330	\param modifier The modifier key to set in the system keymap.
331	\param key The key code to set the modifier key to.
332
333	\since BeOS R3
334*/
335
336
337/*!
338	\fn void set_keyboard_locks(uint32 modifiers)
339	\brief Set the keyboard locks.
340
341	Pass in a bit mask containing the following constants:
342		- \c B_CAPS_LOCK
343		- \c B_NUM_LOCK
344		- \c B_SCROLL_LOCK
345
346	The constants present in the bit mask will turn the lock on, those
347	absent will turn the lock off. Pass 0 in to turn off all locks.
348
349	\param modifiers A bitmap of lock keys to set.
350
351	\since BeOS R3
352*/
353
354
355/*!
356	\fn status_t get_mouse_type(int32* type)
357	\brief Get the number of buttons of the mouse.
358
359	If there are multiple mouses connected, the number of buttons for one of
360	them picked at random will be returned.
361*/
362
363
364/*!
365	\fn status_t set_mouse_type(int32 type)
366	\brief Set the number of buttons of the mouse.
367	\deprecated use set_mouse_type_by_name instead.
368*/
369
370
371/*!
372	\fn status_t get_mouse_type_by_name(BString mouse_name, int32* type)
373	\brief Get the number of buttons for a specific mouse.
374
375	Mouse names can be known from BInputDevice.
376*/
377
378
379/*!
380	\fn status_t set_mouse_type_by_name(BString mouse_name, int32 type)
381	\brief Configure the number of buttons for a specific mouse.
382
383	The setting is saved and persists accross reboots.
384*/
385
386
387/*!
388	\fn status_t get_mouse_speed(int32* speed)
389	\brief Get the mouse speed
390
391	If there are multiple mouses connected, this function return the speed
392	from a random one.
393*/
394
395
396/*!
397	\fn status_t set_mouse_speed(int32 speed)
398	\brief Set the mouse speed
399	\deprecated use set_mouse_speed_by_name instead.
400*/
401
402
403/*!
404	\fn status_t get_mouse_speed_by_name(BString mouse_name, int32* speed)
405	\brief Get the mouse speed setting for a specific mouse
406*/
407
408
409/*!
410	\fn status_t set_mouse_speed_by_name(BString mouse_name, int32 speed)
411	\brief Set the mouse speed for a specific mouse.
412
413	The setting is saved and persists accross reboots.
414*/
415