openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stev...@apache.org
Subject svn commit: r1420522 [9/12] - in /openoffice/branches/ia2/main/winaccessibility: ./ inc/ prj/ source/ source/UAccCOM/ source/UAccCOMIDL/ source/service/
Date Wed, 12 Dec 2012 04:41:33 GMT
Added: openoffice/branches/ia2/main/winaccessibility/source/UAccCOMIDL/UAccCOM.idl
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/winaccessibility/source/UAccCOMIDL/UAccCOM.idl?rev=1420522&view=auto
==============================================================================
--- openoffice/branches/ia2/main/winaccessibility/source/UAccCOMIDL/UAccCOM.idl (added)
+++ openoffice/branches/ia2/main/winaccessibility/source/UAccCOMIDL/UAccCOM.idl Wed Dec 12 04:41:12 2012
@@ -0,0 +1,225 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright IBM Corporation 2010.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+import "oaidl.idl";
+import "ocidl.idl";
+import "Accessible2.idl";
+import "defines.idl";
+import "AccessibleComponent.idl";
+import "AccessibleAction.idl";
+import "AccessibleRelation.idl";
+import "AccessibleTable.idl";
+import "AccessibleText.idl";
+import "AccessibleHyperlink.idl";
+import "AccessibleEditableText.idl";
+import "AccessibleValue.idl";
+import "AccessibleImage.idl";
+import "AccessibleValue.idl";
+import "AccessibleHypertext.idl";
+
+	[
+		object,
+		uuid(D00F5EB7-588A-487F-A6F6-0B5D7D1815AA),
+		dual,
+		helpstring("IMAccessible Interface"),
+		pointer_default(unique)
+	]
+	interface IMAccessible : IAccessible2
+	{
+		[id(1), helpstring("method Put_XAccName")] HRESULT Put_XAccName(const OLECHAR* pszName);
+		[id(2), helpstring("method Put_XAccRole")] HRESULT Put_XAccRole(unsigned short pRole);
+		[id(3), helpstring("method DecreaseState")] HRESULT DecreaseState(DWORD pXSate);
+		[id(4), helpstring("method IncreaseState")] HRESULT IncreaseState(DWORD pXSate);
+		[id(5), helpstring("method Put_XDescription")] HRESULT Put_XAccDescription(const OLECHAR* pszDescription);
+		[id(6), helpstring("method Put_XAccValue")] HRESULT Put_XAccValue(const OLECHAR* pszAccValue);
+		[id(7), helpstring("method SetState")] HRESULT SetState(DWORD pXSate);
+		[id(8), helpstring("method Put_XAccLocation")] HRESULT Put_XAccLocation(const Location sLocation);
+		[id(9), helpstring("method Put_XAccFocus")] HRESULT Put_XAccFocus(long dChildID);
+		[id(10), helpstring("method Put_XAccParent")] HRESULT Put_XAccParent(IMAccessible* pIParent);	
+		[id(13), helpstring("method Put_XAccWindowHandle")] HRESULT Put_XAccWindowHandle(HWND hwnd);
+		[id(14), helpstring("method Put_XAccChildID")] HRESULT Put_XAccChildID(long dChildID);
+		[id(19), helpstring("method SetXAccessible")] HRESULT SetXAccessible( long XAccessible);
+		[id(20), helpstring("method GetUNOInterface")] HRESULT GetUNOInterface(long* UNOInterface);
+		[id(23), helpstring("method SetDefaultAction")] HRESULT SetDefaultAction(long pAction);
+		[id(24), helpstring("method Put_ActionDescription")] HRESULT Put_ActionDescription( const OLECHAR* szAction);
+		[id(25), helpstring("method Put_XAccAgent")] HRESULT Put_XAccAgent(long pAgent);
+		[id(26), helpstring("method NotifyDestroy")] HRESULT NotifyDestroy(BOOL isDestroy);
+		[id(30), helpstring("method Get_XAccChildID")] HRESULT Get_XAccChildID([out,retval] long* childID);
+	};
+	[
+		object,
+		uuid(951299EE-1841-4249-9E07-812C0739E489),
+		dual,
+		helpstring("IEnumVariant Interface"),
+		pointer_default(unique)
+	]
+	interface IEnumVariant : IEnumVARIANT
+	{
+		[id(1), helpstring("method ClearEnumeration")] HRESULT ClearEnumeration();
+		[id(2), helpstring("method PutSelection")] HRESULT PutSelection(long pXSeletion);	
+	};
+	[
+		object,
+		uuid(6641185C-E099-4C45-B753-3FBC0EE40646),
+		dual,
+		helpstring("IUNOXWrapper Interface"),
+		pointer_default(unique)
+	]
+	interface IUNOXWrapper : IUnknown
+	{
+		[id(1), helpstring("method put_XInterface")] HRESULT put_XInterface(long pXInterface);
+		[id(2), helpstring("method put_XSubInterface")] HRESULT put_XSubInterface(long pXSubInterface);
+		[id(3), helpstring("method get_XInterface")] HRESULT get_XInterface([out,retval]long* pXInterface);
+		[id(4), helpstring("method get_XSubInterface")] HRESULT get_XSubInterface([out,retval]long* pXSubInterface);
+	};
+
+[
+	uuid(19ECB1B0-9376-4FF9-B580-223FC9C200B8),
+	version(1.0),
+	helpstring("UAccCOM 1.0 Type Library")
+]
+library UACCCOMLib
+{
+	importlib("stdole32.tlb");
+	importlib("stdole2.tlb");
+
+	[
+		uuid(CF8DF8BA-44FE-4B10-BD2E-8C8CB322485F),
+		helpstring("MAccessible Class")
+	]
+	coclass MAccessible
+	{
+		[default] interface IMAccessible;
+	};
+	[
+		uuid(152884E0-268B-4481-9AE7-1B372D3AA97F),
+		helpstring("EnumVariant Class")
+	]
+	coclass EnumVariant
+	{
+		[default] interface IEnumVariant;
+	};
+	[
+		uuid(AA360FB0-BC98-41C1-A885-BB921F5ED601),
+		helpstring("UNOXWrapper Class")
+	]
+	coclass UNOXWrapper
+	{
+		[default] interface IUNOXWrapper;
+	};
+	
+	[
+		uuid(9FD9BA47-70AF-4160-99F1-526F2B9F111B),
+		helpstring("AccComponent Class")
+	]
+	coclass AccComponent
+	{
+		[default] interface IAccessibleComponent;
+	};
+
+    [
+		uuid(8745CF0C-3104-4BAE-B7D0-D7B1717C006E),
+		helpstring("AccRelation Class")
+	]
+	coclass AccRelation
+	{
+		[default] interface IAccessibleRelation;
+	};
+	[
+		uuid(AA49F20E-BB4E-400D-A5B0-6F5B7B770227),
+		helpstring("AccAction Class")
+	]
+	coclass AccAction
+	{
+		[default] interface IAccessibleAction;
+	};
+
+	[
+		uuid(6D8AB08B-CCE9-471E-8A41-35773D5263F5),
+		helpstring("AccText Class")
+	]
+	coclass AccText
+	{
+		[default] interface IAccessibleText;
+	};
+	
+	[
+		uuid(79CE1450-1F61-48E2-BF76-C07BD10105E2),
+		helpstring("AccEditableText Class")
+	]
+	coclass AccEditableText
+	{
+		[default] interface IAccessibleEditableText;
+	};	
+
+	[
+		uuid(CC55D71B-1828-4EE0-89E2-C3749CF9C9AB),
+		helpstring("AccHypertext Class")
+	]
+	coclass AccHypertext
+	{
+		[default] interface IAccessibletext;
+	};
+
+	
+	[
+		uuid(73A45800-7A62-432C-A1A6-BF8852994331),
+		helpstring("AccImage Class")
+	]
+	coclass AccImage
+	{
+		[default] interface IAccessibleImage;
+	};
+	
+	[
+		uuid(730A561B-1AF6-49E1-9C04-9A2F48CD8512),
+		helpstring("AccValue Class")
+	]
+	coclass AccValue
+	{
+		[default] interface IAccessibleValue;
+	};
+	[
+		uuid(92BAA62D-535A-4EAB-9ABB-BFA60B7A6DB6),
+		helpstring("AccTable Class")
+	]
+	coclass AccTable
+	{
+		[default] interface IAccessibleTable;
+	};
+	
+	[
+		uuid(519A64CD-F6A6-4793-BE50-4E36C4C593EF),
+		helpstring("AccHyperLink Class")
+	]
+	coclass AccHyperLink
+	{
+		[default] interface IAccessibleAction;
+	};
+	
+};

Added: openoffice/branches/ia2/main/winaccessibility/source/UAccCOMIDL/defines.idl
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/winaccessibility/source/UAccCOMIDL/defines.idl?rev=1420522&view=auto
==============================================================================
--- openoffice/branches/ia2/main/winaccessibility/source/UAccCOMIDL/defines.idl (added)
+++ openoffice/branches/ia2/main/winaccessibility/source/UAccCOMIDL/defines.idl Wed Dec 12 04:41:12 2012
@@ -0,0 +1,47 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright IBM Corporation 2010.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+import "objidl.idl";
+import "oaidl.idl";
+import "oleacc.idl";
+
+interface IMAccessible;
+
+const long UACC_NO_FOCUS=0xFFFF;
+
+typedef struct {
+	long m_dChildID;//identify a unique child node
+	IMAccessible* m_pIMAccessible;
+}AccChildNode;
+
+typedef struct Location {
+	long m_dLeft;
+	long m_dTop;
+	long m_dWidth;
+	long m_dHeight;
+}Location;

Added: openoffice/branches/ia2/main/winaccessibility/source/UAccCOMIDL/dlldata.c
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/winaccessibility/source/UAccCOMIDL/dlldata.c?rev=1420522&view=auto
==============================================================================
--- openoffice/branches/ia2/main/winaccessibility/source/UAccCOMIDL/dlldata.c (added)
+++ openoffice/branches/ia2/main/winaccessibility/source/UAccCOMIDL/dlldata.c Wed Dec 12 04:41:12 2012
@@ -0,0 +1,64 @@
+/*********************************************************
+   DllData file -- generated by MIDL compiler 
+
+        DO NOT ALTER THIS FILE
+
+   This file is regenerated by MIDL on every IDL file compile.
+
+   To completely reconstruct this file, delete it and rerun MIDL
+   on all the IDL files in this DLL, specifying this file for the
+   /dlldata command line option
+
+*********************************************************/
+
+#define PROXY_DELEGATION
+
+#include <rpcproxy.h>
+
+#ifdef __cplusplus
+extern "C"   {
+#endif
+
+EXTERN_PROXY_FILE( Accessible2 )
+EXTERN_PROXY_FILE( AccessibleAction )
+EXTERN_PROXY_FILE( AccessibleApplication )
+EXTERN_PROXY_FILE( AccessibleComponent )
+EXTERN_PROXY_FILE( AccessibleEditableText )
+EXTERN_PROXY_FILE( AccessibleHyperlink )
+EXTERN_PROXY_FILE( AccessibleHypertext )
+EXTERN_PROXY_FILE( AccessibleImage )
+EXTERN_PROXY_FILE( AccessibleKeyBinding )
+EXTERN_PROXY_FILE( AccessibleRelation )
+EXTERN_PROXY_FILE( AccessibleTable )
+EXTERN_PROXY_FILE( AccessibleText )
+EXTERN_PROXY_FILE( AccessibleValue )
+EXTERN_PROXY_FILE( UAccCOM )
+
+
+PROXYFILE_LIST_START
+/* Start of list */
+  REFERENCE_PROXY_FILE( Accessible2 ),
+  REFERENCE_PROXY_FILE( AccessibleAction ),
+  REFERENCE_PROXY_FILE( AccessibleApplication ),
+  REFERENCE_PROXY_FILE( AccessibleComponent ),
+  REFERENCE_PROXY_FILE( AccessibleEditableText ),
+  REFERENCE_PROXY_FILE( AccessibleHyperlink ),
+  REFERENCE_PROXY_FILE( AccessibleHypertext ),
+  REFERENCE_PROXY_FILE( AccessibleImage ),
+  REFERENCE_PROXY_FILE( AccessibleKeyBinding ),
+  REFERENCE_PROXY_FILE( AccessibleRelation ),
+  REFERENCE_PROXY_FILE( AccessibleTable ),
+  REFERENCE_PROXY_FILE( AccessibleText ),
+  REFERENCE_PROXY_FILE( AccessibleValue ),
+  REFERENCE_PROXY_FILE( UAccCOM ),
+/* End of list */
+PROXYFILE_LIST_END
+
+
+DLLDATA_ROUTINES( aProxyFileList, GET_DLL_CLSID )
+
+#ifdef __cplusplus
+}  /*extern "C" */
+#endif
+
+/* end of generated dlldata file */

Added: openoffice/branches/ia2/main/winaccessibility/source/UAccCOMIDL/makefile.mk
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/winaccessibility/source/UAccCOMIDL/makefile.mk?rev=1420522&view=auto
==============================================================================
--- openoffice/branches/ia2/main/winaccessibility/source/UAccCOMIDL/makefile.mk (added)
+++ openoffice/branches/ia2/main/winaccessibility/source/UAccCOMIDL/makefile.mk Wed Dec 12 04:41:12 2012
@@ -0,0 +1,233 @@
+#/*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+# 
+# Copyright IBM Corporation 2010.
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org.  If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#************************************************************************/
+
+PRJ=..$/..
+PRJNAME=winaccessibility
+TARGET=UAccComIDL
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE :	settings.mk
+
+.IF "$(GUI)" == "WNT"
+
+# --- Targets ----------------------------------
+
+ALL : $(MISC)$/Accessible2	\
+	  $(MISC)$/AccessibleAction \
+	  $(MISC)$/AccessibleApplication \
+	  $(MISC)$/AccessibleComponent \
+	  $(MISC)$/AccessibleEditableText \
+	  $(MISC)$/AccessibleEventId \
+	  $(MISC)$/AccessibleHyperlink \
+	  $(MISC)$/AccessibleHypertext \
+	  $(MISC)$/AccessibleImage \
+	  $(MISC)$/AccessibleKeyBinding \
+	  $(MISC)$/AccessibleKeyStroke \
+	  $(MISC)$/AccessibleRelation \
+	  $(MISC)$/AccessibleRole \
+	  $(MISC)$/AccessibleStates \
+	  $(MISC)$/AccessibleTable \
+	  $(MISC)$/AccessibleText \
+	  $(MISC)$/AccessibleValue \
+	  $(MISC)$/Charset \
+	  $(MISC)$/defines \
+	  $(MISC)$/IA2CommonTypes \
+	  $(MISC)$/IA2TypeLibrary \
+	  $(MISC)$/UAccCOM
+
+MTL=midl.exe
+MTL_PROJ=
+
+SOURCE=Accessible2.idl
+SOURCE1=AccessibleAction.idl
+SOURCE2=AccessibleApplication.idl
+SOURCE3=AccessibleComponent.idl
+SOURCE4=AccessibleEditableText.idl
+SOURCE5=AccessibleEventId.idl
+SOURCE6=AccessibleHyperlink.idl
+SOURCE7=AccessibleHypertext.idl
+SOURCE8=AccessibleImage.idl
+SOURCE9=AccessibleKeyBinding.idl
+SOURCE10=AccessibleKeyStroke.idl
+SOURCE11=AccessibleRelation.idl
+SOURCE12=AccessibleRole.idl
+SOURCE13=AccessibleStates.idl
+SOURCE14=AccessibleTable.idl
+SOURCE15=AccessibleText.idl
+SOURCE16=AccessibleValue.idl
+SOURCE17=Charset.idl
+SOURCE18=defines.idl
+SOURCE19=IA2CommonTypes.idl
+SOURCE20=IA2TypeLibrary.idl
+SOURCE21=UAccCOM.idl
+
+MTL_SWITCHES=-tlb $(MISC)$/Accessible2.tlb -h $(MISC)$/Accessible2.h -iid $(MISC)$/Accessible2_i.c -proxy $(MISC)$/Accessible2_p.c -Oicf
+MTL_SWITCHES1=-tlb $(MISC)$/AccessibleAction.tlb -h $(MISC)$/AccessibleAction.h -iid $(MISC)$/AccessibleAction_i.c -proxy $(MISC)$/AccessibleAction_p.c -Oicf
+MTL_SWITCHES2=-tlb $(MISC)$/AccessibleApplication.tlb -h $(MISC)$/AccessibleApplication.h -iid $(MISC)$/AccessibleApplication_i.c -proxy $(MISC)$/AccessibleApplication_p.c -Oicf
+MTL_SWITCHES3=-tlb $(MISC)$/AccessibleComponent.tlb -h $(MISC)$/AccessibleComponent.h -iid $(MISC)$/AccessibleComponent_i.c -proxy $(MISC)$/AccessibleComponent_p.c -Oicf
+MTL_SWITCHES4=-tlb $(MISC)$/AccessibleEditableText.tlb -h $(MISC)$/AccessibleEditableText.h -iid $(MISC)$/AccessibleEditableText_i.c -proxy $(MISC)$/AccessibleEditableText_p.c -Oicf
+MTL_SWITCHES5=-tlb $(MISC)$/AccessibleEventId.tlb -h $(MISC)$/AccessibleEventId.h -iid $(MISC)$/AccessibleEventId_i.c -proxy $(MISC)$/AccessibleEventId_p.c -Oicf
+MTL_SWITCHES6=-tlb $(MISC)$/AccessibleHyperlink.tlb -h $(MISC)$/AccessibleHyperlink.h -iid $(MISC)$/AccessibleHyperlink_i.c -proxy $(MISC)$/AccessibleHyperlink_p.c -Oicf
+MTL_SWITCHES7=-tlb $(MISC)$/AccessibleHypertext.tlb -h $(MISC)$/AccessibleHypertext.h -iid $(MISC)$/AccessibleHypertext_i.c -proxy $(MISC)$/AccessibleHypertext_p.c -Oicf
+MTL_SWITCHES8=-tlb $(MISC)$/AccessibleImage.tlb -h $(MISC)$/AccessibleImage.h -iid $(MISC)$/AccessibleImage_i.c -proxy $(MISC)$/AccessibleImage_p.c -Oicf
+MTL_SWITCHES9=-tlb $(MISC)$/AccessibleKeyBinding.tlb -h $(MISC)$/AccessibleKeyBinding.h -iid $(MISC)$/AccessibleKeyBinding_i.c -proxy $(MISC)$/AccessibleKeyBinding_p.c -Oicf
+MTL_SWITCHES10=-tlb $(MISC)$/AccessibleKeyStroke.tlb -h $(MISC)$/AccessibleKeyStroke.h -iid $(MISC)$/AccessibleKeyStroke_i.c -proxy $(MISC)$/AccessibleKeyStroke_p.c -Oicf
+MTL_SWITCHES11=-tlb $(MISC)$/AccessibleRelation.tlb -h $(MISC)$/AccessibleRelation.h -iid $(MISC)$/AccessibleRelation_i.c -proxy $(MISC)$/AccessibleRelation_p.c -Oicf
+MTL_SWITCHES12=-tlb $(MISC)$/AccessibleRole.tlb -h $(MISC)$/AccessibleRole.h -iid $(MISC)$/AccessibleRole_i.c -proxy $(MISC)$/AccessibleRole_p.c -Oicf
+MTL_SWITCHES13=-tlb $(MISC)$/AccessibleStates.tlb -h $(MISC)$/AccessibleStates.h -iid $(MISC)$/AccessibleStates_i.c -proxy $(MISC)$/AccessibleStates_p.c -Oicf
+MTL_SWITCHES14=-tlb $(MISC)$/AccessibleTable.tlb -h $(MISC)$/AccessibleTable.h -iid $(MISC)$/AccessibleTable_i.c -proxy $(MISC)$/AccessibleTable_p.c -Oicf
+MTL_SWITCHES15=-tlb $(MISC)$/AccessibleText.tlb -h $(MISC)$/AccessibleText.h -iid $(MISC)$/AccessibleText_i.c -proxy $(MISC)$/AccessibleText_p.c -Oicf
+MTL_SWITCHES16=-tlb $(MISC)$/AccessibleValue.tlb -h $(MISC)$/AccessibleValue.h -iid $(MISC)$/AccessibleValue_i.c -proxy $(MISC)$/AccessibleValue_p.c -Oicf
+MTL_SWITCHES17=-tlb $(MISC)$/Charset.tlb -h $(MISC)$/Charset.h -iid $(MISC)$/Charset_i.c -proxy $(MISC)$/Charset_p.c -Oicf
+MTL_SWITCHES18=-tlb $(MISC)$/defines.tlb -h $(MISC)$/defines.h -iid $(MISC)$/defines_i.c -proxy $(MISC)$/defines_p.c -Oicf
+MTL_SWITCHES19=-tlb $(MISC)$/IA2CommonTypes.tlb -h $(MISC)$/IA2CommonTypes.h -iid $(MISC)$/IA2CommonTypes_i.c -proxy $(MISC)$/IA2CommonTypes_p.c -Oicf
+MTL_SWITCHES20=-tlb $(MISC)$/IA2TypeLibrary.tlb -h $(MISC)$/IA2TypeLibrary.h -iid $(MISC)$/IA2TypeLibrary_i.c -proxy $(MISC)$/IA2TypeLibrary_p.c -Oicf
+MTL_SWITCHES21=-tlb $(MISC)$/UAccCOM.tlb -h $(MISC)$/UAccCOM.h -iid $(MISC)$/UAccCOM_i.c -proxy $(MISC)$/UAccCOM_p.c -Oicf
+
+.IF "$(COM)"=="GCC"
+MTL_SWITCHES+=-cpp_cmd gcc -cpp_opt "-x c -E -D__stdcall= -D_stdcall= -nostdinc -I $(shell @cygpath -w $(PSDK_HOME)/include)"
+MTL_SWITCHES1+=-cpp_cmd gcc -cpp_opt "-x c -E -D__stdcall= -D_stdcall= -nostdinc -I $(shell @cygpath -w $(PSDK_HOME)/include)"
+MTL_SWITCHES2+=-cpp_cmd gcc -cpp_opt "-x c -E -D__stdcall= -D_stdcall= -nostdinc -I $(shell @cygpath -w $(PSDK_HOME)/include)"
+MTL_SWITCHES3+=-cpp_cmd gcc -cpp_opt "-x c -E -D__stdcall= -D_stdcall= -nostdinc -I $(shell @cygpath -w $(PSDK_HOME)/include)"
+MTL_SWITCHES4+=-cpp_cmd gcc -cpp_opt "-x c -E -D__stdcall= -D_stdcall= -nostdinc -I $(shell @cygpath -w $(PSDK_HOME)/include)"
+MTL_SWITCHES5+=-cpp_cmd gcc -cpp_opt "-x c -E -D__stdcall= -D_stdcall= -nostdinc -I $(shell @cygpath -w $(PSDK_HOME)/include)"
+MTL_SWITCHES6+=-cpp_cmd gcc -cpp_opt "-x c -E -D__stdcall= -D_stdcall= -nostdinc -I $(shell @cygpath -w $(PSDK_HOME)/include)"
+MTL_SWITCHES7+=-cpp_cmd gcc -cpp_opt "-x c -E -D__stdcall= -D_stdcall= -nostdinc -I $(shell @cygpath -w $(PSDK_HOME)/include)"
+MTL_SWITCHES8+=-cpp_cmd gcc -cpp_opt "-x c -E -D__stdcall= -D_stdcall= -nostdinc -I $(shell @cygpath -w $(PSDK_HOME)/include)"
+MTL_SWITCHES9+=-cpp_cmd gcc -cpp_opt "-x c -E -D__stdcall= -D_stdcall= -nostdinc -I $(shell @cygpath -w $(PSDK_HOME)/include)"
+MTL_SWITCHES10+=-cpp_cmd gcc -cpp_opt "-x c -E -D__stdcall= -D_stdcall= -nostdinc -I $(shell @cygpath -w $(PSDK_HOME)/include)"
+MTL_SWITCHES11+=-cpp_cmd gcc -cpp_opt "-x c -E -D__stdcall= -D_stdcall= -nostdinc -I $(shell @cygpath -w $(PSDK_HOME)/include)"
+MTL_SWITCHES12+=-cpp_cmd gcc -cpp_opt "-x c -E -D__stdcall= -D_stdcall= -nostdinc -I $(shell @cygpath -w $(PSDK_HOME)/include)"
+MTL_SWITCHES13+=-cpp_cmd gcc -cpp_opt "-x c -E -D__stdcall= -D_stdcall= -nostdinc -I $(shell @cygpath -w $(PSDK_HOME)/include)"
+MTL_SWITCHES14+=-cpp_cmd gcc -cpp_opt "-x c -E -D__stdcall= -D_stdcall= -nostdinc -I $(shell @cygpath -w $(PSDK_HOME)/include)"
+MTL_SWITCHES15+=-cpp_cmd gcc -cpp_opt "-x c -E -D__stdcall= -D_stdcall= -nostdinc -I $(shell @cygpath -w $(PSDK_HOME)/include)"
+MTL_SWITCHES16+=-cpp_cmd gcc -cpp_opt "-x c -E -D__stdcall= -D_stdcall= -nostdinc -I $(shell @cygpath -w $(PSDK_HOME)/include)"
+MTL_SWITCHES17+=-cpp_cmd gcc -cpp_opt "-x c -E -D__stdcall= -D_stdcall= -nostdinc -I $(shell @cygpath -w $(PSDK_HOME)/include)"
+MTL_SWITCHES18+=-cpp_cmd gcc -cpp_opt "-x c -E -D__stdcall= -D_stdcall= -nostdinc -I $(shell @cygpath -w $(PSDK_HOME)/include)"
+MTL_SWITCHES19+=-cpp_cmd gcc -cpp_opt "-x c -E -D__stdcall= -D_stdcall= -nostdinc -I $(shell @cygpath -w $(PSDK_HOME)/include)"
+MTL_SWITCHES20+=-cpp_cmd gcc -cpp_opt "-x c -E -D__stdcall= -D_stdcall= -nostdinc -I $(shell @cygpath -w $(PSDK_HOME)/include)"
+MTL_SWITCHES21+=-cpp_cmd gcc -cpp_opt "-x c -E -D__stdcall= -D_stdcall= -nostdinc -I $(shell @cygpath -w $(PSDK_HOME)/include)"
+
+$(MISC)$/Accessible2 : $(SOURCE) 
+	$(MTL) $(MTL_SWITCHES) -I $(shell @cygpath -w $(PSDK_HOME)/include|sed 's#\\#\\\\#g') $(SOURCE) 
+$(MISC)$/AccessibleAction : $(SOURCE1) 
+	$(MTL) $(MTL_SWITCHES1) -I $(shell @cygpath -w $(PSDK_HOME)/include|sed 's#\\#\\\\#g') $(SOURCE1) 
+$(MISC)$/AccessibleApplication : $(SOURCE2) 
+	$(MTL) $(MTL_SWITCHES2) -I $(shell @cygpath -w $(PSDK_HOME)/include|sed 's#\\#\\\\#g') $(SOURCE2) 
+$(MISC)$/AccessibleComponent : $(SOURCE3) 
+	$(MTL) $(MTL_SWITCHES3) -I $(shell @cygpath -w $(PSDK_HOME)/include|sed 's#\\#\\\\#g') $(SOURCE3) 
+$(MISC)$/AccessibleEditableText : $(SOURCE4) 
+	$(MTL) $(MTL_SWITCHES4) -I $(shell @cygpath -w $(PSDK_HOME)/include|sed 's#\\#\\\\#g') $(SOURCE4) 
+$(MISC)$/AccessibleEventId : $(SOURCE5) 
+	$(MTL) $(MTL_SWITCHES5) -I $(shell @cygpath -w $(PSDK_HOME)/include|sed 's#\\#\\\\#g') $(SOURCE5) 
+$(MISC)$/AccessibleHyperlink : $(SOURCE6) 
+	$(MTL) $(MTL_SWITCHES6) -I $(shell @cygpath -w $(PSDK_HOME)/include|sed 's#\\#\\\\#g') $(SOURCE6) 
+$(MISC)$/AccessibleHypertext : $(SOURCE7) 
+	$(MTL) $(MTL_SWITCHES7) -I $(shell @cygpath -w $(PSDK_HOME)/include|sed 's#\\#\\\\#g') $(SOURCE7) 
+$(MISC)$/AccessibleImage : $(SOURCE8) 
+	$(MTL) $(MTL_SWITCHES8) -I $(shell @cygpath -w $(PSDK_HOME)/include|sed 's#\\#\\\\#g') $(SOURCE8) 
+$(MISC)$/AccessibleKeyBinding : $(SOURCE9) 
+	$(MTL) $(MTL_SWITCHES9) -I $(shell @cygpath -w $(PSDK_HOME)/include|sed 's#\\#\\\\#g') $(SOURCE9) 
+$(MISC)$/AccessibleKeyStroke : $(SOURCE10) 
+	$(MTL) $(MTL_SWITCHES10) -I $(shell @cygpath -w $(PSDK_HOME)/include|sed 's#\\#\\\\#g') $(SOURCE10) 
+$(MISC)$/AccessibleRelation : $(SOURCE11) 
+	$(MTL) $(MTL_SWITCHES11) -I $(shell @cygpath -w $(PSDK_HOME)/include|sed 's#\\#\\\\#g') $(SOURCE11) 
+$(MISC)$/AccessibleRole : $(SOURCE12) 
+	$(MTL) $(MTL_SWITCHES12) -I $(shell @cygpath -w $(PSDK_HOME)/include|sed 's#\\#\\\\#g') $(SOURCE12) 
+$(MISC)$/AccessibleStates : $(SOURCE13) 
+	$(MTL) $(MTL_SWITCHES13) -I $(shell @cygpath -w $(PSDK_HOME)/include|sed 's#\\#\\\\#g') $(SOURCE13)
+$(MISC)$/AccessibleTable : $(SOURCE14) 
+	$(MTL) $(MTL_SWITCHES14) -I $(shell @cygpath -w $(PSDK_HOME)/include|sed 's#\\#\\\\#g') $(SOURCE14)
+$(MISC)$/AccessibleText : $(SOURCE15) 
+	$(MTL) $(MTL_SWITCHES15) -I $(shell @cygpath -w $(PSDK_HOME)/include|sed 's#\\#\\\\#g') $(SOURCE15)
+$(MISC)$/AccessibleValue : $(SOURCE16) 
+	$(MTL) $(MTL_SWITCHES16) -I $(shell @cygpath -w $(PSDK_HOME)/include|sed 's#\\#\\\\#g') $(SOURCE16)
+$(MISC)$/Charset : $(SOURCE17) 
+	$(MTL) $(MTL_SWITCHES17) -I $(shell @cygpath -w $(PSDK_HOME)/include|sed 's#\\#\\\\#g') $(SOURCE17)
+$(MISC)$/defines : $(SOURCE18) 
+	$(MTL) $(MTL_SWITCHES18) -I $(shell @cygpath -w $(PSDK_HOME)/include|sed 's#\\#\\\\#g') $(SOURCE18)
+$(MISC)$/IA2CommonTypes : $(SOURCE19) 
+	$(MTL) $(MTL_SWITCHES19) -I $(shell @cygpath -w $(PSDK_HOME)/include|sed 's#\\#\\\\#g') $(SOURCE19)
+$(MISC)$/IA2TypeLibrary : $(SOURCE20) 
+	$(MTL) $(MTL_SWITCHES20) -I $(shell @cygpath -w $(PSDK_HOME)/include|sed 's#\\#\\\\#g') $(SOURCE20)
+$(MISC)$/UAccCOM : $(SOURCE21) 
+	$(MTL) $(MTL_SWITCHES21) -I $(shell @cygpath -w $(PSDK_HOME)/include|sed 's#\\#\\\\#g') $(SOURCE21)
+
+.ELSE
+
+$(MISC)$/Accessible2 : $(SOURCE)
+	$(WRAPCMD) $(MTL) $(MTL_SWITCHES) $(INCLUDE) $(SOURCE) && $(TOUCH) $@
+$(MISC)$/AccessibleAction : $(SOURCE1)
+	$(WRAPCMD) $(MTL) $(MTL_SWITCHES1) $(INCLUDE) $(SOURCE1) && $(TOUCH) $@
+$(MISC)$/AccessibleApplication : $(SOURCE2)
+	$(WRAPCMD) $(MTL) $(MTL_SWITCHES2) $(INCLUDE) $(SOURCE2) && $(TOUCH) $@
+$(MISC)$/AccessibleComponent : $(SOURCE3)
+	$(WRAPCMD) $(MTL) $(MTL_SWITCHES3) $(INCLUDE) $(SOURCE3) && $(TOUCH) $@
+$(MISC)$/AccessibleEditableText : $(SOURCE4)
+	$(WRAPCMD) $(MTL) $(MTL_SWITCHES4) $(INCLUDE) $(SOURCE4) && $(TOUCH) $@
+$(MISC)$/AccessibleEventId : $(SOURCE5)
+	$(WRAPCMD) $(MTL) $(MTL_SWITCHES5) $(INCLUDE) $(SOURCE5) && $(TOUCH) $@
+$(MISC)$/AccessibleHyperlink : $(SOURCE6)
+	$(WRAPCMD) $(MTL) $(MTL_SWITCHES6) $(INCLUDE) $(SOURCE6) && $(TOUCH) $@
+$(MISC)$/AccessibleHypertext : $(SOURCE7)
+	$(WRAPCMD) $(MTL) $(MTL_SWITCHES7) $(INCLUDE) $(SOURCE7) && $(TOUCH) $@
+$(MISC)$/AccessibleImage : $(SOURCE8)
+	$(WRAPCMD) $(MTL) $(MTL_SWITCHES8) $(INCLUDE) $(SOURCE8) && $(TOUCH) $@
+$(MISC)$/AccessibleKeyBinding : $(SOURCE9)
+	$(WRAPCMD) $(MTL) $(MTL_SWITCHES9) $(INCLUDE) $(SOURCE9) && $(TOUCH) $@
+$(MISC)$/AccessibleKeyStroke : $(SOURCE10)
+	$(WRAPCMD) $(MTL) $(MTL_SWITCHES10) $(INCLUDE) $(SOURCE10) && $(TOUCH) $@
+$(MISC)$/AccessibleRelation : $(SOURCE11)
+	$(WRAPCMD) $(MTL) $(MTL_SWITCHES11) $(INCLUDE) $(SOURCE11) && $(TOUCH) $@
+$(MISC)$/AccessibleRole : $(SOURCE12)
+	$(WRAPCMD) $(MTL) $(MTL_SWITCHES12) $(INCLUDE) $(SOURCE12) && $(TOUCH) $@
+$(MISC)$/AccessibleStates : $(SOURCE13)
+	$(WRAPCMD) $(MTL) $(MTL_SWITCHES13) $(INCLUDE) $(SOURCE13) && $(TOUCH) $@
+$(MISC)$/AccessibleTable : $(SOURCE14)
+	$(WRAPCMD) $(MTL) $(MTL_SWITCHES14) $(INCLUDE) $(SOURCE14) && $(TOUCH) $@
+$(MISC)$/AccessibleText : $(SOURCE15)
+	$(WRAPCMD) $(MTL) $(MTL_SWITCHES15) $(INCLUDE) $(SOURCE15) && $(TOUCH) $@
+$(MISC)$/AccessibleValue : $(SOURCE16)
+	$(WRAPCMD) $(MTL) $(MTL_SWITCHES16) $(INCLUDE) $(SOURCE16) && $(TOUCH) $@
+$(MISC)$/Charset : $(SOURCE17)
+	$(WRAPCMD) $(MTL) $(MTL_SWITCHES17) $(INCLUDE) $(SOURCE17) && $(TOUCH) $@
+$(MISC)$/defines : $(SOURCE18)
+	$(WRAPCMD) $(MTL) $(MTL_SWITCHES18) $(INCLUDE) $(SOURCE18) && $(TOUCH) $@
+$(MISC)$/IA2CommonTypes : $(SOURCE19)
+	$(WRAPCMD) $(MTL) $(MTL_SWITCHES19) $(INCLUDE) $(SOURCE19) && $(TOUCH) $@
+$(MISC)$/IA2TypeLibrary : $(SOURCE20)
+	$(WRAPCMD) $(MTL) $(MTL_SWITCHES20) $(INCLUDE) $(SOURCE20) && $(TOUCH) $@
+$(MISC)$/UAccCOM : $(SOURCE21)
+	$(WRAPCMD) $(MTL) $(MTL_SWITCHES21) $(INCLUDE) $(SOURCE21) && $(TOUCH) $@
+.ENDIF
+
+.ENDIF
+
+.INCLUDE : target.mk
+

Added: openoffice/branches/ia2/main/winaccessibility/source/service/AccComponentEventListener.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/winaccessibility/source/service/AccComponentEventListener.cxx?rev=1420522&view=auto
==============================================================================
--- openoffice/branches/ia2/main/winaccessibility/source/service/AccComponentEventListener.cxx (added)
+++ openoffice/branches/ia2/main/winaccessibility/source/service/AccComponentEventListener.cxx Wed Dec 12 04:41:12 2012
@@ -0,0 +1,343 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright IBM Corporation 2010.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/AccessibleStateType.hpp>
+#include <com/sun/star/accessibility/AccessibleEventId.hpp>
+#include <com/sun/star/accessibility/AccessibleRole.hpp>
+#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
+
+#include "AccComponentEventListener.hxx"
+#include "AccObjectManagerAgent.hxx"
+#include "unomsaaevent.hxx"
+
+using namespace com::sun::star::uno;
+using namespace com::sun::star::accessibility;
+
+AccComponentEventListener::AccComponentEventListener(com::sun::star::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent)
+        :AccEventListener(pAcc, Agent)
+{
+}
+
+AccComponentEventListener::~AccComponentEventListener()
+{
+}
+
+/**
+ * Uno's event notifier when event is captured
+ *
+ * @param	AccessibleEventObject	the event object which contains information about event
+ */
+void  AccComponentEventListener::notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent )
+throw (::com::sun::star::uno::RuntimeException)
+{
+    switch (aEvent.EventId)
+    {
+    case AccessibleEventId::VALUE_CHANGED:
+        handleValueChangedEvent(aEvent.OldValue, aEvent.NewValue);
+        break;
+    case AccessibleEventId::ACTION_CHANGED:
+        handleActionChangedEvent();
+        break;
+    case AccessibleEventId::TEXT_CHANGED:
+        handleTextChangedEvent(aEvent.OldValue, aEvent.NewValue);
+        break;
+    case AccessibleEventId::CARET_CHANGED:
+        handleCaretChangedEvent(aEvent.OldValue, aEvent.NewValue);
+        break;
+    case AccessibleEventId::VISIBLE_DATA_CHANGED:
+        handleVisibleDataChangedEvent();
+        break;
+    case AccessibleEventId::BOUNDRECT_CHANGED:
+        handleBoundrectChangedEvent();
+        break;
+    case AccessibleEventId::SELECTION_CHANGED:
+        handleSelectionChangedEvent();
+        break;
+        //to add TEXT_SELECTION_CHANGED event
+    case AccessibleEventId::TEXT_SELECTION_CHANGED:
+        handleTextSelectionChangedEvent();
+        break;
+        //End
+    default:
+        AccEventListener::notifyEvent(aEvent);
+        break;
+    }
+}
+
+/**
+ * handle the VALUE_CHANGED event
+ *
+ * @param	oldValue	the old value of the source of event
+ * @param	newValue	the new value of the source of event
+ */
+void AccComponentEventListener::handleValueChangedEvent(Any oldValue, Any newValue)
+{
+    pAgent->UpdateValue(pAccessible);
+    pAgent->NotifyAccEvent(UM_EVENT_OBJECT_VALUECHANGE, pAccessible);
+}
+
+/**
+ * handle the NAME_CHANGED event
+ */
+void AccComponentEventListener::handleActionChangedEvent()
+{
+    pAgent->UpdateAction(pAccessible);
+    pAgent->NotifyAccEvent(UM_EVENT_OBJECT_DEFACTIONCHANGE, pAccessible);
+}
+
+/**
+ * handle the TEXT_CHANGED event
+ *
+ * @param	oldValue	the old value of the source of event
+ * @param	newValue	the new value of the source of event
+ */
+void AccComponentEventListener::handleTextChangedEvent(Any oldValue, Any newValue)
+{
+    pAgent->UpdateValue(pAccessible, newValue);
+    pAgent->NotifyAccEvent(UM_EVENT_OBJECT_VALUECHANGE, pAccessible);
+}
+
+/**
+ * handle the CARET_CHANGED event
+ *
+ * @param	oldValue	the old value of the source of event
+ * @param	newValue	the new value of the source of event
+ */
+void AccComponentEventListener::handleCaretChangedEvent(Any oldValue, Any newValue)
+{
+    pAgent->NotifyAccEvent(UM_EVENT_OBJECT_CARETCHANGE, pAccessible);
+}
+
+/**
+ *	handle the VISIBLE_DATA_CHANGED event
+ */
+void AccComponentEventListener::handleVisibleDataChangedEvent()
+{
+    AccEventListener::handleVisibleDataChangedEvent();
+}
+
+/**
+ *	handle the BOUNDRECT_CHANGED event
+ */
+void AccComponentEventListener::handleBoundrectChangedEvent()
+{
+    AccEventListener::handleBoundrectChangedEvent();
+}
+
+/**
+ * set the new state and fire the MSAA event
+ *
+ * @param	state	new state id
+ * @param	enable	true if state is set, false if state is unset
+ */
+void AccComponentEventListener::setComponentState(short state, bool enable )
+{
+    // only the following state can be fired state event.
+    switch (state)
+    {
+    case AccessibleStateType::CHECKED:
+    case AccessibleStateType::PRESSED:
+    case AccessibleStateType::SELECTED:
+    case AccessibleStateType::ARMED:
+    case AccessibleStateType::INDETERMINATE:
+    case AccessibleStateType::SHOWING:
+        fireStatePropertyChange(state, enable);
+        break;
+    case AccessibleStateType::VISIBLE:
+        if (getRole() == AccessibleRole::MENU_ITEM)
+        {
+            if(enable)
+            {
+                pAgent->IncreaseState( pAccessible, AccessibleStateType::VISIBLE);
+                pAgent->IncreaseState( pAccessible, AccessibleStateType::FOCUSABLE);
+            }
+            else
+            {
+                pAgent->DecreaseState( pAccessible, AccessibleStateType::VISIBLE);
+                pAgent->DecreaseState( pAccessible, AccessibleStateType::FOCUSABLE);
+            }
+        }
+        else
+        {
+            fireStatePropertyChange(state, enable);
+        }
+        break;
+        break;
+    case AccessibleStateType::FOCUSED:
+        fireStateFocusdChange(enable);
+        break;
+    case AccessibleStateType::ENABLED:
+        if(enable)
+        {
+            pAgent->UpdateState(pAccessible);
+            pAgent->DecreaseState( pAccessible, AccessibleStateType::DEFUNC);
+            // 8. label should have no FOCUSABLE state state, Firefox has READONLY state, we can also have.
+			if( getRole() != AccessibleRole::LABEL
+				&& getRole() != AccessibleRole::SCROLL_BAR) //IAccessibility2 Implementation 2009
+                pAgent->IncreaseState( pAccessible, AccessibleStateType::FOCUSABLE);
+        }
+        else
+        {
+            pAgent->UpdateState(pAccessible);
+            pAgent->IncreaseState( pAccessible, AccessibleStateType::DEFUNC);
+            pAgent->DecreaseState( pAccessible, AccessibleStateType::FOCUSABLE);
+        }
+        break;
+    case AccessibleStateType::ACTIVE:
+        // Only frames should be active
+        // no msaa state mapping
+        break;
+    default:
+        break;
+    }
+}
+
+/**
+ * fire the MSAA state changed event
+ *
+ * @param	state	the state id
+ * @param	set		true if state is set, false if state is unset
+ */
+void AccComponentEventListener::fireStatePropertyChange(short state, bool set)
+{
+    if( set)
+        {
+            // new value
+            switch(state)
+            {
+            case AccessibleStateType::CHECKED:
+            case AccessibleStateType::INDETERMINATE:
+                pAgent->IncreaseState( pAccessible, state);
+                pAgent->UpdateAction( pAccessible );
+
+                if(!pAgent->IsSpecialToolboItem(pAccessible))
+                {
+                    pAgent->NotifyAccEvent(UM_EVENT_STATE_CHECKED, pAccessible);
+                }
+                break;
+            case AccessibleStateType::PRESSED:
+                pAgent->IncreaseState( pAccessible, state);
+                pAgent->NotifyAccEvent(UM_EVENT_STATE_PRESSED, pAccessible);
+                break;
+            case AccessibleStateType::SELECTED:
+                pAgent->IncreaseState( pAccessible, state);
+                break;
+            case AccessibleStateType::ARMED:
+                pAgent->IncreaseState( pAccessible, state);
+                pAgent->NotifyAccEvent(UM_EVENT_STATE_ARMED, pAccessible);
+                break;
+            case AccessibleStateType::SHOWING:
+                pAgent->DecreaseState( pAccessible, AccessibleStateType::DEFUNC);
+                // UNO !SHOWING == MSAA OFFSCREEN
+                pAgent->IncreaseState( pAccessible, AccessibleStateType::SHOWING );
+                break;
+            case AccessibleStateType::VISIBLE:
+                // UNO !VISIBLE == MSAA INVISIBLE
+                pAgent->IncreaseState( pAccessible, AccessibleStateType::VISIBLE );
+                break;
+            default:
+                break;
+            }
+        }
+    else
+    {
+        // old value
+        switch(state)
+        {
+        case AccessibleStateType::CHECKED:
+        case AccessibleStateType::INDETERMINATE:
+            pAgent->DecreaseState( pAccessible, state );
+            pAgent->UpdateAction( pAccessible );
+
+            if(!pAgent->IsSpecialToolboItem(pAccessible))
+            {
+                pAgent->NotifyAccEvent(UM_EVENT_STATE_CHECKED, pAccessible);
+            }
+            break;
+        case AccessibleStateType::PRESSED:
+            pAgent->DecreaseState( pAccessible, state );
+            pAgent->NotifyAccEvent(UM_EVENT_STATE_PRESSED, pAccessible);
+            break;
+        case AccessibleStateType::SELECTED:
+            pAgent->DecreaseState( pAccessible, state );
+            //if the state is unset, no need to send MSAA SELECTION event
+            //pAgent->NotifyAccEvent(UM_EVENT_STATE_SELECTED, pAccessible);
+            break;
+        case AccessibleStateType::ARMED:
+            {
+                pAgent->DecreaseState( pAccessible, state);
+                //if the state is unset, no need to send MSAA MENU event
+                //pAgent->NotifyAccEvent(UM_EVENT_STATE_ARMED, pAccessible);
+            }
+            break;
+        case AccessibleStateType::SHOWING:
+            pAgent->DecreaseState( pAccessible, AccessibleStateType::DEFUNC);
+            // UNO !SHOWING == MSAA OFFSCREEN
+            pAgent->DecreaseState( pAccessible, AccessibleStateType::SHOWING );
+            break;
+        case AccessibleStateType::VISIBLE:
+            // UNO !VISIBLE == MSAA INVISIBLE
+            pAgent->DecreaseState( pAccessible, AccessibleStateType::VISIBLE );
+            break;
+
+        default:
+            break;
+        }
+    }
+}
+
+/**
+ * handle the focused event
+ *
+ * @param	enable	true if get focus, false if lose focus
+ */
+void AccComponentEventListener::fireStateFocusdChange(bool enable)
+{
+    if(enable)
+    {
+        if(getParentRole() != AccessibleRole::COMBO_BOX )
+            pAgent->NotifyAccEvent(UM_EVENT_STATE_FOCUSED, pAccessible);
+    }
+    else
+    {
+        //if lose focus, no need to send MSAA FOCUS event
+        pAgent->DecreaseState( pAccessible, AccessibleStateType::FOCUSED);
+    }
+}
+
+void AccComponentEventListener::handleSelectionChangedEvent()
+{
+    pAgent->NotifyAccEvent(UM_EVENT_SELECTION_CHANGED, pAccessible);
+}
+
+//add TEXT_SELECTION_CHANGED event
+void AccComponentEventListener::handleTextSelectionChangedEvent()
+{
+    pAgent->NotifyAccEvent(UM_EVENT_TEXT_SELECTION_CHANGED, pAccessible);
+}

Added: openoffice/branches/ia2/main/winaccessibility/source/service/AccContainerEventListener.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/winaccessibility/source/service/AccContainerEventListener.cxx?rev=1420522&view=auto
==============================================================================
--- openoffice/branches/ia2/main/winaccessibility/source/service/AccContainerEventListener.cxx (added)
+++ openoffice/branches/ia2/main/winaccessibility/source/service/AccContainerEventListener.cxx Wed Dec 12 04:41:12 2012
@@ -0,0 +1,578 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright IBM Corporation 2010.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/AccessibleStateType.hpp>
+#include <com/sun/star/accessibility/AccessibleEventId.hpp>
+#include <com/sun/star/accessibility/AccessibleRole.hpp>
+#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
+
+#include "AccContainerEventListener.hxx"
+#include "AccObjectManagerAgent.hxx"
+#include "unomsaaevent.hxx"
+
+using namespace com::sun::star::uno;
+using namespace com::sun::star::accessibility;
+
+AccContainerEventListener::AccContainerEventListener(com::sun::star::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent)
+        :AccEventListener(pAcc, Agent)
+{
+}
+
+AccContainerEventListener::~AccContainerEventListener()
+{
+}
+
+/**
+ *	Uno's event notifier when event is captured
+ *
+ *	@param AccessibleEventObject	the event object which contains information about event
+ */
+void  AccContainerEventListener::notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent )
+throw (::com::sun::star::uno::RuntimeException)
+{
+    short role = getRole();
+    switch (aEvent.EventId)
+    {
+    case AccessibleEventId::CHILD:
+        handleChildChangedEvent(aEvent.OldValue, aEvent.NewValue);
+        break;
+    case AccessibleEventId::SELECTION_CHANGED:
+        handleSelectionChangedEvent(aEvent.OldValue, aEvent.NewValue);
+        break;
+    case AccessibleEventId::INVALIDATE_ALL_CHILDREN:
+        handleAllChildrenChangedEvent();
+        break;
+    case AccessibleEventId::TEXT_CHANGED:
+        handleTextChangedEvent(aEvent.OldValue, aEvent.NewValue);
+    case AccessibleEventId::VISIBLE_DATA_CHANGED:
+        handleVisibleDataChangedEvent();
+        break;
+    case AccessibleEventId::BOUNDRECT_CHANGED:
+        handleBoundrectChangedEvent();
+        break;
+    case AccessibleEventId::STATE_CHANGED:
+        handleStateChangedEvent(aEvent.OldValue, aEvent.NewValue);
+        break;
+    case AccessibleEventId::VALUE_CHANGED:
+        handleValueChangedEvent(aEvent.OldValue, aEvent.NewValue);
+        break;
+    case AccessibleEventId::SELECTION_CHANGED_ADD:
+       	handleSelectionChangedAddEvent(aEvent.OldValue, aEvent.NewValue);
+       	break;
+    case AccessibleEventId::SELECTION_CHANGED_REMOVE:
+        handleSelectionChangedRemoveEvent(aEvent.OldValue, aEvent.NewValue);
+        break;
+    case AccessibleEventId::SELECTION_CHANGED_WITHIN:
+        handleSelectionChangedWithinEvent(aEvent.OldValue, aEvent.NewValue);
+        break;
+    case AccessibleEventId::PAGE_CHANGED:
+        handlePageChangedEvent(aEvent.OldValue, aEvent.NewValue);
+        break;
+    case AccessibleEventId::SECTION_CHANGED:
+        handleSectionChangedEvent(aEvent.OldValue, aEvent.NewValue);
+        break;
+    case AccessibleEventId::COLUMN_CHANGED:
+        handleColumnChangedEvent(aEvent.OldValue, aEvent.NewValue);
+        break;
+    default:
+        AccEventListener::notifyEvent(aEvent);
+        break;
+    }
+}
+
+/**
+ *	handle the VISIBLE_DATA_CHANGED event
+ */
+void AccContainerEventListener::handleVisibleDataChangedEvent()
+{
+    AccEventListener::handleVisibleDataChangedEvent();
+}
+
+/**
+ *	handle the BOUNDRECT_CHANGED event
+ */
+void AccContainerEventListener::handleBoundrectChangedEvent()
+{
+    AccEventListener::handleBoundrectChangedEvent();
+}
+
+void AccContainerEventListener::handleStateChangedEvent(Any oldValue, Any newValue)
+{
+    short State;
+    if( newValue >>= State)
+    {
+        setComponentState( State,true);
+    }
+    else if (oldValue >>= State)
+    {
+        setComponentState( State,false);
+    }
+
+}
+
+/**
+ * handle the CHILD event
+ * @param	oldValue	the child to be deleted
+ * @param	newValue	the child to be added
+ */
+void AccContainerEventListener::handleChildChangedEvent(Any oldValue, Any newValue)
+{
+    Reference< XAccessible > xChild;
+    if( newValue >>= xChild)
+    {
+        //create a new child
+        if(xChild.is())
+        {
+            XAccessible* pAcc = xChild.get();
+            //add this child
+
+            if(pAgent->InsertAccObj( pAcc,pAccessible))
+            {
+                //add all oldValue's existing children
+                pAgent->InsertChildrenAccObj(pAcc);
+                pAgent->NotifyAccEvent(UM_EVENT_CHILD_ADDED, pAcc);
+            }
+        }
+        else
+        {}
+    }
+    else if (oldValue >>= xChild)
+    {
+        //delete a existing child
+        if(xChild.is())
+        {
+            XAccessible* pAcc = xChild.get();
+            pAgent->NotifyAccEvent(UM_EVENT_CHILD_REMOVED, pAcc);
+            //delete all oldValue's existing children
+            pAgent->DeleteChildrenAccObj( pAcc );
+            //delete this child
+            pAgent->DeleteAccObj( pAcc );
+
+        }
+        else
+        {}
+    }
+
+}
+
+/**
+ * handle the SELECTION_CHANGED event
+ * @param	oldValue	the old value of the source of event
+ * @param	newValue	the new value of the source of event
+ */
+void AccContainerEventListener::handleSelectionChangedEvent(const Any& /*oldValue*/, const Any& newValue)
+{
+    if(NotifyChildEvent(UM_EVENT_SELECTION_CHANGED,newValue))
+    {
+        return ;
+    }
+
+    //menu bar does not process selection change event,just same as word behavior
+    if(getRole()!=AccessibleRole::MENU_BAR)
+        pAgent->NotifyAccEvent(UM_EVENT_SELECTION_CHANGED, pAccessible);
+}
+
+/**
+ *	handle the INVALIDATE_ALL_CHILDREN event
+ */
+void AccContainerEventListener::handleAllChildrenChangedEvent()
+{
+    //TODO: update all the children
+    if( pAccessible )
+    {
+        //delete all oldValue's existing children
+        pAgent->DeleteChildrenAccObj( pAccessible );
+        //add all oldValue's existing children
+        pAgent->InsertChildrenAccObj( pAccessible );
+        pAgent->NotifyAccEvent(UM_EVENT_OBJECT_REORDER , pAccessible);
+    }
+}
+
+/**
+ *	handle the TEXT_CHANGED event
+ */
+void AccContainerEventListener::handleTextChangedEvent(Any oldValue, Any newValue)
+{
+    pAgent->UpdateValue(pAccessible, newValue);
+    pAgent->NotifyAccEvent(UM_EVENT_OBJECT_TEXTCHANGE, pAccessible);
+}
+
+/**
+ * set the new state and fire the MSAA event
+ * @param	state	new state id
+ * @param	enable	true if state is set, false if state is unset
+ */
+void AccContainerEventListener::setComponentState(short state, bool enable )
+{
+    // only the following state can be fired state event.
+
+    switch (state)
+    {
+    case AccessibleStateType::SELECTED:
+    case AccessibleStateType::BUSY:
+    case AccessibleStateType::INDETERMINATE:
+    case AccessibleStateType::OFFSCREEN:
+    case AccessibleStateType::FOCUSABLE:
+    case AccessibleStateType::SHOWING:
+    case AccessibleStateType::VISIBLE:
+        fireStatePropertyChange(state, enable);
+        break;
+    case AccessibleStateType::FOCUSED:
+        fireStateFocusdChange(enable);
+        break;
+    case AccessibleStateType::ENABLED:
+        if(enable)
+        {
+            pAgent->DecreaseState( pAccessible, AccessibleStateType::DEFUNC);
+            pAgent->IncreaseState( pAccessible, AccessibleStateType::FOCUSABLE);
+            pAgent->UpdateState(pAccessible);
+
+            UpdateAllChildrenState(pAccessible);
+        }
+        else
+        {
+            pAgent->IncreaseState( pAccessible, AccessibleStateType::DEFUNC);
+            pAgent->DecreaseState( pAccessible, AccessibleStateType::FOCUSABLE);
+            pAgent->UpdateState(pAccessible);
+
+            UpdateAllChildrenState(pAccessible);
+        }
+        break;
+    case AccessibleStateType::ACTIVE:
+        // Only frames should be active
+        // no msaa state mapping
+        //for PAGE_TAB_LIST, there will be ACTIVE state, then it should be converted to FOCUSED event.
+        if(getRole() == AccessibleRole::PAGE_TAB_LIST)
+        {
+            if (!enable) /* get the active state */
+            {
+                pAgent->IncreaseState( pAccessible, AccessibleStateType::FOCUSED);
+            }
+
+            else	/* lose the active state */
+            {
+                pAgent->DecreaseState( pAccessible, AccessibleStateType::FOCUSED);
+            }
+        }
+        break;
+
+    case AccessibleStateType::EXPANDED:
+    case AccessibleStateType::COLLAPSE:
+    case AccessibleStateType::CHECKED:
+        {
+            pAgent->UpdateState(pAccessible);
+            pAgent->NotifyAccEvent(UM_EVENT_STATE_BUSY, pAccessible);
+            break;
+        }
+
+    default:
+        break;
+    }
+}
+
+/**
+ * fire the MSAA state changed event
+ * @param	state	the state id
+ * @param	set		true if state is set, false if state is unset
+ */
+void AccContainerEventListener::fireStatePropertyChange(short state, bool set)
+{
+    if( set )
+	{
+		// new value
+		switch(state)
+		{
+		case AccessibleStateType::SELECTED:
+			pAgent->IncreaseState( pAccessible, state);
+			break;
+		case AccessibleStateType::INDETERMINATE:
+		case AccessibleStateType::BUSY:
+		case AccessibleStateType::FOCUSABLE:
+		case AccessibleStateType::OFFSCREEN:
+			pAgent->IncreaseState( pAccessible, state);
+			pAgent->NotifyAccEvent(UM_EVENT_STATE_BUSY, pAccessible);
+			break;
+		case AccessibleStateType::SHOWING:
+			// UNO !SHOWING == MSAA OFFSCREEN
+			pAgent->IncreaseState( pAccessible, AccessibleStateType::SHOWING );
+			break;
+		case AccessibleStateType::VISIBLE:
+			// UNO !VISIBLE == MSAA INVISIBLE
+			pAgent->IncreaseState( pAccessible, AccessibleStateType::VISIBLE );
+			break;
+		default:
+			break;
+		}
+	}
+    else
+    {
+        // old value
+        switch(state)
+        {
+        case AccessibleStateType::SELECTED:
+            pAgent->DecreaseState( pAccessible, state );
+            break;
+        case AccessibleStateType::BUSY:
+        case AccessibleStateType::INDETERMINATE:
+        case AccessibleStateType::FOCUSABLE:
+        case AccessibleStateType::OFFSCREEN:
+            pAgent->DecreaseState( pAccessible, state);
+            pAgent->NotifyAccEvent(UM_EVENT_STATE_BUSY, pAccessible);
+            break;
+        case AccessibleStateType::SHOWING:
+            // UNO !SHOWING == MSAA OFFSCREEN
+            pAgent->DecreaseState( pAccessible, AccessibleStateType::SHOWING );
+            break;
+        case AccessibleStateType::VISIBLE:
+            // UNO !VISIBLE == MSAA INVISIBLE
+            pAgent->DecreaseState( pAccessible, AccessibleStateType::VISIBLE );
+            break;
+        default:
+            break;
+        }
+    }
+}
+
+/**
+ * handle the focused event
+ * @param	enable	true if get focus, false if lose focus
+ */
+void AccContainerEventListener::fireStateFocusdChange(bool enable)
+{
+    if(enable)
+    {
+        pAgent->IncreaseState( pAccessible, AccessibleStateType::FOCUSED);
+        //if the acc role is MENU_BAR, MSAA UM_EVENT_MENU_START event should be sent
+        //if the acc role is POPUP_MENU, MSAA UM_EVENT_MENUPOPUPSTART event should be sent
+        short role = getRole();
+        if(role == AccessibleRole::MENU_BAR)
+        {
+            pAgent->NotifyAccEvent(UM_EVENT_MENU_START, pAccessible);
+        }
+        else if (role == AccessibleRole::POPUP_MENU)
+            pAgent->NotifyAccEvent(UM_EVENT_MENUPOPUPSTART, pAccessible);
+        //Disable the focused event on option_pane and Panel.
+        //only disable option_pane for toolbar has panel to get focus
+        else if (role == AccessibleRole::PANEL || role == AccessibleRole::OPTION_PANE )
+        {
+            //don't send focused event on PANEL & OPTION_PANE if the parent is not toolbar
+            short parentRole = getParentRole();
+            if (parentRole == AccessibleRole::TOOL_BAR)
+                pAgent->NotifyAccEvent(UM_EVENT_STATE_FOCUSED, pAccessible);
+        }
+        //to update ComboBox's description
+        else if (role == AccessibleRole::COMBO_BOX )
+        {
+            pAgent->UpdateDescription(pAccessible);
+            //for editable combobox, send focus event on only edit control,
+            bool bSendFocusOnCombobox = true;
+            //send focused event to the first text child
+            Reference<XAccessibleContext> mxContext(pAccessible->getAccessibleContext(),UNO_QUERY);
+            if(mxContext.is())
+            {
+                Reference<XAccessible> mxChild = mxContext->getAccessibleChild(0);
+                if(mxChild.is())
+                {
+                    Reference<XAccessibleContext> mxChildContext(mxChild->getAccessibleContext(),UNO_QUERY);
+                    short childrole = mxChildContext->getAccessibleRole();
+                    if (childrole == AccessibleRole::TEXT)
+                    {
+                        if (IsEditable(mxChildContext))
+                        {
+                            pAgent->DecreaseState( pAccessible, AccessibleStateType::FOCUSED);
+                            pAgent->IncreaseState( mxChild.get(), AccessibleStateType::FOCUSED);
+                            pAgent->NotifyAccEvent(UM_EVENT_STATE_FOCUSED, mxChild.get());
+                            bSendFocusOnCombobox = false;
+                        }
+                    }
+                }
+            }
+            if (bSendFocusOnCombobox)
+                pAgent->NotifyAccEvent(UM_EVENT_STATE_FOCUSED, pAccessible);
+        }
+        else
+            pAgent->NotifyAccEvent(UM_EVENT_STATE_FOCUSED, pAccessible);
+    }
+    else
+    {
+        pAgent->DecreaseState( pAccessible, AccessibleStateType::FOCUSED);
+        //if the acc role is MENU_BAR, MSAA UM_EVENT_MENU_END event should be sent
+        //if the acc role is POPUP_MENU, MSAA UM_EVENT_MENUPOPUPEND event should be sent
+        if(getRole() == AccessibleRole::MENU_BAR)
+        {
+            pAgent->NotifyAccEvent(UM_EVENT_MENU_END, pAccessible);
+        }
+        else if (getRole() == AccessibleRole::POPUP_MENU)
+        {
+            pAgent->NotifyAccEvent(UM_EVENT_MENUPOPUPEND, pAccessible);
+        }
+    }
+}
+
+/**
+ * handle the VALUE_CHANGED event
+ *
+ * @param	oldValue	the old value of the source of event
+ * @param	newValue	the new value of the source of event
+ */
+void AccContainerEventListener::handleValueChangedEvent(Any oldValue, Any newValue)
+{
+    pAgent->UpdateValue(pAccessible);
+    pAgent->NotifyAccEvent(UM_EVENT_OBJECT_VALUECHANGE, pAccessible);
+}
+
+bool AccContainerEventListener::IsEditable(Reference<XAccessibleContext> xContext)
+{
+    bool ret = false;
+    Reference< XAccessibleStateSet > pRState = xContext->getAccessibleStateSet();
+    if( !pRState.is() )
+        return false;
+
+    Sequence<short> pStates = pRState->getStates();
+    int count = pStates.getLength();
+    for( int iIndex = 0;iIndex < count;iIndex++ )
+    {
+        if(pStates[iIndex] == AccessibleStateType::EDITABLE)
+            return true;
+    }
+    return ret;
+}
+
+bool AccContainerEventListener::NotifyChildEvent(short nWinEvent,const Any &Value)
+{
+    Reference< XAccessible > xChild;
+    if(Value >>= xChild )
+    {
+        if(xChild.is())
+        {
+            XAccessible* pAcc = xChild.get();
+            pAgent->NotifyAccEvent(nWinEvent, pAcc);
+            return true;
+        }
+    }
+    return false;
+}
+
+void AccContainerEventListener::handleSelectionChangedAddEvent(const Any& /*oldValue*/, const Any& newValue)
+{
+    if(NotifyChildEvent(UM_EVENT_SELECTION_CHANGED_ADD,newValue))
+    {
+        return ;
+    }
+    pAgent->NotifyAccEvent(UM_EVENT_SELECTION_CHANGED_ADD,pAccessible);
+}
+void AccContainerEventListener::handleSelectionChangedRemoveEvent(const Any& /*oldValue*/, const Any& newValue)
+{
+    if(NotifyChildEvent(UM_EVENT_SELECTION_CHANGED_REMOVE,newValue))
+    {
+        return ;
+    }
+    pAgent->NotifyAccEvent(UM_EVENT_SELECTION_CHANGED_REMOVE,pAccessible);
+}
+void AccContainerEventListener::handleSelectionChangedWithinEvent(const Any& /*oldValue*/, const Any& newValue)
+{
+    if(NotifyChildEvent(UM_EVENT_SELECTION_CHANGED_WITHIN,newValue))
+    {
+        return ;
+    }
+    pAgent->NotifyAccEvent(UM_EVENT_SELECTION_CHANGED_WITHIN,pAccessible);
+}
+
+void SAL_CALL AccContainerEventListener::UpdateAllChildrenState( com::sun::star::accessibility::XAccessible* pXAccessible )
+{
+    Reference<com::sun::star::accessibility::XAccessibleContext> xContext(pXAccessible->getAccessibleContext(),UNO_QUERY);
+    if(!xContext.is())
+    {
+        return;
+    }
+    com::sun::star::accessibility::XAccessibleContext* pAccessibleContext = xContext.get();
+    if(pAccessibleContext == NULL)
+    {
+        return;
+    }
+
+	if (pAgent && pAgent->IsStateManageDescendant(pXAccessible))
+	{
+		return;
+	}
+
+    int count = pAccessibleContext->getAccessibleChildCount();
+    for (int i=0;i<count;i++)
+    {
+        Reference<com::sun::star::accessibility::XAccessible> mxAccessible
+        = pAccessibleContext->getAccessibleChild(i);
+
+        com::sun::star::accessibility::XAccessible* mpAccessible = mxAccessible.get();
+        if(mpAccessible != NULL)
+        {
+            pAgent->UpdateState(mpAccessible);
+            UpdateAllChildrenState(mpAccessible);
+        }
+    }
+}
+
+
+void AccContainerEventListener::handlePageChangedEvent(const Any& /*oldValue*/, const Any& /*newValue*/)
+{
+    pAgent->NotifyAccEvent(UM_EVENT_OBJECT_PAGECHANGED, pAccessible);
+}
+
+void AccContainerEventListener::handleSectionChangedEvent(const Any& /*oldValue*/, const Any& /*newValue*/ )
+{
+    pAgent->NotifyAccEvent(UM_EVENT_SECTION_CHANGED, pAccessible);
+}
+
+void AccContainerEventListener::handleColumnChangedEvent(const Any& /*oldValue*/, const Any& /*newValue*/)
+{
+    pAgent->NotifyAccEvent(UM_EVENT_COLUMN_CHANGED, pAccessible);
+}
+
+//IAccessibility2 Implementation 2009-----
+void  AccContainerEventListener::handleNameChangedEvent( Any name )
+{
+	if (getRole() == AccessibleRole::COMBO_BOX)
+	{
+		Reference<XAccessibleContext> mxContext(pAccessible->getAccessibleContext(),UNO_QUERY);
+		if(mxContext.is())
+		{
+			Reference<XAccessible> mxChild = mxContext->getAccessibleChild(0);
+			if(mxChild.is())
+			{
+				Reference<XAccessibleContext> mxChildContext(mxChild->getAccessibleContext(),UNO_QUERY);
+				short childrole = mxChildContext->getAccessibleRole();
+				if (childrole == AccessibleRole::TEXT)
+				{
+					pAgent->UpdateAccName(mxChild.get(), name);
+				}
+			}
+		}
+	}
+	AccEventListener::handleNameChangedEvent(name);
+}
+//-----IAccessibility2 Implementation 2009

Added: openoffice/branches/ia2/main/winaccessibility/source/service/AccDescendantManagerEventListener.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/winaccessibility/source/service/AccDescendantManagerEventListener.cxx?rev=1420522&view=auto
==============================================================================
--- openoffice/branches/ia2/main/winaccessibility/source/service/AccDescendantManagerEventListener.cxx (added)
+++ openoffice/branches/ia2/main/winaccessibility/source/service/AccDescendantManagerEventListener.cxx Wed Dec 12 04:41:12 2012
@@ -0,0 +1,233 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright IBM Corporation 2010.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/AccessibleStateType.hpp>
+#include <com/sun/star/accessibility/AccessibleEventId.hpp>
+#include <com/sun/star/accessibility/AccessibleRole.hpp>
+#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
+
+#include "AccDescendantManagerEventListener.hxx"
+#include "AccObjectManagerAgent.hxx"
+#include "unomsaaevent.hxx"
+
+using namespace com::sun::star::uno;
+using namespace com::sun::star::accessibility;
+
+AccDescendantManagerEventListener::AccDescendantManagerEventListener(com::sun::star::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent)
+        :AccComponentEventListener(pAcc, Agent),
+        pActiveDescendant(NULL)
+{
+}
+
+AccDescendantManagerEventListener::~AccDescendantManagerEventListener()
+{
+}
+
+/**
+ * Uno's event notifier when event is captured
+ * @param AccessibleEventObject		the event object which contains information about event
+ */
+void  AccDescendantManagerEventListener::notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent )
+throw (::com::sun::star::uno::RuntimeException)
+{
+    switch (aEvent.EventId)
+    {
+    case AccessibleEventId::SELECTION_CHANGED:
+        handleSelectionChangedEvent(aEvent.OldValue, aEvent.NewValue);
+        break;
+    case AccessibleEventId::CHILD:
+        handleChildChangedEvent(aEvent.OldValue, aEvent.NewValue);
+        break;
+	case AccessibleEventId::ACTIVE_DESCENDANT_CHANGED_NOFOCUS:
+        handleChildChangedNoFocusEvent(aEvent.OldValue, aEvent.NewValue);
+        break;
+    case AccessibleEventId::SELECTION_CHANGED_ADD:
+        handleSelectionChangedAddEvent(aEvent.OldValue, aEvent.NewValue);
+		break;
+    case AccessibleEventId::SELECTION_CHANGED_REMOVE:
+		handleSelectionChangedRemoveEvent(aEvent.OldValue, aEvent.NewValue);
+        break;
+    case AccessibleEventId::SELECTION_CHANGED_WITHIN:
+        handleSelectionChangedWithinEvent(aEvent.OldValue, aEvent.NewValue);
+        break;
+    default:
+        AccComponentEventListener::notifyEvent(aEvent);
+        break;
+    }
+}
+
+/**
+ *	handle the CHILD event
+ *  @param	oldValue	the child to be deleted
+ *  @param	newValue	the child to be added
+ */
+void AccDescendantManagerEventListener::handleChildChangedEvent(Any oldValue, Any newValue)
+{
+
+    Reference< XAccessible > xChild;
+    if( newValue >>= xChild)
+    {
+        //create a new child
+        if(xChild.is())
+        {
+            XAccessible* pAcc = xChild.get();
+            pAgent->InsertAccObj( pAcc,pAccessible);
+            pAgent->InsertChildrenAccObj(pAcc);
+
+            pAgent->NotifyAccEvent(UM_EVENT_CHILD_ADDED, pAcc);
+
+        }
+        else
+        {}
+    }
+
+    if (oldValue >>= xChild)
+    {
+        if(xChild.is())
+        {
+            XAccessible* pAcc = xChild.get();
+
+            pAgent->NotifyAccEvent(UM_EVENT_CHILD_REMOVED, pAcc);
+            pAgent->DeleteChildrenAccObj( pAcc );
+            pAgent->DeleteAccObj( pAcc );
+        }
+        else
+        {}
+    }
+
+}
+
+/**
+ *	handle the SELECTION_CHANGED event
+ */
+void AccDescendantManagerEventListener::handleSelectionChangedEvent(Any oldValue, Any newValue)
+{
+    bool bSend =false;
+    Reference< XAccessible > xChild;
+    if(newValue >>= xChild )
+    {
+        if(xChild.is())
+        {
+            XAccessible* pAcc = xChild.get();
+            //if the Role is the SC cell ,don't add the selected state.
+            if (pAgent->GetRole(pAcc) != AccessibleRole::TABLE_CELL)
+            {
+                pAgent->IncreaseState( pAcc, AccessibleStateType::SELECTED);
+            }
+
+            pAgent->NotifyAccEvent(UM_EVENT_SELECTION_CHANGED, pAcc);
+            bSend=true;
+        }
+    }
+    if(oldValue >>= xChild )
+    {
+        if(xChild.is())
+        {
+            XAccessible* pAcc = xChild.get();
+            pAgent->DecreaseState( pAcc, AccessibleStateType::SELECTED);
+        }
+    }
+    if (!bSend)
+    {
+        pAgent->NotifyAccEvent(UM_EVENT_SELECTION_CHANGED, pAccessible);
+    }
+}
+
+
+void AccDescendantManagerEventListener::handleChildChangedNoFocusEvent(Any oldValue, Any newValue)
+{
+    Reference< XAccessible > xChild;
+    if(newValue >>= xChild )
+    {
+        if(xChild.is())
+        {
+            XAccessible* pAcc = xChild.get();
+
+            pAgent->InsertAccObj(pAcc,pAccessible);
+            pAgent->InsertChildrenAccObj(pAcc);
+
+            pActiveDescendant= pAcc;
+        }
+    }
+    if (oldValue >>= xChild)
+    {
+        if(xChild.is())
+        {
+            XAccessible* pAcc = xChild.get();
+            pAgent->DeleteChildrenAccObj( pAcc );
+            pAgent->DeleteAccObj( pAcc );
+        }
+    }
+}
+
+bool AccDescendantManagerEventListener::NotifyChildEvent(short nWinEvent,const Any &Value)
+{
+    Reference< XAccessible > xChild;
+    if(Value >>= xChild )
+    {
+        if(xChild.is())
+        {
+            XAccessible* pAcc = xChild.get();
+            pAgent->NotifyAccEvent(nWinEvent, pAcc);
+
+            if (pAgent && pAgent->IsStateManageDescendant(pAccessible) && ( nWinEvent == UM_EVENT_SELECTION_CHANGED_REMOVE) )
+            {
+                pAgent->DeleteAccObj( pAcc );
+            }
+            return true;
+        }
+    }
+    return false;
+}
+void AccDescendantManagerEventListener::handleSelectionChangedAddEvent(const Any& /*oldValue*/, const Any &newValue)
+{
+    if(NotifyChildEvent(UM_EVENT_SELECTION_CHANGED_ADD,newValue))
+    {
+        return ;
+    }
+    pAgent->NotifyAccEvent(UM_EVENT_SELECTION_CHANGED_ADD,pAccessible);
+}
+void AccDescendantManagerEventListener::handleSelectionChangedRemoveEvent(const Any& /*oldValue*/, const Any &newValue)
+{
+    if(NotifyChildEvent(UM_EVENT_SELECTION_CHANGED_REMOVE,newValue))
+    {
+        return ;
+    }
+    pAgent->NotifyAccEvent(UM_EVENT_SELECTION_CHANGED_REMOVE,pAccessible);
+}
+
+void AccDescendantManagerEventListener::handleSelectionChangedWithinEvent(const Any& /*oldValue*/, const Any &newValue)
+{
+    if(NotifyChildEvent(UM_EVENT_SELECTION_CHANGED_WITHIN,newValue))
+    {
+        return ;
+    }
+    pAgent->NotifyAccEvent(UM_EVENT_SELECTION_CHANGED_WITHIN,pAccessible);
+}
+

Added: openoffice/branches/ia2/main/winaccessibility/source/service/AccDialogEventListener.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/winaccessibility/source/service/AccDialogEventListener.cxx?rev=1420522&view=auto
==============================================================================
--- openoffice/branches/ia2/main/winaccessibility/source/service/AccDialogEventListener.cxx (added)
+++ openoffice/branches/ia2/main/winaccessibility/source/service/AccDialogEventListener.cxx Wed Dec 12 04:41:12 2012
@@ -0,0 +1,157 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright IBM Corporation 2010.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/AccessibleStateType.hpp>
+#include <com/sun/star/accessibility/AccessibleEventId.hpp>
+#include <com/sun/star/accessibility/AccessibleRole.hpp>
+#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
+
+#include "AccDialogEventListener.hxx"
+#include "AccObjectManagerAgent.hxx"
+#include "unomsaaevent.hxx"
+
+using namespace com::sun::star::uno;
+using namespace com::sun::star::accessibility;
+
+AccDialogEventListener::AccDialogEventListener(com::sun::star::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent)
+        :AccEventListener(pAcc, Agent)
+{}
+AccDialogEventListener::~AccDialogEventListener()
+{
+}
+
+/**
+ *	Uno's event notifier when event is captured
+ *	@param AccessibleEventObject	the event object which contains information about event
+ */
+void  AccDialogEventListener::notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent )
+throw (::com::sun::star::uno::RuntimeException)
+{
+    switch (aEvent.EventId)
+    {
+    case AccessibleEventId::CHILD:
+        handleChildChangedEvent(aEvent.OldValue, aEvent.NewValue);
+        break;
+    case AccessibleEventId::VISIBLE_DATA_CHANGED:
+        handleVisibleDataChangedEvent();
+        break;
+    case AccessibleEventId::BOUNDRECT_CHANGED:
+        handleBoundrectChangedEvent();
+        break;
+    default:
+        AccEventListener::notifyEvent(aEvent);
+        break;
+    }
+}
+
+/**
+ *	handle the VISIBLE_DATA_CHANGED event
+ */
+void AccDialogEventListener::handleVisibleDataChangedEvent()
+{
+    AccEventListener::handleVisibleDataChangedEvent();
+}
+
+/**
+ *	handle the BOUNDRECT_CHANGED event
+ */
+void AccDialogEventListener::handleBoundrectChangedEvent()
+{
+    AccEventListener::handleBoundrectChangedEvent();
+}
+
+/**
+ *	handle the CHILD event
+ * @param	oldValue	the child to be deleted
+ * @param	newValue	the child to be added
+ */
+void AccDialogEventListener::handleChildChangedEvent(Any oldValue, Any newValue)
+{
+    Reference< XAccessible > xChild;
+    if( newValue >>= xChild)
+    {
+        //create a new child
+        if(xChild.is())
+        {
+            XAccessible* pAcc = xChild.get();
+            //add this child
+            pAgent->InsertAccObj( pAcc,pAccessible);
+            //add all oldValue's existing children
+            pAgent->InsertChildrenAccObj(pAcc);
+            pAgent->NotifyAccEvent(UM_EVENT_CHILD_ADDED, pAcc);
+        }
+        else
+        {}
+    }
+    else if (oldValue >>= xChild)
+    {
+        //delete a existing child
+        if(xChild.is())
+        {
+            XAccessible* pAcc = xChild.get();
+            pAgent->NotifyAccEvent(UM_EVENT_CHILD_REMOVED, pAcc);
+            //delete all oldValue's existing children
+            pAgent->DeleteChildrenAccObj( pAcc );
+            //delete this child
+            pAgent->DeleteAccObj( pAcc );
+        }
+        else
+        {}
+    }
+
+}
+
+/**
+ *	set the new state and fire the MSAA event
+ *	@param state	new state id
+ *	@param enable	true if state is set, false if state is unset
+ */
+void AccDialogEventListener::setComponentState(short state, bool enable )
+{
+    // only the following state can be fired state event.
+    switch (state)
+    {
+    case AccessibleStateType::ICONIFIED:
+        // no msaa state mapping
+        break;
+    case AccessibleStateType::VISIBLE:
+        // UNO !VISIBLE == MSAA INVISIBLE
+        if( enable )
+            pAgent->IncreaseState( pAccessible, AccessibleStateType::VISIBLE );
+        else
+            pAgent->DecreaseState( pAccessible, AccessibleStateType::VISIBLE );
+        break;
+    case AccessibleStateType::ACTIVE:
+        // Only frames should be active
+        // no msaa state mapping
+        break;
+    default:
+        break;
+    }
+}

Added: openoffice/branches/ia2/main/winaccessibility/source/service/AccEventListener.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/winaccessibility/source/service/AccEventListener.cxx?rev=1420522&view=auto
==============================================================================
--- openoffice/branches/ia2/main/winaccessibility/source/service/AccEventListener.cxx (added)
+++ openoffice/branches/ia2/main/winaccessibility/source/service/AccEventListener.cxx Wed Dec 12 04:41:12 2012
@@ -0,0 +1,316 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright IBM Corporation 2010.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include <cppuhelper/bootstrap.hxx>
+#include <com/sun/star/bridge/XUnoUrlResolver.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <toolkit/awt/Vclxwindow.hxx>
+
+#ifndef _SV_SYSDATA_HXX
+#if defined( WIN ) || defined( WNT ) || defined( OS2 )
+typedef sal_Int32 HWND;
+#endif
+#endif
+#include "AccEventListener.hxx"
+#include "AccObjectManagerAgent.hxx"
+#include "unomsaaevent.hxx"
+
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/AccessibleStateType.hpp>
+#include <com/sun/star/accessibility/AccessibleEventId.hpp>
+#include <com/sun/star/accessibility/AccessibleRole.hpp>
+#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
+#include <com/sun/star/accessibility/XAccessibleComponent.hpp>
+
+#include <stdio.h>
+
+using namespace com::sun::star::uno;
+using namespace com::sun::star::accessibility;
+using namespace rtl;
+using namespace cppu;
+
+AccEventListener::AccEventListener(com::sun::star::accessibility::XAccessible* pAcc,
+                                   AccObjectManagerAgent* Agent)
+        :pAccessible(pAcc),
+        pAgent(Agent),
+        m_isDisposed(false),
+        m_refcount(0)
+{}
+
+AccEventListener::~AccEventListener()
+{
+}
+
+/**
+ *	Uno's event notifier when event is captured
+ *	@param AccessibleEventObject	the event object which contains information about event
+ */
+void  AccEventListener::notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent )
+throw (::com::sun::star::uno::RuntimeException)
+{
+
+    switch (aEvent.EventId)
+    {
+    case AccessibleEventId::NAME_CHANGED:
+        handleNameChangedEvent(aEvent.NewValue);
+        break;
+    case AccessibleEventId::DESCRIPTION_CHANGED:
+        handleDescriptionChangedEvent(aEvent.NewValue);
+        break;
+    case AccessibleEventId::STATE_CHANGED:
+        handleStateChangedEvent(aEvent.OldValue, aEvent.NewValue);
+        break;
+    default:
+        break;
+    }
+}
+
+/**
+ *	handle the NAME_CHANGED event
+ *	@param	name		the new name with changed.
+ */
+void AccEventListener::handleNameChangedEvent(Any name)
+{
+    if ( pAgent->IsTopWinAcc( pAccessible ) )
+    {
+        XAccessible* pAccDoc = pAgent->GetAccDocByAccTopWin( pAccessible );
+        if ( pAccDoc )
+        {
+            pAgent->UpdateAccName(pAccDoc);
+            pAgent->NotifyAccEvent(UM_EVENT_OBJECT_NAMECHANGE, pAccDoc);
+        }
+    }
+
+    pAgent->UpdateAccName(pAccessible, name);
+    pAgent->NotifyAccEvent(UM_EVENT_OBJECT_NAMECHANGE, pAccessible);
+}
+
+/**
+ *	handle the DESCRIPTION_CHANGED event
+ *	@param	desc		the new description
+ */
+void AccEventListener::handleDescriptionChangedEvent(Any desc)
+{
+    pAgent->UpdateDescription(pAccessible, desc);
+    pAgent->NotifyAccEvent(UM_EVENT_OBJECT_DESCRIPTIONCHANGE, pAccessible);
+}
+
+/**
+ *	handle the BOUNDRECT_CHANGED event
+ */
+void AccEventListener::handleBoundrectChangedEvent()
+{
+    pAgent->UpdateLocation(pAccessible);
+    pAgent->NotifyAccEvent(UM_EVENT_BOUNDRECT_CHANGED, pAccessible);
+}
+
+/**
+ *	handle the VISIBLE_DATA_CHANGED event
+ */
+void AccEventListener::handleVisibleDataChangedEvent()
+{
+    pAgent->UpdateValue(pAccessible);
+    pAgent->NotifyAccEvent(UM_EVENT_VISIBLE_DATA_CHANGED, pAccessible);
+}
+
+/**
+ *	handle the STATE_CHANGED event
+ *  @param	oldValue	the old state of the source of event
+ *  @param	newValue	the new state of the source of event
+ */
+void AccEventListener::handleStateChangedEvent(Any oldValue, Any newValue)
+{
+    short newV, oldV;
+    if( newValue >>= newV)
+    {
+        setComponentState(newV, true);
+    }
+    else if (oldValue >>= oldV)
+    {
+        setComponentState(oldV, false);
+    }
+}
+
+/**
+ *	set the new state and fire the MSAA event
+ *	@param	state		new state id
+ *	@param	enable		true if state is set, false if state is unset
+ */
+void AccEventListener::setComponentState(short state, bool enable )
+{
+    switch (state)
+    {
+    case AccessibleStateType::FOCUSED:
+        fireStateFocusdChange(enable);
+        break;
+    default:
+        fireStatePropertyChange(state, enable);
+        break;
+    }
+}
+
+/**
+ *	handle the focused event
+ *	@param enable	true if get focus, false if lose focus
+ */
+void AccEventListener::fireStateFocusdChange(bool enable)
+{
+    if(enable)
+    {
+        pAgent->IncreaseState( pAccessible, AccessibleStateType::FOCUSED);
+        pAgent->NotifyAccEvent(UM_EVENT_STATE_FOCUSED, pAccessible);
+    }
+    else
+    {
+        // no focus lost event in MSAA
+    }
+}
+
+
+/**
+ *	fire the MSAA state changed event
+ *	@param state	the state id
+ *	@param set		true if state is set, false if state is unset
+ */
+void AccEventListener::fireStatePropertyChange(short state, bool set )
+{
+    if( set )
+    {
+        //get new state
+    }
+    else
+    {
+        //lose old state
+    }
+}
+
+/**
+ *	get the role of accessible object which is observed
+ */
+short AccEventListener::getRole()
+{
+    Reference<com::sun::star::accessibility::XAccessibleContext> xContext(pAccessible->getAccessibleContext(),UNO_QUERY);
+    if(xContext.is())
+    {
+        return xContext->getAccessibleRole();
+    }
+    return -1;
+}
+
+/**
+ *	get the role of accessible parent object which is observed
+ */
+short AccEventListener::getParentRole()
+{
+    if(pAccessible)
+    {
+        return pAgent->GetParentRole(pAccessible);
+    }
+    return -1;
+}
+/**
+ *	remove the listener from accessible object
+ */
+void AccEventListener::removeMeFromBroadcaster()
+{
+    try
+    {
+        vos::OGuard aGuard(aRemoveMutex);
+        if(m_isDisposed)
+            return;
+        //get accessible context
+        Reference< XAccessibleContext > pRContext;
+        XAccessibleContext* pContext =NULL;
+
+        if( pAccessible == NULL)
+        {
+            return;
+        }
+        pRContext = pAccessible->getAccessibleContext();
+        if( !pRContext.is() )
+        {
+            return;
+        }
+
+        //get broadcaster from accessible component
+        Reference<XAccessibleComponent> xComponent(pRContext,UNO_QUERY);
+        if(!xComponent.is())
+        {
+            return;
+        }
+        Reference<XAccessibleEventBroadcaster> broadcaster(xComponent,UNO_QUERY);
+        XAccessibleEventBroadcaster* pBroadcaster = broadcaster.get();
+        if (pBroadcaster != NULL)
+        {
+            //remove the lister from accessible object
+            pBroadcaster->removeEventListener(this);
+            m_isDisposed = true;
+            pAgent->NotifyDestroy(pAccessible);
+        }
+    }
+    catch(...)
+    {
+        return;
+    }
+
+}
+
+/**
+ *	this method is invoked before listener is disposed
+ */
+void AccEventListener::disposing( const ::com::sun::star::lang::EventObject& Source )
+throw (::com::sun::star::uno::RuntimeException)
+{
+    removeMeFromBroadcaster();
+}
+
+//need to investigate further
+::com::sun::star::uno::Any SAL_CALL AccEventListener::queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException)
+{
+    if(aType.equals(::getCppuType( (Reference< com::sun::star::accessibility::XAccessibleEventListener> const *)0 ) ))
+    {
+        Reference< com::sun::star::accessibility::XAccessibleEventListener> xEventListener( static_cast< com::sun::star::accessibility::XAccessibleEventListener* >(this));
+        return makeAny(xEventListener);
+    }
+
+    return Any();
+}
+
+void AccEventListener::acquire(  ) throw ()
+{
+    ::osl_incrementInterlockedCount( &m_refcount );
+}
+
+void AccEventListener::release() throw ()
+{
+    // thread-safe decrementation of reference count
+    if (0 == ::osl_decrementInterlockedCount( &m_refcount ))
+    {
+        delete this; // shutdown this object
+    }
+}



Mime
View raw message