Adding WpfBridge for automation of WPF and Silverlight
WpfBridge allows java to access .net 4 UI Automation libraries. This library enables Synthuse to access and automation WPF and Silverlight apps.
This commit is contained in:
39
native/WpfBridge/WpfAutomation.h
Normal file
39
native/WpfBridge/WpfAutomation.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright 2014, Synthuse.org
|
||||
* Released under the Apache Version 2.0 License.
|
||||
*
|
||||
* last modified by ejakubowski7@gmail.com
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
public ref class WpfAutomation
|
||||
{
|
||||
public:
|
||||
WpfAutomation(void);
|
||||
void setFrameworkId(System::String ^propertyValue); //default is WPF, but also accepts Silverlight, Win32
|
||||
|
||||
//Descendants will walk the full tree of windows, NOT just one level of children
|
||||
System::Int32 countDescendantWindows();
|
||||
System::Int32 countDescendantWindows(System::String ^runtimeIdValue);
|
||||
|
||||
System::Int32 countChildrenWindows();
|
||||
System::Int32 countChildrenWindows(System::String ^runtimeIdValue);
|
||||
|
||||
array<System::String ^> ^ enumChildrenWindowIds(System::String ^runtimeIdValue); //if runtimeIdValue is null will start at desktop
|
||||
array<System::String ^> ^ enumDescendantWindowIds(System::String ^runtimeIdValue); //if runtimeIdValue is null will start at desktop
|
||||
array<System::String ^> ^ enumDescendantWindowIds(System::Int32 processId);
|
||||
array<System::String ^> ^ EnumDescendantWindowIdsFromHandle(System::IntPtr windowHandle);
|
||||
//In all the above Enumerate methods will return a list of Runtime Ids for all related windows.
|
||||
|
||||
System::String ^getProperty(System::String ^propertyName, System::String ^runtimeIdValue);
|
||||
array<System::String ^> ^ getProperties(System::String ^runtimeIdValue);
|
||||
array<System::String ^> ^ getPropertiesAndValues(System::String ^runtimeIdValue);
|
||||
private:
|
||||
array<System::Int32> ^ convertRuntimeIdString(System::String ^runtimeIdValue);
|
||||
System::Windows::Automation::AutomationElement ^ findAutomationElementById(System::String ^runtimeIdValue);
|
||||
array<System::String ^> ^ getRuntimeIdsFromCollection(System::Windows::Automation::AutomationElementCollection ^collection);
|
||||
|
||||
static System::String ^DEFAULT_FRAMEWORK = L"WPF";
|
||||
System::String ^frameworkId;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user