gtk4/auto/list_base.rs
1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// DO NOT EDIT
4
5#[cfg(feature = "v4_10")]
6#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
7use crate::Accessible;
8use crate::{Buildable, ConstraintTarget, Orientable, Scrollable, Widget, ffi};
9
10#[cfg(feature = "v4_10")]
11#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
12glib::wrapper! {
13 /// The abstract base class for GTK's list widgets.
14 ///
15 /// # Shortcuts and Gestures
16 ///
17 /// [`ListBase`][crate::ListBase] supports the following keyboard shortcuts:
18 ///
19 /// - <kbd>Ctrl</kbd>+<kbd>A</kbd> or <kbd>Ctrl</kbd>+<kbd>/</kbd>
20 /// selects all items.
21 /// - <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>A</kbd> or
22 /// <kbd>Ctrl</kbd>+<kbd>\</kbd> unselects all items.
23 ///
24 /// The focused item is controlled by the navigation keys below, combined
25 /// with the <kbd>Ctrl</kbd> modifier to prevent moving the selection,
26 /// and the <kbd>Shift</kbd> modifier to extend the current selection.
27 ///
28 /// - <kbd>←</kbd>, <kbd>→</kbd>, <kbd>↑</kbd>, <kbd>↓</kbd> move the focus
29 /// on the next item in the designed direction.
30 /// - <kbd>Home</kbd> and <kbd>End</kbd> focus the first or last item.
31 /// - <kbd>PgUp</kbd> and <kbd>PgDn</kbd> move the focus one page up or down.
32 ///
33 /// List item widgets support the following keyboard shortcuts:
34 ///
35 /// - <kbd>Enter</kbd> activates the item.
36 /// - <kbd>␣</kbd> selects the item, with the same <kbd>Ctrl</kbd> and
37 /// <kbd>Shift</kbd> modifiers combinations as the navigation keys.
38 ///
39 /// # Actions
40 ///
41 /// [`ListBase`][crate::ListBase] defines a set of built-in actions:
42 ///
43 /// - `list.scroll-to-item` moves the visible area to the item at given position
44 /// with the minimum amount of scrolling required. If the item is already
45 /// visible, nothing happens.
46 /// - `list.select-item` changes the selection.
47 /// - `list.select-all` selects all items in the model, if the selection model
48 /// supports it.
49 /// - `list.unselect-all` unselects all items in the model, if the selection
50 /// model supports it.
51 ///
52 /// List item widgets install the following actions:
53 ///
54 /// - `listitem.select` changes selection if the item is selectable.
55 /// - `listitem.scroll-to` moves the visible area of the list to this item with
56 /// the minimum amount of scrolling required.
57 ///
58 /// This is an Abstract Base Class, you cannot instantiate it.
59 ///
60 /// ## Properties
61 ///
62 ///
63 /// #### `orientation`
64 /// The orientation of the list. See GtkOrientable:orientation
65 /// for details.
66 ///
67 /// Readable | Writable
68 /// <details><summary><h4>Widget</h4></summary>
69 ///
70 ///
71 /// #### `can-focus`
72 /// Whether the widget or any of its descendents can accept
73 /// the input focus.
74 ///
75 /// This property is meant to be set by widget implementations,
76 /// typically in their instance init function.
77 ///
78 /// Readable | Writable
79 ///
80 ///
81 /// #### `can-target`
82 /// Whether the widget can receive pointer events.
83 ///
84 /// Readable | Writable
85 ///
86 ///
87 /// #### `css-classes`
88 /// A list of css classes applied to this widget.
89 ///
90 /// Readable | Writable
91 ///
92 ///
93 /// #### `css-name`
94 /// The name of this widget in the CSS tree.
95 ///
96 /// This property is meant to be set by widget implementations,
97 /// typically in their instance init function.
98 ///
99 /// Readable | Writable | Construct Only
100 ///
101 ///
102 /// #### `cursor`
103 /// The cursor used by @widget.
104 ///
105 /// Readable | Writable
106 ///
107 ///
108 /// #### `focus-on-click`
109 /// Whether the widget should grab focus when it is clicked with the mouse.
110 ///
111 /// This property is only relevant for widgets that can take focus.
112 ///
113 /// Readable | Writable
114 ///
115 ///
116 /// #### `focusable`
117 /// Whether this widget itself will accept the input focus.
118 ///
119 /// Readable | Writable
120 ///
121 ///
122 /// #### `halign`
123 /// How to distribute horizontal space if widget gets extra space.
124 ///
125 /// Readable | Writable
126 ///
127 ///
128 /// #### `has-default`
129 /// Whether the widget is the default widget.
130 ///
131 /// Readable
132 ///
133 ///
134 /// #### `has-focus`
135 /// Whether the widget has the input focus.
136 ///
137 /// Readable
138 ///
139 ///
140 /// #### `has-tooltip`
141 /// Enables or disables the emission of the [`query-tooltip`][struct@crate::Widget#query-tooltip]
142 /// signal on @widget.
143 ///
144 /// A true value indicates that @widget can have a tooltip, in this case
145 /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to
146 /// determine whether it will provide a tooltip or not.
147 ///
148 /// Readable | Writable
149 ///
150 ///
151 /// #### `height-request`
152 /// Overrides for height request of the widget.
153 ///
154 /// If this is -1, the natural request will be used.
155 ///
156 /// Readable | Writable
157 ///
158 ///
159 /// #### `hexpand`
160 /// Whether to expand horizontally.
161 ///
162 /// Readable | Writable
163 ///
164 ///
165 /// #### `hexpand-set`
166 /// Whether to use the `hexpand` property.
167 ///
168 /// Readable | Writable
169 ///
170 ///
171 /// #### `layout-manager`
172 /// The [`LayoutManager`][crate::LayoutManager] instance to use to compute
173 /// the preferred size of the widget, and allocate its children.
174 ///
175 /// This property is meant to be set by widget implementations,
176 /// typically in their instance init function.
177 ///
178 /// Readable | Writable
179 ///
180 ///
181 /// #### `limit-events`
182 /// Makes this widget act like a modal dialog, with respect to
183 /// event delivery.
184 ///
185 /// Global event controllers will not handle events with targets
186 /// inside the widget, unless they are set up to ignore propagation
187 /// limits. See [`EventControllerExt::set_propagation_limit()`][crate::prelude::EventControllerExt::set_propagation_limit()].
188 ///
189 /// Readable | Writable
190 ///
191 ///
192 /// #### `margin-bottom`
193 /// Margin on bottom side of widget.
194 ///
195 /// This property adds margin outside of the widget's normal size
196 /// request, the margin will be added in addition to the size from
197 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
198 ///
199 /// Readable | Writable
200 ///
201 ///
202 /// #### `margin-end`
203 /// Margin on end of widget, horizontally.
204 ///
205 /// This property supports left-to-right and right-to-left text
206 /// directions.
207 ///
208 /// This property adds margin outside of the widget's normal size
209 /// request, the margin will be added in addition to the size from
210 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
211 ///
212 /// Readable | Writable
213 ///
214 ///
215 /// #### `margin-start`
216 /// Margin on start of widget, horizontally.
217 ///
218 /// This property supports left-to-right and right-to-left text
219 /// directions.
220 ///
221 /// This property adds margin outside of the widget's normal size
222 /// request, the margin will be added in addition to the size from
223 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
224 ///
225 /// Readable | Writable
226 ///
227 ///
228 /// #### `margin-top`
229 /// Margin on top side of widget.
230 ///
231 /// This property adds margin outside of the widget's normal size
232 /// request, the margin will be added in addition to the size from
233 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
234 ///
235 /// Readable | Writable
236 ///
237 ///
238 /// #### `name`
239 /// The name of the widget.
240 ///
241 /// Readable | Writable
242 ///
243 ///
244 /// #### `opacity`
245 /// The requested opacity of the widget.
246 ///
247 /// Readable | Writable
248 ///
249 ///
250 /// #### `overflow`
251 /// How content outside the widget's content area is treated.
252 ///
253 /// This property is meant to be set by widget implementations,
254 /// typically in their instance init function.
255 ///
256 /// Readable | Writable
257 ///
258 ///
259 /// #### `parent`
260 /// The parent widget of this widget.
261 ///
262 /// Readable
263 ///
264 ///
265 /// #### `receives-default`
266 /// Whether the widget will receive the default action when it is focused.
267 ///
268 /// Readable | Writable
269 ///
270 ///
271 /// #### `root`
272 /// The [`Root`][crate::Root] widget of the widget tree containing this widget.
273 ///
274 /// This will be `NULL` if the widget is not contained in a root widget.
275 ///
276 /// Readable
277 ///
278 ///
279 /// #### `scale-factor`
280 /// The scale factor of the widget.
281 ///
282 /// Readable
283 ///
284 ///
285 /// #### `sensitive`
286 /// Whether the widget responds to input.
287 ///
288 /// Readable | Writable
289 ///
290 ///
291 /// #### `tooltip-markup`
292 /// Sets the text of tooltip to be the given string, which is marked up
293 /// with Pango markup.
294 ///
295 /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
296 ///
297 /// This is a convenience property which will take care of getting the
298 /// tooltip shown if the given string is not `NULL`:
299 /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
300 /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
301 /// the default signal handler.
302 ///
303 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
304 /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
305 ///
306 /// Readable | Writable
307 ///
308 ///
309 /// #### `tooltip-text`
310 /// Sets the text of tooltip to be the given string.
311 ///
312 /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
313 ///
314 /// This is a convenience property which will take care of getting the
315 /// tooltip shown if the given string is not `NULL`:
316 /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
317 /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
318 /// the default signal handler.
319 ///
320 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
321 /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
322 ///
323 /// Readable | Writable
324 ///
325 ///
326 /// #### `valign`
327 /// How to distribute vertical space if widget gets extra space.
328 ///
329 /// Readable | Writable
330 ///
331 ///
332 /// #### `vexpand`
333 /// Whether to expand vertically.
334 ///
335 /// Readable | Writable
336 ///
337 ///
338 /// #### `vexpand-set`
339 /// Whether to use the `vexpand` property.
340 ///
341 /// Readable | Writable
342 ///
343 ///
344 /// #### `visible`
345 /// Whether the widget is visible.
346 ///
347 /// Readable | Writable
348 ///
349 ///
350 /// #### `width-request`
351 /// Overrides for width request of the widget.
352 ///
353 /// If this is -1, the natural request will be used.
354 ///
355 /// Readable | Writable
356 /// </details>
357 /// <details><summary><h4>Accessible</h4></summary>
358 ///
359 ///
360 /// #### `accessible-role`
361 /// The accessible role of the given [`Accessible`][crate::Accessible] implementation.
362 ///
363 /// The accessible role cannot be changed once set.
364 ///
365 /// Readable | Writable
366 /// </details>
367 /// <details><summary><h4>Orientable</h4></summary>
368 ///
369 ///
370 /// #### `orientation`
371 /// The orientation of the orientable.
372 ///
373 /// Readable | Writable
374 /// </details>
375 /// <details><summary><h4>Scrollable</h4></summary>
376 ///
377 ///
378 /// #### `hadjustment`
379 /// Horizontal [`Adjustment`][crate::Adjustment] of the scrollable widget.
380 ///
381 /// This adjustment is shared between the scrollable widget and its parent.
382 ///
383 /// Readable | Writable | Construct
384 ///
385 ///
386 /// #### `hscroll-policy`
387 /// Determines when horizontal scrolling should start.
388 ///
389 /// Readable | Writable
390 ///
391 ///
392 /// #### `vadjustment`
393 /// Vertical [`Adjustment`][crate::Adjustment] of the scrollable widget.
394 ///
395 /// This adjustment is shared between the scrollable widget and its parent.
396 ///
397 /// Readable | Writable | Construct
398 ///
399 ///
400 /// #### `vscroll-policy`
401 /// Determines when vertical scrolling should start.
402 ///
403 /// Readable | Writable
404 /// </details>
405 ///
406 /// # Implements
407 ///
408 /// [`WidgetExt`][trait@crate::prelude::WidgetExt], [`trait@glib::ObjectExt`], [`AccessibleExt`][trait@crate::prelude::AccessibleExt], [`BuildableExt`][trait@crate::prelude::BuildableExt], [`ConstraintTargetExt`][trait@crate::prelude::ConstraintTargetExt], [`OrientableExt`][trait@crate::prelude::OrientableExt], [`ScrollableExt`][trait@crate::prelude::ScrollableExt], [`WidgetExtManual`][trait@crate::prelude::WidgetExtManual], [`AccessibleExtManual`][trait@crate::prelude::AccessibleExtManual]
409 #[doc(alias = "GtkListBase")]
410 pub struct ListBase(Object<ffi::GtkListBase, ffi::GtkListBaseClass>) @extends Widget, @implements Accessible, Buildable, ConstraintTarget, Orientable, Scrollable;
411
412 match fn {
413 type_ => || ffi::gtk_list_base_get_type(),
414 }
415}
416
417#[cfg(not(feature = "v4_10"))]
418glib::wrapper! {
419 #[doc(alias = "GtkListBase")]
420 pub struct ListBase(Object<ffi::GtkListBase, ffi::GtkListBaseClass>) @extends Widget, @implements Buildable, ConstraintTarget, Orientable, Scrollable;
421
422 match fn {
423 type_ => || ffi::gtk_list_base_get_type(),
424 }
425}
426
427impl ListBase {
428 pub const NONE: Option<&'static ListBase> = None;
429}