// Copyright © SixtyFPS GmbH // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial // cSpell: ignore langtype typeregister /** This file contains the definition off all builtin items It is parsed with the normal .slint parser, but the semantic. `_` means that that this is a langtype::NativeClass with no parent. Exported components are added to the as BuiltinElement. comments starting by `//-` have some meanings Properties with two way bindings (aliases) are deprecated in favor of the property they point to Properties can have default binding which must be an expression without any reference to another properties. These binding will be then set by the compiler. `output` property mean that the property can be modified by the native Item, otherwise it is assumed the native item don't write to that property. */ component Empty { in property x; in property y; in property width; in property height; //-default_size_binding:expands_to_parent_geometry //-is_internal } component Rectangle inherits Empty { in property background; in property color <=> background; } component BorderRectangle inherits Rectangle { in property border-width; in property border-radius; in property border-color; //-default_size_binding:expands_to_parent_geometry } export { BorderRectangle as Rectangle } component ImageItem inherits Empty { in property source; in property image-fit; in property image-rendering; in property colorize; } export component ClippedImage inherits ImageItem { in property source-clip-x; in property source-clip-y; in property source-clip-width; in property source-clip-height; //-default_size_binding:implicit_size } export { ClippedImage as Image } export component Rotate inherits Empty { in property rotation-angle; in property rotation-origin-x; in property rotation-origin-y; //-default_size_binding:expands_to_parent_geometry //-is_internal } export component Text inherits Empty { in property text; in property font-family; in property font-size; in property font-weight; in property color; // StyleMetrics.default-text-color set in apply_default_properties_from_style in property horizontal-alignment; in property vertical-alignment; in property overflow; in property wrap; in property letter-spacing; //-default_size_binding:implicit_size } export struct PointerEvent { //-name:slint::private_api::PointerEvent button: PointerEventButton, kind: PointerEventKind, } export component TouchArea { in property x; in property y; in property width; in property height; in property enabled: true; out property pressed; out property has_hover; out property mouse_x; out property mouse_y; out property pressed_x; out property pressed_y; in property mouse-cursor; callback clicked; callback moved; callback pointer-event(PointerEvent); //-default_size_binding:expands_to_parent_geometry } export struct KeyboardModifiers { //-name:slint::private_api::KeyboardModifiers alt: bool, control: bool, shift: bool, meta: bool, } export struct KeyEvent { //-name:slint::private_api::KeyEvent text: string, modifiers: KeyboardModifiers, } export component FocusScope { in property x; in property y; in property width; in property height; in property enabled: true; out property has-focus; callback key_pressed(KeyEvent) -> EventResult; callback key_released(KeyEvent) -> EventResult; //-default_size_binding:expands_to_parent_geometry //-accepts_focus } export component Flickable inherits Empty { // These properties are actually going to be forwarded to the viewport by the // code generator in property viewport-height; in property viewport-width; in-out property viewport-x; in-out property viewport-y; in property interactive: true; //-default_size_binding:expands_to_parent_geometry } component WindowItem { in-out property width; in-out property height; in property background; // StyleMetrics.window_background set in apply_default_properties_from_style in property color <=> background; in property title: "Slint Window"; in property no-frame; in property default-font-family; in-out property default-font-size; // <=> StyleMetrics.default-font-size set in apply_default_properties_from_style in property default-font-weight; in property icon; } export component Window inherits WindowItem {} export component BoxShadow inherits Empty { in property border_radius; in property offset_x; in property offset_y; in property color; in property blur; //-default_size_binding:expands_to_parent_geometry //-is_internal } export struct Point { //-name:slint::private_api::Point x: length, y: length, } export component TextInput { in-out property text; in property font-family; in property font-size; in property font-weight; in property color; // StyleMetrics.default-text-color set in apply_default_properties_from_style in property selection-foreground-color: #000; in property selection-background-color: #808080; in property horizontal-alignment; in property vertical-alignment; in property wrap; in property letter-spacing; in property x; in property y; in property width; in property height; in property text-cursor-width; // StyleMetrics.text-cursor-width set in apply_default_properties_from_style in property input-type; // Internal, undocumented property, only exposed for tests. out property cursor-position_byte-offset; // Internal, undocumented property, only exposed for tests. out property anchor-position-byte-offset; out property has-focus; callback accepted; callback edited; callback cursor_position_changed(Point); in property enabled: true; in property single-line: true; in property read-only: false; out property preedit-text; //-default_size_binding:expands_to_parent_geometry //-accepts_focus } export component Clip { in property x; in property y; in property width; in property height; in property border-radius; in property border-width; in property clip; //-default_size_binding:expands_to_parent_geometry //-is_internal } export component Opacity { in property x; in property y; in property width; in property height; in property opacity: 1; //-default_size_binding:expands_to_parent_geometry //-is_internal } export component Layer inherits Empty { in property cache-rendering-hint; //-default_size_binding:expands_to_parent_geometry //-is_internal } component Row { //-is_non_item_type } // Note: layouts are not NativeClass, but this is lowered in lower_layout export component GridLayout { in property spacing; // Additional accepted child Row { } } export component VerticalLayout { in property spacing; in property alignment; } export component HorizontalLayout { in property spacing; in property alignment; } component MoveTo { in property x; in property y; //-rust_type_constructor:slint::re_exports::PathElement::MoveTo(PathMoveTo{{}}) //-cpp_type:slint::private_api::PathMoveTo //-is_non_item_type } component LineTo { in property x; in property y; //-rust_type_constructor:slint::re_exports::PathElement::LineTo(PathLineTo{{}}) //-cpp_type:slint::private_api::PathLineTo //-is_non_item_type } component ArcTo { in property x; in property y; in property radius-x; in property radius-y; in property x-rotation; in property large_arc; in property sweep; //-rust_type_constructor:slint::re_exports::PathElement::ArcTo(PathArcTo{{}}) //-cpp_type:slint::private_api::PathArcTo //-is_non_item_type } component CubicTo { in property control-1-x; in property control-1-y; in property control-2-x; in property control-2-y; in property x; in property y; //-rust_type_constructor:slint::re_exports::PathElement::CubicTo(PathCubicTo{{}}) //-cpp_type:slint::private_api::PathCubicTo //-is_non_item_type } component QuadraticTo { in property control-x; in property control-y; in property x; in property y; //-rust_type_constructor:slint::re_exports::PathElement::QuadraticTo(PathQuadraticTo{{}}) //-cpp_type:slint::private_api::PathQuadraticTo //-is_non_item_type } component Close { //-rust_type_constructor:slint::re_exports::PathElement::Close //-cpp_type:slint::private_api::PathClose //-is_non_item_type //-is_non_item_type } export component Path { in property x; in property y; in property width; in property height; in property fill; in property fill-rule; in property stroke; in property stroke-width; in property commands; in property viewbox-x; in property viewbox-y; in property viewbox-width; in property viewbox-height; in property clip; //-disallow_global_types_as_child_elements MoveTo {} LineTo {} ArcTo {} CubicTo {} QuadraticTo {} Close {} //-default_size_binding:expands_to_parent_geometry } component Tab { in property title; } // Note: not a native class, handled in the lower_tabs pass export component TabWidget { in property x; in property y; in property width; in property height; in-out property current-index; //-disallow_global_types_as_child_elements Tab {} //-default_size_binding:expands_to_parent_geometry //-is_internal } // Note: not a native class, handled in the lower_popups pass export component PopupWindow { //property x; //property y; in property width; in property height; /*property anchor_x; in property anchor_y; in property anchor_height; in property anchor_width;*/ //show() is hardcoded in typeregister.rs } export component Dialog inherits WindowItem {} component PropertyAnimation { in property delay; in property duration; in property easing; in property iteration-count: 1.0; //-is_non_item_type } export struct StandardListViewItem { //-name:slint::StandardListViewItem text: string, } export struct TableColumn { //-name:slint::private_api::TableColumn title: string, min-width: length, horizontal-stretch: float, sort-order: SortOrder, width: length, } export struct StateInfo { //-name:slint::private_api::StateInfo current_state: int, previous_state: int, //change_time: duration, //-is_internal } export component NativeButton { in property x; in property y; in property width; in property height; in property text; in property icon; out property pressed; in property checkable; in-out property checked; out property has-focus; callback clicked; in property enabled: true; in property standard-button-kind; in property is-standard-button; //-is_internal } export component NativeCheckBox { in property x; in property y; in property width; in property height; in property enabled: true; in property text; in-out property checked; out property has-focus; callback toggled; //-is_internal } export component NativeSpinBox { in property x; in property y; in property width; in property height; in property enabled: true; out property has-focus; in-out property value; in property minimum; in property maximum: 100; //-is_internal } export component NativeSlider { in property x; in property y; in property width; in property height; in property enabled: true; in-out property value; in property minimum; in property maximum: 100; callback changed(float); //-is_internal } export component NativeGroupBox { in property x; in property y; in property width; in property height; in property enabled: true; in property title; out property native-padding-left; out property native-padding-right; out property native-padding-top; out property native-padding-bottom; //-default_size_binding:expands_to_parent_geometry //-is_internal } export component NativeLineEdit { in property x; in property y; in property width; in property height; out property native-padding-left; out property native-padding-right; out property native-padding-top; out property native-padding-bottom; in property has-focus; in property enabled: true; //-is_internal } export component NativeScrollView { in property x; in property y; in property width; in property height; in property horizontal-max; in property horizontal-page-size; in property horizontal-value; in property vertical-max; in property vertical-page-size; in-out property vertical-value; out property native-padding-left; out property native-padding-right; out property native-padding-top; out property native-padding-bottom; in property has_focus; in property enabled: true; //-default_size_binding:expands_to_parent_geometry //-is_internal } export component NativeStandardListViewItem { in property x; in property y; in property width; in property height; in property index; in property item; in-out property is_selected; in property has_hover; //-is_internal } export component NativeTableHeaderSection { in property x; in property y; in property width; in property height; in property index; in property item; in property has_hover; //-is_internal } export component NativeComboBox { in property x; in property y; in property width; in property height; in-out property current_value; in property enabled: true; //-is_internal } export component NativeComboBoxPopup { in property x; in property y; in property width; in property height; //-is_internal } export component NativeTabWidget { in property x; in property y; in property width; in property height; out property content-x; out property content-y; out property content-height; out property content-width; out property tabbar-x; out property tabbar-y; out property tabbar-height; out property tabbar-width; in property tabbar-preferred-height; in property tabbar-preferred-width; in property content-min-height; in property content-min-width; in property current-index; in property current-focused; //-default_size_binding:expands_to_parent_geometry //-is_internal } export component NativeTab { in property x; in property y; in property width; in property height; in property title; in property icon; in property enabled : true; in-out property current; // supposed to be a binding to the tab in property tab-index; in property current-focused; in property num-tabs; //-is_internal } export global NativeStyleMetrics { out property layout-spacing; out property layout-padding; out property text-cursor-width; out property window-background; out property default-text-color; out property default-font-size; out property textedit-background; out property textedit-text-color; out property textedit-background-disabled; out property textedit-text-color-disabled; out property dark-color-scheme; // specific to the Native one out property placeholder-color; out property placeholder-color-disabled; // Tab Bar metrics: out property tab-bar-alignment; //-is_non_item_type //-is_internal }