Skip to main content

uiautomation/
types.rs

1use std::ffi::c_void;
2use std::fmt::Debug;
3use std::fmt::Display;
4
5use uiautomation_derive::EnumConvert;
6use uiautomation_derive::map_as;
7use windows::core::Free;
8use windows::Win32::Foundation::HANDLE;
9use windows::Win32::Foundation::HWND;
10use windows::Win32::Foundation::POINT;
11use windows::Win32::Foundation::RECT;
12
13/// A Point type stores the x and y position.
14#[derive(Clone, Copy, PartialEq, Default)]
15pub struct Point(POINT);
16
17impl Point {
18    /// Creates a new position.
19    pub fn new(x: i32, y: i32) -> Self {
20        Self(POINT {
21            x,
22            y
23        })
24    }
25
26    /// Retrievies the x position.
27    pub fn get_x(&self) -> i32 {
28        self.0.x
29    }
30
31    /// Sets the x position.
32    pub fn set_x(&mut self, x: i32) {
33        self.0.x = x;
34    }
35
36    /// Retrieves the y position.
37    pub fn get_y(&self) -> i32 {
38        self.0.y
39    }
40
41    /// Sets the y position.
42    pub fn set_y(&mut self, y: i32) {
43        self.0.y = y;
44    }
45
46    /// Offsets the point by dx and dy.
47    pub fn offset(&mut self, dx: i32, dy: i32) {
48        self.0.x += dx;
49        self.0.y += dy;
50    }
51}
52
53impl Eq for Point {
54}
55
56impl Debug for Point {
57    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
58        f.debug_struct("Point").field("x", &self.0.x).field("y", &self.0.y).finish()
59    }
60}
61
62impl Display for Point {
63    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
64        write!(f, "({}, {})", self.0.x, self.0.y)
65    }
66}
67
68impl From<POINT> for Point {
69    fn from(point: POINT) -> Self {
70        Self(point)
71    }
72}
73
74impl Into<POINT> for Point {
75    fn into(self) -> POINT {
76        self.0
77    }
78}
79
80impl AsRef<POINT> for Point {
81    fn as_ref(&self) -> &POINT {
82        &self.0
83    }
84}
85
86impl AsMut<POINT> for Point {
87    fn as_mut(&mut self) -> &mut POINT {
88        &mut self.0
89    }
90}
91
92/// A Rect type stores the position and size of a rectangle.
93#[derive(Clone, Copy, PartialEq, Default)]
94pub struct Rect(RECT);
95
96impl Rect {
97    /// Creates a new rect.
98    pub fn new(left: i32, top: i32, right: i32, bottom: i32) -> Self {
99        Self(RECT {
100            left,
101            top,
102            right,
103            bottom
104        })
105    }
106
107    /// Retrieves the left of the rect.
108    pub fn get_left(&self) -> i32 {
109        self.0.left
110    }
111
112    /// Sets the left of the rect.
113    pub fn set_left(&mut self, left: i32) {
114        self.0.left = left;
115    }
116
117    /// Retrieves the top of the rect.
118    pub fn get_top(&self) -> i32 {
119        self.0.top
120    }
121
122    /// Sets the top of the rect.
123    pub fn set_top(&mut self, top: i32) {
124        self.0.top = top;
125    }
126
127    /// Retrieves the right of the rect.
128    pub fn get_right(&self) -> i32 {
129        self.0.right
130    }
131
132    /// Sets the right of the rect.
133    pub fn set_right(&mut self, right: i32) {
134        self.0.right = right;
135    }
136
137    /// Retrieves the bottom of the rect.
138    pub fn get_bottom(&self) -> i32 {
139        self.0.bottom
140    }
141
142    /// Sets the bottom of the rect.
143    pub fn set_bottom(&mut self, bottom: i32) {
144        self.0.bottom = bottom;
145    }
146
147    /// Retrieves the top left point.
148    pub fn get_top_left(&self) -> Point {
149        Point::new(self.get_left(), self.get_top())
150    }
151
152    /// Retrieves the right bottom point.
153    pub fn get_right_bottom(&self) -> Point {
154        Point::new(self.get_right(), self.get_bottom())
155    }
156
157    /// Retrieves the width of the rect.
158    pub fn get_width(&self) -> i32 {
159        self.0.right - self.0.left + 1
160    }
161
162    /// Retrieves the height of the rect.
163    pub fn get_height(&self) -> i32 {
164        self.0.bottom - self.0.top + 1
165    }
166}
167
168impl Eq for Rect {
169    
170}
171
172impl Debug for Rect {
173    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
174        f.debug_struct("Rect").field("left", &self.0.left).field("top", &self.0.top).field("right", &self.0.right).field("bottom", &self.0.bottom).finish()
175    }
176}
177
178impl Display for Rect {
179    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
180        write!(f, "[({}, {}), ({}, {})]", self.0.left, self.0.top, self.0.right, self.0.bottom)
181    }
182}
183
184impl From<RECT> for Rect {
185    fn from(rect: RECT) -> Self {
186        Self(rect)
187    }
188}
189
190impl Into<RECT> for Rect {
191    fn into(self) -> RECT {
192        self.0
193    }
194}
195
196impl AsRef<RECT> for Rect {
197    fn as_ref(&self) -> &RECT {
198        &self.0
199    }
200}
201
202impl AsMut<RECT> for Rect {
203    fn as_mut(&mut self) -> &mut RECT {
204        &mut self.0
205    }
206}
207
208/// A Wrapper for windows `HANDLE`.
209#[derive(Default, Clone, Copy)]
210pub struct Handle(HANDLE);
211
212impl Handle {
213    /// Checks if the handle is invalid.
214    pub fn is_invalid(&self) -> bool {
215        self.0.is_invalid()
216    }
217
218    /// Frees current handle.
219    pub fn free(&mut self) {
220        unsafe { self.0.free() };
221    }
222}
223
224impl Debug for Handle {
225    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
226        let v: isize = unsafe {
227            std::mem::transmute(self.0.0)
228        };
229        write!(f, "Handle(0x{:X})", v)
230    }
231}
232
233impl Display for Handle {
234    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
235        write!(f, "{:?}", self.0)
236    }
237}
238
239impl From<HWND> for Handle {
240    fn from(hwnd: HWND) -> Self {
241        Self(hwnd.into())
242    }
243}
244
245impl Into<HWND> for Handle {
246    fn into(self) -> HWND {
247        HWND(self.0.0)
248    }
249}
250
251impl From<HANDLE> for Handle {
252    fn from(handle: HANDLE) -> Self {
253        Self(handle)
254    }
255}
256
257impl Into<HANDLE> for Handle {
258    fn into(self) -> HANDLE {
259        self.0
260    }
261}
262
263impl AsRef<HANDLE> for Handle {
264    fn as_ref(&self) -> &HANDLE {
265        &self.0
266    }
267}
268
269// impl Param<HWND> for Handle {
270//     unsafe fn param(self) -> windows::core::ParamValue<HWND> {
271//         windows::core::ParamValue::Owned(self.0)
272//     }
273// }
274
275impl From<isize> for Handle {
276    fn from(value: isize) -> Self {
277        // let hwd: *mut c_void = unsafe {
278        //     std::mem::transmute(value)
279        // };
280        let hwd: *mut c_void = std::ptr::with_exposed_provenance_mut(value as _);
281        Self(HANDLE(hwd))
282    }
283}
284
285impl Into<isize> for Handle {
286    fn into(self) -> isize {
287        unsafe {
288            std::mem::transmute(self.0.0)
289        }
290    }
291}
292
293// impl AsRef<isize> for Handle {
294//     fn as_ref(&self) -> &isize {
295//         &self.0.0
296//     }
297// }
298
299/// Defines enum for `windows::Win32::UI::Accessibility::UIA_PROPERTY_ID`.
300/// 
301/// Describes the named constants that identify the properties of Microsoft UI Automation elements.
302#[repr(i32)]
303#[derive(Debug, Clone, Copy, PartialEq, Eq, EnumConvert)]
304#[map_as(windows::Win32::UI::Accessibility::UIA_PROPERTY_ID)]
305pub enum UIProperty {
306    /// Identifies the RuntimeId property, which is an array of integers representing the identifier for an automation element.
307    RuntimeId = 30000i32,
308    /// Identifies the BoundingRectangle property, which specifies the coordinates of the rectangle that completely encloses the automation element.
309    BoundingRectangle = 30001i32,
310    /// Identifies the ProcessId property, which is an integer representing the process identifier (ID) of the automation element.
311    ProcessId = 30002i32,
312    /// Identifies the ControlType property, which is a class that identifies the type of the automation element. 
313    ControlType = 30003i32,
314    /// Identifies the LocalizedControlType property, which is a text string describing the type of control that the automation element represents.
315    LocalizedControlType = 30004i32,
316    /// Identifies the Name property, which is a string that holds the name of the automation element.
317    Name = 30005i32,
318    /// Identifies the AcceleratorKey property, which is a string containing the accelerator key (also called shortcut key) combinations for the automation element.
319    AcceleratorKey = 30006i32,
320    /// Identifies the AccessKey property, which is a string containing the access key character for the automation element.
321    AccessKey = 30007i32,
322    /// Identifies the HasKeyboardFocus property, which is a Boolean value that indicates whether the automation element has keyboard focus.
323    HasKeyboardFocus = 30008i32,
324    /// Identifies the IsKeyboardFocusable property, which is a Boolean value that indicates whether the automation element can accept keyboard focus.
325    IsKeyboardFocusable = 30009i32,
326    /// Identifies the IsEnabled property, which is a Boolean value that indicates whether the UI item referenced by the automation element is enabled and can be interacted with.
327    IsEnabled = 30010i32,
328    /// Identifies the AutomationId property, which is a string containing the UI Automation identifier (ID) for the automation element.
329    AutomationId = 30011i32,
330    /// Identifies the ClassName property, which is a string containing the class name for the automation element as assigned by the control developer.
331    ClassName = 30012i32,
332    /// Identifies the HelpText property, which is a help text string associated with the automation element.
333    HelpText = 30013i32,
334    /// Identifies the ClickablePoint property, which is a point on the automation element that can be clicked. 
335    ClickablePoint = 30014i32,
336    /// Identifies the Culture property, which contains a locale identifier for the automation element.
337    Culture = 30015i32,
338    /// Identifies the IsControlElement property, which is a Boolean value that specifies whether the element appears in the control view of the automation element tree.
339    IsControlElement = 30016i32,
340    /// Identifies the IsContentElement property, which is a Boolean value that specifies whether the element appears in the content view of the automation element tree.
341    IsContentElement = 30017i32,
342    /// Identifies the LabeledBy property, which is an automation element that contains the text label for this element.
343    LabeledBy = 30018i32,
344    /// Identifies the IsPassword property, which is a Boolean value that indicates whether the automation element contains protected content or a password.
345    IsPassword = 30019i32,
346    /// Identifies the NativeWindowHandle property, which is an integer that represents the handle (HWND) of the automation element window, if it exists; otherwise, this property is 0.
347    NativeWindowHandle = 30020i32,
348    /// Identifies the ItemType property, which is a text string describing the type of the automation element.
349    ItemType = 30021i32,
350    /// Identifies the IsOffscreen property, which is a Boolean value that indicates whether the automation element is entirely scrolled out of view (for example, an item in a list box that is outside the viewport of the container object) or collapsed out of view (for example, an item in a tree view or menu, or in a minimized window). 
351    IsOffscreen = 30022i32,
352    /// Identifies the Orientation property, which indicates the orientation of the control represented by the automation element. The property is expressed as a value from the OrientationType enumerated type.
353    Orientation = 30023i32,
354    /// Identifies the FrameworkId property, which is a string containing the name of the underlying UI framework that the automation element belongs to.
355    FrameworkId = 30024i32,
356    /// Identifies the IsRequiredForForm property, which is a Boolean value that indicates whether the automation element is required to be filled out on a form.
357    IsRequiredForForm = 30025i32,
358    /// Identifies the ItemStatus property, which is a text string describing the status of an item of the automation element.
359    ItemStatus = 30026i32,
360    /// Identifies the IsDockPatternAvailable property, which indicates whether the Dock control pattern is available for the automation element.
361    IsDockPatternAvailable = 30027i32,
362    /// Identifies the IsExpandCollapsePatternAvailable property, which indicates whether the ExpandCollapse control pattern is available for the automation element.
363    IsExpandCollapsePatternAvailable = 30028i32,
364    /// Identifies the IsGridItemPatternAvailable property, which indicates whether the GridItem control pattern is available for the automation element.
365    IsGridItemPatternAvailable = 30029i32,
366    /// Identifies the IsGridPatternAvailable property, which indicates whether the Grid control pattern is available for the automation element.
367    IsGridPatternAvailable = 30030i32,
368    /// Identifies the IsInvokePatternAvailable property, which indicates whether the Invoke control pattern is available for the automation element.
369    IsInvokePatternAvailable = 30031i32,
370    /// Identifies the IsMultipleViewPatternAvailable property, which indicates whether the MultipleView control pattern is available for the automation element.
371    IsMultipleViewPatternAvailable = 30032i32,
372    /// Identifies the IsRangeValuePatternAvailable property, which indicates whether the RangeValue control pattern is available for the automation element.
373    IsRangeValuePatternAvailable = 30033i32,
374    /// Identifies the IsScrollPatternAvailable property, which indicates whether the Scroll control pattern is available for the automation element.
375    IsScrollPatternAvailable = 30034i32,
376    /// Identifies the IsScrollItemPatternAvailable property, which indicates whether the ScrollItem control pattern is available for the automation element.
377    IsScrollItemPatternAvailable = 30035i32,
378    /// Identifies the IsSelectionItemPatternAvailable property, which indicates whether the SelectionItem control pattern is available for the automation element. 
379    IsSelectionItemPatternAvailable = 30036i32,
380    /// Identifies the IsSelectionPatternAvailable property, which indicates whether the Selection control pattern is available for the automation element.
381    IsSelectionPatternAvailable = 30037i32,
382    /// Identifies the IsTablePatternAvailable property, which indicates whether the Table control pattern is available for the automation element.
383    IsTablePatternAvailable = 30038i32,
384    /// Identifies the IsTableItemPatternAvailable property, which indicates whether the TableItem control pattern is available for the automation element.
385    IsTableItemPatternAvailable = 30039i32,
386    /// Identifies the IsTextPatternAvailable property, which indicates whether the Text control pattern is available for the automation element.
387    IsTextPatternAvailable = 30040i32,
388    /// Identifies the IsTogglePatternAvailable property, which indicates whether the Toggle control pattern is available for the automation element.
389    IsTogglePatternAvailable = 30041i32,
390    /// Identifies the IsTransformPatternAvailable property, which indicates whether the Transform control pattern is available for the automation element.
391    IsTransformPatternAvailable = 30042i32,
392    /// Identifies the IsValuePatternAvailable property, which indicates whether the Value control pattern is available for the automation element.
393    IsValuePatternAvailable = 30043i32,
394    /// Identifies the IsWindowPatternAvailable property, which indicates whether the Window control pattern is available for the automation element.
395    IsWindowPatternAvailable = 30044i32,
396    /// Identifies the Value property of the Value control pattern.
397    ValueValue = 30045i32,
398    /// Identifies the IsReadOnly property of the Value control pattern.
399    ValueIsReadOnly = 30046i32,
400    /// Identifies the Value property of the RangeValue control pattern.
401    RangeValueValue = 30047i32,
402    /// Identifies the IsReadOnly property of the RangeValue control pattern.
403    RangeValueIsReadOnly = 30048i32,
404    /// Identifies the Minimum property of the RangeValue control pattern.
405    RangeValueMinimum = 30049i32,
406    /// Identifies the Maximum property of the RangeValue control pattern.
407    RangeValueMaximum = 30050i32,
408    /// Identifies the LargeChange property of the RangeValue control pattern.
409    RangeValueLargeChange = 30051i32,
410    /// Identifies the SmallChange property of the RangeValue control pattern.
411    RangeValueSmallChange = 30052i32,
412    /// Identifies the HorizontalScrollPercent property of the Scroll control pattern.
413    ScrollHorizontalScrollPercent = 30053i32,
414    /// Identifies the HorizontalViewSize property of the Scroll control pattern.
415    ScrollHorizontalViewSize = 30054i32,
416    /// Identifies the VerticalScrollPercent property of the Scroll control pattern.
417    ScrollVerticalScrollPercent = 30055i32,
418    /// Identifies the VerticalViewSize property of the Scroll control pattern.
419    ScrollVerticalViewSize = 30056i32,
420    /// Identifies the HorizontallyScrollable property of the Scroll control pattern.
421    ScrollHorizontallyScrollable = 30057i32,
422    /// Identifies the VerticallyScrollable property of the Scroll control pattern.
423    ScrollVerticallyScrollable = 30058i32,
424    /// Identifies the Selection property of the Selection control pattern.
425    SelectionSelection = 30059i32,
426    /// Identifies the CanSelectMultiple property of the Selection control pattern.
427    SelectionCanSelectMultiple = 30060i32,
428    /// Identifies the IsSelectionRequired property of the Selection control pattern.
429    SelectionIsSelectionRequired = 30061i32,
430    /// Identifies the RowCount property of the Grid control pattern. This property indicates the total number of rows in the grid.
431    GridRowCount = 30062i32,
432    /// Identifies the ColumnCount property of the Grid control pattern. This property indicates the total number of columns in the grid.
433    GridColumnCount = 30063i32,
434    /// Identifies the Row property of the GridItem control pattern. This property is the ordinal number of the row that contains the cell or item.
435    GridItemRow = 30064i32,
436    /// Identifies the Column property of the GridItem control pattern. This property indicates the ordinal number of the column that contains the cell or item.
437    GridItemColumn = 30065i32,
438    /// Identifies the RowSpan property of the GridItem control pattern. This property indicates the number of rows spanned by the cell or item.
439    GridItemRowSpan = 30066i32,
440    /// Identifies the ColumnSpan property of the GridItem control pattern. This property indicates the number of columns spanned by the cell or item.
441    GridItemColumnSpan = 30067i32,
442    /// Identifies the ContainingGrid property of the GridItem control pattern.
443    GridItemContainingGrid = 30068i32,
444    /// Identifies the DockPosition property of the Dock control pattern.
445    DockDockPosition = 30069i32,
446    /// Identifies the ExpandCollapseState property of the ExpandCollapse control pattern.
447    ExpandCollapseExpandCollapseState = 30070i32,
448    /// Identifies the CurrentView property of the MultipleView control pattern.
449    MultipleViewCurrentView = 30071i32,
450    /// Identifies the SupportedViews property of the MultipleView control pattern.
451    MultipleViewSupportedViews = 30072i32,
452    /// Identifies the CanMaximize property of the Window control pattern.
453    WindowCanMaximize = 30073i32,
454    /// Identifies the CanMinimize property of the Window control pattern.
455    WindowCanMinimize = 30074i32,
456    /// Identifies the WindowVisualState property of the Window control pattern.
457    WindowWindowVisualState = 30075i32,
458    /// Identifies the WindowInteractionState property of the Window control pattern.
459    WindowWindowInteractionState = 30076i32,
460    /// Identifies the IsModal property of the Window control pattern.
461    WindowIsModal = 30077i32,
462    /// Identifies the IsTopmost property of the Window control pattern.
463    WindowIsTopmost = 30078i32,
464    /// Identifies the IsSelected property of the SelectionItem control pattern.
465    SelectionItemIsSelected = 30079i32,
466    /// Identifies the SelectionContainer property of the SelectionItem control pattern.
467    SelectionItemSelectionContainer = 30080i32,
468    /// Identifies the RowHeaders property of the Table control pattern.
469    TableRowHeaders = 30081i32,
470    /// Identifies the ColumnHeaders property of the Table control pattern.
471    TableColumnHeaders = 30082i32,
472    /// Identifies the RowOrColumnMajor property of the Table control pattern.
473    TableRowOrColumnMajor = 30083i32,
474    /// Identifies the RowHeaderItems property of the TableItem control pattern.
475    TableItemRowHeaderItems = 30084i32,
476    /// Identifies the ColumnHeaderItems property of the TableItem control pattern.
477    TableItemColumnHeaderItems = 30085i32,
478    /// Identifies the ToggleState property of the Toggle control pattern.
479    ToggleToggleState = 30086i32,
480    /// Identifies the CanMove property of the Transform control pattern.
481    TransformCanMove = 30087i32,
482    /// Identifies the CanResize property of the Transform control pattern.
483    TransformCanResize = 30088i32,
484    /// Identifies the CanRotate property of the Transform control pattern.
485    TransformCanRotate = 30089i32,
486    /// Identifies the IsLegacyIAccessiblePatternAvailable property, which indicates whether the LegacyIAccessible control pattern is available for the automation element.
487    IsLegacyIAccessiblePatternAvailable = 30090i32,
488    /// Identifies the ChildId property of the LegacyIAccessible control pattern.
489    LegacyIAccessibleChildId = 30091i32,
490    /// Identifies the Name property of the LegacyIAccessible control pattern.
491    LegacyIAccessibleName = 30092i32,
492    /// Identifies the Value property of the LegacyIAccessible control pattern.
493    LegacyIAccessibleValue = 30093i32,
494    /// Identifies the Description property of the LegacyIAccessible control pattern.
495    LegacyIAccessibleDescription = 30094i32,
496    /// Identifies the Roleproperty of the LegacyIAccessible control pattern.
497    LegacyIAccessibleRole = 30095i32,
498    /// Identifies the State property of the LegacyIAccessible control pattern.
499    LegacyIAccessibleState = 30096i32,
500    /// Identifies the Help property of the LegacyIAccessible control pattern.
501    LegacyIAccessibleHelp = 30097i32,
502    /// Identifies the KeyboardShortcut property of the LegacyIAccessible control pattern.
503    LegacyIAccessibleKeyboardShortcut = 30098i32,
504    /// Identifies the Selection property of the LegacyIAccessible control pattern.
505    LegacyIAccessibleSelection = 30099i32,
506    /// Identifies the DefaultAction property of the LegacyIAccessible control pattern.
507    LegacyIAccessibleDefaultAction = 30100i32,
508    /// Identifies the AriaRole property, which is a string containing the Accessible Rich Internet Application (ARIA) role information for the automation element. 
509    AriaRole = 30101i32,
510    /// Identifies the AriaProperties property, which is a formatted string containing the Accessible Rich Internet Application (ARIA) property information for the automation element. 
511    AriaProperties = 30102i32,
512    /// Identifies the IsDataValidForForm property, which is a Boolean value that indicates whether the entered or selected value is valid for the form rule associated with the automation element. 
513    IsDataValidForForm = 30103i32,
514    /// Identifies the ControllerFor property, which is an array of automation elements that are manipulated by the automation element that supports this property.
515    ControllerFor = 30104i32,
516    /// Identifies the DescribedBy property, which is an array of elements that provide more information about the automation element.
517    DescribedBy = 30105i32,
518    /// Identifies the FlowsTo property, which is an array of automation elements that suggests the reading order after the current automation element.
519    FlowsTo = 30106i32,
520    /// Identifies the ProviderDescription property, which is a formatted string containing the source information of the UI Automation provider for the automation element, including proxy information.
521    ProviderDescription = 30107i32,
522    /// Identifies the IsItemContainerPatternAvailable property, which indicates whether the ItemContainer control pattern is available for the automation element.
523    IsItemContainerPatternAvailable = 30108i32,
524    /// Identifies the IsVirtualizedItemPatternAvailable property, which indicates whether the VirtualizedItem control pattern is available for the automation element.
525    IsVirtualizedItemPatternAvailable = 30109i32,
526    /// Identifies the IsSynchronizedInputPatternAvailable property, which indicates whether the SynchronizedInput control pattern is available for the automation element.
527    IsSynchronizedInputPatternAvailable = 30110i32,
528    /// Identifies the OptimizeForVisualContent property, which is a Boolean value that indicates whether the provider exposes only elements that are visible.
529    OptimizeForVisualContent = 30111i32,
530    /// Identifies the IsObjectModelPatternAvailable property, which indicates whether the ObjectModel control pattern is available for the automation element.
531    IsObjectModelPatternAvailable = 30112i32,
532    /// Identifies the AnnotationTypeId property of the Annotation control pattern. Supported starting with Windows 8.
533    AnnotationAnnotationTypeId = 30113i32,
534    /// Identifies the AnnotationTypeName property of the Annotation control pattern. Supported starting with Windows 8.
535    AnnotationAnnotationTypeName = 30114i32,
536    /// Identifies the Author property of the Annotation control pattern. Supported starting with Windows 8.
537    AnnotationAuthor = 30115i32,
538    /// Identifies the DateTime property of the Annotation control pattern. Supported starting with Windows 8.
539    AnnotationDateTime = 30116i32,
540    /// Identifies the Target property of the Annotation control pattern. Supported starting with Windows 8.
541    AnnotationTarget = 30117i32,
542    /// Identifies the IsAnnotationPatternAvailable property, which indicates whether the Annotation control pattern is available for the automation element.
543    IsAnnotationPatternAvailable = 30118i32,
544    /// Identifies the IsTextPattern2Available property, which indicates whether version two of the Text control pattern is available for the automation element.
545    IsTextPattern2Available = 30119i32,
546    /// Identifies the StyleId property of the Styles control pattern.
547    StylesStyleId = 30120i32,
548    /// Identifies the StyleName property of the Styles control pattern.
549    StylesStyleName = 30121i32,
550    /// Identifies the FillColor property of the Styles control pattern.
551    StylesFillColor = 30122i32,
552    /// Identifies the FillPatternStyle property of the Styles control pattern.
553    StylesFillPatternStyle = 30123i32,
554    /// Identifies the Shape property of the Styles control pattern.
555    StylesShape = 30124i32,
556    /// Identifies the FillPatternColor property of the Styles control pattern.
557    StylesFillPatternColor = 30125i32,
558    /// Identifies the ExtendedProperties property of the Styles control pattern.
559    StylesExtendedProperties = 30126i32,
560    /// Identifies the IsStylesPatternAvailable property, which indicates whether the Styles control pattern is available for the automation element.
561    IsStylesPatternAvailable = 30127i32,
562    /// Identifies the IsSpreadsheetPatternAvailable property, which indicates whether the Spreadsheet control pattern is available for the automation element.
563    IsSpreadsheetPatternAvailable = 30128i32,
564    /// Identifies the Formula property of the SpreadsheetItem control pattern.
565    SpreadsheetItemFormula = 30129i32,
566    /// Identifies the AnnotationObjects property of the SpreadsheetItem control pattern.
567    SpreadsheetItemAnnotationObjects = 30130i32,
568    /// Identifies the AnnotationTypes property of the SpreadsheetItem control pattern. Supported starting with Windows 8.
569    SpreadsheetItemAnnotationTypes = 30131i32,
570    /// Identifies the IsSpreadsheetItemPatternAvailable property, which indicates whether the SpreadsheetItem control pattern is available for the automation element.
571    IsSpreadsheetItemPatternAvailable = 30132i32,
572    /// Identifies the CanZoom property of the Transform control pattern. Supported starting with Windows 8.
573    Transform2CanZoom = 30133i32,
574    /// Identifies the IsTransformPattern2Available property, which indicates whether version two of the Transform control pattern is available for the automation element.
575    IsTransformPattern2Available = 30134i32,
576    /// Identifies the LiveSetting property, which is supported by an automation element that represents a live region.
577    LiveSetting = 30135i32,
578    /// Identifies the IsTextChildPatternAvailable property, which indicates whether the TextChild control pattern is available for the automation element.
579    IsTextChildPatternAvailable = 30136i32,
580    /// Identifies the IsDragPatternAvailable property, which indicates whether the Drag control pattern is available for the automation element.
581    IsDragPatternAvailable = 30137i32,
582    /// Identifies the IsGrabbed property of the Drag control pattern. Supported starting with Windows 8.
583    DragIsGrabbed = 30138i32,
584    /// Identifies the DropEffect property of the Drag control pattern. Supported starting with Windows 8.
585    DragDropEffect = 30139i32,
586    /// Identifies the DropEffects property of the Drag control pattern. Supported starting with Windows 8.
587    DragDropEffects = 30140i32,
588    /// Identifies the IsDropTargetPatternAvailable property, which indicates whether the DropTarget control pattern is available for the automation element.
589    IsDropTargetPatternAvailable = 30141i32,
590    /// Identifies the DropTargetEffect property of the DropTarget control pattern. Supported starting with Windows 8.
591    DropTargetDropTargetEffect = 30142i32,
592    /// Identifies the DropTargetEffects property of the DropTarget control pattern. Supported starting with Windows 8.
593    DropTargetDropTargetEffects = 30143i32,
594    /// Identifies the GrabbedItems property of the Drag control pattern. Supported starting with Windows 8.
595    DragGrabbedItems = 30144i32,
596    /// Identifies the ZoomLevel property of the Transform control pattern. Supported starting with Windows 8.
597    Transform2ZoomLevel = 30145i32,
598    /// Identifies the ZoomMinimum property of the Transform control pattern. Supported starting with Windows 8.
599    Transform2ZoomMinimum = 30146i32,
600    /// Identifies the ZoomMaximum property of the Transform control pattern. Supported starting with Windows 8.
601    Transform2ZoomMaximum = 30147i32,
602    /// Identifies the FlowsFrom property, which is an array of automation elements that suggests the reading order before the current automation element. Supported starting with Windows 8.
603    FlowsFrom = 30148i32,
604    /// Identifies the IsTextEditPatternAvailable property, which indicates whether the TextEdit control pattern is available for the automation element.
605    IsTextEditPatternAvailable = 30149i32,
606    /// Identifies the IsPeripheral property, which is a Boolean value that indicates whether the automation element represents peripheral UI.
607    IsPeripheral = 30150i32,
608    /// Identifies the IsCustomNavigationPatternAvailable property, which indicates whether the CustomNavigation control pattern is available for the automation element.
609    IsCustomNavigationPatternAvailable = 30151i32,
610    /// Identifies the PositionInSet property, which is a 1-based integer associated with an automation element.
611    PositionInSet = 30152i32,
612    /// Identifies the SizeOfSet property, which is a 1-based integer associated with an automation element.
613    SizeOfSet = 30153i32,
614    /// Identifies the Level property, which is a 1-based integer associated with an automation element.
615    Level = 30154i32,
616    /// Identifies the AnnotationTypes property, which is a list of the types of annotations in a document, such as comment, header, footer, and so on.
617    AnnotationTypes = 30155i32,
618    /// Identifies the AnnotationObjects property, which is a list of annotation objects in a document, such as comment, header, footer, and so on.
619    AnnotationObjects = 30156i32,
620    /// Identifies the LandmarkType property, which is a Landmark Type Identifier associated with an element.
621    LandmarkType = 30157i32,
622    /// Identifies the LocalizedLandmarkType, which is a text string describing the type of landmark that the automation element represents.
623    LocalizedLandmarkType = 30158i32,
624    /// The FullDescription property exposes a localized string which can contain extended description text for an element. 
625    FullDescription = 30159i32,
626    /// Identifies the FillColor property, which specifies the color used to fill the automation element.
627    FillColor = 30160i32,
628    /// Identifies the OutlineColor property, which specifies the color used for the outline of the automation element.
629    OutlineColor = 30161i32,
630    /// Identifies the FillType property, which specifies the pattern used to fill the automation element, such as none, color, gradient, picture, pattern, and so on.
631    FillType = 30162i32,
632    /// Identifies the VisualEffects property, which is a bit field that specifies effects on the automation element, such as shadow, reflection, glow, soft edges, or bevel.
633    VisualEffects = 30163i32,
634    /// Identifies the OutlineThickness property, which specifies the width for the outline of the automation element.
635    OutlineThickness = 30164i32,
636    /// Identifies the CenterPoint property, which specifies the center X and Y point coordinates of the automation element. 
637    CenterPoint = 30165i32,
638    /// Identifies the Rotation property, which specifies the angle of rotation in unspecified units.
639    Rotation = 30166i32,
640    /// Identifies the Size property, which specifies the width and height of the automation element.
641    Size = 30167i32,
642    /// Identifies whether the Selection2 control pattern is available.
643    IsSelectionPattern2Available = 30168i32,
644    /// Identifies the FirstSelectedItem property of the Selection2 control pattern.
645    Selection2FirstSelectedItem = 30169i32,
646    /// Identifies the LastSelectedItem property of the Selection2 control pattern.
647    Selection2LastSelectedItem = 30170i32,
648    /// Identifies the CurrentSelectedItem property of the Selection2 control pattern.
649    Selection2CurrentSelectedItem = 30171i32,
650    /// Identifies the ItemCount property of the Selection2 control pattern.
651    Selection2ItemCount = 30172i32,
652    /// Identifies the HeadingLevel property, which indicates the heading level of a UI Automation element.
653    HeadingLevel = 30173i32,
654    /// Identifies the IsDialog property, which is a Boolean value that indicates whether the automation element is a dialog window. 
655    IsDialog = 30174i32,
656}
657
658/// Defines enum for `windows::Win32::UI::Accessibility::WindowInteractionState`.
659/// 
660/// Contains values that specify the current state of the window for purposes of user interaction.
661#[repr(i32)]
662#[derive(Debug, Clone, Copy, PartialEq, Eq, EnumConvert)]
663#[map_as(windows::Win32::UI::Accessibility::WindowInteractionState)]
664pub enum WindowInteractionState {
665    /// The window is running. This does not guarantee that the window is ready for user interaction or is responding.
666    Running = 0i32, 
667    /// The window is closing.
668    Closing = 1i32,
669    /// The window is ready for user interaction.
670    ReadyForUserInteraction = 2i32,
671    /// The window is blocked by a modal window.
672    BlockedByModalWindow = 3i32,
673    /// The window is not responding.
674    NotResponding = 4i32
675}
676
677/// Defines enum for `windows::Win32::UI::Accessibility::DockPosition`.
678/// 
679/// Contains values that specify the dock position of an object, represented by a DockPattern, within a docking container.
680#[repr(i32)]
681#[derive(Debug, Clone, Copy, PartialEq, Eq, EnumConvert)]
682#[map_as(windows::Win32::UI::Accessibility::DockPosition)]
683pub enum DockPosition {
684    /// Indicates that the UI Automation element is docked along the top edge of the docking container.
685    Top = 0i32,
686    /// Indicates that the UI Automation element is docked along the left edge of the docking container.
687    Left = 1i32,
688    /// Indicates that the UI Automation element is docked along the bottom edge of the docking container.
689    Bottom = 2i32,
690    /// Indicates that the UI Automation element is docked along the right edge of the docking container.
691    Right = 3i32,
692    /// Indicates that the UI Automation element is docked along all edges of the docking container and fills all available space within the container.
693    Fill = 4i32,
694    /// Indicates that the UI Automation element is not docked to any edge of the docking container.
695    None = 5i32,
696}
697
698/// Defines enum for `windows::Win32::UI::Accessibility::ExpandCollapseState`.
699/// 
700/// Contains values that specify the ExpandCollapseState automation property value of a UI Automation element.
701#[repr(i32)]
702#[derive(Debug, Clone, Copy, PartialEq, Eq, EnumConvert)]
703#[map_as(windows::Win32::UI::Accessibility::ExpandCollapseState)]
704pub enum ExpandCollapseState {
705    /// No child nodes, controls, or content of the UI Automation element are displayed.
706    Collapsed = 0i32,
707    /// All child nodes, controls, and content of the UI Automation element are displayed.
708    Expanded = 1i32,
709    /// Some, but not all, child nodes, controls, or content of the UI Automation element are displayed.
710    PartiallyExpanded = 2i32,
711    /// The UI Automation element has no child nodes, controls, or content to display.
712    LeafNode = 3i32
713}
714
715/// Defines enum for `windows::Win32::UI::Accessibility::NavigateDirection`.
716/// 
717/// Contains values used to specify the direction of navigation within the Microsoft UI Automation tree.
718#[repr(i32)]
719#[derive(Debug, Clone, Copy, PartialEq, Eq, EnumConvert)]
720#[map_as(windows::Win32::UI::Accessibility::NavigateDirection)]
721pub enum NavigateDirection {
722    /// The navigation direction is to the parent.
723    Parent = 0i32,
724    /// The navigation direction is to the next sibling.
725    NextSibling = 1i32,
726    /// The navigation direction is to the previous sibling.
727    PreviousSibling = 2i32,
728    /// The navigation direction is to the first child.
729    FirstChild = 3i32,
730    /// The navigation direction is to the last child.
731    LastChild = 4i32
732}
733
734/// Defines enum for `windows::Win32::UI::Accessibility::RowOrColumnMajor`.
735/// 
736/// Contains values that specify whether data in a table should be read primarily by row or by column.
737#[repr(i32)]
738#[derive(Debug, Clone, Copy, PartialEq, Eq, EnumConvert)]
739#[map_as(windows::Win32::UI::Accessibility::RowOrColumnMajor)]
740pub enum RowOrColumnMajor {
741    /// Data in the table should be read row by row.
742    RowMajor = 0i32,
743    /// Data in the table should be read column by column.
744    ColumnMajor = 1i32,
745    /// The best way to present the data is indeterminate.
746    Indeterminate = 2i32
747}
748
749/// Defines enum for `windows::Win32::UI::Accessibility::ScrollAmount`.
750/// 
751/// Contains values that specify the direction and distance to scroll.
752#[repr(i32)]
753#[derive(Debug, Clone, Copy, PartialEq, Eq, EnumConvert)]
754#[map_as(windows::Win32::UI::Accessibility::ScrollAmount)]
755pub enum ScrollAmount {
756    /// Scrolling is done in large decrements, equivalent to pressing the PAGE UP key or clicking on a blank part of a scroll bar. 
757    /// If one page up is not a relevant amount for the control and no scroll bar exists, the value represents an amount equal to the current visible window.
758    LargeDecrement = 0i32,
759    /// Scrolling is done in small decrements, equivalent to pressing an arrow key or clicking the arrow button on a scroll bar.
760    SmallDecrement = 1i32,
761    /// No scrolling is done.
762    NoAmount = 2i32,
763    /// Scrolling is done in large increments, equivalent to pressing the PAGE DOWN or PAGE UP key or clicking on a blank part of a scroll bar.
764    /// If one page is not a relevant amount for the control and no scroll bar exists, the value represents an amount equal to the current visible window.
765    LargeIncrement = 3i32,
766    /// Scrolling is done in small increments, equivalent to pressing an arrow key or clicking the arrow button on a scroll bar.
767    SmallIncrement = 4i32
768}
769
770/// Defines enum for `windows::Win32::UI::Accessibility::SupportedTextSelection`.
771/// 
772/// Contains values that specify the supported text selection attribute.
773#[repr(i32)]
774#[derive(Debug, Clone, Copy, PartialEq, Eq, EnumConvert)]
775#[map_as(windows::Win32::UI::Accessibility::SupportedTextSelection)]
776pub enum SupportedTextSelection {
777    /// Does not support text selections.
778    None = 0i32,
779    /// Supports a single, continuous text selection.
780    Single = 1i32,
781    /// Supports multiple, disjoint text selections.
782    Multiple = 2i32,
783}
784
785/// Defines enum for `windows::Win32::UI::Accessibility::ToggleState`.
786/// 
787/// Contains values that specify the toggle state of a Microsoft UI Automation element that implements the Toggle control pattern.
788#[repr(i32)]
789#[derive(Debug, Clone, Copy, PartialEq, Eq, EnumConvert)]
790#[map_as(windows::Win32::UI::Accessibility::ToggleState)]
791pub enum ToggleState {
792    /// The UI Automation element is not selected, checked, marked or otherwise activated.
793    Off = 0i32,
794    /// The UI Automation element is selected, checked, marked or otherwise activated.
795    On = 1i32,
796    /// The UI Automation element is in an indeterminate state.
797    /// 
798    /// The Indeterminate property can be used to indicate whether the user has acted on a control. For example, a check box can appear checked and dimmed, indicating an indeterminate state.
799    /// 
800    /// Creating an indeterminate state is different from disabling the control. 
801    /// Consequently, a check box in the indeterminate state can still receive the focus. 
802    /// When the user clicks an indeterminate control the ToggleState cycles to its next value.
803    Indeterminate = 2i32,
804}
805
806/// Defines enum for `windows::Win32::UI::Accessibility::ZoomUnit`.
807/// 
808/// Contains possible values for the IUIAutomationTransformPattern2::ZoomByUnit method, which zooms the viewport of a control by the specified unit.
809#[repr(i32)]
810#[derive(Debug, Clone, Copy, PartialEq, Eq, EnumConvert)]
811#[map_as(windows::Win32::UI::Accessibility::ZoomUnit)]
812pub enum ZoomUnit {
813    /// No increase or decrease in zoom.
814    NoAmount = 0i32,
815    /// Decrease zoom by a large decrement.
816    LargeDecrement = 1i32,
817    /// Decrease zoom by a small decrement.
818    SmallDecrement = 2i32,
819    /// Increase zoom by a large increment.
820    LargeIncrement = 3i32,
821    /// Increase zoom by a small increment.
822    SmallIncrement = 4i32,
823}
824
825/// Defines enum for `windows::Win32::UI::Accessibility::WindowVisualState`.
826/// 
827/// Contains values that specify the visual state of a window for the IWindowProvider pattern.
828#[repr(i32)]
829#[derive(Debug, Clone, Copy, PartialEq, Eq, EnumConvert)]
830#[map_as(windows::Win32::UI::Accessibility::WindowVisualState)]
831pub enum WindowVisualState {
832    /// Specifies that the window is normal (restored).
833    Normal = 0i32,
834    /// Specifies that the window is maximized.
835    Maximized = 1i32,
836    /// Specifies that the window is minimized.
837    Minimized = 2i32
838}
839
840/// Defines enum for `windows::Win32::UI::Accessibility::TextUnit`.
841/// 
842/// Contains values that specify units of text for the purposes of navigation.
843#[repr(i32)]
844#[derive(Debug, Clone, Copy, PartialEq, Eq, EnumConvert)]
845#[map_as(windows::Win32::UI::Accessibility::TextUnit)]
846pub enum TextUnit {
847    /// Specifies that the text unit is one character in length.
848    Character = 0i32,
849    /// Specifies that the text unit is the length of a single, common format specification, such as bold, italic, or similar.
850    Format = 1i32,
851    /// Specifies that the text unit is one word in length.
852    Word = 2i32,
853    /// Specifies that the text unit is one line in length.
854    Line = 3i32,
855    /// Specifies that the text unit is one paragraph in length.
856    Paragraph = 4i32,
857    /// Specifies that the text unit is one document-specific page in length.
858    Page = 5i32,
859    /// Specifies that the text unit is an entire document in length.
860    Document = 6i32,
861}
862
863/// Defines enum for `windows::Win32::UI::Accessibility::TextPatternRangeEndpoint`.
864/// 
865/// Contains values that specify the endpoints of a text range.
866#[repr(i32)]
867#[derive(Debug, Clone, Copy, PartialEq, Eq, EnumConvert)]
868#[map_as(windows::Win32::UI::Accessibility::TextPatternRangeEndpoint)]
869pub enum TextPatternRangeEndpoint {
870    /// The starting endpoint of the range.
871    Start = 0i32,
872    /// The ending endpoint of the range.
873    End = 1i32,
874}
875
876/// Defines enum for `windows::Win32::UI::Accessibility::OrientationType`.
877/// 
878/// Contains values that specify the orientation of a control.
879#[repr(i32)]
880#[derive(Debug, Clone, Copy, PartialEq, Eq, EnumConvert)]
881#[map_as(windows::Win32::UI::Accessibility::OrientationType)]
882pub enum OrientationType {
883    /// The control has no orientation.
884    None = 0i32,
885    /// The control has horizontal orientation.
886    Horizontal = 1i32,
887    /// The control has vertical orientation.
888    Vertical = 2i32
889}
890
891/// Defines enum for `windows::Win32::UI::Accessibility::PropertyConditionFlags`.
892/// 
893/// Contains values used in creating property conditions.
894#[repr(i32)]
895#[derive(Debug, Clone, Copy, PartialEq, Eq, EnumConvert)]
896#[map_as(windows::Win32::UI::Accessibility::PropertyConditionFlags)]
897pub enum PropertyConditionFlags {
898    /// No flags.
899    None = 0i32,
900    /// Comparison of string properties is not case-sensitive.
901    IgnoreCase = 1i32,
902    /// Comparison of substring properties is enabled.
903    MatchSubstring = 2i32,
904    /// Combines `IgnoreCase` and `MatchSubstring` flags.
905    All = 3i32
906}
907
908/// Defines enum for `windows::Win32::UI::Accessibility::TreeScope`.
909/// 
910/// Contains values that specify the scope of various operations in the Microsoft UI Automation tree.
911#[repr(i32)]
912#[derive(Debug, Clone, Copy, PartialEq, Eq, EnumConvert)]
913#[map_as(windows::Win32::UI::Accessibility::TreeScope)]
914pub enum TreeScope {
915    /// The scope excludes the subtree from the search.
916    None = 0i32,
917    /// The scope includes the element itself.
918    Element = 1i32,
919    /// The scope includes children of the element.
920    Children = 2i32,
921    /// The scope includes children and more distant descendants of the element.
922    Descendants = 4i32,
923    /// The scope includes the parent of the element.
924    Parent = 8i32,
925    /// The scope includes the parent and more distant ancestors of the element.
926    Ancestors = 16i32,
927    /// The scope includes the element and all its descendants. This flag is a combination of the TreeScope_Element and TreeScope_Descendants values.
928    Subtree = 7i32
929}
930
931/// Defines enum for `windows::Win32::UI::Accessibility::UIA_ANNOTATIONTYPE`.
932/// 
933/// This type describes the named constants that are used to identify types of annotations in a document.
934#[repr(i32)]
935#[derive(Debug, Clone, Copy, PartialEq, Eq, EnumConvert)]
936#[map_as(windows::Win32::UI::Accessibility::UIA_ANNOTATIONTYPE)]
937pub enum AnnotationType {
938    /// The annotation type is unknown.
939    Unknown = 60000i32,
940    /// A spelling error, often denoted by a red squiggly line.
941    SpellingError = 60001i32,
942    /// A grammatical error, often denoted by a green squiggly line.
943    GrammarError = 60002i32,
944    /// A comment. Comments can take different forms depending on the application.
945    Comment = 60003i32,
946    /// An error in a formula. Formula errors typically include red text and exclamation marks.
947    FormulaError = 60004i32,
948    /// A change that was made to the document.
949    TrackChanges = 60005i32,
950    /// The header for a page in a document.
951    Header = 60006i32,
952    /// The footer for a page in a document.
953    Footer = 60007i32,
954    /// Highlighted content, typically denoted by a contrasting background color.
955    Highlighted = 60008i32,
956    /// The endnote for a document.
957    Endnote = 60009i32,
958    /// The footnote for a page in a document.
959    Footnote = 60010i32,
960    /// An insertion change that was made to the document.
961    InsertionChange = 60011i32,
962    /// A deletion change that was made to the document.
963    DeletionChange = 60012i32,
964    /// A move change that was made to the document.
965    MoveChange = 60013i32,
966    /// A format change that was made.
967    FormatChange = 60014i32,
968    /// An unsynced change that was made to the document.
969    UnsyncedChange = 60015i32,
970    /// An editing locked change that was made to the document.
971    EditingLockedChange = 60016i32,
972    /// An external change that was made to the document.
973    ExternalChange = 60017i32,
974    /// A conflicting change that was made to the document.
975    ConflictingChange = 60018i32,
976    /// The author of the document.
977    Author = 60019i32,
978    /// An advanced proofing issue.
979    AdvancedProofingIssue = 60020i32,
980    /// A data validation error that occurred.
981    DataValidationError = 60021i32,
982    /// A circular reference error that occurred.
983    CircularReferenceError = 60022i32,
984    /// A text range containing mathematics.
985    Mathematics = 60023i32,
986}
987
988/// Defines enum for `windows::Win32::UI::Accessibility::UIA_HEADINGLEVEL_ID`.
989///
990/// This set of constants describes the named constants used to identify the heading level of a UI Automation element.
991#[repr(i32)]
992#[derive(Debug, Clone, Copy, PartialEq, Eq, EnumConvert)]
993#[map_as(windows::Win32::UI::Accessibility::UIA_HEADINGLEVEL_ID)]
994pub enum HeadingLevel {
995    HeadingLevelNone = 80050i32,
996    HeadingLevel1 = 80051i32,
997    HeadingLevel2 = 80052i32,
998    HeadingLevel3 = 80053i32,
999    HeadingLevel4 = 80054i32,
1000    HeadingLevel5 = 80055i32,
1001    HeadingLevel6 = 80056i32,
1002    HeadingLevel7 = 80057i32,
1003    HeadingLevel8 = 80058i32,
1004    HeadingLevel9 = 80059i32
1005}
1006
1007/// Defines enum for `windows::Win32::UI::Accessibility::UIA_STYLE_ID`.
1008/// 
1009/// This set of constants describes the named constants used to identify the visual style of text in a document.
1010#[repr(i32)]
1011#[derive(Debug, Clone, Copy, PartialEq, Eq, EnumConvert)]
1012#[map_as(windows::Win32::UI::Accessibility::UIA_STYLE_ID)]
1013pub enum StyleType {
1014    /// A custom style.
1015    Custom = 70000i32,
1016    /// A first level heading.
1017    Heading1 = 70001i32,
1018    /// A second level heading.
1019    Heading2 = 70002i32,
1020    /// A third level heading.
1021    Heading3 = 70003i32,
1022    /// A fourth level heading.
1023    Heading4 = 70004i32,
1024    /// A fifth level heading.
1025    Heading5 = 70005i32,
1026    /// A sixth level heading.
1027    Heading6 = 70006i32,
1028    /// A seventh level heading.
1029    Heading7 = 70007i32,
1030    /// An eighth level heading.
1031    Heading8 = 70008i32,
1032    /// A ninth level heading.
1033    Heading9 = 70009i32,
1034    /// A title.
1035    Title = 70010i32,
1036    /// A subtitle.
1037    Subtitle = 70011i32,
1038    /// Normal style.
1039    Normal = 70012i32,
1040    /// Text that is emphasized.
1041    Emphasis = 70013i32,
1042    /// A quotation.
1043    Quote = 70014i32,
1044    /// A list with bulleted items. Supported starting with Windows 8.1.
1045    BulletedList = 70015i32,
1046    /// A list with numbered items. Supported starting with Windows 8.1.
1047    NumberedList = 70016i32,
1048}
1049
1050/// Defines enum for `windows::Win32::UI::Accessibility::UIA_TEXTATTRIBUTE_ID`.
1051/// 
1052/// This type describes the named constants used to identify text attributes of a Microsoft UI Automation text range.
1053#[repr(i32)]
1054#[derive(Debug, Clone, Copy, PartialEq, Eq, EnumConvert)]
1055#[map_as(windows::Win32::UI::Accessibility::UIA_TEXTATTRIBUTE_ID)]
1056pub enum TextAttribute {
1057    /// Identifies the AnimationStyle text attribute, which specifies the type of animation applied to the text. This attribute is specified as a value from the AnimationStyle enumerated type.
1058    AnimationStyle = 40000i32,
1059    /// Identifies the BackgroundColor text attribute, which specifies the background color of the text. This attribute is specified as a COLORREF; a 32-bit value used to specify an RGB or RGBA color.
1060    BackgroundColor = 40001i32,
1061    /// Identifies the BulletStyle text attribute, which specifies the style of bullets used in the text range. This attribute is specified as a value from the BulletStyle enumerated type.
1062    BulletStyle = 40002i32,
1063    /// Identifies the CapStyle text attribute, which specifies the capitalization style for the text. This attribute is specified as a value from the CapStyle enumerated type.
1064    CapStyle = 40003i32,
1065    /// Identifies the Culture text attribute, which specifies the locale of the text by locale identifier (LCID).
1066    Culture = 40004i32,
1067    /// Identifies the FontName text attribute, which specifies the name of the font. Examples: Arial Black; Arial Narrow. The font name string is not localized.
1068    FontName = 40005i32,
1069    /// Identifies the FontSize text attribute, which specifies the point size of the font.
1070    FontSize = 40006i32,
1071    /// Identifies the FontWeight text attribute, which specifies the relative stroke, thickness, or boldness of the font. The FontWeight attribute is modeled after the lfWeight member of the GDI LOGFONT structure, and related standards, and can be one of the following values:
1072    FontWeight = 40007i32,
1073    /// Identifies the ForegroundColor text attribute, which specifies the foreground color of the text. This attribute is specified as a COLORREF, a 32-bit value used to specify an RGB or RGBA color.
1074    ForegroundColor = 40008i32,
1075    /// Identifies the HorizontalTextAlignment text attribute, which specifies how the text is aligned horizontally. This attribute is specified as a value from the HorizontalTextAlignmentEnum enumerated type.
1076    HorizontalTextAlignment = 40009i32,
1077    /// Identifies the IndentationFirstLine text attribute, which specifies how far, in points, to indent the first line of a paragraph.
1078    IndentationFirstLine = 40010i32,
1079    /// Identifies the IndentationLeading text attribute, which specifies the leading indentation, in points.
1080    IndentationLeading = 40011i32,
1081    /// Identifies the IndentationTrailing text attribute, which specifies the trailing indentation, in points.
1082    IndentationTrailing = 40012i32,
1083    /// Identifies the IsHidden text attribute, which indicates whether the text is hidden (TRUE) or visible (FALSE).
1084    IsHidden = 40013i32,
1085    /// Identifies the IsItalic text attribute, which indicates whether the text is italic (TRUE) or not (FALSE).
1086    IsItalic = 40014i32,
1087    /// Identifies the IsReadOnly text attribute, which indicates whether the text is read-only (TRUE) or can be modified (FALSE).
1088    IsReadOnly = 40015i32,
1089    /// Identifies the IsSubscript text attribute, which indicates whether the text is subscript (TRUE) or not (FALSE).
1090    IsSubscript = 40016i32,
1091    /// Identifies the IsSuperscript text attribute, which indicates whether the text is subscript (TRUE) or not (FALSE).
1092    IsSuperscript = 40017i32,
1093    /// Identifies the MarginBottom text attribute, which specifies the size, in points, of the bottom margin applied to the page associated with the text range.
1094    MarginBottom = 40018i32,
1095    /// Identifies the MarginLeading text attribute, which specifies the size, in points, of the leading margin applied to the page associated with the text range.
1096    MarginLeading = 40019i32,
1097    /// Identifies the MarginTop text attribute, which specifies the size, in points, of the top margin applied to the page associated with the text range.
1098    MarginTop = 40020i32,
1099    /// Identifies the MarginTrailing text attribute, which specifies the size, in points, of the trailing margin applied to the page associated with the text range.
1100    MarginTrailing = 40021i32,
1101    /// Identifies the OutlineStyles text attribute, which specifies the outline style of the text. This attribute is specified as a value from the OutlineStyles enumerated type.
1102    OutlineStyles = 40022i32,
1103    /// Identifies the OverlineColor text attribute, which specifies the color of the overline text decoration. This attribute is specified as a COLORREF, a 32-bit value used to specify an RGB or RGBA color.
1104    OverlineColor = 40023i32,
1105    /// Identifies the OverlineStyle text attribute, which specifies the style of the overline text decoration. This attribute is specified as a value from the TextDecorationLineStyleEnum enumerated type.
1106    OverlineStyle = 40024i32,
1107    /// Identifies the StrikethroughColor text attribute, which specifies the color of the strikethrough text decoration. This attribute is specified as a COLORREF, a 32-bit value used to specify an RGB or RGBA color.
1108    StrikethroughColor = 40025i32,
1109    /// Identifies the StrikethroughStyle text attribute, which specifies the style of the strikethrough text decoration. This attribute is specified as a value from the TextDecorationLineStyleEnum enumerated type.
1110    StrikethroughStyle = 40026i32,
1111    /// Identifies the Tabs text attribute, which is an array specifying the tab stops for the text range. Each array element specifies a distance, in points, from the leading margin.
1112    Tabs = 40027i32,
1113    /// Identifies the TextFlowDirections text attribute, which specifies the direction of text flow. This attribute is specified as a combination of values from the FlowDirections enumerated type.
1114    TextFlowDirections = 40028i32,
1115    /// Identifies the UnderlineColor text attribute, which specifies the color of the underline text decoration. This attribute is specified as a COLORREF, a 32-bit value used to specify an RGB or RGBA color.
1116    UnderlineColor = 40029i32,
1117    /// Identifies the UnderlineStyle text attribute, which specifies the style of the underline text decoration. This attribute is specified as a value from the TextDecorationLineStyleEnum enumerated type.
1118    UnderlineStyle = 40030i32,
1119    /// Identifies the AnnotationTypes text attribute, which maintains a list of annotation type identifiers for a range of text. For a list of possible values, see Annotation Type Identifiers. Supported starting with Windows 8.
1120    AnnotationTypes = 40031i32,
1121    /// Identifies the AnnotationObjects text attribute, which maintains an array of IUIAutomationElement2 interfaces, one for each element in the current text range that implements the Annotation control pattern. Each element might also implement other control patterns as needed to describe the annotation. For example, an annotation that is a comment would also support the Text control pattern. Supported starting with Windows 8.
1122    AnnotationObjects = 40032i32,
1123    /// Identifies the StyleName text attribute, which identifies the localized name of the text style in use for a text range. Supported starting with Windows 8.
1124    StyleName = 40033i32,
1125    /// Identifies the StyleId text attribute, which indicates the text styles in use for a text range. For a list of possible values, see Style Identifiers. Supported starting with Windows 8.
1126    StyleId = 40034i32,
1127    /// Identifies the Link text attribute, which contains the IUIAutomationTextRange interface of the text range that is the target of an internal link in a document. Supported starting with Windows 8.
1128    Link = 40035i32,
1129    /// Identifies the IsActive text attribute, which indicates whether the control that contains the text range has the keyboard focus (TRUE) or not (FALSE). Supported starting with Windows 8.
1130    IsActive = 40036i32,
1131    /// Identifies the SelectionActiveEnd text attribute, which indicates the location of the caret relative to a text range that represents the currently selected text. This attribute is specified as a value from the ActiveEnd enumeration. Supported starting with Windows 8.
1132    SelectionActiveEnd = 40037i32,
1133    /// Identifies the CaretPosition text attribute, which indicates whether the caret is at the beginning or the end of a line of text in the text range. This attribute is specified as a value from the CaretPosition enumerated type. Supported starting with Windows 8.
1134    CaretPosition = 40038i32,
1135    /// Identifies the CaretBidiMode text attribute, which indicates the direction of text flow in the text range. This attribute is specified as a value from the CaretBidiMode enumerated type. Supported starting with Windows 8.
1136    CaretBidiMode = 40039i32,
1137    /// Identifies the LineSpacing text attribute, which specifies the spacing between lines of text.
1138    LineSpacing = 40040i32,
1139    /// Identifies the BeforeParagraphSpacing text attribute, which specifies the size of spacing before the paragraph.
1140    BeforeParagraphSpacing = 40041i32,
1141    /// Identifies the AfterParagraphSpacing text attribute, which specifies the size of spacing after the paragraph.
1142    AfterParagraphSpacing = 40042i32,
1143}
1144
1145/// Defines enum for `windows::Win32::UI::Accessibility::AutomationElementMode`.
1146/// 
1147/// Contains values that specify the type of reference to use when returning UI Automation elements.
1148#[repr(i32)]
1149#[derive(Debug, Clone, Copy, PartialEq, Eq, EnumConvert)]
1150#[map_as(windows::Win32::UI::Accessibility::AutomationElementMode)]
1151pub enum ElementMode {
1152    /// Specifies that returned elements have no reference to the underlying UI and contain only cached information.
1153    None = 0i32,
1154    /// Specifies that returned elements have a full reference to the underlying UI.
1155    Full = 1i32
1156}
1157
1158/// `StructureChangeType` is an enum wrapper for `windows::Win32::UI::Accessibility::StructureChangeType`.
1159/// 
1160/// Contains values that specify the type of change in the Microsoft UI Automation tree structure.
1161#[repr(i32)]
1162#[derive(Debug, Clone, Copy, PartialEq, Eq, EnumConvert)]
1163#[map_as(windows::Win32::UI::Accessibility::StructureChangeType)]
1164pub enum StructureChangeType {
1165    /// A child element was added to the UI Automation element tree.
1166    ChildAdded = 0i32,
1167    /// A child element was removed from the UI Automation element tree.
1168    ChildRemoved = 1i32,
1169    /// Child elements were invalidated in the UI Automation element tree. 
1170    /// This might mean that one or more child elements were added or removed, or a combination of both. 
1171    /// This value can also indicate that one subtree in the UI was substituted for another. 
1172    /// For example, the entire contents of a dialog box changed at once, or the view of a list changed because an Explorer-type application navigated to another location. 
1173    /// The exact meaning depends on the UI Automation provider implementation.
1174    ChildrenInvalidated = 2i32,
1175    /// Child elements were added in bulk to the UI Automation element tree.
1176    ChildrenBulkAdded = 3i32,
1177    /// Child elements were removed in bulk from the UI Automation element tree.
1178    ChildrenBulkRemoved = 4i32,
1179    /// The order of child elements has changed in the UI Automation element tree. Child elements may or may not have been added or removed.
1180    ChildrenReordered = 5i32
1181}
1182
1183/// Defines enum for `windows::Win32::UI::Accessibility::UIA_CONTROLTYPE_ID`.
1184/// 
1185/// Contains the named constants used to identify Microsoft UI Automation control types.
1186#[repr(i32)]
1187#[derive(Debug, Clone, Copy, PartialEq, Eq, EnumConvert)]
1188#[map_as(windows::Win32::UI::Accessibility::UIA_CONTROLTYPE_ID)]
1189pub enum ControlType {
1190    /// Identifies the Button control type.
1191    Button = 50000i32,
1192    /// Identifies the Calendar control type.
1193    Calendar = 50001i32,
1194    /// Identifies the CheckBox control type.
1195    CheckBox = 50002i32,
1196    /// Identifies the ComboBox control type.
1197    ComboBox = 50003i32,
1198    /// Identifies the Edit control type.
1199    Edit = 50004i32,
1200    /// Identifies the Hyperlink control type.
1201    Hyperlink = 50005i32,
1202    /// Identifies the Image control type.
1203    Image = 50006i32,
1204    /// Identifies the ListItem control type.
1205    ListItem = 50007i32,
1206    /// Identifies the List control type.
1207    List = 50008i32,
1208    /// Identifies the Menu control type.
1209    Menu = 50009i32,
1210    /// Identifies the MenuBar control type.
1211    MenuBar = 50010i32,
1212    /// Identifies the MenuItem control type.
1213    MenuItem = 50011i32,
1214    /// Identifies the ProgressBar control type.
1215    ProgressBar = 50012i32,
1216    /// Identifies the RadioButton control type.
1217    RadioButton = 50013i32,
1218    /// Identifies the ScrollBar control type.
1219    ScrollBar = 50014i32,
1220    /// Identifies the Slider control type.
1221    Slider = 50015i32,
1222    /// Identifies the Spinner control type.
1223    Spinner = 50016i32,
1224    /// Identifies the StatusBar control type.
1225    StatusBar = 50017i32,
1226    /// Identifies the Tab control type.
1227    Tab = 50018i32,
1228    /// Identifies the TabItem control type.
1229    TabItem = 50019i32,
1230    /// Identifies the Text control type.
1231    Text = 50020i32,
1232    /// Identifies the ToolBar control type.
1233    ToolBar = 50021i32,
1234    /// Identifies the ToolTip control type.
1235    ToolTip = 50022i32,
1236    /// Identifies the Tree control type.
1237    Tree = 50023i32,
1238    /// Identifies the TreeItem control type.
1239    TreeItem = 50024i32,
1240    /// Identifies the Custom control type. For more information, see Custom Properties, Events, and Control Patterns.
1241    Custom = 50025i32,
1242    /// Identifies the Group control type.
1243    Group = 50026i32,
1244    /// Identifies the Thumb control type.
1245    Thumb = 50027i32,
1246    /// Identifies the DataGrid control type.
1247    DataGrid = 50028i32,
1248    /// Identifies the DataItem control type.
1249    DataItem = 50029i32,
1250    /// Identifies the Document control type.
1251    Document = 50030i32,
1252    /// Identifies the SplitButton control type.
1253    SplitButton = 50031i32,
1254    /// Identifies the Window control type.
1255    Window = 50032i32,
1256    /// Identifies the Pane control type.
1257    Pane = 50033i32,
1258    /// Identifies the Header control type.
1259    Header = 50034i32,
1260    /// Identifies the HeaderItem control type.
1261    HeaderItem = 50035i32,
1262    /// Identifies the Table control type.
1263    Table = 50036i32,
1264    /// Identifies the TitleBar control type.
1265    TitleBar = 50037i32,
1266    /// Identifies the Separator control type.
1267    Separator = 50038i32,
1268    /// Identifies the SemanticZoom control type. Supported starting with Windows 8.
1269    SemanticZoom = 50039i32,
1270    /// Identifies the AppBar control type. Supported starting with Windows 8.1.
1271    AppBar = 50040i32    
1272}
1273
1274#[cfg(test)]
1275mod tests {
1276    use windows::Win32::UI::Accessibility;
1277
1278    use super::WindowInteractionState;
1279
1280    #[test]
1281    fn test_window_interaction_state() {
1282        assert_eq!(Ok(WindowInteractionState::Running), WindowInteractionState::try_from(0));
1283        assert_eq!(Ok(WindowInteractionState::NotResponding), WindowInteractionState::try_from(4));
1284        assert!(WindowInteractionState::try_from(100).is_err());
1285        
1286        assert_eq!(1i32, WindowInteractionState::Closing as i32);
1287
1288        assert_eq!(Accessibility::WindowInteractionState_ReadyForUserInteraction, WindowInteractionState::ReadyForUserInteraction.into());
1289        assert_eq!(WindowInteractionState::Running, Accessibility::WindowInteractionState_Running.try_into().unwrap());
1290
1291        let running = format!("{}", WindowInteractionState::Running);
1292        assert_eq!(running, "Running");
1293    }
1294
1295    #[test]
1296    fn test_handle() {
1297        let handle = crate::types::Handle::from(0x001);
1298        // assert_eq!(windows::Win32::Foundation::HWND(unsafe { std::mem::transmute(0x001isize) } ), handle.into());
1299        assert_eq!(windows::Win32::Foundation::HWND(std::ptr::with_exposed_provenance_mut(0x001usize)), handle.into());
1300    }
1301}