xref: /haiku/docs/user/interface/InterfaceDefs.dox (revision 1b6bc2675fe3691538c8764ab016593f3b06ca53)
1/*
2 * Copyright 2001-2011, Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
5
6/*!
7	\file InterfaceDefs.h
8	\brief Defines standard interface definitions for controls.
9*/
10
11
12/*!
13	\enum border_style
14	Collection of flags that determine the border style drawn around a BBox.
15*/
16
17/*! \var border_style B_PLAIN_BORDER
18
19	\image html B_PLAIN_BORDER.png
20
21	The right and bottom sides of the box are darker than the top and
22	left sides to produce a shadow effect and make the box look like it
23	is raised slightly above the surrounding surface.
24*/
25
26/*! \var border_style B_FANCY_BORDER
27
28	\image html B_FANCY_BORDER.png
29
30	The border is a bevelled to give it a 3D effect. The border is uniform
31	in appearance on all four sides. This is the default appearance.
32*/
33
34/*! \var border_style B_NO_BORDER
35	No border.
36*/
37
38
39/*!
40	\enum orientation
41Orientation flag sets the layout to either horizontal or vertical
42	alignment.
43*/
44
45/*!
46	\var orientation B_HORIZONTAL
47	Horizontal alignment
48*/
49
50/*! \var orientation B_VERTICAL
51	Vertical alignment
52*/
53
54
55/*!
56	\enum button_width
57	Collection of flags that determine how wide to draw the buttons in a
58	BAlert dialog.
59*/
60
61/*!
62	\var button_width B_WIDTH_AS_USUAL
63	Set the width of each button based on the standard width.
64*/
65
66/*!
67	\var button_width B_WIDTH_FROM_WIDEST
68	Set the width of each button based on the width of the widest button.
69*/
70
71/*!
72	\var button_width B_WIDTH_FROM_LABEL
73	Set the width of each button to accomidate the width of the button's
74	label.
75*/
76
77
78///// Keyboard related functions
79
80
81/*!
82	\fn uint32 modifiers()
83	\brief Gets a bitmap of each modifier key pressed down and each active
84		keyboard lock.
85
86	Test the bitmap returned using a bit mask composed of the following
87	modifier key constants:
88		- \c B_CAPS_LOCK
89		- \c B_COMMAND_KEY
90		- \c B_CONTROL_KEY
91		- \c B_MENU_KEY
92		- \c B_NUM_LOCK
93		- \c B_OPTION_KEY
94		- \c B_SCROLL_LOCK
95		- \c B_SHIFT_KEY
96
97	You may use a bit mask of 0 to test that no modifier keys are pressed.
98	If it is important to know if the left or right modifier key is pressed
99	down you can use the following additional constants:
100		- \c B_LEFT_SHIFT_KEY
101		- \c B_RIGHT_SHIFT_KEY
102		- \c B_LEFT_CONTROL_KEY
103		- \c B_RIGHT_CONTROL_KEY
104		- \c B_LEFT_OPTION_KEY
105		- \c B_RIGHT_OPTION_KEY
106		- \c B_LEFT_COMMAND_KEY
107		- \c B_RIGHT_COMMAND_KEY
108
109	\returns A bitmap containing each active modifier keys and locks.
110*/
111
112
113/*!
114	\fn status_t get_key_info(key_info* info)
115	\brief Fills out the key_info struct with the current state of the
116		keyboard.
117
118	\param info The key_info struct to fill out.
119
120	\retval B_OK Everything went fine.
121	\retval B_ERROR There was an error retrieving the key_info struct.
122*/
123
124
125/*!
126	\fn void get_key_map(key_map** _map, char** _keyBuffer)
127	\brief Provides a copy of the system keymap.
128
129	\attention You must free \a _map and \a _keyBuffer when you are done
130		with them.
131
132	\param _map A pointer to the system keymap structure.
133	\param _keyBuffer A pointer containing the UTF-8 character encodings.
134*/
135
136
137/*!
138	\fn status_t get_keyboard_id(uint16* _id)
139	\brief Fills out \a _id with the id of the currently attached keyboard.
140
141	\retval B_OK Everything went fine.
142	\retval B_ERROR There was an error retrieving the keyboard id.
143*/
144
145
146/*!
147	\fn status_t get_modifier_key(uint32 modifier, uint32 *key)
148	\brief Gets the code of the requested \a modifier key from the
149		system keymap.
150
151	\param modifier The modifier key to get from the system keymap.
152	\param key A pointer to an int32 to store the key code.
153
154	\retval B_OK Everything went fine.
155	\retval B_ERROR There was an error retrieving the modifier key.
156*/
157
158
159/*!
160	\fn void set_modifier_key(uint32 modifier, uint32 key)
161	\brief Set the \a modifier \a key to the specified code in the
162		system keymap.
163
164	\param modifier The modifier key to set in the system keymap.
165	\param key The key code to set the modifier key to.
166*/
167
168
169/*!
170	\fn void set_keyboard_locks(uint32 modifiers)
171	\brief Set the keyboard locks.
172
173	Pass in a bit mask containing the following constants:
174		- \c B_CAPS_LOCK
175		- \c B_NUM_LOCK
176		- \c B_SCROLL_LOCK
177
178	The constants present in the bit mask will turn the lock on, those
179	absent will turn the lock off. Pass 0 in to turn off all locks.
180
181	\param modifiers A bitmap of lock keys to set.
182*/
183