use com_shim::{com_shim, IDispatchExt, VariantExt};
use windows::{core::*, Win32::System::Com::*, Win32::System::Variant::*};
pub struct SAPWrapper {
inner: IDispatch,
}
impl SAPWrapper {
pub(crate) fn new() -> crate::Result<Self> {
unsafe {
let clsid: GUID = CLSIDFromProgID(w!("SapROTWr.SapROTWrapper"))?;
let p_clsid: *const GUID = &clsid;
log::debug!("CSapROTWrapper CLSID: {:?}", clsid);
let dispatch: IDispatch =
CoCreateInstance(p_clsid, None, CLSCTX_LOCAL_SERVER | CLSCTX_INPROC_SERVER)?;
Ok(SAPWrapper { inner: dispatch })
}
}
pub fn scripting_engine(&self) -> crate::Result<GuiApplication> {
log::debug!("Getting UI ROT entry...");
let result = self
.inner
.call("GetROTEntry", vec![VARIANT::from_str("SAPGUI")])?;
let sap_gui = result.to_idispatch()?;
log::debug!("Getting scripting engine.");
let scripting_engine = sap_gui.call("GetScriptingEngine", vec![])?;
Ok(GuiApplication {
inner: scripting_engine.to_idispatch()?.clone(),
})
}
}
pub enum SAPComponent {
GuiApplication(GuiApplication),
GuiBarChart(GuiBarChart),
GuiBox(GuiBox),
GuiButton(GuiButton),
GuiCalendar(GuiCalendar),
GuiChart(GuiChart),
GuiCheckBox(GuiCheckBox),
GuiColorSelector(GuiColorSelector),
GuiComboBox(GuiComboBox),
GuiComboBoxControl(GuiComboBoxControl),
GuiComboBoxEntry(GuiComboBoxEntry),
GuiComponent(GuiComponent),
GuiConnection(GuiConnection),
GuiContainer(GuiContainer),
GuiContainerShell(GuiContainerShell),
GuiCTextField(GuiCTextField),
GuiCustomControl(GuiCustomControl),
GuiDialogShell(GuiDialogShell),
GuiEAIViewer2D(GuiEAIViewer2D),
GuiEAIViewer3D(GuiEAIViewer3D),
GuiFrameWindow(GuiFrameWindow),
GuiGOSShell(GuiGOSShell),
GuiGraphAdapt(GuiGraphAdapt),
GuiGridView(GuiGridView),
GuiHTMLViewer(GuiHTMLViewer),
GuiInputFieldControl(GuiInputFieldControl),
GuiLabel(GuiLabel),
GuiMainWindow(GuiMainWindow),
GuiMap(GuiMap),
GuiMenu(GuiMenu),
GuiMenubar(GuiMenubar),
GuiModalWindow(GuiModalWindow),
GuiNetChart(GuiNetChart),
GuiOfficeIntegration(GuiOfficeIntegration),
GuiOkCodeField(GuiOkCodeField),
GuiPasswordField(GuiPasswordField),
GuiPicture(GuiPicture),
GuiRadioButton(GuiRadioButton),
GuiSapChart(GuiSapChart),
GuiScrollbar(GuiScrollbar),
GuiScrollContainer(GuiScrollContainer),
GuiSession(GuiSession),
GuiShell(GuiShell),
GuiSimpleContainer(GuiSimpleContainer),
GuiSplit(GuiSplit),
GuiSplitterContainer(GuiSplitterContainer),
GuiStage(GuiStage),
GuiStatusbar(GuiStatusbar),
GuiStatusPane(GuiStatusPane),
GuiTab(GuiTab),
GuiTableControl(GuiTableControl),
GuiTabStrip(GuiTabStrip),
GuiTextedit(GuiTextedit),
GuiTextField(GuiTextField),
GuiTitlebar(GuiTitlebar),
GuiToolbar(GuiToolbar),
GuiTree(GuiTree),
GuiUserArea(GuiUserArea),
GuiVComponent(GuiVComponent),
GuiVContainer(GuiVContainer),
GuiVHViewSwitch(GuiVHViewSwitch),
}
impl From<IDispatch> for SAPComponent {
fn from(value: IDispatch) -> Self {
let value = GuiComponent { inner: value };
if let Ok(mut kind) = value._type() {
log::debug!("Converting component {kind} to SAPComponent.");
if kind.as_str() == "GuiShell" {
log::debug!("Kind is shell, checking subkind.");
if let Ok(sub_kind) = (GuiShell { inner: value.inner.clone() }).sub_type() {
log::debug!("Subkind is {sub_kind}");
kind = sub_kind;
}
}
match kind.as_str() {
"GuiApplication" => {
SAPComponent::GuiApplication(GuiApplication { inner: value.inner })
}
"BarChart" => SAPComponent::GuiBarChart(GuiBarChart { inner: value.inner }),
"GuiBox" => SAPComponent::GuiBox(GuiBox { inner: value.inner }),
"GuiButton" => SAPComponent::GuiButton(GuiButton { inner: value.inner }),
"Calendar" => SAPComponent::GuiCalendar(GuiCalendar { inner: value.inner }),
"Chart" => SAPComponent::GuiChart(GuiChart { inner: value.inner }),
"GuiCheckBox" => SAPComponent::GuiCheckBox(GuiCheckBox { inner: value.inner }),
"ColorSelector" => {
SAPComponent::GuiColorSelector(GuiColorSelector { inner: value.inner })
}
"GuiComboBox" => SAPComponent::GuiComboBox(GuiComboBox { inner: value.inner }),
"ComboBoxControl" => {
SAPComponent::GuiComboBoxControl(GuiComboBoxControl { inner: value.inner })
}
"GuiComboBoxEntry" => {
SAPComponent::GuiComboBoxEntry(GuiComboBoxEntry { inner: value.inner })
}
"GuiComponent" => SAPComponent::GuiComponent(value),
"GuiConnection" => {
SAPComponent::GuiConnection(GuiConnection { inner: value.inner })
}
"GuiContainer" => SAPComponent::GuiContainer(GuiContainer { inner: value.inner }),
"ContainerShell" => {
SAPComponent::GuiContainerShell(GuiContainerShell { inner: value.inner })
}
"GuiCTextField" => {
SAPComponent::GuiCTextField(GuiCTextField { inner: value.inner })
}
"GuiCustomControl" => {
SAPComponent::GuiCustomControl(GuiCustomControl { inner: value.inner })
}
"GuiDialogShell" => {
SAPComponent::GuiDialogShell(GuiDialogShell { inner: value.inner })
}
"EAIViewer2D" => {
SAPComponent::GuiEAIViewer2D(GuiEAIViewer2D { inner: value.inner })
}
"EAIViewer3D" => {
SAPComponent::GuiEAIViewer3D(GuiEAIViewer3D { inner: value.inner })
}
"GuiFrameWindow" => {
SAPComponent::GuiFrameWindow(GuiFrameWindow { inner: value.inner })
}
"GuiGOSShell" => SAPComponent::GuiGOSShell(GuiGOSShell { inner: value.inner }),
"GraphAdapt" => {
SAPComponent::GuiGraphAdapt(GuiGraphAdapt { inner: value.inner })
}
"GridView" => SAPComponent::GuiGridView(GuiGridView { inner: value.inner }),
"HTMLViewer" => {
SAPComponent::GuiHTMLViewer(GuiHTMLViewer { inner: value.inner })
}
"InputFieldControl" => {
SAPComponent::GuiInputFieldControl(GuiInputFieldControl { inner: value.inner })
}
"GuiLabel" => SAPComponent::GuiLabel(GuiLabel { inner: value.inner }),
"GuiMainWindow" => {
SAPComponent::GuiMainWindow(GuiMainWindow { inner: value.inner })
}
"Map" => SAPComponent::GuiMap(GuiMap { inner: value.inner }),
"GuiMenu" => SAPComponent::GuiMenu(GuiMenu { inner: value.inner }),
"GuiMenubar" => SAPComponent::GuiMenubar(GuiMenubar { inner: value.inner }),
"GuiModalWindow" => {
SAPComponent::GuiModalWindow(GuiModalWindow { inner: value.inner })
}
"NetChart" => SAPComponent::GuiNetChart(GuiNetChart { inner: value.inner }),
"OfficeIntegration" => {
SAPComponent::GuiOfficeIntegration(GuiOfficeIntegration { inner: value.inner })
}
"GuiOkCodeField" => {
SAPComponent::GuiOkCodeField(GuiOkCodeField { inner: value.inner })
}
"GuiPasswordField" => {
SAPComponent::GuiPasswordField(GuiPasswordField { inner: value.inner })
}
"Picture" => SAPComponent::GuiPicture(GuiPicture { inner: value.inner }),
"GuiRadioButton" => {
SAPComponent::GuiRadioButton(GuiRadioButton { inner: value.inner })
}
"SapChart" => SAPComponent::GuiSapChart(GuiSapChart { inner: value.inner }),
"GuiScrollbar" => SAPComponent::GuiScrollbar(GuiScrollbar { inner: value.inner }),
"GuiScrollContainer" => {
SAPComponent::GuiScrollContainer(GuiScrollContainer { inner: value.inner })
}
"GuiSession" => SAPComponent::GuiSession(GuiSession { inner: value.inner }),
"GuiShell" => SAPComponent::GuiShell(GuiShell { inner: value.inner }),
"GuiSimpleContainer" => {
SAPComponent::GuiSimpleContainer(GuiSimpleContainer { inner: value.inner })
}
"Split" => SAPComponent::GuiSplit(GuiSplit { inner: value.inner }),
"SplitterContainer" => {
SAPComponent::GuiSplitterContainer(GuiSplitterContainer { inner: value.inner })
}
"Stage" => SAPComponent::GuiStage(GuiStage { inner: value.inner }),
"GuiStatusbar" => SAPComponent::GuiStatusbar(GuiStatusbar { inner: value.inner }),
"GuiStatusPane" => {
SAPComponent::GuiStatusPane(GuiStatusPane { inner: value.inner })
}
"GuiTab" => SAPComponent::GuiTab(GuiTab { inner: value.inner }),
"GuiTableControl" => {
SAPComponent::GuiTableControl(GuiTableControl { inner: value.inner })
}
"GuiTabStrip" => SAPComponent::GuiTabStrip(GuiTabStrip { inner: value.inner }),
"Textedit" => SAPComponent::GuiTextedit(GuiTextedit { inner: value.inner }),
"GuiTextField" => SAPComponent::GuiTextField(GuiTextField { inner: value.inner }),
"GuiTitlebar" => SAPComponent::GuiTitlebar(GuiTitlebar { inner: value.inner }),
"GuiToolbar" => SAPComponent::GuiToolbar(GuiToolbar { inner: value.inner }),
"Tree" => SAPComponent::GuiTree(GuiTree { inner: value.inner }),
"GuiUserArea" => SAPComponent::GuiUserArea(GuiUserArea { inner: value.inner }),
"GuiVComponent" => {
SAPComponent::GuiVComponent(GuiVComponent { inner: value.inner })
}
"GuiVContainer" => {
SAPComponent::GuiVContainer(GuiVContainer { inner: value.inner })
}
"GuiVHViewSwitch" => {
SAPComponent::GuiVHViewSwitch(GuiVHViewSwitch { inner: value.inner })
}
_ => SAPComponent::GuiComponent(value),
}
} else {
SAPComponent::GuiComponent(value)
}
}
}
impl From<VARIANT> for SAPComponent {
fn from(value: VARIANT) -> Self {
let idisp = value.to_idispatch().unwrap();
Self::from(idisp.clone())
}
}
com_shim! {
class GuiApplication: GuiContainer + GuiComponent {
mut AllowSystemMessages: bool,
mut ButtonbarVisible: bool,
Children: GuiComponentCollection,
ConnectionErrorText: String,
Connections: GuiComponentCollection,
mut HistoryEnabled: bool,
MajorVersion: i32,
MinorVersion: i32,
NewVisualDesign: bool,
Patchlevel: i32,
Revision: i32,
mut StatusbarVisible: bool,
mut TitlebarVisible: bool,
mut ToolbarVisible: bool,
Utils: GuiUtils,
fn AddHistoryEntry(String, String) -> bool,
fn CreateGuiCollection() -> GuiCollection,
fn DropHistory() -> bool,
fn Ignore(i16),
fn OpenConnection(String) -> SAPComponent,
fn OpenConnectionByConnectionString(String) -> SAPComponent,
}
}
com_shim! {
class GuiBarChart: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent + GuiShell {
ChartCount: i32,
fn BarCount(i32) -> i32,
fn GetBarContent(i32, i32, i32) -> String,
fn GetGridLineContent(i32, i32, i32) -> String,
fn GridCount(i32) -> i32,
fn LinkCount(i32) -> i32,
fn SendData(String),
}
}
com_shim! {
class GuiBox: GuiVComponent + GuiComponent {
CharHeight: i32,
CharLeft: i32,
CharTop: i32,
CharWidth: i32,
}
}
com_shim! {
class GuiButton: GuiVComponent + GuiComponent {
Emphasized: bool,
LeftLabel: SAPComponent,
RightLabel: SAPComponent,
fn Press(),
}
}
com_shim! {
class GuiCalendar: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent + GuiShell {
endSelection: String,
mut FirstVisibleDate: String,
mut FocusDate: String,
FocusedElement: i32,
horizontal: bool,
mut LastVisibleDate: String,
mut SelectionInterval: String,
startSelection: String,
Today: String,
fn ContextMenu(i32, i32, i32, String, String),
fn CreateDate(i32, i32, i32),
fn GetColor(String) -> i32,
fn GetColorInfo(i32) -> String,
fn GetDateTooltip(String) -> String,
fn GetDay(String) -> i32,
fn GetMonth(String) -> i32,
fn GetWeekday(String) -> String,
fn GetWeekNumber(String) -> i32,
fn GetYear(String) -> i32,
fn IsWeekend(String) -> bool,
fn SelectMonth(i32, i32),
fn SelectRange(String, String),
fn SelectWeek(i32, i32),
}
}
com_shim! {
class GuiChart: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent + GuiShell {
fn ValueChange(i32, i32, String, String, bool, String, String, i32),
}
}
com_shim! {
class GuiCheckBox: GuiVComponent + GuiComponent {
ColorIndex: i32,
ColorIntensified: i32,
ColorInverse: bool,
Flushing: bool,
IsLeftLabel: bool,
IsListElement: bool,
IsRightLabel: bool,
LeftLabel: SAPComponent,
RightLabel: SAPComponent,
RowText: String,
mut Selected: bool,
fn GetListProperty(String) -> String,
fn GetListPropertyNonRec(String) -> String,
}
}
com_shim! {
class GuiCollection {
Count: i32,
Length: i32,
Type: String,
TypeAsNumber: i32,
fn ElementAt(i32) -> SAPComponent,
}
}
com_shim! {
class GuiColorSelector: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent + GuiShell {
fn ChangeSelection(i16),
}
}
com_shim! {
class GuiComboBox: GuiVComponent + GuiComponent {
CharHeight: i32,
CharLeft: i32,
CharTop: i32,
CharWidth: i32,
CurListBoxEntry: SAPComponent,
Entries: GuiCollection,
Flushing: bool,
Highlighted: bool,
IsLeftLabel: bool,
IsListBoxActive: bool,
IsRightLabel: bool,
mut Key: String,
LeftLabel: SAPComponent,
Required: bool,
RightLabel: SAPComponent,
ShowKey: bool,
Text: String,
mut Value: String,
fn SetKeySpace(),
}
}
com_shim! {
class GuiComboBoxControl: GuiVComponent + GuiVContainer + GuiComponent + GuiContainer + GuiShell {
CurListBoxEntry: SAPComponent,
Entries: GuiCollection,
IsListBoxActive: bool,
LabelText: String,
mut Selected: String,
Text: String,
fn FireSelected(),
}
}
com_shim! {
class GuiComboBoxEntry {
Key: String,
Pos: i32,
Value: String,
}
}
com_shim! {
class GuiComponent {
ContainerType: bool,
Id: String,
Name: String,
Type: String,
TypeAsNumber: i32,
}
}
com_shim! {
class GuiComponentCollection {
Count: i32,
Length: i32,
Type: String,
TypeAsNumber: i32,
fn ElementAt(i32) -> SAPComponent,
}
}
com_shim! {
class GuiConnection: GuiContainer + GuiComponent {
Children: GuiComponentCollection,
ConnectionString: String,
Description: String,
DisabledByServer: bool,
Sessions: GuiComponentCollection,
fn CloseConnection(),
fn CloseSession(String),
}
}
com_shim! {
class GuiContainer: GuiComponent {
Children: GuiComponentCollection,
fn FindById(String) -> SAPComponent,
}
}
com_shim! {
class GuiContainerShell: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent + GuiShell {
AccDescription: String,
}
}
com_shim! {
class GuiCTextField: GuiTextField + GuiVComponent + GuiComponent { }
}
com_shim! {
class GuiCustomControl: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent {
CharHeight: i32,
CharLeft: i32,
CharTop: i32,
CharWidth: i32,
}
}
com_shim! {
class GuiDialogShell: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent {
Title: String,
fn Close(),
}
}
com_shim! {
class GuiDockShell: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent {
AccDescription: String,
DockerIsVertical: bool,
mut DockerPixelSize: i32,
}
}
com_shim! {
class GuiEAIViewer2D: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent + GuiShell {
mut AnnoutationEnabled: i32,
mut AnnotationMode: i16,
mut RedliningStream: String,
fn annotationTextRequest(String),
}
}
com_shim! {
class GuiEAIViewer3D: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent + GuiShell { }
}
com_shim! {
class GuiFrameWindow: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent {
mut ElementVisualizationMode: bool,
GuiFocus: SAPComponent,
Handle: i32,
Iconic: bool,
SystemFocus: SAPComponent,
WorkingPaneHeight: i32,
WorkingPaneWidth: i32,
fn Close(),
fn CompBitmap(String, String) -> i32,
fn HardCopy(String, i16) -> String,
fn Iconify(),
fn IsVKeyAllowed(i16) -> bool,
fn JumpBackward(),
fn JumpForward(),
fn Maximize(),
fn Restore(),
fn SendVKey(i16),
fn ShowMessageBox(String, String, i32, i32) -> i32,
fn TabBackward(),
fn TabForward(),
}
}
com_shim! {
class GuiGOSShell: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent { }
}
com_shim! {
class GuiGraphAdapt: GuiVComponent + GuiVContainer + GuiContainer + GuiComponent + GuiShell { }
}
com_shim! {
class GuiGridView: GuiVComponent + GuiVContainer + GuiComponent + GuiContainer + GuiShell {
ColumnCount: i32,
mut CurrentCellColumn: String,
mut CurrentCellRow: i32,
mut FirstVisibleColumn: String,
mut FirstVisibleRow: i32,
FrozenColumnCount: i32,
RowCount: i32,
mut SelectedRows: String,
SelectionMode: String,
Title: String,
ToolbarButtonCount: i32,
VisibleRowCount: i32,
fn ClearSelection(),
fn Click(i32, String),
fn ClickCurrentCell(),
fn ContextMenu(),
fn CurrentCellMoved(),
fn DeleteRows(String),
fn DeselectColumn(String),
fn DoubleClick(i32, String),
fn DoubleClickCurrentCell(),
fn DuplicateRows(String),
fn GetCellChangeable(i32, String) -> bool,
fn GetCellCheckBoxChecked(i32, String) -> bool,
fn GetCellColor(i32, String) -> i32,
fn GetCellHeight(i32, String) -> i32,
fn GetCellHotspotType(i32, String) -> String,
fn GetCellIcon(i32, String) -> String,
fn GetCellLeft(i32, String) -> i32,
fn GetCellListBoxCount(i32, String) -> i32,
fn GetCellListBoxCurIndex(i32, String) -> String,
fn GetCellMaxLength(i32, String) -> i32,
fn GetCellState(i32, String) -> String,
fn GetCellTooltip(i32, String) -> String,
fn GetCellTop(i32, String) -> i32,
fn GetCellType(i32, String) -> String,
fn GetCellValue(i32, String) -> String,
fn GetCellWidth(i32, String) -> i32,
fn GetColorInfo(i32) -> String,
fn GetColumnDataType(String) -> String,
fn GetColumnOperationType(String) -> String,
fn GetColumnPosition(String) -> i32,
fn GetColumnSortType(String) -> String,
fn GetColumnTooltip(String) -> String,
fn GetColumnTotalType(String) -> String,
fn GetDisplayedColumnTitle(String) -> String,
fn GetRowTotalLevel(i32) -> i32,
fn GetSymbolInfo(String) -> String,
fn GetToolbarButtonChecked(i32) -> bool,
fn GetToolbarButtonEnabled(i32) -> bool,
fn GetToolbarButtonIcon(i32) -> String,
fn GetToolbarButtonId(i32) -> String,
fn GetToolbarButtonText(i32) -> String,
fn GetToolbarButtonTooltip(i32) -> String,
fn GetToolbarButtonType(i32) -> String,
fn GetToolbarFocusButton() -> i32,
fn HasCellF4Help(i32, String) -> bool,
fn HistoryCurEntry(i32, String) -> String,
fn HistoryCurIndex(i32, String) -> i32,
fn HistoryIsActive(i32, String) -> bool,
fn HistoryList(i32, String) -> GuiCollection,
fn InsertRows(String),
fn IsCellHotspot(i32, String) -> bool,
fn IsCellSymbol(i32, String) -> bool,
fn IsCellTotalExpander(i32, String) -> bool,
fn IsColumnFiltered(String) -> bool,
fn IsColumnKey(String) -> bool,
fn IsTotalRowExpanded(i32) -> bool,
fn ModifyCell(i32, String, String),
fn ModifyCheckBox(i32, String, bool),
fn MoveRows(i32, i32, i32),
fn PressButton(i32, String),
fn PressButtonCurrentCell(),
fn PressColumnHeader(String),
fn PressEnter(),
fn PressF1(),
fn PressF4(),
fn PressToolbarButton(String),
fn PressToolbarContextButton(String),
fn PressTotalRow(i32, String),
fn PressTotalRowCurrentCell(),
fn SelectAll(),
fn SelectColumn(String),
fn SelectionChanged(),
fn SelectToolbarMenuItem(String),
fn SetColumnWidth(String, i32),
fn SetCurrentCell(i32, String),
fn TriggerModified(),
}
}
com_shim! {
class GuiHTMLViewer: GuiVComponent + GuiVContainer + GuiComponent + GuiContainer + GuiShell {
DocumentComplete: i32,
fn ContextMenu(),
fn GetBrowerControlType() -> i32,
fn SapEvent(String, String, String),
}
}
com_shim! {
class GuiInputFieldControl: GuiVComponent + GuiVContainer + GuiComponent + GuiContainer + GuiShell {
ButtonTooltip: String,
FindButtonActivated: bool,
HistoryCurEntry: String,
HistoryCurIndex: i32,
HistoryIsActive: bool,
HistoryList: GuiCollection,
LabelText: String,
PromptText: String,
fn Submit(),
}
}
com_shim! {
class GuiLabel: GuiVComponent + GuiComponent {
mut CaretPosition: i32,
CharHeight: i32,
CharLeft: i32,
CharTop: i32,
CharWidth: i32,
ColorIndex: i32,
ColorIntensified: bool,
ColorInverse: bool,
DisplayedText: String,
Highlighted: String,
IsHotspot: String,
IsLeftLabel: bool,
IsListElement: bool,
IsRightLabel: bool,
MaxLength: i32,
Numerical: bool,
RowText: String,
fn GetListProperty(String) -> String,
fn GetListPropertyNonRec(String) -> String,
}
}
com_shim! {
class GuiMainWindow: GuiFrameWindow + GuiVComponent + GuiVContainer + GuiContainer + GuiComponent {
mut ButtonbarVisible: bool,
mut StatusbarVisible: bool,
mut TitlebarVisible: bool,
mut ToolbarVisible: bool,
fn ResizeWorkingPane(i32, i32, bool),
fn ResizeWorkingPaneEx(i32, i32, bool),
}
}
com_shim! {
class GuiMap: GuiVComponent + GuiVContainer + GuiComponent + GuiContainer + GuiShell { }
}
com_shim! {
class GuiMenu: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent {
fn Select(),
}
}
com_shim! {
class GuiMenubar: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent { }
}
com_shim! {
class GuiMessageWindow: GuiVComponent + GuiComponent {
FocusedButton: i32,
HelpButtonHelpText: String,
HelpButtonText: String,
MessageText: String,
MessageType: i32,
OKButtonHelpText: String,
OKButtonText: String,
ScreenLeft: i32,
ScreenTop: i32,
Visible: bool,
}
}
com_shim! {
class GuiModalWindow: GuiFrameWindow + GuiVComponent + GuiVContainer + GuiComponent + GuiContainer {
fn IsPopupDialog() -> bool,
fn PopupDialogText() -> String,
}
}
com_shim! {
class GuiNetChart: GuiVComponent + GuiVContainer + GuiComponent + GuiContainer + GuiShell {
LinkCount: i32,
NodeCount: i32,
fn GetLinkContent(i32, i32) -> String,
fn GetNodeContent(i32, i32) -> String,
fn SendData(String),
}
}
com_shim! {
class GuiOfficeIntegration: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent + GuiShell {
HostedApplication: i32,
fn AppendRow(String, String),
fn CloseDocument(i32, bool, bool),
fn RemoveContent(String),
fn SaveDocument(i32, bool),
fn SetDocument(i32, String),
}
}
com_shim! {
class GuiOkCodeField: GuiVComponent + GuiComponent {
Opened: bool,
fn PressF1(),
}
}
com_shim! {
class GuiPasswordField: GuiTextField + GuiVComponent + GuiComponent { }
}
com_shim! {
class GuiPicture: GuiVComponent + GuiVContainer + GuiComponent + GuiContainer + GuiShell {
AltText: String,
DisplayMode: String,
Icon: String,
Url: String,
fn Click(),
fn ClickControlArea(i32, i32),
fn ClickPictureArea(i32, i32),
fn ContextMenu(i32, i32),
fn DoubleClick(),
fn DoubleClickControlArea(i32, i32),
fn DoubleClickPictureArea(i32, i32),
}
}
com_shim! {
class GuiRadioButton: GuiVComponent + GuiComponent {
CharHeight: i32,
CharLeft: i32,
CharTop: i32,
CharWidth: i32,
Flushing: bool,
GroupCount: i32,
GroupMembers: GuiComponentCollection,
GroupPos: i32,
IsLeftLabel: bool,
IsRightLabel: bool,
LeftLabel: SAPComponent,
RightLabel: SAPComponent,
Selected: bool,
fn Select(),
}
}
com_shim! {
class GuiSapChart: GuiVComponent + GuiVContainer + GuiComponent + GuiContainer + GuiShell { }
}
com_shim! {
class GuiScrollbar {
Maximum: i32,
Minimum: i32,
PageSize: i32,
mut Position: i32,
Range: i32,
}
}
com_shim! {
class GuiScrollContainer: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent {
HorizontalScrollbar: SAPComponent,
VerticalScrollbar: SAPComponent,
}
}
com_shim! {
class GuiSession: GuiContainer + GuiComponent {
mut AccEnhancedTabChain: bool,
mut AccSymbolReplacement: bool,
ActiveWindow: SAPComponent,
mut Busy: bool,
Info: GuiSessionInfo,
IsActive: bool,
IsListBoxActive: bool,
ListBoxCurrEntry: i32,
ListBoxCurrEntryHeight: i32,
ListBoxCurrEntryLeft: i32,
ListBoxCurrEntryTop: i32,
ListBoxCurrEntryWidth: i32,
ListBoxHeight: i32,
ListBoxLeft: i32,
ListBoxTop: i32,
ListBoxWidth: i32,
mut PassportPreSystemId: String,
mut PassportSystemId: String,
mut PassportTransactionId: String,
ProgressPercent: i32,
ProgressText: String,
mut Record: bool,
mut RecordFile: String,
mut SaveAsUnicode: bool,
mut ShowDropdownKeys: bool,
mut SuppressBackendPopups: bool,
mut TestToolMode: i32,
fn AsStdNumberFormat(String) -> String,
fn ClearErrorList(),
fn CreateSession(),
fn EnableJawsEvents(),
fn EndTransaction(),
fn FindByPosition(i32, i32) -> SAPComponent,
fn GetIconResourceName(String) -> String,
fn GetObjectTree(String) -> String,
fn GetVKeyDescription(i32) -> String,
fn LockSessionUI(),
fn SendCommand(String),
fn SendCommandAsync(String),
fn StartTransaction(String),
fn UnlockSessionUI(),
}
}
com_shim! {
class GuiSessionInfo {
ApplicationServer: String,
Client: String,
Codepage: i32,
Flushes: i32,
Group: String,
GuiCodepage: i32,
I18NMode: bool,
InterpretationTime: i32,
IsLowSpeedConnection: bool,
Language: String,
MessageServer: String,
Program: String,
ResponseTime: i32,
RoundTrips: i32,
ScreenNumber: i32,
ScriptingModeReadOnly: bool,
ScriptingModeRecordingDisabled: bool,
SessionNumber: i32,
SystemName: String,
SystemNumber: i32,
SystemSessionId: String,
Transaction: String,
UI_GUIDELINE: String,
User: String,
}
}
com_shim! {
class GuiShell: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent {
AccDescription: String,
DragDropSupported: bool,
Handle: i32,
OcxEvents: GuiCollection,
SubType: String,
fn SelectContextMenuItem(String),
fn SelectContextMenuItemByPosition(String),
fn SelectContextMenuItemByText(String),
}
}
com_shim! {
class GuiSimpleContainer: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent {
IsListElement: bool,
IsStepLoop: bool,
IsStepLoopInTableStructure: bool,
LoopColCount: i32,
LoopCurrentCol: i32,
LoopCurrentColCount: i32,
LoopCurrentRow: i32,
LoopRowCount: i32,
fn GetListProperty(String) -> String,
fn GetListPropertyNonRec(String) -> String,
}
}
com_shim! {
class GuiSplit: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent + GuiShell {
IsVertical: i32,
fn GetColSize(i32) -> i32,
fn GetRowSize(i32) -> i32,
fn SetColSize(i32, i32),
fn SetRowSize(i32, i32),
}
}
com_shim! {
class GuiSplitterContainer: GuiVContainer + GuiVComponent + GuiComponent + GuiContainer + GuiShell {
IsVertical: bool,
mut SashPosition: i32,
}
}
com_shim! {
class GuiStage: GuiVComponent + GuiVContainer + GuiContainer + GuiShell + GuiComponent {
fn ContextMenu(String),
fn DoubleClick(String),
fn SelectItems(String),
}
}
com_shim! {
class GuiStatusbar: GuiVComponent + GuiVContainer + GuiComponent + GuiContainer {
Handle: i32,
MessageAsPopup: bool,
MessageHasLongText: i32,
MessageId: String,
MessageNumber: String,
MessageParameter: String,
MessageType: String,
fn CreateSupportMessageClick(),
fn DoubleClick(),
fn ServiceRequestClick(),
}
}
com_shim! {
class GuiStatusBarLink: GuiVComponent + GuiComponent {
fn Press(),
}
}
com_shim! {
class GuiStatusPane: GuiVComponent + GuiComponent {
Children: GuiComponentCollection,
}
}
com_shim! {
class GuiTab: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent {
fn ScrollToLeft(),
fn Select(),
}
}
com_shim! {
class GuiTableColumn: GuiComponentCollection {
DefaultTooltip: String,
Fixed: bool,
IconName: String,
Selected: bool,
Title: String,
Tooltip: String,
}
}
com_shim! {
class GuiTableControl: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent {
CharHeight: i32,
CharLeft: i32,
CharTop: i32,
CharWidth: i32,
Columns: GuiCollection,
CurrentCol: i32,
CurrentRow: i32,
HorizontalScrollbar: SAPComponent,
RowCount: i32,
Rows: GuiCollection,
TableFieldName: String,
VerticalScrollbar: SAPComponent,
VisibleRowCount: i32,
fn ConfigureLayout(),
fn DeselectAllColumns(),
fn GetAbsoluteRow(i32) -> GuiTableRow,
fn GetCell(i32, i32) -> SAPComponent,
fn ReorderTable(String),
fn SelectAllColumns(),
}
}
com_shim! {
class GuiTableRow: GuiComponentCollection {
Selectable: bool,
mut Selected: bool,
}
}
com_shim! {
class GuiTabStrip: GuiVContainer + GuiVComponent + GuiContainer + GuiComponent {
CharHeight: i32,
CharLeft: i32,
CharTop: i32,
CharWidth: i32,
LeftTab: SAPComponent,
SelectedTab: SAPComponent,
}
}
com_shim! {
class GuiTextedit: GuiShell + GuiVComponent + GuiVContainer + GuiContainer + GuiComponent {
CurrentColumn: i32,
CurrentLine: i32,
mut FirstVisibleLine: i32,
LastVisibleLine: i32,
LineCount: i32,
NumberOfUnprotectedTextParts: i32,
SelectedText: String,
SelectionEndColumn: i32,
SelectionEndLine: i32,
SelectionIndexEnd: i32,
SelectionIndexStart: i32,
SelectionStartColumn: i32,
SelectionStartLine: i32,
fn ContextMenu(),
fn DoubleClick(),
fn GetLineText(i32) -> String,
fn GetUnprotectedTextPart(i32) -> String,
fn IsBreakpointLine(i32) -> bool,
fn IsCommentLine(i32) -> bool,
fn IsHighlightedLine(i32) -> bool,
fn IsProtectedLine(i32) -> bool,
fn IsSelectedLine(i32) -> bool,
fn ModifiedStatusChanged(bool),
fn MultipleFilesDropped(),
fn PressF1(),
fn PressF4(),
fn SetSelectionIndexes(i32, i32),
fn SetUnprotectedTextPart(i32, String) -> bool,
fn SingleFileDropped(String),
}
}
com_shim! {
class GuiTextField: GuiVComponent + GuiComponent {
mut CaretPosition: i32,
DisplayedText: String,
Highlighted: bool,
HistoryCurEntry: String,
HistoryCurIndex: i32,
HistoryIsActive: bool,
HistoryList: GuiCollection,
IsHotspot: bool,
IsLeftLabel: bool,
IsListElement: bool,
IsOField: bool,
IsRightLabel: bool,
LeftLabel: SAPComponent,
MaxLength: i32,
Numerical: bool,
Required: bool,
RightLabel: SAPComponent,
fn GetListProperty(String) -> String,
fn GetListPropertyNonRec(String) -> String,
}
}
com_shim! {
class GuiTitlebar: GuiVComponent + GuiVContainer + GuiContainer + GuiComponent { }
}
com_shim! {
class GuiToolbar: GuiVComponent + GuiVContainer + GuiContainer + GuiComponent { }
}
com_shim! {
class GuiToolbarControl: GuiShell + GuiVComponent + GuiVContainer + GuiComponent + GuiContainer {
ButtonCount: i32,
FocusedButton: i32,
fn GetButtonChecked(i32) -> bool,
fn GetButtonEnabled(i32) -> bool,
fn GetButtonIcon(i32) -> String,
fn GetButtonId(i32) -> String,
fn GetButtonText(i32) -> String,
fn GetButtonTooltip(i32) -> String,
fn GetButtonType(i32) -> String,
fn GetMenuItemIdFromPosition(i32) -> String,
fn PressButton(String),
fn PressContextButton(String),
fn SelectMenuItem(String),
fn SelectMenuItemByText(String),
}
}
com_shim! {
class GuiTree: GuiShell + GuiVContainer + GuiVComponent + GuiComponent + GuiContainer {
HierarchyHeaderWidth: i32,
SelectedNode: String,
TopNode: String,
fn ChangeCheckbox(String, String, bool),
fn ClickLink(String, String),
fn CollapseNode(String),
fn DefaultContextMenu(),
fn DoubleClickItem(String, String),
fn DoubleClickNode(String),
fn EnsureVisibleHorizontalItem(String, String),
fn ExpandNode(String),
fn FindNodeKeyByPath(String) -> String,
fn GetAbapImage(String, String) -> String,
fn GetCheckBoxState(String, String) -> bool,
fn GetColumnIndexFromName(String) -> i32,
fn GetColumnTitleFromName(String) -> String,
fn GetFocusedNodeKey() -> String,
fn GetHierarchyLevel(String) -> i32,
fn GetHierarchyTitle() -> String,
fn GetIsDisabled(String, String) -> bool,
fn GetIsEditable(String, String) -> bool,
fn GetIsHighLighted(String, String) -> bool,
fn GetItemHeight(String, String) -> i32,
fn GetItemLeft(String, String) -> i32,
fn GetItemStyle(String, String) -> i32,
fn GetItemText(String, String) -> String,
fn GetItemTextColor(String, String) -> u64,
fn GetItemToolTip(String, String) -> String,
fn GetItemTop(String, String) -> i32,
fn GetItemType(String, String) -> i32,
fn GetItemWidth(String, String) -> i32,
fn GetListTreeNodeItemCount(String) -> i32,
fn GetNextNodeKey(String) -> String,
fn GetNodeAbapImage(String) -> String,
fn GetNodeChildrenCount(String) -> i32,
fn GetNodeChildrenCountByPath(String) -> i32,
fn GetNodeHeight(String) -> i32,
fn GetNodeIndex(String) -> i32,
fn GetNodeKeyByPath(String) -> String,
fn GetNodeLeft(String) -> i32,
fn GetNodePathByKey(String) -> String,
fn GetNodeStyle(String) -> i32,
fn GetNodeTextByKey(String) -> String,
fn GetNodeTextByPath(String) -> String,
fn GetNodeTextColor(String) -> u64,
fn GetNodeToolTip(String) -> String,
fn GetNodeTop(String) -> i32,
fn GetNodeWidth(String) -> i32,
fn GetParent(String) -> String,
fn GetPreviousNodeKey(String) -> String,
fn GetSelectionMode() -> i16,
fn GetStyleDescription(i32) -> String,
fn GetTreeType() -> i32,
fn HeaderContextMenu(String),
fn IsFolder(String) -> bool,
fn IsFolderExpandable(String) -> bool,
fn IsFolderExpanded(String) -> bool,
fn ItemContextMenu(String, String),
fn NodeContextMenu(String),
fn PressButton(String, String),
fn PressHeader(String),
fn PressKey(String),
fn SelectColumn(String),
fn SelectedItemColumn() -> String,
fn SelectedItemNode() -> String,
fn SelectItem(String, String),
fn SelectNode(String),
fn SetCheckBoxState(String, String, i32),
fn SetColumnWidth(String, i32),
fn UnselectAll(),
fn UnselectColumn(String),
fn UnselectNode(String),
}
}
com_shim! {
class GuiUserArea: GuiVContainer + GuiVComponent + GuiComponent + GuiContainer {
HorizontalScrollbar: SAPComponent,
IsOTFPreview: bool,
VerticalScrollbar: SAPComponent,
fn FindByLabel(String, String) -> SAPComponent,
fn ListNavigate(String),
}
}
com_shim! {
class GuiUtils {
MESSAGE_OPTION_OK: i32,
MESSAGE_OPTION_OKCANCEL: i32,
MESSAGE_OPTION_YESNO: i32,
MESSAGE_RESULT_CANCEL: i32,
MESSAGE_RESULT_NO: i32,
MESSAGE_RESULT_OK: i32,
MESSAGE_RESULT_YES: i32,
MESSAGE_TYPE_ERROR: i32,
MESSAGE_TYPE_INFORMATION: i32,
MESSAGE_TYPE_PLAIN: i32,
MESSAGE_TYPE_QUESTION: i32,
MESSAGE_TYPE_WARNING: i32,
fn CloseFile(i32),
fn OpenFile(String) -> i32,
fn ShowMessageBox(String, String, i32, i32) -> i32,
fn Write(i32, String),
fn WriteLine(i32, String),
}
}
com_shim! {
class GuiVComponent: GuiComponent {
AccLabelCollection: GuiComponentCollection,
AccText: String,
AccTextOnRequest: String,
AccTooltip: String,
Changeable: bool,
DefaultTooltip: String,
Height: i32,
IconName: String,
IsSymbolFont: bool,
Left: i32,
Modified: bool,
ParentFrame: SAPComponent,
ScreenLeft: i32,
ScreenTop: i32,
mut Text: String,
Tooltip: String,
Top: i32,
Width: i32,
fn DumpState(String) -> GuiCollection,
fn SetFocus(),
fn Visualize(bool) -> bool,
}
}
com_shim! {
class GuiVContainer: GuiVComponent + GuiComponent + GuiContainer {
fn FindAllByName(String, String) -> GuiComponentCollection,
fn FindAllByNameEx(String, i32) -> GuiComponentCollection,
fn FindByName(String, String) -> SAPComponent,
fn FindByNameEx(String, String) -> SAPComponent,
}
}
com_shim! {
class GuiVHViewSwitch: GuiVComponent + GuiComponent {}
}