org.eclipse.actf.accservice.core.win32.msaa
Class MsaaAccessibilityEventService

java.lang.Object
  extended by org.eclipse.actf.accservice.core.win32.msaa.MsaaAccessibilityEventService
All Implemented Interfaces:
IAccessibilityEventService
Direct Known Subclasses:
IA2AccessibilityEventService

public class MsaaAccessibilityEventService
extends Object
implements IAccessibilityEventService


Field Summary
protected static int _flag
           
protected  Map _hookMap
           
protected static Map _listenerMap
           
protected  IWindowService _windowService
           
 int dwMemFileSize
           
static int EVENT_OBJECT_ACCELERATORCHANGE
           
static int EVENT_OBJECT_CREATE
           
static int EVENT_OBJECT_DEFACTIONCHANGE
           
static int EVENT_OBJECT_DESCRIPTIONCHANGE
           
static int EVENT_OBJECT_DESTROY
           
static int EVENT_OBJECT_FOCUS
           
static int EVENT_OBJECT_HELPCHANGE
           
static int EVENT_OBJECT_HIDE
           
static int EVENT_OBJECT_LOCATIONCHANGE
           
static int EVENT_OBJECT_NAMECHANGE
           
static int EVENT_OBJECT_PARENTCHANGE
           
static int EVENT_OBJECT_REORDER
           
static int EVENT_OBJECT_SELECTION
           
static int EVENT_OBJECT_SELECTIONADD
           
static int EVENT_OBJECT_SELECTIONREMOVE
           
static int EVENT_OBJECT_SELECTIONWITHIN
           
static int EVENT_OBJECT_SHOW
           
static int EVENT_OBJECT_STATECHANGE
           
static int EVENT_OBJECT_VALUECHANGE
           
static int EVENT_SYSTEM_MENUEND
           
static int EVENT_SYSTEM_MENUPOPUPEND
           
static int EVENT_SYSTEM_MENUPOPUPSTART
           
static int EVENT_SYSTEM_MENUSTART
           
static int FILE_MAP_COPY
           
static int FILE_MAP_READ
           
static int FILE_MAP_WRITE
           
static String fileMappingObjName
           
protected static long initClockTicks
           
protected static boolean isMapFileOpen
           
protected static int mapFilePtr
           
static int PAGE_READONLY
           
static int PAGE_READWRITE
           
static int PAGE_WRITECOPY
           
protected static long timeDiff
           
static int WINEVENT_INCONTEXT
           
static int WINEVENT_OUTOFCONTEXT
           
static int WINEVENT_SKIPOWNPROCESS
           
static int WINEVENT_SKIPOWNTHREAD
           
 
Constructor Summary
MsaaAccessibilityEventService(IWindowService windowService)
           
 
Method Summary
 void addAccessibilityEventListener(IModelEventListener listener, Object[] eventTypes)
          add the listener to be notified when events of the given type are fired from the underlying system
static boolean closeHandle(int hObject)
           
protected static int createAccessibleObjectFromEvent(int hwnd, int idObject, int idChild)
           
static int createFileMapping(int lProtect, int dwMaximumSizeHigh, int dwMaximumSizeLow, String name)
           
static String eventName(int event)
           
protected static void fireAccessibilityModelEvent(AccessibilityModelEvent accEvent, int eventId)
           
static long getClockTicks()
           
static int getWinEventFlag()
           
 boolean initThread()
           
protected static long internalGetClockTicks()
           
protected  boolean internalRemoveWinEventHook(int hook)
           
protected  int internalSetWinEventHook(int eventMin, int eventMax, int idThread, int idProcess, int dwFlags)
           
static int mapViewOfFile(int hFileMappingObj, int dwDesiredAccess, int dwFileOffsetHigh, int dwFileOffsetLow, int dwNumberOfBytesToMap)
           
static int openFileMapping(int dwDesiredAccess, boolean bInheritHandle, String name)
           
static String[] readFromMem(int lpBaseAddress)
           
 void removeAccessibilityEventListener(IModelEventListener listener, Object[] eventTypes)
          remove a previously added listener
protected  boolean removeWinEventHook(int hook)
          remove a previously registered winEventHook
protected static void setTimeDiff()
           
static void setWinEventFlag(int evFlag)
           
protected  int setWinEventHook(int eventMin, int eventMax, int idProcess, int idThread)
          MSAA SetWinEventHook function wrapper
static boolean unmapViewOfFile(int lpBaseAddress)
           
protected static void winEventCallback(int eventId, int hwnd, int idObject, int idChild, long time)
          callback from the native Windows system for out-of-process Msaa events.
protected  void winEventIPCallback()
          callback from the native Windows system for in-process Msaa events.
static void writeToMem(int lpBaseAddress, int content)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EVENT_SYSTEM_MENUSTART

public static final int EVENT_SYSTEM_MENUSTART
See Also:
Constant Field Values

EVENT_SYSTEM_MENUEND

public static final int EVENT_SYSTEM_MENUEND
See Also:
Constant Field Values

EVENT_SYSTEM_MENUPOPUPSTART

public static final int EVENT_SYSTEM_MENUPOPUPSTART
See Also:
Constant Field Values

EVENT_SYSTEM_MENUPOPUPEND

public static final int EVENT_SYSTEM_MENUPOPUPEND
See Also:
Constant Field Values

EVENT_OBJECT_CREATE

public static final int EVENT_OBJECT_CREATE
See Also:
Constant Field Values

EVENT_OBJECT_DESTROY

public static final int EVENT_OBJECT_DESTROY
See Also:
Constant Field Values

EVENT_OBJECT_SHOW

public static final int EVENT_OBJECT_SHOW
See Also:
Constant Field Values

EVENT_OBJECT_HIDE

public static final int EVENT_OBJECT_HIDE
See Also:
Constant Field Values

EVENT_OBJECT_REORDER

public static final int EVENT_OBJECT_REORDER
See Also:
Constant Field Values

EVENT_OBJECT_FOCUS

public static final int EVENT_OBJECT_FOCUS
See Also:
Constant Field Values

EVENT_OBJECT_SELECTION

public static final int EVENT_OBJECT_SELECTION
See Also:
Constant Field Values

EVENT_OBJECT_SELECTIONADD

public static final int EVENT_OBJECT_SELECTIONADD
See Also:
Constant Field Values

EVENT_OBJECT_SELECTIONREMOVE

public static final int EVENT_OBJECT_SELECTIONREMOVE
See Also:
Constant Field Values

EVENT_OBJECT_SELECTIONWITHIN

public static final int EVENT_OBJECT_SELECTIONWITHIN
See Also:
Constant Field Values

EVENT_OBJECT_STATECHANGE

public static final int EVENT_OBJECT_STATECHANGE
See Also:
Constant Field Values

EVENT_OBJECT_LOCATIONCHANGE

public static final int EVENT_OBJECT_LOCATIONCHANGE
See Also:
Constant Field Values

EVENT_OBJECT_NAMECHANGE

public static final int EVENT_OBJECT_NAMECHANGE
See Also:
Constant Field Values

EVENT_OBJECT_DESCRIPTIONCHANGE

public static final int EVENT_OBJECT_DESCRIPTIONCHANGE
See Also:
Constant Field Values

EVENT_OBJECT_VALUECHANGE

public static final int EVENT_OBJECT_VALUECHANGE
See Also:
Constant Field Values

EVENT_OBJECT_PARENTCHANGE

public static final int EVENT_OBJECT_PARENTCHANGE
See Also:
Constant Field Values

EVENT_OBJECT_HELPCHANGE

public static final int EVENT_OBJECT_HELPCHANGE
See Also:
Constant Field Values

EVENT_OBJECT_DEFACTIONCHANGE

public static final int EVENT_OBJECT_DEFACTIONCHANGE
See Also:
Constant Field Values

EVENT_OBJECT_ACCELERATORCHANGE

public static final int EVENT_OBJECT_ACCELERATORCHANGE
See Also:
Constant Field Values

WINEVENT_OUTOFCONTEXT

public static final int WINEVENT_OUTOFCONTEXT
See Also:
Constant Field Values

WINEVENT_SKIPOWNTHREAD

public static final int WINEVENT_SKIPOWNTHREAD
See Also:
Constant Field Values

WINEVENT_SKIPOWNPROCESS

public static final int WINEVENT_SKIPOWNPROCESS
See Also:
Constant Field Values

WINEVENT_INCONTEXT

public static final int WINEVENT_INCONTEXT
See Also:
Constant Field Values

_listenerMap

protected static Map _listenerMap

_hookMap

protected Map _hookMap

_windowService

protected IWindowService _windowService

_flag

protected static int _flag

timeDiff

protected static long timeDiff

initClockTicks

protected static long initClockTicks

fileMappingObjName

public static final String fileMappingObjName
See Also:
Constant Field Values

PAGE_READONLY

public static final int PAGE_READONLY
See Also:
Constant Field Values

PAGE_READWRITE

public static final int PAGE_READWRITE
See Also:
Constant Field Values

PAGE_WRITECOPY

public static final int PAGE_WRITECOPY
See Also:
Constant Field Values

FILE_MAP_COPY

public static final int FILE_MAP_COPY
See Also:
Constant Field Values

FILE_MAP_WRITE

public static final int FILE_MAP_WRITE
See Also:
Constant Field Values

FILE_MAP_READ

public static final int FILE_MAP_READ
See Also:
Constant Field Values

mapFilePtr

protected static int mapFilePtr

dwMemFileSize

public final int dwMemFileSize
See Also:
Constant Field Values

isMapFileOpen

protected static boolean isMapFileOpen
Constructor Detail

MsaaAccessibilityEventService

public MsaaAccessibilityEventService(IWindowService windowService)
Method Detail

createFileMapping

public static int createFileMapping(int lProtect,
                                    int dwMaximumSizeHigh,
                                    int dwMaximumSizeLow,
                                    String name)

openFileMapping

public static int openFileMapping(int dwDesiredAccess,
                                  boolean bInheritHandle,
                                  String name)

mapViewOfFile

public static int mapViewOfFile(int hFileMappingObj,
                                int dwDesiredAccess,
                                int dwFileOffsetHigh,
                                int dwFileOffsetLow,
                                int dwNumberOfBytesToMap)

unmapViewOfFile

public static boolean unmapViewOfFile(int lpBaseAddress)

writeToMem

public static void writeToMem(int lpBaseAddress,
                              int content)

readFromMem

public static String[] readFromMem(int lpBaseAddress)

closeHandle

public static boolean closeHandle(int hObject)

initThread

public boolean initThread()

getWinEventFlag

public static int getWinEventFlag()

setWinEventFlag

public static void setWinEventFlag(int evFlag)

getClockTicks

public static long getClockTicks()

internalGetClockTicks

protected static long internalGetClockTicks()

setWinEventHook

protected int setWinEventHook(int eventMin,
                              int eventMax,
                              int idProcess,
                              int idThread)
MSAA SetWinEventHook function wrapper

Parameters:
eventMin - - minimum event type for hook (use one of the pre-defined constants in this class)
eventMax - - maximum event value for hook (use one of the pre-defined constants in this class)
idProcess - - usually to be obtained from getProcessId(int)
idThread - - use id of desired thread or 0 for all threads
Returns:
hook reference to be used with unregisterWinEventHook or -1 if set was not successful
See Also:
removeWinEventHook(int)

internalSetWinEventHook

protected int internalSetWinEventHook(int eventMin,
                                      int eventMax,
                                      int idThread,
                                      int idProcess,
                                      int dwFlags)

removeWinEventHook

protected boolean removeWinEventHook(int hook)
remove a previously registered winEventHook

Parameters:
hook - - hook reference obtained from setWinEventHook
Returns:
true if hook successfully removed, false otherwise
See Also:
setWinEventHook(int, int, int, int)

internalRemoveWinEventHook

protected boolean internalRemoveWinEventHook(int hook)

winEventCallback

protected static void winEventCallback(int eventId,
                                       int hwnd,
                                       int idObject,
                                       int idChild,
                                       long time)
callback from the native Windows system for out-of-process Msaa events. The parameters are:

The appropriate listeners for the given event id are notified and the AccesibilityModelEvent is created from the formed MsaaAccessible

Parameters:
eventId -
hwnd -
idObject -
idChild -
time -

createAccessibleObjectFromEvent

protected static int createAccessibleObjectFromEvent(int hwnd,
                                                     int idObject,
                                                     int idChild)

winEventIPCallback

protected void winEventIPCallback()
callback from the native Windows system for in-process Msaa events. The event information is read from a memory map file as a string array.

The appropriate listeners for the given event id are notified and the AccesibilityModelEvent is created. Here, the source of the AccesibilityModelEvent is a string array containing information about the accessible that fired the event


fireAccessibilityModelEvent

protected static void fireAccessibilityModelEvent(AccessibilityModelEvent accEvent,
                                                  int eventId)

addAccessibilityEventListener

public void addAccessibilityEventListener(IModelEventListener listener,
                                          Object[] eventTypes)
add the listener to be notified when events of the given type are fired from the underlying system

Specified by:
addAccessibilityEventListener in interface IAccessibilityEventService
Parameters:
listener -
eventTypes - to be chosen from constants in this class
See Also:
org.eclipse.actf.accservice.core.win32.msaa.MsaaGuiModel#registerModelEventListener(IModelEventListener, Object[])

setTimeDiff

protected static void setTimeDiff()

removeAccessibilityEventListener

public void removeAccessibilityEventListener(IModelEventListener listener,
                                             Object[] eventTypes)
remove a previously added listener

Specified by:
removeAccessibilityEventListener in interface IAccessibilityEventService
See Also:
#addAccessibilityListener(AccessibilityEventListener, Object)

eventName

public static String eventName(int event)