1// Copyright © SixtyFPS GmbH <info@slint.dev>
2// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
3
4export enum Foo { bli, bla, blu }
5
6// (override the builtin 'InputType')
7export enum InputType { Xxx, Yyy, Zzz }
8
9export enum With-dash { hallo, hello-world, halloWorld}
10
11export component TestCase {
12 in-out property<Foo> foo: Foo.bla;
13 in-out property<Foo> default;
14
15 in-out property<InputType> input-type: InputType.Xxx;
16
17 out property <bool> test: foo == Foo.bla && default == Foo.bli && input-type == InputType.Xxx;
18
19 in property <With-dash> dash: halloWorld;
20}
21
22/*
23```rust
24let instance = TestCase::new().unwrap();
25
26assert_eq!(instance.get_foo(), Foo::Bla);
27assert!(instance.get_test());
28instance.set_foo(Foo::Blu);
29assert!(!instance.get_test());
30
31assert_eq!(instance.get_dash(), With_dash::HalloWorld);
32instance.set_dash(With_dash::Hallo);
33instance.set_dash(With_dash::HelloWorld);
34
35```
36
37```cpp
38auto handle = TestCase::create();
39const TestCase &instance = *handle;
40
41assert(instance.get_foo() == Foo::Bla);
42assert(instance.get_test());
43instance.set_foo(Foo::Blu);
44assert(!instance.get_test());
45
46assert(instance.get_dash() == With_dash::HalloWorld);
47instance.set_dash(With_dash::Hallo);
48instance.set_dash(With_dash::HelloWorld);
49```
50
51*/
52