sap_scripting/
types.rs

1use com_shim::{com_shim, IDispatchExt, VariantExt};
2use windows::{core::*, Win32::System::Com::*, Win32::System::Variant::*};
3
4/// A wrapper over the SAP scripting engine, equivalent to CSapROTWrapper.
5pub struct SAPWrapper {
6    inner: IDispatch,
7}
8
9impl SAPWrapper {
10    pub(crate) fn new() -> crate::Result<Self> {
11        unsafe {
12            let clsid: GUID = CLSIDFromProgID(w!("SapROTWr.SapROTWrapper"))?;
13            let p_clsid: *const GUID = &clsid;
14            log::debug!("CSapROTWrapper CLSID: {:?}", clsid);
15
16            let dispatch: IDispatch =
17                CoCreateInstance(p_clsid, None, CLSCTX_LOCAL_SERVER | CLSCTX_INPROC_SERVER)?;
18            Ok(SAPWrapper { inner: dispatch })
19        }
20    }
21
22    /// Get the Scripting Engine object from this wrapper.
23    pub fn scripting_engine(&self) -> crate::Result<GuiApplication> {
24        log::debug!("Getting UI ROT entry...");
25        let result = self
26            .inner
27            .call("GetROTEntry", vec![VARIANT::from_str("SAPGUI")])?;
28
29        let sap_gui = result.to_idispatch()?;
30
31        log::debug!("Getting scripting engine.");
32        let scripting_engine = sap_gui.call("GetScriptingEngine", vec![])?;
33
34        Ok(GuiApplication {
35            inner: scripting_engine.to_idispatch()?.clone(),
36        })
37    }
38}
39
40/// SAPComponent wraps around all of the GuiComponent types, allowing a more Rust-y way of exporing components.
41pub enum SAPComponent {
42    /// The GuiApplication represents the process in which all SAP GUI activity takes place. If the scripting
43    /// component is accessed by attaching to an SAP Logon process, then GuiApplication will represent SAP
44    /// Logon. GuiApplication is a creatable class. However, there must be only one component of this type
45    /// in any process. GuiApplication extends the GuiContainer Object.
46    GuiApplication(GuiApplication),
47    /// The GuiBarChart is a powerful tool to display and modify time scale diagrams.
48    GuiBarChart(GuiBarChart),
49    /// A GuiBox is a simple frame with a name (also called a "Group Box"). The items inside the frame are not
50    /// children of the box. The type prefix is "box".
51    GuiBox(GuiBox),
52    /// GuiButton represents all push buttons that are on dynpros, the toolbar or in table controls. GuiButton
53    /// extends the GuiVComponent Object. The type prefix is btn, the name property is the fieldname taken
54    /// from the SAP data dictionary There is one exception: For tabstrip buttons, it is the button id set in
55    /// screen painter that is taken from the SAP data dictionary.
56    GuiButton(GuiButton),
57    /// The calendar control can be used to select single dates or periods of time. GuiCalendar extends the
58    /// GuiShell Object.
59    GuiCalendar(GuiCalendar),
60    /// The GuiChart object is of a very technical nature. It should only be used for recording and playback, as
61    /// most of the parameters cannot be determined in any other way.
62    GuiChart(GuiChart),
63    /// GuiCheckBox extends the GuiVComponent Object. The type prefix is chk, the name is the fieldname taken
64    /// from the SAP data dictionary.
65    GuiCheckBox(GuiCheckBox),
66    /// GuiColorSelector displays a set of colors for selection. It extends the GuiShell Object.
67    GuiColorSelector(GuiColorSelector),
68    /// The GuiComboBox looks somewhat similar to GuiCTextField, but has a completely different implementation.
69    /// While pressing the combo box button of a GuiCTextField will open a new dynpro or control in which a
70    /// selection can be made, GuiComboBox retrieves all possible choices on initialization from the server, so
71    /// the selection is done solely on the client. GuiComboBox extends the GuiVComponent Object. The type prefix
72    /// is cmb, the name is the fieldname taken from the SAP data dictionary. GuiComboBox inherits from the
73    /// GuiVComponent Object.
74    GuiComboBox(GuiComboBox),
75    ///
76    GuiComboBoxControl(GuiComboBoxControl),
77    /// Members of the Entries collection of a GuiComboBox are of type GuiComBoxEntry.
78    GuiComboBoxEntry(GuiComboBoxEntry),
79    /// GuiComponent is the base class for most classes in the Scripting API. It was designed to allow generic
80    /// programming, meaning you can work with objects without knowing their exact type.
81    GuiComponent(GuiComponent),
82    /// A GuiConnection represents the connection between SAP GUI and an application server. Connections can be opened
83    /// from SAP Logon or from GuiApplication’s openConnection and openConnectionByConnectionString methods.
84    /// GuiConnection extends the GuiContainer Object. The type prefix for GuiConnection is con, the name is con
85    /// plus the connection number in square brackets.
86    GuiConnection(GuiConnection),
87    /// This interface resembles GuiVContainer. The only difference is that it is not intended for visual objects
88    /// but rather administrative objects such as connections or sessions. Objects exposing this interface will
89    /// therefore support GuiComponent but not GuiVComponent. GuiContainer extends the GuiComponent Object.
90    GuiContainer(GuiContainer),
91    /// A GuiContainerShell is a wrapper for a set of the GuiShell Object. GuiContainerShell extends the GuiVContainer
92    /// Object. The type prefix is shellcont, the name is the last part of the id, shellcont\[n\].
93    GuiContainerShell(GuiContainerShell),
94    /// If the cursor is set into a text field of type GuiCTextField a combo box button is displayed to the right of
95    /// the text field. Pressing this button is equivalent to pressing the F4 key. The button is not represented in
96    /// the scripting object model as a separate object; it is considered to be part of the text field.
97    ///
98    /// There are no other differences between GuiTextField and GuiCTextField. GuiCTextField extends the GuiTextField.
99    /// The type prefix is ctxt, the name is the Fieldname taken from the SAP data dictionary.
100    GuiCTextField(GuiCTextField),
101    /// The GuiCustomControl is a wrapper object that is used to place ActiveX controls onto dynpro screens. While
102    /// GuiCustomControl is a dynpro element itself, its children are of GuiContainerShell type, which is a container
103    /// for controls. GuiCustomControl extends the GuiVContainer Object. The type prefix is cntl, the name is the
104    /// fieldname taken from the SAP data dictionary.
105    GuiCustomControl(GuiCustomControl),
106    /// The GuiDialogShell is an external window that is used as a container for other shells, for example a toolbar.
107    /// GuiDialogShell extends the GuiVContainer Object. The type prefix is shellcont, the name is the last part of
108    /// the id, shellcont\[n\].
109    GuiDialogShell(GuiDialogShell),
110    /// The GuiEAIViewer2D control is used to view 2-dimensional graphic images in the SAP system. The user can carry
111    /// out redlining over the loaded image. The scripting wrapper for this control records all user actions during
112    /// the redlining process and reproduces the same actions when the recorded script is replayed.
113    GuiEAIViewer2D(GuiEAIViewer2D),
114    /// The GuiEAIViewer3D control is used to view 3-dimensional graphic images in the SAP system.
115    GuiEAIViewer3D(GuiEAIViewer3D),
116    /// A GuiFrameWindow is a high level visual object in the runtime hierarchy. It can be either the main window or
117    /// a modal popup window. See the GuiMainWindow and GuiModalWindow sections for examples. GuiFrameWindow itself
118    /// is an abstract interface. GuiFrameWindow extends the GuiVContainer Object. The type prefix is wnd, the name
119    /// is wnd plus the window number in square brackets.
120    GuiFrameWindow(GuiFrameWindow),
121    /// The GuiGosShell is only available in New Visual Design mode. GuiGOSShell extends the GuiVContainer Object.
122    /// The type prefix is shellcont, the name is the last part of the id, shellcont\[n\].
123    GuiGOSShell(GuiGOSShell),
124    /// For the graphic adapter control only basic members from GuiShell are available. Recording and playback is
125    /// not possible.
126    GuiGraphAdapt(GuiGraphAdapt),
127    /// The grid view is similar to the dynpro table control, but significantly more powerful. GuiGridView extends
128    /// the GuiShell Object.
129    GuiGridView(GuiGridView),
130    /// The GuiHTMLViewer is used to display an HTML document inside SAP GUI. GuiHTMLViewer extends the GuiShell
131    /// Object.
132    GuiHTMLViewer(GuiHTMLViewer),
133    ///
134    GuiInputFieldControl(GuiInputFieldControl),
135    /// GuiLabel extends the GuiVComponent Object. The type prefix is lbl, the name is the fieldname taken from the
136    /// SAP data dictionary.
137    GuiLabel(GuiLabel),
138    /// This window represents the main window of an SAP GUI session.
139    GuiMainWindow(GuiMainWindow),
140    /// For the map control only basic members from GuiShell are available. Recording and playback is not possible.
141    GuiMap(GuiMap),
142    /// A GuiMenu may have other GuiMenu objects as children. GuiMenu extends the GuiVContainer Object. The type prefix
143    /// is menu, the name is the text of the menu item. If the item does not have a text, which is the case for
144    /// separators, then the name is the last part of the id, menu\[n\].
145    GuiMenu(GuiMenu),
146    /// Only the main window has a menubar. The children of the menubar are menus. GuiMenubar extends the GuiVContainer
147    /// Object. The type prefix and name are mbar.
148    GuiMenubar(GuiMenubar),
149    /// A GuiModalWindow is a dialog pop-up.
150    GuiModalWindow(GuiModalWindow),
151    /// The GuiNetChart is a powerful tool to display and modify entity relationship diagrams. It is of a very technical
152    /// nature and should only be used for recording and playback, as most of the parameters cannot be determined in
153    /// any other way.
154    GuiNetChart(GuiNetChart),
155    ///
156    GuiOfficeIntegration(GuiOfficeIntegration),
157    /// The GuiOkCodeField is placed on the upper toolbar of the main window. It is a combo box into which commands can
158    /// be entered. Setting the text of GuiOkCodeField will not execute the command until server communication is
159    /// started, for example by emulating the Enter key (VKey 0). GuiOkCodeField extends the GuiVComponent Object. The
160    /// type prefix is okcd, the name is empty.
161    GuiOkCodeField(GuiOkCodeField),
162    /// There are some differences between GuiTextField and GuiPasswordField:
163    ///
164    /// - The Text and DisplayedText properties cannot be read for a password field. The returned text is always empty.
165    /// During recording the password is also not saved in the recorded script.
166    /// - The properties HistoryCurEntry, HistoryCurIndex, HistoryIsActive and HistoryList are not supported, because
167    /// password fields do not offer an input history
168    /// - The property IsListElement is not supported, because password fields cannot be placed on ABAP lists
169    GuiPasswordField(GuiPasswordField),
170    /// The picture control displays a picture on an SAP GUI screen. GuiPicture extends the GuiShell Object.
171    GuiPicture(GuiPicture),
172    /// GuiRadioButton extends the GuiVComponent Object. The type prefix is rad, the name is the fieldname taken from the
173    /// SAP data dictionary.
174    GuiRadioButton(GuiRadioButton),
175    /// For the SAP chart control only basic members from GuiShell are available. Recording and playback is not possible.
176    GuiSapChart(GuiSapChart),
177    /// The GuiScrollbar class is a utility class used for example in GuiScrollContainer or GuiTableControl.
178    GuiScrollbar(GuiScrollbar),
179    /// This container represents scrollable subscreens. A subscreen may be scrollable without actually having a scrollbar,
180    /// because the existence of a scrollbar depends on the amount of data displayed and the size of the GuiUserArea.
181    /// GuiScrollContainer extend sthe GuiVContainer Object. The type prefix is ssub, the name is generated from the data
182    /// dictionary settings.
183    GuiScrollContainer(GuiScrollContainer),
184    /// GuiSession is self-contained in that ids within the context of a session remain valid independently of other connections
185    /// or sessions being open at the same time. Usually an external application will first determine with which session to
186    /// interact. Once that is clear, the application will work more or less exclusively on that session. Traversing the object
187    /// hierarchy from the GuiApplication to the user interface elements, it is the session among whose children the highest
188    /// level visible objects can be found. In contrast to objects like buttons or text fields, the session remains valid until
189    /// the corresponding main window has been closed, whereas buttons, for example, are destroyed during each server
190    /// communication.
191    GuiSession(GuiSession),
192    /// GuiShell is an abstract object whose interface is supported by all the controls. GuiShell extends the GuiVContainer
193    /// Object. The type prefix is shell, the name is the last part of the id, shell\[n\].
194    GuiShell(GuiShell),
195    /// This container represents non-scrollable subscreens. It does not have any functionality apart from to the inherited
196    /// interfaces. GuiSimpleContainer extends the GuiVContainer Object. The type prefix is sub, the name is is generated
197    /// from the data dictionary settings.
198    GuiSimpleContainer(GuiSimpleContainer),
199    /// GuiSplit extends the GuiShell Object.
200    GuiSplit(GuiSplit),
201    /// The GuiSplitterContainer represents the dynpro splitter element, which was introduced in the Web Application Server
202    /// ABAP in NetWeaver 7.1. The dynpro splitter element is similar to the activeX based splitter control, but it is a
203    /// plain dynpro element.
204    GuiSplitterContainer(GuiSplitterContainer),
205    /// For the stage control only basic members from GuiShell are available. Recording and playback is not possible.
206    GuiStage(GuiStage),
207    /// GuiStatusbar represents the message displaying part of the status bar on the bottom of the SAP GUI window. It does
208    /// not include the system and login information displayed in the rightmost area of the status bar as these are available
209    /// from the GuiSessionInfo object. GuiStatusbar extends the GuiVComponent Object. The type prefix is sbar.
210    GuiStatusbar(GuiStatusbar),
211    /// The parent of the GuiStatusPane objects is the status bar (see also GuiStatusbar Object). The GuiStatusPane objects
212    /// reflect the individual areas of the status bar, for example "pane\[0\]" refers to the section of the status bar where
213    /// the messages are displayed. See also GuiStatusbar Object. The first pane of the GuiStatusBar (pane\[0\]) can have a
214    /// child of type GuiStatusBarLink, if a service request link is displayed.
215    GuiStatusPane(GuiStatusPane),
216    /// The GuiTab objects are the children of a GuiTabStrip object. GuiTab extends the GuiVContainer Object. The type prefix
217    /// is tabp, the name is the id of the tab’s button taken from SAP data dictionary.
218    GuiTab(GuiTab),
219    /// The table control is a standard dynpro element, in contrast to the GuiCtrlGridView, which looks similar. GuiTableControl
220    /// extends the GuiVContainer Object. The type prefix is tbl, the name is the fieldname taken from the SAP data dictionary.
221    GuiTableControl(GuiTableControl),
222    /// A tab strip is a container whose children are of type GuiTab. GuiTabStrip extends the GuiVContainer Object. The type
223    /// prefix is tabs, the name is the fieldname taken from the SAP data dictionary.
224    GuiTabStrip(GuiTabStrip),
225    /// The TextEdit control is a multiline edit control offering a number of possible benefits. With regard to scripting,
226    /// the possibility of protecting text parts against editing by the user is especially useful. GuiTextedit extends the
227    /// GuiShell Object.
228    GuiTextedit(GuiTextedit),
229    /// GuiTextField extends the GuiVComponent Object. The type prefix is txt, the name is the fieldname taken from the
230    /// SAP data dictionary.
231    GuiTextField(GuiTextField),
232    /// The titlebar is only displayed and exposed as a separate object in New Visual Design mode. GuiTitlebar extends the
233    /// GuiVContainer Object. The type prefix and name of GuiTitlebar are titl.
234    GuiTitlebar(GuiTitlebar),
235    /// Every GuiFrameWindow has a GuiToolbar. The GuiMainWindow has two toolbars unless the second has been turned off by
236    /// the ABAP application. In classical SAP GUI themes, the upper toolbar is called “system toolbar” or “GUI toolbar” ,
237    /// while the second toolbar is called “application toolbar”. In SAP GUI themes as of Belize and in integration scenarios
238    /// (like embedded into SAP Business Client), only a single toolbar (“merged toolbar") is displayed. Additionally, a footer
239    /// also containing buttons originally coming from the system or application toolbar may be displayed.
240    GuiToolbar(GuiToolbar),
241    /// A Tree view.
242    GuiTree(GuiTree),
243    /// The GuiUserArea comprises the area between the toolbar and status bar for windows of GuiMainWindow type and the area
244    /// between the titlebar and toolbar for modal windows, and may also be limited by docker controls. The standard dynpro
245    /// elements can be found only in this area, with the exception of buttons, which are also found in the toolbars.
246    GuiUserArea(GuiUserArea),
247    /// The GuiVComponent interface is exposed by all visual objects, such as windows, buttons or text fields. Like GuiComponent,
248    /// it is an abstract interface. Any object supporting the GuiVComponent interface also exposes the GuiComponent interface.
249    /// GuiVComponent extends the GuiComponent Object.
250    GuiVComponent(GuiVComponent),
251    /// An object exposes the GuiVContainer interface if it is both visible and can have children. It will then also expose
252    /// GuiComponent and GuiVComponent. Examples of this interface are windows and subscreens, toolbars or controls having
253    /// children, such as the splitter control. GuiVContainer extends the GuiContainer Object and the GuiVComponent Object.
254    GuiVContainer(GuiVContainer),
255    /// GuiVHViewSwitch represents the “View Switch” object that was introduced with the Belize theme in SAP GUI. The View Switch
256    /// is placed in the header area of the SAP GUI main window and can be used to select different views within an application.
257    /// Many screens can be displayed in different ways (for example, as a tree or list). To switch from one view to another in
258    /// a comfortable way, these screens may make use of the View Switch:
259    GuiVHViewSwitch(GuiVHViewSwitch),
260}
261
262impl From<IDispatch> for SAPComponent {
263    fn from(value: IDispatch) -> Self {
264        let value = GuiComponent { inner: value };
265        if let Ok(mut kind) = value._type() {
266            log::debug!("Converting component {kind} to SAPComponent.");
267            if kind.as_str() == "GuiShell" {
268                log::debug!("Kind is shell, checking subkind.");
269                if let Ok(sub_kind) = (GuiShell { inner: value.inner.clone() }).sub_type() {
270                    // use subkind if a GuiShell
271                    log::debug!("Subkind is {sub_kind}");
272                    kind = sub_kind;
273                }
274            }
275            match kind.as_str() {
276                // ! Types that extend from GuiShell are not prefixed with `Gui` as they use SubType.
277                "GuiApplication" => {
278                    SAPComponent::GuiApplication(GuiApplication { inner: value.inner })
279                }
280                "BarChart" => SAPComponent::GuiBarChart(GuiBarChart { inner: value.inner }),
281                "GuiBox" => SAPComponent::GuiBox(GuiBox { inner: value.inner }),
282                "GuiButton" => SAPComponent::GuiButton(GuiButton { inner: value.inner }),
283                "Calendar" => SAPComponent::GuiCalendar(GuiCalendar { inner: value.inner }),
284                "Chart" => SAPComponent::GuiChart(GuiChart { inner: value.inner }),
285                "GuiCheckBox" => SAPComponent::GuiCheckBox(GuiCheckBox { inner: value.inner }),
286                "ColorSelector" => {
287                    SAPComponent::GuiColorSelector(GuiColorSelector { inner: value.inner })
288                }
289                "GuiComboBox" => SAPComponent::GuiComboBox(GuiComboBox { inner: value.inner }),
290                "ComboBoxControl" => {
291                    SAPComponent::GuiComboBoxControl(GuiComboBoxControl { inner: value.inner })
292                }
293                "GuiComboBoxEntry" => {
294                    SAPComponent::GuiComboBoxEntry(GuiComboBoxEntry { inner: value.inner })
295                }
296                "GuiComponent" => SAPComponent::GuiComponent(value),
297                "GuiConnection" => {
298                    SAPComponent::GuiConnection(GuiConnection { inner: value.inner })
299                }
300                "GuiContainer" => SAPComponent::GuiContainer(GuiContainer { inner: value.inner }),
301                "ContainerShell" => {
302                    SAPComponent::GuiContainerShell(GuiContainerShell { inner: value.inner })
303                }
304                "GuiCTextField" => {
305                    SAPComponent::GuiCTextField(GuiCTextField { inner: value.inner })
306                }
307                "GuiCustomControl" => {
308                    SAPComponent::GuiCustomControl(GuiCustomControl { inner: value.inner })
309                }
310                "GuiDialogShell" => {
311                    SAPComponent::GuiDialogShell(GuiDialogShell { inner: value.inner })
312                }
313                "EAIViewer2D" => {
314                    SAPComponent::GuiEAIViewer2D(GuiEAIViewer2D { inner: value.inner })
315                }
316                "EAIViewer3D" => {
317                    SAPComponent::GuiEAIViewer3D(GuiEAIViewer3D { inner: value.inner })
318                }
319                "GuiFrameWindow" => {
320                    SAPComponent::GuiFrameWindow(GuiFrameWindow { inner: value.inner })
321                }
322                "GuiGOSShell" => SAPComponent::GuiGOSShell(GuiGOSShell { inner: value.inner }),
323                "GraphAdapt" => {
324                    SAPComponent::GuiGraphAdapt(GuiGraphAdapt { inner: value.inner })
325                }
326                "GridView" => SAPComponent::GuiGridView(GuiGridView { inner: value.inner }),
327                "HTMLViewer" => {
328                    SAPComponent::GuiHTMLViewer(GuiHTMLViewer { inner: value.inner })
329                }
330                "InputFieldControl" => {
331                    SAPComponent::GuiInputFieldControl(GuiInputFieldControl { inner: value.inner })
332                }
333                "GuiLabel" => SAPComponent::GuiLabel(GuiLabel { inner: value.inner }),
334                "GuiMainWindow" => {
335                    SAPComponent::GuiMainWindow(GuiMainWindow { inner: value.inner })
336                }
337                "Map" => SAPComponent::GuiMap(GuiMap { inner: value.inner }),
338                "GuiMenu" => SAPComponent::GuiMenu(GuiMenu { inner: value.inner }),
339                "GuiMenubar" => SAPComponent::GuiMenubar(GuiMenubar { inner: value.inner }),
340                "GuiModalWindow" => {
341                    SAPComponent::GuiModalWindow(GuiModalWindow { inner: value.inner })
342                }
343                "NetChart" => SAPComponent::GuiNetChart(GuiNetChart { inner: value.inner }),
344                "OfficeIntegration" => {
345                    SAPComponent::GuiOfficeIntegration(GuiOfficeIntegration { inner: value.inner })
346                }
347                "GuiOkCodeField" => {
348                    SAPComponent::GuiOkCodeField(GuiOkCodeField { inner: value.inner })
349                }
350                "GuiPasswordField" => {
351                    SAPComponent::GuiPasswordField(GuiPasswordField { inner: value.inner })
352                }
353                "Picture" => SAPComponent::GuiPicture(GuiPicture { inner: value.inner }),
354                "GuiRadioButton" => {
355                    SAPComponent::GuiRadioButton(GuiRadioButton { inner: value.inner })
356                }
357                "SapChart" => SAPComponent::GuiSapChart(GuiSapChart { inner: value.inner }),
358                "GuiScrollbar" => SAPComponent::GuiScrollbar(GuiScrollbar { inner: value.inner }),
359                "GuiScrollContainer" => {
360                    SAPComponent::GuiScrollContainer(GuiScrollContainer { inner: value.inner })
361                }
362                "GuiSession" => SAPComponent::GuiSession(GuiSession { inner: value.inner }),
363                "GuiShell" => SAPComponent::GuiShell(GuiShell { inner: value.inner }),
364                "GuiSimpleContainer" => {
365                    SAPComponent::GuiSimpleContainer(GuiSimpleContainer { inner: value.inner })
366                }
367                "Split" => SAPComponent::GuiSplit(GuiSplit { inner: value.inner }),
368                "SplitterContainer" => {
369                    SAPComponent::GuiSplitterContainer(GuiSplitterContainer { inner: value.inner })
370                }
371                "Stage" => SAPComponent::GuiStage(GuiStage { inner: value.inner }),
372                "GuiStatusbar" => SAPComponent::GuiStatusbar(GuiStatusbar { inner: value.inner }),
373                "GuiStatusPane" => {
374                    SAPComponent::GuiStatusPane(GuiStatusPane { inner: value.inner })
375                }
376                "GuiTab" => SAPComponent::GuiTab(GuiTab { inner: value.inner }),
377                "GuiTableControl" => {
378                    SAPComponent::GuiTableControl(GuiTableControl { inner: value.inner })
379                }
380                "GuiTabStrip" => SAPComponent::GuiTabStrip(GuiTabStrip { inner: value.inner }),
381                "Textedit" => SAPComponent::GuiTextedit(GuiTextedit { inner: value.inner }),
382                "GuiTextField" => SAPComponent::GuiTextField(GuiTextField { inner: value.inner }),
383                "GuiTitlebar" => SAPComponent::GuiTitlebar(GuiTitlebar { inner: value.inner }),
384                "GuiToolbar" => SAPComponent::GuiToolbar(GuiToolbar { inner: value.inner }),
385                "Tree" => SAPComponent::GuiTree(GuiTree { inner: value.inner }),
386                "GuiUserArea" => SAPComponent::GuiUserArea(GuiUserArea { inner: value.inner }),
387                "GuiVComponent" => {
388                    SAPComponent::GuiVComponent(GuiVComponent { inner: value.inner })
389                }
390                "GuiVContainer" => {
391                    SAPComponent::GuiVContainer(GuiVContainer { inner: value.inner })
392                }
393                "GuiVHViewSwitch" => {
394                    SAPComponent::GuiVHViewSwitch(GuiVHViewSwitch { inner: value.inner })
395                }
396                _ => SAPComponent::GuiComponent(value),
397            }
398        } else {
399            SAPComponent::GuiComponent(value)
400        }
401    }
402}
403
404impl From<VARIANT> for SAPComponent {
405    fn from(value: VARIANT) -> Self {
406        let idisp = value.to_idispatch().unwrap();
407        Self::from(idisp.clone())
408    }
409}
410
411com_shim! {
412    class GuiApplication: GuiContainer + GuiComponent {
413        // TODO ActiveSession: Object,
414        mut AllowSystemMessages: bool,
415        mut ButtonbarVisible: bool,
416        Children: GuiComponentCollection,
417        ConnectionErrorText: String,
418        Connections: GuiComponentCollection,
419        mut HistoryEnabled: bool,
420        MajorVersion: i32,
421        MinorVersion: i32,
422        NewVisualDesign: bool,
423        Patchlevel: i32,
424        Revision: i32,
425        mut StatusbarVisible: bool,
426        mut TitlebarVisible: bool,
427        mut ToolbarVisible: bool,
428        Utils: GuiUtils,
429
430        fn AddHistoryEntry(String, String) -> bool,
431        fn CreateGuiCollection() -> GuiCollection,
432        fn DropHistory() -> bool,
433        fn Ignore(i16),
434        fn OpenConnection(String) -> SAPComponent,
435        fn OpenConnectionByConnectionString(String) -> SAPComponent,
436    }
437}
438
439com_shim! {
440    class GuiBarChart: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent + GuiShell {
441        ChartCount: i32,
442
443        fn BarCount(i32) -> i32,
444        fn GetBarContent(i32, i32, i32) -> String,
445        fn GetGridLineContent(i32, i32, i32) -> String,
446        fn GridCount(i32) -> i32,
447        fn LinkCount(i32) -> i32,
448        fn SendData(String),
449    }
450}
451
452com_shim! {
453    class GuiBox: GuiVComponent + GuiComponent {
454        CharHeight: i32,
455        CharLeft: i32,
456        CharTop: i32,
457        CharWidth: i32,
458    }
459}
460
461com_shim! {
462    class GuiButton: GuiVComponent + GuiComponent {
463        Emphasized: bool,
464        LeftLabel: SAPComponent,
465        RightLabel: SAPComponent,
466
467        fn Press(),
468    }
469}
470
471com_shim! {
472    class GuiCalendar: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent + GuiShell {
473        endSelection: String,
474        mut FirstVisibleDate: String,
475        mut FocusDate: String,
476        FocusedElement: i32,
477        horizontal: bool,
478        mut LastVisibleDate: String,
479        mut SelectionInterval: String,
480        startSelection: String,
481        Today: String,
482
483        fn ContextMenu(i32, i32, i32, String, String),
484        fn CreateDate(i32, i32, i32),
485        fn GetColor(String) -> i32,
486        fn GetColorInfo(i32) -> String,
487        fn GetDateTooltip(String) -> String,
488        fn GetDay(String) -> i32,
489        fn GetMonth(String) -> i32,
490        fn GetWeekday(String) -> String,
491        fn GetWeekNumber(String) -> i32,
492        fn GetYear(String) -> i32,
493        fn IsWeekend(String) -> bool,
494        fn SelectMonth(i32, i32),
495        fn SelectRange(String, String),
496        fn SelectWeek(i32, i32),
497    }
498}
499
500com_shim! {
501    class GuiChart: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent + GuiShell {
502        fn ValueChange(i32, i32, String, String, bool, String, String, i32),
503    }
504}
505
506com_shim! {
507    class GuiCheckBox: GuiVComponent + GuiComponent {
508        ColorIndex: i32,
509        ColorIntensified: i32,
510        ColorInverse: bool,
511        Flushing: bool,
512        IsLeftLabel: bool,
513        IsListElement: bool,
514        IsRightLabel: bool,
515        LeftLabel: SAPComponent,
516        RightLabel: SAPComponent,
517        RowText: String,
518        mut Selected: bool,
519
520        fn GetListProperty(String) -> String,
521        fn GetListPropertyNonRec(String) -> String,
522    }
523}
524
525com_shim! {
526    class GuiCollection {
527        Count: i32,
528        Length: i32,
529        Type: String,
530        TypeAsNumber: i32,
531
532        // TODO fn Add(Variant),
533        fn ElementAt(i32) -> SAPComponent,
534    }
535}
536
537com_shim! {
538    class GuiColorSelector: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent + GuiShell {
539        fn ChangeSelection(i16),
540    }
541}
542
543com_shim! {
544    class GuiComboBox: GuiVComponent + GuiComponent {
545        CharHeight: i32,
546        CharLeft: i32,
547        CharTop: i32,
548        CharWidth: i32,
549        CurListBoxEntry: SAPComponent,
550        Entries: GuiCollection,
551        Flushing: bool,
552        Highlighted: bool,
553        IsLeftLabel: bool,
554        IsListBoxActive: bool,
555        IsRightLabel: bool,
556        mut Key: String,
557        LeftLabel: SAPComponent,
558        Required: bool,
559        RightLabel: SAPComponent,
560        ShowKey: bool,
561        Text: String,
562        mut Value: String,
563
564        fn SetKeySpace(),
565    }
566}
567
568com_shim! {
569    class GuiComboBoxControl: GuiVComponent + GuiVContainer + GuiComponent + GuiContainer + GuiShell {
570        CurListBoxEntry: SAPComponent,
571        Entries: GuiCollection,
572        IsListBoxActive: bool,
573        LabelText: String,
574        mut Selected: String,
575        Text: String,
576
577        fn FireSelected(),
578    }
579}
580
581com_shim! {
582    class GuiComboBoxEntry {
583        Key: String,
584        Pos: i32,
585        Value: String,
586    }
587}
588
589com_shim! {
590    class GuiComponent {
591        ContainerType: bool,
592        Id: String,
593        Name: String,
594        Type: String,
595        TypeAsNumber: i32,
596    }
597}
598
599com_shim! {
600    class GuiComponentCollection {
601        Count: i32,
602        Length: i32,
603        Type: String,
604        TypeAsNumber: i32,
605
606        fn ElementAt(i32) -> SAPComponent,
607    }
608}
609
610com_shim! {
611    class GuiConnection: GuiContainer + GuiComponent {
612        Children: GuiComponentCollection,
613        ConnectionString: String,
614        Description: String,
615        DisabledByServer: bool,
616        Sessions: GuiComponentCollection,
617
618        fn CloseConnection(),
619        fn CloseSession(String),
620    }
621}
622
623com_shim! {
624    class GuiContainer: GuiComponent {
625        Children: GuiComponentCollection,
626
627        fn FindById(String) -> SAPComponent,
628    }
629}
630
631com_shim! {
632    class GuiContainerShell: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent + GuiShell {
633        AccDescription: String,
634    }
635}
636
637com_shim! {
638    class GuiCTextField: GuiTextField + GuiVComponent + GuiComponent { }
639}
640
641com_shim! {
642    class GuiCustomControl: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent {
643        CharHeight: i32,
644        CharLeft: i32,
645        CharTop: i32,
646        CharWidth: i32,
647    }
648}
649
650com_shim! {
651    class GuiDialogShell: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent {
652        Title: String,
653
654        fn Close(),
655    }
656}
657
658com_shim! {
659    class GuiDockShell: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent {
660        AccDescription: String,
661        DockerIsVertical: bool,
662        mut DockerPixelSize: i32,
663    }
664}
665
666com_shim! {
667    class GuiEAIViewer2D: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent + GuiShell {
668        mut AnnoutationEnabled: i32,
669        mut AnnotationMode: i16,
670        mut RedliningStream: String,
671
672        fn annotationTextRequest(String),
673    }
674}
675
676com_shim! {
677    class GuiEAIViewer3D: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent + GuiShell { }
678}
679
680com_shim! {
681    class GuiFrameWindow: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent {
682        mut ElementVisualizationMode: bool,
683        GuiFocus: SAPComponent,
684        Handle: i32,
685        Iconic: bool,
686        SystemFocus: SAPComponent,
687        WorkingPaneHeight: i32,
688        WorkingPaneWidth: i32,
689
690        fn Close(),
691        fn CompBitmap(String, String) -> i32,
692        fn HardCopy(String, i16) -> String,
693        fn Iconify(),
694        fn IsVKeyAllowed(i16) -> bool,
695        fn JumpBackward(),
696        fn JumpForward(),
697        fn Maximize(),
698        fn Restore(),
699        fn SendVKey(i16),
700        fn ShowMessageBox(String, String, i32, i32) -> i32,
701        fn TabBackward(),
702        fn TabForward(),
703    }
704}
705
706com_shim! {
707    class GuiGOSShell: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent { }
708}
709
710com_shim! {
711    class GuiGraphAdapt: GuiVComponent + GuiVContainer + GuiContainer + GuiComponent + GuiShell { }
712}
713
714com_shim! {
715    class GuiGridView: GuiVComponent + GuiVContainer + GuiComponent + GuiContainer + GuiShell {
716        ColumnCount: i32,
717        // TODO mut ColumnOrder: Object,
718        mut CurrentCellColumn: String,
719        mut CurrentCellRow: i32,
720        mut FirstVisibleColumn: String,
721        mut FirstVisibleRow: i32,
722        FrozenColumnCount: i32,
723        RowCount: i32,
724        // TODO mut SelectedCells: Object,
725        // TODO mut SelectedColumns: Object,
726        mut SelectedRows: String,
727        SelectionMode: String,
728        Title: String,
729        ToolbarButtonCount: i32,
730        VisibleRowCount: i32,
731
732        fn ClearSelection(),
733        fn Click(i32, String),
734        fn ClickCurrentCell(),
735        fn ContextMenu(),
736        fn CurrentCellMoved(),
737        fn DeleteRows(String),
738        fn DeselectColumn(String),
739        fn DoubleClick(i32, String),
740        fn DoubleClickCurrentCell(),
741        fn DuplicateRows(String),
742        fn GetCellChangeable(i32, String) -> bool,
743        fn GetCellCheckBoxChecked(i32, String) -> bool,
744        fn GetCellColor(i32, String) -> i32,
745        fn GetCellHeight(i32, String) -> i32,
746        fn GetCellHotspotType(i32, String) -> String,
747        fn GetCellIcon(i32, String) -> String,
748        fn GetCellLeft(i32, String) -> i32,
749        fn GetCellListBoxCount(i32, String) -> i32,
750        fn GetCellListBoxCurIndex(i32, String) -> String,
751        fn GetCellMaxLength(i32, String) -> i32,
752        fn GetCellState(i32, String) -> String,
753        fn GetCellTooltip(i32, String) -> String,
754        fn GetCellTop(i32, String) -> i32,
755        fn GetCellType(i32, String) -> String,
756        fn GetCellValue(i32, String) -> String,
757        fn GetCellWidth(i32, String) -> i32,
758        fn GetColorInfo(i32) -> String,
759        fn GetColumnDataType(String) -> String,
760        fn GetColumnOperationType(String) -> String,
761        fn GetColumnPosition(String) -> i32,
762        fn GetColumnSortType(String) -> String,
763        // TODO fn GetColumnTitles(String) -> Object,
764        fn GetColumnTooltip(String) -> String,
765        fn GetColumnTotalType(String) -> String,
766        fn GetDisplayedColumnTitle(String) -> String,
767        fn GetRowTotalLevel(i32) -> i32,
768        fn GetSymbolInfo(String) -> String,
769        fn GetToolbarButtonChecked(i32) -> bool,
770        fn GetToolbarButtonEnabled(i32) -> bool,
771        fn GetToolbarButtonIcon(i32) -> String,
772        fn GetToolbarButtonId(i32) -> String,
773        fn GetToolbarButtonText(i32) -> String,
774        fn GetToolbarButtonTooltip(i32) -> String,
775        fn GetToolbarButtonType(i32) -> String,
776        fn GetToolbarFocusButton() -> i32,
777        fn HasCellF4Help(i32, String) -> bool,
778        fn HistoryCurEntry(i32, String) -> String,
779        fn HistoryCurIndex(i32, String) -> i32,
780        fn HistoryIsActive(i32, String) -> bool,
781        fn HistoryList(i32, String) -> GuiCollection,
782        fn InsertRows(String),
783        fn IsCellHotspot(i32, String) -> bool,
784        fn IsCellSymbol(i32, String) -> bool,
785        fn IsCellTotalExpander(i32, String) -> bool,
786        fn IsColumnFiltered(String) -> bool,
787        fn IsColumnKey(String) -> bool,
788        fn IsTotalRowExpanded(i32) -> bool,
789        fn ModifyCell(i32, String, String),
790        fn ModifyCheckBox(i32, String, bool),
791        fn MoveRows(i32, i32, i32),
792        fn PressButton(i32, String),
793        fn PressButtonCurrentCell(),
794        fn PressColumnHeader(String),
795        fn PressEnter(),
796        fn PressF1(),
797        fn PressF4(),
798        fn PressToolbarButton(String),
799        fn PressToolbarContextButton(String),
800        fn PressTotalRow(i32, String),
801        fn PressTotalRowCurrentCell(),
802        fn SelectAll(),
803        fn SelectColumn(String),
804        fn SelectionChanged(),
805        fn SelectToolbarMenuItem(String),
806        fn SetColumnWidth(String, i32),
807        fn SetCurrentCell(i32, String),
808        fn TriggerModified(),
809    }
810}
811
812com_shim! {
813    class GuiHTMLViewer: GuiVComponent + GuiVContainer + GuiComponent + GuiContainer + GuiShell {
814        // TODO BrowserHandle: Object,
815        DocumentComplete: i32,
816
817        fn ContextMenu(),
818        fn GetBrowerControlType() -> i32,
819        fn SapEvent(String, String, String),
820    }
821}
822
823com_shim! {
824    class GuiInputFieldControl: GuiVComponent + GuiVContainer + GuiComponent + GuiContainer + GuiShell {
825        ButtonTooltip: String,
826        FindButtonActivated: bool,
827        HistoryCurEntry: String,
828        HistoryCurIndex: i32,
829        HistoryIsActive: bool,
830        HistoryList: GuiCollection,
831        LabelText: String,
832        PromptText: String,
833
834        fn Submit(),
835    }
836}
837
838com_shim! {
839    class GuiLabel: GuiVComponent + GuiComponent {
840        mut CaretPosition: i32,
841        CharHeight: i32,
842        CharLeft: i32,
843        CharTop: i32,
844        CharWidth: i32,
845        ColorIndex: i32,
846        ColorIntensified: bool,
847        ColorInverse: bool,
848        DisplayedText: String,
849        Highlighted: String,
850        IsHotspot: String,
851        IsLeftLabel: bool,
852        IsListElement: bool,
853        IsRightLabel: bool,
854        MaxLength: i32,
855        Numerical: bool,
856        RowText: String,
857
858        fn GetListProperty(String) -> String,
859        fn GetListPropertyNonRec(String) -> String,
860    }
861}
862
863com_shim! {
864    class GuiMainWindow: GuiFrameWindow + GuiVComponent + GuiVContainer + GuiContainer + GuiComponent {
865        mut ButtonbarVisible: bool,
866        mut StatusbarVisible: bool,
867        mut TitlebarVisible: bool,
868        mut ToolbarVisible: bool,
869
870        fn ResizeWorkingPane(i32, i32, bool),
871        fn ResizeWorkingPaneEx(i32, i32, bool),
872    }
873}
874
875com_shim! {
876    class GuiMap: GuiVComponent + GuiVContainer + GuiComponent + GuiContainer + GuiShell { }
877}
878
879com_shim! {
880    class GuiMenu: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent {
881        fn Select(),
882    }
883}
884
885com_shim! {
886    class GuiMenubar: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent { }
887}
888
889com_shim! {
890    class GuiMessageWindow: GuiVComponent + GuiComponent {
891        FocusedButton: i32,
892        HelpButtonHelpText: String,
893        HelpButtonText: String,
894        MessageText: String,
895        MessageType: i32,
896        OKButtonHelpText: String,
897        OKButtonText: String,
898        ScreenLeft: i32,
899        ScreenTop: i32,
900        Visible: bool,
901    }
902}
903
904com_shim! {
905    class GuiModalWindow: GuiFrameWindow + GuiVComponent + GuiVContainer + GuiComponent + GuiContainer {
906        fn IsPopupDialog() -> bool,
907        fn PopupDialogText() -> String,
908    }
909}
910
911com_shim! {
912    class GuiNetChart: GuiVComponent + GuiVContainer + GuiComponent + GuiContainer + GuiShell {
913        LinkCount: i32,
914        NodeCount: i32,
915
916        fn GetLinkContent(i32, i32) -> String,
917        fn GetNodeContent(i32, i32) -> String,
918        fn SendData(String),
919    }
920}
921
922com_shim! {
923    class GuiOfficeIntegration: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent + GuiShell {
924        // TODO Document: Object,
925        HostedApplication: i32,
926
927        fn AppendRow(String, String),
928        fn CloseDocument(i32, bool, bool),
929        // TODO fn CustomEvent(i32, String, i32, ...),
930        fn RemoveContent(String),
931        fn SaveDocument(i32, bool),
932        fn SetDocument(i32, String),
933    }
934}
935
936com_shim! {
937    class GuiOkCodeField: GuiVComponent + GuiComponent {
938        Opened: bool,
939
940        fn PressF1(),
941    }
942}
943
944com_shim! {
945    class GuiPasswordField: GuiTextField + GuiVComponent + GuiComponent { }
946}
947
948com_shim! {
949    class GuiPicture: GuiVComponent + GuiVContainer + GuiComponent + GuiContainer + GuiShell {
950        AltText: String,
951        DisplayMode: String,
952        Icon: String,
953        Url: String,
954
955        fn Click(),
956        fn ClickControlArea(i32, i32),
957        fn ClickPictureArea(i32, i32),
958        fn ContextMenu(i32, i32),
959        fn DoubleClick(),
960        fn DoubleClickControlArea(i32, i32),
961        fn DoubleClickPictureArea(i32, i32),
962    }
963}
964
965com_shim! {
966    class GuiRadioButton: GuiVComponent + GuiComponent {
967        CharHeight: i32,
968        CharLeft: i32,
969        CharTop: i32,
970        CharWidth: i32,
971        Flushing: bool,
972        GroupCount: i32,
973        GroupMembers: GuiComponentCollection,
974        GroupPos: i32,
975        IsLeftLabel: bool,
976        IsRightLabel: bool,
977        LeftLabel: SAPComponent,
978        RightLabel: SAPComponent,
979        Selected: bool,
980
981        fn Select(),
982    }
983}
984
985com_shim! {
986    class GuiSapChart: GuiVComponent + GuiVContainer + GuiComponent + GuiContainer + GuiShell { }
987}
988
989com_shim! {
990    class GuiScrollbar {
991        Maximum: i32,
992        Minimum: i32,
993        PageSize: i32,
994        mut Position: i32,
995        Range: i32,
996    }
997}
998
999com_shim! {
1000    class GuiScrollContainer: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent {
1001        HorizontalScrollbar: SAPComponent,
1002        VerticalScrollbar: SAPComponent,
1003    }
1004}
1005
1006com_shim! {
1007    class GuiSession: GuiContainer + GuiComponent {
1008        mut AccEnhancedTabChain: bool,
1009        mut AccSymbolReplacement: bool,
1010        ActiveWindow: SAPComponent,
1011        mut Busy: bool,
1012        // TODO mut ErrorList: GuiCollection,
1013        Info: GuiSessionInfo,
1014        IsActive: bool,
1015        IsListBoxActive: bool,
1016        ListBoxCurrEntry: i32,
1017        ListBoxCurrEntryHeight: i32,
1018        ListBoxCurrEntryLeft: i32,
1019        ListBoxCurrEntryTop: i32,
1020        ListBoxCurrEntryWidth: i32,
1021        ListBoxHeight: i32,
1022        ListBoxLeft: i32,
1023        ListBoxTop: i32,
1024        ListBoxWidth: i32,
1025        mut PassportPreSystemId: String,
1026        mut PassportSystemId: String,
1027        mut PassportTransactionId: String,
1028        ProgressPercent: i32,
1029        ProgressText: String,
1030        mut Record: bool,
1031        mut RecordFile: String,
1032        mut SaveAsUnicode: bool,
1033        mut ShowDropdownKeys: bool,
1034        mut SuppressBackendPopups: bool,
1035        mut TestToolMode: i32,
1036
1037        fn AsStdNumberFormat(String) -> String,
1038        fn ClearErrorList(),
1039        fn CreateSession(),
1040        fn EnableJawsEvents(),
1041        fn EndTransaction(),
1042        fn FindByPosition(i32, i32) -> SAPComponent,
1043        fn GetIconResourceName(String) -> String,
1044        fn GetObjectTree(String) -> String,
1045        fn GetVKeyDescription(i32) -> String,
1046        fn LockSessionUI(),
1047        fn SendCommand(String),
1048        fn SendCommandAsync(String),
1049        fn StartTransaction(String),
1050        fn UnlockSessionUI(),
1051    }
1052}
1053
1054com_shim! {
1055    class GuiSessionInfo {
1056        ApplicationServer: String,
1057        Client: String,
1058        Codepage: i32,
1059        Flushes: i32,
1060        Group: String,
1061        GuiCodepage: i32,
1062        I18NMode: bool,
1063        InterpretationTime: i32,
1064        IsLowSpeedConnection: bool,
1065        Language: String,
1066        MessageServer: String,
1067        Program: String,
1068        ResponseTime: i32,
1069        RoundTrips: i32,
1070        ScreenNumber: i32,
1071        ScriptingModeReadOnly: bool,
1072        ScriptingModeRecordingDisabled: bool,
1073        SessionNumber: i32,
1074        SystemName: String,
1075        SystemNumber: i32,
1076        SystemSessionId: String,
1077        Transaction: String,
1078        UI_GUIDELINE: String,
1079        User: String,
1080    }
1081}
1082
1083com_shim! {
1084    class GuiShell: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent {
1085        AccDescription: String,
1086        DragDropSupported: bool,
1087        Handle: i32,
1088        OcxEvents: GuiCollection,
1089        SubType: String,
1090
1091        fn SelectContextMenuItem(String),
1092        fn SelectContextMenuItemByPosition(String),
1093        fn SelectContextMenuItemByText(String),
1094    }
1095}
1096
1097com_shim! {
1098    class GuiSimpleContainer: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent {
1099        IsListElement: bool,
1100        IsStepLoop: bool,
1101        IsStepLoopInTableStructure: bool,
1102        LoopColCount: i32,
1103        LoopCurrentCol: i32,
1104        LoopCurrentColCount: i32,
1105        LoopCurrentRow: i32,
1106        LoopRowCount: i32,
1107
1108        fn GetListProperty(String) -> String,
1109        fn GetListPropertyNonRec(String) -> String,
1110    }
1111}
1112
1113com_shim! {
1114    class GuiSplit: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent + GuiShell {
1115        IsVertical: i32,
1116
1117        fn GetColSize(i32) -> i32,
1118        fn GetRowSize(i32) -> i32,
1119        fn SetColSize(i32, i32),
1120        fn SetRowSize(i32, i32),
1121    }
1122}
1123
1124com_shim! {
1125    class GuiSplitterContainer: GuiVContainer + GuiVComponent + GuiComponent + GuiContainer + GuiShell {
1126        IsVertical: bool,
1127        mut SashPosition: i32,
1128    }
1129}
1130
1131com_shim! {
1132    class GuiStage: GuiVComponent + GuiVContainer + GuiContainer + GuiShell + GuiComponent {
1133        fn ContextMenu(String),
1134        fn DoubleClick(String),
1135        fn SelectItems(String),
1136    }
1137}
1138
1139com_shim! {
1140    class GuiStatusbar: GuiVComponent + GuiVContainer + GuiComponent + GuiContainer {
1141        Handle: i32,
1142        MessageAsPopup: bool,
1143        MessageHasLongText: i32,
1144        MessageId: String,
1145        MessageNumber: String,
1146        MessageParameter: String,
1147        MessageType: String,
1148
1149        fn CreateSupportMessageClick(),
1150        fn DoubleClick(),
1151        fn ServiceRequestClick(),
1152    }
1153}
1154
1155com_shim! {
1156    class GuiStatusBarLink: GuiVComponent + GuiComponent {
1157        fn Press(),
1158    }
1159}
1160
1161com_shim! {
1162    class GuiStatusPane: GuiVComponent + GuiComponent {
1163        Children: GuiComponentCollection,
1164    }
1165}
1166
1167com_shim! {
1168    class GuiTab: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent {
1169        fn ScrollToLeft(),
1170        fn Select(),
1171    }
1172}
1173
1174com_shim! {
1175    class GuiTableColumn: GuiComponentCollection {
1176        DefaultTooltip: String,
1177        Fixed: bool,
1178        IconName: String,
1179        Selected: bool,
1180        Title: String,
1181        Tooltip: String,
1182    }
1183}
1184
1185com_shim! {
1186    class GuiTableControl: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent {
1187        CharHeight: i32,
1188        CharLeft: i32,
1189        CharTop: i32,
1190        CharWidth: i32,
1191        // TODO ColSelectMode: GuiTableSelectionType,
1192        Columns: GuiCollection,
1193        CurrentCol: i32,
1194        CurrentRow: i32,
1195        HorizontalScrollbar: SAPComponent,
1196        RowCount: i32,
1197        Rows: GuiCollection,
1198        // TODO RowSelectMode: GuiTableSelectionType,
1199        TableFieldName: String,
1200        VerticalScrollbar: SAPComponent,
1201        VisibleRowCount: i32,
1202
1203        fn ConfigureLayout(),
1204        fn DeselectAllColumns(),
1205        fn GetAbsoluteRow(i32) -> GuiTableRow,
1206        fn GetCell(i32, i32) -> SAPComponent,
1207        fn ReorderTable(String),
1208        fn SelectAllColumns(),
1209    }
1210}
1211
1212com_shim! {
1213    class GuiTableRow: GuiComponentCollection {
1214        Selectable: bool,
1215        mut Selected: bool,
1216    }
1217}
1218
1219com_shim! {
1220    class GuiTabStrip: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent {
1221        CharHeight: i32,
1222        CharLeft: i32,
1223        CharTop: i32,
1224        CharWidth: i32,
1225        LeftTab: SAPComponent,
1226        SelectedTab: SAPComponent,
1227    }
1228}
1229
1230com_shim! {
1231    class GuiTextedit: GuiShell + GuiVComponent + GuiVContainer + GuiContainer + GuiComponent {
1232        CurrentColumn: i32,
1233        CurrentLine: i32,
1234        mut FirstVisibleLine: i32,
1235        LastVisibleLine: i32,
1236        LineCount: i32,
1237        NumberOfUnprotectedTextParts: i32,
1238        SelectedText: String,
1239        SelectionEndColumn: i32,
1240        SelectionEndLine: i32,
1241        SelectionIndexEnd: i32,
1242        SelectionIndexStart: i32,
1243        SelectionStartColumn: i32,
1244        SelectionStartLine: i32,
1245
1246        fn ContextMenu(),
1247        fn DoubleClick(),
1248        fn GetLineText(i32) -> String,
1249        fn GetUnprotectedTextPart(i32) -> String,
1250        fn IsBreakpointLine(i32) -> bool,
1251        fn IsCommentLine(i32) -> bool,
1252        fn IsHighlightedLine(i32) -> bool,
1253        fn IsProtectedLine(i32) -> bool,
1254        fn IsSelectedLine(i32) -> bool,
1255        fn ModifiedStatusChanged(bool),
1256        fn MultipleFilesDropped(),
1257        fn PressF1(),
1258        fn PressF4(),
1259        fn SetSelectionIndexes(i32, i32),
1260        fn SetUnprotectedTextPart(i32, String) -> bool,
1261        fn SingleFileDropped(String),
1262    }
1263}
1264
1265com_shim! {
1266    class GuiTextField: GuiVComponent + GuiComponent {
1267        mut CaretPosition: i32,
1268        DisplayedText: String,
1269        Highlighted: bool,
1270        HistoryCurEntry: String,
1271        HistoryCurIndex: i32,
1272        HistoryIsActive: bool,
1273        HistoryList: GuiCollection,
1274        IsHotspot: bool,
1275        IsLeftLabel: bool,
1276        IsListElement: bool,
1277        IsOField: bool,
1278        IsRightLabel: bool,
1279        LeftLabel: SAPComponent,
1280        MaxLength: i32,
1281        Numerical: bool,
1282        Required: bool,
1283        RightLabel: SAPComponent,
1284
1285        fn GetListProperty(String) -> String,
1286        fn GetListPropertyNonRec(String) -> String,
1287    }
1288}
1289
1290com_shim! {
1291    class GuiTitlebar: GuiVComponent + GuiVContainer + GuiContainer + GuiComponent { }
1292}
1293
1294com_shim! {
1295    class GuiToolbar: GuiVComponent + GuiVContainer + GuiContainer + GuiComponent { }
1296}
1297
1298com_shim! {
1299    class GuiToolbarControl: GuiShell + GuiVComponent + GuiVContainer + GuiComponent + GuiContainer {
1300        ButtonCount: i32,
1301        FocusedButton: i32,
1302
1303        fn GetButtonChecked(i32) -> bool,
1304        fn GetButtonEnabled(i32) -> bool,
1305        fn GetButtonIcon(i32) -> String,
1306        fn GetButtonId(i32) -> String,
1307        fn GetButtonText(i32) -> String,
1308        fn GetButtonTooltip(i32) -> String,
1309        fn GetButtonType(i32) -> String,
1310        fn GetMenuItemIdFromPosition(i32) -> String,
1311        fn PressButton(String),
1312        fn PressContextButton(String),
1313        fn SelectMenuItem(String),
1314        fn SelectMenuItemByText(String),
1315    }
1316}
1317
1318com_shim! {
1319    class GuiTree: GuiShell + GuiVContainer + GuiVComponent + GuiComponent + GuiContainer {
1320        // TODO ColumnOrder: Object,
1321        HierarchyHeaderWidth: i32,
1322        SelectedNode: String,
1323        TopNode: String,
1324
1325        fn ChangeCheckbox(String, String, bool),
1326        fn ClickLink(String, String),
1327        fn CollapseNode(String),
1328        fn DefaultContextMenu(),
1329        fn DoubleClickItem(String, String),
1330        fn DoubleClickNode(String),
1331        fn EnsureVisibleHorizontalItem(String, String),
1332        fn ExpandNode(String),
1333        fn FindNodeKeyByPath(String) -> String,
1334        fn GetAbapImage(String, String) -> String,
1335        // TODO fn GetAllNodeKeys() -> Object,
1336        fn GetCheckBoxState(String, String) -> bool,
1337        // TODO fn GetColumnCol(String) -> Object,
1338        // TODO fn GetColumnHeaders() -> Object,
1339        fn GetColumnIndexFromName(String) -> i32,
1340        // TODO fn GetColumnNames() -> Object,
1341        fn GetColumnTitleFromName(String) -> String,
1342        // TODO fn GetColumnTitles() -> Object,
1343        fn GetFocusedNodeKey() -> String,
1344        fn GetHierarchyLevel(String) -> i32,
1345        fn GetHierarchyTitle() -> String,
1346        fn GetIsDisabled(String, String) -> bool,
1347        fn GetIsEditable(String, String) -> bool,
1348        fn GetIsHighLighted(String, String) -> bool,
1349        fn GetItemHeight(String, String) -> i32,
1350        fn GetItemLeft(String, String) -> i32,
1351        fn GetItemStyle(String, String) -> i32,
1352        fn GetItemText(String, String) -> String,
1353        fn GetItemTextColor(String, String) -> u64,
1354        fn GetItemToolTip(String, String) -> String,
1355        fn GetItemTop(String, String) -> i32,
1356        fn GetItemType(String, String) -> i32,
1357        fn GetItemWidth(String, String) -> i32,
1358        fn GetListTreeNodeItemCount(String) -> i32,
1359        fn GetNextNodeKey(String) -> String,
1360        fn GetNodeAbapImage(String) -> String,
1361        fn GetNodeChildrenCount(String) -> i32,
1362        fn GetNodeChildrenCountByPath(String) -> i32,
1363        fn GetNodeHeight(String) -> i32,
1364        fn GetNodeIndex(String) -> i32,
1365        // TODO fn GetNodeItemHeaders(String) -> Object,
1366        fn GetNodeKeyByPath(String) -> String,
1367        fn GetNodeLeft(String) -> i32,
1368        fn GetNodePathByKey(String) -> String,
1369        // TODO fn GetNodesCol() -> Object,
1370        fn GetNodeStyle(String) -> i32,
1371        fn GetNodeTextByKey(String) -> String,
1372        fn GetNodeTextByPath(String) -> String,
1373        fn GetNodeTextColor(String) -> u64,
1374        fn GetNodeToolTip(String) -> String,
1375        fn GetNodeTop(String) -> i32,
1376        fn GetNodeWidth(String) -> i32,
1377        fn GetParent(String) -> String,
1378        fn GetPreviousNodeKey(String) -> String,
1379        // TODO fn GetSelectedNodes() -> Object,
1380        fn GetSelectionMode() -> i16,
1381        fn GetStyleDescription(i32) -> String,
1382        // TODO fn GetSubNodesCol(String) -> Object,
1383        fn GetTreeType() -> i32,
1384        fn HeaderContextMenu(String),
1385        fn IsFolder(String) -> bool,
1386        fn IsFolderExpandable(String) -> bool,
1387        fn IsFolderExpanded(String) -> bool,
1388        fn ItemContextMenu(String, String),
1389        fn NodeContextMenu(String),
1390        fn PressButton(String, String),
1391        fn PressHeader(String),
1392        fn PressKey(String),
1393        fn SelectColumn(String),
1394        fn SelectedItemColumn() -> String,
1395        fn SelectedItemNode() -> String,
1396        fn SelectItem(String, String),
1397        fn SelectNode(String),
1398        fn SetCheckBoxState(String, String, i32),
1399        fn SetColumnWidth(String, i32),
1400        fn UnselectAll(),
1401        fn UnselectColumn(String),
1402        fn UnselectNode(String),
1403    }
1404}
1405
1406com_shim! {
1407    class GuiUserArea: GuiVContainer + GuiVComponent + GuiComponent + GuiContainer {
1408        HorizontalScrollbar: SAPComponent,
1409        IsOTFPreview: bool,
1410        VerticalScrollbar: SAPComponent,
1411
1412        fn FindByLabel(String, String) -> SAPComponent,
1413        fn ListNavigate(String),
1414    }
1415}
1416
1417com_shim! {
1418    class GuiUtils {
1419        MESSAGE_OPTION_OK: i32,
1420        MESSAGE_OPTION_OKCANCEL: i32,
1421        MESSAGE_OPTION_YESNO: i32,
1422        MESSAGE_RESULT_CANCEL: i32,
1423        MESSAGE_RESULT_NO: i32,
1424        MESSAGE_RESULT_OK: i32,
1425        MESSAGE_RESULT_YES: i32,
1426        MESSAGE_TYPE_ERROR: i32,
1427        MESSAGE_TYPE_INFORMATION: i32,
1428        MESSAGE_TYPE_PLAIN: i32,
1429        MESSAGE_TYPE_QUESTION: i32,
1430        MESSAGE_TYPE_WARNING: i32,
1431
1432        fn CloseFile(i32),
1433        fn OpenFile(String) -> i32,
1434        fn ShowMessageBox(String, String, i32, i32) -> i32,
1435        fn Write(i32, String),
1436        fn WriteLine(i32, String),
1437    }
1438}
1439
1440com_shim! {
1441    class GuiVComponent: GuiComponent {
1442        AccLabelCollection: GuiComponentCollection,
1443        AccText: String,
1444        AccTextOnRequest: String,
1445        AccTooltip: String,
1446        Changeable: bool,
1447        DefaultTooltip: String,
1448        Height: i32,
1449        IconName: String,
1450        IsSymbolFont: bool,
1451        Left: i32,
1452        Modified: bool,
1453        ParentFrame: SAPComponent,
1454        ScreenLeft: i32,
1455        ScreenTop: i32,
1456        mut Text: String,
1457        Tooltip: String,
1458        Top: i32,
1459        Width: i32,
1460
1461        fn DumpState(String) -> GuiCollection,
1462        fn SetFocus(),
1463        fn Visualize(bool) -> bool,
1464    }
1465}
1466
1467com_shim! {
1468    class GuiVContainer: GuiVComponent + GuiComponent + GuiContainer {
1469        fn FindAllByName(String, String) -> GuiComponentCollection,
1470        fn FindAllByNameEx(String, i32) -> GuiComponentCollection,
1471        fn FindByName(String, String) -> SAPComponent,
1472        fn FindByNameEx(String, String) -> SAPComponent,
1473    }
1474}
1475
1476com_shim! {
1477    class GuiVHViewSwitch: GuiVComponent + GuiComponent {}
1478}