| 1 | // Copyright © SixtyFPS GmbH <info@slint.dev> |
| 2 | // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0 |
| 3 | |
| 4 | //cpp-namespace: my::ui |
| 5 | //ignore: rust,js |
| 6 | struct TestStruct { |
| 7 | condition: bool, |
| 8 | } |
| 9 | |
| 10 | enum TestEnum { |
| 11 | A, |
| 12 | B, |
| 13 | C |
| 14 | } |
| 15 | |
| 16 | export component TestCase inherits Rectangle { |
| 17 | in-out property <TestStruct> test_struct; |
| 18 | in-out property <TestEnum> test_enum; |
| 19 | } |
| 20 | |
| 21 | /* |
| 22 | ```cpp |
| 23 | auto handle = my::ui::TestCase::create(); |
| 24 | const my::ui::TestCase &instance = *handle; |
| 25 | my::ui::TestStruct test_struct {.condition = false}; |
| 26 | test_struct.condition = true; |
| 27 | instance.set_test_struct(test_struct); |
| 28 | assert(instance.get_test_struct() == test_struct); |
| 29 | instance.set_test_enum(my::ui::TestEnum::A); |
| 30 | auto test_enum = instance.get_test_enum(); |
| 31 | test_enum = my::ui::TestEnum::B; |
| 32 | instance.set_test_enum(test_enum); |
| 33 | assert(instance.get_test_enum() == my::ui::TestEnum::B); |
| 34 | ``` |
| 35 | |
| 36 | */ |