1use com_shim::{com_shim, IDispatchExt, VariantExt};
2use windows::{core::*, Win32::System::Com::*, Win32::System::Variant::*};
3
4pub 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 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
40pub enum SAPComponent {
42 GuiApplication(GuiApplication),
47 GuiBarChart(GuiBarChart),
49 GuiBox(GuiBox),
52 GuiButton(GuiButton),
57 GuiCalendar(GuiCalendar),
60 GuiChart(GuiChart),
63 GuiCheckBox(GuiCheckBox),
66 GuiColorSelector(GuiColorSelector),
68 GuiComboBox(GuiComboBox),
75 GuiComboBoxControl(GuiComboBoxControl),
77 GuiComboBoxEntry(GuiComboBoxEntry),
79 GuiComponent(GuiComponent),
82 GuiConnection(GuiConnection),
87 GuiContainer(GuiContainer),
91 GuiContainerShell(GuiContainerShell),
94 GuiCTextField(GuiCTextField),
101 GuiCustomControl(GuiCustomControl),
106 GuiDialogShell(GuiDialogShell),
110 GuiEAIViewer2D(GuiEAIViewer2D),
114 GuiEAIViewer3D(GuiEAIViewer3D),
116 GuiFrameWindow(GuiFrameWindow),
121 GuiGOSShell(GuiGOSShell),
124 GuiGraphAdapt(GuiGraphAdapt),
127 GuiGridView(GuiGridView),
130 GuiHTMLViewer(GuiHTMLViewer),
133 GuiInputFieldControl(GuiInputFieldControl),
135 GuiLabel(GuiLabel),
138 GuiMainWindow(GuiMainWindow),
140 GuiMap(GuiMap),
142 GuiMenu(GuiMenu),
146 GuiMenubar(GuiMenubar),
149 GuiModalWindow(GuiModalWindow),
151 GuiNetChart(GuiNetChart),
155 GuiOfficeIntegration(GuiOfficeIntegration),
157 GuiOkCodeField(GuiOkCodeField),
162 GuiPasswordField(GuiPasswordField),
170 GuiPicture(GuiPicture),
172 GuiRadioButton(GuiRadioButton),
175 GuiSapChart(GuiSapChart),
177 GuiScrollbar(GuiScrollbar),
179 GuiScrollContainer(GuiScrollContainer),
184 GuiSession(GuiSession),
192 GuiShell(GuiShell),
195 GuiSimpleContainer(GuiSimpleContainer),
199 GuiSplit(GuiSplit),
201 GuiSplitterContainer(GuiSplitterContainer),
205 GuiStage(GuiStage),
207 GuiStatusbar(GuiStatusbar),
211 GuiStatusPane(GuiStatusPane),
216 GuiTab(GuiTab),
219 GuiTableControl(GuiTableControl),
222 GuiTabStrip(GuiTabStrip),
225 GuiTextedit(GuiTextedit),
229 GuiTextField(GuiTextField),
232 GuiTitlebar(GuiTitlebar),
235 GuiToolbar(GuiToolbar),
241 GuiTree(GuiTree),
243 GuiUserArea(GuiUserArea),
247 GuiVComponent(GuiVComponent),
251 GuiVContainer(GuiVContainer),
255 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 log::debug!("Subkind is {sub_kind}");
272 kind = sub_kind;
273 }
274 }
275 match kind.as_str() {
276 "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 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 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 mut CurrentCellColumn: String,
719 mut CurrentCellRow: i32,
720 mut FirstVisibleColumn: String,
721 mut FirstVisibleRow: i32,
722 FrozenColumnCount: i32,
723 RowCount: i32,
724 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 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 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 HostedApplication: i32,
926
927 fn AppendRow(String, String),
928 fn CloseDocument(i32, bool, bool),
929 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 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 Columns: GuiCollection,
1193 CurrentCol: i32,
1194 CurrentRow: i32,
1195 HorizontalScrollbar: SAPComponent,
1196 RowCount: i32,
1197 Rows: GuiCollection,
1198 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 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 fn GetCheckBoxState(String, String) -> bool,
1337 fn GetColumnIndexFromName(String) -> i32,
1340 fn GetColumnTitleFromName(String) -> String,
1342 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 fn GetNodeKeyByPath(String) -> String,
1367 fn GetNodeLeft(String) -> i32,
1368 fn GetNodePathByKey(String) -> String,
1369 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 fn GetSelectionMode() -> i16,
1381 fn GetStyleDescription(i32) -> String,
1382 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}