From e0849330bc4875384704fe031d563f8971ca4d96 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Fri, 27 May 2016 10:56:17 +0300 Subject: Get rid of unnecessary directory levels $D/inc/$D Change-Id: Ibf313b8948a493043006ebf3a8281487c1f67b48 Reviewed-on: https://gerrit.libreoffice.org/25532 Tested-by: Jenkins Reviewed-by: Tor Lillqvist Tested-by: Tor Lillqvist --- .../accessibility/extended/AccessibleBrowseBox.hxx | 289 --------- .../extended/AccessibleBrowseBoxBase.hxx | 447 ------------- .../extended/AccessibleBrowseBoxCheckBoxCell.hxx | 84 --- .../extended/AccessibleBrowseBoxHeaderBar.hxx | 258 -------- .../extended/AccessibleBrowseBoxHeaderCell.hxx | 74 --- .../extended/AccessibleBrowseBoxTable.hxx | 152 ----- .../extended/AccessibleBrowseBoxTableBase.hxx | 267 -------- .../extended/AccessibleBrowseBoxTableCell.hxx | 133 ---- .../extended/AccessibleGridControl.hxx | 239 ------- .../extended/AccessibleGridControlBase.hxx | 356 ----------- .../extended/AccessibleGridControlHeader.hxx | 181 ------ .../extended/AccessibleGridControlHeaderCell.hxx | 86 --- .../extended/AccessibleGridControlTable.hxx | 210 ------- .../extended/AccessibleGridControlTableBase.hxx | 207 ------ .../extended/AccessibleGridControlTableCell.hxx | 154 ----- .../extended/accessiblebrowseboxcell.hxx | 77 --- .../extended/accessibleeditbrowseboxcell.hxx | 142 ----- .../extended/accessibleiconchoicectrl.hxx | 110 ---- .../extended/accessibleiconchoicectrlentry.hxx | 191 ------ .../accessibility/extended/accessiblelistbox.hxx | 133 ---- .../extended/accessiblelistboxentry.hxx | 230 ------- .../accessibility/extended/accessibletabbar.hxx | 112 ---- .../extended/accessibletabbarbase.hxx | 65 -- .../extended/accessibletabbarpage.hxx | 128 ---- .../extended/accessibletabbarpagelist.hxx | 132 ---- .../extended/accessibletablistbox.hxx | 104 ---- .../extended/accessibletablistboxtable.hxx | 109 ---- .../accessibility/extended/listboxaccessible.hxx | 84 --- .../extended/textwindowaccessibility.hxx | 693 --------------------- .../accessibility/helper/IComboListBoxHelper.hxx | 69 -- .../inc/accessibility/helper/accessiblestrings.hrc | 51 -- .../inc/accessibility/helper/accresmgr.hxx | 66 -- .../helper/characterattributeshelper.hxx | 52 -- .../inc/accessibility/helper/listboxhelper.hxx | 189 ------ .../standard/accessiblemenubasecomponent.hxx | 145 ----- .../standard/accessiblemenucomponent.hxx | 89 --- .../standard/accessiblemenuitemcomponent.hxx | 90 --- .../accessibility/standard/vclxaccessiblebox.hxx | 185 ------ .../standard/vclxaccessiblebutton.hxx | 78 --- .../standard/vclxaccessiblecheckbox.hxx | 85 --- .../standard/vclxaccessiblecombobox.hxx | 57 -- .../standard/vclxaccessibledropdowncombobox.hxx | 56 -- .../standard/vclxaccessibledropdownlistbox.hxx | 56 -- .../accessibility/standard/vclxaccessibleedit.hxx | 111 ---- .../standard/vclxaccessiblefixedhyperlink.hxx | 47 -- .../standard/vclxaccessiblefixedtext.hxx | 47 -- .../accessibility/standard/vclxaccessiblelist.hxx | 210 ------- .../standard/vclxaccessiblelistbox.hxx | 56 -- .../standard/vclxaccessiblelistitem.hxx | 173 ----- .../accessibility/standard/vclxaccessiblemenu.hxx | 79 --- .../standard/vclxaccessiblemenubar.hxx | 66 -- .../standard/vclxaccessiblemenuitem.hxx | 109 ---- .../standard/vclxaccessiblemenuseparator.hxx | 46 -- .../standard/vclxaccessiblepopupmenu.hxx | 52 -- .../standard/vclxaccessibleradiobutton.hxx | 76 --- .../standard/vclxaccessiblescrollbar.hxx | 79 --- .../standard/vclxaccessiblestatusbar.hxx | 74 --- .../standard/vclxaccessiblestatusbaritem.hxx | 134 ---- .../standard/vclxaccessibletabcontrol.hxx | 96 --- .../standard/vclxaccessibletabpage.hxx | 139 ----- .../standard/vclxaccessibletabpagewindow.hxx | 60 -- .../standard/vclxaccessibletextcomponent.hxx | 85 --- .../standard/vclxaccessibletextfield.hxx | 92 --- .../standard/vclxaccessibletoolbox.hxx | 105 ---- .../standard/vclxaccessibletoolboxitem.hxx | 154 ----- accessibility/inc/extended/AccessibleBrowseBox.hxx | 289 +++++++++ .../inc/extended/AccessibleBrowseBoxBase.hxx | 447 +++++++++++++ .../extended/AccessibleBrowseBoxCheckBoxCell.hxx | 84 +++ .../inc/extended/AccessibleBrowseBoxHeaderBar.hxx | 258 ++++++++ .../inc/extended/AccessibleBrowseBoxHeaderCell.hxx | 74 +++ .../inc/extended/AccessibleBrowseBoxTable.hxx | 152 +++++ .../inc/extended/AccessibleBrowseBoxTableBase.hxx | 267 ++++++++ .../inc/extended/AccessibleBrowseBoxTableCell.hxx | 133 ++++ .../inc/extended/AccessibleGridControl.hxx | 239 +++++++ .../inc/extended/AccessibleGridControlBase.hxx | 356 +++++++++++ .../inc/extended/AccessibleGridControlHeader.hxx | 181 ++++++ .../extended/AccessibleGridControlHeaderCell.hxx | 86 +++ .../inc/extended/AccessibleGridControlTable.hxx | 210 +++++++ .../extended/AccessibleGridControlTableBase.hxx | 207 ++++++ .../extended/AccessibleGridControlTableCell.hxx | 154 +++++ .../inc/extended/accessiblebrowseboxcell.hxx | 77 +++ .../inc/extended/accessibleeditbrowseboxcell.hxx | 142 +++++ .../inc/extended/accessibleiconchoicectrl.hxx | 110 ++++ .../inc/extended/accessibleiconchoicectrlentry.hxx | 191 ++++++ accessibility/inc/extended/accessiblelistbox.hxx | 133 ++++ .../inc/extended/accessiblelistboxentry.hxx | 230 +++++++ accessibility/inc/extended/accessibletabbar.hxx | 112 ++++ .../inc/extended/accessibletabbarbase.hxx | 65 ++ .../inc/extended/accessibletabbarpage.hxx | 128 ++++ .../inc/extended/accessibletabbarpagelist.hxx | 132 ++++ .../inc/extended/accessibletablistbox.hxx | 104 ++++ .../inc/extended/accessibletablistboxtable.hxx | 109 ++++ accessibility/inc/extended/listboxaccessible.hxx | 84 +++ .../inc/extended/textwindowaccessibility.hxx | 693 +++++++++++++++++++++ accessibility/inc/helper/IComboListBoxHelper.hxx | 69 ++ accessibility/inc/helper/accessiblestrings.hrc | 51 ++ accessibility/inc/helper/accresmgr.hxx | 66 ++ .../inc/helper/characterattributeshelper.hxx | 52 ++ accessibility/inc/helper/listboxhelper.hxx | 189 ++++++ accessibility/inc/pch/precompiled_acc.hxx | 32 +- .../inc/standard/accessiblemenubasecomponent.hxx | 145 +++++ .../inc/standard/accessiblemenucomponent.hxx | 89 +++ .../inc/standard/accessiblemenuitemcomponent.hxx | 90 +++ accessibility/inc/standard/vclxaccessiblebox.hxx | 185 ++++++ .../inc/standard/vclxaccessiblebutton.hxx | 78 +++ .../inc/standard/vclxaccessiblecheckbox.hxx | 85 +++ .../inc/standard/vclxaccessiblecombobox.hxx | 57 ++ .../standard/vclxaccessibledropdowncombobox.hxx | 56 ++ .../inc/standard/vclxaccessibledropdownlistbox.hxx | 56 ++ accessibility/inc/standard/vclxaccessibleedit.hxx | 111 ++++ .../inc/standard/vclxaccessiblefixedhyperlink.hxx | 47 ++ .../inc/standard/vclxaccessiblefixedtext.hxx | 47 ++ accessibility/inc/standard/vclxaccessiblelist.hxx | 210 +++++++ .../inc/standard/vclxaccessiblelistbox.hxx | 56 ++ .../inc/standard/vclxaccessiblelistitem.hxx | 173 +++++ accessibility/inc/standard/vclxaccessiblemenu.hxx | 79 +++ .../inc/standard/vclxaccessiblemenubar.hxx | 66 ++ .../inc/standard/vclxaccessiblemenuitem.hxx | 109 ++++ .../inc/standard/vclxaccessiblemenuseparator.hxx | 46 ++ .../inc/standard/vclxaccessiblepopupmenu.hxx | 52 ++ .../inc/standard/vclxaccessibleradiobutton.hxx | 76 +++ .../inc/standard/vclxaccessiblescrollbar.hxx | 79 +++ .../inc/standard/vclxaccessiblestatusbar.hxx | 74 +++ .../inc/standard/vclxaccessiblestatusbaritem.hxx | 134 ++++ .../inc/standard/vclxaccessibletabcontrol.hxx | 96 +++ .../inc/standard/vclxaccessibletabpage.hxx | 139 +++++ .../inc/standard/vclxaccessibletabpagewindow.hxx | 60 ++ .../inc/standard/vclxaccessibletextcomponent.hxx | 85 +++ .../inc/standard/vclxaccessibletextfield.hxx | 92 +++ .../inc/standard/vclxaccessibletoolbox.hxx | 105 ++++ .../inc/standard/vclxaccessibletoolboxitem.hxx | 154 +++++ .../source/extended/AccessibleBrowseBox.cxx | 12 +- .../source/extended/AccessibleBrowseBoxBase.cxx | 2 +- .../extended/AccessibleBrowseBoxCheckBoxCell.cxx | 2 +- .../extended/AccessibleBrowseBoxHeaderBar.cxx | 4 +- .../extended/AccessibleBrowseBoxHeaderCell.cxx | 4 +- .../source/extended/AccessibleBrowseBoxTable.cxx | 2 +- .../extended/AccessibleBrowseBoxTableBase.cxx | 2 +- .../extended/AccessibleBrowseBoxTableCell.cxx | 2 +- .../source/extended/AccessibleGridControl.cxx | 10 +- .../source/extended/AccessibleGridControlBase.cxx | 2 +- .../extended/AccessibleGridControlHeader.cxx | 8 +- .../extended/AccessibleGridControlHeaderCell.cxx | 4 +- .../source/extended/AccessibleGridControlTable.cxx | 4 +- .../extended/AccessibleGridControlTableBase.cxx | 2 +- .../extended/AccessibleGridControlTableCell.cxx | 2 +- .../source/extended/accessiblebrowseboxcell.cxx | 2 +- .../extended/accessibleeditbrowseboxcell.cxx | 2 +- .../source/extended/accessibleiconchoicectrl.cxx | 4 +- .../extended/accessibleiconchoicectrlentry.cxx | 2 +- .../source/extended/accessiblelistbox.cxx | 4 +- .../source/extended/accessiblelistboxentry.cxx | 6 +- accessibility/source/extended/accessibletabbar.cxx | 4 +- .../source/extended/accessibletabbarbase.cxx | 4 +- .../source/extended/accessibletabbarpage.cxx | 2 +- .../source/extended/accessibletabbarpagelist.cxx | 4 +- .../source/extended/accessibletablistbox.cxx | 4 +- .../source/extended/accessibletablistboxtable.cxx | 6 +- .../source/extended/listboxaccessible.cxx | 2 +- .../source/extended/textwindowaccessibility.cxx | 2 +- .../source/helper/IComboListBoxHelper.cxx | 2 +- accessibility/source/helper/acc_factory.cxx | 62 +- accessibility/source/helper/accessiblestrings.src | 2 +- accessibility/source/helper/accresmgr.cxx | 2 +- .../source/helper/characterattributeshelper.cxx | 2 +- .../standard/accessiblemenubasecomponent.cxx | 8 +- .../source/standard/accessiblemenucomponent.cxx | 2 +- .../standard/accessiblemenuitemcomponent.cxx | 6 +- .../source/standard/vclxaccessiblebox.cxx | 14 +- .../source/standard/vclxaccessiblebutton.cxx | 6 +- .../source/standard/vclxaccessiblecheckbox.cxx | 6 +- .../source/standard/vclxaccessiblecombobox.cxx | 4 +- .../standard/vclxaccessibledropdowncombobox.cxx | 12 +- .../standard/vclxaccessibledropdownlistbox.cxx | 8 +- .../source/standard/vclxaccessibleedit.cxx | 6 +- .../standard/vclxaccessiblefixedhyperlink.cxx | 2 +- .../source/standard/vclxaccessiblefixedtext.cxx | 2 +- .../source/standard/vclxaccessiblelist.cxx | 6 +- .../source/standard/vclxaccessiblelistbox.cxx | 6 +- .../source/standard/vclxaccessiblelistitem.cxx | 4 +- .../source/standard/vclxaccessiblemenu.cxx | 2 +- .../source/standard/vclxaccessiblemenubar.cxx | 2 +- .../source/standard/vclxaccessiblemenuitem.cxx | 8 +- .../standard/vclxaccessiblemenuseparator.cxx | 2 +- .../source/standard/vclxaccessiblepopupmenu.cxx | 2 +- .../source/standard/vclxaccessibleradiobutton.cxx | 6 +- .../source/standard/vclxaccessiblescrollbar.cxx | 6 +- .../source/standard/vclxaccessiblestatusbar.cxx | 4 +- .../standard/vclxaccessiblestatusbaritem.cxx | 4 +- .../source/standard/vclxaccessibletabcontrol.cxx | 4 +- .../source/standard/vclxaccessibletabpage.cxx | 4 +- .../standard/vclxaccessibletabpagewindow.cxx | 2 +- .../standard/vclxaccessibletextcomponent.cxx | 4 +- .../source/standard/vclxaccessibletextfield.cxx | 4 +- .../source/standard/vclxaccessibletoolbox.cxx | 4 +- .../source/standard/vclxaccessibletoolboxitem.cxx | 6 +- bridges/inc/arraypointer.hxx | 49 ++ bridges/inc/bridge.hxx | 122 ++++ .../inc/bridges/cpp_uno/shared/arraypointer.hxx | 49 -- bridges/inc/bridges/cpp_uno/shared/bridge.hxx | 122 ---- .../bridges/cpp_uno/shared/cppinterfaceproxy.hxx | 100 --- bridges/inc/bridges/cpp_uno/shared/except.hxx | 41 -- bridges/inc/bridges/cpp_uno/shared/types.hxx | 71 --- .../bridges/cpp_uno/shared/unointerfaceproxy.hxx | 110 ---- .../inc/bridges/cpp_uno/shared/vtablefactory.hxx | 222 ------- bridges/inc/bridges/cpp_uno/shared/vtables.hxx | 102 --- bridges/inc/cppinterfaceproxy.hxx | 100 +++ bridges/inc/except.hxx | 41 ++ bridges/inc/types.hxx | 71 +++ bridges/inc/unointerfaceproxy.hxx | 110 ++++ bridges/inc/vtablefactory.hxx | 222 +++++++ bridges/inc/vtables.hxx | 102 +++ .../source/cpp_uno/gcc3_aix_powerpc/cpp2uno.cxx | 8 +- .../source/cpp_uno/gcc3_aix_powerpc/uno2cpp.cxx | 8 +- .../source/cpp_uno/gcc3_ios_arm/cpp2uno-arm.cxx | 8 +- .../source/cpp_uno/gcc3_ios_arm/cpp2uno-arm64.cxx | 8 +- .../source/cpp_uno/gcc3_ios_arm/cpp2uno-i386.cxx | 8 +- bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno.cxx | 2 +- .../source/cpp_uno/gcc3_ios_arm/uno2cpp-arm.cxx | 8 +- .../source/cpp_uno/gcc3_ios_arm/uno2cpp-arm64.cxx | 8 +- .../source/cpp_uno/gcc3_ios_arm/uno2cpp-i386.cxx | 8 +- bridges/source/cpp_uno/gcc3_ios_arm/uno2cpp.cxx | 8 +- .../source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx | 8 +- .../source/cpp_uno/gcc3_linux_aarch64/uno2cpp.cxx | 8 +- .../source/cpp_uno/gcc3_linux_alpha/cpp2uno.cxx | 8 +- .../source/cpp_uno/gcc3_linux_alpha/uno2cpp.cxx | 8 +- bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx | 8 +- bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx | 8 +- bridges/source/cpp_uno/gcc3_linux_hppa/call.cxx | 8 +- bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx | 8 +- bridges/source/cpp_uno/gcc3_linux_hppa/uno2cpp.cxx | 8 +- bridges/source/cpp_uno/gcc3_linux_ia64/cpp2uno.cxx | 8 +- bridges/source/cpp_uno/gcc3_linux_ia64/share.hxx | 2 +- bridges/source/cpp_uno/gcc3_linux_ia64/uno2cpp.cxx | 8 +- .../source/cpp_uno/gcc3_linux_intel/cpp2uno.cxx | 8 +- .../source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx | 8 +- bridges/source/cpp_uno/gcc3_linux_m68k/cpp2uno.cxx | 8 +- bridges/source/cpp_uno/gcc3_linux_m68k/uno2cpp.cxx | 8 +- bridges/source/cpp_uno/gcc3_linux_mips/cpp2uno.cxx | 8 +- bridges/source/cpp_uno/gcc3_linux_mips/uno2cpp.cxx | 8 +- .../source/cpp_uno/gcc3_linux_mips64/cpp2uno.cxx | 8 +- .../source/cpp_uno/gcc3_linux_mips64/uno2cpp.cxx | 8 +- .../source/cpp_uno/gcc3_linux_powerpc/cpp2uno.cxx | 8 +- .../source/cpp_uno/gcc3_linux_powerpc/uno2cpp.cxx | 8 +- .../cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx | 8 +- .../cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx | 8 +- bridges/source/cpp_uno/gcc3_linux_s390/cpp2uno.cxx | 8 +- bridges/source/cpp_uno/gcc3_linux_s390/uno2cpp.cxx | 8 +- .../source/cpp_uno/gcc3_linux_s390x/cpp2uno.cxx | 8 +- .../source/cpp_uno/gcc3_linux_s390x/uno2cpp.cxx | 8 +- .../source/cpp_uno/gcc3_linux_sparc/cpp2uno.cxx | 8 +- .../source/cpp_uno/gcc3_linux_sparc/uno2cpp.cxx | 8 +- .../source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx | 8 +- .../source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx | 8 +- .../source/cpp_uno/gcc3_macosx_x86-64/cpp2uno.cxx | 8 +- .../source/cpp_uno/gcc3_macosx_x86-64/uno2cpp.cxx | 8 +- .../gcc3_solaris_intel/callvirtualmethod.cxx | 8 +- .../source/cpp_uno/gcc3_solaris_intel/cpp2uno.cxx | 8 +- .../source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx | 8 +- .../source/cpp_uno/gcc3_solaris_sparc/cpp2uno.cxx | 8 +- .../source/cpp_uno/gcc3_solaris_sparc/uno2cpp.cxx | 8 +- bridges/source/cpp_uno/mingw_intel/cpp2uno.cxx | 8 +- bridges/source/cpp_uno/mingw_intel/smallstruct.cxx | 2 +- bridges/source/cpp_uno/mingw_intel/uno2cpp.cxx | 8 +- bridges/source/cpp_uno/mingw_x86-64/cpp2uno.cxx | 8 +- bridges/source/cpp_uno/mingw_x86-64/uno2cpp.cxx | 8 +- .../source/cpp_uno/msvc_win32_intel/cpp2uno.cxx | 8 +- bridges/source/cpp_uno/msvc_win32_intel/except.cxx | 2 +- .../source/cpp_uno/msvc_win32_intel/uno2cpp.cxx | 8 +- .../source/cpp_uno/msvc_win32_x86-64/cpp2uno.cxx | 8 +- .../source/cpp_uno/msvc_win32_x86-64/except.cxx | 2 +- .../source/cpp_uno/msvc_win32_x86-64/uno2cpp.cxx | 8 +- bridges/source/cpp_uno/shared/bridge.cxx | 6 +- bridges/source/cpp_uno/shared/component.cxx | 2 +- .../source/cpp_uno/shared/cppinterfaceproxy.cxx | 6 +- bridges/source/cpp_uno/shared/types.cxx | 2 +- .../source/cpp_uno/shared/unointerfaceproxy.cxx | 4 +- bridges/source/cpp_uno/shared/vtablefactory.cxx | 4 +- bridges/source/cpp_uno/shared/vtables.cxx | 2 +- idlc/inc/astattribute.hxx | 110 ++++ idlc/inc/astbasetype.hxx | 55 ++ idlc/inc/astconstant.hxx | 50 ++ idlc/inc/astconstants.hxx | 35 ++ idlc/inc/astdeclaration.hxx | 132 ++++ idlc/inc/astenum.hxx | 48 ++ idlc/inc/astexception.hxx | 36 ++ idlc/inc/astexpression.hxx | 143 +++++ idlc/inc/astinterface.hxx | 126 ++++ idlc/inc/astinterfacemember.hxx | 46 ++ idlc/inc/astmember.hxx | 50 ++ idlc/inc/astmodule.hxx | 44 ++ idlc/inc/astneeds.hxx | 41 ++ idlc/inc/astobserves.hxx | 41 ++ idlc/inc/astoperation.hxx | 59 ++ idlc/inc/astparameter.hxx | 48 ++ idlc/inc/astscope.hxx | 70 +++ idlc/inc/astsequence.hxx | 52 ++ idlc/inc/astservice.hxx | 62 ++ idlc/inc/astservicemember.hxx | 46 ++ idlc/inc/aststack.hxx | 49 ++ idlc/inc/aststruct.hxx | 58 ++ idlc/inc/aststructinstance.hxx | 49 ++ idlc/inc/asttype.hxx | 38 ++ idlc/inc/asttypedef.hxx | 46 ++ idlc/inc/errorhandler.hxx | 132 ++++ idlc/inc/fehelper.hxx | 76 +++ idlc/inc/idlc.hxx | 166 +++++ idlc/inc/idlc/astattribute.hxx | 110 ---- idlc/inc/idlc/astbasetype.hxx | 55 -- idlc/inc/idlc/astconstant.hxx | 50 -- idlc/inc/idlc/astconstants.hxx | 35 -- idlc/inc/idlc/astdeclaration.hxx | 132 ---- idlc/inc/idlc/astenum.hxx | 48 -- idlc/inc/idlc/astexception.hxx | 36 -- idlc/inc/idlc/astexpression.hxx | 143 ----- idlc/inc/idlc/astinterface.hxx | 126 ---- idlc/inc/idlc/astinterfacemember.hxx | 46 -- idlc/inc/idlc/astmember.hxx | 50 -- idlc/inc/idlc/astmodule.hxx | 44 -- idlc/inc/idlc/astneeds.hxx | 41 -- idlc/inc/idlc/astobserves.hxx | 41 -- idlc/inc/idlc/astoperation.hxx | 59 -- idlc/inc/idlc/astparameter.hxx | 48 -- idlc/inc/idlc/astscope.hxx | 70 --- idlc/inc/idlc/astsequence.hxx | 52 -- idlc/inc/idlc/astservice.hxx | 62 -- idlc/inc/idlc/astservicemember.hxx | 46 -- idlc/inc/idlc/aststack.hxx | 49 -- idlc/inc/idlc/aststruct.hxx | 58 -- idlc/inc/idlc/aststructinstance.hxx | 49 -- idlc/inc/idlc/asttype.hxx | 38 -- idlc/inc/idlc/asttypedef.hxx | 46 -- idlc/inc/idlc/errorhandler.hxx | 132 ---- idlc/inc/idlc/fehelper.hxx | 76 --- idlc/inc/idlc/idlc.hxx | 166 ----- idlc/inc/idlc/idlctypes.hxx | 209 ------- idlc/inc/idlc/inheritedinterface.hxx | 55 -- idlc/inc/idlc/options.hxx | 83 --- idlc/inc/idlctypes.hxx | 209 +++++++ idlc/inc/inheritedinterface.hxx | 55 ++ idlc/inc/options.hxx | 83 +++ idlc/source/astconstant.cxx | 4 +- idlc/source/astdeclaration.cxx | 4 +- idlc/source/astdump.cxx | 22 +- idlc/source/astenum.cxx | 2 +- idlc/source/astexpression.cxx | 8 +- idlc/source/astinterface.cxx | 8 +- idlc/source/astoperation.cxx | 10 +- idlc/source/astscope.cxx | 8 +- idlc/source/astservice.cxx | 8 +- idlc/source/aststack.cxx | 4 +- idlc/source/aststruct.cxx | 4 +- idlc/source/aststructinstance.cxx | 6 +- idlc/source/errorhandler.cxx | 4 +- idlc/source/fehelper.cxx | 6 +- idlc/source/idlc.cxx | 32 +- idlc/source/idlccompile.cxx | 2 +- idlc/source/idlcmain.cxx | 2 +- idlc/source/idlcproduce.cxx | 4 +- idlc/source/options.cxx | 2 +- idlc/source/parser.y | 42 +- idlc/source/scanner.l | 6 +- pyuno/inc/pyuno.hxx | 316 ++++++++++ pyuno/inc/pyuno/pyuno.hxx | 316 ---------- pyuno/source/loader/pyuno_loader.cxx | 2 +- pyuno/source/module/pyuno_impl.hxx | 2 +- svgio/inc/pch/precompiled_svgio.hxx | 12 +- svgio/inc/svganode.hxx | 58 ++ svgio/inc/svgcharacternode.hxx | 169 +++++ svgio/inc/svgcirclenode.hxx | 73 +++ svgio/inc/svgclippathnode.hxx | 68 ++ svgio/inc/svgdocument.hxx | 83 +++ svgio/inc/svgdocumenthandler.hxx | 68 ++ svgio/inc/svgellipsenode.hxx | 78 +++ svgio/inc/svggnode.hxx | 59 ++ svgio/inc/svggradientnode.hxx | 130 ++++ svgio/inc/svggradientstopnode.hxx | 57 ++ svgio/inc/svgimagenode.hxx | 89 +++ svgio/inc/svgio/svgreader/svganode.hxx | 58 -- svgio/inc/svgio/svgreader/svgcharacternode.hxx | 169 ----- svgio/inc/svgio/svgreader/svgcirclenode.hxx | 73 --- svgio/inc/svgio/svgreader/svgclippathnode.hxx | 68 -- svgio/inc/svgio/svgreader/svgdocument.hxx | 83 --- svgio/inc/svgio/svgreader/svgdocumenthandler.hxx | 68 -- svgio/inc/svgio/svgreader/svgellipsenode.hxx | 78 --- svgio/inc/svgio/svgreader/svggnode.hxx | 59 -- svgio/inc/svgio/svgreader/svggradientnode.hxx | 130 ---- svgio/inc/svgio/svgreader/svggradientstopnode.hxx | 57 -- svgio/inc/svgio/svgreader/svgimagenode.hxx | 89 --- svgio/inc/svgio/svgreader/svglinenode.hxx | 78 --- svgio/inc/svgio/svgreader/svgmarkernode.hxx | 116 ---- svgio/inc/svgio/svgreader/svgmasknode.hxx | 93 --- svgio/inc/svgio/svgreader/svgnode.hxx | 190 ------ svgio/inc/svgio/svgreader/svgpaint.hxx | 58 -- svgio/inc/svgio/svgreader/svgpathnode.hxx | 70 --- svgio/inc/svgio/svgreader/svgpatternnode.hxx | 119 ---- svgio/inc/svgio/svgreader/svgpolynode.hxx | 71 --- svgio/inc/svgio/svgreader/svgrectnode.hxx | 88 --- svgio/inc/svgio/svgreader/svgstyleattributes.hxx | 478 -------------- svgio/inc/svgio/svgreader/svgstylenode.hxx | 64 -- svgio/inc/svgio/svgreader/svgsvgnode.hxx | 104 ---- svgio/inc/svgio/svgreader/svgsymbolnode.hxx | 59 -- svgio/inc/svgio/svgreader/svgtextnode.hxx | 75 --- svgio/inc/svgio/svgreader/svgtextpathnode.hxx | 77 --- svgio/inc/svgio/svgreader/svgtitledescnode.hxx | 54 -- svgio/inc/svgio/svgreader/svgtoken.hxx | 196 ------ svgio/inc/svgio/svgreader/svgtools.hxx | 233 ------- svgio/inc/svgio/svgreader/svgtrefnode.hxx | 58 -- svgio/inc/svgio/svgreader/svgtspannode.hxx | 59 -- svgio/inc/svgio/svgreader/svgusenode.hxx | 80 --- svgio/inc/svglinenode.hxx | 78 +++ svgio/inc/svgmarkernode.hxx | 116 ++++ svgio/inc/svgmasknode.hxx | 93 +++ svgio/inc/svgnode.hxx | 190 ++++++ svgio/inc/svgpaint.hxx | 58 ++ svgio/inc/svgpathnode.hxx | 70 +++ svgio/inc/svgpatternnode.hxx | 119 ++++ svgio/inc/svgpolynode.hxx | 71 +++ svgio/inc/svgrectnode.hxx | 88 +++ svgio/inc/svgstyleattributes.hxx | 478 ++++++++++++++ svgio/inc/svgstylenode.hxx | 64 ++ svgio/inc/svgsvgnode.hxx | 104 ++++ svgio/inc/svgsymbolnode.hxx | 59 ++ svgio/inc/svgtextnode.hxx | 75 +++ svgio/inc/svgtextpathnode.hxx | 77 +++ svgio/inc/svgtitledescnode.hxx | 54 ++ svgio/inc/svgtoken.hxx | 196 ++++++ svgio/inc/svgtools.hxx | 233 +++++++ svgio/inc/svgtrefnode.hxx | 58 ++ svgio/inc/svgtspannode.hxx | 59 ++ svgio/inc/svgusenode.hxx | 80 +++ svgio/source/svgreader/svganode.cxx | 2 +- svgio/source/svgreader/svgcharacternode.cxx | 4 +- svgio/source/svgreader/svgcirclenode.cxx | 2 +- svgio/source/svgreader/svgclippathnode.cxx | 2 +- svgio/source/svgreader/svgdocument.cxx | 2 +- svgio/source/svgreader/svgdocumenthandler.cxx | 56 +- svgio/source/svgreader/svgellipsenode.cxx | 2 +- svgio/source/svgreader/svggnode.cxx | 2 +- svgio/source/svgreader/svggradientnode.cxx | 6 +- svgio/source/svgreader/svggradientstopnode.cxx | 2 +- svgio/source/svgreader/svgimagenode.cxx | 4 +- svgio/source/svgreader/svglinenode.cxx | 2 +- svgio/source/svgreader/svgmarkernode.cxx | 2 +- svgio/source/svgreader/svgmasknode.cxx | 2 +- svgio/source/svgreader/svgnode.cxx | 6 +- svgio/source/svgreader/svgpaint.cxx | 2 +- svgio/source/svgreader/svgpathnode.cxx | 2 +- svgio/source/svgreader/svgpatternnode.cxx | 4 +- svgio/source/svgreader/svgpolynode.cxx | 2 +- svgio/source/svgreader/svgrectnode.cxx | 2 +- svgio/source/svgreader/svgstyleattributes.cxx | 16 +- svgio/source/svgreader/svgstylenode.cxx | 4 +- svgio/source/svgreader/svgsvgnode.cxx | 2 +- svgio/source/svgreader/svgsymbolnode.cxx | 2 +- svgio/source/svgreader/svgtextnode.cxx | 12 +- svgio/source/svgreader/svgtextpathnode.cxx | 10 +- svgio/source/svgreader/svgtitledescnode.cxx | 2 +- svgio/source/svgreader/svgtoken.cxx | 2 +- svgio/source/svgreader/svgtools.cxx | 4 +- svgio/source/svgreader/svgtrefnode.cxx | 4 +- svgio/source/svgreader/svgtspannode.cxx | 2 +- svgio/source/svgreader/svgusenode.cxx | 4 +- svgio/source/svguno/xsvgparser.cxx | 2 +- unodevtools/inc/options.hxx | 42 ++ unodevtools/inc/unodevtools/options.hxx | 42 -- unodevtools/source/skeletonmaker/skeletonmaker.cxx | 2 +- unodevtools/source/unodevtools/options.cxx | 2 +- xmlsecurity/inc/biginteger.hxx | 33 + xmlsecurity/inc/certificatechooser.hxx | 84 +++ xmlsecurity/inc/certificateviewer.hxx | 150 +++++ xmlsecurity/inc/digitalsignaturesdialog.hxx | 129 ++++ xmlsecurity/inc/documentsignaturehelper.hxx | 102 +++ xmlsecurity/inc/documentsignaturemanager.hxx | 8 +- xmlsecurity/inc/global.hrc | 29 + xmlsecurity/inc/macrosecurity.hxx | 152 +++++ xmlsecurity/inc/pch/precompiled_xmlsecurity.hxx | 4 +- xmlsecurity/inc/pch/precompiled_xsec_fw.hxx | 2 +- xmlsecurity/inc/pch/precompiled_xsec_xmlsec.hxx | 4 +- xmlsecurity/inc/sigstruct.hxx | 102 +++ xmlsecurity/inc/xmlsec-wrapper.h | 46 ++ xmlsecurity/inc/xmlsecurity/biginteger.hxx | 33 - xmlsecurity/inc/xmlsecurity/certificatechooser.hxx | 84 --- xmlsecurity/inc/xmlsecurity/certificateviewer.hxx | 150 ----- .../inc/xmlsecurity/digitalsignaturesdialog.hxx | 129 ---- .../inc/xmlsecurity/documentsignaturehelper.hxx | 102 --- xmlsecurity/inc/xmlsecurity/global.hrc | 29 - xmlsecurity/inc/xmlsecurity/macrosecurity.hxx | 152 ----- xmlsecurity/inc/xmlsecurity/sigstruct.hxx | 102 --- xmlsecurity/inc/xmlsecurity/xmlsec-wrapper.h | 46 -- xmlsecurity/inc/xmlsecurity/xmlsignaturehelper.hxx | 198 ------ xmlsecurity/inc/xmlsecuritydllapi.h | 6 +- xmlsecurity/inc/xmlsignaturehelper.hxx | 198 ++++++ xmlsecurity/qa/unit/signing/signing.cxx | 4 +- .../source/component/documentdigitalsignatures.cxx | 12 +- .../source/component/documentdigitalsignatures.hxx | 2 +- xmlsecurity/source/component/warnbox.src | 2 +- xmlsecurity/source/dialogs/certificatechooser.cxx | 6 +- xmlsecurity/source/dialogs/certificateviewer.cxx | 4 +- xmlsecurity/source/dialogs/dialogs.hrc | 2 +- .../source/dialogs/digitalsignaturesdialog.cxx | 8 +- .../source/dialogs/digitalsignaturesdialog.hrc | 2 +- xmlsecurity/source/dialogs/macrosecurity.cxx | 8 +- .../source/helper/documentsignaturehelper.cxx | 2 +- xmlsecurity/source/helper/ooxmlsecexporter.hxx | 2 +- xmlsecurity/source/helper/xmlsignaturehelper.cxx | 4 +- xmlsecurity/source/helper/xmlsignaturehelper2.cxx | 2 +- xmlsecurity/source/helper/xsecctl.hxx | 2 +- xmlsecurity/source/xmlsec/biginteger.cxx | 4 +- xmlsecurity/source/xmlsec/errorcallback.cxx | 2 +- .../mscrypt/securityenvironment_mscryptimpl.cxx | 4 +- .../mscrypt/securityenvironment_mscryptimpl.hxx | 2 +- .../xmlsec/mscrypt/seinitializer_mscryptimpl.cxx | 2 +- .../xmlsec/mscrypt/xmlencryption_mscryptimpl.cxx | 2 +- .../mscrypt/xmlsecuritycontext_mscryptimpl.cxx | 2 +- .../xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx | 2 +- .../xmlsec/nss/securityenvironment_nssimpl.cxx | 4 +- .../xmlsec/nss/securityenvironment_nssimpl.hxx | 2 +- .../source/xmlsec/nss/xmlencryption_nssimpl.cxx | 2 +- .../xmlsec/nss/xmlsecuritycontext_nssimpl.cxx | 2 +- .../source/xmlsec/nss/xmlsignature_nssimpl.cxx | 2 +- xmlsecurity/source/xmlsec/serialnumberadapter.cxx | 2 +- xmlsecurity/source/xmlsec/xmlstreamio.cxx | 2 +- 523 files changed, 17286 insertions(+), 17286 deletions(-) delete mode 100644 accessibility/inc/accessibility/extended/AccessibleBrowseBox.hxx delete mode 100644 accessibility/inc/accessibility/extended/AccessibleBrowseBoxBase.hxx delete mode 100644 accessibility/inc/accessibility/extended/AccessibleBrowseBoxCheckBoxCell.hxx delete mode 100644 accessibility/inc/accessibility/extended/AccessibleBrowseBoxHeaderBar.hxx delete mode 100644 accessibility/inc/accessibility/extended/AccessibleBrowseBoxHeaderCell.hxx delete mode 100644 accessibility/inc/accessibility/extended/AccessibleBrowseBoxTable.hxx delete mode 100644 accessibility/inc/accessibility/extended/AccessibleBrowseBoxTableBase.hxx delete mode 100644 accessibility/inc/accessibility/extended/AccessibleBrowseBoxTableCell.hxx delete mode 100644 accessibility/inc/accessibility/extended/AccessibleGridControl.hxx delete mode 100644 accessibility/inc/accessibility/extended/AccessibleGridControlBase.hxx delete mode 100644 accessibility/inc/accessibility/extended/AccessibleGridControlHeader.hxx delete mode 100644 accessibility/inc/accessibility/extended/AccessibleGridControlHeaderCell.hxx delete mode 100644 accessibility/inc/accessibility/extended/AccessibleGridControlTable.hxx delete mode 100644 accessibility/inc/accessibility/extended/AccessibleGridControlTableBase.hxx delete mode 100644 accessibility/inc/accessibility/extended/AccessibleGridControlTableCell.hxx delete mode 100644 accessibility/inc/accessibility/extended/accessiblebrowseboxcell.hxx delete mode 100644 accessibility/inc/accessibility/extended/accessibleeditbrowseboxcell.hxx delete mode 100644 accessibility/inc/accessibility/extended/accessibleiconchoicectrl.hxx delete mode 100644 accessibility/inc/accessibility/extended/accessibleiconchoicectrlentry.hxx delete mode 100644 accessibility/inc/accessibility/extended/accessiblelistbox.hxx delete mode 100644 accessibility/inc/accessibility/extended/accessiblelistboxentry.hxx delete mode 100644 accessibility/inc/accessibility/extended/accessibletabbar.hxx delete mode 100644 accessibility/inc/accessibility/extended/accessibletabbarbase.hxx delete mode 100644 accessibility/inc/accessibility/extended/accessibletabbarpage.hxx delete mode 100644 accessibility/inc/accessibility/extended/accessibletabbarpagelist.hxx delete mode 100644 accessibility/inc/accessibility/extended/accessibletablistbox.hxx delete mode 100644 accessibility/inc/accessibility/extended/accessibletablistboxtable.hxx delete mode 100644 accessibility/inc/accessibility/extended/listboxaccessible.hxx delete mode 100644 accessibility/inc/accessibility/extended/textwindowaccessibility.hxx delete mode 100644 accessibility/inc/accessibility/helper/IComboListBoxHelper.hxx delete mode 100644 accessibility/inc/accessibility/helper/accessiblestrings.hrc delete mode 100644 accessibility/inc/accessibility/helper/accresmgr.hxx delete mode 100644 accessibility/inc/accessibility/helper/characterattributeshelper.hxx delete mode 100644 accessibility/inc/accessibility/helper/listboxhelper.hxx delete mode 100644 accessibility/inc/accessibility/standard/accessiblemenubasecomponent.hxx delete mode 100644 accessibility/inc/accessibility/standard/accessiblemenucomponent.hxx delete mode 100644 accessibility/inc/accessibility/standard/accessiblemenuitemcomponent.hxx delete mode 100644 accessibility/inc/accessibility/standard/vclxaccessiblebox.hxx delete mode 100644 accessibility/inc/accessibility/standard/vclxaccessiblebutton.hxx delete mode 100644 accessibility/inc/accessibility/standard/vclxaccessiblecheckbox.hxx delete mode 100644 accessibility/inc/accessibility/standard/vclxaccessiblecombobox.hxx delete mode 100644 accessibility/inc/accessibility/standard/vclxaccessibledropdowncombobox.hxx delete mode 100644 accessibility/inc/accessibility/standard/vclxaccessibledropdownlistbox.hxx delete mode 100644 accessibility/inc/accessibility/standard/vclxaccessibleedit.hxx delete mode 100644 accessibility/inc/accessibility/standard/vclxaccessiblefixedhyperlink.hxx delete mode 100644 accessibility/inc/accessibility/standard/vclxaccessiblefixedtext.hxx delete mode 100644 accessibility/inc/accessibility/standard/vclxaccessiblelist.hxx delete mode 100644 accessibility/inc/accessibility/standard/vclxaccessiblelistbox.hxx delete mode 100644 accessibility/inc/accessibility/standard/vclxaccessiblelistitem.hxx delete mode 100644 accessibility/inc/accessibility/standard/vclxaccessiblemenu.hxx delete mode 100644 accessibility/inc/accessibility/standard/vclxaccessiblemenubar.hxx delete mode 100644 accessibility/inc/accessibility/standard/vclxaccessiblemenuitem.hxx delete mode 100644 accessibility/inc/accessibility/standard/vclxaccessiblemenuseparator.hxx delete mode 100644 accessibility/inc/accessibility/standard/vclxaccessiblepopupmenu.hxx delete mode 100644 accessibility/inc/accessibility/standard/vclxaccessibleradiobutton.hxx delete mode 100644 accessibility/inc/accessibility/standard/vclxaccessiblescrollbar.hxx delete mode 100644 accessibility/inc/accessibility/standard/vclxaccessiblestatusbar.hxx delete mode 100644 accessibility/inc/accessibility/standard/vclxaccessiblestatusbaritem.hxx delete mode 100644 accessibility/inc/accessibility/standard/vclxaccessibletabcontrol.hxx delete mode 100644 accessibility/inc/accessibility/standard/vclxaccessibletabpage.hxx delete mode 100644 accessibility/inc/accessibility/standard/vclxaccessibletabpagewindow.hxx delete mode 100644 accessibility/inc/accessibility/standard/vclxaccessibletextcomponent.hxx delete mode 100644 accessibility/inc/accessibility/standard/vclxaccessibletextfield.hxx delete mode 100644 accessibility/inc/accessibility/standard/vclxaccessibletoolbox.hxx delete mode 100644 accessibility/inc/accessibility/standard/vclxaccessibletoolboxitem.hxx create mode 100644 accessibility/inc/extended/AccessibleBrowseBox.hxx create mode 100644 accessibility/inc/extended/AccessibleBrowseBoxBase.hxx create mode 100644 accessibility/inc/extended/AccessibleBrowseBoxCheckBoxCell.hxx create mode 100644 accessibility/inc/extended/AccessibleBrowseBoxHeaderBar.hxx create mode 100644 accessibility/inc/extended/AccessibleBrowseBoxHeaderCell.hxx create mode 100644 accessibility/inc/extended/AccessibleBrowseBoxTable.hxx create mode 100644 accessibility/inc/extended/AccessibleBrowseBoxTableBase.hxx create mode 100644 accessibility/inc/extended/AccessibleBrowseBoxTableCell.hxx create mode 100644 accessibility/inc/extended/AccessibleGridControl.hxx create mode 100644 accessibility/inc/extended/AccessibleGridControlBase.hxx create mode 100644 accessibility/inc/extended/AccessibleGridControlHeader.hxx create mode 100644 accessibility/inc/extended/AccessibleGridControlHeaderCell.hxx create mode 100644 accessibility/inc/extended/AccessibleGridControlTable.hxx create mode 100644 accessibility/inc/extended/AccessibleGridControlTableBase.hxx create mode 100644 accessibility/inc/extended/AccessibleGridControlTableCell.hxx create mode 100644 accessibility/inc/extended/accessiblebrowseboxcell.hxx create mode 100644 accessibility/inc/extended/accessibleeditbrowseboxcell.hxx create mode 100644 accessibility/inc/extended/accessibleiconchoicectrl.hxx create mode 100644 accessibility/inc/extended/accessibleiconchoicectrlentry.hxx create mode 100644 accessibility/inc/extended/accessiblelistbox.hxx create mode 100644 accessibility/inc/extended/accessiblelistboxentry.hxx create mode 100644 accessibility/inc/extended/accessibletabbar.hxx create mode 100644 accessibility/inc/extended/accessibletabbarbase.hxx create mode 100644 accessibility/inc/extended/accessibletabbarpage.hxx create mode 100644 accessibility/inc/extended/accessibletabbarpagelist.hxx create mode 100644 accessibility/inc/extended/accessibletablistbox.hxx create mode 100644 accessibility/inc/extended/accessibletablistboxtable.hxx create mode 100644 accessibility/inc/extended/listboxaccessible.hxx create mode 100644 accessibility/inc/extended/textwindowaccessibility.hxx create mode 100644 accessibility/inc/helper/IComboListBoxHelper.hxx create mode 100644 accessibility/inc/helper/accessiblestrings.hrc create mode 100644 accessibility/inc/helper/accresmgr.hxx create mode 100644 accessibility/inc/helper/characterattributeshelper.hxx create mode 100644 accessibility/inc/helper/listboxhelper.hxx create mode 100644 accessibility/inc/standard/accessiblemenubasecomponent.hxx create mode 100644 accessibility/inc/standard/accessiblemenucomponent.hxx create mode 100644 accessibility/inc/standard/accessiblemenuitemcomponent.hxx create mode 100644 accessibility/inc/standard/vclxaccessiblebox.hxx create mode 100644 accessibility/inc/standard/vclxaccessiblebutton.hxx create mode 100644 accessibility/inc/standard/vclxaccessiblecheckbox.hxx create mode 100644 accessibility/inc/standard/vclxaccessiblecombobox.hxx create mode 100644 accessibility/inc/standard/vclxaccessibledropdowncombobox.hxx create mode 100644 accessibility/inc/standard/vclxaccessibledropdownlistbox.hxx create mode 100644 accessibility/inc/standard/vclxaccessibleedit.hxx create mode 100644 accessibility/inc/standard/vclxaccessiblefixedhyperlink.hxx create mode 100644 accessibility/inc/standard/vclxaccessiblefixedtext.hxx create mode 100644 accessibility/inc/standard/vclxaccessiblelist.hxx create mode 100644 accessibility/inc/standard/vclxaccessiblelistbox.hxx create mode 100644 accessibility/inc/standard/vclxaccessiblelistitem.hxx create mode 100644 accessibility/inc/standard/vclxaccessiblemenu.hxx create mode 100644 accessibility/inc/standard/vclxaccessiblemenubar.hxx create mode 100644 accessibility/inc/standard/vclxaccessiblemenuitem.hxx create mode 100644 accessibility/inc/standard/vclxaccessiblemenuseparator.hxx create mode 100644 accessibility/inc/standard/vclxaccessiblepopupmenu.hxx create mode 100644 accessibility/inc/standard/vclxaccessibleradiobutton.hxx create mode 100644 accessibility/inc/standard/vclxaccessiblescrollbar.hxx create mode 100644 accessibility/inc/standard/vclxaccessiblestatusbar.hxx create mode 100644 accessibility/inc/standard/vclxaccessiblestatusbaritem.hxx create mode 100644 accessibility/inc/standard/vclxaccessibletabcontrol.hxx create mode 100644 accessibility/inc/standard/vclxaccessibletabpage.hxx create mode 100644 accessibility/inc/standard/vclxaccessibletabpagewindow.hxx create mode 100644 accessibility/inc/standard/vclxaccessibletextcomponent.hxx create mode 100644 accessibility/inc/standard/vclxaccessibletextfield.hxx create mode 100644 accessibility/inc/standard/vclxaccessibletoolbox.hxx create mode 100644 accessibility/inc/standard/vclxaccessibletoolboxitem.hxx create mode 100644 bridges/inc/arraypointer.hxx create mode 100644 bridges/inc/bridge.hxx delete mode 100644 bridges/inc/bridges/cpp_uno/shared/arraypointer.hxx delete mode 100644 bridges/inc/bridges/cpp_uno/shared/bridge.hxx delete mode 100644 bridges/inc/bridges/cpp_uno/shared/cppinterfaceproxy.hxx delete mode 100644 bridges/inc/bridges/cpp_uno/shared/except.hxx delete mode 100644 bridges/inc/bridges/cpp_uno/shared/types.hxx delete mode 100644 bridges/inc/bridges/cpp_uno/shared/unointerfaceproxy.hxx delete mode 100644 bridges/inc/bridges/cpp_uno/shared/vtablefactory.hxx delete mode 100644 bridges/inc/bridges/cpp_uno/shared/vtables.hxx create mode 100644 bridges/inc/cppinterfaceproxy.hxx create mode 100644 bridges/inc/except.hxx create mode 100644 bridges/inc/types.hxx create mode 100644 bridges/inc/unointerfaceproxy.hxx create mode 100644 bridges/inc/vtablefactory.hxx create mode 100644 bridges/inc/vtables.hxx create mode 100644 idlc/inc/astattribute.hxx create mode 100644 idlc/inc/astbasetype.hxx create mode 100644 idlc/inc/astconstant.hxx create mode 100644 idlc/inc/astconstants.hxx create mode 100644 idlc/inc/astdeclaration.hxx create mode 100644 idlc/inc/astenum.hxx create mode 100644 idlc/inc/astexception.hxx create mode 100644 idlc/inc/astexpression.hxx create mode 100644 idlc/inc/astinterface.hxx create mode 100644 idlc/inc/astinterfacemember.hxx create mode 100644 idlc/inc/astmember.hxx create mode 100644 idlc/inc/astmodule.hxx create mode 100644 idlc/inc/astneeds.hxx create mode 100644 idlc/inc/astobserves.hxx create mode 100644 idlc/inc/astoperation.hxx create mode 100644 idlc/inc/astparameter.hxx create mode 100644 idlc/inc/astscope.hxx create mode 100644 idlc/inc/astsequence.hxx create mode 100644 idlc/inc/astservice.hxx create mode 100644 idlc/inc/astservicemember.hxx create mode 100644 idlc/inc/aststack.hxx create mode 100644 idlc/inc/aststruct.hxx create mode 100644 idlc/inc/aststructinstance.hxx create mode 100644 idlc/inc/asttype.hxx create mode 100644 idlc/inc/asttypedef.hxx create mode 100644 idlc/inc/errorhandler.hxx create mode 100644 idlc/inc/fehelper.hxx create mode 100644 idlc/inc/idlc.hxx delete mode 100644 idlc/inc/idlc/astattribute.hxx delete mode 100644 idlc/inc/idlc/astbasetype.hxx delete mode 100644 idlc/inc/idlc/astconstant.hxx delete mode 100644 idlc/inc/idlc/astconstants.hxx delete mode 100644 idlc/inc/idlc/astdeclaration.hxx delete mode 100644 idlc/inc/idlc/astenum.hxx delete mode 100644 idlc/inc/idlc/astexception.hxx delete mode 100644 idlc/inc/idlc/astexpression.hxx delete mode 100644 idlc/inc/idlc/astinterface.hxx delete mode 100644 idlc/inc/idlc/astinterfacemember.hxx delete mode 100644 idlc/inc/idlc/astmember.hxx delete mode 100644 idlc/inc/idlc/astmodule.hxx delete mode 100644 idlc/inc/idlc/astneeds.hxx delete mode 100644 idlc/inc/idlc/astobserves.hxx delete mode 100644 idlc/inc/idlc/astoperation.hxx delete mode 100644 idlc/inc/idlc/astparameter.hxx delete mode 100644 idlc/inc/idlc/astscope.hxx delete mode 100644 idlc/inc/idlc/astsequence.hxx delete mode 100644 idlc/inc/idlc/astservice.hxx delete mode 100644 idlc/inc/idlc/astservicemember.hxx delete mode 100644 idlc/inc/idlc/aststack.hxx delete mode 100644 idlc/inc/idlc/aststruct.hxx delete mode 100644 idlc/inc/idlc/aststructinstance.hxx delete mode 100644 idlc/inc/idlc/asttype.hxx delete mode 100644 idlc/inc/idlc/asttypedef.hxx delete mode 100644 idlc/inc/idlc/errorhandler.hxx delete mode 100644 idlc/inc/idlc/fehelper.hxx delete mode 100644 idlc/inc/idlc/idlc.hxx delete mode 100644 idlc/inc/idlc/idlctypes.hxx delete mode 100644 idlc/inc/idlc/inheritedinterface.hxx delete mode 100644 idlc/inc/idlc/options.hxx create mode 100644 idlc/inc/idlctypes.hxx create mode 100644 idlc/inc/inheritedinterface.hxx create mode 100644 idlc/inc/options.hxx create mode 100644 pyuno/inc/pyuno.hxx delete mode 100644 pyuno/inc/pyuno/pyuno.hxx create mode 100644 svgio/inc/svganode.hxx create mode 100644 svgio/inc/svgcharacternode.hxx create mode 100644 svgio/inc/svgcirclenode.hxx create mode 100644 svgio/inc/svgclippathnode.hxx create mode 100644 svgio/inc/svgdocument.hxx create mode 100644 svgio/inc/svgdocumenthandler.hxx create mode 100644 svgio/inc/svgellipsenode.hxx create mode 100644 svgio/inc/svggnode.hxx create mode 100644 svgio/inc/svggradientnode.hxx create mode 100644 svgio/inc/svggradientstopnode.hxx create mode 100644 svgio/inc/svgimagenode.hxx delete mode 100644 svgio/inc/svgio/svgreader/svganode.hxx delete mode 100644 svgio/inc/svgio/svgreader/svgcharacternode.hxx delete mode 100644 svgio/inc/svgio/svgreader/svgcirclenode.hxx delete mode 100644 svgio/inc/svgio/svgreader/svgclippathnode.hxx delete mode 100644 svgio/inc/svgio/svgreader/svgdocument.hxx delete mode 100644 svgio/inc/svgio/svgreader/svgdocumenthandler.hxx delete mode 100644 svgio/inc/svgio/svgreader/svgellipsenode.hxx delete mode 100644 svgio/inc/svgio/svgreader/svggnode.hxx delete mode 100644 svgio/inc/svgio/svgreader/svggradientnode.hxx delete mode 100644 svgio/inc/svgio/svgreader/svggradientstopnode.hxx delete mode 100644 svgio/inc/svgio/svgreader/svgimagenode.hxx delete mode 100644 svgio/inc/svgio/svgreader/svglinenode.hxx delete mode 100644 svgio/inc/svgio/svgreader/svgmarkernode.hxx delete mode 100644 svgio/inc/svgio/svgreader/svgmasknode.hxx delete mode 100644 svgio/inc/svgio/svgreader/svgnode.hxx delete mode 100644 svgio/inc/svgio/svgreader/svgpaint.hxx delete mode 100644 svgio/inc/svgio/svgreader/svgpathnode.hxx delete mode 100644 svgio/inc/svgio/svgreader/svgpatternnode.hxx delete mode 100644 svgio/inc/svgio/svgreader/svgpolynode.hxx delete mode 100644 svgio/inc/svgio/svgreader/svgrectnode.hxx delete mode 100644 svgio/inc/svgio/svgreader/svgstyleattributes.hxx delete mode 100644 svgio/inc/svgio/svgreader/svgstylenode.hxx delete mode 100644 svgio/inc/svgio/svgreader/svgsvgnode.hxx delete mode 100644 svgio/inc/svgio/svgreader/svgsymbolnode.hxx delete mode 100644 svgio/inc/svgio/svgreader/svgtextnode.hxx delete mode 100644 svgio/inc/svgio/svgreader/svgtextpathnode.hxx delete mode 100644 svgio/inc/svgio/svgreader/svgtitledescnode.hxx delete mode 100644 svgio/inc/svgio/svgreader/svgtoken.hxx delete mode 100644 svgio/inc/svgio/svgreader/svgtools.hxx delete mode 100644 svgio/inc/svgio/svgreader/svgtrefnode.hxx delete mode 100644 svgio/inc/svgio/svgreader/svgtspannode.hxx delete mode 100644 svgio/inc/svgio/svgreader/svgusenode.hxx create mode 100644 svgio/inc/svglinenode.hxx create mode 100644 svgio/inc/svgmarkernode.hxx create mode 100644 svgio/inc/svgmasknode.hxx create mode 100644 svgio/inc/svgnode.hxx create mode 100644 svgio/inc/svgpaint.hxx create mode 100644 svgio/inc/svgpathnode.hxx create mode 100644 svgio/inc/svgpatternnode.hxx create mode 100644 svgio/inc/svgpolynode.hxx create mode 100644 svgio/inc/svgrectnode.hxx create mode 100644 svgio/inc/svgstyleattributes.hxx create mode 100644 svgio/inc/svgstylenode.hxx create mode 100644 svgio/inc/svgsvgnode.hxx create mode 100644 svgio/inc/svgsymbolnode.hxx create mode 100644 svgio/inc/svgtextnode.hxx create mode 100644 svgio/inc/svgtextpathnode.hxx create mode 100644 svgio/inc/svgtitledescnode.hxx create mode 100644 svgio/inc/svgtoken.hxx create mode 100644 svgio/inc/svgtools.hxx create mode 100644 svgio/inc/svgtrefnode.hxx create mode 100644 svgio/inc/svgtspannode.hxx create mode 100644 svgio/inc/svgusenode.hxx create mode 100644 unodevtools/inc/options.hxx delete mode 100644 unodevtools/inc/unodevtools/options.hxx create mode 100644 xmlsecurity/inc/biginteger.hxx create mode 100644 xmlsecurity/inc/certificatechooser.hxx create mode 100644 xmlsecurity/inc/certificateviewer.hxx create mode 100644 xmlsecurity/inc/digitalsignaturesdialog.hxx create mode 100644 xmlsecurity/inc/documentsignaturehelper.hxx create mode 100644 xmlsecurity/inc/global.hrc create mode 100644 xmlsecurity/inc/macrosecurity.hxx create mode 100644 xmlsecurity/inc/sigstruct.hxx create mode 100644 xmlsecurity/inc/xmlsec-wrapper.h delete mode 100644 xmlsecurity/inc/xmlsecurity/biginteger.hxx delete mode 100644 xmlsecurity/inc/xmlsecurity/certificatechooser.hxx delete mode 100644 xmlsecurity/inc/xmlsecurity/certificateviewer.hxx delete mode 100644 xmlsecurity/inc/xmlsecurity/digitalsignaturesdialog.hxx delete mode 100644 xmlsecurity/inc/xmlsecurity/documentsignaturehelper.hxx delete mode 100644 xmlsecurity/inc/xmlsecurity/global.hrc delete mode 100644 xmlsecurity/inc/xmlsecurity/macrosecurity.hxx delete mode 100644 xmlsecurity/inc/xmlsecurity/sigstruct.hxx delete mode 100644 xmlsecurity/inc/xmlsecurity/xmlsec-wrapper.h delete mode 100644 xmlsecurity/inc/xmlsecurity/xmlsignaturehelper.hxx create mode 100644 xmlsecurity/inc/xmlsignaturehelper.hxx diff --git a/accessibility/inc/accessibility/extended/AccessibleBrowseBox.hxx b/accessibility/inc/accessibility/extended/AccessibleBrowseBox.hxx deleted file mode 100644 index 927b77aebb0c..000000000000 --- a/accessibility/inc/accessibility/extended/AccessibleBrowseBox.hxx +++ /dev/null @@ -1,289 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEBROWSEBOX_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEBROWSEBOX_HXX - -#include -#include -#include -#include -#include - -namespace accessibility { - - class AccessibleBrowseBoxImpl; - class AccessibleBrowseBoxTable; - - -/** This class represents the complete accessible BrowseBox object. */ -class AccessibleBrowseBox : public AccessibleBrowseBoxBase -{ - friend class AccessibleBrowseBoxAccess; - -protected: - AccessibleBrowseBox( - const css::uno::Reference< css::accessibility::XAccessible >& _rxParent, - const css::uno::Reference< css::accessibility::XAccessible >& _rxCreator, - ::svt::IAccessibleTableProvider& _rBrowseBox - ); - - virtual ~AccessibleBrowseBox(); - - /** sets the XAccessible which created the context - - To be called only once, and only if in the ctor NULL was passed. - */ - void setCreator( - const css::uno::Reference< css::accessibility::XAccessible >& _rxCreator - ); - - /** Cleans up members. */ - using AccessibleBrowseBoxBase::disposing; - virtual void SAL_CALL disposing() override; - -protected: - // XAccessibleContext - - /** @return The count of visible children. */ - virtual sal_Int32 SAL_CALL getAccessibleChildCount() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return The XAccessible interface of the specified child. */ - virtual css::uno::Reference< - css::accessibility::XAccessible > SAL_CALL - getAccessibleChild( sal_Int32 nChildIndex ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - // XAccessibleComponent - - /** @return - The accessible child rendered under the given point. - */ - virtual css::uno::Reference< - css::accessibility::XAccessible > SAL_CALL - getAccessibleAtPoint( const css::awt::Point& rPoint ) - throw ( css::uno::RuntimeException, std::exception ) override; - - /** Grabs the focus to the BrowseBox. */ - virtual void SAL_CALL grabFocus() - throw ( css::uno::RuntimeException, std::exception ) override; - - // XServiceInfo - - /** @return - The name of this class. - */ - virtual OUString SAL_CALL getImplementationName() - throw ( css::uno::RuntimeException, std::exception ) override; - -public: - // helper functions - /** commitHeaderBarEvent commit the event at all listeners of the column/row header bar - @param nEventId - the event id - @param rNewValue - the new value - @param rOldValue - the old value - @param _bColumnHeaderBar - true if a column based header bar, false if a row based header bar - */ - void commitHeaderBarEvent(sal_Int16 nEventId, - const css::uno::Any& rNewValue, - const css::uno::Any& rOldValue,bool _bColumnHeaderBar = true); - - // helper functions - /** commitTableEvent commit the event at all listeners of the table - @param nEventId - the event id - @param rNewValue - the new value - @param rOldValue - the old value - */ - void commitTableEvent(sal_Int16 nEventId, - const css::uno::Any& rNewValue, - const css::uno::Any& rOldValue); - - /** returns the accessible object for the row or the column header bar - */ - inline css::uno::Reference< - css::accessibility::XAccessible > - getHeaderBar( ::svt::AccessibleBrowseBoxObjType _eObjType ) - { - return implGetHeaderBar(_eObjType); - } - - /** returns the accessible object for the table representation - */ - inline css::uno::Reference< - css::accessibility::XAccessible > - getTable( ) - { - return implGetTable(); - } - -protected: - // internal virtual methods - - /** @attention This method requires locked mutex's and a living object. - @return The bounding box (VCL rect.) relative to the parent window. */ - virtual Rectangle implGetBoundingBox() override; - /** @attention This method requires locked mutex's and a living object. - @return The bounding box (VCL rect.) in screen coordinates. */ - virtual Rectangle implGetBoundingBoxOnScreen() override; - - // internal helper methods - - /** This method creates (once) and returns the accessible data table child. - @attention This method requires locked mutex's and a living object. - @return The XAccessible interface of the data table. */ - css::uno::Reference< - css::accessibility::XAccessible > implGetTable(); - - /** This method creates (once) and returns the specified header bar. - @attention This method requires locked mutex's and a living object. - @return The XAccessible interface of the header bar. */ - css::uno::Reference< - css::accessibility::XAccessible > - implGetHeaderBar( ::svt::AccessibleBrowseBoxObjType eObjType ); - - /** This method returns one of the children that are always present: - Data table, row and column header bar or corner control. - @attention This method requires locked mutex's and a living object. - @return The XAccessible interface of the specified child. */ - css::uno::Reference< - css::accessibility::XAccessible > - implGetFixedChild( sal_Int32 nChildIndex ); - - /** This method creates and returns an accessible table. - @return An AccessibleBrowseBoxTable. */ - virtual AccessibleBrowseBoxTable* createAccessibleTable(); - -private: - // members - std::unique_ptr< AccessibleBrowseBoxImpl > m_xImpl; -}; - - -/** the XAccessible which creates/returns an AccessibleBrowseBox - - The instance holds its XAccessibleContext with a hard reference, while - the context holds this instance weak. -*/ -class AccessibleBrowseBoxAccess: - public cppu::WeakImplHelper, - public ::svt::IAccessibleBrowseBox -{ -private: - ::osl::Mutex m_aMutex; - css::uno::Reference< css::accessibility::XAccessible > - m_xParent; - ::svt::IAccessibleTableProvider& m_rBrowseBox; - - css::uno::Reference< css::accessibility::XAccessibleContext > - m_xContext; - AccessibleBrowseBox* m_pContext; - // note that this pointer is valid as long as m_xContext is valid! - -public: - AccessibleBrowseBoxAccess( - const css::uno::Reference< css::accessibility::XAccessible >& _rxParent, - ::svt::IAccessibleTableProvider& _rBrowseBox - ); - - /// checks whether the accessible context is still alive - bool isContextAlive() const; - - /// returns the AccessibleContext belonging to this Accessible - inline AccessibleBrowseBox* getContext() { return m_pContext; } - -protected: - virtual ~AccessibleBrowseBoxAccess(); - - // XAccessible - virtual css::uno::Reference< css::accessibility::XAccessibleContext > - SAL_CALL getAccessibleContext() throw ( css::uno::RuntimeException, std::exception ) override; - - // IAccessibleBrowseBox - virtual css::uno::Reference< css::accessibility::XAccessible > - getMyself() override - { - return this; - } - void dispose() override; - virtual bool isAlive() const override - { - return isContextAlive(); - } - virtual css::uno::Reference< css::accessibility::XAccessible > - getHeaderBar( ::svt::AccessibleBrowseBoxObjType _eObjType ) override - { - css::uno::Reference< css::accessibility::XAccessible > xAccessible; - AccessibleBrowseBox* pContext( getContext() ); - if ( pContext ) - xAccessible = pContext->getHeaderBar( _eObjType ); - return xAccessible; - } - virtual css::uno::Reference< css::accessibility::XAccessible > - getTable() override - { - css::uno::Reference< css::accessibility::XAccessible > xAccessible; - AccessibleBrowseBox* pContext( getContext() ); - if ( pContext ) - xAccessible = pContext->getTable(); - return xAccessible; - } - virtual void commitHeaderBarEvent( sal_Int16 nEventId, const css::uno::Any& rNewValue, - const css::uno::Any& rOldValue, bool _bColumnHeaderBar ) override - { - AccessibleBrowseBox* pContext( getContext() ); - if ( pContext ) - pContext->commitHeaderBarEvent( nEventId, rNewValue, rOldValue, _bColumnHeaderBar ); - } - virtual void commitTableEvent( sal_Int16 nEventId, - const css::uno::Any& rNewValue, const css::uno::Any& rOldValue ) override - { - AccessibleBrowseBox* pContext( getContext() ); - if ( pContext ) - pContext->commitTableEvent( nEventId, rNewValue, rOldValue ); - } - virtual void commitEvent( sal_Int16 nEventId, - const css::uno::Any& rNewValue, const css::uno::Any& rOldValue ) override - { - AccessibleBrowseBox* pContext( getContext() ); - if ( pContext ) - pContext->commitEvent( nEventId, rNewValue, rOldValue ); - } - -private: - AccessibleBrowseBoxAccess( const AccessibleBrowseBoxAccess& ) = delete; - AccessibleBrowseBoxAccess& operator=( const AccessibleBrowseBoxAccess& ) = delete; -}; - - -} // namespace accessibility - - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/extended/AccessibleBrowseBoxBase.hxx b/accessibility/inc/accessibility/extended/AccessibleBrowseBoxBase.hxx deleted file mode 100644 index fe2035f5cc4d..000000000000 --- a/accessibility/inc/accessibility/extended/AccessibleBrowseBoxBase.hxx +++ /dev/null @@ -1,447 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEBROWSEBOXBASE_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEBROWSEBOXBASE_HXX - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -namespace vcl { class Window; } - -namespace utl { - class AccessibleStateSetHelper; -} - -namespace svt { - class IAccessibleTableProvider; -} - -namespace accessibility { - -typedef ::cppu::WeakAggComponentImplHelper5< - css::accessibility::XAccessibleContext, - css::accessibility::XAccessibleComponent, - css::accessibility::XAccessibleEventBroadcaster, - css::awt::XFocusListener, - css::lang::XServiceInfo > - AccessibleBrowseBoxImplHelper; - -/** The BrowseBox accessible objects inherit from this base class. It - implements basic functionality for various Accessibility interfaces and - the event broadcaster and contains the osl::Mutex. */ -class AccessibleBrowseBoxBase : - public ::comphelper::OBaseMutex, - public AccessibleBrowseBoxImplHelper -{ -public: - /** Constructor sets specified name and description. If the constant of a - text is BBTEXT_NONE, the derived class has to set the text via - implSetName() (in Ctor) or later via - setAccessibleName() and setAccessibleDescription() (these methods - notify the listeners about the change). - - @param rxParent XAccessible interface of the parent object. - @param rBrowseBox The BrowseBox control. - @param _xFocusWindow The window that gets all the focus events. - @param eObjType Object type */ - AccessibleBrowseBoxBase( - const css::uno::Reference< css::accessibility::XAccessible >& rxParent, - ::svt::IAccessibleTableProvider& rBrowseBox, - const css::uno::Reference< css::awt::XWindow >& _xFocusWindow, - ::svt::AccessibleBrowseBoxObjType eObjType ); - - /** Constructor sets specified name and description. - @param rxParent XAccessible interface of the parent object. - @param rBrowseBox The BrowseBox control. - @param _xFocusWindow The window that gets all the focus events. - @param eObjType Object type - @param rName The name of this object. - @param rDescription The description text of this object. */ - AccessibleBrowseBoxBase( - const css::uno::Reference< css::accessibility::XAccessible >& rxParent, - ::svt::IAccessibleTableProvider& rBrowseBox, - const css::uno::Reference< css::awt::XWindow >& _xFocusWindow, - ::svt::AccessibleBrowseBoxObjType eObjType, - const OUString& rName, - const OUString& rDescription ); - -protected: - virtual ~AccessibleBrowseBoxBase(); - - /** Commits DeFunc event to listeners and cleans up members. */ - virtual void SAL_CALL disposing() override; - -public: - // XAccessibleContext - - /** @return A reference to the parent accessible object. */ - virtual css::uno::Reference SAL_CALL getAccessibleParent() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return The index of this object among the parent's children. */ - virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return - The description of this object. - */ - virtual OUString SAL_CALL getAccessibleDescription() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return - The name of this object. - */ - virtual OUString SAL_CALL getAccessibleName() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return - The relation set (the BrowseBox does not have one). - */ - virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return The set of current states. */ - virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return The parent's locale. */ - virtual css::lang::Locale SAL_CALL getLocale() - throw ( css::accessibility::IllegalAccessibleComponentStateException, - css::uno::RuntimeException, std::exception ) override; - - /** @return - The role of this object. Panel, ROWHEADER, COLUMNHEADER, TABLE, TABLE_CELL are supported. - */ - virtual sal_Int16 SAL_CALL getAccessibleRole() - throw ( css::uno::RuntimeException, std::exception ) override; - - /* Derived classes have to implement: - - getAccessibleChildCount, - - getAccessibleChild, - - getAccessibleRole. - Derived classes may overwrite getAccessibleIndexInParent to increase - performance. */ - - // XAccessibleComponent - - /** @return - TRUE, if the point lies within the bounding box of this object. */ - virtual sal_Bool SAL_CALL containsPoint( const css::awt::Point& rPoint ) - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return The bounding box of this object. */ - virtual css::awt::Rectangle SAL_CALL getBounds() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return - The upper left corner of the bounding box relative to the parent. */ - virtual css::awt::Point SAL_CALL getLocation() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return - The upper left corner of the bounding box in screen coordinates. */ - virtual css::awt::Point SAL_CALL getLocationOnScreen() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return The size of the bounding box. */ - virtual css::awt::Size SAL_CALL getSize() - throw ( css::uno::RuntimeException, std::exception ) override; - - virtual sal_Int32 SAL_CALL getForeground( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getBackground( ) throw (css::uno::RuntimeException, std::exception) override; - - // XFocusListener - virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) throw (css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL focusGained( const css::awt::FocusEvent& e ) throw (css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL focusLost( const css::awt::FocusEvent& e ) throw (css::uno::RuntimeException, std::exception) override; - - /* Derived classes have to implement: - - getAccessibleAt, - - grabFocus. */ - - /** @return - The accessible child rendered under the given point. - */ - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& rPoint ) - throw ( css::uno::RuntimeException, std::exception ) override; - - // XAccessibleEventBroadcaster - - /** Adds a new event listener */ - virtual void SAL_CALL addAccessibleEventListener( - const css::uno::Reference< css::accessibility::XAccessibleEventListener>& rxListener ) - throw ( css::uno::RuntimeException, std::exception ) override; - - /** Removes an event listener. */ - virtual void SAL_CALL removeAccessibleEventListener( - const css::uno::Reference< css::accessibility::XAccessibleEventListener>& rxListener ) - throw ( css::uno::RuntimeException, std::exception ) override; - - // XTypeProvider - - /** @return An unique implementation ID. */ - virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() - throw ( css::uno::RuntimeException, std::exception ) override; - - // XServiceInfo - - /** @return Whether the specified service is supported by this class. */ - virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return A list of all supported services. */ - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() - throw ( css::uno::RuntimeException, std::exception ) override; - - /* Derived classes have to implement: - - getImplementationName. */ - - // helper methods - - /** @return The BrowseBox object type. */ - inline ::svt::AccessibleBrowseBoxObjType getType() const; - - /** Changes the name of the object and notifies listeners. */ - void setAccessibleName( const OUString& rName ); - /** Changes the description of the object and notifies listeners. */ - void setAccessibleDescription( const OUString& rDescription ); - - /** Commits an event to all listeners. */ - void commitEvent( - sal_Int16 nEventId, - const css::uno::Any& rNewValue, - const css::uno::Any& rOldValue ); - /** @return TRUE, if the object is not disposed or disposing. */ - bool isAlive() const; - -protected: - // internal virtual methods - - /** Determines whether the BrowseBox control is really showing inside of - its parent accessible window. Derived classes may implement different - behaviour. - @attention This method requires locked mutex's and a living object. - @return TRUE, if the object is really showing. */ - bool implIsShowing(); - - /** Derived classes return the bounding box relative to the parent window. - @attention This method requires locked mutex's and a living object. - @return The bounding box (VCL rect.) relative to the parent window. */ - virtual Rectangle implGetBoundingBox() = 0; - /** Derived classes return the bounding box in screen coordinates. - @attention This method requires locked mutex's and a living object. - @return The bounding box (VCL rect.) in screen coordinates. */ - virtual Rectangle implGetBoundingBoxOnScreen() = 0; - - /** Creates a new AccessibleStateSetHelper and fills it with states of the - current object. This method calls FillStateSet at the BrowseBox which - fills it with more states depending on the object type. Derived classes - may overwrite this method and add more states. - @attention This method requires locked mutex's. - @return A filled AccessibleStateSetHelper. */ - virtual ::utl::AccessibleStateSetHelper* implCreateStateSetHelper(); - - // internal helper methods - - /** @throws DisposedException If the object is not alive. */ - void ensureIsAlive() const - throw ( css::lang::DisposedException ); - - /** @return The osl::Mutex member provided by the class OBaseMutex. */ - inline ::osl::Mutex& getOslMutex(); - - /** Changes the name of the object (flat assignment, no notify). - @attention This method requires a locked mutex. */ - inline void implSetName( const OUString& rName ); - - /** Locks all mutex's and calculates the bounding box relative to the - parent window. - @return The bounding box (VCL rect.) relative to the parent object. */ - Rectangle getBoundingBox() - throw ( css::lang::DisposedException ); - /** Locks all mutex's and calculates the bounding box in screen - coordinates. - @return The bounding box (VCL rect.) in screen coordinates. */ - Rectangle getBoundingBoxOnScreen() - throw ( css::lang::DisposedException ); - - ::comphelper::AccessibleEventNotifier::TClientId getClientId() const { return m_aClientId; } - void setClientId(::comphelper::AccessibleEventNotifier::TClientId _aNewClientId) { m_aClientId = _aNewClientId; } - -public: - // public versions of internal helper methods, with access control - struct AccessControl { friend class SolarMethodGuard; private: AccessControl() { } }; - - inline ::osl::Mutex& getMutex( const AccessControl& ) { return getOslMutex(); } - inline void ensureIsAlive( const AccessControl& ) { ensureIsAlive(); } - -protected: - // members - - /** The parent accessible object. */ - css::uno::Reference< css::accessibility::XAccessible > mxParent; - /** The VCL BrowseBox control. */ - ::svt::IAccessibleTableProvider* mpBrowseBox; - - /** This is the window which get all the nice focus events - */ - css::uno::Reference< css::awt::XWindow > m_xFocusWindow; - -private: - /** Localized name. */ - OUString maName; - /** Localized description text. */ - OUString maDescription; - - /** The type of this object (for names, descriptions, state sets, ...). */ - ::svt::AccessibleBrowseBoxObjType meObjType; - - ::comphelper::AccessibleEventNotifier::TClientId m_aClientId; -}; - - -// a version of AccessibleBrowseBoxBase which implements not only the XAccessibleContext, -// but also the XAccessible - -typedef ::cppu::ImplHelper1 < css::accessibility::XAccessible - > BrowseBoxAccessibleElement_Base; - -class BrowseBoxAccessibleElement - :public AccessibleBrowseBoxBase - ,public BrowseBoxAccessibleElement_Base -{ -protected: - /** Constructor sets specified name and description. If the constant of a - text is BBTEXT_NONE, the derived class has to set the text via - implSetName() (in Ctor) or later via - setAccessibleName() and setAccessibleDescription() (these methods - notify the listeners about the change). - - @param rxParent XAccessible interface of the parent object. - @param rBrowseBox The BrowseBox control. - @param _xFocusWindow The window that gets all the focus events. - @param eObjType Object type - */ - BrowseBoxAccessibleElement( - const css::uno::Reference< css::accessibility::XAccessible >& rxParent, - ::svt::IAccessibleTableProvider& rBrowseBox, - const css::uno::Reference< css::awt::XWindow >& _xFocusWindow, - ::svt::AccessibleBrowseBoxObjType eObjType ); - - /** Constructor sets specified name and description. - - @param rxParent XAccessible interface of the parent object. - @param rBrowseBox The BrowseBox control. - @param _xFocusWindow The window that gets all the focus events. - @param eObjType Object type - @param rName The name of this object. - @param rDescription The description text of this object. - */ - BrowseBoxAccessibleElement( - const css::uno::Reference< css::accessibility::XAccessible >& rxParent, - ::svt::IAccessibleTableProvider& rBrowseBox, - const css::uno::Reference< css::awt::XWindow >& _xFocusWindow, - ::svt::AccessibleBrowseBoxObjType eObjType, - const OUString& rName, - const OUString& rDescription ); - -public: - // noncopyable - BrowseBoxAccessibleElement(const BrowseBoxAccessibleElement&) = delete; - const BrowseBoxAccessibleElement& operator=(const BrowseBoxAccessibleElement&) = delete; - // XInterface - DECLARE_XINTERFACE( ) - // XTypeProvider - DECLARE_XTYPEPROVIDER( ) - -protected: - virtual ~BrowseBoxAccessibleElement(); - -protected: - // XAccessible - - /** @return The XAccessibleContext interface of this object. */ - virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() - throw ( css::uno::RuntimeException, std::exception ) override; -}; - - -// a helper class for protecting methods which need to lock the solar mutex in addition to the own mutex - -typedef ::osl::MutexGuard OslMutexGuard; - -class SolarMethodGuard : public SolarMutexGuard, public OslMutexGuard -{ -public: - inline SolarMethodGuard( AccessibleBrowseBoxBase& _rOwner, bool _bEnsureAlive = true ) - :SolarMutexGuard( ) - ,OslMutexGuard( _rOwner.getMutex( AccessibleBrowseBoxBase::AccessControl() ) ) - { - if ( _bEnsureAlive ) - _rOwner.ensureIsAlive( AccessibleBrowseBoxBase::AccessControl() ); - } -}; - -// inlines - -inline ::svt::AccessibleBrowseBoxObjType AccessibleBrowseBoxBase::getType() const -{ - return meObjType; -} - -inline ::osl::Mutex& AccessibleBrowseBoxBase::getOslMutex() -{ - return m_aMutex; -} - -inline void AccessibleBrowseBoxBase::implSetName( - const OUString& rName ) -{ - maName = rName; -} - -} // namespace accessibility - - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/extended/AccessibleBrowseBoxCheckBoxCell.hxx b/accessibility/inc/accessibility/extended/AccessibleBrowseBoxCheckBoxCell.hxx deleted file mode 100644 index 91a4c13dacdb..000000000000 --- a/accessibility/inc/accessibility/extended/AccessibleBrowseBoxCheckBoxCell.hxx +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEBROWSEBOXCHECKBOXCELL_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEBROWSEBOXCHECKBOXCELL_HXX - -#include -#include -#include -#include "accessibility/extended/accessiblebrowseboxcell.hxx" -#include -#include - -namespace accessibility -{ - - typedef ::cppu::ImplHelper2 < css::accessibility::XAccessible, - css::accessibility::XAccessibleValue - > AccessibleCheckBoxCell_BASE; - - class AccessibleCheckBoxCell : public AccessibleBrowseBoxCell - ,public AccessibleCheckBoxCell_BASE - { - private: - TriState m_eState; - bool m_bIsTriState; - - protected: - virtual ~AccessibleCheckBoxCell() {} - - virtual ::utl::AccessibleStateSetHelper* implCreateStateSetHelper() override; - - public: - AccessibleCheckBoxCell(const css::uno::Reference< css::accessibility::XAccessible >& _rxParent, - ::svt::IAccessibleTableProvider& _rBrowseBox, - const css::uno::Reference< css::awt::XWindow >& _xFocusWindow, - sal_Int32 _nRowPos, - sal_uInt16 _nColPos, - const TriState& _eState, - bool _bIsTriState); - - // XInterface - DECLARE_XINTERFACE( ) - // XTypeProvider - DECLARE_XTYPEPROVIDER( ) - - // XAccessible - virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleContext - virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getImplementationName() throw ( css::uno::RuntimeException, std::exception ) override; - virtual ::sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (css::uno::RuntimeException, std::exception) override; - - - // XAccessibleValue - virtual css::uno::Any SAL_CALL getCurrentValue( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL setCurrentValue( const css::uno::Any& aNumber ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Any SAL_CALL getMaximumValue( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Any SAL_CALL getMinimumValue( ) throw (css::uno::RuntimeException, std::exception) override; - - // internal - void SetChecked( bool _bChecked ); - }; -} -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEBROWSEBOXCHECKBOXCELL_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/extended/AccessibleBrowseBoxHeaderBar.hxx b/accessibility/inc/accessibility/extended/AccessibleBrowseBoxHeaderBar.hxx deleted file mode 100644 index 72011d8daf96..000000000000 --- a/accessibility/inc/accessibility/extended/AccessibleBrowseBoxHeaderBar.hxx +++ /dev/null @@ -1,258 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEBROWSEBOXHEADERBAR_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEBROWSEBOXHEADERBAR_HXX - -#include "accessibility/extended/AccessibleBrowseBoxTableBase.hxx" -#include -#include - - -namespace accessibility { - - -typedef ::cppu::ImplHelper1< css::accessibility::XAccessibleSelection > - AccessibleBrowseBoxHeaderBarImplHelper; - -/** This class represents the accessible object of a header bar of a BrowseBox - control (row or column header bar). This object supports the - XAccessibleSelection interface. Selecting a child of this object selects - complete rows or columns of the data table. */ -class AccessibleBrowseBoxHeaderBar : - public AccessibleBrowseBoxTableBase, - public AccessibleBrowseBoxHeaderBarImplHelper -{ -public: - /** @param rxParent Parent that holds the browsebox headerbar control - @param rBrowseBox The BrowseBox control. - @param eObjType One of the two allowed types BBTYPE_ROWHEADERBAR or - BBTYPE_COLUMNHEADERBAR. */ - AccessibleBrowseBoxHeaderBar( - const css::uno::Reference< css::accessibility::XAccessible >& rxParent, - ::svt::IAccessibleTableProvider& rBrowseBox, - ::svt::AccessibleBrowseBoxObjType eObjType ); - -protected: - virtual ~AccessibleBrowseBoxHeaderBar(); - -public: - // XAccessibleContext - - /** @return - The XAccessible interface of the specified child. - */ - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL - getAccessibleChild( sal_Int32 nChildIndex ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** @return The index of this object among the parent's children. */ - virtual sal_Int32 SAL_CALL - getAccessibleIndexInParent() - throw ( css::uno::RuntimeException, std::exception ) override; - - // XAccessibleComponent - - /** @return The accessible child rendered under the given point. */ - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL - getAccessibleAtPoint( const css::awt::Point& rPoint ) - throw ( css::uno::RuntimeException, std::exception ) override; - - /** Grabs the focus to (the current cell of) the data table. */ - virtual void SAL_CALL grabFocus() - throw ( css::uno::RuntimeException, std::exception ) override; - - // XAccessibleTable - - /** @return The description text of the specified row. */ - virtual OUString SAL_CALL - getAccessibleRowDescription( sal_Int32 nRow ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** @return The description text of the specified column. */ - virtual OUString SAL_CALL getAccessibleColumnDescription( sal_Int32 nColumn ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** @return The XAccessibleTable interface of the row header bar. */ - virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL - getAccessibleRowHeaders() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return The XAccessibleTable interface of the column header bar. */ - virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL - getAccessibleColumnHeaders() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return An index list of completely selected rows. */ - virtual css::uno::Sequence< sal_Int32 > SAL_CALL - getSelectedAccessibleRows() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return An index list of completely selected columns. */ - virtual css::uno::Sequence< sal_Int32 > SAL_CALL - getSelectedAccessibleColumns() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return TRUE, if the specified row is completely selected. */ - virtual sal_Bool SAL_CALL isAccessibleRowSelected( sal_Int32 nRow ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** @return TRUE, if the specified column is completely selected. */ - virtual sal_Bool SAL_CALL isAccessibleColumnSelected( sal_Int32 nColumn ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** @return The XAccessible interface of the cell object at the specified - cell position. */ - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL - getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** @return TRUE, if the specified cell is selected. */ - virtual sal_Bool SAL_CALL isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - // XAccessibleSelection - - /** Selects the specified child (row or column of the table). */ - virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** @return TRUE, if the specified child (row/column) is selected. */ - virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** Clears the complete selection. */ - virtual void SAL_CALL clearAccessibleSelection() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** Selects all children or first, if multiselection is not supported. */ - virtual void SAL_CALL selectAllAccessibleChildren() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return The number of selected rows/columns. */ - virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return The specified selected row/column. */ - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL - getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** Removes the specified row/column from the selection. */ - virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - // XInterface - - /** Queries for a new interface. */ - css::uno::Any SAL_CALL queryInterface( const css::uno::Type& rType ) - throw ( css::uno::RuntimeException, std::exception ) override; - - /** Aquires the object (calls acquire() on base class). */ - virtual void SAL_CALL acquire() throw () override; - - /** Releases the object (calls release() on base class). */ - virtual void SAL_CALL release() throw () override; - - // XServiceInfo - - /** @return The name of this class. */ - virtual OUString SAL_CALL getImplementationName() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return An unique implementation ID. */ - virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() - throw ( css::uno::RuntimeException, std::exception ) override; - -protected: - // internal virtual methods - - /** @attention This method requires locked mutex's and a living object. - @return The bounding box (VCL rect.) relative to the parent window. */ - virtual Rectangle implGetBoundingBox() override; - /** @attention This method requires locked mutex's and a living object. - @return The bounding box (VCL rect.) in screen coordinates. */ - virtual Rectangle implGetBoundingBoxOnScreen() override; - - /** @attention This method requires locked mutex's and a living object. - @return The count of used rows. */ - virtual sal_Int32 implGetRowCount() const override; - /** @attention This method requires locked mutex's and a living object. - @return The count of used columns. */ - virtual sal_Int32 implGetColumnCount() const override; - - // internal helper methods - - /** @return TRUE, if the objects is a header bar for rows. */ - inline bool isRowBar() const; - /** @return TRUE, if the objects is a header bar for columns. */ - inline bool isColumnBar() const; - - /** Returns the specified row or column. Uses one of the parameters, - depending on object type. - @attention This method requires locked mutex's and a living object. - @return The XAccessible interface of the specified column/row. */ - css::uno::Reference< css::accessibility::XAccessible > - implGetChild( sal_Int32 nRow, sal_uInt16 nColumnPos ); - - /** @attention This method requires locked mutex's and a living object. - @return The absolute child index from the index of selected children. - @throws IndexOutOfBoundsException - If the specified index is invalid. */ - sal_Int32 implGetChildIndexFromSelectedIndex( sal_Int32 nSelectedChildIndex ) - throw ( css::lang::IndexOutOfBoundsException ); - - /** @attention This method requires locked mutex's and a living object. - @throws IndexOutOfBoundsException - If the specified row/column index (depending on type) is invalid. */ - void ensureIsValidHeaderIndex( sal_Int32 nIndex ) - throw ( css::lang::IndexOutOfBoundsException ); -}; - -// inlines - -inline bool AccessibleBrowseBoxHeaderBar::isRowBar() const -{ - return getType() == ::svt::BBTYPE_ROWHEADERBAR; -} - -inline bool AccessibleBrowseBoxHeaderBar::isColumnBar() const -{ - return getType() == ::svt::BBTYPE_COLUMNHEADERBAR; -} - - -} // namespace accessibility - - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/extended/AccessibleBrowseBoxHeaderCell.hxx b/accessibility/inc/accessibility/extended/AccessibleBrowseBoxHeaderCell.hxx deleted file mode 100644 index 0f9f1bacbf92..000000000000 --- a/accessibility/inc/accessibility/extended/AccessibleBrowseBoxHeaderCell.hxx +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEBROWSEBOXHEADERCELL_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEBROWSEBOXHEADERCELL_HXX - -#include "accessibility/extended/AccessibleBrowseBoxBase.hxx" - -namespace accessibility -{ - class AccessibleBrowseBoxHeaderCell : public BrowseBoxAccessibleElement - { - sal_Int32 m_nColumnRowId; - public: - AccessibleBrowseBoxHeaderCell(sal_Int32 _nColumnRowId, - const css::uno::Reference< css::accessibility::XAccessible >& rxParent, - ::svt::IAccessibleTableProvider& _rBrowseBox, - const css::uno::Reference< css::awt::XWindow >& _xFocusWindow, - ::svt::AccessibleBrowseBoxObjType _eObjType); - /** @return The count of visible children. */ - virtual sal_Int32 SAL_CALL getAccessibleChildCount() throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return The XAccessible interface of the specified child. */ - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL - getAccessibleChild( sal_Int32 nChildIndex ) throw ( css::lang::IndexOutOfBoundsException,css::uno::RuntimeException, std::exception ) override; - - /** @return The index of this object among the parent's children. */ - virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() throw ( css::uno::RuntimeException, std::exception ) override; - - /** Grabs the focus to the BrowseBox. */ - virtual void SAL_CALL grabFocus() throw ( css::uno::RuntimeException, std::exception ) override; - - inline bool isRowBarCell() const - { - return getType() == ::svt::BBTYPE_ROWHEADERCELL; - } - - /** @return - The name of this class. - */ - virtual OUString SAL_CALL getImplementationName() throw ( css::uno::RuntimeException, std::exception ) override; - - /** Creates a new AccessibleStateSetHelper and fills it with states of the - current object. - @return - A filled AccessibleStateSetHelper. - */ - ::utl::AccessibleStateSetHelper* implCreateStateSetHelper() override; - - protected: - virtual Rectangle implGetBoundingBox() override; - - virtual Rectangle implGetBoundingBoxOnScreen() override; - }; -} - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEBROWSEBOXHEADERCELL_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/extended/AccessibleBrowseBoxTable.hxx b/accessibility/inc/accessibility/extended/AccessibleBrowseBoxTable.hxx deleted file mode 100644 index 2bd31e1bff46..000000000000 --- a/accessibility/inc/accessibility/extended/AccessibleBrowseBoxTable.hxx +++ /dev/null @@ -1,152 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEBROWSEBOXTABLE_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEBROWSEBOXTABLE_HXX - -#include "accessibility/extended/AccessibleBrowseBoxTableBase.hxx" - - -namespace accessibility { - -/** This class represents the accessible object of the data table of a - BrowseBox control. */ -class AccessibleBrowseBoxTable : public AccessibleBrowseBoxTableBase -{ - friend class AccessibleBrowseBox; // to create header bars - -public: - AccessibleBrowseBoxTable( - const css::uno::Reference< css::accessibility::XAccessible >& rxParent, - ::svt::IAccessibleTableProvider& rBrowseBox ); - -protected: - virtual ~AccessibleBrowseBoxTable(); - -public: - // XAccessibleContext - - /** @return The XAccessible interface of the specified child. */ - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL - getAccessibleChild( sal_Int32 nChildIndex ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** @return The index of this object among the parent's children. */ - virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() - throw ( css::uno::RuntimeException, std::exception ) override; - - // XAccessibleComponent - - /** @return The accessible child rendered under the given point. */ - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL - getAccessibleAtPoint( const css::awt::Point& rPoint ) - throw ( css::uno::RuntimeException, std::exception ) override; - - /** Grabs the focus to (the current cell of) the data table. */ - virtual void SAL_CALL grabFocus() - throw ( css::uno::RuntimeException, std::exception ) override; - - // XAccessibleTable - - /** @return The description text of the specified row. */ - virtual OUString SAL_CALL getAccessibleRowDescription( sal_Int32 nRow ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** @return The description text of the specified column. */ - virtual OUString SAL_CALL getAccessibleColumnDescription( sal_Int32 nColumn ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** @return The XAccessibleTable interface of the row header bar. */ - virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL - getAccessibleRowHeaders() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return The XAccessibleTable interface of the column header bar. */ - virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL - getAccessibleColumnHeaders() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return An index list of completely selected rows. */ - virtual css::uno::Sequence< sal_Int32 > SAL_CALL - getSelectedAccessibleRows() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return An index list of completely selected columns. */ - virtual css::uno::Sequence< sal_Int32 > SAL_CALL - getSelectedAccessibleColumns() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return TRUE, if the specified row is completely selected. */ - virtual sal_Bool SAL_CALL isAccessibleRowSelected( sal_Int32 nRow ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** @return TRUE, if the specified column is completely selected. */ - virtual sal_Bool SAL_CALL isAccessibleColumnSelected( sal_Int32 nColumn ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** @return The XAccessible interface of the cell object at the specified - cell position. */ - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL - getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** @return TRUE, if the specified cell is selected. */ - virtual sal_Bool SAL_CALL isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - // XServiceInfo - - /** @return The name of this class. */ - virtual OUString SAL_CALL getImplementationName() - throw ( css::uno::RuntimeException, std::exception ) override; - -protected: - // internal virtual methods - - /** @attention This method requires locked mutex's and a living object. - @return The bounding box (VCL rect.) relative to the parent window. */ - virtual Rectangle implGetBoundingBox() override; - /** @attention This method requires locked mutex's and a living object. - @return The bounding box (VCL rect.) in screen coordinates. */ - virtual Rectangle implGetBoundingBoxOnScreen() override; - - // internal helper methods - - /** @attention This method requires a locked mutex. - @return The XAccessibleTable interface of the specified header bar. */ - css::uno::Reference< css::accessibility::XAccessibleTable > - implGetHeaderBar( sal_Int32 nChildIndex ) - throw ( css::uno::RuntimeException ); -}; - - -} // namespace accessibility - - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/extended/AccessibleBrowseBoxTableBase.hxx b/accessibility/inc/accessibility/extended/AccessibleBrowseBoxTableBase.hxx deleted file mode 100644 index 1baa85f5d661..000000000000 --- a/accessibility/inc/accessibility/extended/AccessibleBrowseBoxTableBase.hxx +++ /dev/null @@ -1,267 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEBROWSEBOXTABLEBASE_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEBROWSEBOXTABLEBASE_HXX - -#include "accessibility/extended/AccessibleBrowseBoxBase.hxx" -#include -#include - - -namespace accessibility { - -typedef ::cppu::ImplHelper1< css::accessibility::XAccessibleTable > - AccessibleBrowseBoxTableImplHelper; - -/** The BrowseBox accessible table objects inherit from this base class. It - implements basic functionality for the XAccessibleTable interface. - BrowseBox table objects are: the data table, the column header bar and the - row header bar. */ -class AccessibleBrowseBoxTableBase : - public BrowseBoxAccessibleElement, - public AccessibleBrowseBoxTableImplHelper -{ -public: - /** Constructor sets specified name and description. If the constant of a - text is BBTEXT_NONE, the derived class has to set the text via - implSetName() and implSetDescription() (in Ctor) or later via - setAccessibleName() and setAccessibleDescription() (these methods - notify the listeners about the change). - @param rxParent XAccessible interface of the parent object. - @param rBrowseBox The BrowseBox control. - @param eObjType Type of BrowseBox object. */ - AccessibleBrowseBoxTableBase( - const css::uno::Reference< css::accessibility::XAccessible >& rxParent, - ::svt::IAccessibleTableProvider& rBrowseBox, - ::svt::AccessibleBrowseBoxObjType eObjType ); - -protected: - virtual ~AccessibleBrowseBoxTableBase(); - -public: - // XAccessibleContext - - /** @return The count of visible children. */ - virtual sal_Int32 SAL_CALL getAccessibleChildCount() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return The role of this object (a table). */ - virtual sal_Int16 SAL_CALL getAccessibleRole() - throw ( css::uno::RuntimeException, std::exception ) override; - - /* Derived classes have to implement: - - getAccessibleChild, - - getAccessibleIndexInParent. */ - - // XAccessibleComponent - - /* Derived classes have to implement: - - getAccessibleAt, - - grabFocus. */ - - // XAccessibleTable - - /** @return The number of used rows in the table (0 = empty table). */ - virtual sal_Int32 SAL_CALL getAccessibleRowCount() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return The number of used columns in the table (0 = empty table). */ - virtual sal_Int32 SAL_CALL getAccessibleColumnCount() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return The row extent of the specified cell (always 1). */ - virtual sal_Int32 SAL_CALL - getAccessibleRowExtentAt( sal_Int32 nRow, sal_Int32 nColumn ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** @return The column extent of the specified cell (always 1). */ - virtual sal_Int32 SAL_CALL - getAccessibleColumnExtentAt( sal_Int32 nRow, sal_Int32 nColumn ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** @return The caption cell of the table (not supported). */ - virtual css::uno::Reference< - css::accessibility::XAccessible > SAL_CALL - getAccessibleCaption() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return The summary object of the table (not supported). */ - virtual css::uno::Reference< - css::accessibility::XAccessible > SAL_CALL - getAccessibleSummary() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return The child index of the specified cell. */ - virtual sal_Int32 SAL_CALL getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** @return The row index of the specified child cell. */ - virtual sal_Int32 SAL_CALL getAccessibleRow( sal_Int32 nChildIndex ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** @return The column index of the specified child cell. */ - virtual sal_Int32 SAL_CALL getAccessibleColumn( sal_Int32 nChildIndex ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /* Derived classes have to implement: - - getAccessibleRowDescription, - - getAccessibleColumnDescription, - - getAccessibleRowHeaders, - - getAccessibleColumnHeaders, - - getSelectedAccessibleRows, - - getSelectedAccessibleColumns, - - isAccessibleRowSelected, - - isAccessibleColumnSelected, - - getAccessibleCellAt, - - isAccessibleSelected. */ - - // XInterface - - /** Queries for a new interface. */ - css::uno::Any SAL_CALL queryInterface( const css::uno::Type& rType ) - throw ( css::uno::RuntimeException, std::exception ) override; - - /** Aquires the object (calls acquire() on base class). */ - virtual void SAL_CALL acquire() throw () override; - - /** Releases the object (calls release() on base class). */ - virtual void SAL_CALL release() throw () override; - - // XTypeProvider - - /** @return A sequence of possible types (received from base classes). */ - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return An unique implementation ID. */ - virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() - throw ( css::uno::RuntimeException, std::exception ) override; - - // XServiceInfo - - /* Derived classes have to implement: - - getImplementationName */ - -protected: - // internal virtual methods - - /** @attention This method requires locked mutex's and a living object. - @return The count of data rows without header bar. */ - virtual sal_Int32 implGetRowCount() const; - /** @attention This method requires locked mutex's and a living object. - @return The count of data columns without "handle column". */ - virtual sal_Int32 implGetColumnCount() const; - - // internal helper methods - - /** @return TRUE, if first BrowseBox column is the "handle column". */ - bool implHasHandleColumn() const; - - /** @attention This method requires locked mutex's and a living object. - @param nColumn - the position of the column in the Accessible world - @return - the position of the column in VCL the Accessible world - */ - sal_uInt16 implToVCLColumnPos( sal_Int32 nColumn ) const; - - /** @attention This method requires locked mutex's and a living object. - @return The number of cells of the table. */ - sal_Int32 implGetChildCount() const; - - /** @attention This method requires locked mutex's and a living object. - @return The row index of the specified cell index. */ - sal_Int32 implGetRow( sal_Int32 nChildIndex ) const; - /** @attention This method requires locked mutex's and a living object. - @return The column index of the specified cell index. */ - sal_Int32 implGetColumn( sal_Int32 nChildIndex ) const; - /** @attention This method requires locked mutex's and a living object. - @return The child index of the specified cell address. */ - sal_Int32 implGetChildIndex( sal_Int32 nRow, sal_Int32 nColumn ) const; - - /** @attention This method requires locked mutex's and a living object. - @return TRUE, if the specified row is selected. */ - bool implIsRowSelected( sal_Int32 nRow ) const; - /** @attention This method requires locked mutex's and a living object. - @return TRUE, if the specified column is selected. */ - bool implIsColumnSelected( sal_Int32 nColumn ) const; - - /** Selects/deselects a row (tries to expand selection). - @attention This method requires locked mutex's and a living object. - @param nRow Row to select - @param bSelect TRUE = select, FALSE = deselect */ - void implSelectRow( sal_Int32 nRow, bool bSelect ); - /** Selects/deselects a column (tries to expand selection). - @attention This method requires locked mutex's and a living object. - @param nColumnPos column number to select - @param bSelect TRUE = select, FALSE = deselect */ - void implSelectColumn( sal_Int32 nColumnPos, bool bSelect ); - - /** @attention This method requires locked mutex's and a living object. - @return The count of selected rows. */ - sal_Int32 implGetSelectedRowCount() const; - /** @attention This method requires locked mutex's and a living object. - @return The count of selected columns. */ - sal_Int32 implGetSelectedColumnCount() const; - - /** Fills a sequence with sorted indexes of completely selected rows. - @attention This method requires locked mutex's and a living object. - @param rSeq Out-parameter that takes the sorted row index list. */ - void implGetSelectedRows( css::uno::Sequence< sal_Int32 >& rSeq ); - /** Fills a sequence with sorted indexes of completely selected columns. - @attention This method requires locked mutex's and a living object. - @param rSeq Out-parameter that takes the sorted column index list. */ - void implGetSelectedColumns( css::uno::Sequence< sal_Int32 >& rSeq ); - - /** @attention This method requires locked mutex's and a living object. - @throws IndexOutOfBoundsException - If the specified row index is invalid. */ - void ensureIsValidRow( sal_Int32 nRow ) - throw ( css::lang::IndexOutOfBoundsException ); - /** @attention This method requires locked mutex's and a living object. - @throws IndexOutOfBoundsException - If the specified column index is invalid. */ - void ensureIsValidColumn( sal_Int32 nColumn ) - throw ( css::lang::IndexOutOfBoundsException ); - /** @attention This method requires locked mutex's and a living object. - @throws IndexOutOfBoundsException - If the specified cell address is invalid. */ - void ensureIsValidAddress( sal_Int32 nRow, sal_Int32 nColumn ) - throw ( css::lang::IndexOutOfBoundsException ); - /** @attention This method requires locked mutex's and a living object. - @throws IndexOutOfBoundsException - If the specified child index is invalid. */ - void ensureIsValidIndex( sal_Int32 nChildIndex ) - throw ( css::lang::IndexOutOfBoundsException ); -}; - - -} // namespace accessibility - - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/extended/AccessibleBrowseBoxTableCell.hxx b/accessibility/inc/accessibility/extended/AccessibleBrowseBoxTableCell.hxx deleted file mode 100644 index 6c10d4e8a3c5..000000000000 --- a/accessibility/inc/accessibility/extended/AccessibleBrowseBoxTableCell.hxx +++ /dev/null @@ -1,133 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEBROWSEBOXTABLECELL_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEBROWSEBOXTABLECELL_HXX - -#include "accessibility/extended/accessiblebrowseboxcell.hxx" -#include -#include - -namespace accessibility -{ - typedef ::cppu::ImplHelper2 < css::accessibility::XAccessibleText - , css::accessibility::XAccessible - > AccessibleTextHelper_BASE; - - // implementation of a table cell of BrowseBox - class AccessibleBrowseBoxTableCell :public AccessibleBrowseBoxCell - ,public AccessibleTextHelper_BASE - ,public ::comphelper::OCommonAccessibleText - { - private: - sal_Int32 m_nOffset; - - protected: - // OCommonAccessibleText - virtual OUString implGetText() override; - virtual css::lang::Locale implGetLocale() override; - virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override; - - public: - AccessibleBrowseBoxTableCell( const css::uno::Reference< css::accessibility::XAccessible >& _rxParent, - ::svt::IAccessibleTableProvider& _rBrowseBox, - const css::uno::Reference< css::awt::XWindow >& _xFocusWindow, - sal_Int32 _nRowId, - sal_uInt16 _nColId, - sal_Int32 _nOffset ); - - void nameChanged( const OUString& rNewName, const OUString& rOldName ); - - // XInterface ------------------------------------------------------------- - - /** Queries for a new interface. */ - css::uno::Any SAL_CALL queryInterface( const css::uno::Type& rType ) - throw ( css::uno::RuntimeException, std::exception ) override; - - /** Aquires the object (calls acquire() on base class). */ - virtual void SAL_CALL acquire() throw () override; - - /** Releases the object (calls release() on base class). */ - virtual void SAL_CALL release() throw () override; - - // XEventListener - using AccessibleBrowseBoxBase::disposing; - virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) - throw(css::uno::RuntimeException, std::exception) override; - - /** @return The index of this object among the parent's children. */ - virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return - The name of this class. - */ - virtual OUString SAL_CALL getImplementationName() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return - The count of visible children. - */ - virtual sal_Int32 SAL_CALL getAccessibleChildCount() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return - The XAccessible interface of the specified child. - */ - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL - getAccessibleChild( sal_Int32 nChildIndex ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** Creates a new AccessibleStateSetHelper and fills it with states of the - current object. - @return - A filled AccessibleStateSetHelper. - */ - ::utl::AccessibleStateSetHelper* implCreateStateSetHelper() override; - - // XAccessible ------------------------------------------------------------ - - /** @return The XAccessibleContext interface of this object. */ - virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL - getAccessibleContext() - throw ( css::uno::RuntimeException, std::exception ) override; - - // XAccessibleText - virtual sal_Int32 SAL_CALL getCaretPosition() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getCharacterCount() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getSelectedText() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getSelectionStart() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getSelectionEnd() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getText() throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; - virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; - virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - }; -} -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEBROWSEBOXTABLECELL_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControl.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControl.hxx deleted file mode 100644 index 865f8258f98c..000000000000 --- a/accessibility/inc/accessibility/extended/AccessibleGridControl.hxx +++ /dev/null @@ -1,239 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEGRIDCONTROL_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEGRIDCONTROL_HXX - -#include -#include -#include -#include -#include -#include - -namespace accessibility { - - class AccessibleGridControl_Impl; - - -/** This class represents the complete accessible Grid Control object. */ -class AccessibleGridControl : public AccessibleGridControlBase -{ - friend class AccessibleGridControlAccess; - -protected: - AccessibleGridControl( - const css::uno::Reference< css::accessibility::XAccessible >& _rxParent, - const css::uno::Reference< css::accessibility::XAccessible >& _rxCreator, - ::svt::table::IAccessibleTable& _rTable - ); - - virtual ~AccessibleGridControl(); - - /** Cleans up members. */ - using AccessibleGridControlBase::disposing; - virtual void SAL_CALL disposing() override; - -protected: - // XAccessibleContext ----------------------------------------------------- - - /** @return The count of visible children. */ - virtual sal_Int32 SAL_CALL getAccessibleChildCount() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return The XAccessible interface of the specified child. */ - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL - getAccessibleChild( sal_Int32 nChildIndex ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** @return The role of this object (a table). */ - virtual sal_Int16 SAL_CALL getAccessibleRole() - throw ( css::uno::RuntimeException, std::exception ) override; - - // XAccessibleComponent --------------------------------------------------- - - /** @return - The accessible child rendered under the given point. - */ - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL - getAccessibleAtPoint( const css::awt::Point& rPoint ) - throw ( css::uno::RuntimeException, std::exception ) override; - - /** Grabs the focus to the Grid Control. */ - virtual void SAL_CALL grabFocus() - throw ( css::uno::RuntimeException, std::exception ) override; - - // XServiceInfo ----------------------------------------------------------- - - /** @return - The name of this class. - */ - virtual OUString SAL_CALL getImplementationName() - throw ( css::uno::RuntimeException, std::exception ) override; - -public: - // helper functions - - /** commitCellEvent commit the event at all listeners of the table - @param nEventId - the event id - @param rNewValue - the new value - @param rOldValue - the old value - */ - void commitCellEvent(sal_Int16 nEventId, const css::uno::Any& rNewValue, - const css::uno::Any& rOldValue); - - /** commitTableEvent commit the event at all listeners of the table - @param nEventId - the event id - @param rNewValue - the new value - @param rOldValue - the old value - */ - void commitTableEvent(sal_Int16 nEventId, const css::uno::Any& rNewValue, - const css::uno::Any& rOldValue); - -protected: - // internal virtual methods ----------------------------------------------- - - /** @attention This method requires locked mutex's and a living object. - @return The bounding box (VCL rect.) relative to the parent window. */ - virtual Rectangle implGetBoundingBox() override; - /** @attention This method requires locked mutex's and a living object. - @return The bounding box (VCL rect.) in screen coordinates. */ - virtual Rectangle implGetBoundingBoxOnScreen() override; - - // internal helper methods ------------------------------------------------ - - /** This method creates (once) and returns the accessible data table child. - @attention This method requires locked mutex's and a living object. - @return The XAccessible interface of the data table. */ - css::uno::Reference< css::accessibility::XAccessible > implGetTable(); - - /** This method creates (once) and returns the specified header bar. - @attention This method requires locked mutex's and a living object. - @return The XAccessible interface of the header bar. */ - css::uno::Reference< css::accessibility::XAccessible > - implGetHeaderBar( ::svt::table::AccessibleTableControlObjType eObjType ); - - /** This method returns one of the children that are always present: - Data table, row and column header bar or corner control. - @attention This method requires locked mutex's and a living object. - @return The XAccessible interface of the specified child. */ - css::uno::Reference< css::accessibility::XAccessible > - implGetFixedChild( sal_Int32 nChildIndex ); - - /** This method creates and returns an accessible table. - @return An AccessibleGridControlTable. */ - AccessibleGridControlTable* createAccessibleTable(); - -private: - // members ---------------------------------------------------------------- - std::unique_ptr< AccessibleGridControl_Impl > m_xImpl; -}; - - -/** the XAccessible which creates/returns an AccessibleGridControl - -

The instance holds its XAccessibleContext with a hard reference, while - the context holds this instance weak.

-*/ - -class AccessibleGridControlAccess : - public ::cppu::WeakImplHelper< css::accessibility::XAccessible > - ,public ::svt::table::IAccessibleTableControl -{ -private: - css::uno::Reference< css::accessibility::XAccessible > - m_xParent; - ::svt::table::IAccessibleTable * m_pTable; - - css::uno::Reference< css::accessibility::XAccessibleContext > - m_xContext; - AccessibleGridControl* m_pContext; - // note that this pointer is valid as long as m_xContext is valid! - -public: - AccessibleGridControlAccess( - const css::uno::Reference< css::accessibility::XAccessible >& _rxParent, - ::svt::table::IAccessibleTable& _rTable - ); - - /// checks whether the accessible context is still alive - bool isContextAlive() const; - - /// returns the AccessibleContext belonging to this Accessible - inline AccessibleGridControl* getContext() { return m_pContext; } - -protected: - virtual ~AccessibleGridControlAccess(); - - // XAccessible - virtual css::uno::Reference< css::accessibility::XAccessibleContext > - SAL_CALL getAccessibleContext() throw ( css::uno::RuntimeException, std::exception ) override; - - // IAccessibleTable - virtual css::uno::Reference< css::accessibility::XAccessible > - getMyself() override - { - return this; - } - void DisposeAccessImpl() override; - virtual bool isAlive() const override - { - return isContextAlive(); - } - virtual void commitCellEvent( sal_Int16 nEventId, - const css::uno::Any& rNewValue, const css::uno::Any& rOldValue ) override - { - AccessibleGridControl* pContext( getContext() ); - if ( pContext ) - pContext->commitCellEvent( nEventId, rNewValue, rOldValue ); - } - virtual void commitTableEvent( sal_Int16 nEventId, - const css::uno::Any& rNewValue, const css::uno::Any& rOldValue ) override - { - AccessibleGridControl* pContext( getContext() ); - if ( pContext ) - pContext->commitTableEvent( nEventId, rNewValue, rOldValue ); - } - virtual void commitEvent( sal_Int16 nEventId, - const css::uno::Any& rNewValue, const css::uno::Any& rOldValue ) override - { - AccessibleGridControl* pContext( getContext() ); - if ( pContext ) - pContext->commitEvent( nEventId, rNewValue, rOldValue ); - } - -private: - AccessibleGridControlAccess( const AccessibleGridControlAccess& ) = delete; - AccessibleGridControlAccess& operator=( const AccessibleGridControlAccess& ) = delete; -}; - - -} // namespace accessibility - - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlBase.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlBase.hxx deleted file mode 100644 index b5ba1bd65e3e..000000000000 --- a/accessibility/inc/accessibility/extended/AccessibleGridControlBase.hxx +++ /dev/null @@ -1,356 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEGRIDCONTROLBASE_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEGRIDCONTROLBASE_HXX - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -namespace vcl { class Window; } - -namespace utl { - class AccessibleStateSetHelper; -} - - -namespace accessibility { - -typedef ::cppu::WeakAggComponentImplHelper4< - css::accessibility::XAccessibleContext, - css::accessibility::XAccessibleComponent, - css::accessibility::XAccessibleEventBroadcaster, - css::lang::XServiceInfo > - AccessibleGridControlImplHelper; - -/** The GridControl accessible objects inherit from this base class. It - implements basic functionality for various Accessibility interfaces and - the event broadcaster and contains the osl::Mutex. */ -class AccessibleGridControlBase : - public ::comphelper::OBaseMutex, - public AccessibleGridControlImplHelper -{ -public: - /** Constructor sets specified name and description. - @param rxParent XAccessible interface of the parent object. - @param rTable The Table control. - @param eObjType Type of accessible table control. */ - AccessibleGridControlBase( - const css::uno::Reference< css::accessibility::XAccessible >& rxParent, - ::svt::table::IAccessibleTable& rTable, - ::svt::table::AccessibleTableControlObjType eObjType ); - -protected: - virtual ~AccessibleGridControlBase(); - - /** Commits DeFunc event to listeners and cleans up members. */ - virtual void SAL_CALL disposing() override; - -public: - // XAccessibleContext - - /** @return A reference to the parent accessible object. */ - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL - getAccessibleParent() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return The index of this object among the parent's children. */ - virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return - The description of this object. - */ - virtual OUString SAL_CALL getAccessibleDescription() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return - The name of this object. - */ - virtual OUString SAL_CALL getAccessibleName() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return - The relation set (the GridControl does not have one). - */ - virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL - getAccessibleRelationSet() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return The set of current states. */ - virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL - getAccessibleStateSet() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return The parent's locale. */ - virtual css::lang::Locale SAL_CALL getLocale() - throw ( css::accessibility::IllegalAccessibleComponentStateException, - css::uno::RuntimeException, std::exception ) override; - - /** @return - The role of this object. Panel, ROWHEADER, COLUMNHEADER, TABLE, TABLE_CELL are supported. - */ - virtual sal_Int16 SAL_CALL getAccessibleRole() - throw ( css::uno::RuntimeException, std::exception ) override; - - /* Derived classes have to implement: - - getAccessibleChildCount, - - getAccessibleChild, - - getAccessibleRole. - Derived classes may overwrite getAccessibleIndexInParent to increase - performance. */ - - // XAccessibleComponent - - /** @return - TRUE, if the point lies within the bounding box of this object. */ - virtual sal_Bool SAL_CALL containsPoint( const css::awt::Point& rPoint ) - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return The bounding box of this object. */ - virtual css::awt::Rectangle SAL_CALL getBounds() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return - The upper left corner of the bounding box relative to the parent. */ - virtual css::awt::Point SAL_CALL getLocation() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return - The upper left corner of the bounding box in screen coordinates. */ - virtual css::awt::Point SAL_CALL getLocationOnScreen() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return The size of the bounding box. */ - virtual css::awt::Size SAL_CALL getSize() - throw ( css::uno::RuntimeException, std::exception ) override; - - virtual sal_Int32 SAL_CALL getForeground( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getBackground( ) throw (css::uno::RuntimeException, std::exception) override; - - - /* Derived classes have to implement: - - getAccessibleAt, - - grabFocus. */ - - /** @return - The accessible child rendered under the given point. - */ - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL - getAccessibleAtPoint( const css::awt::Point& rPoint ) - throw ( css::uno::RuntimeException, std::exception ) override; - - // XAccessibleEventBroadcaster - - /** Adds a new event listener */ - virtual void SAL_CALL addAccessibleEventListener( - const css::uno::Reference< css::accessibility::XAccessibleEventListener>& rxListener ) - throw ( css::uno::RuntimeException, std::exception ) override; - - /** Removes an event listener. */ - virtual void SAL_CALL removeAccessibleEventListener( - const css::uno::Reference< css::accessibility::XAccessibleEventListener>& rxListener ) - throw ( css::uno::RuntimeException, std::exception ) override; - - // XTypeProvider - - /** @return An unique implementation ID. */ - virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() - throw ( css::uno::RuntimeException, std::exception ) override; - - // XServiceInfo - - /** @return Whether the specified service is supported by this class. */ - virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return A list of all supported services. */ - virtual css::uno::Sequence< OUString > SAL_CALL - getSupportedServiceNames() - throw ( css::uno::RuntimeException, std::exception ) override; - - /* Derived classes have to implement: - - getImplementationName. */ - - // helper methods - - /** @return The GridControl object type. */ - inline ::svt::table::AccessibleTableControlObjType getType() const; - - /** Commits an event to all listeners. */ - void commitEvent( - sal_Int16 nEventId, - const css::uno::Any& rNewValue, - const css::uno::Any& rOldValue ); - /** @return TRUE, if the object is not disposed or disposing. */ - bool isAlive() const; - -protected: - // internal virtual methods - - /** Determines whether the Grid control is really showing inside of - its parent accessible window. Derived classes may implement different - behaviour. - @attention This method requires locked mutex's and a living object. - @return TRUE, if the object is really showing. */ - bool implIsShowing(); - - /** Derived classes return the bounding box relative to the parent window. - @attention This method requires locked mutex's and a living object. - @return The bounding box (VCL rect.) relative to the parent window. */ - virtual Rectangle implGetBoundingBox() = 0; - ///** Derived classes return the bounding box in screen coordinates. - // @attention This method requires locked mutex's and a living object. - // @return The bounding box (VCL rect.) in screen coordinates. */ - virtual Rectangle implGetBoundingBoxOnScreen() = 0; - - /** Creates a new AccessibleStateSetHelper and fills it with states of the - current object. This method calls FillStateSet at the GridControl which - fills it with more states depending on the object type. Derived classes - may overwrite this method and add more states. - @attention This method requires locked mutex's. - @return A filled AccessibleStateSetHelper. */ - virtual ::utl::AccessibleStateSetHelper* implCreateStateSetHelper(); - - // internal helper methods - - /** @throws DisposedException If the object is not alive. */ - void ensureIsAlive() const - throw ( css::lang::DisposedException ); - - /** Changes the name of the object (flat assignment, no notify). - @attention This method requires a locked mutex. */ - inline void implSetName( const OUString& rName ); - - /** Locks all mutex's and calculates the bounding box relative to the - parent window. - @return The bounding box (VCL rect.) relative to the parent object. */ - Rectangle getBoundingBox() - throw ( css::lang::DisposedException ); - ///** Locks all mutex's and calculates the bounding box in screen - // coordinates. - // @return The bounding box (VCL rect.) in screen coordinates. */ - Rectangle getBoundingBoxOnScreen() - throw ( css::lang::DisposedException ); - - ::comphelper::AccessibleEventNotifier::TClientId getClientId() const { return m_aClientId; } - void setClientId(::comphelper::AccessibleEventNotifier::TClientId _aNewClientId) { m_aClientId = _aNewClientId; } - -protected: - // members - - /** The parent accessible object. */ - css::uno::Reference< css::accessibility::XAccessible > m_xParent; - /** The SVT Table control. */ - ::svt::table::IAccessibleTable& m_aTable; - /** The type of this object (for names, descriptions, state sets, ...). */ - ::svt::table::AccessibleTableControlObjType m_eObjType; - -private: - /** Localized name. */ - OUString m_aName; - /** Localized description text. */ - OUString m_aDescription; - ::comphelper::AccessibleEventNotifier::TClientId m_aClientId; -}; - - -// a version of AccessibleGridControlBase which implements not only the XAccessibleContext, -// but also the XAccessible - -typedef ::cppu::ImplHelper1 < css::accessibility::XAccessible - > GridControlAccessibleElement_Base; - -class GridControlAccessibleElement - :public AccessibleGridControlBase - ,public GridControlAccessibleElement_Base -{ -protected: - /** Constructor sets specified name and description. - - @param rxParent XAccessible interface of the parent object. - @param rTable The Table control. - @param eObjType Type of table control - */ - GridControlAccessibleElement( - const css::uno::Reference< css::accessibility::XAccessible >& rxParent, - ::svt::table::IAccessibleTable& rTable, - ::svt::table::AccessibleTableControlObjType eObjType ); - -public: - // XInterface - DECLARE_XINTERFACE( ) - // XTypeProvider - DECLARE_XTYPEPROVIDER( ) - -protected: - virtual ~GridControlAccessibleElement(); - -protected: - // XAccessible - - /** @return The XAccessibleContext interface of this object. */ - virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL - getAccessibleContext() - throw ( css::uno::RuntimeException, std::exception ) override; - -private: - GridControlAccessibleElement( const GridControlAccessibleElement& ) = delete; - GridControlAccessibleElement& operator=( const GridControlAccessibleElement& ) = delete; -}; - -// inlines - -inline ::svt::table::AccessibleTableControlObjType AccessibleGridControlBase::getType() const -{ - return m_eObjType; -} - -inline void AccessibleGridControlBase::implSetName( - const OUString& rName ) -{ - m_aName = rName; -} - - -} // namespace accessibility - - -#endif // ACCESSIBILITY_EXT_ACCESSIBILEGRIDCONTROLBASE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlHeader.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlHeader.hxx deleted file mode 100644 index 5f4039f4e5bc..000000000000 --- a/accessibility/inc/accessibility/extended/AccessibleGridControlHeader.hxx +++ /dev/null @@ -1,181 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEGRIDCONTROLHEADER_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEGRIDCONTROLHEADER_HXX - -#include -#include - -namespace accessibility { - -/** This class represents the accessible object of a header bar of a Grid Control - (row or column header bar). This object supports the - XAccessibleSelection interface. Selecting a child of this object selects - complete rows or columns of the data table. */ -class AccessibleGridControlHeader : public AccessibleGridControlTableBase -{ -public: - /** @param rxParent accessible parent control - @param rTable accessible table - @param eObjType One of the two allowed types TCTYPE_ROWHEADERBAR or - TCTYPE_COLUMNHEADERBAR. */ - AccessibleGridControlHeader( - const css::uno::Reference< - css::accessibility::XAccessible >& rxParent, - ::svt::table::IAccessibleTable& rTable, - ::svt::table::AccessibleTableControlObjType eObjType ); - -protected: - virtual ~AccessibleGridControlHeader(); - -public: - // XAccessibleContext - - /** @return - The XAccessible interface of the specified child. - */ - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL - getAccessibleChild( sal_Int32 nChildIndex ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** @return The index of this object among the parent's children. */ - virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() - throw ( css::uno::RuntimeException, std::exception ) override; - - // XAccessibleComponent - - /** @return The accessible child rendered under the given point. */ - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL - getAccessibleAtPoint( const css::awt::Point& rPoint ) - throw ( css::uno::RuntimeException, std::exception ) override; - - /** Grabs the focus to (the current cell of) the data table. */ - virtual void SAL_CALL grabFocus() - throw ( css::uno::RuntimeException, std::exception ) override; - - // XAccessibleTable - - /** @return The description text of the specified row. */ - virtual OUString SAL_CALL - getAccessibleRowDescription( sal_Int32 nRow ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** @return The description text of the specified column. */ - virtual OUString SAL_CALL - getAccessibleColumnDescription( sal_Int32 nColumn ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** @return The XAccessibleTable interface of the row header bar. */ - virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL - getAccessibleRowHeaders() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return The XAccessibleTable interface of the column header bar. */ - virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL - getAccessibleColumnHeaders() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return An index list of completely selected rows. */ - virtual css::uno::Sequence< sal_Int32 > SAL_CALL - getSelectedAccessibleRows() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return An index list of completely selected columns. */ - virtual css::uno::Sequence< sal_Int32 > SAL_CALL - getSelectedAccessibleColumns() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return TRUE, if the specified row is completely selected. */ - virtual sal_Bool SAL_CALL isAccessibleRowSelected( sal_Int32 nRow ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** @return TRUE, if the specified column is completely selected. */ - virtual sal_Bool SAL_CALL isAccessibleColumnSelected( sal_Int32 nColumn ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** @return The XAccessible interface of the cell object at the specified - cell position. */ - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL - getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** @return TRUE, if the specified cell is selected. */ - virtual sal_Bool SAL_CALL isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - // XServiceInfo - - /** @return The name of this class. */ - virtual OUString SAL_CALL getImplementationName() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return An unique implementation ID. */ - virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() - throw ( css::uno::RuntimeException, std::exception ) override; - -protected: - /** Returns the specified row or column. Uses one of the parameters, - depending on object type. - @attention This method requires locked mutex's and a living object. - @return The XAccessible interface of the specified column/row. */ - css::uno::Reference< css::accessibility::XAccessible > - implGetChild( sal_Int32 nRow, sal_uInt32 nColumnPos ); - /** @attention This method requires locked mutex's and a living object. - @return The bounding box (VCL rect.) relative to the parent window. */ - virtual Rectangle implGetBoundingBox() override; - /** @attention This method requires locked mutex's and a living object. - @return The bounding box (VCL rect.) in screen coordinates. */ - virtual Rectangle implGetBoundingBoxOnScreen() override; - - // internal helper methods - - /** @return TRUE, if the objects is a header bar for rows. */ - inline bool isRowBar() const; - /** @return TRUE, if the objects is a header bar for columns. */ - inline bool isColumnBar() const; -}; - -// inlines - -inline bool AccessibleGridControlHeader::isRowBar() const -{ - return getType() == ::svt::table::TCTYPE_ROWHEADERBAR; -} - -inline bool AccessibleGridControlHeader::isColumnBar() const -{ - return getType() == ::svt::table::TCTYPE_COLUMNHEADERBAR; -} - - -} // namespace accessibility - - -#endif // ACCESSIBILITY_EXT_ACCESSIBILEGRIDCONTROLHEADER_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlHeaderCell.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlHeaderCell.hxx deleted file mode 100644 index ad1449de1b06..000000000000 --- a/accessibility/inc/accessibility/extended/AccessibleGridControlHeaderCell.hxx +++ /dev/null @@ -1,86 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEGRIDCONTROLHEADERCELL_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEGRIDCONTROLHEADERCELL_HXX - -#include "accessibility/extended/AccessibleGridControlTableCell.hxx" - -namespace accessibility -{ - class AccessibleGridControlHeaderCell : public AccessibleGridControlCell, public css::accessibility::XAccessible - { - sal_Int32 m_nColumnRowId; - public: - AccessibleGridControlHeaderCell(sal_Int32 _nColumnRowId, - const css::uno::Reference< css::accessibility::XAccessible >& rxParent, - ::svt::table::IAccessibleTable& _rTable, - ::svt::table::AccessibleTableControlObjType _eObjType); - /** @return The count of visible children. */ - virtual sal_Int32 SAL_CALL getAccessibleChildCount() throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return The XAccessible interface of the specified child. */ - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL - getAccessibleChild( sal_Int32 nChildIndex ) throw ( css::lang::IndexOutOfBoundsException,css::uno::RuntimeException, std::exception ) override; - - /** @return The index of this object among the parent's children. */ - virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() throw ( css::uno::RuntimeException, std::exception ) override; - - /** Grabs the focus to the GridControl. */ - virtual void SAL_CALL grabFocus() throw ( css::uno::RuntimeException, std::exception ) override; - - // XInterface - - /** Queries for a new interface. */ - css::uno::Any SAL_CALL queryInterface( const css::uno::Type& rType ) - throw ( css::uno::RuntimeException, std::exception ) override; - - /** Aquires the object (calls acquire() on base class). */ - virtual void SAL_CALL acquire() throw () override; - - /** Releases the object (calls release() on base class). */ - virtual void SAL_CALL release() throw () override; - // XAccessible - - /** @return The XAccessibleContext interface of this object. */ - virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL - getAccessibleContext() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return - The name of this class. - */ - virtual OUString SAL_CALL getImplementationName() throw ( css::uno::RuntimeException, std::exception ) override; - - /** Creates a new AccessibleStateSetHelper and fills it with states of the - current object. - @return - A filled AccessibleStateSetHelper. - */ - ::utl::AccessibleStateSetHelper* implCreateStateSetHelper() override; - - protected: - virtual Rectangle implGetBoundingBox() override; - - virtual Rectangle implGetBoundingBoxOnScreen() override; - }; -} - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEGRIDCONTROLHEADERCELL_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlTable.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlTable.hxx deleted file mode 100644 index 22c71db21f52..000000000000 --- a/accessibility/inc/accessibility/extended/AccessibleGridControlTable.hxx +++ /dev/null @@ -1,210 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEGRIDCONTROLTABLE_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEGRIDCONTROLTABLE_HXX - -#include "accessibility/extended/AccessibleGridControlTableBase.hxx" -#include -#include -#include - - -namespace accessibility { - - -typedef ::cppu::ImplHelper1 < css::accessibility::XAccessibleSelection > - AccessibleGridControlTableSelectionImplHelper; -/** This class represents the accessible object of the data table of a - Grid control. */ -class AccessibleGridControlTable : public AccessibleGridControlTableBase, - public AccessibleGridControlTableSelectionImplHelper -{ -public: - AccessibleGridControlTable( - const css::uno::Reference< css::accessibility::XAccessible >& rxParent, - ::svt::table::IAccessibleTable& rTable, - ::svt::table::AccessibleTableControlObjType _eType); - -protected: - virtual ~AccessibleGridControlTable(); -private: - std::vector< AccessibleGridControlTableCell* > m_pCellVector; - std::vector< css::uno::Reference< css::accessibility::XAccessible> > m_pAccessCellVector; -public: - // XAccessibleContext - - /** @return The XAccessible interface of the specified child. */ - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL - getAccessibleChild( sal_Int32 nChildIndex ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** @return The index of this object among the parent's children. */ - virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() - throw ( css::uno::RuntimeException, std::exception ) override; - - // XAccessibleComponent - - /** @return The accessible child rendered under the given point. */ - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL - getAccessibleAtPoint( const css::awt::Point& rPoint ) - throw ( css::uno::RuntimeException, std::exception ) override; - - /** Grabs the focus to (the current cell of) the data table. */ - virtual void SAL_CALL grabFocus() - throw ( css::uno::RuntimeException, std::exception ) override; - - // XAccessibleTable - - /** @return The description text of the specified row. */ - virtual OUString SAL_CALL getAccessibleRowDescription( sal_Int32 nRow ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** @return The description text of the specified column. */ - virtual OUString SAL_CALL getAccessibleColumnDescription( sal_Int32 nColumn ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** @return The XAccessibleTable interface of the row header bar. */ - virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL - getAccessibleRowHeaders() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return The XAccessibleTable interface of the column header bar. */ - virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL - getAccessibleColumnHeaders() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return An index list of completely selected rows. */ - virtual css::uno::Sequence< sal_Int32 > SAL_CALL - getSelectedAccessibleRows() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return An index list of completely selected columns. */ - virtual css::uno::Sequence< sal_Int32 > SAL_CALL - getSelectedAccessibleColumns() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return TRUE, if the specified row is completely selected. */ - virtual sal_Bool SAL_CALL isAccessibleRowSelected( sal_Int32 nRow ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** @return TRUE, if the specified column is completely selected. */ - virtual sal_Bool SAL_CALL isAccessibleColumnSelected( sal_Int32 nColumn ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** @return The XAccessible interface of the cell object at the specified - cell position. */ - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL - getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** @return TRUE, if the specified cell is selected. */ - virtual sal_Bool SAL_CALL isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - // XAccessibleSelection - - /** Selects the specified child (row or column of the table). */ - virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** @return TRUE, if the specified child (row/column) is selected. */ - virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** Clears the complete selection. */ - virtual void SAL_CALL clearAccessibleSelection() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** Selects all children or first, if multiselection is not supported. */ - virtual void SAL_CALL selectAllAccessibleChildren() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return The number of selected rows/columns. */ - virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return The specified selected row/column. */ - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL - getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** Removes the specified row/column from the selection. */ - virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - // XInterface - - /** Queries for a new interface. */ - css::uno::Any SAL_CALL queryInterface( const css::uno::Type& rType ) - throw ( css::uno::RuntimeException, std::exception ) override; - - /** Aquires the object (calls acquire() on base class). */ - virtual void SAL_CALL acquire() throw () override; - - /** Releases the object (calls release() on base class). */ - virtual void SAL_CALL release() throw () override; - // XServiceInfo - - /** @return The name of this class. */ - virtual OUString SAL_CALL getImplementationName() - throw ( css::uno::RuntimeException, std::exception ) override; - - /**@return m_pCellVector*/ - std::vector< AccessibleGridControlTableCell* >& getCellVector() { return m_pCellVector;} - /**@return m_xAccessCellVector*/ - std::vector< css::uno::Reference< css::accessibility::XAccessible > >& getAccessibleCellVector() { return m_pAccessCellVector;} - -protected: - // internal virtual methods - - /** @attention This method requires locked mutex's and a living object. - @return The bounding box (VCL rect.) relative to the parent window. */ - virtual Rectangle implGetBoundingBox() override; - ///** @attention This method requires locked mutex's and a living object. - // @return The bounding box (VCL rect.) in screen coordinates. */ - virtual Rectangle implGetBoundingBoxOnScreen() override; - - - //// internal helper methods - ///** @attention This method requires a locked mutex. - // @return The XAccessibleTable interface of the specified header bar. */ - css::uno::Reference< css::accessibility::XAccessibleTable > - implGetHeaderBar( sal_Int32 nChildIndex ) - throw ( css::uno::RuntimeException ); -}; - - -} // namespace accessibility - - -#endif // ACCESSIBILITY_EXT_ACCESSIBILEGRIDCONTROLTABLE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlTableBase.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlTableBase.hxx deleted file mode 100644 index e2311aaa77b6..000000000000 --- a/accessibility/inc/accessibility/extended/AccessibleGridControlTableBase.hxx +++ /dev/null @@ -1,207 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEGRIDCONTROLTABLEBASE_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEGRIDCONTROLTABLEBASE_HXX - -#include "accessibility/extended/AccessibleGridControlBase.hxx" -#include -#include - - -namespace accessibility { - -typedef ::cppu::ImplHelper1 < css::accessibility::XAccessibleTable > - AccessibleGridControlTableImplHelper; - -/** The Grid Control accessible table objects inherit from this base class. It - implements basic functionality for the XAccessibleTable interface. - Grid COntrol table objects are: the data table, the column header bar and the - row header bar. */ -class AccessibleGridControlTableBase : - public GridControlAccessibleElement, - public AccessibleGridControlTableImplHelper -{ -public: - /** Constructor sets specified name and description. - @param rxParent XAccessible interface of the parent object. - @param rTable The Table control. - @param eObjType Type of table control object */ - AccessibleGridControlTableBase( - const css::uno::Reference< css::accessibility::XAccessible >& rxParent, - ::svt::table::IAccessibleTable& rTable, - ::svt::table::AccessibleTableControlObjType eObjType ); - -protected: - virtual ~AccessibleGridControlTableBase(); - -public: - // XAccessibleContext - - /** @return The count of visible children. */ - virtual sal_Int32 SAL_CALL getAccessibleChildCount() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return The role of this object (a table). */ - virtual sal_Int16 SAL_CALL getAccessibleRole() - throw ( css::uno::RuntimeException, std::exception ) override; - - /* Derived classes have to implement: - - getAccessibleChild, - - getAccessibleIndexInParent. */ - - // XAccessibleComponent - - /* Derived classes have to implement: - - getAccessibleAt, - - grabFocus. */ - - // XAccessibleTable - - /** @return The number of used rows in the table (0 = empty table). */ - virtual sal_Int32 SAL_CALL getAccessibleRowCount() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return The number of used columns in the table (0 = empty table). */ - virtual sal_Int32 SAL_CALL getAccessibleColumnCount() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return The row extent of the specified cell (always 1). */ - virtual sal_Int32 SAL_CALL - getAccessibleRowExtentAt( sal_Int32 nRow, sal_Int32 nColumn ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** @return The column extent of the specified cell (always 1). */ - virtual sal_Int32 SAL_CALL - getAccessibleColumnExtentAt( sal_Int32 nRow, sal_Int32 nColumn ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** @return The caption cell of the table (not supported). */ - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL - getAccessibleCaption() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return The summary object of the table (not supported). */ - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL - getAccessibleSummary() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return The child index of the specified cell. */ - virtual sal_Int32 SAL_CALL getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** @return The row index of the specified child cell. */ - virtual sal_Int32 SAL_CALL getAccessibleRow( sal_Int32 nChildIndex ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** @return The column index of the specified child cell. */ - virtual sal_Int32 SAL_CALL getAccessibleColumn( sal_Int32 nChildIndex ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /* Derived classes have to implement: - - getAccessibleRowDescription, - - getAccessibleColumnDescription, - - getAccessibleRowHeaders, - - getAccessibleColumnHeaders, - - getSelectedAccessibleRows, - - getSelectedAccessibleColumns, - - isAccessibleRowSelected, - - isAccessibleColumnSelected, - - getAccessibleCellAt, - - isAccessibleSelected. */ - - // XInterface - - /** Queries for a new interface. */ - css::uno::Any SAL_CALL queryInterface( const css::uno::Type& rType ) - throw ( css::uno::RuntimeException, std::exception ) override; - - /** Aquires the object (calls acquire() on base class). */ - virtual void SAL_CALL acquire() throw () override; - - /** Releases the object (calls release() on base class). */ - virtual void SAL_CALL release() throw () override; - - // XTypeProvider - - /** @return A sequence of possible types (received from base classes). */ - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return An unique implementation ID. */ - virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() - throw ( css::uno::RuntimeException, std::exception ) override; - -protected: - // internal helper methods - - /** @attention This method requires locked mutex's and a living object. - @return The number of cells of the table. */ - sal_Int32 implGetChildCount() const; - - /** @attention This method requires locked mutex's and a living object. - @return The row index of the specified cell index. */ - sal_Int32 implGetRow( sal_Int32 nChildIndex ) const; - /** @attention This method requires locked mutex's and a living object. - @return The column index of the specified cell index. */ - sal_Int32 implGetColumn( sal_Int32 nChildIndex ) const; - /** @attention This method requires locked mutex's and a living object. - @return The child index of the specified cell address. */ - sal_Int32 implGetChildIndex( sal_Int32 nRow, sal_Int32 nColumn ) const; - - /** Fills a sequence with sorted indexes of completely selected rows. - @attention This method requires locked mutex's and a living object. - @param rSeq Out-parameter that takes the sorted row index list. */ - void implGetSelectedRows( css::uno::Sequence< sal_Int32 >& rSeq ); - - /** @attention This method requires locked mutex's and a living object. - @throws IndexOutOfBoundsException - If the specified row index is invalid. */ - void ensureIsValidRow( sal_Int32 nRow ) - throw ( css::lang::IndexOutOfBoundsException ); - /** @attention This method requires locked mutex's and a living object. - @throws IndexOutOfBoundsException - If the specified column index is invalid. */ - void ensureIsValidColumn( sal_Int32 nColumn ) - throw ( css::lang::IndexOutOfBoundsException ); - /** @attention This method requires locked mutex's and a living object. - @throws IndexOutOfBoundsException - If the specified cell address is invalid. */ - void ensureIsValidAddress( sal_Int32 nRow, sal_Int32 nColumn ) - throw ( css::lang::IndexOutOfBoundsException ); - /** @attention This method requires locked mutex's and a living object. - @throws IndexOutOfBoundsException - If the specified child index is invalid. */ - void ensureIsValidIndex( sal_Int32 nChildIndex ) - throw ( css::lang::IndexOutOfBoundsException ); -}; - - -} // namespace accessibility - - -#endif // ACCESSIBILITY_EXT_ACCESSIBILEGRIDCONTROLTABLEBASE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlTableCell.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlTableCell.hxx deleted file mode 100644 index f03df43d2265..000000000000 --- a/accessibility/inc/accessibility/extended/AccessibleGridControlTableCell.hxx +++ /dev/null @@ -1,154 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEGRIDCONTROLTABLECELL_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEGRIDCONTROLTABLECELL_HXX - -#include -#include -#include "accessibility/extended/AccessibleGridControlBase.hxx" -#include - -namespace accessibility -{ - class AccessibleGridControlCell : public AccessibleGridControlBase - { - private: - sal_Int32 m_nRowPos; // the row number of the table cell - sal_Int32 m_nColPos; // the column id of the table cell - - protected: - // attribute access - inline sal_Int32 getRowPos( ) const { return m_nRowPos; } - inline sal_Int32 getColumnPos( ) const { return m_nColPos; } - - // XAccessibleComponent - virtual void SAL_CALL grabFocus() throw ( css::uno::RuntimeException, std::exception ) override; - - protected: - AccessibleGridControlCell( - const css::uno::Reference< css::accessibility::XAccessible >& _rxParent, - ::svt::table::IAccessibleTable& _rTable, - sal_Int32 _nRowPos, - sal_uInt16 _nColPos, - ::svt::table::AccessibleTableControlObjType _eType - ); - - virtual ~AccessibleGridControlCell(); - - private: - AccessibleGridControlCell( const AccessibleGridControlCell& ) = delete; - AccessibleGridControlCell& operator=( const AccessibleGridControlCell& ) = delete; - }; - - typedef ::cppu::ImplHelper2 < css::accessibility::XAccessibleText - , css::accessibility::XAccessible - > AccessibleTextHelper_BASE; - // implementation of a table cell of GridControl - class AccessibleGridControlTableCell :public AccessibleGridControlCell - ,public AccessibleTextHelper_BASE - ,public ::comphelper::OCommonAccessibleText - { - protected: - // OCommonAccessibleText - virtual OUString implGetText() override; - virtual css::lang::Locale implGetLocale() override; - virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override; - virtual Rectangle implGetBoundingBox() override; - virtual Rectangle implGetBoundingBoxOnScreen() override; - - public: - AccessibleGridControlTableCell( const css::uno::Reference< css::accessibility::XAccessible >& _rxParent, - ::svt::table::IAccessibleTable& _rTable, - sal_Int32 _nRowId, - sal_uInt16 _nColId, - svt::table::AccessibleTableControlObjType eObjType); - - // XInterface ------------------------------------------------------------- - - /** Queries for a new interface. */ - css::uno::Any SAL_CALL queryInterface( const css::uno::Type& rType ) - throw ( css::uno::RuntimeException, std::exception ) override; - - /** Aquires the object (calls acquire() on base class). */ - virtual void SAL_CALL acquire() throw () override; - - /** Releases the object (calls release() on base class). */ - virtual void SAL_CALL release() throw () override; - - /** @return The index of this object among the parent's children. */ - virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return - The name of this class. - */ - virtual OUString SAL_CALL getImplementationName() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return - The count of visible children. - */ - virtual sal_Int32 SAL_CALL getAccessibleChildCount() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return - The XAccessible interface of the specified child. - */ - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL - getAccessibleChild( sal_Int32 nChildIndex ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - /** Creates a new AccessibleStateSetHelper and fills it with states of the - current object. - @return - A filled AccessibleStateSetHelper. - */ - ::utl::AccessibleStateSetHelper* implCreateStateSetHelper() override; - - // XAccessible ------------------------------------------------------------ - - /** @return The XAccessibleContext interface of this object. */ - virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL - getAccessibleContext() - throw ( css::uno::RuntimeException, std::exception ) override; - - // XAccessibleText - virtual sal_Int32 SAL_CALL getCaretPosition() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getCharacterCount() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getSelectedText() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getSelectionStart() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getSelectionEnd() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getText() throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; - virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; - virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - }; -} -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEGRIDCONTROLTABLECELL_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/extended/accessiblebrowseboxcell.hxx b/accessibility/inc/accessibility/extended/accessiblebrowseboxcell.hxx deleted file mode 100644 index bafb0590da5c..000000000000 --- a/accessibility/inc/accessibility/extended/accessiblebrowseboxcell.hxx +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEBROWSEBOXCELL_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEBROWSEBOXCELL_HXX - -#include "accessibility/extended/AccessibleBrowseBoxBase.hxx" -#include - - -namespace accessibility -{ - - - // = AccessibleBrowseBoxCell - - /** common accessibility-functionality for browse box elements which occupy a cell - */ - class AccessibleBrowseBoxCell : public AccessibleBrowseBoxBase - { - private: - sal_Int32 m_nRowPos; // the row number of the table cell - sal_uInt16 m_nColPos; // the column id of the table cell - - protected: - // attribute access - inline sal_Int32 getRowPos( ) const { return m_nRowPos; } - inline sal_Int32 getColumnPos( ) const { return m_nColPos; } - - protected: - // AccessibleBrowseBoxBase overridables - virtual Rectangle implGetBoundingBox() override; - virtual Rectangle implGetBoundingBoxOnScreen() override; - - // XAccessibleComponent - virtual void SAL_CALL grabFocus() throw ( css::uno::RuntimeException, std::exception ) override; - - protected: - AccessibleBrowseBoxCell( - const css::uno::Reference< css::accessibility::XAccessible >& _rxParent, - ::svt::IAccessibleTableProvider& _rBrowseBox, - const css::uno::Reference< css::awt::XWindow >& _xFocusWindow, - sal_Int32 _nRowPos, - sal_uInt16 _nColPos, - ::svt::AccessibleBrowseBoxObjType _eType = ::svt::BBTYPE_TABLECELL - ); - - virtual ~AccessibleBrowseBoxCell(); - - private: - AccessibleBrowseBoxCell( const AccessibleBrowseBoxCell& ) = delete; - AccessibleBrowseBoxCell& operator=( const AccessibleBrowseBoxCell& ) = delete; - }; - - -} // namespace accessibility - - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEBROWSEBOXCELL_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/extended/accessibleeditbrowseboxcell.hxx b/accessibility/inc/accessibility/extended/accessibleeditbrowseboxcell.hxx deleted file mode 100644 index 8ec563a65e8b..000000000000 --- a/accessibility/inc/accessibility/extended/accessibleeditbrowseboxcell.hxx +++ /dev/null @@ -1,142 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEEDITBROWSEBOXCELL_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEEDITBROWSEBOXCELL_HXX - -#include "accessiblebrowseboxcell.hxx" -#include -#include -#include -#include -#include -#include -#include - -namespace accessibility -{ - - // = EditBrowseBoxTableCell - - class EditBrowseBoxTableCell :public AccessibleBrowseBoxCell - ,public ::comphelper::OAccessibleContextWrapperHelper - { - public: - EditBrowseBoxTableCell( - const css::uno::Reference< css::accessibility::XAccessible >& _rxParent, - const css::uno::Reference< css::accessibility::XAccessible >& _rxOwningAccessible, - const css::uno::Reference< css::accessibility::XAccessibleContext >& _xControlChild, - ::svt::IAccessibleTableProvider& _rBrowseBox, - const css::uno::Reference< css::awt::XWindow >& _xFocusWindow, - sal_Int32 _nRowPos, - sal_uInt16 _nColPos - ); - - protected: - virtual ~EditBrowseBoxTableCell(); - - protected: - // XAccessibleComponent - virtual sal_Int32 SAL_CALL getForeground( ) throw (css::uno::RuntimeException, std::exception) override ; - virtual sal_Int32 SAL_CALL getBackground( ) throw (css::uno::RuntimeException, std::exception) override ; - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() throw ( css::uno::RuntimeException, std::exception ) override; - - // XInterface - DECLARE_XINTERFACE( ) - // XTypeProvider - DECLARE_XTYPEPROVIDER( ) - - // XAccessibleContext - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleDescription( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleName( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (css::uno::RuntimeException, std::exception) override; - - sal_Int16 SAL_CALL getAccessibleRole() throw ( css::uno::RuntimeException, std::exception ) override; - - virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - - virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) throw (css::uno::RuntimeException, std::exception) override; - protected: - // OComponentHelper - virtual void SAL_CALL disposing() override; - - // XComponent/OComponentProxyAggregationHelper (needs to be disambiguated) - virtual void SAL_CALL dispose() throw( css::uno::RuntimeException, std::exception ) override; - - // OAccessibleContextWrapperHelper(); - void notifyTranslatedEvent( const css::accessibility::AccessibleEventObject& _rEvent ) throw (css::uno::RuntimeException) override; - - private: - EditBrowseBoxTableCell( const EditBrowseBoxTableCell& ) = delete; - EditBrowseBoxTableCell& operator=( const EditBrowseBoxTableCell& ) = delete; - }; - - - // = EditBrowseBoxTableCell - - // XAccessible providing an EditBrowseBoxTableCell - class EditBrowseBoxTableCellAccess: - public comphelper::OBaseMutex, - public cppu::WeakComponentImplHelper - { - protected: - css::uno::WeakReference< css::accessibility::XAccessibleContext > - m_aContext; - css::uno::Reference< css::accessibility::XAccessible > - m_xParent; - css::uno::Reference< css::accessibility::XAccessible > - m_xControlAccessible; - css::uno::Reference< css::awt::XWindow > - m_xFocusWindow; - ::svt::IAccessibleTableProvider* m_pBrowseBox; - sal_Int32 m_nRowPos; - sal_uInt16 m_nColPos; - - public: - EditBrowseBoxTableCellAccess( - const css::uno::Reference< css::accessibility::XAccessible >& _rxParent, - const css::uno::Reference< css::accessibility::XAccessible >& _rxControlAccessible, - const css::uno::Reference< css::awt::XWindow >& _rxFocusWindow, - ::svt::IAccessibleTableProvider& _rBrowseBox, - sal_Int32 _nRowPos, - sal_uInt16 _nColPos - ); - - protected: - virtual ~EditBrowseBoxTableCellAccess(); - - // XAccessible - virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (css::uno::RuntimeException, std::exception) override; - - // XComponent/OComponentHelper - virtual void SAL_CALL disposing() override; - - private: - EditBrowseBoxTableCellAccess( const EditBrowseBoxTableCellAccess& ) = delete; - EditBrowseBoxTableCellAccess& operator=( const EditBrowseBoxTableCellAccess& ) = delete; - }; -} - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEEDITBROWSEBOXCELL_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/extended/accessibleiconchoicectrl.hxx b/accessibility/inc/accessibility/extended/accessibleiconchoicectrl.hxx deleted file mode 100644 index 0bcaea64a6b8..000000000000 --- a/accessibility/inc/accessibility/extended/accessibleiconchoicectrl.hxx +++ /dev/null @@ -1,110 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEICONCHOICECTRL_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEICONCHOICECTRL_HXX - -#include -#include -#include -#include -#include - -// class AccessibleListBox ----------------------------------------------- - -class SvtIconChoiceCtrl; - -namespace accessibility -{ - typedef ::cppu::ImplHelper2< css::accessibility::XAccessible - , css::accessibility::XAccessibleSelection> AccessibleIconChoiceCtrl_BASE; - - /** the class OAccessibleListBoxEntry represents the base class for an accessible object of a listbox entry - */ - class AccessibleIconChoiceCtrl :public AccessibleIconChoiceCtrl_BASE - ,public VCLXAccessibleComponent - { - protected: - css::uno::Reference< css::accessibility::XAccessible > m_xParent; - - protected: - virtual ~AccessibleIconChoiceCtrl(); - - /** this function is called upon disposing the component */ - virtual void SAL_CALL disposing() override; - - virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; - virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) override; - - VclPtr< SvtIconChoiceCtrl > getCtrl(); - - public: - /** OAccessibleBase needs a valid view - @param _rIconCtrl - is the box for which we implement an accessible object - @param _xParent - is our parent accessible object - */ - AccessibleIconChoiceCtrl( SvtIconChoiceCtrl& _rIconCtrl, - const css::uno::Reference< css::accessibility::XAccessible >& _xParent ); - - // XTypeProvider - DECLARE_XTYPEPROVIDER() - - // XInterface - DECLARE_XINTERFACE() - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() throw(css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(css::uno::RuntimeException, std::exception) override; - - // XServiceInfo - static methods - static css::uno::Sequence< OUString > getSupportedServiceNames_Static() throw(css::uno::RuntimeException); - static OUString getImplementationName_Static() throw(css::uno::RuntimeException); - - // XAccessible - virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleContext - virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleDescription( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleName( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleSelection - void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - void SAL_CALL clearAccessibleSelection( ) throw (css::uno::RuntimeException, std::exception) override; - void SAL_CALL selectAllAccessibleChildren( ) throw (css::uno::RuntimeException, std::exception) override; - sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; - css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - }; - - -}// namespace accessibility - - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEICONCHOICECTRL_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/extended/accessibleiconchoicectrlentry.hxx b/accessibility/inc/accessibility/extended/accessibleiconchoicectrlentry.hxx deleted file mode 100644 index 180aedf06090..000000000000 --- a/accessibility/inc/accessibility/extended/accessibleiconchoicectrlentry.hxx +++ /dev/null @@ -1,191 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEICONCHOICECTRLENTRY_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEICONCHOICECTRLENTRY_HXX - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// forward - -class SvxIconChoiceCtrlEntry; -class SvtIconChoiceCtrl; - -namespace accessibility -{ - -// class AccessibleIconChoiceCtrlEntry - - typedef ::cppu::WeakAggComponentImplHelper8< css::accessibility::XAccessible - , css::accessibility::XAccessibleContext - , css::accessibility::XAccessibleComponent - , css::accessibility::XAccessibleEventBroadcaster - , css::accessibility::XAccessibleText - , css::accessibility::XAccessibleAction - , css::lang::XServiceInfo - , css::lang::XEventListener > AccessibleIconChoiceCtrlEntry_BASE; - - /** the class AccessibleListBoxEntry represents the class for an accessible object of a listbox entry */ - class AccessibleIconChoiceCtrlEntry : public ::comphelper::OBaseMutex, - public AccessibleIconChoiceCtrlEntry_BASE, - public ::comphelper::OCommonAccessibleText - { - private: - /** The treelistbox control */ - VclPtr m_pIconCtrl; - sal_Int32 m_nIndex; - - protected: - /// client id in the AccessibleEventNotifier queue - sal_uInt32 m_nClientId; - - css::uno::Reference< css::accessibility::XAccessible > m_xParent; - - private: - Rectangle GetBoundingBox_Impl() const; - Rectangle GetBoundingBoxOnScreen_Impl() const; - bool IsAlive_Impl() const; - bool IsShowing_Impl() const; - - Rectangle GetBoundingBox() - throw (css::lang::DisposedException, - css::uno::RuntimeException); - Rectangle GetBoundingBoxOnScreen() - throw (css::lang::DisposedException, - css::uno::RuntimeException); - void EnsureIsAlive() const throw ( css::lang::DisposedException ); - - protected: - virtual ~AccessibleIconChoiceCtrlEntry(); - /** this function is called upon disposing the component - */ - virtual void SAL_CALL disposing() override; - - // OCommonAccessibleText - virtual OUString implGetText() override; - virtual css::lang::Locale implGetLocale() override; - virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override; - - public: - /** Ctor() - @param _rIconCtrl - the icon control - @param _nPos - the entry number - @param _xParent - is our parent accessible object - */ - AccessibleIconChoiceCtrlEntry( SvtIconChoiceCtrl& _rIconCtrl, - sal_Int32 _nPos, - const css::uno::Reference< css::accessibility::XAccessible >& _xParent ); - - // XTypeProvider - virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (css::uno::RuntimeException, std::exception) override; - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() throw(css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(css::uno::RuntimeException, std::exception) override; - - // XServiceInfo - static methods - static css::uno::Sequence< OUString > getSupportedServiceNames_Static() throw(css::uno::RuntimeException); - static OUString getImplementationName_Static() throw(css::uno::RuntimeException); - - // XEventListener - virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) throw(css::uno::RuntimeException, std::exception) override; - - // XAccessible - virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleContext - virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleDescription( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleName( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::lang::Locale SAL_CALL getLocale( ) throw (css::accessibility::IllegalAccessibleComponentStateException, css::uno::RuntimeException, std::exception) override; - - // XAccessibleComponent - virtual sal_Bool SAL_CALL containsPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::awt::Rectangle SAL_CALL getBounds( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::awt::Point SAL_CALL getLocation( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::awt::Point SAL_CALL getLocationOnScreen( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::awt::Size SAL_CALL getSize( ) throw (css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL grabFocus( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getForeground( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getBackground( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleText - virtual sal_Int32 SAL_CALL getCaretPosition() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getCharacterCount() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getSelectedText() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getSelectionStart() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getSelectionEnd() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getText() throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; - virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; - virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - - // XAccessibleEventBroadcaster - virtual void SAL_CALL addAccessibleEventListener( const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener ) throw (css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL removeAccessibleEventListener( const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleAction - virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL doAccessibleAction( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleActionDescription( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - }; - - -}// namespace accessibility - - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLEICONCHOICECTRLENTRY_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/extended/accessiblelistbox.hxx b/accessibility/inc/accessibility/extended/accessiblelistbox.hxx deleted file mode 100644 index a6e0c5cae09c..000000000000 --- a/accessibility/inc/accessibility/extended/accessiblelistbox.hxx +++ /dev/null @@ -1,133 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLELISTBOX_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLELISTBOX_HXX - -#include -#include -#include -#include -#include - -#include - -// class AccessibleListBox ----------------------------------------------- - -class SvTreeListBox; -class SvTreeListEntry; - -namespace accessibility -{ - class AccessibleListBoxEntry; - - /** the class OAccessibleListBoxEntry represents the base class for an accessible object of a listbox entry - */ - class AccessibleListBox: - public cppu::ImplHelper2< - css::accessibility::XAccessible, - css::accessibility::XAccessibleSelection>, - public VCLXAccessibleComponent - { - protected: - - css::uno::Reference< css::accessibility::XAccessible > m_xParent; - - protected: - virtual ~AccessibleListBox(); - - // OComponentHelper overridables - /** this function is called upon disposing the component */ - virtual void SAL_CALL disposing() override; - - // VCLXAccessibleComponent - virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; - virtual void ProcessWindowChildEvent( const VclWindowEvent& rVclWindowEvent ) override; - virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) override; - - VclPtr< SvTreeListBox > getListBox() const; - - void RemoveChildEntries(SvTreeListEntry*); - - sal_Int32 GetRoleType(); - - public: - /** OAccessibleBase needs a valid view - @param _rListBox - is the box for which we implement an accessible object - @param _xParent - is our parent accessible object - */ - AccessibleListBox( SvTreeListBox& _rListBox, - const css::uno::Reference< css::accessibility::XAccessible >& _xParent ); - - // XTypeProvider - DECLARE_XTYPEPROVIDER() - - // XInterface - DECLARE_XINTERFACE() - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() throw(css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(css::uno::RuntimeException, std::exception) override; - - // XServiceInfo - static methods - static css::uno::Sequence< OUString > getSupportedServiceNames_Static() throw(css::uno::RuntimeException); - static OUString getImplementationName_Static() throw(css::uno::RuntimeException); - - // XAccessible - virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleContext - virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleDescription( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleName( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleSelection - void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - void SAL_CALL clearAccessibleSelection( ) throw (css::uno::RuntimeException, std::exception) override; - void SAL_CALL selectAllAccessibleChildren( ) throw (css::uno::RuntimeException, std::exception) override; - sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; - css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - -private: - - typedef std::map< SvTreeListEntry*, css::uno::Reference< css::accessibility::XAccessible > > MAP_ENTRY; - MAP_ENTRY m_mapEntry; - - css::uno::Reference< css::accessibility::XAccessible > m_xFocusedChild; - - accessibility::AccessibleListBoxEntry* GetCurEventEntry( const VclWindowEvent& rVclWindowEvent ); - - }; - - -}// namespace accessibility - - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLELISTBOX_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/extended/accessiblelistboxentry.hxx b/accessibility/inc/accessibility/extended/accessiblelistboxentry.hxx deleted file mode 100644 index 3ce874162b92..000000000000 --- a/accessibility/inc/accessibility/extended/accessiblelistboxentry.hxx +++ /dev/null @@ -1,230 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLELISTBOXENTRY_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLELISTBOXENTRY_HXX - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "accessibility/extended/listboxaccessible.hxx" - -// forward --------------------------------------------------------------- - -namespace com { namespace sun { namespace star { namespace awt { - struct Point; - struct Rectangle; - struct Size; - class XFocusListener; -} } } } - -class SvTreeListBox; -class SvTreeListEntry; - - -namespace accessibility -{ - - -// class AccessibleListBoxEntry ------------------------------------------ - typedef ::cppu::WeakAggComponentImplHelper9< css::accessibility::XAccessible - , css::accessibility::XAccessibleContext - , css::accessibility::XAccessibleComponent - , css::accessibility::XAccessibleEventBroadcaster - , css::accessibility::XAccessibleAction - , css::accessibility::XAccessibleSelection - , css::accessibility::XAccessibleText - , css::accessibility::XAccessibleValue - , css::lang::XServiceInfo > AccessibleListBoxEntry_BASE; - - /** the class AccessibleListBoxEntry represents the class for an accessible object of a listbox entry */ - class AccessibleListBoxEntry:public ::comphelper::OBaseMutex - ,public AccessibleListBoxEntry_BASE - ,public ::comphelper::OCommonAccessibleText - ,public ListBoxAccessibleBase - { - friend class AccessibleListBox; - - private: - /** The treelistbox control */ - ::std::deque< sal_Int32 > m_aEntryPath; - SvTreeListEntry* m_pSvLBoxEntry; // Needed for a11y focused item... - - - protected: - /// client id in the AccessibleEventNotifier queue - sal_uInt32 m_nClientId; - - css::uno::WeakReference< css::accessibility::XAccessible > - m_aParent; - - private: - Rectangle GetBoundingBox_Impl() const; - Rectangle GetBoundingBoxOnScreen_Impl() const; - bool IsAlive_Impl() const; - bool IsShowing_Impl() const; - - Rectangle GetBoundingBox() - throw (css::lang::DisposedException, - css::uno::RuntimeException); - Rectangle GetBoundingBoxOnScreen() - throw (css::lang::DisposedException, - css::uno::RuntimeException); - void EnsureIsAlive() const throw ( css::lang::DisposedException ); - - void NotifyAccessibleEvent( sal_Int16 _nEventId, const css::uno::Any& _aOldValue, const css::uno::Any& _aNewValue ); - - protected: - virtual ~AccessibleListBoxEntry(); - - /** this function is called upon disposing the component - */ - virtual void SAL_CALL disposing() override; - - // ListBoxAccessible/XComponent - virtual void SAL_CALL dispose() throw ( css::uno::RuntimeException, std::exception ) override; - - // OCommonAccessibleText - virtual OUString implGetText() override; - virtual css::lang::Locale implGetLocale() override; - virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override; - - public: - /** Ctor() - @param _rListBox - the view control - @param _pEntry - the entry - @param _xParent - is our parent accessible object - */ - AccessibleListBoxEntry( SvTreeListBox& _rListBox, SvTreeListEntry* _pEntry, - const css::uno::Reference< css::accessibility::XAccessible >& _xParent ); - - SvTreeListEntry* GetSvLBoxEntry() const { return m_pSvLBoxEntry; } - - - protected: - // XTypeProvider - virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (css::uno::RuntimeException, std::exception) override; - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() throw(css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(css::uno::RuntimeException, std::exception) override; - - // XServiceInfo - static methods - static css::uno::Sequence< OUString > getSupportedServiceNames_Static() throw(css::uno::RuntimeException); - static OUString getImplementationName_Static() throw(css::uno::RuntimeException); - - // XAccessible - virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleContext - virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleDescription( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleName( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::lang::Locale SAL_CALL getLocale( ) throw (css::accessibility::IllegalAccessibleComponentStateException, css::uno::RuntimeException, std::exception) override; - - // XAccessibleComponent - virtual sal_Bool SAL_CALL containsPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::awt::Rectangle SAL_CALL getBounds( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::awt::Point SAL_CALL getLocation( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::awt::Point SAL_CALL getLocationOnScreen( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::awt::Size SAL_CALL getSize( ) throw (css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL grabFocus( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getForeground( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getBackground( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleText - virtual sal_Int32 SAL_CALL getCaretPosition() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getCharacterCount() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getSelectedText() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getSelectionStart() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getSelectionEnd() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getText() throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; - virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; - virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - - // XAccessibleEventBroadcaster - virtual void SAL_CALL addAccessibleEventListener( const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener ) throw (css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL removeAccessibleEventListener( const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleAction - virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL doAccessibleAction( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleActionDescription( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - - // XAccessibleSelection - void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - void SAL_CALL clearAccessibleSelection( ) throw (css::uno::RuntimeException, std::exception) override; - void SAL_CALL selectAllAccessibleChildren( ) throw (css::uno::RuntimeException, std::exception) override; - sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; - css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::uno::Any SAL_CALL getCurrentValue( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL setCurrentValue( const css::uno::Any& aNumber ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Any SAL_CALL getMaximumValue( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Any SAL_CALL getMinimumValue( ) throw (css::uno::RuntimeException, std::exception) override; - private: - css::uno::Reference< css::accessibility::XAccessible > implGetParentAccessible( ) const; - SvTreeListEntry* GetRealChild(sal_Int32 nIndex); - sal_Int32 GetRoleType(); - }; - - -}// namespace accessibility - - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLELISTBOXENTRY_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/extended/accessibletabbar.hxx b/accessibility/inc/accessibility/extended/accessibletabbar.hxx deleted file mode 100644 index 60c8d52a78f7..000000000000 --- a/accessibility/inc/accessibility/extended/accessibletabbar.hxx +++ /dev/null @@ -1,112 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLETABBAR_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLETABBAR_HXX - -#include -#include -#include -#include "accessibility/extended/accessibletabbarbase.hxx" - -#include - -namespace utl { -class AccessibleStateSetHelper; -} - - -namespace accessibility -{ - - - // class AccessibleTabBar - - - typedef ::cppu::ImplHelper2< - css::accessibility::XAccessible, - css::lang::XServiceInfo > AccessibleTabBar_BASE; - - class AccessibleTabBar : public AccessibleTabBarBase, - public AccessibleTabBar_BASE - { - private: - typedef ::std::vector< css::uno::Reference< css::accessibility::XAccessible > > AccessibleChildren; - - AccessibleChildren m_aAccessibleChildren; - - protected: - virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; - void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ); - - // OCommonAccessibleComponent - virtual css::awt::Rectangle implGetBounds( ) throw (css::uno::RuntimeException) override; - - // XComponent - virtual void SAL_CALL disposing() override; - - public: - AccessibleTabBar( TabBar* pTabBar ); - virtual ~AccessibleTabBar(); - - // XInterface - DECLARE_XINTERFACE() - - // XTypeProvider - DECLARE_XTYPEPROVIDER() - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; - - // XAccessible - virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleContext - virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleDescription( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleName( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::lang::Locale SAL_CALL getLocale( ) throw (css::accessibility::IllegalAccessibleComponentStateException, css::uno::RuntimeException, std::exception) override; - - // XAccessibleComponent - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL grabFocus( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getForeground( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getBackground( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleExtendedComponent - virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getTitledBorderText( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getToolTipText( ) throw (css::uno::RuntimeException, std::exception) override; - }; - - -} // namespace accessibility - - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLETABBAR_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/extended/accessibletabbarbase.hxx b/accessibility/inc/accessibility/extended/accessibletabbarbase.hxx deleted file mode 100644 index 40fadf73d497..000000000000 --- a/accessibility/inc/accessibility/extended/accessibletabbarbase.hxx +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLETABBARBASE_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLETABBARBASE_HXX - -#include -#include -#include - -class TabBar; -class VCLExternalSolarLock; -class VclSimpleEvent; -class VclWindowEvent; - - -namespace accessibility -{ - -class AccessibleTabBarBase : public comphelper::OAccessibleExtendedComponentHelper -{ -public: - explicit AccessibleTabBarBase( TabBar* pTabBar ); - virtual ~AccessibleTabBarBase(); - -protected: - DECL_LINK_TYPED( WindowEventListener, VclWindowEvent&, void ); - - virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); - - // XComponent - virtual void SAL_CALL disposing() override; - -private: - void SetTabBarPointer( TabBar* pTabBar ); - void ClearTabBarPointer(); - -protected: - VCLExternalSolarLock* m_pExternalLock; - VclPtr m_pTabBar; -}; - - -} // namespace accessibility - - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/extended/accessibletabbarpage.hxx b/accessibility/inc/accessibility/extended/accessibletabbarpage.hxx deleted file mode 100644 index 8904a14bd7b0..000000000000 --- a/accessibility/inc/accessibility/extended/accessibletabbarpage.hxx +++ /dev/null @@ -1,128 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLETABBARPAGE_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLETABBARPAGE_HXX - -#include -#include -#include -#include "accessibility/extended/accessibletabbarbase.hxx" - -#include - -namespace utl { -class AccessibleStateSetHelper; -} - - -namespace accessibility -{ - - - // class AccessibleTabBarPage - - - typedef ::cppu::ImplHelper2< - css::accessibility::XAccessible, - css::lang::XServiceInfo > AccessibleTabBarPage_BASE; - - class AccessibleTabBarPage : public AccessibleTabBarBase, - public AccessibleTabBarPage_BASE - { - friend class AccessibleTabBarPageList; - - private: - sal_uInt16 m_nPageId; - bool m_bEnabled; - bool m_bShowing; - bool m_bSelected; - OUString m_sPageText; - - css::uno::Reference< css::accessibility::XAccessible > m_xParent; - - protected: - bool IsEnabled(); - bool IsShowing(); - bool IsSelected(); - - void SetShowing( bool bShowing ); - void SetSelected( bool bSelected ); - void SetPageText( const OUString& sPageText ); - - sal_uInt16 GetPageId() const { return m_nPageId; } - - void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ); - - // OCommonAccessibleComponent - virtual css::awt::Rectangle implGetBounds( ) throw (css::uno::RuntimeException) override; - - // XComponent - virtual void SAL_CALL disposing() override; - - public: - AccessibleTabBarPage( TabBar* pTabBar, sal_uInt16 nPageId, - const css::uno::Reference< css::accessibility::XAccessible >& rxParent ); - virtual ~AccessibleTabBarPage(); - - // XInterface - DECLARE_XINTERFACE() - - // XTypeProvider - DECLARE_XTYPEPROVIDER() - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; - - // XAccessible - virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleContext - virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleDescription( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleName( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::lang::Locale SAL_CALL getLocale( ) throw (css::accessibility::IllegalAccessibleComponentStateException, css::uno::RuntimeException, std::exception) override; - - // XAccessibleComponent - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL grabFocus( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getForeground( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getBackground( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleExtendedComponent - virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getTitledBorderText( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getToolTipText( ) throw (css::uno::RuntimeException, std::exception) override; - }; - - -} // namespace accessibility - - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLETABBARPAGE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/extended/accessibletabbarpagelist.hxx b/accessibility/inc/accessibility/extended/accessibletabbarpagelist.hxx deleted file mode 100644 index a9d7556ba105..000000000000 --- a/accessibility/inc/accessibility/extended/accessibletabbarpagelist.hxx +++ /dev/null @@ -1,132 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLETABBARPAGELIST_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLETABBARPAGELIST_HXX - -#include -#include -#include -#include -#include "accessibility/extended/accessibletabbarbase.hxx" - -#include - -namespace utl { -class AccessibleStateSetHelper; -} - - -namespace accessibility -{ - - - // class AccessibleTabBarPageList - - - typedef ::cppu::ImplHelper3< - css::accessibility::XAccessible, - css::accessibility::XAccessibleSelection, - css::lang::XServiceInfo > AccessibleTabBarPageList_BASE; - - class AccessibleTabBarPageList : public AccessibleTabBarBase, - public AccessibleTabBarPageList_BASE - { - private: - typedef ::std::vector< css::uno::Reference< css::accessibility::XAccessible > > AccessibleChildren; - - AccessibleChildren m_aAccessibleChildren; - sal_Int32 m_nIndexInParent; - - protected: - void UpdateShowing( bool bShowing ); - void UpdateSelected( sal_Int32 i, bool bSelected ); - void UpdatePageText( sal_Int32 i ); - - void InsertChild( sal_Int32 i ); - void RemoveChild( sal_Int32 i ); - void MoveChild( sal_Int32 i, sal_Int32 j ); - - virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; - void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ); - - // OCommonAccessibleComponent - virtual css::awt::Rectangle implGetBounds( ) throw (css::uno::RuntimeException) override; - - // XComponent - virtual void SAL_CALL disposing() override; - - public: - AccessibleTabBarPageList( TabBar* pTabBar, sal_Int32 nIndexInParent ); - virtual ~AccessibleTabBarPageList(); - - // XInterface - DECLARE_XINTERFACE() - - // XTypeProvider - DECLARE_XTYPEPROVIDER() - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; - - // XAccessible - virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleContext - virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleDescription( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleName( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::lang::Locale SAL_CALL getLocale( ) throw (css::accessibility::IllegalAccessibleComponentStateException, css::uno::RuntimeException, std::exception) override; - - // XAccessibleComponent - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL grabFocus( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getForeground( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getBackground( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleExtendedComponent - virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getTitledBorderText( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getToolTipText( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleSelection - virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL clearAccessibleSelection( ) throw (css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL selectAllAccessibleChildren( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - }; - - -} // namespace accessibility - - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLETABBARPAGELIST_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/extended/accessibletablistbox.hxx b/accessibility/inc/accessibility/extended/accessibletablistbox.hxx deleted file mode 100644 index bfc9e2a2c80e..000000000000 --- a/accessibility/inc/accessibility/extended/accessibletablistbox.hxx +++ /dev/null @@ -1,104 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLETABLISTBOX_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLETABLISTBOX_HXX - -#include "AccessibleBrowseBox.hxx" -#include -#include -#include - -class SvHeaderTabListBox; - - -namespace accessibility { - -class AccessibleBrowseBoxTable; - -typedef ::cppu::ImplHelper1 < css::accessibility::XAccessible - > AccessibleTabListBox_Base; - -/** !!! */ -class AccessibleTabListBox - :public AccessibleBrowseBox - ,public AccessibleTabListBox_Base - ,public ::svt::IAccessibleTabListBox -{ -private: - VclPtr m_pTabListBox; - -public: - /** ctor() - @param rxParent XAccessible interface of the parent object. - @param rBox The HeaderTabListBox control. */ - AccessibleTabListBox( - const css::uno::Reference< css::accessibility::XAccessible >& rxParent, - SvHeaderTabListBox& rBox ); - -public: - // XInterface - DECLARE_XINTERFACE( ) - // XTypeProvider - DECLARE_XTYPEPROVIDER( ) - - // XAccessibleContext ----------------------------------------------------- - - /** @return The count of visible children. */ - virtual sal_Int32 SAL_CALL getAccessibleChildCount() - throw ( css::uno::RuntimeException, std::exception ) override; - - /** @return The XAccessible interface of the specified child. */ - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL - getAccessibleChild( sal_Int32 nChildIndex ) - throw ( css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception ) override; - - // XAccessibleContext - css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() throw ( css::uno::RuntimeException, std::exception ) override; - - // IAccessibleTabListBox - virtual css::uno::Reference< css::accessibility::XAccessible > - getMyself() override - { - return this; - } - - css::uno::Reference< css::accessibility::XAccessible > - getHeaderBar() override - { - return AccessibleBrowseBox::getHeaderBar( svt::BBTYPE_COLUMNHEADERBAR ); - } - -protected: - /** dtor() */ - virtual ~AccessibleTabListBox(); - - /** This method creates and returns an accessible table. - @return An AccessibleBrowseBoxTable. */ - virtual AccessibleBrowseBoxTable* createAccessibleTable() override; -}; - - -} // namespace accessibility - - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLETABLISTBOX_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/extended/accessibletablistboxtable.hxx b/accessibility/inc/accessibility/extended/accessibletablistboxtable.hxx deleted file mode 100644 index 4c79a9962871..000000000000 --- a/accessibility/inc/accessibility/extended/accessibletablistboxtable.hxx +++ /dev/null @@ -1,109 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLETABLISTBOXTABLE_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLETABLISTBOXTABLE_HXX - -#include "AccessibleBrowseBoxTable.hxx" -#include -#include -#include - -class SvHeaderTabListBox; - - -namespace accessibility { - -typedef ::cppu::ImplHelper1< css::accessibility::XAccessibleSelection > - AccessibleTabListBoxTableImplHelper; - -class AccessibleTabListBoxTable : public AccessibleBrowseBoxTable, public AccessibleTabListBoxTableImplHelper -{ -private: - VclPtr m_pTabListBox; - - css::uno::Reference< css::accessibility::XAccessible > m_xCurChild; - - void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); - DECL_LINK_TYPED( WindowEventListener, VclWindowEvent&, void ); - - // helpers ---------------------------------------------------------------- - - /** Throws an exception, if nIndex is not a valid child index. */ - void ensureValidIndex( sal_Int32 _nIndex ) const; - - /** Returns true, if the specified row is selected. */ - bool implIsRowSelected( sal_Int32 _nRow ) const; - /** Selects the specified row. */ - void implSelectRow( sal_Int32 _nRow, bool _bSelect ); - - /** Returns the count of rows in the table. */ - sal_Int32 implGetRowCount() const override; - /** Returns the total column count in the table. */ - sal_Int32 implGetColumnCount() const override; - /** Returns the count of selected rows in the table. */ - sal_Int32 implGetSelRowCount() const; - /** Returns the total cell count in the table (including header). */ - inline sal_Int32 implGetCellCount() const { return implGetRowCount() * implGetColumnCount(); } - - /** Returns the row index from cell index. */ - inline sal_Int32 implGetRow( sal_Int32 _nIndex ) const { return _nIndex / implGetColumnCount(); } - /** Returns the absolute row index of the nSelRow-th selected row. */ - sal_Int32 implGetSelRow( sal_Int32 _nSelRow ) const; - -public: - /** ctor() - @param rxParent XAccessible interface of the parent object. - @param rBox The HeaderTabListBox control. */ - AccessibleTabListBoxTable( - const css::uno::Reference< css::accessibility::XAccessible >& rxParent, - SvHeaderTabListBox& rBox ); - -protected: - /** dtor() */ - virtual ~AccessibleTabListBoxTable(); - -public: - // XInterface - DECLARE_XINTERFACE( ) - - // XTypeProvider - DECLARE_XTYPEPROVIDER( ) - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() - throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleSelection - void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - void SAL_CALL clearAccessibleSelection( ) throw (css::uno::RuntimeException, std::exception) override; - void SAL_CALL selectAllAccessibleChildren( ) throw (css::uno::RuntimeException, std::exception) override; - sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; - css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; -}; - - -} // namespace accessibility - - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_ACCESSIBLETABLISTBOXTABLE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/extended/listboxaccessible.hxx b/accessibility/inc/accessibility/extended/listboxaccessible.hxx deleted file mode 100644 index ed6e0a29d783..000000000000 --- a/accessibility/inc/accessibility/extended/listboxaccessible.hxx +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_LISTBOXACCESSIBLE_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_LISTBOXACCESSIBLE_HXX - -#include -#include -#include - -class SvTreeListBox; -class VclSimpleEvent; -class VclWindowEvent; - -namespace accessibility -{ - - /** helper class which couples its life time to the life time of an - SvTreeListBox - */ - class ListBoxAccessibleBase - { - private: - VclPtr m_pWindow; - - protected: - inline SvTreeListBox* getListBox() const - { - return const_cast< ListBoxAccessibleBase* >( this )->m_pWindow; - } - - inline bool isAlive() const { return nullptr != m_pWindow; } - - public: - ListBoxAccessibleBase( SvTreeListBox& _rWindow ); - - protected: - virtual ~ListBoxAccessibleBase( ); - - // own overridables - /// will be called for any VclWindowEvent events broadcasted by our VCL window - void ProcessWindowEvent( const VclWindowEvent& _rVclWindowEvent ); - - /** will be called when our window broadcasts the VCLEVENT_OBJECT_DYING event - -

Usually, you derive your class from both ListBoxAccessibleBase and XComponent, - and call XComponent::dispose here.

- */ - virtual void SAL_CALL dispose() throw ( css::uno::RuntimeException, std::exception ) = 0; - - /// to be called in the dispose method of your derived class - void disposing(); - - private: - DECL_LINK_TYPED( WindowEventListener, VclWindowEvent&, void ); - - private: - ListBoxAccessibleBase( const ListBoxAccessibleBase& ) = delete; - ListBoxAccessibleBase& operator=( const ListBoxAccessibleBase& ) = delete; - }; - - -} // namespace accessibility - - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_LISTBOXACCESSIBLE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/extended/textwindowaccessibility.hxx b/accessibility/inc/accessibility/extended/textwindowaccessibility.hxx deleted file mode 100644 index 6d101612f54f..000000000000 --- a/accessibility/inc/accessibility/extended/textwindowaccessibility.hxx +++ /dev/null @@ -1,693 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_TEXTWINDOWACCESSIBILITY_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_TEXTWINDOWACCESSIBILITY_HXX - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -class TextEngine; -class TextView; - -namespace accessibility -{ - -class Document; - -class SfxListenerGuard -{ -public: - inline SfxListenerGuard(::SfxListener & rListener): - m_rListener(rListener), m_pNotifier(nullptr) {} - - inline ~SfxListenerGuard() { endListening(); } - - // Not thread safe: - void startListening(::SfxBroadcaster & rNotifier); - - // Not thread safe: - void endListening(); - -private: - ::SfxListener & m_rListener; - ::SfxBroadcaster * m_pNotifier; -}; - -class WindowListenerGuard -{ -public: - inline WindowListenerGuard(::Link const & rListener): - m_aListener(rListener), m_pNotifier(nullptr) {} - - inline ~WindowListenerGuard() { endListening(); } - - // Not thread safe: - void startListening(vcl::Window & rNotifier); - - // Not thread safe: - void endListening(); - -private: - ::Link m_aListener; - VclPtr m_pNotifier; -}; - -class ParagraphInfo -{ -public: - inline ParagraphInfo(::sal_Int32 nHeight): m_nHeight(nHeight) {} - - inline - css::uno::WeakReference< css::accessibility::XAccessible > const & - getParagraph() const { return m_xParagraph; } - - inline ::sal_Int32 getHeight() const { return m_nHeight; } - - inline void setParagraph( - css::uno::Reference< css::accessibility::XAccessible > const & - rParagraph) { m_xParagraph = rParagraph; } - - inline void changeHeight(::sal_Int32 nHeight) { m_nHeight = nHeight; } - -private: - css::uno::WeakReference< css::accessibility::XAccessible > - m_xParagraph; - ::sal_Int32 m_nHeight; -}; - -typedef ::std::vector< ParagraphInfo > Paragraphs; - -typedef ::cppu::WeakAggComponentImplHelper7< - css::accessibility::XAccessible, - css::accessibility::XAccessibleContext, - css::accessibility::XAccessibleComponent, - css::accessibility::XAccessibleEditableText, - css::accessibility::XAccessibleMultiLineText, - css::accessibility::XAccessibleTextAttributes, - css::accessibility::XAccessibleEventBroadcaster > ParagraphBase; - -// The Paragraph's number is the absolute position within the text engine (from -// 0 to N - 1), whereas the Paragraph's index is the position within the text -// view/accessible parent (from 0 to M - 1). Paragraphs outside the currently -// visible range have an index of -1. -class Paragraph: - private cppu::BaseMutex, public ParagraphBase, private ::comphelper::OCommonAccessibleText -{ -public: - Paragraph(::rtl::Reference< Document > const & rDocument, - Paragraphs::size_type nNumber); - - // Not thread-safe. - inline Paragraphs::size_type getNumber() const { return m_nNumber; } - - // Not thread-safe. - void numberChanged(bool bIncremented); - - // Not thread-safe. - void textChanged(); - - // Thread-safe. - void notifyEvent(::sal_Int16 nEventId, css::uno::Any const & rOldValue, - css::uno::Any const & rNewValue); - -protected: - // OCommonAccessibleText - virtual void implGetParagraphBoundary( css::i18n::Boundary& rBoundary, - ::sal_Int32 nIndex ) override; - virtual void implGetLineBoundary( css::i18n::Boundary& rBoundary, - ::sal_Int32 nIndex ) override; - -private: - virtual css::uno::Reference< css::accessibility::XAccessibleContext > - SAL_CALL getAccessibleContext() throw (css::uno::RuntimeException, std::exception) override; - - virtual ::sal_Int32 SAL_CALL getAccessibleChildCount() - throw (css::uno::RuntimeException, std::exception) override; - - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL - getAccessibleChild(::sal_Int32 i) - throw (css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception) override; - - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL - getAccessibleParent() throw (css::uno::RuntimeException, std::exception) override; - - virtual ::sal_Int32 SAL_CALL getAccessibleIndexInParent() - throw (css::uno::RuntimeException, std::exception) override; - - virtual ::sal_Int16 SAL_CALL getAccessibleRole() - throw (css::uno::RuntimeException, std::exception) override; - - virtual OUString SAL_CALL getAccessibleDescription() - throw (css::uno::RuntimeException, std::exception) override; - - virtual OUString SAL_CALL getAccessibleName() - throw (css::uno::RuntimeException, std::exception) override; - - virtual - css::uno::Reference< css::accessibility::XAccessibleRelationSet > - SAL_CALL getAccessibleRelationSet() throw (css::uno::RuntimeException, std::exception) override; - - virtual - css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL - getAccessibleStateSet() throw (css::uno::RuntimeException, std::exception) override; - - virtual css::lang::Locale SAL_CALL getLocale() - throw (css::accessibility::IllegalAccessibleComponentStateException, - css::uno::RuntimeException, std::exception) override; - - virtual sal_Bool SAL_CALL containsPoint(css::awt::Point const & rPoint) - throw (css::uno::RuntimeException, std::exception) override; - - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL - getAccessibleAtPoint(css::awt::Point const & rPoint) - throw (css::uno::RuntimeException, std::exception) override; - - virtual css::awt::Rectangle SAL_CALL getBounds() - throw (css::uno::RuntimeException, std::exception) override; - - virtual css::awt::Point SAL_CALL getLocation() - throw (css::uno::RuntimeException, std::exception) override; - - virtual css::awt::Point SAL_CALL getLocationOnScreen() - throw (css::uno::RuntimeException, std::exception) override; - - virtual css::awt::Size SAL_CALL getSize() - throw (css::uno::RuntimeException, std::exception) override; - - virtual void SAL_CALL grabFocus() throw (css::uno::RuntimeException, std::exception) override; - - virtual css::util::Color SAL_CALL getForeground() - throw (css::uno::RuntimeException, std::exception) override; - - virtual css::util::Color SAL_CALL getBackground() - throw (css::uno::RuntimeException, std::exception) override; - - virtual ::sal_Int32 SAL_CALL getCaretPosition() - throw (css::uno::RuntimeException, std::exception) override; - - virtual sal_Bool SAL_CALL setCaretPosition(::sal_Int32 nIndex) - throw (css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception) override; - - virtual ::sal_Unicode SAL_CALL getCharacter(::sal_Int32 nIndex) - throw (css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception) override; - - virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL - getCharacterAttributes(::sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes ) - throw (css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception) override; - - virtual css::awt::Rectangle SAL_CALL - getCharacterBounds(::sal_Int32 nIndex) - throw (css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception) override; - - virtual ::sal_Int32 SAL_CALL getCharacterCount() - throw (css::uno::RuntimeException, std::exception) override; - - virtual ::sal_Int32 SAL_CALL - getIndexAtPoint(css::awt::Point const & rPoint) - throw (css::uno::RuntimeException, std::exception) override; - - virtual OUString SAL_CALL getSelectedText() - throw (css::uno::RuntimeException, std::exception) override; - - virtual ::sal_Int32 SAL_CALL getSelectionStart() - throw (css::uno::RuntimeException, std::exception) override; - - virtual ::sal_Int32 SAL_CALL getSelectionEnd() - throw (css::uno::RuntimeException, std::exception) override; - - virtual sal_Bool SAL_CALL setSelection(::sal_Int32 nStartIndex, - ::sal_Int32 nEndIndex) - throw (css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception) override; - - virtual OUString SAL_CALL getText() - throw (css::uno::RuntimeException, std::exception) override; - - virtual OUString SAL_CALL getTextRange(::sal_Int32 nStartIndex, - ::sal_Int32 nEndIndex) - throw (css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception) override; - - virtual css::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; - virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; - virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; - - virtual sal_Bool SAL_CALL copyText(::sal_Int32 nStartIndex, - ::sal_Int32 nEndIndex) - throw (css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception) override; - - virtual sal_Bool SAL_CALL cutText(::sal_Int32 nStartIndex, - ::sal_Int32 nEndIndex) - throw (css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception) override; - - virtual sal_Bool SAL_CALL pasteText(::sal_Int32 nIndex) - throw (css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception) override; - - virtual sal_Bool SAL_CALL deleteText(::sal_Int32 nStartIndex, - ::sal_Int32 nEndIndex) - throw (css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception) override; - - virtual sal_Bool SAL_CALL insertText(OUString const & rText, - ::sal_Int32 nIndex) - throw (css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception) override; - - virtual sal_Bool SAL_CALL replaceText( - ::sal_Int32 nStartIndex, ::sal_Int32 nEndIndex, - OUString const & rReplacement) - throw (css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception) override; - - virtual sal_Bool SAL_CALL setAttributes( - ::sal_Int32 nStartIndex, ::sal_Int32 nEndIndex, - css::uno::Sequence< css::beans::PropertyValue > const & - rAttributeSet) - throw (css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception) override; - - virtual sal_Bool SAL_CALL setText(OUString const & rText) - throw (css::uno::RuntimeException, std::exception) override; - - virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL - getDefaultAttributes(const css::uno::Sequence< OUString >& RequestedAttributes) - throw (css::uno::RuntimeException, std::exception) override; - - virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL - getRunAttributes(::sal_Int32 Index, const css::uno::Sequence< OUString >& RequestedAttributes) - throw (css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception) override; - - virtual ::sal_Int32 SAL_CALL getLineNumberAtIndex( ::sal_Int32 nIndex ) - throw (css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception) override; - - virtual css::accessibility::TextSegment SAL_CALL getTextAtLineNumber( ::sal_Int32 nLineNo ) - throw (css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception) override; - - virtual css::accessibility::TextSegment SAL_CALL getTextAtLineWithCaret( ) - throw (css::uno::RuntimeException, std::exception) override; - - virtual ::sal_Int32 SAL_CALL getNumberOfLineWithCaret( ) - throw (css::uno::RuntimeException, std::exception) override; - - virtual void SAL_CALL addAccessibleEventListener( - css::uno::Reference< - css::accessibility::XAccessibleEventListener > const & rListener) - throw (css::uno::RuntimeException, std::exception) override; - - virtual void SAL_CALL removeAccessibleEventListener( - css::uno::Reference< - css::accessibility::XAccessibleEventListener > const & rListener) - throw (css::uno::RuntimeException, std::exception) override; - - virtual void SAL_CALL disposing() override; - - virtual OUString implGetText() override; - - virtual css::lang::Locale implGetLocale() override; - - virtual void implGetSelection(::sal_Int32 & rStartIndex, - ::sal_Int32 & rEndIndex) override; - - // Throws css::lang::DisposedException: - void checkDisposed(); - - ::rtl::Reference< Document > m_xDocument; - Paragraphs::size_type m_nNumber; - - /// client id in the AccessibleEventNotifier queue - sal_uInt32 m_nClientId; - - OUString m_aParagraphText; -}; - - -typedef std::unordered_map< OUString, - css::beans::PropertyValue, - OUStringHash > tPropValMap; - -class Document: public ::VCLXAccessibleComponent, public ::SfxListener -{ -public: - Document(::VCLXWindow * pVclXWindow, ::TextEngine & rEngine, - ::TextView & rView); - - const css::uno::Reference< css::accessibility::XAccessible >& - getAccessible() { return m_xAccessible; } - - // Must be called only after init has been called. - css::lang::Locale retrieveLocale(); - - // Must be called only after init has been called. - // To make it possible for this method to be (indirectly) called from - // within Paragraph's constructor (i.e., when the Paragraph's ref count is - // still zero), pass a "Paragraph const *" instead of a - // "::rtl::Reference< Paragraph > const &". - ::sal_Int32 retrieveParagraphIndex(Paragraph const * pParagraph); - - // Must be called only after init has been called. - // To make it possible for this method to be (indirectly) called from - // within Paragraph's constructor (i.e., when the Paragraph's ref count is - // still zero), pass a "Paragraph const *" instead of a - // "::rtl::Reference< Paragraph > const &". - ::sal_Int64 retrieveParagraphState(Paragraph const * pParagraph); - - // Must be called only after init has been called. - // To make it possible for this method to be (indirectly) called from - // within Paragraph's constructor (i.e., when the Paragraph's ref count is - // still zero), pass a "Paragraph const &" instead of a - // "::rtl::Reference< Paragraph > const &". - css::awt::Rectangle - retrieveParagraphBounds(Paragraph const * pParagraph, bool bAbsolute); - - // Must be called only after init has been called. - // To make it possible for this method to be (indirectly) called from - // within Paragraph's constructor (i.e., when the Paragraph's ref count is - // still zero), pass a "Paragraph const &" instead of a - // "::rtl::Reference< Paragraph > const &". - OUString retrieveParagraphText(Paragraph const * pParagraph); - - // Must be called only after init has been called. - // To make it possible for this method to be (indirectly) called from - // within Paragraph's constructor (i.e., when the Paragraph's ref count is - // still zero), pass a "Paragraph const &" instead of a - // "::rtl::Reference< Paragraph > const &". - void retrieveParagraphSelection(Paragraph const * pParagraph, - ::sal_Int32 * pBegin, ::sal_Int32 * pEnd); - - // Must be called only after init has been called. - // To make it possible for this method to be (indirectly) called from - // within Paragraph's constructor (i.e., when the Paragraph's ref count is - // still zero), pass a "Paragraph const *" instead of a - // "::rtl::Reference< Paragraph > const &". - ::sal_Int32 retrieveParagraphCaretPosition(Paragraph const * pParagraph); - - // Must be called only after init has been called. - // To make it possible for this method to be (indirectly) called from - // within Paragraph's constructor (i.e., when the Paragraph's ref count is - // still zero), pass a "Paragraph const &" instead of a - // "::rtl::Reference< Paragraph > const &". - // Throws css::lang::IndexOutOfBoundsException. - css::awt::Rectangle - retrieveCharacterBounds(Paragraph const * pParagraph, - ::sal_Int32 nIndex); - - // Must be called only after init has been called. - // To make it possible for this method to be (indirectly) called from - // within Paragraph's constructor (i.e., when the Paragraph's ref count is - // still zero), pass a "Paragraph const &" instead of a - // "::rtl::Reference< Paragraph > const &". - ::sal_Int32 retrieveCharacterIndex(Paragraph const * pParagraph, - css::awt::Point const & rPoint); - - // Must be called only after init has been called. - // To make it possible for this method to be (indirectly) called from - // within Paragraph's constructor (i.e., when the Paragraph's ref count is - // still zero), pass a "Paragraph const &" instead of a - // "::rtl::Reference< Paragraph > const &". - // Throws css::lang::IndexOutOfBoundsException. - css::uno::Sequence< css::beans::PropertyValue > retrieveCharacterAttributes( - Paragraph const * pParagraph, ::sal_Int32 nIndex, - const css::uno::Sequence< OUString >& aRequestedAttributes); - - // Must be called only after init has been called. - // To make it possible for this method to be (indirectly) called from - // within Paragraph's constructor (i.e., when the Paragraph's ref count is - // still zero), pass a "Paragraph const &" instead of a - // "::rtl::Reference< Paragraph > const &". - css::uno::Sequence< css::beans::PropertyValue > retrieveDefaultAttributes( - Paragraph const * pParagraph, - const css::uno::Sequence< OUString >& RequestedAttributes); - - // Must be called only after init has been called. - // To make it possible for this method to be (indirectly) called from - // within Paragraph's constructor (i.e., when the Paragraph's ref count is - // still zero), pass a "Paragraph const &" instead of a - // "::rtl::Reference< Paragraph > const &". - // Throws css::lang::IndexOutOfBoundsException. - css::uno::Sequence< css::beans::PropertyValue > retrieveRunAttributes( - Paragraph const * pParagraph, ::sal_Int32 Index, - const css::uno::Sequence< OUString >& RequestedAttributes); - - // Must be called only after init has been called. - // To make it possible for this method to be (indirectly) called from - // within Paragraph's constructor (i.e., when the Paragraph's ref count is - // still zero), pass a "Paragraph const &" instead of a - // "::rtl::Reference< Paragraph > const &". - void changeParagraphText(Paragraph * pParagraph, - OUString const & rText); - - // Must be called only after init has been called. - // To make it possible for this method to be (indirectly) called from - // within Paragraph's constructor (i.e., when the Paragraph's ref count is - // still zero), pass a "Paragraph const &" instead of a - // "::rtl::Reference< Paragraph > const &". - // Throws css::lang::IndexOutOfBoundsException. - void changeParagraphText(Paragraph * pParagraph, ::sal_Int32 nBegin, - ::sal_Int32 nEnd, bool bCut, bool bPaste, - OUString const & rText); - - // Must be called only after init has been called. - // To make it possible for this method to be (indirectly) called from - // within Paragraph's constructor (i.e., when the Paragraph's ref count is - // still zero), pass a "Paragraph const &" instead of a - // "::rtl::Reference< Paragraph > const &". - // Throws css::lang::IndexOutOfBoundsException. - void copyParagraphText(Paragraph const * pParagraph, - ::sal_Int32 nBegin, ::sal_Int32 nEnd); - - // Must be called only after init has been called. - // To make it possible for this method to be (indirectly) called from - // within Paragraph's constructor (i.e., when the Paragraph's ref count is - // still zero), pass a "Paragraph const &" instead of a - // "::rtl::Reference< Paragraph > const &". - // Throws css::lang::IndexOutOfBoundsException. - void changeParagraphAttributes( - Paragraph * pParagraph, ::sal_Int32 nBegin, ::sal_Int32 nEnd, - css::uno::Sequence< css::beans::PropertyValue > const & - rAttributeSet); - - // Must be called only after init has been called. - // To make it possible for this method to be (indirectly) called from - // within Paragraph's constructor (i.e., when the Paragraph's ref count is - // still zero), pass a "Paragraph const &" instead of a - // "::rtl::Reference< Paragraph > const &". - // Throws css::lang::IndexOutOfBoundsException. - void changeParagraphSelection(Paragraph * pParagraph, - ::sal_Int32 nBegin, ::sal_Int32 nEnd); - - css::i18n::Boundary - retrieveParagraphLineBoundary( Paragraph const * pParagraph, - ::sal_Int32 nIndex, ::sal_Int32 *pLineNo = nullptr); - - css::i18n::Boundary - retrieveParagraphBoundaryOfLine( Paragraph const * pParagraph, - ::sal_Int32 nIndex ); - - sal_Int32 retrieveParagraphLineWithCursor( Paragraph const * pParagraph ); - - css::uno::Reference< css::accessibility::XAccessibleRelationSet > - retrieveParagraphRelationSet( Paragraph const * pParagraph ); - -private: - virtual ::sal_Int32 SAL_CALL getAccessibleChildCount() - throw (css::uno::RuntimeException, std::exception) override; - - virtual css::uno::Reference< css::accessibility::XAccessible > - SAL_CALL getAccessibleChild(::sal_Int32 i) - throw (css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception) override; - - virtual ::sal_Int16 SAL_CALL getAccessibleRole() - throw (css::uno::RuntimeException, std::exception) override; - - virtual css::uno::Reference< css::accessibility::XAccessible > - SAL_CALL getAccessibleAtPoint(css::awt::Point const & rPoint) - throw (css::uno::RuntimeException, std::exception) override; - - virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) override; - virtual void FillAccessibleRelationSet( utl::AccessibleRelationSetHelper& rRelationSet ) override; - - // ??? Will be called with both the external (Solar) and internal mutex - // locked: - virtual void SAL_CALL disposing() override; - - // ??? Will be called with the external (Solar) mutex locked. - // init will already have been called. - virtual void Notify(::SfxBroadcaster & rBC, ::SfxHint const & rHint) override; - - // Assuming that this will only be called with the external (Solar) mutex - // locked. - // init will already have been called. - DECL_LINK_TYPED(WindowEventHandler, VclWindowEvent&, void); - - // Must be called with both the external (Solar) and internal mutex - // locked. - void init(); - - // Must be called with both the external (Solar) and internal mutex - // locked, and after init has been called: - static ::rtl::Reference< Paragraph > - getParagraph(Paragraphs::iterator const & rIt); - - // Must be called with both the external (Solar) and internal mutex - // locked, and after init has been called. - // Throws css::uno::RuntimeException. - css::uno::Reference< css::accessibility::XAccessible > - getAccessibleChild(Paragraphs::iterator const & rIt); - - // Must be called with both the external (Solar) and internal mutex - // locked, and after init has been called: - void determineVisibleRange(); - - // Must be called with both the external (Solar) and internal mutex - // locked, and after init has been called: - void notifyVisibleRangeChanges( - Paragraphs::iterator const & rOldVisibleBegin, - Paragraphs::iterator const & rOldVisibleEnd, - Paragraphs::iterator const & rInserted); - - // Must be called with both the external (Solar) and internal mutex - // locked, and after init has been called: - void changeParagraphText(::sal_uLong nNumber, ::sal_uInt16 nBegin, ::sal_uInt16 nEnd, - bool bCut, bool bPaste, - OUString const & rText); - - void - handleParagraphNotifications(); - - void handleSelectionChangeNotification(); - - ::sal_Int32 getSelectionType(::sal_Int32 nNewFirstPara, ::sal_Int32 nNewFirstPos, ::sal_Int32 nNewLastPara, ::sal_Int32 nNewLastPos); - void sendEvent(::sal_Int32 start, ::sal_Int32 end, ::sal_Int16 nEventId); - - void disposeParagraphs(); - - static css::uno::Any mapFontColor(::Color const & rColor); - - static ::Color mapFontColor(css::uno::Any const & rColor); - - static css::uno::Any mapFontWeight(::FontWeight nWeight); - - static ::FontWeight mapFontWeight(css::uno::Any const & rWeight); - - static void retrieveDefaultAttributesImpl( - Paragraph const * pParagraph, - const css::uno::Sequence< OUString >& RequestedAttributes, - tPropValMap& rDefAttrSeq); - - void retrieveRunAttributesImpl( - Paragraph const * pParagraph, ::sal_Int32 Index, - const css::uno::Sequence< OUString >& RequestedAttributes, - tPropValMap& rRunAttrSeq); - - css::uno::Reference< css::accessibility::XAccessible > m_xAccessible; - ::TextEngine & m_rEngine; - ::TextView & m_rView; - - SfxListenerGuard m_aEngineListener; - WindowListenerGuard m_aViewListener; - - // All the following members have valid values only after calling init: - - std::unique_ptr< Paragraphs > m_xParagraphs; - - // m_nViewOffset is from the start of the document (0) to the start of the - // current view, and m_nViewHeight is the height of the view: - ::sal_Int32 m_nViewOffset; - ::sal_Int32 m_nViewHeight; - - // m_aVisibleBegin points to the first Paragraph that is (partially) - // contained in the view, and m_aVisibleEnd points past the last Paragraph - // that is (partially) contained. If no Paragraphs are (partially) in the - // view, both m_aVisibleBegin and m_aVisibleEnd are set to - // m_xParagraphs->end(). These values are only changed by - // determineVisibleRange. - Paragraphs::iterator m_aVisibleBegin; - Paragraphs::iterator m_aVisibleEnd; - - // m_nVisibleBeginOffset is from m_nViewOffset back to the start of the - // Paragraph pointed to by m_aVisibleBegin (and always has a non-negative - // value). If m_aVisibleBegin == m_xParagraphs->end(), - // m_nVisibleBeginOffset is set to 0. These values are only changed by - // determineVisibleRange. - ::sal_Int32 m_nVisibleBeginOffset; - - // If no selection has yet been set, all the following four variables are - // set to -1. m_nSelectionLastPara/Pos is also the cursor position. - ::sal_Int32 m_nSelectionFirstPara; - ::sal_Int32 m_nSelectionFirstPos; - ::sal_Int32 m_nSelectionLastPara; - ::sal_Int32 m_nSelectionLastPos; - - Paragraphs::iterator m_aFocused; - - ::std::queue< ::TextHint > m_aParagraphNotifications; - bool m_bSelectionChangedNotification; -}; - -} - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_EXTENDED_TEXTWINDOWACCESSIBILITY_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/helper/IComboListBoxHelper.hxx b/accessibility/inc/accessibility/helper/IComboListBoxHelper.hxx deleted file mode 100644 index 7777e920b72a..000000000000 --- a/accessibility/inc/accessibility/helper/IComboListBoxHelper.hxx +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_HELPER_ICOMBOLISTBOXHELPER_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_HELPER_ICOMBOLISTBOXHELPER_HXX - -#include - -#include -#include - -namespace com { namespace sun { namespace star { namespace datatransfer { namespace clipboard { - class XClipboard; -} } } } } - -class Point; -class Rectangle; -namespace vcl { class Window; } -namespace accessibility -{ - class IComboListBoxHelper - { - public: - virtual ~IComboListBoxHelper() = 0; - - virtual OUString GetEntry( sal_Int32 nPos ) const = 0; - virtual Rectangle GetDropDownPosSizePixel( ) const = 0; - virtual Rectangle GetBoundingRectangle( sal_uInt16 nItem ) const = 0; - virtual Rectangle GetWindowExtentsRelative() = 0; - virtual bool IsEnabled() const = 0; - virtual bool IsEntryVisible( sal_Int32 nPos ) const = 0; - virtual sal_uInt16 GetDisplayLineCount() const = 0; - virtual void GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const = 0; - virtual WinBits GetStyle() const = 0; - virtual bool IsMultiSelectionEnabled() const = 0; - virtual sal_Int32 GetTopEntry() const = 0; - virtual bool IsEntryPosSelected( sal_Int32 nPos ) const = 0; - virtual sal_Int32 GetEntryCount() const = 0; - virtual void Select() = 0; - virtual void SelectEntryPos( sal_Int32 nPos, bool bSelect = true ) = 0; - virtual sal_Int32 GetSelectEntryCount() const = 0; - virtual void SetNoSelection() = 0; - virtual sal_Int32 GetSelectEntryPos( sal_Int32 nSelIndex = 0 ) const = 0; - virtual bool IsInDropDown() const = 0; - virtual Rectangle GetEntryCharacterBounds( const sal_Int32 _nEntryPos, const sal_Int32 _nCharacterIndex ) const = 0; - virtual long GetIndexForPoint( const Point& rPoint, sal_Int32 & nPos ) const = 0; - virtual css::uno::Reference< css::datatransfer::clipboard::XClipboard > - GetClipboard() = 0; - }; -} -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_HELPER_ICOMBOLISTBOXHELPER_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ - diff --git a/accessibility/inc/accessibility/helper/accessiblestrings.hrc b/accessibility/inc/accessibility/helper/accessiblestrings.hrc deleted file mode 100644 index 60c4392a7562..000000000000 --- a/accessibility/inc/accessibility/helper/accessiblestrings.hrc +++ /dev/null @@ -1,51 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef ACCESSIBILITY_HELPER_ACCESSIBLESTRINGS_HRC_ -#define ACCESSIBILITY_HELPER_ACCESSIBLESTRINGS_HRC_ - -#define RID_TK_ACC_START 1000 - -// Accessible Action Id's -#define RID_STR_ACC_ACTION_CLICK ( RID_TK_ACC_START + 0 ) -#define RID_STR_ACC_ACTION_TOGGLEPOPUP ( RID_TK_ACC_START + 1 ) -#define RID_STR_ACC_ACTION_SELECT ( RID_TK_ACC_START + 2 ) -#define RID_STR_ACC_ACTION_INCLINE ( RID_TK_ACC_START + 3 ) -#define RID_STR_ACC_ACTION_DECLINE ( RID_TK_ACC_START + 4 ) -#define RID_STR_ACC_ACTION_INCBLOCK ( RID_TK_ACC_START + 5 ) -#define RID_STR_ACC_ACTION_DECBLOCK ( RID_TK_ACC_START + 6 ) -#define RID_STR_ACC_NAME_PREVIEW ( RID_TK_ACC_START + 7 ) - -#define STR_SVT_ACC_ACTION_EXPAND ( RID_TK_ACC_START + 8 ) -#define STR_SVT_ACC_ACTION_COLLAPSE ( RID_TK_ACC_START + 9 ) -#define STR_SVT_ACC_LISTENTRY_SELCTED_STATE ( RID_TK_ACC_START + 10 ) - -#define RID_STR_ACC_ACTION_CHECK ( RID_TK_ACC_START + 11 ) -#define RID_STR_ACC_ACTION_UNCHECK ( RID_TK_ACC_START + 12 ) -#define RID_STR_ACC_ACTION_DOUBLE_CLICK ( RID_TK_ACC_START + 13 ) -#define RID_STR_ACC_SCROLLBAR_NAME_VERTICAL ( RID_TK_ACC_START + 14 ) -#define RID_STR_ACC_SCROLLBAR_NAME_HORIZONTAL ( RID_TK_ACC_START + 15 ) -#define RID_STR_ACC_PANEL_DESCRIPTION ( RID_TK_ACC_START + 16 ) - -#define RID_STR_ACC_NAME_BROWSEBUTTON ( RID_TK_ACC_START + 100 ) -#define RID_STR_ACC_DESC_PANELDECL_TABBAR ( RID_TK_ACC_START + 101 ) - -#endif // ACCESSIBILITY_HELPER_ACCESSIBLESTRINGS_HRC_ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/helper/accresmgr.hxx b/accessibility/inc/accessibility/helper/accresmgr.hxx deleted file mode 100644 index fe8ae624843e..000000000000 --- a/accessibility/inc/accessibility/helper/accresmgr.hxx +++ /dev/null @@ -1,66 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_HELPER_ACCRESMGR_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_HELPER_ACCRESMGR_HXX - -#include - -class SimpleResMgr; - -#define TK_RES_STRING(id) ::accessibility::TkResMgr::loadString(id) - - -// TkResMgr - -namespace accessibility -{ - -class TkResMgr -{ - static SimpleResMgr* m_pImpl; - -private: - // no instantiation allowed - TkResMgr() = delete; - ~TkResMgr() { } - - // we'll instantiate one static member of the following class, - // which in its dtor ensures that m_pImpl will be deleted - class EnsureDelete - { - public: - EnsureDelete() { } - ~EnsureDelete(); - }; - friend class EnsureDelete; - -protected: - static void ensureImplExists(); - -public: - // loads the string with the specified resource id - static OUString loadString( sal_uInt16 nResId ); -}; - -} - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_HELPER_ACCRESMGR_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/helper/characterattributeshelper.hxx b/accessibility/inc/accessibility/helper/characterattributeshelper.hxx deleted file mode 100644 index 3ed820b127e4..000000000000 --- a/accessibility/inc/accessibility/helper/characterattributeshelper.hxx +++ /dev/null @@ -1,52 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_HELPER_CHARACTERATTRIBUTESHELPER_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_HELPER_CHARACTERATTRIBUTESHELPER_HXX - -#include -#include -#include - -#include - - -// class CharacterAttributesHelper - - -class CharacterAttributesHelper -{ -private: - - typedef ::std::map< OUString, css::uno::Any > AttributeMap; - - AttributeMap m_aAttributeMap; - -public: - - CharacterAttributesHelper( const vcl::Font& rFont, sal_Int32 nBackColor, sal_Int32 nColor ); - ~CharacterAttributesHelper(); - - std::vector< css::beans::PropertyValue > GetCharacterAttributes(); - css::uno::Sequence< css::beans::PropertyValue > GetCharacterAttributes( const css::uno::Sequence< OUString >& aRequestedAttributes ); -}; - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_HELPER_CHARACTERATTRIBUTESHELPER_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/helper/listboxhelper.hxx b/accessibility/inc/accessibility/helper/listboxhelper.hxx deleted file mode 100644 index 1dec33d21134..000000000000 --- a/accessibility/inc/accessibility/helper/listboxhelper.hxx +++ /dev/null @@ -1,189 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_HELPER_LISTBOXHELPER_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_HELPER_LISTBOXHELPER_HXX - -#include -#include -#include -#include - - -// globals - - -const sal_Int32 DEFAULT_INDEX_IN_PARENT = -1; - - -// class VCLListBoxHelper - - -template< class T > class VCLListBoxHelper : public ::accessibility::IComboListBoxHelper -{ -private: - T& m_aComboListBox; - -public: - inline - VCLListBoxHelper( T& _pListBox ) : - m_aComboListBox( _pListBox ){} - - - virtual OUString GetEntry( sal_Int32 nPos ) const override - { - return m_aComboListBox.GetEntry( nPos ); - } - - virtual Rectangle GetDropDownPosSizePixel() const override - { - Rectangle aTemp = m_aComboListBox.GetWindowExtentsRelative(nullptr); - Rectangle aRet = m_aComboListBox.GetDropDownPosSizePixel(); - aRet.Move(aTemp.TopLeft().X(),aTemp.TopLeft().Y()); - return aRet; - } - - virtual Rectangle GetBoundingRectangle( sal_uInt16 nItem ) const override - { - Rectangle aRect; - if ( m_aComboListBox.IsInDropDown() && IsEntryVisible( nItem ) ) - { - Rectangle aTemp = m_aComboListBox.GetDropDownPosSizePixel(); - Size aSize = aTemp.GetSize(); - aSize.Height() /= m_aComboListBox.GetDisplayLineCount(); - Point aTopLeft = aTemp.TopLeft(); - aTopLeft.Y() += aSize.Height() * ( nItem - m_aComboListBox.GetTopEntry() ); - aRect = Rectangle( aTopLeft, aSize ); - } - else - aRect = m_aComboListBox.GetBoundingRectangle( nItem ); - return aRect; - } - - virtual Rectangle GetWindowExtentsRelative() override - { - return m_aComboListBox.GetWindowExtentsRelative( nullptr ); - } - - virtual bool IsEnabled() const override - { - return m_aComboListBox.IsEnabled(); - } - - virtual bool IsEntryVisible( sal_Int32 nPos ) const override - { - sal_Int32 nTopEntry = m_aComboListBox.GetTopEntry(); - sal_uInt16 nLines = m_aComboListBox.GetDisplayLineCount(); - return ( nPos >= nTopEntry && nPos < ( nTopEntry + nLines ) ); - } - - virtual sal_uInt16 GetDisplayLineCount() const override - { - return m_aComboListBox.GetDisplayLineCount(); - } - - virtual void GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const override - { - m_aComboListBox.GetMaxVisColumnsAndLines(rnCols,rnLines); - } - - virtual WinBits GetStyle() const override - { - return m_aComboListBox.GetStyle(); - } - - virtual bool IsMultiSelectionEnabled() const override - { - return m_aComboListBox.IsMultiSelectionEnabled(); - } - - virtual sal_Int32 GetTopEntry() const override - { - return m_aComboListBox.GetTopEntry(); - } - - virtual bool IsEntryPosSelected( sal_Int32 nPos ) const override - { - return m_aComboListBox.IsEntryPosSelected(nPos); - } - - virtual sal_Int32 GetEntryCount() const override - { - return m_aComboListBox.GetEntryCount(); - } - - virtual void Select() override - { - m_aComboListBox.Select(); - } - - virtual void SelectEntryPos( sal_Int32 nPos, bool bSelect = true ) override - { - m_aComboListBox.SelectEntryPos(nPos,bSelect); - } - - virtual sal_Int32 GetSelectEntryCount() const override - { - return m_aComboListBox.GetSelectEntryCount(); - } - - virtual void SetNoSelection() override - { - m_aComboListBox.SetNoSelection(); - } - - virtual sal_Int32 GetSelectEntryPos( sal_Int32 nSelIndex = 0 ) const override - { - return m_aComboListBox.GetSelectEntryPos(nSelIndex); - } - - virtual bool IsInDropDown() const override - { - return m_aComboListBox.IsInDropDown(); - } - - virtual Rectangle GetEntryCharacterBounds( const sal_Int32 _nEntryPos, const sal_Int32 _nCharacterIndex ) const override - { - Rectangle aRect; - - Pair aEntryCharacterRange = m_aComboListBox.GetLineStartEnd( _nEntryPos ); - if ( aEntryCharacterRange.A() + _nCharacterIndex <= aEntryCharacterRange.B() ) - { - long nIndex = aEntryCharacterRange.A() + _nCharacterIndex; - aRect = m_aComboListBox.GetCharacterBounds( nIndex ); - } - return aRect; - } - - long GetIndexForPoint( const Point& rPoint, sal_Int32& nPos ) const override - { - return m_aComboListBox.GetIndexForPoint( rPoint, nPos ); - } - - css::uno::Reference< css::datatransfer::clipboard::XClipboard > - GetClipboard() override - { - return m_aComboListBox.GetClipboard(); - } - -}; - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_HELPER_LISTBOXHELPER_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/standard/accessiblemenubasecomponent.hxx b/accessibility/inc/accessibility/standard/accessiblemenubasecomponent.hxx deleted file mode 100644 index 11cbf87ddb85..000000000000 --- a/accessibility/inc/accessibility/standard/accessiblemenubasecomponent.hxx +++ /dev/null @@ -1,145 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_ACCESSIBLEMENUBASECOMPONENT_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_ACCESSIBLEMENUBASECOMPONENT_HXX - -#include -#include -#include -#include -#include -#include - -#include - -class Menu; -class VclSimpleEvent; -class VclMenuEvent; -class VCLExternalSolarLock; - -namespace utl { -class AccessibleStateSetHelper; -} - - -// class OAccessibleMenuBaseComponent - -typedef ::cppu::ImplHelper2< - css::accessibility::XAccessible, - css::lang::XServiceInfo > OAccessibleMenuBaseComponent_BASE; - -class OAccessibleMenuBaseComponent : public comphelper::OAccessibleExtendedComponentHelper, - public OAccessibleMenuBaseComponent_BASE -{ - friend class OAccessibleMenuItemComponent; - friend class VCLXAccessibleMenuItem; - friend class VCLXAccessibleMenu; - -private: - VCLExternalSolarLock* m_pExternalLock; - -protected: - typedef ::std::vector< css::uno::Reference< css::accessibility::XAccessible > > AccessibleChildren; - - AccessibleChildren m_aAccessibleChildren; - Menu* m_pMenu; - - bool m_bEnabled; - bool m_bFocused; - bool m_bVisible; - bool m_bSelected; - bool m_bChecked; - - virtual bool IsEnabled(); - virtual bool IsFocused(); - virtual bool IsVisible(); - virtual bool IsSelected(); - virtual bool IsChecked(); - - void SetEnabled( bool bEnabled ); - void SetFocused( bool bFocused ); - void SetVisible( bool bVisible ); - void SetSelected( bool bSelected ); - void SetChecked( bool bChecked ); - - void UpdateEnabled( sal_Int32 i, bool bEnabled ); - void UpdateFocused( sal_Int32 i, bool bFocused ); - void UpdateVisible(); - void UpdateSelected( sal_Int32 i, bool bSelected ); - void UpdateChecked( sal_Int32 i, bool bChecked ); - void UpdateAccessibleName( sal_Int32 i ); - void UpdateItemText( sal_Int32 i ); - - sal_Int32 GetChildCount(); - - css::uno::Reference< css::accessibility::XAccessible > GetChild( sal_Int32 i ); - css::uno::Reference< css::accessibility::XAccessible > GetChildAt( const css::awt::Point& rPoint ); - - void InsertChild( sal_Int32 i ); - void RemoveChild( sal_Int32 i ); - - virtual bool IsHighlighted(); - bool IsChildHighlighted(); - - virtual bool IsMenuHideDisabledEntries(); - - void SelectChild( sal_Int32 i ); - void DeSelectAll(); - bool IsChildSelected( sal_Int32 i ); - - virtual void Select(); - virtual void DeSelect(); - virtual void Click(); - virtual bool IsPopupMenuOpen(); - - DECL_LINK_TYPED( MenuEventListener, VclMenuEvent&, void ); - - void ProcessMenuEvent( const VclMenuEvent& rVclMenuEvent ); - - virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) = 0; - - // XComponent - virtual void SAL_CALL disposing() override; - -public: - OAccessibleMenuBaseComponent( Menu* pMenu ); - virtual ~OAccessibleMenuBaseComponent(); - - void SetStates(); - - // XInterface - DECLARE_XINTERFACE() - - // XTypeProvider - DECLARE_XTYPEPROVIDER() - - // XServiceInfo - virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessible - virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleContext - virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (css::uno::RuntimeException, std::exception) override; -}; - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_ACCESSIBLEMENUBASECOMPONENT_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/standard/accessiblemenucomponent.hxx b/accessibility/inc/accessibility/standard/accessiblemenucomponent.hxx deleted file mode 100644 index 859756041438..000000000000 --- a/accessibility/inc/accessibility/standard/accessiblemenucomponent.hxx +++ /dev/null @@ -1,89 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_ACCESSIBLEMENUCOMPONENT_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_ACCESSIBLEMENUCOMPONENT_HXX - -#include -#include -#include - - -// class OAccessibleMenuComponent - -typedef ::cppu::ImplHelper1< - css::accessibility::XAccessibleSelection > OAccessibleMenuComponent_BASE; - -class OAccessibleMenuComponent : public OAccessibleMenuBaseComponent, - public OAccessibleMenuComponent_BASE -{ -protected: - virtual bool IsEnabled() override; - virtual bool IsVisible() override; - - virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) override; - - // OCommonAccessibleComponent - virtual css::awt::Rectangle implGetBounds( ) throw (css::uno::RuntimeException) override; - -public: - OAccessibleMenuComponent( Menu* pMenu ); - virtual ~OAccessibleMenuComponent(); - - // XInterface - DECLARE_XINTERFACE() - - // XTypeProvider - DECLARE_XTYPEPROVIDER() - - // XAccessibleContext - virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleDescription( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleName( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::lang::Locale SAL_CALL getLocale( ) throw (css::accessibility::IllegalAccessibleComponentStateException, css::uno::RuntimeException, std::exception) override; - - // XAccessibleComponent - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::awt::Point SAL_CALL getLocationOnScreen( ) throw (css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL grabFocus( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getForeground( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getBackground( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleExtendedComponent - virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getTitledBorderText( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getToolTipText( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleSelection - virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL clearAccessibleSelection( ) throw (css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL selectAllAccessibleChildren( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; -}; - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_ACCESSIBLEMENUCOMPONENT_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/standard/accessiblemenuitemcomponent.hxx b/accessibility/inc/accessibility/standard/accessiblemenuitemcomponent.hxx deleted file mode 100644 index 2bcf01f60882..000000000000 --- a/accessibility/inc/accessibility/standard/accessiblemenuitemcomponent.hxx +++ /dev/null @@ -1,90 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_ACCESSIBLEMENUITEMCOMPONENT_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_ACCESSIBLEMENUITEMCOMPONENT_HXX - -#include - - -// class OAccessibleMenuItemComponent - - -class OAccessibleMenuItemComponent : public OAccessibleMenuBaseComponent -{ - friend class OAccessibleMenuBaseComponent; - -protected: - Menu* m_pParent; - sal_uInt16 m_nItemPos; - OUString m_sAccessibleName; - OUString m_sItemText; - - virtual bool IsEnabled() override; - virtual bool IsVisible() override; - virtual void Select() override; - virtual void DeSelect() override; - virtual void Click() override; - - void SetItemPos( sal_uInt16 nItemPos ); - void SetAccessibleName( const OUString& sAccessibleName ); - OUString GetAccessibleName(); - void SetItemText( const OUString& sItemText ); - OUString GetItemText(); - - virtual bool IsMenuHideDisabledEntries() override; - - virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) override; - - // OCommonAccessibleComponent - virtual css::awt::Rectangle implGetBounds( ) throw (css::uno::RuntimeException) override; - - // XComponent - virtual void SAL_CALL disposing() override; - -public: - OAccessibleMenuItemComponent( Menu* pParent, sal_uInt16 nItemPos, Menu* pMenu ); - virtual ~OAccessibleMenuItemComponent(); - - // XAccessibleContext - virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleDescription( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleName( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::lang::Locale SAL_CALL getLocale( ) throw (css::accessibility::IllegalAccessibleComponentStateException, css::uno::RuntimeException, std::exception) override; - - // XAccessibleComponent - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL grabFocus( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getForeground( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getBackground( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleExtendedComponent - virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getTitledBorderText( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getToolTipText( ) throw (css::uno::RuntimeException, std::exception) override; -}; - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_ACCESSIBLEMENUITEMCOMPONENT_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblebox.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblebox.hxx deleted file mode 100644 index 7fec38d57559..000000000000 --- a/accessibility/inc/accessibility/standard/vclxaccessiblebox.hxx +++ /dev/null @@ -1,185 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLEBOX_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLEBOX_HXX - -#include -#include -#include -#include -#include -#include - - -typedef ::cppu::ImplHelper3< - css::accessibility::XAccessible, - css::accessibility::XAccessibleValue, - css::accessibility::XAccessibleAction - > VCLXAccessibleBox_BASE; - - -/** Base class for list- and combo boxes. This class manages the box' - children. The classed derived from this one have only to implement the - IsValid method and return the correct implementation name. -*/ -class VCLXAccessibleBox - : public VCLXAccessibleComponent, - public VCLXAccessibleBox_BASE -{ -public: - enum BoxType {COMBOBOX, LISTBOX}; - - /** The constructor is initialized with the box type which may be - either COMBOBOX or LISTBOX and a flag - indicating whether the box is a drop down box. - */ - VCLXAccessibleBox (VCLXWindow* pVCLXindow, BoxType aType, bool bIsDropDownBox); - - // XTypeProvider - DECLARE_XTYPEPROVIDER() - - // XInterface - DECLARE_XINTERFACE() - - - // XAccessible - - virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL - getAccessibleContext( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleContext - - /** Each object has one or two children: an optional text field and the - actual list. The text field is not provided for non drop down list - boxes. - */ - sal_Int32 SAL_CALL getAccessibleChildCount() - throw (css::uno::RuntimeException, std::exception) override; - /** For drop down list boxes the text field is a not editable - VCLXAccessibleTextField, for combo boxes it is an - editable VLCAccessibleEdit. - */ - css::uno::Reference< css::accessibility::XAccessible> SAL_CALL - getAccessibleChild (sal_Int32 i) - throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - /** The role is always AccessibleRole::COMBO_BOX. - */ - sal_Int16 SAL_CALL getAccessibleRole() - throw (css::uno::RuntimeException, std::exception) override; - - sal_Int32 SAL_CALL getAccessibleIndexInParent() - throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleAction - - /** There is one action for drop down boxes and none for others. - */ - virtual sal_Int32 SAL_CALL getAccessibleActionCount() - throw (css::uno::RuntimeException, std::exception) override; - /** The action for drop down boxes lets the user toggle the visibility of the - popup menu. - */ - virtual sal_Bool SAL_CALL doAccessibleAction (sal_Int32 nIndex) - throw (css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception) override; - /** The returned string is associated with resource - RID_STR_ACC_ACTION_TOGGLEPOPUP. - */ - virtual OUString SAL_CALL getAccessibleActionDescription (sal_Int32 nIndex) - throw (css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception) override; - /** No keybinding returned so far. - */ - virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL - getAccessibleActionKeyBinding( sal_Int32 nIndex ) - throw (css::lang::IndexOutOfBoundsException, - css::uno::RuntimeException, std::exception) override; - - // XComponent - - /** This method is called from the implementation helper during an - XComponent::dispose() call. - */ - virtual void SAL_CALL disposing() override; - - // XAccessibleValue - - virtual css::uno::Any SAL_CALL getCurrentValue( ) - throw (css::uno::RuntimeException, std::exception) override; - - virtual sal_Bool SAL_CALL setCurrentValue( - const css::uno::Any& aNumber ) - throw (css::uno::RuntimeException, std::exception) override; - - virtual css::uno::Any SAL_CALL getMaximumValue( ) - throw (css::uno::RuntimeException, std::exception) override; - - virtual css::uno::Any SAL_CALL getMinimumValue( ) - throw (css::uno::RuntimeException, std::exception) override; -protected: - /** Specifies whether the box is a combo box or a list box. List boxes - have multi selection. - */ - BoxType m_aBoxType; - - /// Specifies whether the box is a drop down box and thus has an action. - bool m_bIsDropDownBox; - - /// The child that represents the text field if there is one. - css::uno::Reference< css::accessibility::XAccessible> - m_xText; - - /// The child that contains the items of this box. - css::uno::Reference< css::accessibility::XAccessible> - m_xList; - - /** This flag specifies whether an object has a text field as child - regardless of whether that child being currently instantiated or - not. - */ - bool m_bHasTextChild; - - /** This flag specifies whether an object has a list as child regardless - of whether that child being currently instantiated or not. This - flag is always true in the current implementation because the list - child is just another wrapper around this object and thus has the - same life time. - */ - bool m_bHasListChild; - - virtual ~VCLXAccessibleBox(); - - /** Returns true when the object is valid. - */ - virtual bool IsValid() const = 0; - - virtual void ProcessWindowChildEvent (const VclWindowEvent& rVclWindowEvent) override; - virtual void ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent) override; - - virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) override; - -private: - /// Index in parent. This is settable from the outside. - sal_Int32 m_nIndexInParent; -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblebutton.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblebutton.hxx deleted file mode 100644 index 8f0a8f1fa42b..000000000000 --- a/accessibility/inc/accessibility/standard/vclxaccessiblebutton.hxx +++ /dev/null @@ -1,78 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLEBUTTON_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLEBUTTON_HXX - -#include - -#include -#include - -#include - - -// class VCLXAccessibleButton - - -typedef ::cppu::ImplHelper2< - css::accessibility::XAccessibleAction, - css::accessibility::XAccessibleValue > VCLXAccessibleButton_BASE; - -class VCLXAccessibleButton : public VCLXAccessibleTextComponent, - public VCLXAccessibleButton_BASE -{ -protected: - virtual ~VCLXAccessibleButton(); - - virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; - virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) override; - -public: - VCLXAccessibleButton( VCLXWindow* pVCLXindow ); - - // XInterface - DECLARE_XINTERFACE() - - // XTypeProvider - DECLARE_XTYPEPROVIDER() - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleContext - virtual OUString SAL_CALL getAccessibleName( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleAction - virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL doAccessibleAction ( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - - // XAccessibleValue - virtual css::uno::Any SAL_CALL getCurrentValue( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL setCurrentValue( const css::uno::Any& aNumber ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Any SAL_CALL getMaximumValue( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Any SAL_CALL getMinimumValue( ) throw (css::uno::RuntimeException, std::exception) override; -}; - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLEBUTTON_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblecheckbox.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblecheckbox.hxx deleted file mode 100644 index db0f699e98b7..000000000000 --- a/accessibility/inc/accessibility/standard/vclxaccessiblecheckbox.hxx +++ /dev/null @@ -1,85 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLECHECKBOX_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLECHECKBOX_HXX - -#include - -#include -#include - -#include - - -// class VCLXAccessibleCheckBox - - -typedef ::cppu::ImplHelper2< - css::accessibility::XAccessibleAction, - css::accessibility::XAccessibleValue > VCLXAccessibleCheckBox_BASE; - -class VCLXAccessibleCheckBox : public VCLXAccessibleTextComponent, - public VCLXAccessibleCheckBox_BASE -{ -private: - bool m_bChecked; - bool m_bIndeterminate; - -protected: - virtual ~VCLXAccessibleCheckBox(); - - bool IsChecked(); - bool IsIndeterminate(); - - void SetChecked( bool bChecked ); - void SetIndeterminate( bool bIndeterminate ); - - virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; - virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) override; - -public: - VCLXAccessibleCheckBox( VCLXWindow* pVCLXindow ); - - // XInterface - DECLARE_XINTERFACE() - - // XTypeProvider - DECLARE_XTYPEPROVIDER() - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleAction - virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL doAccessibleAction ( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - - // XAccessibleValue - virtual css::uno::Any SAL_CALL getCurrentValue( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL setCurrentValue( const css::uno::Any& aNumber ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Any SAL_CALL getMaximumValue( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Any SAL_CALL getMinimumValue( ) throw (css::uno::RuntimeException, std::exception) override; -}; - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLECHECKBOX_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblecombobox.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblecombobox.hxx deleted file mode 100644 index 082bd30d0990..000000000000 --- a/accessibility/inc/accessibility/standard/vclxaccessiblecombobox.hxx +++ /dev/null @@ -1,57 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLECOMBOBOX_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLECOMBOBOX_HXX - -#include -#include -#include - - -/** The accessible combobox has two children. The first is the text field - represented by an object of the VCLXAccessibleEdit class. - The second is the list containing all items and is represented by an - object of the VCLXAccessibleList class which does not - support selection at the moment. -*/ -class VCLXAccessibleComboBox - : public VCLXAccessibleBox -{ -public: - VCLXAccessibleComboBox (VCLXWindow* pVCLXindow); - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() - throw (css::uno::RuntimeException, std::exception) override; - // Return combo box specific services. - virtual css::uno::Sequence< OUString > SAL_CALL - getSupportedServiceNames() - throw (css::uno::RuntimeException, std::exception) override; - -protected: - virtual ~VCLXAccessibleComboBox(); - - virtual bool IsValid() const override; - virtual void ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent) override; -}; - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLECOMBOBOX_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/standard/vclxaccessibledropdowncombobox.hxx b/accessibility/inc/accessibility/standard/vclxaccessibledropdowncombobox.hxx deleted file mode 100644 index ab6d71bed276..000000000000 --- a/accessibility/inc/accessibility/standard/vclxaccessibledropdowncombobox.hxx +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLEDROPDOWNCOMBOBOX_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLEDROPDOWNCOMBOBOX_HXX - -#include -#include -#include - -/** The accessible drop down combobox has two children. The first is the - text field represented by an object of the - VCLXAccessibleEdit class. The second is the list - containing all items and is represented by an object of the - VCLXAccessibleList class which does not support selection - at the moment. -*/ -class VCLXAccessibleDropDownComboBox : public VCLXAccessibleBox -{ -public: - VCLXAccessibleDropDownComboBox (VCLXWindow* pVCLXindow); - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() - throw (css::uno::RuntimeException, std::exception) override; - // Return drop down combo box specific services. - virtual css::uno::Sequence< OUString > SAL_CALL - getSupportedServiceNames() - throw (css::uno::RuntimeException, std::exception) override; - -protected: - virtual ~VCLXAccessibleDropDownComboBox(); - - virtual bool IsValid() const override; - virtual void ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent) override; -}; - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLEDROPDOWNCOMBOBOX_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/standard/vclxaccessibledropdownlistbox.hxx b/accessibility/inc/accessibility/standard/vclxaccessibledropdownlistbox.hxx deleted file mode 100644 index 23f1ab4ba9b0..000000000000 --- a/accessibility/inc/accessibility/standard/vclxaccessibledropdownlistbox.hxx +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLEDROPDOWNLISTBOX_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLEDROPDOWNLISTBOX_HXX - -#include -#include - -/** The accessible drop down combobox has two children. The first is the - text field represented by an object of the - VCLXAccessibleTextField class which can not be edited. The - second is the list containing all items and is represented by an object - of the VCLXAccessibleListBoxList class which does support - selection. -*/ -class VCLXAccessibleDropDownListBox : public VCLXAccessibleBox -{ -public: - VCLXAccessibleDropDownListBox (VCLXWindow* pVCLXindow); - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() - throw (css::uno::RuntimeException, std::exception) override; - // Return drop down list box specific services. - virtual css::uno::Sequence< OUString > SAL_CALL - getSupportedServiceNames() - throw (css::uno::RuntimeException, std::exception) override; - -protected: - virtual ~VCLXAccessibleDropDownListBox(); - - virtual bool IsValid() const override; - virtual void ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent) override; - -}; - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLEDROPDOWNLISTBOX_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/standard/vclxaccessibleedit.hxx b/accessibility/inc/accessibility/standard/vclxaccessibleedit.hxx deleted file mode 100644 index 7e395620a410..000000000000 --- a/accessibility/inc/accessibility/standard/vclxaccessibleedit.hxx +++ /dev/null @@ -1,111 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLEEDIT_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLEEDIT_HXX - -#include -#include -#include - -#include - - -// class VCLXAccessibleEdit - - -typedef ::cppu::ImplHelper2< - css::accessibility::XAccessibleAction, - css::accessibility::XAccessibleEditableText > VCLXAccessibleEdit_BASE; - -class VCLXAccessibleEdit : public VCLXAccessibleTextComponent, - public VCLXAccessibleEdit_BASE -{ - friend class VCLXAccessibleBox; - -private: - sal_Int32 m_nSelectionStart; - sal_Int32 m_nCaretPosition; - -protected: - virtual ~VCLXAccessibleEdit(); - - virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; - virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) override; - - // OCommonAccessibleText - virtual OUString implGetText() override; - virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override; - -public: - VCLXAccessibleEdit( VCLXWindow* pVCLXindow ); - - // XInterface - DECLARE_XINTERFACE() - - // XTypeProvider - DECLARE_XTYPEPROVIDER() - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleContext - virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleAction - virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL doAccessibleAction ( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - - // XAccessibleText - virtual sal_Int32 SAL_CALL getCaretPosition( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getCharacterCount( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getSelectedText( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getSelectionStart( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getSelectionEnd( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getText( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; - virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; - virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - - // XAccessibleEditableText - virtual sal_Bool SAL_CALL cutText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL pasteText( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL deleteText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL insertText( const OUString& sText, sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL replaceText( sal_Int32 nStartIndex, sal_Int32 nEndIndex, const OUString& sReplacement ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL setAttributes( sal_Int32 nStartIndex, sal_Int32 nEndIndex, const css::uno::Sequence< css::beans::PropertyValue >& aAttributeSet ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL setText( const OUString& sText ) throw (css::uno::RuntimeException, std::exception) override; -}; - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLEEDIT_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblefixedhyperlink.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblefixedhyperlink.hxx deleted file mode 100644 index d6e876f93ee9..000000000000 --- a/accessibility/inc/accessibility/standard/vclxaccessiblefixedhyperlink.hxx +++ /dev/null @@ -1,47 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLEFIXEDHYPERLINK_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLEFIXEDHYPERLINK_HXX - -#include - - -// class VCLXAccessibleFixedHyperlink - - -class VCLXAccessibleFixedHyperlink : public VCLXAccessibleTextComponent -{ -protected: - virtual ~VCLXAccessibleFixedHyperlink(); - - virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) override; - virtual void implGetLineBoundary( css::i18n::Boundary& rBoundary, sal_Int32 nIndex ) override; - -public: - VCLXAccessibleFixedHyperlink( VCLXWindow* pVCLXindow ); - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; -}; - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLEFIXEDHYPERLINK_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblefixedtext.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblefixedtext.hxx deleted file mode 100644 index fc2616ecec53..000000000000 --- a/accessibility/inc/accessibility/standard/vclxaccessiblefixedtext.hxx +++ /dev/null @@ -1,47 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLEFIXEDTEXT_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLEFIXEDTEXT_HXX - -#include - - -// class VCLXAccessibleFixedText - - -class VCLXAccessibleFixedText : public VCLXAccessibleTextComponent -{ -protected: - virtual ~VCLXAccessibleFixedText(); - - virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) override; - virtual void implGetLineBoundary( css::i18n::Boundary& rBoundary, sal_Int32 nIndex ) override; - -public: - VCLXAccessibleFixedText( VCLXWindow* pVCLXindow ); - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; -}; - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLEFIXEDTEXT_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblelist.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblelist.hxx deleted file mode 100644 index 86b3a04238f5..000000000000 --- a/accessibility/inc/accessibility/standard/vclxaccessiblelist.hxx +++ /dev/null @@ -1,210 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLELIST_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLELIST_HXX - -#include -#include -#include "accessibility/standard/vclxaccessiblelistitem.hxx" -#include -#include -#include -#include -#include -#include - -typedef ::cppu::ImplHelper2< - css::accessibility::XAccessible, - css::accessibility::XAccessibleSelection - > VCLXAccessibleList_BASE; - -typedef std::vector< css::uno::WeakReference< css::accessibility::XAccessible > > - ListItems; - -namespace accessibility -{ - class IComboListBoxHelper; -} - - -/** Base class for the list contained in list- and combo boxes. This class - does not support selection because lists of combo boxes give no direct - access to their underlying list implementation. Look into derived - classes for selection. -*/ -class VCLXAccessibleList - : public VCLXAccessibleComponent, - public VCLXAccessibleList_BASE -{ -public: - enum BoxType {COMBOBOX, LISTBOX}; - - VCLXAccessibleList (VCLXWindow* pVCLXindow, BoxType aBoxType, - const css::uno::Reference< - css::accessibility::XAccessible >& _xParent); - - /** The index that is passed to this method is returned on following - calls to getAccessibleIndexInParent. - */ - void SetIndexInParent (sal_Int32 nIndex); - - /** Process some of the events and delegate the rest to the base classes. - */ - virtual void ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent) override; - virtual void FillAccessibleRelationSet( utl::AccessibleRelationSetHelper& rRelationSet ) override; - - /** Called on reception of selection events this method checks all known - list items for a possible change in their selection state and - updates that accordingly. No accessibility events are send because - the XAccessibleSelection interface is not supported and the items - are transient. - @param sTextOfSelectedItem - This string contains the text of the currently selected - item. It is used to retrieve the index of that item. - */ - void UpdateSelection (const OUString& sTextOfSelectedItem); - - // XInterface - DECLARE_XINTERFACE() - - // XTypeProvider - DECLARE_XTYPEPROVIDER() - - // XAccessible - virtual css::uno::Reference< css::accessibility::XAccessibleContext> SAL_CALL - getAccessibleContext() - throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleContext - virtual sal_Int32 SAL_CALL getAccessibleChildCount() - throw (css::uno::RuntimeException, std::exception) override; - css::uno::Reference< css::accessibility::XAccessible> SAL_CALL - getAccessibleChild (sal_Int32 i) - throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL - getAccessibleParent( ) - throw (css::uno::RuntimeException, std::exception) override; - - /** The index returned as index in parent is always the one set with the - SetIndexInParent() method. - */ - virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() - throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int16 SAL_CALL getAccessibleRole() - throw (css::uno::RuntimeException, std::exception) override; - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() - throw (css::uno::RuntimeException, std::exception) override; - // Return list specific services. - virtual css::uno::Sequence< OUString > SAL_CALL - getSupportedServiceNames() - throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleSelection - virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL clearAccessibleSelection( ) throw (css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL selectAllAccessibleChildren( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - - virtual css::awt::Point SAL_CALL getLocationOnScreen( ) throw (css::uno::RuntimeException, std::exception) override; - bool IsInDropDown(); - void HandleDropOpen(); - void ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent, bool b_IsDropDownList); - void UpdateSelection_Acc (const ::rtl::OUString& sTextOfSelectedItem, bool b_IsDropDownList); - void UpdateSelection_Impl_Acc (bool b_IsDropDownList); - - void UpdateFocus_Impl_Acc ( sal_Int32 nPos, bool b_IsDropDownList) ; - static void NotifyListItem(css::uno::Any& val); -protected: - BoxType m_aBoxType; - ::accessibility::IComboListBoxHelper* m_pListBoxHelper; - ListItems m_aAccessibleChildren; - sal_Int32 m_nVisibleLineCount; - /// Index in parent. This is settable from the outside. - sal_Int32 m_nIndexInParent; - sal_Int32 m_nLastTopEntry; - sal_Int32 m_nLastSelectedPos; - bool m_bDisableProcessEvent; - bool m_bVisible; - sal_Int32 m_nCurSelectedPos; - - - virtual ~VCLXAccessibleList(); - - /** This function is called from the implementation helper during a - XComponent::dispose call. Free the list of items and the items themselves. - */ - virtual void SAL_CALL disposing() override; - - /** This method adds the states - AccessibleStateType::FOCUSABLE and possibly - AccessibleStateType::MULTI_SELECTABLE to the state set - of the base classes. - */ - virtual void FillAccessibleStateSet (utl::AccessibleStateSetHelper& rStateSet) override; - - /** Create the specified child and insert it into the list of children. - Sets the child's states. - */ - css::uno::Reference< css::accessibility::XAccessible > - CreateChild (sal_Int32 i); - - /** Call this method when the item list has been changed, i.e. items - have been deleted or inserted. - @param bItemInserted - Indicate whether items have been inserted (TRUE) or removed (FALSE). - @param nIndex - Index of the new or removed item. A value of -1 indicates that - the whole list has been cleared. - */ - void HandleChangedItemList (bool bItemInserted, sal_Int32 nIndex); - - // VCLXAccessibleComponent - virtual css::awt::Rectangle implGetBounds( ) throw (css::uno::RuntimeException) override; - -private: - /** We need to save the accessible parent to return it in getAccessibleParent(), - because this method of the base class returns the wrong parent. - */ - css::uno::Reference< css::accessibility::XAccessible > m_xParent; - - - /** dispose all items aand clears the container - */ - void clearItems(); - - void UpdateEntryRange_Impl(); -protected: - void UpdateSelection_Impl(sal_Int32 nPos = 0); - bool checkEntrySelected(sal_Int32 _nPos, - css::uno::Any& _rNewValue, - css::uno::Reference< css::accessibility::XAccessible >& _rxNewAcc); -private: - void notifyVisibleStates(bool _bSetNew ); - void UpdateVisibleLineCount(); -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblelistbox.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblelistbox.hxx deleted file mode 100644 index d015b4b79a4d..000000000000 --- a/accessibility/inc/accessibility/standard/vclxaccessiblelistbox.hxx +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLELISTBOX_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLELISTBOX_HXX - -#include -#include -#include -#include - - -/** The accessible drop down combobox has one children. It is the list - containing all items and is represented by an object of the - VCLXAccessibleListBoxList class which does support - selection. -*/ -class VCLXAccessibleListBox : public VCLXAccessibleBox -{ -public: - VCLXAccessibleListBox (VCLXWindow* pVCLXindow); - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() - throw (css::uno::RuntimeException, std::exception) override; - // Return list box specific services. - virtual css::uno::Sequence< OUString > SAL_CALL - getSupportedServiceNames() - throw (css::uno::RuntimeException, std::exception) override; - -protected: - virtual ~VCLXAccessibleListBox(); - - virtual bool IsValid() const override; - virtual void ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent) override; -}; - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLELISTBOX_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblelistitem.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblelistitem.hxx deleted file mode 100644 index f851060c8248..000000000000 --- a/accessibility/inc/accessibility/standard/vclxaccessiblelistitem.hxx +++ /dev/null @@ -1,173 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLELISTITEM_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLELISTITEM_HXX - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// forward --------------------------------------------------------------- - -namespace com { namespace sun { namespace star { namespace awt { - struct Point; - struct Rectangle; - struct Size; - class XFocusListener; -} } } } - -namespace accessibility -{ - class IComboListBoxHelper; -} - -// class VCLXAccessibleListItem ------------------------------------------ - -typedef ::cppu::WeakAggComponentImplHelper6< css::accessibility::XAccessible - , css::accessibility::XAccessibleContext - , css::accessibility::XAccessibleComponent - , css::accessibility::XAccessibleEventBroadcaster - , css::accessibility::XAccessibleText - , css::lang::XServiceInfo > VCLXAccessibleListItem_BASE; - -/** the class OAccessibleListBoxEntry represents the base class for an accessible object of a listbox entry -*/ -class VCLXAccessibleListItem : public ::comphelper::OBaseMutex, - public ::comphelper::OCommonAccessibleText, - public VCLXAccessibleListItem_BASE -{ -private: - OUString m_sEntryText; - sal_Int32 m_nIndexInParent; - bool m_bSelected; - bool m_bVisible; - -protected: - /// client id in the AccessibleEventNotifier queue - sal_uInt32 m_nClientId; - ::accessibility::IComboListBoxHelper* m_pListBoxHelper; - - css::uno::Reference< css::accessibility::XAccessible > m_xParent; - css::uno::Reference< css::accessibility::XAccessibleContext > m_xParentContext; - -protected: - virtual ~VCLXAccessibleListItem(); - /** this function is called upon disposing the component - */ - virtual void SAL_CALL disposing() override; - - // OCommonAccessibleText - virtual OUString implGetText() override; - virtual css::lang::Locale implGetLocale() override; - virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override; - -public: - /** OAccessibleBase needs a valid view - @param _pListBoxHelper - is the list- or combobox for which we implement an accessible object - @param _nIndexInParent - is the position of the entry inside the listbox - @param _xParent - is our parent accessible object - */ - VCLXAccessibleListItem( ::accessibility::IComboListBoxHelper* _pListBoxHelper, - sal_Int32 _nIndexInParent, - const css::uno::Reference< css::accessibility::XAccessible >& _xParent ); - - void NotifyAccessibleEvent( sal_Int16 _nEventId, const css::uno::Any& _aOldValue, const css::uno::Any& _aNewValue ); - - inline bool IsSelected() const { return m_bSelected; } - void SetSelected( bool _bSelected ); - void SetVisible( bool _bVisible ); - - // XInterface - virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) throw(css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL acquire( ) throw() override; - virtual void SAL_CALL release( ) throw() override; - - // XTypeProvider - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (css::uno::RuntimeException, std::exception) override; - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; - - // XAccessible - virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleContext - virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleDescription( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleName( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::lang::Locale SAL_CALL getLocale( ) throw (css::accessibility::IllegalAccessibleComponentStateException, css::uno::RuntimeException, std::exception) override; - - // XAccessibleComponent - virtual sal_Bool SAL_CALL containsPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::awt::Rectangle SAL_CALL getBounds( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::awt::Point SAL_CALL getLocation( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::awt::Point SAL_CALL getLocationOnScreen( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::awt::Size SAL_CALL getSize( ) throw (css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL grabFocus( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getForeground() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getBackground() throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleText - virtual sal_Int32 SAL_CALL getCaretPosition() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getCharacterCount() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getSelectedText() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getSelectionStart() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getSelectionEnd() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getText() throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; - virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; - virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - - // XAccessibleEventBroadcaster - virtual void SAL_CALL addAccessibleEventListener( const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener ) throw (css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL removeAccessibleEventListener( const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener ) throw (css::uno::RuntimeException, std::exception) override; -}; - -#endif // ACCESSIBILITY_STANDARD_ACCESSIBLELISTBOXENTRY_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblemenu.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblemenu.hxx deleted file mode 100644 index 58484dba443e..000000000000 --- a/accessibility/inc/accessibility/standard/vclxaccessiblemenu.hxx +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLEMENU_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLEMENU_HXX - -#include -#include - -#include - - -// class VCLXAccessibleMenu - - -typedef ::cppu::ImplHelper1 < - css::accessibility::XAccessibleSelection > VCLXAccessibleMenu_BASE; - -class VCLXAccessibleMenu : public VCLXAccessibleMenuItem, - public VCLXAccessibleMenu_BASE -{ -protected: - virtual bool IsFocused() override; - virtual bool IsPopupMenuOpen() override; - -public: - VCLXAccessibleMenu( Menu* pParent, sal_uInt16 nItemPos, Menu* pMenu ); - virtual ~VCLXAccessibleMenu(); - - // XInterface - DECLARE_XINTERFACE() - - // XTypeProvider - DECLARE_XTYPEPROVIDER() - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleContext - virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleComponent - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleSelection - virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL clearAccessibleSelection( ) throw (css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL selectAllAccessibleChildren( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - - // XAccessibleAction - virtual ::rtl::OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; -}; - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLEMENU_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblemenubar.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblemenubar.hxx deleted file mode 100644 index 261256a0e938..000000000000 --- a/accessibility/inc/accessibility/standard/vclxaccessiblemenubar.hxx +++ /dev/null @@ -1,66 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLEMENUBAR_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLEMENUBAR_HXX - -#include -#include - -class VclSimpleEvent; -class VclWindowEvent; -namespace vcl { class Window; } - - -// class VCLXAccessibleMenuBar - - -class VCLXAccessibleMenuBar : public OAccessibleMenuComponent -{ -protected: - VclPtr m_pWindow; - - virtual bool IsFocused() override; - - DECL_LINK_TYPED( WindowEventListener, VclWindowEvent&, void ); - - void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); - - // XComponent - virtual void SAL_CALL disposing() override; - -public: - VCLXAccessibleMenuBar( Menu* pMenu ); - virtual ~VCLXAccessibleMenuBar(); - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleContext - virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleExtendedComponent - virtual sal_Int32 SAL_CALL getBackground( ) throw (css::uno::RuntimeException, std::exception) override; -}; - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLEMENUBAR_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblemenuitem.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblemenuitem.hxx deleted file mode 100644 index 19d39f53202f..000000000000 --- a/accessibility/inc/accessibility/standard/vclxaccessiblemenuitem.hxx +++ /dev/null @@ -1,109 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLEMENUITEM_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLEMENUITEM_HXX - -#include - -#include -#include - -#include -#include - - -// class VCLXAccessibleMenuItem - - -typedef ::cppu::ImplHelper3< - css::accessibility::XAccessibleText, - css::accessibility::XAccessibleAction, - css::accessibility::XAccessibleValue > VCLXAccessibleMenuItem_BASE; - -class VCLXAccessibleMenuItem : public OAccessibleMenuItemComponent, - public ::comphelper::OCommonAccessibleText, - public VCLXAccessibleMenuItem_BASE -{ -protected: - virtual bool IsFocused() override; - virtual bool IsSelected() override; - virtual bool IsChecked() override; - - virtual bool IsHighlighted() override; - - virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) override; - - // OCommonAccessibleText - virtual OUString implGetText() override; - virtual css::lang::Locale implGetLocale() override; - virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override; - -public: - VCLXAccessibleMenuItem( Menu* pParent, sal_uInt16 nItemPos, Menu* pMenu = nullptr ); - virtual ~VCLXAccessibleMenuItem(); - - // XInterface - DECLARE_XINTERFACE() - - // XTypeProvider - DECLARE_XTYPEPROVIDER() - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleContext - virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleText - virtual sal_Int32 SAL_CALL getCaretPosition() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getCharacterCount() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getSelectedText() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getSelectionStart() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getSelectionEnd() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getText() throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; - virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; - virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - - // XAccessibleAction - virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL doAccessibleAction ( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - - // XAccessibleValue - virtual css::uno::Any SAL_CALL getCurrentValue( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL setCurrentValue( const css::uno::Any& aNumber ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Any SAL_CALL getMaximumValue( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Any SAL_CALL getMinimumValue( ) throw (css::uno::RuntimeException, std::exception) override; -}; - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLEMENUITEM_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblemenuseparator.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblemenuseparator.hxx deleted file mode 100644 index 4e3250b06f7b..000000000000 --- a/accessibility/inc/accessibility/standard/vclxaccessiblemenuseparator.hxx +++ /dev/null @@ -1,46 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLEMENUSEPARATOR_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLEMENUSEPARATOR_HXX - -#include - - -// class VCLXAccessibleMenuSeparator - - -class VCLXAccessibleMenuSeparator : public OAccessibleMenuItemComponent -{ -public: - VCLXAccessibleMenuSeparator( Menu* pParent, sal_uInt16 nItemPos, Menu* pMenu = nullptr ); - virtual ~VCLXAccessibleMenuSeparator(); - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleContext - virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; -}; - - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLEMENUSEPARATOR_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblepopupmenu.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblepopupmenu.hxx deleted file mode 100644 index d91ed83b2be5..000000000000 --- a/accessibility/inc/accessibility/standard/vclxaccessiblepopupmenu.hxx +++ /dev/null @@ -1,52 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLEPOPUPMENU_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLEPOPUPMENU_HXX - -#include - - -// class VCLXAccessiblePopupMenu - - -class VCLXAccessiblePopupMenu : public OAccessibleMenuComponent -{ -protected: - virtual bool IsFocused() override; - -public: - VCLXAccessiblePopupMenu( Menu* pMenu ); - virtual ~VCLXAccessiblePopupMenu(); - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleContext - virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleExtendedComponent - virtual sal_Int32 SAL_CALL getBackground( ) throw (css::uno::RuntimeException, std::exception) override; -}; - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLEPOPUPMENU_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/standard/vclxaccessibleradiobutton.hxx b/accessibility/inc/accessibility/standard/vclxaccessibleradiobutton.hxx deleted file mode 100644 index ed0ac66abdca..000000000000 --- a/accessibility/inc/accessibility/standard/vclxaccessibleradiobutton.hxx +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLERADIOBUTTON_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLERADIOBUTTON_HXX - -#include - -#include -#include - -#include - - -// class VCLXAccessibleRadioButton - - -typedef ::cppu::ImplHelper2< - css::accessibility::XAccessibleAction, - css::accessibility::XAccessibleValue > VCLXAccessibleRadioButton_BASE; - -class VCLXAccessibleRadioButton : public VCLXAccessibleTextComponent, - public VCLXAccessibleRadioButton_BASE -{ -protected: - virtual ~VCLXAccessibleRadioButton(); - - virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; - virtual void FillAccessibleRelationSet( utl::AccessibleRelationSetHelper& rRelationSet ) override; - virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) override; - -public: - VCLXAccessibleRadioButton( VCLXWindow* pVCLXindow ); - - // XInterface - DECLARE_XINTERFACE() - - // XTypeProvider - DECLARE_XTYPEPROVIDER() - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleAction - virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL doAccessibleAction ( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - - // XAccessibleValue - virtual css::uno::Any SAL_CALL getCurrentValue( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL setCurrentValue( const css::uno::Any& aNumber ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Any SAL_CALL getMaximumValue( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Any SAL_CALL getMinimumValue( ) throw (css::uno::RuntimeException, std::exception) override; -}; - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLERADIOBUTTON_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblescrollbar.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblescrollbar.hxx deleted file mode 100644 index 6b8617f75ebf..000000000000 --- a/accessibility/inc/accessibility/standard/vclxaccessiblescrollbar.hxx +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLESCROLLBAR_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLESCROLLBAR_HXX - -#include - -#include -#include - -#include - - -// class VCLXAccessibleScrollBar - - -typedef ::cppu::ImplHelper2< - css::accessibility::XAccessibleAction, - css::accessibility::XAccessibleValue > VCLXAccessibleScrollBar_BASE; - -class VCLXAccessibleScrollBar : public VCLXAccessibleComponent, - public VCLXAccessibleScrollBar_BASE -{ -protected: - virtual ~VCLXAccessibleScrollBar(); - - virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; - virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) override; - -public: - VCLXAccessibleScrollBar( VCLXWindow* pVCLXindow ); - - // XInterface - DECLARE_XINTERFACE() - - // XTypeProvider - DECLARE_XTYPEPROVIDER() - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleAction - virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL doAccessibleAction ( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - - // XAccessibleValue - virtual css::uno::Any SAL_CALL getCurrentValue( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL setCurrentValue( const css::uno::Any& aNumber ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Any SAL_CALL getMaximumValue( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Any SAL_CALL getMinimumValue( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleContext - ::rtl::OUString SAL_CALL getAccessibleName( ) throw (css::uno::RuntimeException, std::exception) override; - -}; - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLESCROLLBAR_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblestatusbar.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblestatusbar.hxx deleted file mode 100644 index 65c9e106366e..000000000000 --- a/accessibility/inc/accessibility/standard/vclxaccessiblestatusbar.hxx +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLESTATUSBAR_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLESTATUSBAR_HXX - -#include -#include - -#include - -class StatusBar; - - -// class VCLXAccessibleStatusBar - - -class VCLXAccessibleStatusBar : public VCLXAccessibleComponent -{ -private: - typedef ::std::vector< css::uno::Reference< css::accessibility::XAccessible > > AccessibleChildren; - - AccessibleChildren m_aAccessibleChildren; - VclPtr m_pStatusBar; - -protected: - void UpdateShowing( sal_Int32 i, bool bShowing ); - void UpdateItemName( sal_Int32 i ); - void UpdateItemText( sal_Int32 i ); - - void InsertChild( sal_Int32 i ); - void RemoveChild( sal_Int32 i ); - - virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; - - // XComponent - virtual void SAL_CALL disposing() override; - -public: - VCLXAccessibleStatusBar( VCLXWindow* pVCLXWindow ); - virtual ~VCLXAccessibleStatusBar(); - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleContext - virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - - // XAccessibleComponent - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; -}; - - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLESTATUSBAR_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblestatusbaritem.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblestatusbaritem.hxx deleted file mode 100644 index 6e4b56f6e6e2..000000000000 --- a/accessibility/inc/accessibility/standard/vclxaccessiblestatusbaritem.hxx +++ /dev/null @@ -1,134 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLESTATUSBARITEM_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLESTATUSBARITEM_HXX - -#include -#include -#include -#include -#include - -class StatusBar; -class VCLExternalSolarLock; - -namespace utl { -class AccessibleStateSetHelper; -} - - -// class VCLXAccessibleStatusBarItem - - -typedef ::comphelper::OAccessibleTextHelper AccessibleTextHelper_BASE; - -typedef ::cppu::ImplHelper2< - css::accessibility::XAccessible, - css::lang::XServiceInfo > VCLXAccessibleStatusBarItem_BASE; - -class VCLXAccessibleStatusBarItem : public AccessibleTextHelper_BASE, - public VCLXAccessibleStatusBarItem_BASE -{ - friend class VCLXAccessibleStatusBar; - -private: - VCLExternalSolarLock* m_pExternalLock; - VclPtr m_pStatusBar; - sal_uInt16 m_nItemId; - OUString m_sItemName; - OUString m_sItemText; - bool m_bShowing; - -protected: - bool IsShowing(); - void SetShowing( bool bShowing ); - void SetItemName( const OUString& sItemName ); - OUString GetItemName(); - void SetItemText( const OUString& sItemText ); - OUString GetItemText(); - sal_uInt16 GetItemId() const { return m_nItemId; } - - void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ); - - // OCommonAccessibleComponent - virtual css::awt::Rectangle implGetBounds( ) throw (css::uno::RuntimeException) override; - - // OCommonAccessibleText - virtual OUString implGetText() override; - virtual css::lang::Locale implGetLocale() override; - virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override; - - // XComponent - virtual void SAL_CALL disposing() override; - -public: - VCLXAccessibleStatusBarItem( StatusBar* pStatusBar, sal_uInt16 nItemId ); - virtual ~VCLXAccessibleStatusBarItem(); - - // XInterface - DECLARE_XINTERFACE() - - // XTypeProvider - DECLARE_XTYPEPROVIDER() - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; - - // XAccessible - virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleContext - virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleDescription( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleName( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::lang::Locale SAL_CALL getLocale( ) throw (css::accessibility::IllegalAccessibleComponentStateException, css::uno::RuntimeException, std::exception) override; - - // XAccessibleComponent - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL grabFocus( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getForeground( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getBackground( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleExtendedComponent - virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getTitledBorderText( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getToolTipText( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleText - virtual sal_Int32 SAL_CALL getCaretPosition() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; -}; - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLESTATUSBARITEM_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/standard/vclxaccessibletabcontrol.hxx b/accessibility/inc/accessibility/standard/vclxaccessibletabcontrol.hxx deleted file mode 100644 index bfcbab4a8cd1..000000000000 --- a/accessibility/inc/accessibility/standard/vclxaccessibletabcontrol.hxx +++ /dev/null @@ -1,96 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLETABCONTROL_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLETABCONTROL_HXX - -#include -#include -#include - -#include - -class TabControl; - - -// class VCLXAccessibleTabControl - - -typedef ::cppu::ImplHelper1 < - css::accessibility::XAccessibleSelection > VCLXAccessibleTabControl_BASE; - -class VCLXAccessibleTabControl : public VCLXAccessibleComponent, - public VCLXAccessibleTabControl_BASE -{ -private: - typedef ::std::vector< css::uno::Reference< css::accessibility::XAccessible > > AccessibleChildren; - - AccessibleChildren m_aAccessibleChildren; - VclPtr m_pTabControl; - -protected: - void UpdateFocused(); - void UpdateSelected( sal_Int32 i, bool bSelected ); - void UpdatePageText( sal_Int32 i ); - void UpdateTabPage( sal_Int32 i, bool bNew ); - - void InsertChild( sal_Int32 i ); - void RemoveChild( sal_Int32 i ); - - virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; - virtual void ProcessWindowChildEvent( const VclWindowEvent& rVclWindowEvent ) override; - virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) override; - - // XComponent - virtual void SAL_CALL disposing() override; - -public: - VCLXAccessibleTabControl( VCLXWindow* pVCLXWindow ); - virtual ~VCLXAccessibleTabControl(); - - // XInterface - DECLARE_XINTERFACE() - - // XTypeProvider - DECLARE_XTYPEPROVIDER() - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleContext - virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleName( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleSelection - virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL clearAccessibleSelection( ) throw (css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL selectAllAccessibleChildren( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; -}; - - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLETABCONTROL_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/standard/vclxaccessibletabpage.hxx b/accessibility/inc/accessibility/standard/vclxaccessibletabpage.hxx deleted file mode 100644 index 4749e6dd9a5d..000000000000 --- a/accessibility/inc/accessibility/standard/vclxaccessibletabpage.hxx +++ /dev/null @@ -1,139 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLETABPAGE_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLETABPAGE_HXX - -#include -#include -#include -#include -#include - - -class TabControl; -class VCLExternalSolarLock; - -namespace utl { -class AccessibleStateSetHelper; -} - - -// class VCLXAccessibleTabPage - - -typedef ::comphelper::OAccessibleTextHelper AccessibleTextHelper_BASE; - -typedef ::cppu::ImplHelper2< - css::accessibility::XAccessible, - css::lang::XServiceInfo > VCLXAccessibleTabPage_BASE; - -class VCLXAccessibleTabPage : public AccessibleTextHelper_BASE, - public VCLXAccessibleTabPage_BASE -{ - friend class VCLXAccessibleTabControl; - -private: - VCLExternalSolarLock* m_pExternalLock; - VclPtr m_pTabControl; - sal_uInt16 m_nPageId; - bool m_bFocused; - bool m_bSelected; - OUString m_sPageText; - -protected: - bool IsFocused(); - bool IsSelected(); - - void SetFocused( bool bFocused ); - void SetSelected( bool bSelected ); - void SetPageText( const OUString& sPageText ); - OUString GetPageText(); - - void Update( bool bNew ); - - sal_uInt16 GetPageId() const { return m_nPageId; } - - void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ); - - // OCommonAccessibleComponent - virtual css::awt::Rectangle implGetBounds( ) throw (css::uno::RuntimeException) override; - - // OCommonAccessibleText - virtual OUString implGetText() override; - virtual css::lang::Locale implGetLocale() override; - virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override; - - // XComponent - virtual void SAL_CALL disposing() override; - -public: - VCLXAccessibleTabPage( TabControl* pTabControl, sal_uInt16 nPageId ); - virtual ~VCLXAccessibleTabPage(); - - // XInterface - DECLARE_XINTERFACE() - - // XTypeProvider - DECLARE_XTYPEPROVIDER() - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; - - // XAccessible - virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleContext - virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleDescription( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleName( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::lang::Locale SAL_CALL getLocale( ) throw (css::accessibility::IllegalAccessibleComponentStateException, css::uno::RuntimeException, std::exception) override; - - // XAccessibleComponent - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL grabFocus( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getForeground( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getBackground( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleExtendedComponent - virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getTitledBorderText( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getToolTipText( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleText - virtual sal_Int32 SAL_CALL getCaretPosition() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; -}; - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLETABPAGE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/standard/vclxaccessibletabpagewindow.hxx b/accessibility/inc/accessibility/standard/vclxaccessibletabpagewindow.hxx deleted file mode 100644 index 391b14d3a6ab..000000000000 --- a/accessibility/inc/accessibility/standard/vclxaccessibletabpagewindow.hxx +++ /dev/null @@ -1,60 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLETABPAGEWINDOW_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLETABPAGEWINDOW_HXX - -#include -#include - - -class TabControl; -class TabPage; - - -// class VCLXAccessibleTabPageWindow - - -class VCLXAccessibleTabPageWindow : public VCLXAccessibleComponent -{ -private: - VclPtr m_pTabControl; - VclPtr m_pTabPage; - sal_uInt16 m_nPageId; - -protected: - // OCommonAccessibleComponent - virtual css::awt::Rectangle implGetBounds( ) throw (css::uno::RuntimeException) override; - - // XComponent - virtual void SAL_CALL disposing() override; - -public: - VCLXAccessibleTabPageWindow( VCLXWindow* pVCLXWindow ); - virtual ~VCLXAccessibleTabPageWindow(); - - // XAccessibleContext - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (css::uno::RuntimeException, std::exception) override; -}; - - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLETABPAGEWINDOW_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/standard/vclxaccessibletextcomponent.hxx b/accessibility/inc/accessibility/standard/vclxaccessibletextcomponent.hxx deleted file mode 100644 index 10390f508616..000000000000 --- a/accessibility/inc/accessibility/standard/vclxaccessibletextcomponent.hxx +++ /dev/null @@ -1,85 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLETEXTCOMPONENT_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLETEXTCOMPONENT_HXX - -#include -#include - - -// class VCLXAccessibleTextComponent - - -typedef ::cppu::ImplHelper1 < - css::accessibility::XAccessibleText > VCLXAccessibleTextComponent_BASE; - -class VCLXAccessibleTextComponent : public VCLXAccessibleComponent, - public ::comphelper::OCommonAccessibleText, - public VCLXAccessibleTextComponent_BASE -{ -protected: - OUString m_sText; - - void SetText( const OUString& sText ); - - virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; - - // OCommonAccessibleText - virtual OUString implGetText() override; - virtual css::lang::Locale implGetLocale() override; - virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override; - - // XComponent - virtual void SAL_CALL disposing() override; - -public: - VCLXAccessibleTextComponent( VCLXWindow* pVCLXWindow ); - virtual ~VCLXAccessibleTextComponent(); - - // XInterface - DECLARE_XINTERFACE() - - // XTypeProvider - DECLARE_XTYPEPROVIDER() - - // XAccessibleText - virtual sal_Int32 SAL_CALL getCaretPosition() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getCharacterCount() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getSelectedText() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getSelectionStart() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getSelectionEnd() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getText() throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; - virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; - virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; -}; - - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLETEXTCOMPONENT_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/standard/vclxaccessibletextfield.hxx b/accessibility/inc/accessibility/standard/vclxaccessibletextfield.hxx deleted file mode 100644 index 58ec93b94392..000000000000 --- a/accessibility/inc/accessibility/standard/vclxaccessibletextfield.hxx +++ /dev/null @@ -1,92 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLETEXTFIELD_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLETEXTFIELD_HXX - -#include - -#include - -typedef ::cppu::ImplHelper1< css::accessibility::XAccessible > VCLXAccessible_BASE; - - -/** This class represents non editable text fields. The object passed to - the constructor is expected to be a list (a ListBox to be - more specific). From this always the selected item is token to be made - accessible by this class. When the selected item changes then also the - exported text changes. -*/ -class VCLXAccessibleTextField : - public VCLXAccessibleTextComponent, - public VCLXAccessible_BASE -{ -public: - VCLXAccessibleTextField (VCLXWindow* pVCLXindow, - const css::uno::Reference< css::accessibility::XAccessible >& _xParent); - - // XInterface - DECLARE_XINTERFACE() - - // XTypeProvider - DECLARE_XTYPEPROVIDER() - - // XAccessible - css::uno::Reference< css::accessibility::XAccessibleContext> SAL_CALL - getAccessibleContext() - throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleContext - sal_Int32 SAL_CALL getAccessibleChildCount() - throw (css::uno::RuntimeException, std::exception) override; - css::uno::Reference< css::accessibility::XAccessible> SAL_CALL - getAccessibleChild (sal_Int32 i) - throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - sal_Int16 SAL_CALL getAccessibleRole() - throw (css::uno::RuntimeException, std::exception) override; - css::uno::Reference< css::accessibility::XAccessible > SAL_CALL - getAccessibleParent( ) - throw (css::uno::RuntimeException, std::exception) override; - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() - throw (css::uno::RuntimeException, std::exception) override; - // Return text field specific services. - virtual css::uno::Sequence< OUString > SAL_CALL - getSupportedServiceNames() - throw (css::uno::RuntimeException, std::exception) override; - -protected: - virtual ~VCLXAccessibleTextField(); - - /** With this method the text of the currently selected item is made - available to the VCLXAccessibleTextComponent base class. - */ - OUString implGetText() override; - -private: - /** We need to save the accessible parent to return it in getAccessibleParent(), - because this method of the base class returns the wrong parent. - */ - css::uno::Reference< css::accessibility::XAccessible > m_xParent; -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/standard/vclxaccessibletoolbox.hxx b/accessibility/inc/accessibility/standard/vclxaccessibletoolbox.hxx deleted file mode 100644 index c5a5b4dbd821..000000000000 --- a/accessibility/inc/accessibility/standard/vclxaccessibletoolbox.hxx +++ /dev/null @@ -1,105 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLETOOLBOX_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLETOOLBOX_HXX - -#include -#include -#include - - -// class VCLXAccessibleToolBox - - -typedef ::cppu::ImplHelper1 < css::accessibility::XAccessibleSelection > VCLXAccessibleToolBox_BASE; - -typedef std::map< sal_Int32, css::uno::Reference< css::accessibility::XAccessible > > ToolBoxItemsMap; - -class VCLXAccessibleToolBoxItem; -class ToolBox; - -class VCLXAccessibleToolBox : public VCLXAccessibleComponent, public VCLXAccessibleToolBox_BASE -{ -private: - ToolBoxItemsMap m_aAccessibleChildren; - - VCLXAccessibleToolBoxItem* GetItem_Impl( sal_Int32 _nPos ); - - void UpdateFocus_Impl(); - void ReleaseFocus_Impl( sal_Int32 _nPos ); - void UpdateChecked_Impl( sal_Int32 _nPos ); - void UpdateIndeterminate_Impl( sal_Int32 _nPos ); - void UpdateItem_Impl( sal_Int32 _nPos ); - void UpdateAllItems_Impl(); - void UpdateItemName_Impl( sal_Int32 _nPos ); - void UpdateItemEnabled_Impl( sal_Int32 _nPos ); - void UpdateCustomPopupItemp_Impl( vcl::Window* pWindow, bool bOpen ); - void HandleSubToolBarEvent( const VclWindowEvent& rVclWindowEvent ); - void ReleaseSubToolBox( ToolBox* _pSubToolBox ); - -protected: - virtual ~VCLXAccessibleToolBox(); - - virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) override; - virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; - virtual void ProcessWindowChildEvent( const VclWindowEvent& rVclWindowEvent ) override; - - virtual css::uno::Reference< css::accessibility::XAccessible > GetChildAccessible( const VclWindowEvent& rVclWindowEvent ) override; - css::uno::Reference< css::accessibility::XAccessible > GetItemWindowAccessible( const VclWindowEvent& rVclWindowEvent ); - - // XComponent - virtual void SAL_CALL disposing() override; - -public: - VCLXAccessibleToolBox( VCLXWindow* pVCLXWindow ); - - // XInterface - DECLARE_XINTERFACE( ) - - // XTypeProvider - DECLARE_XTYPEPROVIDER( ) - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleContext - virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleSelection - virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL clearAccessibleSelection( ) throw (css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL selectAllAccessibleChildren( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - -private: - void implReleaseToolboxItem( - ToolBoxItemsMap::iterator& _rMapPos, - bool _bNotifyRemoval - ); -}; - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLETOOLBOX_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/accessibility/standard/vclxaccessibletoolboxitem.hxx b/accessibility/inc/accessibility/standard/vclxaccessibletoolboxitem.hxx deleted file mode 100644 index 714d4588495c..000000000000 --- a/accessibility/inc/accessibility/standard/vclxaccessibletoolboxitem.hxx +++ /dev/null @@ -1,154 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLETOOLBOXITEM_HXX -#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLETOOLBOXITEM_HXX - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -class ToolBox; - -typedef ::comphelper::OAccessibleTextHelper AccessibleTextHelper_BASE; -typedef ::cppu::ImplHelper4 < css::accessibility::XAccessible, - css::accessibility::XAccessibleAction, - css::accessibility::XAccessibleValue, - css::lang::XServiceInfo > VCLXAccessibleToolBoxItem_BASE; - -class VCLExternalSolarLock; - -class VCLXAccessibleToolBoxItem : public AccessibleTextHelper_BASE, - public VCLXAccessibleToolBoxItem_BASE -{ -private: - OUString m_sOldName; - VclPtr m_pToolBox; - VCLExternalSolarLock* m_pExternalLock; - sal_Int32 m_nIndexInParent; - sal_Int16 m_nRole; - sal_uInt16 m_nItemId; - bool m_bHasFocus; - bool m_bIsChecked; - bool m_bIndeterminate; - - css::uno::Reference< css::accessibility::XAccessible > m_xChild; - -public: - inline sal_Int32 getIndexInParent() const { return m_nIndexInParent; } - inline void setIndexInParent( sal_Int32 _nNewIndex ) { m_nIndexInParent = _nNewIndex; } - -protected: - virtual ~VCLXAccessibleToolBoxItem(); - - virtual void SAL_CALL disposing() override; - - /// implements the calculation of the bounding rectangle - virtual css::awt::Rectangle implGetBounds( ) throw (css::uno::RuntimeException) override; - - // OCommonAccessibleText - virtual OUString implGetText() override; - virtual css::lang::Locale implGetLocale() override; - virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override; - - OUString GetText(); - -public: - VCLXAccessibleToolBoxItem( ToolBox* _pToolBox, sal_Int32 _nPos ); - - void SetFocus( bool _bFocus ); - inline bool HasFocus() const { return m_bHasFocus; } - void SetChecked( bool _bCheck ); - void SetIndeterminate( bool _bIndeterminate ); - inline void ReleaseToolBox() { m_pToolBox = nullptr; } - void NameChanged(); - void SetChild( const css::uno::Reference< css::accessibility::XAccessible >& _xChild ); - const css::uno::Reference< css::accessibility::XAccessible >& - GetChild() const { return m_xChild; } - void NotifyChildEvent( const css::uno::Reference< css::accessibility::XAccessible >& _xChild, bool _bShow ); - - void ToggleEnableState(); - - // XInterface - DECLARE_XINTERFACE( ) - DECLARE_XTYPEPROVIDER( ) - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; - - // XAccessible - virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleContext - virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleDescription( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleName( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleText - virtual sal_Int32 SAL_CALL getCaretPosition() throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - - // XAccessibleComponent - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL grabFocus( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getForeground( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Int32 SAL_CALL getBackground( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleExtendedComponent - virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getTitledBorderText( ) throw (css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getToolTipText( ) throw (css::uno::RuntimeException, std::exception) override; - - // XAccessibleAction - virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL doAccessibleAction ( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; - - // XAccessibleValue - virtual css::uno::Any SAL_CALL getCurrentValue( ) throw (css::uno::RuntimeException, std::exception) override; - virtual sal_Bool SAL_CALL setCurrentValue( const css::uno::Any& aNumber ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Any SAL_CALL getMaximumValue( ) throw (css::uno::RuntimeException, std::exception) override; - virtual css::uno::Any SAL_CALL getMinimumValue( ) throw (css::uno::RuntimeException, std::exception) override; -}; - -#endif // INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLETOOLBOXITEM_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/extended/AccessibleBrowseBox.hxx b/accessibility/inc/extended/AccessibleBrowseBox.hxx new file mode 100644 index 000000000000..0b1d2fe3e4d2 --- /dev/null +++ b/accessibility/inc/extended/AccessibleBrowseBox.hxx @@ -0,0 +1,289 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +#ifndef INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEBROWSEBOX_HXX +#define INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEBROWSEBOX_HXX + +#include +#include +#include +#include +#include + +namespace accessibility { + + class AccessibleBrowseBoxImpl; + class AccessibleBrowseBoxTable; + + +/** This class represents the complete accessible BrowseBox object. */ +class AccessibleBrowseBox : public AccessibleBrowseBoxBase +{ + friend class AccessibleBrowseBoxAccess; + +protected: + AccessibleBrowseBox( + const css::uno::Reference< css::accessibility::XAccessible >& _rxParent, + const css::uno::Reference< css::accessibility::XAccessible >& _rxCreator, + ::svt::IAccessibleTableProvider& _rBrowseBox + ); + + virtual ~AccessibleBrowseBox(); + + /** sets the XAccessible which created the context + + To be called only once, and only if in the ctor NULL was passed. + */ + void setCreator( + const css::uno::Reference< css::accessibility::XAccessible >& _rxCreator + ); + + /** Cleans up members. */ + using AccessibleBrowseBoxBase::disposing; + virtual void SAL_CALL disposing() override; + +protected: + // XAccessibleContext + + /** @return The count of visible children. */ + virtual sal_Int32 SAL_CALL getAccessibleChildCount() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return The XAccessible interface of the specified child. */ + virtual css::uno::Reference< + css::accessibility::XAccessible > SAL_CALL + getAccessibleChild( sal_Int32 nChildIndex ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + // XAccessibleComponent + + /** @return + The accessible child rendered under the given point. + */ + virtual css::uno::Reference< + css::accessibility::XAccessible > SAL_CALL + getAccessibleAtPoint( const css::awt::Point& rPoint ) + throw ( css::uno::RuntimeException, std::exception ) override; + + /** Grabs the focus to the BrowseBox. */ + virtual void SAL_CALL grabFocus() + throw ( css::uno::RuntimeException, std::exception ) override; + + // XServiceInfo + + /** @return + The name of this class. + */ + virtual OUString SAL_CALL getImplementationName() + throw ( css::uno::RuntimeException, std::exception ) override; + +public: + // helper functions + /** commitHeaderBarEvent commit the event at all listeners of the column/row header bar + @param nEventId + the event id + @param rNewValue + the new value + @param rOldValue + the old value + @param _bColumnHeaderBar + true if a column based header bar, false if a row based header bar + */ + void commitHeaderBarEvent(sal_Int16 nEventId, + const css::uno::Any& rNewValue, + const css::uno::Any& rOldValue,bool _bColumnHeaderBar = true); + + // helper functions + /** commitTableEvent commit the event at all listeners of the table + @param nEventId + the event id + @param rNewValue + the new value + @param rOldValue + the old value + */ + void commitTableEvent(sal_Int16 nEventId, + const css::uno::Any& rNewValue, + const css::uno::Any& rOldValue); + + /** returns the accessible object for the row or the column header bar + */ + inline css::uno::Reference< + css::accessibility::XAccessible > + getHeaderBar( ::svt::AccessibleBrowseBoxObjType _eObjType ) + { + return implGetHeaderBar(_eObjType); + } + + /** returns the accessible object for the table representation + */ + inline css::uno::Reference< + css::accessibility::XAccessible > + getTable( ) + { + return implGetTable(); + } + +protected: + // internal virtual methods + + /** @attention This method requires locked mutex's and a living object. + @return The bounding box (VCL rect.) relative to the parent window. */ + virtual Rectangle implGetBoundingBox() override; + /** @attention This method requires locked mutex's and a living object. + @return The bounding box (VCL rect.) in screen coordinates. */ + virtual Rectangle implGetBoundingBoxOnScreen() override; + + // internal helper methods + + /** This method creates (once) and returns the accessible data table child. + @attention This method requires locked mutex's and a living object. + @return The XAccessible interface of the data table. */ + css::uno::Reference< + css::accessibility::XAccessible > implGetTable(); + + /** This method creates (once) and returns the specified header bar. + @attention This method requires locked mutex's and a living object. + @return The XAccessible interface of the header bar. */ + css::uno::Reference< + css::accessibility::XAccessible > + implGetHeaderBar( ::svt::AccessibleBrowseBoxObjType eObjType ); + + /** This method returns one of the children that are always present: + Data table, row and column header bar or corner control. + @attention This method requires locked mutex's and a living object. + @return The XAccessible interface of the specified child. */ + css::uno::Reference< + css::accessibility::XAccessible > + implGetFixedChild( sal_Int32 nChildIndex ); + + /** This method creates and returns an accessible table. + @return An AccessibleBrowseBoxTable. */ + virtual AccessibleBrowseBoxTable* createAccessibleTable(); + +private: + // members + std::unique_ptr< AccessibleBrowseBoxImpl > m_xImpl; +}; + + +/** the XAccessible which creates/returns an AccessibleBrowseBox + + The instance holds its XAccessibleContext with a hard reference, while + the context holds this instance weak. +*/ +class AccessibleBrowseBoxAccess: + public cppu::WeakImplHelper, + public ::svt::IAccessibleBrowseBox +{ +private: + ::osl::Mutex m_aMutex; + css::uno::Reference< css::accessibility::XAccessible > + m_xParent; + ::svt::IAccessibleTableProvider& m_rBrowseBox; + + css::uno::Reference< css::accessibility::XAccessibleContext > + m_xContext; + AccessibleBrowseBox* m_pContext; + // note that this pointer is valid as long as m_xContext is valid! + +public: + AccessibleBrowseBoxAccess( + const css::uno::Reference< css::accessibility::XAccessible >& _rxParent, + ::svt::IAccessibleTableProvider& _rBrowseBox + ); + + /// checks whether the accessible context is still alive + bool isContextAlive() const; + + /// returns the AccessibleContext belonging to this Accessible + inline AccessibleBrowseBox* getContext() { return m_pContext; } + +protected: + virtual ~AccessibleBrowseBoxAccess(); + + // XAccessible + virtual css::uno::Reference< css::accessibility::XAccessibleContext > + SAL_CALL getAccessibleContext() throw ( css::uno::RuntimeException, std::exception ) override; + + // IAccessibleBrowseBox + virtual css::uno::Reference< css::accessibility::XAccessible > + getMyself() override + { + return this; + } + void dispose() override; + virtual bool isAlive() const override + { + return isContextAlive(); + } + virtual css::uno::Reference< css::accessibility::XAccessible > + getHeaderBar( ::svt::AccessibleBrowseBoxObjType _eObjType ) override + { + css::uno::Reference< css::accessibility::XAccessible > xAccessible; + AccessibleBrowseBox* pContext( getContext() ); + if ( pContext ) + xAccessible = pContext->getHeaderBar( _eObjType ); + return xAccessible; + } + virtual css::uno::Reference< css::accessibility::XAccessible > + getTable() override + { + css::uno::Reference< css::accessibility::XAccessible > xAccessible; + AccessibleBrowseBox* pContext( getContext() ); + if ( pContext ) + xAccessible = pContext->getTable(); + return xAccessible; + } + virtual void commitHeaderBarEvent( sal_Int16 nEventId, const css::uno::Any& rNewValue, + const css::uno::Any& rOldValue, bool _bColumnHeaderBar ) override + { + AccessibleBrowseBox* pContext( getContext() ); + if ( pContext ) + pContext->commitHeaderBarEvent( nEventId, rNewValue, rOldValue, _bColumnHeaderBar ); + } + virtual void commitTableEvent( sal_Int16 nEventId, + const css::uno::Any& rNewValue, const css::uno::Any& rOldValue ) override + { + AccessibleBrowseBox* pContext( getContext() ); + if ( pContext ) + pContext->commitTableEvent( nEventId, rNewValue, rOldValue ); + } + virtual void commitEvent( sal_Int16 nEventId, + const css::uno::Any& rNewValue, const css::uno::Any& rOldValue ) override + { + AccessibleBrowseBox* pContext( getContext() ); + if ( pContext ) + pContext->commitEvent( nEventId, rNewValue, rOldValue ); + } + +private: + AccessibleBrowseBoxAccess( const AccessibleBrowseBoxAccess& ) = delete; + AccessibleBrowseBoxAccess& operator=( const AccessibleBrowseBoxAccess& ) = delete; +}; + + +} // namespace accessibility + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/extended/AccessibleBrowseBoxBase.hxx b/accessibility/inc/extended/AccessibleBrowseBoxBase.hxx new file mode 100644 index 000000000000..de94fa7b3d5a --- /dev/null +++ b/accessibility/inc/extended/AccessibleBrowseBoxBase.hxx @@ -0,0 +1,447 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +#ifndef INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEBROWSEBOXBASE_HXX +#define INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEBROWSEBOXBASE_HXX + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace vcl { class Window; } + +namespace utl { + class AccessibleStateSetHelper; +} + +namespace svt { + class IAccessibleTableProvider; +} + +namespace accessibility { + +typedef ::cppu::WeakAggComponentImplHelper5< + css::accessibility::XAccessibleContext, + css::accessibility::XAccessibleComponent, + css::accessibility::XAccessibleEventBroadcaster, + css::awt::XFocusListener, + css::lang::XServiceInfo > + AccessibleBrowseBoxImplHelper; + +/** The BrowseBox accessible objects inherit from this base class. It + implements basic functionality for various Accessibility interfaces and + the event broadcaster and contains the osl::Mutex. */ +class AccessibleBrowseBoxBase : + public ::comphelper::OBaseMutex, + public AccessibleBrowseBoxImplHelper +{ +public: + /** Constructor sets specified name and description. If the constant of a + text is BBTEXT_NONE, the derived class has to set the text via + implSetName() (in Ctor) or later via + setAccessibleName() and setAccessibleDescription() (these methods + notify the listeners about the change). + + @param rxParent XAccessible interface of the parent object. + @param rBrowseBox The BrowseBox control. + @param _xFocusWindow The window that gets all the focus events. + @param eObjType Object type */ + AccessibleBrowseBoxBase( + const css::uno::Reference< css::accessibility::XAccessible >& rxParent, + ::svt::IAccessibleTableProvider& rBrowseBox, + const css::uno::Reference< css::awt::XWindow >& _xFocusWindow, + ::svt::AccessibleBrowseBoxObjType eObjType ); + + /** Constructor sets specified name and description. + @param rxParent XAccessible interface of the parent object. + @param rBrowseBox The BrowseBox control. + @param _xFocusWindow The window that gets all the focus events. + @param eObjType Object type + @param rName The name of this object. + @param rDescription The description text of this object. */ + AccessibleBrowseBoxBase( + const css::uno::Reference< css::accessibility::XAccessible >& rxParent, + ::svt::IAccessibleTableProvider& rBrowseBox, + const css::uno::Reference< css::awt::XWindow >& _xFocusWindow, + ::svt::AccessibleBrowseBoxObjType eObjType, + const OUString& rName, + const OUString& rDescription ); + +protected: + virtual ~AccessibleBrowseBoxBase(); + + /** Commits DeFunc event to listeners and cleans up members. */ + virtual void SAL_CALL disposing() override; + +public: + // XAccessibleContext + + /** @return A reference to the parent accessible object. */ + virtual css::uno::Reference SAL_CALL getAccessibleParent() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return The index of this object among the parent's children. */ + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return + The description of this object. + */ + virtual OUString SAL_CALL getAccessibleDescription() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return + The name of this object. + */ + virtual OUString SAL_CALL getAccessibleName() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return + The relation set (the BrowseBox does not have one). + */ + virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return The set of current states. */ + virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return The parent's locale. */ + virtual css::lang::Locale SAL_CALL getLocale() + throw ( css::accessibility::IllegalAccessibleComponentStateException, + css::uno::RuntimeException, std::exception ) override; + + /** @return + The role of this object. Panel, ROWHEADER, COLUMNHEADER, TABLE, TABLE_CELL are supported. + */ + virtual sal_Int16 SAL_CALL getAccessibleRole() + throw ( css::uno::RuntimeException, std::exception ) override; + + /* Derived classes have to implement: + - getAccessibleChildCount, + - getAccessibleChild, + - getAccessibleRole. + Derived classes may overwrite getAccessibleIndexInParent to increase + performance. */ + + // XAccessibleComponent + + /** @return + TRUE, if the point lies within the bounding box of this object. */ + virtual sal_Bool SAL_CALL containsPoint( const css::awt::Point& rPoint ) + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return The bounding box of this object. */ + virtual css::awt::Rectangle SAL_CALL getBounds() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return + The upper left corner of the bounding box relative to the parent. */ + virtual css::awt::Point SAL_CALL getLocation() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return + The upper left corner of the bounding box in screen coordinates. */ + virtual css::awt::Point SAL_CALL getLocationOnScreen() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return The size of the bounding box. */ + virtual css::awt::Size SAL_CALL getSize() + throw ( css::uno::RuntimeException, std::exception ) override; + + virtual sal_Int32 SAL_CALL getForeground( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getBackground( ) throw (css::uno::RuntimeException, std::exception) override; + + // XFocusListener + virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) throw (css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL focusGained( const css::awt::FocusEvent& e ) throw (css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL focusLost( const css::awt::FocusEvent& e ) throw (css::uno::RuntimeException, std::exception) override; + + /* Derived classes have to implement: + - getAccessibleAt, + - grabFocus. */ + + /** @return + The accessible child rendered under the given point. + */ + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& rPoint ) + throw ( css::uno::RuntimeException, std::exception ) override; + + // XAccessibleEventBroadcaster + + /** Adds a new event listener */ + virtual void SAL_CALL addAccessibleEventListener( + const css::uno::Reference< css::accessibility::XAccessibleEventListener>& rxListener ) + throw ( css::uno::RuntimeException, std::exception ) override; + + /** Removes an event listener. */ + virtual void SAL_CALL removeAccessibleEventListener( + const css::uno::Reference< css::accessibility::XAccessibleEventListener>& rxListener ) + throw ( css::uno::RuntimeException, std::exception ) override; + + // XTypeProvider + + /** @return An unique implementation ID. */ + virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() + throw ( css::uno::RuntimeException, std::exception ) override; + + // XServiceInfo + + /** @return Whether the specified service is supported by this class. */ + virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return A list of all supported services. */ + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() + throw ( css::uno::RuntimeException, std::exception ) override; + + /* Derived classes have to implement: + - getImplementationName. */ + + // helper methods + + /** @return The BrowseBox object type. */ + inline ::svt::AccessibleBrowseBoxObjType getType() const; + + /** Changes the name of the object and notifies listeners. */ + void setAccessibleName( const OUString& rName ); + /** Changes the description of the object and notifies listeners. */ + void setAccessibleDescription( const OUString& rDescription ); + + /** Commits an event to all listeners. */ + void commitEvent( + sal_Int16 nEventId, + const css::uno::Any& rNewValue, + const css::uno::Any& rOldValue ); + /** @return TRUE, if the object is not disposed or disposing. */ + bool isAlive() const; + +protected: + // internal virtual methods + + /** Determines whether the BrowseBox control is really showing inside of + its parent accessible window. Derived classes may implement different + behaviour. + @attention This method requires locked mutex's and a living object. + @return TRUE, if the object is really showing. */ + bool implIsShowing(); + + /** Derived classes return the bounding box relative to the parent window. + @attention This method requires locked mutex's and a living object. + @return The bounding box (VCL rect.) relative to the parent window. */ + virtual Rectangle implGetBoundingBox() = 0; + /** Derived classes return the bounding box in screen coordinates. + @attention This method requires locked mutex's and a living object. + @return The bounding box (VCL rect.) in screen coordinates. */ + virtual Rectangle implGetBoundingBoxOnScreen() = 0; + + /** Creates a new AccessibleStateSetHelper and fills it with states of the + current object. This method calls FillStateSet at the BrowseBox which + fills it with more states depending on the object type. Derived classes + may overwrite this method and add more states. + @attention This method requires locked mutex's. + @return A filled AccessibleStateSetHelper. */ + virtual ::utl::AccessibleStateSetHelper* implCreateStateSetHelper(); + + // internal helper methods + + /** @throws DisposedException If the object is not alive. */ + void ensureIsAlive() const + throw ( css::lang::DisposedException ); + + /** @return The osl::Mutex member provided by the class OBaseMutex. */ + inline ::osl::Mutex& getOslMutex(); + + /** Changes the name of the object (flat assignment, no notify). + @attention This method requires a locked mutex. */ + inline void implSetName( const OUString& rName ); + + /** Locks all mutex's and calculates the bounding box relative to the + parent window. + @return The bounding box (VCL rect.) relative to the parent object. */ + Rectangle getBoundingBox() + throw ( css::lang::DisposedException ); + /** Locks all mutex's and calculates the bounding box in screen + coordinates. + @return The bounding box (VCL rect.) in screen coordinates. */ + Rectangle getBoundingBoxOnScreen() + throw ( css::lang::DisposedException ); + + ::comphelper::AccessibleEventNotifier::TClientId getClientId() const { return m_aClientId; } + void setClientId(::comphelper::AccessibleEventNotifier::TClientId _aNewClientId) { m_aClientId = _aNewClientId; } + +public: + // public versions of internal helper methods, with access control + struct AccessControl { friend class SolarMethodGuard; private: AccessControl() { } }; + + inline ::osl::Mutex& getMutex( const AccessControl& ) { return getOslMutex(); } + inline void ensureIsAlive( const AccessControl& ) { ensureIsAlive(); } + +protected: + // members + + /** The parent accessible object. */ + css::uno::Reference< css::accessibility::XAccessible > mxParent; + /** The VCL BrowseBox control. */ + ::svt::IAccessibleTableProvider* mpBrowseBox; + + /** This is the window which get all the nice focus events + */ + css::uno::Reference< css::awt::XWindow > m_xFocusWindow; + +private: + /** Localized name. */ + OUString maName; + /** Localized description text. */ + OUString maDescription; + + /** The type of this object (for names, descriptions, state sets, ...). */ + ::svt::AccessibleBrowseBoxObjType meObjType; + + ::comphelper::AccessibleEventNotifier::TClientId m_aClientId; +}; + + +// a version of AccessibleBrowseBoxBase which implements not only the XAccessibleContext, +// but also the XAccessible + +typedef ::cppu::ImplHelper1 < css::accessibility::XAccessible + > BrowseBoxAccessibleElement_Base; + +class BrowseBoxAccessibleElement + :public AccessibleBrowseBoxBase + ,public BrowseBoxAccessibleElement_Base +{ +protected: + /** Constructor sets specified name and description. If the constant of a + text is BBTEXT_NONE, the derived class has to set the text via + implSetName() (in Ctor) or later via + setAccessibleName() and setAccessibleDescription() (these methods + notify the listeners about the change). + + @param rxParent XAccessible interface of the parent object. + @param rBrowseBox The BrowseBox control. + @param _xFocusWindow The window that gets all the focus events. + @param eObjType Object type + */ + BrowseBoxAccessibleElement( + const css::uno::Reference< css::accessibility::XAccessible >& rxParent, + ::svt::IAccessibleTableProvider& rBrowseBox, + const css::uno::Reference< css::awt::XWindow >& _xFocusWindow, + ::svt::AccessibleBrowseBoxObjType eObjType ); + + /** Constructor sets specified name and description. + + @param rxParent XAccessible interface of the parent object. + @param rBrowseBox The BrowseBox control. + @param _xFocusWindow The window that gets all the focus events. + @param eObjType Object type + @param rName The name of this object. + @param rDescription The description text of this object. + */ + BrowseBoxAccessibleElement( + const css::uno::Reference< css::accessibility::XAccessible >& rxParent, + ::svt::IAccessibleTableProvider& rBrowseBox, + const css::uno::Reference< css::awt::XWindow >& _xFocusWindow, + ::svt::AccessibleBrowseBoxObjType eObjType, + const OUString& rName, + const OUString& rDescription ); + +public: + // noncopyable + BrowseBoxAccessibleElement(const BrowseBoxAccessibleElement&) = delete; + const BrowseBoxAccessibleElement& operator=(const BrowseBoxAccessibleElement&) = delete; + // XInterface + DECLARE_XINTERFACE( ) + // XTypeProvider + DECLARE_XTYPEPROVIDER( ) + +protected: + virtual ~BrowseBoxAccessibleElement(); + +protected: + // XAccessible + + /** @return The XAccessibleContext interface of this object. */ + virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() + throw ( css::uno::RuntimeException, std::exception ) override; +}; + + +// a helper class for protecting methods which need to lock the solar mutex in addition to the own mutex + +typedef ::osl::MutexGuard OslMutexGuard; + +class SolarMethodGuard : public SolarMutexGuard, public OslMutexGuard +{ +public: + inline SolarMethodGuard( AccessibleBrowseBoxBase& _rOwner, bool _bEnsureAlive = true ) + :SolarMutexGuard( ) + ,OslMutexGuard( _rOwner.getMutex( AccessibleBrowseBoxBase::AccessControl() ) ) + { + if ( _bEnsureAlive ) + _rOwner.ensureIsAlive( AccessibleBrowseBoxBase::AccessControl() ); + } +}; + +// inlines + +inline ::svt::AccessibleBrowseBoxObjType AccessibleBrowseBoxBase::getType() const +{ + return meObjType; +} + +inline ::osl::Mutex& AccessibleBrowseBoxBase::getOslMutex() +{ + return m_aMutex; +} + +inline void AccessibleBrowseBoxBase::implSetName( + const OUString& rName ) +{ + maName = rName; +} + +} // namespace accessibility + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/extended/AccessibleBrowseBoxCheckBoxCell.hxx b/accessibility/inc/extended/AccessibleBrowseBoxCheckBoxCell.hxx new file mode 100644 index 000000000000..2533ded30224 --- /dev/null +++ b/accessibility/inc/extended/AccessibleBrowseBoxCheckBoxCell.hxx @@ -0,0 +1,84 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEBROWSEBOXCHECKBOXCELL_HXX +#define INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEBROWSEBOXCHECKBOXCELL_HXX + +#include +#include +#include +#include "extended/accessiblebrowseboxcell.hxx" +#include +#include + +namespace accessibility +{ + + typedef ::cppu::ImplHelper2 < css::accessibility::XAccessible, + css::accessibility::XAccessibleValue + > AccessibleCheckBoxCell_BASE; + + class AccessibleCheckBoxCell : public AccessibleBrowseBoxCell + ,public AccessibleCheckBoxCell_BASE + { + private: + TriState m_eState; + bool m_bIsTriState; + + protected: + virtual ~AccessibleCheckBoxCell() {} + + virtual ::utl::AccessibleStateSetHelper* implCreateStateSetHelper() override; + + public: + AccessibleCheckBoxCell(const css::uno::Reference< css::accessibility::XAccessible >& _rxParent, + ::svt::IAccessibleTableProvider& _rBrowseBox, + const css::uno::Reference< css::awt::XWindow >& _xFocusWindow, + sal_Int32 _nRowPos, + sal_uInt16 _nColPos, + const TriState& _eState, + bool _bIsTriState); + + // XInterface + DECLARE_XINTERFACE( ) + // XTypeProvider + DECLARE_XTYPEPROVIDER( ) + + // XAccessible + virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getImplementationName() throw ( css::uno::RuntimeException, std::exception ) override; + virtual ::sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (css::uno::RuntimeException, std::exception) override; + + + // XAccessibleValue + virtual css::uno::Any SAL_CALL getCurrentValue( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL setCurrentValue( const css::uno::Any& aNumber ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Any SAL_CALL getMaximumValue( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Any SAL_CALL getMinimumValue( ) throw (css::uno::RuntimeException, std::exception) override; + + // internal + void SetChecked( bool _bChecked ); + }; +} +#endif // INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEBROWSEBOXCHECKBOXCELL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/extended/AccessibleBrowseBoxHeaderBar.hxx b/accessibility/inc/extended/AccessibleBrowseBoxHeaderBar.hxx new file mode 100644 index 000000000000..d9ea755396f8 --- /dev/null +++ b/accessibility/inc/extended/AccessibleBrowseBoxHeaderBar.hxx @@ -0,0 +1,258 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +#ifndef INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEBROWSEBOXHEADERBAR_HXX +#define INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEBROWSEBOXHEADERBAR_HXX + +#include "extended/AccessibleBrowseBoxTableBase.hxx" +#include +#include + + +namespace accessibility { + + +typedef ::cppu::ImplHelper1< css::accessibility::XAccessibleSelection > + AccessibleBrowseBoxHeaderBarImplHelper; + +/** This class represents the accessible object of a header bar of a BrowseBox + control (row or column header bar). This object supports the + XAccessibleSelection interface. Selecting a child of this object selects + complete rows or columns of the data table. */ +class AccessibleBrowseBoxHeaderBar : + public AccessibleBrowseBoxTableBase, + public AccessibleBrowseBoxHeaderBarImplHelper +{ +public: + /** @param rxParent Parent that holds the browsebox headerbar control + @param rBrowseBox The BrowseBox control. + @param eObjType One of the two allowed types BBTYPE_ROWHEADERBAR or + BBTYPE_COLUMNHEADERBAR. */ + AccessibleBrowseBoxHeaderBar( + const css::uno::Reference< css::accessibility::XAccessible >& rxParent, + ::svt::IAccessibleTableProvider& rBrowseBox, + ::svt::AccessibleBrowseBoxObjType eObjType ); + +protected: + virtual ~AccessibleBrowseBoxHeaderBar(); + +public: + // XAccessibleContext + + /** @return + The XAccessible interface of the specified child. + */ + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL + getAccessibleChild( sal_Int32 nChildIndex ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** @return The index of this object among the parent's children. */ + virtual sal_Int32 SAL_CALL + getAccessibleIndexInParent() + throw ( css::uno::RuntimeException, std::exception ) override; + + // XAccessibleComponent + + /** @return The accessible child rendered under the given point. */ + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL + getAccessibleAtPoint( const css::awt::Point& rPoint ) + throw ( css::uno::RuntimeException, std::exception ) override; + + /** Grabs the focus to (the current cell of) the data table. */ + virtual void SAL_CALL grabFocus() + throw ( css::uno::RuntimeException, std::exception ) override; + + // XAccessibleTable + + /** @return The description text of the specified row. */ + virtual OUString SAL_CALL + getAccessibleRowDescription( sal_Int32 nRow ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** @return The description text of the specified column. */ + virtual OUString SAL_CALL getAccessibleColumnDescription( sal_Int32 nColumn ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** @return The XAccessibleTable interface of the row header bar. */ + virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL + getAccessibleRowHeaders() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return The XAccessibleTable interface of the column header bar. */ + virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL + getAccessibleColumnHeaders() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return An index list of completely selected rows. */ + virtual css::uno::Sequence< sal_Int32 > SAL_CALL + getSelectedAccessibleRows() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return An index list of completely selected columns. */ + virtual css::uno::Sequence< sal_Int32 > SAL_CALL + getSelectedAccessibleColumns() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return TRUE, if the specified row is completely selected. */ + virtual sal_Bool SAL_CALL isAccessibleRowSelected( sal_Int32 nRow ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** @return TRUE, if the specified column is completely selected. */ + virtual sal_Bool SAL_CALL isAccessibleColumnSelected( sal_Int32 nColumn ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** @return The XAccessible interface of the cell object at the specified + cell position. */ + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL + getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** @return TRUE, if the specified cell is selected. */ + virtual sal_Bool SAL_CALL isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + // XAccessibleSelection + + /** Selects the specified child (row or column of the table). */ + virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** @return TRUE, if the specified child (row/column) is selected. */ + virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** Clears the complete selection. */ + virtual void SAL_CALL clearAccessibleSelection() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** Selects all children or first, if multiselection is not supported. */ + virtual void SAL_CALL selectAllAccessibleChildren() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return The number of selected rows/columns. */ + virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return The specified selected row/column. */ + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL + getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** Removes the specified row/column from the selection. */ + virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + // XInterface + + /** Queries for a new interface. */ + css::uno::Any SAL_CALL queryInterface( const css::uno::Type& rType ) + throw ( css::uno::RuntimeException, std::exception ) override; + + /** Aquires the object (calls acquire() on base class). */ + virtual void SAL_CALL acquire() throw () override; + + /** Releases the object (calls release() on base class). */ + virtual void SAL_CALL release() throw () override; + + // XServiceInfo + + /** @return The name of this class. */ + virtual OUString SAL_CALL getImplementationName() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return An unique implementation ID. */ + virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() + throw ( css::uno::RuntimeException, std::exception ) override; + +protected: + // internal virtual methods + + /** @attention This method requires locked mutex's and a living object. + @return The bounding box (VCL rect.) relative to the parent window. */ + virtual Rectangle implGetBoundingBox() override; + /** @attention This method requires locked mutex's and a living object. + @return The bounding box (VCL rect.) in screen coordinates. */ + virtual Rectangle implGetBoundingBoxOnScreen() override; + + /** @attention This method requires locked mutex's and a living object. + @return The count of used rows. */ + virtual sal_Int32 implGetRowCount() const override; + /** @attention This method requires locked mutex's and a living object. + @return The count of used columns. */ + virtual sal_Int32 implGetColumnCount() const override; + + // internal helper methods + + /** @return TRUE, if the objects is a header bar for rows. */ + inline bool isRowBar() const; + /** @return TRUE, if the objects is a header bar for columns. */ + inline bool isColumnBar() const; + + /** Returns the specified row or column. Uses one of the parameters, + depending on object type. + @attention This method requires locked mutex's and a living object. + @return The XAccessible interface of the specified column/row. */ + css::uno::Reference< css::accessibility::XAccessible > + implGetChild( sal_Int32 nRow, sal_uInt16 nColumnPos ); + + /** @attention This method requires locked mutex's and a living object. + @return The absolute child index from the index of selected children. + @throws IndexOutOfBoundsException + If the specified index is invalid. */ + sal_Int32 implGetChildIndexFromSelectedIndex( sal_Int32 nSelectedChildIndex ) + throw ( css::lang::IndexOutOfBoundsException ); + + /** @attention This method requires locked mutex's and a living object. + @throws IndexOutOfBoundsException + If the specified row/column index (depending on type) is invalid. */ + void ensureIsValidHeaderIndex( sal_Int32 nIndex ) + throw ( css::lang::IndexOutOfBoundsException ); +}; + +// inlines + +inline bool AccessibleBrowseBoxHeaderBar::isRowBar() const +{ + return getType() == ::svt::BBTYPE_ROWHEADERBAR; +} + +inline bool AccessibleBrowseBoxHeaderBar::isColumnBar() const +{ + return getType() == ::svt::BBTYPE_COLUMNHEADERBAR; +} + + +} // namespace accessibility + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/extended/AccessibleBrowseBoxHeaderCell.hxx b/accessibility/inc/extended/AccessibleBrowseBoxHeaderCell.hxx new file mode 100644 index 000000000000..b616529c0b65 --- /dev/null +++ b/accessibility/inc/extended/AccessibleBrowseBoxHeaderCell.hxx @@ -0,0 +1,74 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEBROWSEBOXHEADERCELL_HXX +#define INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEBROWSEBOXHEADERCELL_HXX + +#include "extended/AccessibleBrowseBoxBase.hxx" + +namespace accessibility +{ + class AccessibleBrowseBoxHeaderCell : public BrowseBoxAccessibleElement + { + sal_Int32 m_nColumnRowId; + public: + AccessibleBrowseBoxHeaderCell(sal_Int32 _nColumnRowId, + const css::uno::Reference< css::accessibility::XAccessible >& rxParent, + ::svt::IAccessibleTableProvider& _rBrowseBox, + const css::uno::Reference< css::awt::XWindow >& _xFocusWindow, + ::svt::AccessibleBrowseBoxObjType _eObjType); + /** @return The count of visible children. */ + virtual sal_Int32 SAL_CALL getAccessibleChildCount() throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return The XAccessible interface of the specified child. */ + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL + getAccessibleChild( sal_Int32 nChildIndex ) throw ( css::lang::IndexOutOfBoundsException,css::uno::RuntimeException, std::exception ) override; + + /** @return The index of this object among the parent's children. */ + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() throw ( css::uno::RuntimeException, std::exception ) override; + + /** Grabs the focus to the BrowseBox. */ + virtual void SAL_CALL grabFocus() throw ( css::uno::RuntimeException, std::exception ) override; + + inline bool isRowBarCell() const + { + return getType() == ::svt::BBTYPE_ROWHEADERCELL; + } + + /** @return + The name of this class. + */ + virtual OUString SAL_CALL getImplementationName() throw ( css::uno::RuntimeException, std::exception ) override; + + /** Creates a new AccessibleStateSetHelper and fills it with states of the + current object. + @return + A filled AccessibleStateSetHelper. + */ + ::utl::AccessibleStateSetHelper* implCreateStateSetHelper() override; + + protected: + virtual Rectangle implGetBoundingBox() override; + + virtual Rectangle implGetBoundingBoxOnScreen() override; + }; +} + +#endif // INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEBROWSEBOXHEADERCELL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/extended/AccessibleBrowseBoxTable.hxx b/accessibility/inc/extended/AccessibleBrowseBoxTable.hxx new file mode 100644 index 000000000000..5cbe7df5e703 --- /dev/null +++ b/accessibility/inc/extended/AccessibleBrowseBoxTable.hxx @@ -0,0 +1,152 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +#ifndef INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEBROWSEBOXTABLE_HXX +#define INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEBROWSEBOXTABLE_HXX + +#include "extended/AccessibleBrowseBoxTableBase.hxx" + + +namespace accessibility { + +/** This class represents the accessible object of the data table of a + BrowseBox control. */ +class AccessibleBrowseBoxTable : public AccessibleBrowseBoxTableBase +{ + friend class AccessibleBrowseBox; // to create header bars + +public: + AccessibleBrowseBoxTable( + const css::uno::Reference< css::accessibility::XAccessible >& rxParent, + ::svt::IAccessibleTableProvider& rBrowseBox ); + +protected: + virtual ~AccessibleBrowseBoxTable(); + +public: + // XAccessibleContext + + /** @return The XAccessible interface of the specified child. */ + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL + getAccessibleChild( sal_Int32 nChildIndex ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** @return The index of this object among the parent's children. */ + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() + throw ( css::uno::RuntimeException, std::exception ) override; + + // XAccessibleComponent + + /** @return The accessible child rendered under the given point. */ + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL + getAccessibleAtPoint( const css::awt::Point& rPoint ) + throw ( css::uno::RuntimeException, std::exception ) override; + + /** Grabs the focus to (the current cell of) the data table. */ + virtual void SAL_CALL grabFocus() + throw ( css::uno::RuntimeException, std::exception ) override; + + // XAccessibleTable + + /** @return The description text of the specified row. */ + virtual OUString SAL_CALL getAccessibleRowDescription( sal_Int32 nRow ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** @return The description text of the specified column. */ + virtual OUString SAL_CALL getAccessibleColumnDescription( sal_Int32 nColumn ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** @return The XAccessibleTable interface of the row header bar. */ + virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL + getAccessibleRowHeaders() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return The XAccessibleTable interface of the column header bar. */ + virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL + getAccessibleColumnHeaders() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return An index list of completely selected rows. */ + virtual css::uno::Sequence< sal_Int32 > SAL_CALL + getSelectedAccessibleRows() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return An index list of completely selected columns. */ + virtual css::uno::Sequence< sal_Int32 > SAL_CALL + getSelectedAccessibleColumns() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return TRUE, if the specified row is completely selected. */ + virtual sal_Bool SAL_CALL isAccessibleRowSelected( sal_Int32 nRow ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** @return TRUE, if the specified column is completely selected. */ + virtual sal_Bool SAL_CALL isAccessibleColumnSelected( sal_Int32 nColumn ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** @return The XAccessible interface of the cell object at the specified + cell position. */ + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL + getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** @return TRUE, if the specified cell is selected. */ + virtual sal_Bool SAL_CALL isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + // XServiceInfo + + /** @return The name of this class. */ + virtual OUString SAL_CALL getImplementationName() + throw ( css::uno::RuntimeException, std::exception ) override; + +protected: + // internal virtual methods + + /** @attention This method requires locked mutex's and a living object. + @return The bounding box (VCL rect.) relative to the parent window. */ + virtual Rectangle implGetBoundingBox() override; + /** @attention This method requires locked mutex's and a living object. + @return The bounding box (VCL rect.) in screen coordinates. */ + virtual Rectangle implGetBoundingBoxOnScreen() override; + + // internal helper methods + + /** @attention This method requires a locked mutex. + @return The XAccessibleTable interface of the specified header bar. */ + css::uno::Reference< css::accessibility::XAccessibleTable > + implGetHeaderBar( sal_Int32 nChildIndex ) + throw ( css::uno::RuntimeException ); +}; + + +} // namespace accessibility + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/extended/AccessibleBrowseBoxTableBase.hxx b/accessibility/inc/extended/AccessibleBrowseBoxTableBase.hxx new file mode 100644 index 000000000000..9ea46eb27fa8 --- /dev/null +++ b/accessibility/inc/extended/AccessibleBrowseBoxTableBase.hxx @@ -0,0 +1,267 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +#ifndef INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEBROWSEBOXTABLEBASE_HXX +#define INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEBROWSEBOXTABLEBASE_HXX + +#include "extended/AccessibleBrowseBoxBase.hxx" +#include +#include + + +namespace accessibility { + +typedef ::cppu::ImplHelper1< css::accessibility::XAccessibleTable > + AccessibleBrowseBoxTableImplHelper; + +/** The BrowseBox accessible table objects inherit from this base class. It + implements basic functionality for the XAccessibleTable interface. + BrowseBox table objects are: the data table, the column header bar and the + row header bar. */ +class AccessibleBrowseBoxTableBase : + public BrowseBoxAccessibleElement, + public AccessibleBrowseBoxTableImplHelper +{ +public: + /** Constructor sets specified name and description. If the constant of a + text is BBTEXT_NONE, the derived class has to set the text via + implSetName() and implSetDescription() (in Ctor) or later via + setAccessibleName() and setAccessibleDescription() (these methods + notify the listeners about the change). + @param rxParent XAccessible interface of the parent object. + @param rBrowseBox The BrowseBox control. + @param eObjType Type of BrowseBox object. */ + AccessibleBrowseBoxTableBase( + const css::uno::Reference< css::accessibility::XAccessible >& rxParent, + ::svt::IAccessibleTableProvider& rBrowseBox, + ::svt::AccessibleBrowseBoxObjType eObjType ); + +protected: + virtual ~AccessibleBrowseBoxTableBase(); + +public: + // XAccessibleContext + + /** @return The count of visible children. */ + virtual sal_Int32 SAL_CALL getAccessibleChildCount() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return The role of this object (a table). */ + virtual sal_Int16 SAL_CALL getAccessibleRole() + throw ( css::uno::RuntimeException, std::exception ) override; + + /* Derived classes have to implement: + - getAccessibleChild, + - getAccessibleIndexInParent. */ + + // XAccessibleComponent + + /* Derived classes have to implement: + - getAccessibleAt, + - grabFocus. */ + + // XAccessibleTable + + /** @return The number of used rows in the table (0 = empty table). */ + virtual sal_Int32 SAL_CALL getAccessibleRowCount() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return The number of used columns in the table (0 = empty table). */ + virtual sal_Int32 SAL_CALL getAccessibleColumnCount() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return The row extent of the specified cell (always 1). */ + virtual sal_Int32 SAL_CALL + getAccessibleRowExtentAt( sal_Int32 nRow, sal_Int32 nColumn ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** @return The column extent of the specified cell (always 1). */ + virtual sal_Int32 SAL_CALL + getAccessibleColumnExtentAt( sal_Int32 nRow, sal_Int32 nColumn ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** @return The caption cell of the table (not supported). */ + virtual css::uno::Reference< + css::accessibility::XAccessible > SAL_CALL + getAccessibleCaption() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return The summary object of the table (not supported). */ + virtual css::uno::Reference< + css::accessibility::XAccessible > SAL_CALL + getAccessibleSummary() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return The child index of the specified cell. */ + virtual sal_Int32 SAL_CALL getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** @return The row index of the specified child cell. */ + virtual sal_Int32 SAL_CALL getAccessibleRow( sal_Int32 nChildIndex ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** @return The column index of the specified child cell. */ + virtual sal_Int32 SAL_CALL getAccessibleColumn( sal_Int32 nChildIndex ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /* Derived classes have to implement: + - getAccessibleRowDescription, + - getAccessibleColumnDescription, + - getAccessibleRowHeaders, + - getAccessibleColumnHeaders, + - getSelectedAccessibleRows, + - getSelectedAccessibleColumns, + - isAccessibleRowSelected, + - isAccessibleColumnSelected, + - getAccessibleCellAt, + - isAccessibleSelected. */ + + // XInterface + + /** Queries for a new interface. */ + css::uno::Any SAL_CALL queryInterface( const css::uno::Type& rType ) + throw ( css::uno::RuntimeException, std::exception ) override; + + /** Aquires the object (calls acquire() on base class). */ + virtual void SAL_CALL acquire() throw () override; + + /** Releases the object (calls release() on base class). */ + virtual void SAL_CALL release() throw () override; + + // XTypeProvider + + /** @return A sequence of possible types (received from base classes). */ + virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return An unique implementation ID. */ + virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() + throw ( css::uno::RuntimeException, std::exception ) override; + + // XServiceInfo + + /* Derived classes have to implement: + - getImplementationName */ + +protected: + // internal virtual methods + + /** @attention This method requires locked mutex's and a living object. + @return The count of data rows without header bar. */ + virtual sal_Int32 implGetRowCount() const; + /** @attention This method requires locked mutex's and a living object. + @return The count of data columns without "handle column". */ + virtual sal_Int32 implGetColumnCount() const; + + // internal helper methods + + /** @return TRUE, if first BrowseBox column is the "handle column". */ + bool implHasHandleColumn() const; + + /** @attention This method requires locked mutex's and a living object. + @param nColumn + the position of the column in the Accessible world + @return + the position of the column in VCL the Accessible world + */ + sal_uInt16 implToVCLColumnPos( sal_Int32 nColumn ) const; + + /** @attention This method requires locked mutex's and a living object. + @return The number of cells of the table. */ + sal_Int32 implGetChildCount() const; + + /** @attention This method requires locked mutex's and a living object. + @return The row index of the specified cell index. */ + sal_Int32 implGetRow( sal_Int32 nChildIndex ) const; + /** @attention This method requires locked mutex's and a living object. + @return The column index of the specified cell index. */ + sal_Int32 implGetColumn( sal_Int32 nChildIndex ) const; + /** @attention This method requires locked mutex's and a living object. + @return The child index of the specified cell address. */ + sal_Int32 implGetChildIndex( sal_Int32 nRow, sal_Int32 nColumn ) const; + + /** @attention This method requires locked mutex's and a living object. + @return TRUE, if the specified row is selected. */ + bool implIsRowSelected( sal_Int32 nRow ) const; + /** @attention This method requires locked mutex's and a living object. + @return TRUE, if the specified column is selected. */ + bool implIsColumnSelected( sal_Int32 nColumn ) const; + + /** Selects/deselects a row (tries to expand selection). + @attention This method requires locked mutex's and a living object. + @param nRow Row to select + @param bSelect TRUE = select, FALSE = deselect */ + void implSelectRow( sal_Int32 nRow, bool bSelect ); + /** Selects/deselects a column (tries to expand selection). + @attention This method requires locked mutex's and a living object. + @param nColumnPos column number to select + @param bSelect TRUE = select, FALSE = deselect */ + void implSelectColumn( sal_Int32 nColumnPos, bool bSelect ); + + /** @attention This method requires locked mutex's and a living object. + @return The count of selected rows. */ + sal_Int32 implGetSelectedRowCount() const; + /** @attention This method requires locked mutex's and a living object. + @return The count of selected columns. */ + sal_Int32 implGetSelectedColumnCount() const; + + /** Fills a sequence with sorted indexes of completely selected rows. + @attention This method requires locked mutex's and a living object. + @param rSeq Out-parameter that takes the sorted row index list. */ + void implGetSelectedRows( css::uno::Sequence< sal_Int32 >& rSeq ); + /** Fills a sequence with sorted indexes of completely selected columns. + @attention This method requires locked mutex's and a living object. + @param rSeq Out-parameter that takes the sorted column index list. */ + void implGetSelectedColumns( css::uno::Sequence< sal_Int32 >& rSeq ); + + /** @attention This method requires locked mutex's and a living object. + @throws IndexOutOfBoundsException + If the specified row index is invalid. */ + void ensureIsValidRow( sal_Int32 nRow ) + throw ( css::lang::IndexOutOfBoundsException ); + /** @attention This method requires locked mutex's and a living object. + @throws IndexOutOfBoundsException + If the specified column index is invalid. */ + void ensureIsValidColumn( sal_Int32 nColumn ) + throw ( css::lang::IndexOutOfBoundsException ); + /** @attention This method requires locked mutex's and a living object. + @throws IndexOutOfBoundsException + If the specified cell address is invalid. */ + void ensureIsValidAddress( sal_Int32 nRow, sal_Int32 nColumn ) + throw ( css::lang::IndexOutOfBoundsException ); + /** @attention This method requires locked mutex's and a living object. + @throws IndexOutOfBoundsException + If the specified child index is invalid. */ + void ensureIsValidIndex( sal_Int32 nChildIndex ) + throw ( css::lang::IndexOutOfBoundsException ); +}; + + +} // namespace accessibility + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/extended/AccessibleBrowseBoxTableCell.hxx b/accessibility/inc/extended/AccessibleBrowseBoxTableCell.hxx new file mode 100644 index 000000000000..0fb9388ed61c --- /dev/null +++ b/accessibility/inc/extended/AccessibleBrowseBoxTableCell.hxx @@ -0,0 +1,133 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEBROWSEBOXTABLECELL_HXX +#define INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEBROWSEBOXTABLECELL_HXX + +#include "extended/accessiblebrowseboxcell.hxx" +#include +#include + +namespace accessibility +{ + typedef ::cppu::ImplHelper2 < css::accessibility::XAccessibleText + , css::accessibility::XAccessible + > AccessibleTextHelper_BASE; + + // implementation of a table cell of BrowseBox + class AccessibleBrowseBoxTableCell :public AccessibleBrowseBoxCell + ,public AccessibleTextHelper_BASE + ,public ::comphelper::OCommonAccessibleText + { + private: + sal_Int32 m_nOffset; + + protected: + // OCommonAccessibleText + virtual OUString implGetText() override; + virtual css::lang::Locale implGetLocale() override; + virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override; + + public: + AccessibleBrowseBoxTableCell( const css::uno::Reference< css::accessibility::XAccessible >& _rxParent, + ::svt::IAccessibleTableProvider& _rBrowseBox, + const css::uno::Reference< css::awt::XWindow >& _xFocusWindow, + sal_Int32 _nRowId, + sal_uInt16 _nColId, + sal_Int32 _nOffset ); + + void nameChanged( const OUString& rNewName, const OUString& rOldName ); + + // XInterface ------------------------------------------------------------- + + /** Queries for a new interface. */ + css::uno::Any SAL_CALL queryInterface( const css::uno::Type& rType ) + throw ( css::uno::RuntimeException, std::exception ) override; + + /** Aquires the object (calls acquire() on base class). */ + virtual void SAL_CALL acquire() throw () override; + + /** Releases the object (calls release() on base class). */ + virtual void SAL_CALL release() throw () override; + + // XEventListener + using AccessibleBrowseBoxBase::disposing; + virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) + throw(css::uno::RuntimeException, std::exception) override; + + /** @return The index of this object among the parent's children. */ + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return + The name of this class. + */ + virtual OUString SAL_CALL getImplementationName() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return + The count of visible children. + */ + virtual sal_Int32 SAL_CALL getAccessibleChildCount() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return + The XAccessible interface of the specified child. + */ + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL + getAccessibleChild( sal_Int32 nChildIndex ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** Creates a new AccessibleStateSetHelper and fills it with states of the + current object. + @return + A filled AccessibleStateSetHelper. + */ + ::utl::AccessibleStateSetHelper* implCreateStateSetHelper() override; + + // XAccessible ------------------------------------------------------------ + + /** @return The XAccessibleContext interface of this object. */ + virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL + getAccessibleContext() + throw ( css::uno::RuntimeException, std::exception ) override; + + // XAccessibleText + virtual sal_Int32 SAL_CALL getCaretPosition() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getCharacterCount() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getSelectedText() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getSelectionStart() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getSelectionEnd() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getText() throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; + virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; + virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + }; +} +#endif // INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEBROWSEBOXTABLECELL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/extended/AccessibleGridControl.hxx b/accessibility/inc/extended/AccessibleGridControl.hxx new file mode 100644 index 000000000000..a2f19e5de343 --- /dev/null +++ b/accessibility/inc/extended/AccessibleGridControl.hxx @@ -0,0 +1,239 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEGRIDCONTROL_HXX +#define INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEGRIDCONTROL_HXX + +#include +#include +#include +#include +#include +#include + +namespace accessibility { + + class AccessibleGridControl_Impl; + + +/** This class represents the complete accessible Grid Control object. */ +class AccessibleGridControl : public AccessibleGridControlBase +{ + friend class AccessibleGridControlAccess; + +protected: + AccessibleGridControl( + const css::uno::Reference< css::accessibility::XAccessible >& _rxParent, + const css::uno::Reference< css::accessibility::XAccessible >& _rxCreator, + ::svt::table::IAccessibleTable& _rTable + ); + + virtual ~AccessibleGridControl(); + + /** Cleans up members. */ + using AccessibleGridControlBase::disposing; + virtual void SAL_CALL disposing() override; + +protected: + // XAccessibleContext ----------------------------------------------------- + + /** @return The count of visible children. */ + virtual sal_Int32 SAL_CALL getAccessibleChildCount() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return The XAccessible interface of the specified child. */ + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL + getAccessibleChild( sal_Int32 nChildIndex ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** @return The role of this object (a table). */ + virtual sal_Int16 SAL_CALL getAccessibleRole() + throw ( css::uno::RuntimeException, std::exception ) override; + + // XAccessibleComponent --------------------------------------------------- + + /** @return + The accessible child rendered under the given point. + */ + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL + getAccessibleAtPoint( const css::awt::Point& rPoint ) + throw ( css::uno::RuntimeException, std::exception ) override; + + /** Grabs the focus to the Grid Control. */ + virtual void SAL_CALL grabFocus() + throw ( css::uno::RuntimeException, std::exception ) override; + + // XServiceInfo ----------------------------------------------------------- + + /** @return + The name of this class. + */ + virtual OUString SAL_CALL getImplementationName() + throw ( css::uno::RuntimeException, std::exception ) override; + +public: + // helper functions + + /** commitCellEvent commit the event at all listeners of the table + @param nEventId + the event id + @param rNewValue + the new value + @param rOldValue + the old value + */ + void commitCellEvent(sal_Int16 nEventId, const css::uno::Any& rNewValue, + const css::uno::Any& rOldValue); + + /** commitTableEvent commit the event at all listeners of the table + @param nEventId + the event id + @param rNewValue + the new value + @param rOldValue + the old value + */ + void commitTableEvent(sal_Int16 nEventId, const css::uno::Any& rNewValue, + const css::uno::Any& rOldValue); + +protected: + // internal virtual methods ----------------------------------------------- + + /** @attention This method requires locked mutex's and a living object. + @return The bounding box (VCL rect.) relative to the parent window. */ + virtual Rectangle implGetBoundingBox() override; + /** @attention This method requires locked mutex's and a living object. + @return The bounding box (VCL rect.) in screen coordinates. */ + virtual Rectangle implGetBoundingBoxOnScreen() override; + + // internal helper methods ------------------------------------------------ + + /** This method creates (once) and returns the accessible data table child. + @attention This method requires locked mutex's and a living object. + @return The XAccessible interface of the data table. */ + css::uno::Reference< css::accessibility::XAccessible > implGetTable(); + + /** This method creates (once) and returns the specified header bar. + @attention This method requires locked mutex's and a living object. + @return The XAccessible interface of the header bar. */ + css::uno::Reference< css::accessibility::XAccessible > + implGetHeaderBar( ::svt::table::AccessibleTableControlObjType eObjType ); + + /** This method returns one of the children that are always present: + Data table, row and column header bar or corner control. + @attention This method requires locked mutex's and a living object. + @return The XAccessible interface of the specified child. */ + css::uno::Reference< css::accessibility::XAccessible > + implGetFixedChild( sal_Int32 nChildIndex ); + + /** This method creates and returns an accessible table. + @return An AccessibleGridControlTable. */ + AccessibleGridControlTable* createAccessibleTable(); + +private: + // members ---------------------------------------------------------------- + std::unique_ptr< AccessibleGridControl_Impl > m_xImpl; +}; + + +/** the XAccessible which creates/returns an AccessibleGridControl + +

The instance holds its XAccessibleContext with a hard reference, while + the context holds this instance weak.

+*/ + +class AccessibleGridControlAccess : + public ::cppu::WeakImplHelper< css::accessibility::XAccessible > + ,public ::svt::table::IAccessibleTableControl +{ +private: + css::uno::Reference< css::accessibility::XAccessible > + m_xParent; + ::svt::table::IAccessibleTable * m_pTable; + + css::uno::Reference< css::accessibility::XAccessibleContext > + m_xContext; + AccessibleGridControl* m_pContext; + // note that this pointer is valid as long as m_xContext is valid! + +public: + AccessibleGridControlAccess( + const css::uno::Reference< css::accessibility::XAccessible >& _rxParent, + ::svt::table::IAccessibleTable& _rTable + ); + + /// checks whether the accessible context is still alive + bool isContextAlive() const; + + /// returns the AccessibleContext belonging to this Accessible + inline AccessibleGridControl* getContext() { return m_pContext; } + +protected: + virtual ~AccessibleGridControlAccess(); + + // XAccessible + virtual css::uno::Reference< css::accessibility::XAccessibleContext > + SAL_CALL getAccessibleContext() throw ( css::uno::RuntimeException, std::exception ) override; + + // IAccessibleTable + virtual css::uno::Reference< css::accessibility::XAccessible > + getMyself() override + { + return this; + } + void DisposeAccessImpl() override; + virtual bool isAlive() const override + { + return isContextAlive(); + } + virtual void commitCellEvent( sal_Int16 nEventId, + const css::uno::Any& rNewValue, const css::uno::Any& rOldValue ) override + { + AccessibleGridControl* pContext( getContext() ); + if ( pContext ) + pContext->commitCellEvent( nEventId, rNewValue, rOldValue ); + } + virtual void commitTableEvent( sal_Int16 nEventId, + const css::uno::Any& rNewValue, const css::uno::Any& rOldValue ) override + { + AccessibleGridControl* pContext( getContext() ); + if ( pContext ) + pContext->commitTableEvent( nEventId, rNewValue, rOldValue ); + } + virtual void commitEvent( sal_Int16 nEventId, + const css::uno::Any& rNewValue, const css::uno::Any& rOldValue ) override + { + AccessibleGridControl* pContext( getContext() ); + if ( pContext ) + pContext->commitEvent( nEventId, rNewValue, rOldValue ); + } + +private: + AccessibleGridControlAccess( const AccessibleGridControlAccess& ) = delete; + AccessibleGridControlAccess& operator=( const AccessibleGridControlAccess& ) = delete; +}; + + +} // namespace accessibility + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/extended/AccessibleGridControlBase.hxx b/accessibility/inc/extended/AccessibleGridControlBase.hxx new file mode 100644 index 000000000000..978baf95675a --- /dev/null +++ b/accessibility/inc/extended/AccessibleGridControlBase.hxx @@ -0,0 +1,356 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +#ifndef INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEGRIDCONTROLBASE_HXX +#define INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEGRIDCONTROLBASE_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace vcl { class Window; } + +namespace utl { + class AccessibleStateSetHelper; +} + + +namespace accessibility { + +typedef ::cppu::WeakAggComponentImplHelper4< + css::accessibility::XAccessibleContext, + css::accessibility::XAccessibleComponent, + css::accessibility::XAccessibleEventBroadcaster, + css::lang::XServiceInfo > + AccessibleGridControlImplHelper; + +/** The GridControl accessible objects inherit from this base class. It + implements basic functionality for various Accessibility interfaces and + the event broadcaster and contains the osl::Mutex. */ +class AccessibleGridControlBase : + public ::comphelper::OBaseMutex, + public AccessibleGridControlImplHelper +{ +public: + /** Constructor sets specified name and description. + @param rxParent XAccessible interface of the parent object. + @param rTable The Table control. + @param eObjType Type of accessible table control. */ + AccessibleGridControlBase( + const css::uno::Reference< css::accessibility::XAccessible >& rxParent, + ::svt::table::IAccessibleTable& rTable, + ::svt::table::AccessibleTableControlObjType eObjType ); + +protected: + virtual ~AccessibleGridControlBase(); + + /** Commits DeFunc event to listeners and cleans up members. */ + virtual void SAL_CALL disposing() override; + +public: + // XAccessibleContext + + /** @return A reference to the parent accessible object. */ + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL + getAccessibleParent() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return The index of this object among the parent's children. */ + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return + The description of this object. + */ + virtual OUString SAL_CALL getAccessibleDescription() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return + The name of this object. + */ + virtual OUString SAL_CALL getAccessibleName() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return + The relation set (the GridControl does not have one). + */ + virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL + getAccessibleRelationSet() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return The set of current states. */ + virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL + getAccessibleStateSet() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return The parent's locale. */ + virtual css::lang::Locale SAL_CALL getLocale() + throw ( css::accessibility::IllegalAccessibleComponentStateException, + css::uno::RuntimeException, std::exception ) override; + + /** @return + The role of this object. Panel, ROWHEADER, COLUMNHEADER, TABLE, TABLE_CELL are supported. + */ + virtual sal_Int16 SAL_CALL getAccessibleRole() + throw ( css::uno::RuntimeException, std::exception ) override; + + /* Derived classes have to implement: + - getAccessibleChildCount, + - getAccessibleChild, + - getAccessibleRole. + Derived classes may overwrite getAccessibleIndexInParent to increase + performance. */ + + // XAccessibleComponent + + /** @return + TRUE, if the point lies within the bounding box of this object. */ + virtual sal_Bool SAL_CALL containsPoint( const css::awt::Point& rPoint ) + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return The bounding box of this object. */ + virtual css::awt::Rectangle SAL_CALL getBounds() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return + The upper left corner of the bounding box relative to the parent. */ + virtual css::awt::Point SAL_CALL getLocation() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return + The upper left corner of the bounding box in screen coordinates. */ + virtual css::awt::Point SAL_CALL getLocationOnScreen() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return The size of the bounding box. */ + virtual css::awt::Size SAL_CALL getSize() + throw ( css::uno::RuntimeException, std::exception ) override; + + virtual sal_Int32 SAL_CALL getForeground( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getBackground( ) throw (css::uno::RuntimeException, std::exception) override; + + + /* Derived classes have to implement: + - getAccessibleAt, + - grabFocus. */ + + /** @return + The accessible child rendered under the given point. + */ + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL + getAccessibleAtPoint( const css::awt::Point& rPoint ) + throw ( css::uno::RuntimeException, std::exception ) override; + + // XAccessibleEventBroadcaster + + /** Adds a new event listener */ + virtual void SAL_CALL addAccessibleEventListener( + const css::uno::Reference< css::accessibility::XAccessibleEventListener>& rxListener ) + throw ( css::uno::RuntimeException, std::exception ) override; + + /** Removes an event listener. */ + virtual void SAL_CALL removeAccessibleEventListener( + const css::uno::Reference< css::accessibility::XAccessibleEventListener>& rxListener ) + throw ( css::uno::RuntimeException, std::exception ) override; + + // XTypeProvider + + /** @return An unique implementation ID. */ + virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() + throw ( css::uno::RuntimeException, std::exception ) override; + + // XServiceInfo + + /** @return Whether the specified service is supported by this class. */ + virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return A list of all supported services. */ + virtual css::uno::Sequence< OUString > SAL_CALL + getSupportedServiceNames() + throw ( css::uno::RuntimeException, std::exception ) override; + + /* Derived classes have to implement: + - getImplementationName. */ + + // helper methods + + /** @return The GridControl object type. */ + inline ::svt::table::AccessibleTableControlObjType getType() const; + + /** Commits an event to all listeners. */ + void commitEvent( + sal_Int16 nEventId, + const css::uno::Any& rNewValue, + const css::uno::Any& rOldValue ); + /** @return TRUE, if the object is not disposed or disposing. */ + bool isAlive() const; + +protected: + // internal virtual methods + + /** Determines whether the Grid control is really showing inside of + its parent accessible window. Derived classes may implement different + behaviour. + @attention This method requires locked mutex's and a living object. + @return TRUE, if the object is really showing. */ + bool implIsShowing(); + + /** Derived classes return the bounding box relative to the parent window. + @attention This method requires locked mutex's and a living object. + @return The bounding box (VCL rect.) relative to the parent window. */ + virtual Rectangle implGetBoundingBox() = 0; + ///** Derived classes return the bounding box in screen coordinates. + // @attention This method requires locked mutex's and a living object. + // @return The bounding box (VCL rect.) in screen coordinates. */ + virtual Rectangle implGetBoundingBoxOnScreen() = 0; + + /** Creates a new AccessibleStateSetHelper and fills it with states of the + current object. This method calls FillStateSet at the GridControl which + fills it with more states depending on the object type. Derived classes + may overwrite this method and add more states. + @attention This method requires locked mutex's. + @return A filled AccessibleStateSetHelper. */ + virtual ::utl::AccessibleStateSetHelper* implCreateStateSetHelper(); + + // internal helper methods + + /** @throws DisposedException If the object is not alive. */ + void ensureIsAlive() const + throw ( css::lang::DisposedException ); + + /** Changes the name of the object (flat assignment, no notify). + @attention This method requires a locked mutex. */ + inline void implSetName( const OUString& rName ); + + /** Locks all mutex's and calculates the bounding box relative to the + parent window. + @return The bounding box (VCL rect.) relative to the parent object. */ + Rectangle getBoundingBox() + throw ( css::lang::DisposedException ); + ///** Locks all mutex's and calculates the bounding box in screen + // coordinates. + // @return The bounding box (VCL rect.) in screen coordinates. */ + Rectangle getBoundingBoxOnScreen() + throw ( css::lang::DisposedException ); + + ::comphelper::AccessibleEventNotifier::TClientId getClientId() const { return m_aClientId; } + void setClientId(::comphelper::AccessibleEventNotifier::TClientId _aNewClientId) { m_aClientId = _aNewClientId; } + +protected: + // members + + /** The parent accessible object. */ + css::uno::Reference< css::accessibility::XAccessible > m_xParent; + /** The SVT Table control. */ + ::svt::table::IAccessibleTable& m_aTable; + /** The type of this object (for names, descriptions, state sets, ...). */ + ::svt::table::AccessibleTableControlObjType m_eObjType; + +private: + /** Localized name. */ + OUString m_aName; + /** Localized description text. */ + OUString m_aDescription; + ::comphelper::AccessibleEventNotifier::TClientId m_aClientId; +}; + + +// a version of AccessibleGridControlBase which implements not only the XAccessibleContext, +// but also the XAccessible + +typedef ::cppu::ImplHelper1 < css::accessibility::XAccessible + > GridControlAccessibleElement_Base; + +class GridControlAccessibleElement + :public AccessibleGridControlBase + ,public GridControlAccessibleElement_Base +{ +protected: + /** Constructor sets specified name and description. + + @param rxParent XAccessible interface of the parent object. + @param rTable The Table control. + @param eObjType Type of table control + */ + GridControlAccessibleElement( + const css::uno::Reference< css::accessibility::XAccessible >& rxParent, + ::svt::table::IAccessibleTable& rTable, + ::svt::table::AccessibleTableControlObjType eObjType ); + +public: + // XInterface + DECLARE_XINTERFACE( ) + // XTypeProvider + DECLARE_XTYPEPROVIDER( ) + +protected: + virtual ~GridControlAccessibleElement(); + +protected: + // XAccessible + + /** @return The XAccessibleContext interface of this object. */ + virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL + getAccessibleContext() + throw ( css::uno::RuntimeException, std::exception ) override; + +private: + GridControlAccessibleElement( const GridControlAccessibleElement& ) = delete; + GridControlAccessibleElement& operator=( const GridControlAccessibleElement& ) = delete; +}; + +// inlines + +inline ::svt::table::AccessibleTableControlObjType AccessibleGridControlBase::getType() const +{ + return m_eObjType; +} + +inline void AccessibleGridControlBase::implSetName( + const OUString& rName ) +{ + m_aName = rName; +} + + +} // namespace accessibility + + +#endif // ACCESSIBILITY_EXT_ACCESSIBILEGRIDCONTROLBASE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/extended/AccessibleGridControlHeader.hxx b/accessibility/inc/extended/AccessibleGridControlHeader.hxx new file mode 100644 index 000000000000..882f87a95401 --- /dev/null +++ b/accessibility/inc/extended/AccessibleGridControlHeader.hxx @@ -0,0 +1,181 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +#ifndef INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEGRIDCONTROLHEADER_HXX +#define INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEGRIDCONTROLHEADER_HXX + +#include +#include + +namespace accessibility { + +/** This class represents the accessible object of a header bar of a Grid Control + (row or column header bar). This object supports the + XAccessibleSelection interface. Selecting a child of this object selects + complete rows or columns of the data table. */ +class AccessibleGridControlHeader : public AccessibleGridControlTableBase +{ +public: + /** @param rxParent accessible parent control + @param rTable accessible table + @param eObjType One of the two allowed types TCTYPE_ROWHEADERBAR or + TCTYPE_COLUMNHEADERBAR. */ + AccessibleGridControlHeader( + const css::uno::Reference< + css::accessibility::XAccessible >& rxParent, + ::svt::table::IAccessibleTable& rTable, + ::svt::table::AccessibleTableControlObjType eObjType ); + +protected: + virtual ~AccessibleGridControlHeader(); + +public: + // XAccessibleContext + + /** @return + The XAccessible interface of the specified child. + */ + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL + getAccessibleChild( sal_Int32 nChildIndex ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** @return The index of this object among the parent's children. */ + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() + throw ( css::uno::RuntimeException, std::exception ) override; + + // XAccessibleComponent + + /** @return The accessible child rendered under the given point. */ + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL + getAccessibleAtPoint( const css::awt::Point& rPoint ) + throw ( css::uno::RuntimeException, std::exception ) override; + + /** Grabs the focus to (the current cell of) the data table. */ + virtual void SAL_CALL grabFocus() + throw ( css::uno::RuntimeException, std::exception ) override; + + // XAccessibleTable + + /** @return The description text of the specified row. */ + virtual OUString SAL_CALL + getAccessibleRowDescription( sal_Int32 nRow ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** @return The description text of the specified column. */ + virtual OUString SAL_CALL + getAccessibleColumnDescription( sal_Int32 nColumn ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** @return The XAccessibleTable interface of the row header bar. */ + virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL + getAccessibleRowHeaders() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return The XAccessibleTable interface of the column header bar. */ + virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL + getAccessibleColumnHeaders() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return An index list of completely selected rows. */ + virtual css::uno::Sequence< sal_Int32 > SAL_CALL + getSelectedAccessibleRows() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return An index list of completely selected columns. */ + virtual css::uno::Sequence< sal_Int32 > SAL_CALL + getSelectedAccessibleColumns() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return TRUE, if the specified row is completely selected. */ + virtual sal_Bool SAL_CALL isAccessibleRowSelected( sal_Int32 nRow ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** @return TRUE, if the specified column is completely selected. */ + virtual sal_Bool SAL_CALL isAccessibleColumnSelected( sal_Int32 nColumn ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** @return The XAccessible interface of the cell object at the specified + cell position. */ + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL + getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** @return TRUE, if the specified cell is selected. */ + virtual sal_Bool SAL_CALL isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + // XServiceInfo + + /** @return The name of this class. */ + virtual OUString SAL_CALL getImplementationName() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return An unique implementation ID. */ + virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() + throw ( css::uno::RuntimeException, std::exception ) override; + +protected: + /** Returns the specified row or column. Uses one of the parameters, + depending on object type. + @attention This method requires locked mutex's and a living object. + @return The XAccessible interface of the specified column/row. */ + css::uno::Reference< css::accessibility::XAccessible > + implGetChild( sal_Int32 nRow, sal_uInt32 nColumnPos ); + /** @attention This method requires locked mutex's and a living object. + @return The bounding box (VCL rect.) relative to the parent window. */ + virtual Rectangle implGetBoundingBox() override; + /** @attention This method requires locked mutex's and a living object. + @return The bounding box (VCL rect.) in screen coordinates. */ + virtual Rectangle implGetBoundingBoxOnScreen() override; + + // internal helper methods + + /** @return TRUE, if the objects is a header bar for rows. */ + inline bool isRowBar() const; + /** @return TRUE, if the objects is a header bar for columns. */ + inline bool isColumnBar() const; +}; + +// inlines + +inline bool AccessibleGridControlHeader::isRowBar() const +{ + return getType() == ::svt::table::TCTYPE_ROWHEADERBAR; +} + +inline bool AccessibleGridControlHeader::isColumnBar() const +{ + return getType() == ::svt::table::TCTYPE_COLUMNHEADERBAR; +} + + +} // namespace accessibility + + +#endif // ACCESSIBILITY_EXT_ACCESSIBILEGRIDCONTROLHEADER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/extended/AccessibleGridControlHeaderCell.hxx b/accessibility/inc/extended/AccessibleGridControlHeaderCell.hxx new file mode 100644 index 000000000000..82272a000ad4 --- /dev/null +++ b/accessibility/inc/extended/AccessibleGridControlHeaderCell.hxx @@ -0,0 +1,86 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEGRIDCONTROLHEADERCELL_HXX +#define INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEGRIDCONTROLHEADERCELL_HXX + +#include "extended/AccessibleGridControlTableCell.hxx" + +namespace accessibility +{ + class AccessibleGridControlHeaderCell : public AccessibleGridControlCell, public css::accessibility::XAccessible + { + sal_Int32 m_nColumnRowId; + public: + AccessibleGridControlHeaderCell(sal_Int32 _nColumnRowId, + const css::uno::Reference< css::accessibility::XAccessible >& rxParent, + ::svt::table::IAccessibleTable& _rTable, + ::svt::table::AccessibleTableControlObjType _eObjType); + /** @return The count of visible children. */ + virtual sal_Int32 SAL_CALL getAccessibleChildCount() throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return The XAccessible interface of the specified child. */ + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL + getAccessibleChild( sal_Int32 nChildIndex ) throw ( css::lang::IndexOutOfBoundsException,css::uno::RuntimeException, std::exception ) override; + + /** @return The index of this object among the parent's children. */ + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() throw ( css::uno::RuntimeException, std::exception ) override; + + /** Grabs the focus to the GridControl. */ + virtual void SAL_CALL grabFocus() throw ( css::uno::RuntimeException, std::exception ) override; + + // XInterface + + /** Queries for a new interface. */ + css::uno::Any SAL_CALL queryInterface( const css::uno::Type& rType ) + throw ( css::uno::RuntimeException, std::exception ) override; + + /** Aquires the object (calls acquire() on base class). */ + virtual void SAL_CALL acquire() throw () override; + + /** Releases the object (calls release() on base class). */ + virtual void SAL_CALL release() throw () override; + // XAccessible + + /** @return The XAccessibleContext interface of this object. */ + virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL + getAccessibleContext() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return + The name of this class. + */ + virtual OUString SAL_CALL getImplementationName() throw ( css::uno::RuntimeException, std::exception ) override; + + /** Creates a new AccessibleStateSetHelper and fills it with states of the + current object. + @return + A filled AccessibleStateSetHelper. + */ + ::utl::AccessibleStateSetHelper* implCreateStateSetHelper() override; + + protected: + virtual Rectangle implGetBoundingBox() override; + + virtual Rectangle implGetBoundingBoxOnScreen() override; + }; +} + +#endif // INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEGRIDCONTROLHEADERCELL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/extended/AccessibleGridControlTable.hxx b/accessibility/inc/extended/AccessibleGridControlTable.hxx new file mode 100644 index 000000000000..e784544764ad --- /dev/null +++ b/accessibility/inc/extended/AccessibleGridControlTable.hxx @@ -0,0 +1,210 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +#ifndef INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEGRIDCONTROLTABLE_HXX +#define INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEGRIDCONTROLTABLE_HXX + +#include "extended/AccessibleGridControlTableBase.hxx" +#include +#include +#include + + +namespace accessibility { + + +typedef ::cppu::ImplHelper1 < css::accessibility::XAccessibleSelection > + AccessibleGridControlTableSelectionImplHelper; +/** This class represents the accessible object of the data table of a + Grid control. */ +class AccessibleGridControlTable : public AccessibleGridControlTableBase, + public AccessibleGridControlTableSelectionImplHelper +{ +public: + AccessibleGridControlTable( + const css::uno::Reference< css::accessibility::XAccessible >& rxParent, + ::svt::table::IAccessibleTable& rTable, + ::svt::table::AccessibleTableControlObjType _eType); + +protected: + virtual ~AccessibleGridControlTable(); +private: + std::vector< AccessibleGridControlTableCell* > m_pCellVector; + std::vector< css::uno::Reference< css::accessibility::XAccessible> > m_pAccessCellVector; +public: + // XAccessibleContext + + /** @return The XAccessible interface of the specified child. */ + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL + getAccessibleChild( sal_Int32 nChildIndex ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** @return The index of this object among the parent's children. */ + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() + throw ( css::uno::RuntimeException, std::exception ) override; + + // XAccessibleComponent + + /** @return The accessible child rendered under the given point. */ + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL + getAccessibleAtPoint( const css::awt::Point& rPoint ) + throw ( css::uno::RuntimeException, std::exception ) override; + + /** Grabs the focus to (the current cell of) the data table. */ + virtual void SAL_CALL grabFocus() + throw ( css::uno::RuntimeException, std::exception ) override; + + // XAccessibleTable + + /** @return The description text of the specified row. */ + virtual OUString SAL_CALL getAccessibleRowDescription( sal_Int32 nRow ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** @return The description text of the specified column. */ + virtual OUString SAL_CALL getAccessibleColumnDescription( sal_Int32 nColumn ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** @return The XAccessibleTable interface of the row header bar. */ + virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL + getAccessibleRowHeaders() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return The XAccessibleTable interface of the column header bar. */ + virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL + getAccessibleColumnHeaders() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return An index list of completely selected rows. */ + virtual css::uno::Sequence< sal_Int32 > SAL_CALL + getSelectedAccessibleRows() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return An index list of completely selected columns. */ + virtual css::uno::Sequence< sal_Int32 > SAL_CALL + getSelectedAccessibleColumns() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return TRUE, if the specified row is completely selected. */ + virtual sal_Bool SAL_CALL isAccessibleRowSelected( sal_Int32 nRow ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** @return TRUE, if the specified column is completely selected. */ + virtual sal_Bool SAL_CALL isAccessibleColumnSelected( sal_Int32 nColumn ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** @return The XAccessible interface of the cell object at the specified + cell position. */ + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL + getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** @return TRUE, if the specified cell is selected. */ + virtual sal_Bool SAL_CALL isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + // XAccessibleSelection + + /** Selects the specified child (row or column of the table). */ + virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** @return TRUE, if the specified child (row/column) is selected. */ + virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** Clears the complete selection. */ + virtual void SAL_CALL clearAccessibleSelection() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** Selects all children or first, if multiselection is not supported. */ + virtual void SAL_CALL selectAllAccessibleChildren() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return The number of selected rows/columns. */ + virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return The specified selected row/column. */ + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL + getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** Removes the specified row/column from the selection. */ + virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + // XInterface + + /** Queries for a new interface. */ + css::uno::Any SAL_CALL queryInterface( const css::uno::Type& rType ) + throw ( css::uno::RuntimeException, std::exception ) override; + + /** Aquires the object (calls acquire() on base class). */ + virtual void SAL_CALL acquire() throw () override; + + /** Releases the object (calls release() on base class). */ + virtual void SAL_CALL release() throw () override; + // XServiceInfo + + /** @return The name of this class. */ + virtual OUString SAL_CALL getImplementationName() + throw ( css::uno::RuntimeException, std::exception ) override; + + /**@return m_pCellVector*/ + std::vector< AccessibleGridControlTableCell* >& getCellVector() { return m_pCellVector;} + /**@return m_xAccessCellVector*/ + std::vector< css::uno::Reference< css::accessibility::XAccessible > >& getAccessibleCellVector() { return m_pAccessCellVector;} + +protected: + // internal virtual methods + + /** @attention This method requires locked mutex's and a living object. + @return The bounding box (VCL rect.) relative to the parent window. */ + virtual Rectangle implGetBoundingBox() override; + ///** @attention This method requires locked mutex's and a living object. + // @return The bounding box (VCL rect.) in screen coordinates. */ + virtual Rectangle implGetBoundingBoxOnScreen() override; + + + //// internal helper methods + ///** @attention This method requires a locked mutex. + // @return The XAccessibleTable interface of the specified header bar. */ + css::uno::Reference< css::accessibility::XAccessibleTable > + implGetHeaderBar( sal_Int32 nChildIndex ) + throw ( css::uno::RuntimeException ); +}; + + +} // namespace accessibility + + +#endif // ACCESSIBILITY_EXT_ACCESSIBILEGRIDCONTROLTABLE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/extended/AccessibleGridControlTableBase.hxx b/accessibility/inc/extended/AccessibleGridControlTableBase.hxx new file mode 100644 index 000000000000..e818cdd9db5a --- /dev/null +++ b/accessibility/inc/extended/AccessibleGridControlTableBase.hxx @@ -0,0 +1,207 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +#ifndef INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEGRIDCONTROLTABLEBASE_HXX +#define INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEGRIDCONTROLTABLEBASE_HXX + +#include "extended/AccessibleGridControlBase.hxx" +#include +#include + + +namespace accessibility { + +typedef ::cppu::ImplHelper1 < css::accessibility::XAccessibleTable > + AccessibleGridControlTableImplHelper; + +/** The Grid Control accessible table objects inherit from this base class. It + implements basic functionality for the XAccessibleTable interface. + Grid COntrol table objects are: the data table, the column header bar and the + row header bar. */ +class AccessibleGridControlTableBase : + public GridControlAccessibleElement, + public AccessibleGridControlTableImplHelper +{ +public: + /** Constructor sets specified name and description. + @param rxParent XAccessible interface of the parent object. + @param rTable The Table control. + @param eObjType Type of table control object */ + AccessibleGridControlTableBase( + const css::uno::Reference< css::accessibility::XAccessible >& rxParent, + ::svt::table::IAccessibleTable& rTable, + ::svt::table::AccessibleTableControlObjType eObjType ); + +protected: + virtual ~AccessibleGridControlTableBase(); + +public: + // XAccessibleContext + + /** @return The count of visible children. */ + virtual sal_Int32 SAL_CALL getAccessibleChildCount() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return The role of this object (a table). */ + virtual sal_Int16 SAL_CALL getAccessibleRole() + throw ( css::uno::RuntimeException, std::exception ) override; + + /* Derived classes have to implement: + - getAccessibleChild, + - getAccessibleIndexInParent. */ + + // XAccessibleComponent + + /* Derived classes have to implement: + - getAccessibleAt, + - grabFocus. */ + + // XAccessibleTable + + /** @return The number of used rows in the table (0 = empty table). */ + virtual sal_Int32 SAL_CALL getAccessibleRowCount() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return The number of used columns in the table (0 = empty table). */ + virtual sal_Int32 SAL_CALL getAccessibleColumnCount() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return The row extent of the specified cell (always 1). */ + virtual sal_Int32 SAL_CALL + getAccessibleRowExtentAt( sal_Int32 nRow, sal_Int32 nColumn ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** @return The column extent of the specified cell (always 1). */ + virtual sal_Int32 SAL_CALL + getAccessibleColumnExtentAt( sal_Int32 nRow, sal_Int32 nColumn ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** @return The caption cell of the table (not supported). */ + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL + getAccessibleCaption() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return The summary object of the table (not supported). */ + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL + getAccessibleSummary() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return The child index of the specified cell. */ + virtual sal_Int32 SAL_CALL getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** @return The row index of the specified child cell. */ + virtual sal_Int32 SAL_CALL getAccessibleRow( sal_Int32 nChildIndex ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** @return The column index of the specified child cell. */ + virtual sal_Int32 SAL_CALL getAccessibleColumn( sal_Int32 nChildIndex ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /* Derived classes have to implement: + - getAccessibleRowDescription, + - getAccessibleColumnDescription, + - getAccessibleRowHeaders, + - getAccessibleColumnHeaders, + - getSelectedAccessibleRows, + - getSelectedAccessibleColumns, + - isAccessibleRowSelected, + - isAccessibleColumnSelected, + - getAccessibleCellAt, + - isAccessibleSelected. */ + + // XInterface + + /** Queries for a new interface. */ + css::uno::Any SAL_CALL queryInterface( const css::uno::Type& rType ) + throw ( css::uno::RuntimeException, std::exception ) override; + + /** Aquires the object (calls acquire() on base class). */ + virtual void SAL_CALL acquire() throw () override; + + /** Releases the object (calls release() on base class). */ + virtual void SAL_CALL release() throw () override; + + // XTypeProvider + + /** @return A sequence of possible types (received from base classes). */ + virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return An unique implementation ID. */ + virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() + throw ( css::uno::RuntimeException, std::exception ) override; + +protected: + // internal helper methods + + /** @attention This method requires locked mutex's and a living object. + @return The number of cells of the table. */ + sal_Int32 implGetChildCount() const; + + /** @attention This method requires locked mutex's and a living object. + @return The row index of the specified cell index. */ + sal_Int32 implGetRow( sal_Int32 nChildIndex ) const; + /** @attention This method requires locked mutex's and a living object. + @return The column index of the specified cell index. */ + sal_Int32 implGetColumn( sal_Int32 nChildIndex ) const; + /** @attention This method requires locked mutex's and a living object. + @return The child index of the specified cell address. */ + sal_Int32 implGetChildIndex( sal_Int32 nRow, sal_Int32 nColumn ) const; + + /** Fills a sequence with sorted indexes of completely selected rows. + @attention This method requires locked mutex's and a living object. + @param rSeq Out-parameter that takes the sorted row index list. */ + void implGetSelectedRows( css::uno::Sequence< sal_Int32 >& rSeq ); + + /** @attention This method requires locked mutex's and a living object. + @throws IndexOutOfBoundsException + If the specified row index is invalid. */ + void ensureIsValidRow( sal_Int32 nRow ) + throw ( css::lang::IndexOutOfBoundsException ); + /** @attention This method requires locked mutex's and a living object. + @throws IndexOutOfBoundsException + If the specified column index is invalid. */ + void ensureIsValidColumn( sal_Int32 nColumn ) + throw ( css::lang::IndexOutOfBoundsException ); + /** @attention This method requires locked mutex's and a living object. + @throws IndexOutOfBoundsException + If the specified cell address is invalid. */ + void ensureIsValidAddress( sal_Int32 nRow, sal_Int32 nColumn ) + throw ( css::lang::IndexOutOfBoundsException ); + /** @attention This method requires locked mutex's and a living object. + @throws IndexOutOfBoundsException + If the specified child index is invalid. */ + void ensureIsValidIndex( sal_Int32 nChildIndex ) + throw ( css::lang::IndexOutOfBoundsException ); +}; + + +} // namespace accessibility + + +#endif // ACCESSIBILITY_EXT_ACCESSIBILEGRIDCONTROLTABLEBASE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/extended/AccessibleGridControlTableCell.hxx b/accessibility/inc/extended/AccessibleGridControlTableCell.hxx new file mode 100644 index 000000000000..489f695635f8 --- /dev/null +++ b/accessibility/inc/extended/AccessibleGridControlTableCell.hxx @@ -0,0 +1,154 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEGRIDCONTROLTABLECELL_HXX +#define INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEGRIDCONTROLTABLECELL_HXX + +#include +#include +#include "extended/AccessibleGridControlBase.hxx" +#include + +namespace accessibility +{ + class AccessibleGridControlCell : public AccessibleGridControlBase + { + private: + sal_Int32 m_nRowPos; // the row number of the table cell + sal_Int32 m_nColPos; // the column id of the table cell + + protected: + // attribute access + inline sal_Int32 getRowPos( ) const { return m_nRowPos; } + inline sal_Int32 getColumnPos( ) const { return m_nColPos; } + + // XAccessibleComponent + virtual void SAL_CALL grabFocus() throw ( css::uno::RuntimeException, std::exception ) override; + + protected: + AccessibleGridControlCell( + const css::uno::Reference< css::accessibility::XAccessible >& _rxParent, + ::svt::table::IAccessibleTable& _rTable, + sal_Int32 _nRowPos, + sal_uInt16 _nColPos, + ::svt::table::AccessibleTableControlObjType _eType + ); + + virtual ~AccessibleGridControlCell(); + + private: + AccessibleGridControlCell( const AccessibleGridControlCell& ) = delete; + AccessibleGridControlCell& operator=( const AccessibleGridControlCell& ) = delete; + }; + + typedef ::cppu::ImplHelper2 < css::accessibility::XAccessibleText + , css::accessibility::XAccessible + > AccessibleTextHelper_BASE; + // implementation of a table cell of GridControl + class AccessibleGridControlTableCell :public AccessibleGridControlCell + ,public AccessibleTextHelper_BASE + ,public ::comphelper::OCommonAccessibleText + { + protected: + // OCommonAccessibleText + virtual OUString implGetText() override; + virtual css::lang::Locale implGetLocale() override; + virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override; + virtual Rectangle implGetBoundingBox() override; + virtual Rectangle implGetBoundingBoxOnScreen() override; + + public: + AccessibleGridControlTableCell( const css::uno::Reference< css::accessibility::XAccessible >& _rxParent, + ::svt::table::IAccessibleTable& _rTable, + sal_Int32 _nRowId, + sal_uInt16 _nColId, + svt::table::AccessibleTableControlObjType eObjType); + + // XInterface ------------------------------------------------------------- + + /** Queries for a new interface. */ + css::uno::Any SAL_CALL queryInterface( const css::uno::Type& rType ) + throw ( css::uno::RuntimeException, std::exception ) override; + + /** Aquires the object (calls acquire() on base class). */ + virtual void SAL_CALL acquire() throw () override; + + /** Releases the object (calls release() on base class). */ + virtual void SAL_CALL release() throw () override; + + /** @return The index of this object among the parent's children. */ + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return + The name of this class. + */ + virtual OUString SAL_CALL getImplementationName() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return + The count of visible children. + */ + virtual sal_Int32 SAL_CALL getAccessibleChildCount() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return + The XAccessible interface of the specified child. + */ + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL + getAccessibleChild( sal_Int32 nChildIndex ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + /** Creates a new AccessibleStateSetHelper and fills it with states of the + current object. + @return + A filled AccessibleStateSetHelper. + */ + ::utl::AccessibleStateSetHelper* implCreateStateSetHelper() override; + + // XAccessible ------------------------------------------------------------ + + /** @return The XAccessibleContext interface of this object. */ + virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL + getAccessibleContext() + throw ( css::uno::RuntimeException, std::exception ) override; + + // XAccessibleText + virtual sal_Int32 SAL_CALL getCaretPosition() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getCharacterCount() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getSelectedText() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getSelectionStart() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getSelectionEnd() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getText() throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; + virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; + virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + }; +} +#endif // INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEGRIDCONTROLTABLECELL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/extended/accessiblebrowseboxcell.hxx b/accessibility/inc/extended/accessiblebrowseboxcell.hxx new file mode 100644 index 000000000000..e39739e10cc6 --- /dev/null +++ b/accessibility/inc/extended/accessiblebrowseboxcell.hxx @@ -0,0 +1,77 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEBROWSEBOXCELL_HXX +#define INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEBROWSEBOXCELL_HXX + +#include "extended/AccessibleBrowseBoxBase.hxx" +#include + + +namespace accessibility +{ + + + // = AccessibleBrowseBoxCell + + /** common accessibility-functionality for browse box elements which occupy a cell + */ + class AccessibleBrowseBoxCell : public AccessibleBrowseBoxBase + { + private: + sal_Int32 m_nRowPos; // the row number of the table cell + sal_uInt16 m_nColPos; // the column id of the table cell + + protected: + // attribute access + inline sal_Int32 getRowPos( ) const { return m_nRowPos; } + inline sal_Int32 getColumnPos( ) const { return m_nColPos; } + + protected: + // AccessibleBrowseBoxBase overridables + virtual Rectangle implGetBoundingBox() override; + virtual Rectangle implGetBoundingBoxOnScreen() override; + + // XAccessibleComponent + virtual void SAL_CALL grabFocus() throw ( css::uno::RuntimeException, std::exception ) override; + + protected: + AccessibleBrowseBoxCell( + const css::uno::Reference< css::accessibility::XAccessible >& _rxParent, + ::svt::IAccessibleTableProvider& _rBrowseBox, + const css::uno::Reference< css::awt::XWindow >& _xFocusWindow, + sal_Int32 _nRowPos, + sal_uInt16 _nColPos, + ::svt::AccessibleBrowseBoxObjType _eType = ::svt::BBTYPE_TABLECELL + ); + + virtual ~AccessibleBrowseBoxCell(); + + private: + AccessibleBrowseBoxCell( const AccessibleBrowseBoxCell& ) = delete; + AccessibleBrowseBoxCell& operator=( const AccessibleBrowseBoxCell& ) = delete; + }; + + +} // namespace accessibility + + +#endif // INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEBROWSEBOXCELL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/extended/accessibleeditbrowseboxcell.hxx b/accessibility/inc/extended/accessibleeditbrowseboxcell.hxx new file mode 100644 index 000000000000..24e98b720d6d --- /dev/null +++ b/accessibility/inc/extended/accessibleeditbrowseboxcell.hxx @@ -0,0 +1,142 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEEDITBROWSEBOXCELL_HXX +#define INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEEDITBROWSEBOXCELL_HXX + +#include "accessiblebrowseboxcell.hxx" +#include +#include +#include +#include +#include +#include +#include + +namespace accessibility +{ + + // = EditBrowseBoxTableCell + + class EditBrowseBoxTableCell :public AccessibleBrowseBoxCell + ,public ::comphelper::OAccessibleContextWrapperHelper + { + public: + EditBrowseBoxTableCell( + const css::uno::Reference< css::accessibility::XAccessible >& _rxParent, + const css::uno::Reference< css::accessibility::XAccessible >& _rxOwningAccessible, + const css::uno::Reference< css::accessibility::XAccessibleContext >& _xControlChild, + ::svt::IAccessibleTableProvider& _rBrowseBox, + const css::uno::Reference< css::awt::XWindow >& _xFocusWindow, + sal_Int32 _nRowPos, + sal_uInt16 _nColPos + ); + + protected: + virtual ~EditBrowseBoxTableCell(); + + protected: + // XAccessibleComponent + virtual sal_Int32 SAL_CALL getForeground( ) throw (css::uno::RuntimeException, std::exception) override ; + virtual sal_Int32 SAL_CALL getBackground( ) throw (css::uno::RuntimeException, std::exception) override ; + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() throw ( css::uno::RuntimeException, std::exception ) override; + + // XInterface + DECLARE_XINTERFACE( ) + // XTypeProvider + DECLARE_XTYPEPROVIDER( ) + + // XAccessibleContext + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleDescription( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleName( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (css::uno::RuntimeException, std::exception) override; + + sal_Int16 SAL_CALL getAccessibleRole() throw ( css::uno::RuntimeException, std::exception ) override; + + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + + virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) throw (css::uno::RuntimeException, std::exception) override; + protected: + // OComponentHelper + virtual void SAL_CALL disposing() override; + + // XComponent/OComponentProxyAggregationHelper (needs to be disambiguated) + virtual void SAL_CALL dispose() throw( css::uno::RuntimeException, std::exception ) override; + + // OAccessibleContextWrapperHelper(); + void notifyTranslatedEvent( const css::accessibility::AccessibleEventObject& _rEvent ) throw (css::uno::RuntimeException) override; + + private: + EditBrowseBoxTableCell( const EditBrowseBoxTableCell& ) = delete; + EditBrowseBoxTableCell& operator=( const EditBrowseBoxTableCell& ) = delete; + }; + + + // = EditBrowseBoxTableCell + + // XAccessible providing an EditBrowseBoxTableCell + class EditBrowseBoxTableCellAccess: + public comphelper::OBaseMutex, + public cppu::WeakComponentImplHelper + { + protected: + css::uno::WeakReference< css::accessibility::XAccessibleContext > + m_aContext; + css::uno::Reference< css::accessibility::XAccessible > + m_xParent; + css::uno::Reference< css::accessibility::XAccessible > + m_xControlAccessible; + css::uno::Reference< css::awt::XWindow > + m_xFocusWindow; + ::svt::IAccessibleTableProvider* m_pBrowseBox; + sal_Int32 m_nRowPos; + sal_uInt16 m_nColPos; + + public: + EditBrowseBoxTableCellAccess( + const css::uno::Reference< css::accessibility::XAccessible >& _rxParent, + const css::uno::Reference< css::accessibility::XAccessible >& _rxControlAccessible, + const css::uno::Reference< css::awt::XWindow >& _rxFocusWindow, + ::svt::IAccessibleTableProvider& _rBrowseBox, + sal_Int32 _nRowPos, + sal_uInt16 _nColPos + ); + + protected: + virtual ~EditBrowseBoxTableCellAccess(); + + // XAccessible + virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (css::uno::RuntimeException, std::exception) override; + + // XComponent/OComponentHelper + virtual void SAL_CALL disposing() override; + + private: + EditBrowseBoxTableCellAccess( const EditBrowseBoxTableCellAccess& ) = delete; + EditBrowseBoxTableCellAccess& operator=( const EditBrowseBoxTableCellAccess& ) = delete; + }; +} + +#endif // INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEEDITBROWSEBOXCELL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/extended/accessibleiconchoicectrl.hxx b/accessibility/inc/extended/accessibleiconchoicectrl.hxx new file mode 100644 index 000000000000..837ee7f7d033 --- /dev/null +++ b/accessibility/inc/extended/accessibleiconchoicectrl.hxx @@ -0,0 +1,110 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEICONCHOICECTRL_HXX +#define INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEICONCHOICECTRL_HXX + +#include +#include +#include +#include +#include + +// class AccessibleListBox ----------------------------------------------- + +class SvtIconChoiceCtrl; + +namespace accessibility +{ + typedef ::cppu::ImplHelper2< css::accessibility::XAccessible + , css::accessibility::XAccessibleSelection> AccessibleIconChoiceCtrl_BASE; + + /** the class OAccessibleListBoxEntry represents the base class for an accessible object of a listbox entry + */ + class AccessibleIconChoiceCtrl :public AccessibleIconChoiceCtrl_BASE + ,public VCLXAccessibleComponent + { + protected: + css::uno::Reference< css::accessibility::XAccessible > m_xParent; + + protected: + virtual ~AccessibleIconChoiceCtrl(); + + /** this function is called upon disposing the component */ + virtual void SAL_CALL disposing() override; + + virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; + virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) override; + + VclPtr< SvtIconChoiceCtrl > getCtrl(); + + public: + /** OAccessibleBase needs a valid view + @param _rIconCtrl + is the box for which we implement an accessible object + @param _xParent + is our parent accessible object + */ + AccessibleIconChoiceCtrl( SvtIconChoiceCtrl& _rIconCtrl, + const css::uno::Reference< css::accessibility::XAccessible >& _xParent ); + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XInterface + DECLARE_XINTERFACE() + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() throw(css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(css::uno::RuntimeException, std::exception) override; + + // XServiceInfo - static methods + static css::uno::Sequence< OUString > getSupportedServiceNames_Static() throw(css::uno::RuntimeException); + static OUString getImplementationName_Static() throw(css::uno::RuntimeException); + + // XAccessible + virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleDescription( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleName( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleSelection + void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + void SAL_CALL clearAccessibleSelection( ) throw (css::uno::RuntimeException, std::exception) override; + void SAL_CALL selectAllAccessibleChildren( ) throw (css::uno::RuntimeException, std::exception) override; + sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; + css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + }; + + +}// namespace accessibility + + +#endif // INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEICONCHOICECTRL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/extended/accessibleiconchoicectrlentry.hxx b/accessibility/inc/extended/accessibleiconchoicectrlentry.hxx new file mode 100644 index 000000000000..f1fea9fcae48 --- /dev/null +++ b/accessibility/inc/extended/accessibleiconchoicectrlentry.hxx @@ -0,0 +1,191 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEICONCHOICECTRLENTRY_HXX +#define INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEICONCHOICECTRLENTRY_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// forward + +class SvxIconChoiceCtrlEntry; +class SvtIconChoiceCtrl; + +namespace accessibility +{ + +// class AccessibleIconChoiceCtrlEntry + + typedef ::cppu::WeakAggComponentImplHelper8< css::accessibility::XAccessible + , css::accessibility::XAccessibleContext + , css::accessibility::XAccessibleComponent + , css::accessibility::XAccessibleEventBroadcaster + , css::accessibility::XAccessibleText + , css::accessibility::XAccessibleAction + , css::lang::XServiceInfo + , css::lang::XEventListener > AccessibleIconChoiceCtrlEntry_BASE; + + /** the class AccessibleListBoxEntry represents the class for an accessible object of a listbox entry */ + class AccessibleIconChoiceCtrlEntry : public ::comphelper::OBaseMutex, + public AccessibleIconChoiceCtrlEntry_BASE, + public ::comphelper::OCommonAccessibleText + { + private: + /** The treelistbox control */ + VclPtr m_pIconCtrl; + sal_Int32 m_nIndex; + + protected: + /// client id in the AccessibleEventNotifier queue + sal_uInt32 m_nClientId; + + css::uno::Reference< css::accessibility::XAccessible > m_xParent; + + private: + Rectangle GetBoundingBox_Impl() const; + Rectangle GetBoundingBoxOnScreen_Impl() const; + bool IsAlive_Impl() const; + bool IsShowing_Impl() const; + + Rectangle GetBoundingBox() + throw (css::lang::DisposedException, + css::uno::RuntimeException); + Rectangle GetBoundingBoxOnScreen() + throw (css::lang::DisposedException, + css::uno::RuntimeException); + void EnsureIsAlive() const throw ( css::lang::DisposedException ); + + protected: + virtual ~AccessibleIconChoiceCtrlEntry(); + /** this function is called upon disposing the component + */ + virtual void SAL_CALL disposing() override; + + // OCommonAccessibleText + virtual OUString implGetText() override; + virtual css::lang::Locale implGetLocale() override; + virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override; + + public: + /** Ctor() + @param _rIconCtrl + the icon control + @param _nPos + the entry number + @param _xParent + is our parent accessible object + */ + AccessibleIconChoiceCtrlEntry( SvtIconChoiceCtrl& _rIconCtrl, + sal_Int32 _nPos, + const css::uno::Reference< css::accessibility::XAccessible >& _xParent ); + + // XTypeProvider + virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (css::uno::RuntimeException, std::exception) override; + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() throw(css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(css::uno::RuntimeException, std::exception) override; + + // XServiceInfo - static methods + static css::uno::Sequence< OUString > getSupportedServiceNames_Static() throw(css::uno::RuntimeException); + static OUString getImplementationName_Static() throw(css::uno::RuntimeException); + + // XEventListener + virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) throw(css::uno::RuntimeException, std::exception) override; + + // XAccessible + virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleDescription( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleName( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::lang::Locale SAL_CALL getLocale( ) throw (css::accessibility::IllegalAccessibleComponentStateException, css::uno::RuntimeException, std::exception) override; + + // XAccessibleComponent + virtual sal_Bool SAL_CALL containsPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::awt::Rectangle SAL_CALL getBounds( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::awt::Point SAL_CALL getLocation( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::awt::Point SAL_CALL getLocationOnScreen( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::awt::Size SAL_CALL getSize( ) throw (css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL grabFocus( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getForeground( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getBackground( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleText + virtual sal_Int32 SAL_CALL getCaretPosition() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getCharacterCount() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getSelectedText() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getSelectionStart() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getSelectionEnd() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getText() throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; + virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; + virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + + // XAccessibleEventBroadcaster + virtual void SAL_CALL addAccessibleEventListener( const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener ) throw (css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL removeAccessibleEventListener( const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleAction + virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL doAccessibleAction( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleActionDescription( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + }; + + +}// namespace accessibility + + +#endif // INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLEICONCHOICECTRLENTRY_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/extended/accessiblelistbox.hxx b/accessibility/inc/extended/accessiblelistbox.hxx new file mode 100644 index 000000000000..fbdc250493f5 --- /dev/null +++ b/accessibility/inc/extended/accessiblelistbox.hxx @@ -0,0 +1,133 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLELISTBOX_HXX +#define INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLELISTBOX_HXX + +#include +#include +#include +#include +#include + +#include + +// class AccessibleListBox ----------------------------------------------- + +class SvTreeListBox; +class SvTreeListEntry; + +namespace accessibility +{ + class AccessibleListBoxEntry; + + /** the class OAccessibleListBoxEntry represents the base class for an accessible object of a listbox entry + */ + class AccessibleListBox: + public cppu::ImplHelper2< + css::accessibility::XAccessible, + css::accessibility::XAccessibleSelection>, + public VCLXAccessibleComponent + { + protected: + + css::uno::Reference< css::accessibility::XAccessible > m_xParent; + + protected: + virtual ~AccessibleListBox(); + + // OComponentHelper overridables + /** this function is called upon disposing the component */ + virtual void SAL_CALL disposing() override; + + // VCLXAccessibleComponent + virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; + virtual void ProcessWindowChildEvent( const VclWindowEvent& rVclWindowEvent ) override; + virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) override; + + VclPtr< SvTreeListBox > getListBox() const; + + void RemoveChildEntries(SvTreeListEntry*); + + sal_Int32 GetRoleType(); + + public: + /** OAccessibleBase needs a valid view + @param _rListBox + is the box for which we implement an accessible object + @param _xParent + is our parent accessible object + */ + AccessibleListBox( SvTreeListBox& _rListBox, + const css::uno::Reference< css::accessibility::XAccessible >& _xParent ); + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XInterface + DECLARE_XINTERFACE() + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() throw(css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(css::uno::RuntimeException, std::exception) override; + + // XServiceInfo - static methods + static css::uno::Sequence< OUString > getSupportedServiceNames_Static() throw(css::uno::RuntimeException); + static OUString getImplementationName_Static() throw(css::uno::RuntimeException); + + // XAccessible + virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleDescription( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleName( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleSelection + void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + void SAL_CALL clearAccessibleSelection( ) throw (css::uno::RuntimeException, std::exception) override; + void SAL_CALL selectAllAccessibleChildren( ) throw (css::uno::RuntimeException, std::exception) override; + sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; + css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + +private: + + typedef std::map< SvTreeListEntry*, css::uno::Reference< css::accessibility::XAccessible > > MAP_ENTRY; + MAP_ENTRY m_mapEntry; + + css::uno::Reference< css::accessibility::XAccessible > m_xFocusedChild; + + accessibility::AccessibleListBoxEntry* GetCurEventEntry( const VclWindowEvent& rVclWindowEvent ); + + }; + + +}// namespace accessibility + + +#endif // INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLELISTBOX_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/extended/accessiblelistboxentry.hxx b/accessibility/inc/extended/accessiblelistboxentry.hxx new file mode 100644 index 000000000000..bfcbbfc0df19 --- /dev/null +++ b/accessibility/inc/extended/accessiblelistboxentry.hxx @@ -0,0 +1,230 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLELISTBOXENTRY_HXX +#define INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLELISTBOXENTRY_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "extended/listboxaccessible.hxx" + +// forward --------------------------------------------------------------- + +namespace com { namespace sun { namespace star { namespace awt { + struct Point; + struct Rectangle; + struct Size; + class XFocusListener; +} } } } + +class SvTreeListBox; +class SvTreeListEntry; + + +namespace accessibility +{ + + +// class AccessibleListBoxEntry ------------------------------------------ + typedef ::cppu::WeakAggComponentImplHelper9< css::accessibility::XAccessible + , css::accessibility::XAccessibleContext + , css::accessibility::XAccessibleComponent + , css::accessibility::XAccessibleEventBroadcaster + , css::accessibility::XAccessibleAction + , css::accessibility::XAccessibleSelection + , css::accessibility::XAccessibleText + , css::accessibility::XAccessibleValue + , css::lang::XServiceInfo > AccessibleListBoxEntry_BASE; + + /** the class AccessibleListBoxEntry represents the class for an accessible object of a listbox entry */ + class AccessibleListBoxEntry:public ::comphelper::OBaseMutex + ,public AccessibleListBoxEntry_BASE + ,public ::comphelper::OCommonAccessibleText + ,public ListBoxAccessibleBase + { + friend class AccessibleListBox; + + private: + /** The treelistbox control */ + ::std::deque< sal_Int32 > m_aEntryPath; + SvTreeListEntry* m_pSvLBoxEntry; // Needed for a11y focused item... + + + protected: + /// client id in the AccessibleEventNotifier queue + sal_uInt32 m_nClientId; + + css::uno::WeakReference< css::accessibility::XAccessible > + m_aParent; + + private: + Rectangle GetBoundingBox_Impl() const; + Rectangle GetBoundingBoxOnScreen_Impl() const; + bool IsAlive_Impl() const; + bool IsShowing_Impl() const; + + Rectangle GetBoundingBox() + throw (css::lang::DisposedException, + css::uno::RuntimeException); + Rectangle GetBoundingBoxOnScreen() + throw (css::lang::DisposedException, + css::uno::RuntimeException); + void EnsureIsAlive() const throw ( css::lang::DisposedException ); + + void NotifyAccessibleEvent( sal_Int16 _nEventId, const css::uno::Any& _aOldValue, const css::uno::Any& _aNewValue ); + + protected: + virtual ~AccessibleListBoxEntry(); + + /** this function is called upon disposing the component + */ + virtual void SAL_CALL disposing() override; + + // ListBoxAccessible/XComponent + virtual void SAL_CALL dispose() throw ( css::uno::RuntimeException, std::exception ) override; + + // OCommonAccessibleText + virtual OUString implGetText() override; + virtual css::lang::Locale implGetLocale() override; + virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override; + + public: + /** Ctor() + @param _rListBox + the view control + @param _pEntry + the entry + @param _xParent + is our parent accessible object + */ + AccessibleListBoxEntry( SvTreeListBox& _rListBox, SvTreeListEntry* _pEntry, + const css::uno::Reference< css::accessibility::XAccessible >& _xParent ); + + SvTreeListEntry* GetSvLBoxEntry() const { return m_pSvLBoxEntry; } + + + protected: + // XTypeProvider + virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (css::uno::RuntimeException, std::exception) override; + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() throw(css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(css::uno::RuntimeException, std::exception) override; + + // XServiceInfo - static methods + static css::uno::Sequence< OUString > getSupportedServiceNames_Static() throw(css::uno::RuntimeException); + static OUString getImplementationName_Static() throw(css::uno::RuntimeException); + + // XAccessible + virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleDescription( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleName( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::lang::Locale SAL_CALL getLocale( ) throw (css::accessibility::IllegalAccessibleComponentStateException, css::uno::RuntimeException, std::exception) override; + + // XAccessibleComponent + virtual sal_Bool SAL_CALL containsPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::awt::Rectangle SAL_CALL getBounds( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::awt::Point SAL_CALL getLocation( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::awt::Point SAL_CALL getLocationOnScreen( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::awt::Size SAL_CALL getSize( ) throw (css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL grabFocus( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getForeground( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getBackground( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleText + virtual sal_Int32 SAL_CALL getCaretPosition() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getCharacterCount() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getSelectedText() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getSelectionStart() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getSelectionEnd() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getText() throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; + virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; + virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + + // XAccessibleEventBroadcaster + virtual void SAL_CALL addAccessibleEventListener( const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener ) throw (css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL removeAccessibleEventListener( const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleAction + virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL doAccessibleAction( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleActionDescription( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + + // XAccessibleSelection + void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + void SAL_CALL clearAccessibleSelection( ) throw (css::uno::RuntimeException, std::exception) override; + void SAL_CALL selectAllAccessibleChildren( ) throw (css::uno::RuntimeException, std::exception) override; + sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; + css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::uno::Any SAL_CALL getCurrentValue( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL setCurrentValue( const css::uno::Any& aNumber ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Any SAL_CALL getMaximumValue( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Any SAL_CALL getMinimumValue( ) throw (css::uno::RuntimeException, std::exception) override; + private: + css::uno::Reference< css::accessibility::XAccessible > implGetParentAccessible( ) const; + SvTreeListEntry* GetRealChild(sal_Int32 nIndex); + sal_Int32 GetRoleType(); + }; + + +}// namespace accessibility + + +#endif // INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLELISTBOXENTRY_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/extended/accessibletabbar.hxx b/accessibility/inc/extended/accessibletabbar.hxx new file mode 100644 index 000000000000..b248839f78e4 --- /dev/null +++ b/accessibility/inc/extended/accessibletabbar.hxx @@ -0,0 +1,112 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLETABBAR_HXX +#define INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLETABBAR_HXX + +#include +#include +#include +#include "extended/accessibletabbarbase.hxx" + +#include + +namespace utl { +class AccessibleStateSetHelper; +} + + +namespace accessibility +{ + + + // class AccessibleTabBar + + + typedef ::cppu::ImplHelper2< + css::accessibility::XAccessible, + css::lang::XServiceInfo > AccessibleTabBar_BASE; + + class AccessibleTabBar : public AccessibleTabBarBase, + public AccessibleTabBar_BASE + { + private: + typedef ::std::vector< css::uno::Reference< css::accessibility::XAccessible > > AccessibleChildren; + + AccessibleChildren m_aAccessibleChildren; + + protected: + virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; + void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ); + + // OCommonAccessibleComponent + virtual css::awt::Rectangle implGetBounds( ) throw (css::uno::RuntimeException) override; + + // XComponent + virtual void SAL_CALL disposing() override; + + public: + AccessibleTabBar( TabBar* pTabBar ); + virtual ~AccessibleTabBar(); + + // XInterface + DECLARE_XINTERFACE() + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; + + // XAccessible + virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleDescription( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleName( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::lang::Locale SAL_CALL getLocale( ) throw (css::accessibility::IllegalAccessibleComponentStateException, css::uno::RuntimeException, std::exception) override; + + // XAccessibleComponent + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL grabFocus( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getForeground( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getBackground( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleExtendedComponent + virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getTitledBorderText( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getToolTipText( ) throw (css::uno::RuntimeException, std::exception) override; + }; + + +} // namespace accessibility + + +#endif // INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLETABBAR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/extended/accessibletabbarbase.hxx b/accessibility/inc/extended/accessibletabbarbase.hxx new file mode 100644 index 000000000000..2c2d738cbc9b --- /dev/null +++ b/accessibility/inc/extended/accessibletabbarbase.hxx @@ -0,0 +1,65 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLETABBARBASE_HXX +#define INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLETABBARBASE_HXX + +#include +#include +#include + +class TabBar; +class VCLExternalSolarLock; +class VclSimpleEvent; +class VclWindowEvent; + + +namespace accessibility +{ + +class AccessibleTabBarBase : public comphelper::OAccessibleExtendedComponentHelper +{ +public: + explicit AccessibleTabBarBase( TabBar* pTabBar ); + virtual ~AccessibleTabBarBase(); + +protected: + DECL_LINK_TYPED( WindowEventListener, VclWindowEvent&, void ); + + virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); + + // XComponent + virtual void SAL_CALL disposing() override; + +private: + void SetTabBarPointer( TabBar* pTabBar ); + void ClearTabBarPointer(); + +protected: + VCLExternalSolarLock* m_pExternalLock; + VclPtr m_pTabBar; +}; + + +} // namespace accessibility + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/extended/accessibletabbarpage.hxx b/accessibility/inc/extended/accessibletabbarpage.hxx new file mode 100644 index 000000000000..795aebca002e --- /dev/null +++ b/accessibility/inc/extended/accessibletabbarpage.hxx @@ -0,0 +1,128 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLETABBARPAGE_HXX +#define INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLETABBARPAGE_HXX + +#include +#include +#include +#include "extended/accessibletabbarbase.hxx" + +#include + +namespace utl { +class AccessibleStateSetHelper; +} + + +namespace accessibility +{ + + + // class AccessibleTabBarPage + + + typedef ::cppu::ImplHelper2< + css::accessibility::XAccessible, + css::lang::XServiceInfo > AccessibleTabBarPage_BASE; + + class AccessibleTabBarPage : public AccessibleTabBarBase, + public AccessibleTabBarPage_BASE + { + friend class AccessibleTabBarPageList; + + private: + sal_uInt16 m_nPageId; + bool m_bEnabled; + bool m_bShowing; + bool m_bSelected; + OUString m_sPageText; + + css::uno::Reference< css::accessibility::XAccessible > m_xParent; + + protected: + bool IsEnabled(); + bool IsShowing(); + bool IsSelected(); + + void SetShowing( bool bShowing ); + void SetSelected( bool bSelected ); + void SetPageText( const OUString& sPageText ); + + sal_uInt16 GetPageId() const { return m_nPageId; } + + void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ); + + // OCommonAccessibleComponent + virtual css::awt::Rectangle implGetBounds( ) throw (css::uno::RuntimeException) override; + + // XComponent + virtual void SAL_CALL disposing() override; + + public: + AccessibleTabBarPage( TabBar* pTabBar, sal_uInt16 nPageId, + const css::uno::Reference< css::accessibility::XAccessible >& rxParent ); + virtual ~AccessibleTabBarPage(); + + // XInterface + DECLARE_XINTERFACE() + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; + + // XAccessible + virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleDescription( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleName( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::lang::Locale SAL_CALL getLocale( ) throw (css::accessibility::IllegalAccessibleComponentStateException, css::uno::RuntimeException, std::exception) override; + + // XAccessibleComponent + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL grabFocus( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getForeground( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getBackground( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleExtendedComponent + virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getTitledBorderText( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getToolTipText( ) throw (css::uno::RuntimeException, std::exception) override; + }; + + +} // namespace accessibility + + +#endif // INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLETABBARPAGE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/extended/accessibletabbarpagelist.hxx b/accessibility/inc/extended/accessibletabbarpagelist.hxx new file mode 100644 index 000000000000..e46d73f6bb0c --- /dev/null +++ b/accessibility/inc/extended/accessibletabbarpagelist.hxx @@ -0,0 +1,132 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLETABBARPAGELIST_HXX +#define INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLETABBARPAGELIST_HXX + +#include +#include +#include +#include +#include "extended/accessibletabbarbase.hxx" + +#include + +namespace utl { +class AccessibleStateSetHelper; +} + + +namespace accessibility +{ + + + // class AccessibleTabBarPageList + + + typedef ::cppu::ImplHelper3< + css::accessibility::XAccessible, + css::accessibility::XAccessibleSelection, + css::lang::XServiceInfo > AccessibleTabBarPageList_BASE; + + class AccessibleTabBarPageList : public AccessibleTabBarBase, + public AccessibleTabBarPageList_BASE + { + private: + typedef ::std::vector< css::uno::Reference< css::accessibility::XAccessible > > AccessibleChildren; + + AccessibleChildren m_aAccessibleChildren; + sal_Int32 m_nIndexInParent; + + protected: + void UpdateShowing( bool bShowing ); + void UpdateSelected( sal_Int32 i, bool bSelected ); + void UpdatePageText( sal_Int32 i ); + + void InsertChild( sal_Int32 i ); + void RemoveChild( sal_Int32 i ); + void MoveChild( sal_Int32 i, sal_Int32 j ); + + virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; + void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ); + + // OCommonAccessibleComponent + virtual css::awt::Rectangle implGetBounds( ) throw (css::uno::RuntimeException) override; + + // XComponent + virtual void SAL_CALL disposing() override; + + public: + AccessibleTabBarPageList( TabBar* pTabBar, sal_Int32 nIndexInParent ); + virtual ~AccessibleTabBarPageList(); + + // XInterface + DECLARE_XINTERFACE() + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; + + // XAccessible + virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleDescription( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleName( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::lang::Locale SAL_CALL getLocale( ) throw (css::accessibility::IllegalAccessibleComponentStateException, css::uno::RuntimeException, std::exception) override; + + // XAccessibleComponent + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL grabFocus( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getForeground( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getBackground( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleExtendedComponent + virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getTitledBorderText( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getToolTipText( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleSelection + virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL clearAccessibleSelection( ) throw (css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL selectAllAccessibleChildren( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + }; + + +} // namespace accessibility + + +#endif // INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLETABBARPAGELIST_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/extended/accessibletablistbox.hxx b/accessibility/inc/extended/accessibletablistbox.hxx new file mode 100644 index 000000000000..b17209933252 --- /dev/null +++ b/accessibility/inc/extended/accessibletablistbox.hxx @@ -0,0 +1,104 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLETABLISTBOX_HXX +#define INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLETABLISTBOX_HXX + +#include "AccessibleBrowseBox.hxx" +#include +#include +#include + +class SvHeaderTabListBox; + + +namespace accessibility { + +class AccessibleBrowseBoxTable; + +typedef ::cppu::ImplHelper1 < css::accessibility::XAccessible + > AccessibleTabListBox_Base; + +/** !!! */ +class AccessibleTabListBox + :public AccessibleBrowseBox + ,public AccessibleTabListBox_Base + ,public ::svt::IAccessibleTabListBox +{ +private: + VclPtr m_pTabListBox; + +public: + /** ctor() + @param rxParent XAccessible interface of the parent object. + @param rBox The HeaderTabListBox control. */ + AccessibleTabListBox( + const css::uno::Reference< css::accessibility::XAccessible >& rxParent, + SvHeaderTabListBox& rBox ); + +public: + // XInterface + DECLARE_XINTERFACE( ) + // XTypeProvider + DECLARE_XTYPEPROVIDER( ) + + // XAccessibleContext ----------------------------------------------------- + + /** @return The count of visible children. */ + virtual sal_Int32 SAL_CALL getAccessibleChildCount() + throw ( css::uno::RuntimeException, std::exception ) override; + + /** @return The XAccessible interface of the specified child. */ + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL + getAccessibleChild( sal_Int32 nChildIndex ) + throw ( css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception ) override; + + // XAccessibleContext + css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() throw ( css::uno::RuntimeException, std::exception ) override; + + // IAccessibleTabListBox + virtual css::uno::Reference< css::accessibility::XAccessible > + getMyself() override + { + return this; + } + + css::uno::Reference< css::accessibility::XAccessible > + getHeaderBar() override + { + return AccessibleBrowseBox::getHeaderBar( svt::BBTYPE_COLUMNHEADERBAR ); + } + +protected: + /** dtor() */ + virtual ~AccessibleTabListBox(); + + /** This method creates and returns an accessible table. + @return An AccessibleBrowseBoxTable. */ + virtual AccessibleBrowseBoxTable* createAccessibleTable() override; +}; + + +} // namespace accessibility + + +#endif // INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLETABLISTBOX_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/extended/accessibletablistboxtable.hxx b/accessibility/inc/extended/accessibletablistboxtable.hxx new file mode 100644 index 000000000000..feb9aad59635 --- /dev/null +++ b/accessibility/inc/extended/accessibletablistboxtable.hxx @@ -0,0 +1,109 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLETABLISTBOXTABLE_HXX +#define INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLETABLISTBOXTABLE_HXX + +#include "AccessibleBrowseBoxTable.hxx" +#include +#include +#include + +class SvHeaderTabListBox; + + +namespace accessibility { + +typedef ::cppu::ImplHelper1< css::accessibility::XAccessibleSelection > + AccessibleTabListBoxTableImplHelper; + +class AccessibleTabListBoxTable : public AccessibleBrowseBoxTable, public AccessibleTabListBoxTableImplHelper +{ +private: + VclPtr m_pTabListBox; + + css::uno::Reference< css::accessibility::XAccessible > m_xCurChild; + + void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); + DECL_LINK_TYPED( WindowEventListener, VclWindowEvent&, void ); + + // helpers ---------------------------------------------------------------- + + /** Throws an exception, if nIndex is not a valid child index. */ + void ensureValidIndex( sal_Int32 _nIndex ) const; + + /** Returns true, if the specified row is selected. */ + bool implIsRowSelected( sal_Int32 _nRow ) const; + /** Selects the specified row. */ + void implSelectRow( sal_Int32 _nRow, bool _bSelect ); + + /** Returns the count of rows in the table. */ + sal_Int32 implGetRowCount() const override; + /** Returns the total column count in the table. */ + sal_Int32 implGetColumnCount() const override; + /** Returns the count of selected rows in the table. */ + sal_Int32 implGetSelRowCount() const; + /** Returns the total cell count in the table (including header). */ + inline sal_Int32 implGetCellCount() const { return implGetRowCount() * implGetColumnCount(); } + + /** Returns the row index from cell index. */ + inline sal_Int32 implGetRow( sal_Int32 _nIndex ) const { return _nIndex / implGetColumnCount(); } + /** Returns the absolute row index of the nSelRow-th selected row. */ + sal_Int32 implGetSelRow( sal_Int32 _nSelRow ) const; + +public: + /** ctor() + @param rxParent XAccessible interface of the parent object. + @param rBox The HeaderTabListBox control. */ + AccessibleTabListBoxTable( + const css::uno::Reference< css::accessibility::XAccessible >& rxParent, + SvHeaderTabListBox& rBox ); + +protected: + /** dtor() */ + virtual ~AccessibleTabListBoxTable(); + +public: + // XInterface + DECLARE_XINTERFACE( ) + + // XTypeProvider + DECLARE_XTYPEPROVIDER( ) + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() + throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleSelection + void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + void SAL_CALL clearAccessibleSelection( ) throw (css::uno::RuntimeException, std::exception) override; + void SAL_CALL selectAllAccessibleChildren( ) throw (css::uno::RuntimeException, std::exception) override; + sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; + css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; +}; + + +} // namespace accessibility + + +#endif // INCLUDED_ACCESSIBILITY_INC_EXTENDED_ACCESSIBLETABLISTBOXTABLE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/extended/listboxaccessible.hxx b/accessibility/inc/extended/listboxaccessible.hxx new file mode 100644 index 000000000000..ef673d93f4fe --- /dev/null +++ b/accessibility/inc/extended/listboxaccessible.hxx @@ -0,0 +1,84 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_EXTENDED_LISTBOXACCESSIBLE_HXX +#define INCLUDED_ACCESSIBILITY_INC_EXTENDED_LISTBOXACCESSIBLE_HXX + +#include +#include +#include + +class SvTreeListBox; +class VclSimpleEvent; +class VclWindowEvent; + +namespace accessibility +{ + + /** helper class which couples its life time to the life time of an + SvTreeListBox + */ + class ListBoxAccessibleBase + { + private: + VclPtr m_pWindow; + + protected: + inline SvTreeListBox* getListBox() const + { + return const_cast< ListBoxAccessibleBase* >( this )->m_pWindow; + } + + inline bool isAlive() const { return nullptr != m_pWindow; } + + public: + ListBoxAccessibleBase( SvTreeListBox& _rWindow ); + + protected: + virtual ~ListBoxAccessibleBase( ); + + // own overridables + /// will be called for any VclWindowEvent events broadcasted by our VCL window + void ProcessWindowEvent( const VclWindowEvent& _rVclWindowEvent ); + + /** will be called when our window broadcasts the VCLEVENT_OBJECT_DYING event + +

Usually, you derive your class from both ListBoxAccessibleBase and XComponent, + and call XComponent::dispose here.

+ */ + virtual void SAL_CALL dispose() throw ( css::uno::RuntimeException, std::exception ) = 0; + + /// to be called in the dispose method of your derived class + void disposing(); + + private: + DECL_LINK_TYPED( WindowEventListener, VclWindowEvent&, void ); + + private: + ListBoxAccessibleBase( const ListBoxAccessibleBase& ) = delete; + ListBoxAccessibleBase& operator=( const ListBoxAccessibleBase& ) = delete; + }; + + +} // namespace accessibility + + +#endif // INCLUDED_ACCESSIBILITY_INC_EXTENDED_LISTBOXACCESSIBLE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/extended/textwindowaccessibility.hxx b/accessibility/inc/extended/textwindowaccessibility.hxx new file mode 100644 index 000000000000..70fa94f2cb88 --- /dev/null +++ b/accessibility/inc/extended/textwindowaccessibility.hxx @@ -0,0 +1,693 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_EXTENDED_TEXTWINDOWACCESSIBILITY_HXX +#define INCLUDED_ACCESSIBILITY_INC_EXTENDED_TEXTWINDOWACCESSIBILITY_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +class TextEngine; +class TextView; + +namespace accessibility +{ + +class Document; + +class SfxListenerGuard +{ +public: + inline SfxListenerGuard(::SfxListener & rListener): + m_rListener(rListener), m_pNotifier(nullptr) {} + + inline ~SfxListenerGuard() { endListening(); } + + // Not thread safe: + void startListening(::SfxBroadcaster & rNotifier); + + // Not thread safe: + void endListening(); + +private: + ::SfxListener & m_rListener; + ::SfxBroadcaster * m_pNotifier; +}; + +class WindowListenerGuard +{ +public: + inline WindowListenerGuard(::Link const & rListener): + m_aListener(rListener), m_pNotifier(nullptr) {} + + inline ~WindowListenerGuard() { endListening(); } + + // Not thread safe: + void startListening(vcl::Window & rNotifier); + + // Not thread safe: + void endListening(); + +private: + ::Link m_aListener; + VclPtr m_pNotifier; +}; + +class ParagraphInfo +{ +public: + inline ParagraphInfo(::sal_Int32 nHeight): m_nHeight(nHeight) {} + + inline + css::uno::WeakReference< css::accessibility::XAccessible > const & + getParagraph() const { return m_xParagraph; } + + inline ::sal_Int32 getHeight() const { return m_nHeight; } + + inline void setParagraph( + css::uno::Reference< css::accessibility::XAccessible > const & + rParagraph) { m_xParagraph = rParagraph; } + + inline void changeHeight(::sal_Int32 nHeight) { m_nHeight = nHeight; } + +private: + css::uno::WeakReference< css::accessibility::XAccessible > + m_xParagraph; + ::sal_Int32 m_nHeight; +}; + +typedef ::std::vector< ParagraphInfo > Paragraphs; + +typedef ::cppu::WeakAggComponentImplHelper7< + css::accessibility::XAccessible, + css::accessibility::XAccessibleContext, + css::accessibility::XAccessibleComponent, + css::accessibility::XAccessibleEditableText, + css::accessibility::XAccessibleMultiLineText, + css::accessibility::XAccessibleTextAttributes, + css::accessibility::XAccessibleEventBroadcaster > ParagraphBase; + +// The Paragraph's number is the absolute position within the text engine (from +// 0 to N - 1), whereas the Paragraph's index is the position within the text +// view/accessible parent (from 0 to M - 1). Paragraphs outside the currently +// visible range have an index of -1. +class Paragraph: + private cppu::BaseMutex, public ParagraphBase, private ::comphelper::OCommonAccessibleText +{ +public: + Paragraph(::rtl::Reference< Document > const & rDocument, + Paragraphs::size_type nNumber); + + // Not thread-safe. + inline Paragraphs::size_type getNumber() const { return m_nNumber; } + + // Not thread-safe. + void numberChanged(bool bIncremented); + + // Not thread-safe. + void textChanged(); + + // Thread-safe. + void notifyEvent(::sal_Int16 nEventId, css::uno::Any const & rOldValue, + css::uno::Any const & rNewValue); + +protected: + // OCommonAccessibleText + virtual void implGetParagraphBoundary( css::i18n::Boundary& rBoundary, + ::sal_Int32 nIndex ) override; + virtual void implGetLineBoundary( css::i18n::Boundary& rBoundary, + ::sal_Int32 nIndex ) override; + +private: + virtual css::uno::Reference< css::accessibility::XAccessibleContext > + SAL_CALL getAccessibleContext() throw (css::uno::RuntimeException, std::exception) override; + + virtual ::sal_Int32 SAL_CALL getAccessibleChildCount() + throw (css::uno::RuntimeException, std::exception) override; + + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL + getAccessibleChild(::sal_Int32 i) + throw (css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception) override; + + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL + getAccessibleParent() throw (css::uno::RuntimeException, std::exception) override; + + virtual ::sal_Int32 SAL_CALL getAccessibleIndexInParent() + throw (css::uno::RuntimeException, std::exception) override; + + virtual ::sal_Int16 SAL_CALL getAccessibleRole() + throw (css::uno::RuntimeException, std::exception) override; + + virtual OUString SAL_CALL getAccessibleDescription() + throw (css::uno::RuntimeException, std::exception) override; + + virtual OUString SAL_CALL getAccessibleName() + throw (css::uno::RuntimeException, std::exception) override; + + virtual + css::uno::Reference< css::accessibility::XAccessibleRelationSet > + SAL_CALL getAccessibleRelationSet() throw (css::uno::RuntimeException, std::exception) override; + + virtual + css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL + getAccessibleStateSet() throw (css::uno::RuntimeException, std::exception) override; + + virtual css::lang::Locale SAL_CALL getLocale() + throw (css::accessibility::IllegalAccessibleComponentStateException, + css::uno::RuntimeException, std::exception) override; + + virtual sal_Bool SAL_CALL containsPoint(css::awt::Point const & rPoint) + throw (css::uno::RuntimeException, std::exception) override; + + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL + getAccessibleAtPoint(css::awt::Point const & rPoint) + throw (css::uno::RuntimeException, std::exception) override; + + virtual css::awt::Rectangle SAL_CALL getBounds() + throw (css::uno::RuntimeException, std::exception) override; + + virtual css::awt::Point SAL_CALL getLocation() + throw (css::uno::RuntimeException, std::exception) override; + + virtual css::awt::Point SAL_CALL getLocationOnScreen() + throw (css::uno::RuntimeException, std::exception) override; + + virtual css::awt::Size SAL_CALL getSize() + throw (css::uno::RuntimeException, std::exception) override; + + virtual void SAL_CALL grabFocus() throw (css::uno::RuntimeException, std::exception) override; + + virtual css::util::Color SAL_CALL getForeground() + throw (css::uno::RuntimeException, std::exception) override; + + virtual css::util::Color SAL_CALL getBackground() + throw (css::uno::RuntimeException, std::exception) override; + + virtual ::sal_Int32 SAL_CALL getCaretPosition() + throw (css::uno::RuntimeException, std::exception) override; + + virtual sal_Bool SAL_CALL setCaretPosition(::sal_Int32 nIndex) + throw (css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception) override; + + virtual ::sal_Unicode SAL_CALL getCharacter(::sal_Int32 nIndex) + throw (css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception) override; + + virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL + getCharacterAttributes(::sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes ) + throw (css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception) override; + + virtual css::awt::Rectangle SAL_CALL + getCharacterBounds(::sal_Int32 nIndex) + throw (css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception) override; + + virtual ::sal_Int32 SAL_CALL getCharacterCount() + throw (css::uno::RuntimeException, std::exception) override; + + virtual ::sal_Int32 SAL_CALL + getIndexAtPoint(css::awt::Point const & rPoint) + throw (css::uno::RuntimeException, std::exception) override; + + virtual OUString SAL_CALL getSelectedText() + throw (css::uno::RuntimeException, std::exception) override; + + virtual ::sal_Int32 SAL_CALL getSelectionStart() + throw (css::uno::RuntimeException, std::exception) override; + + virtual ::sal_Int32 SAL_CALL getSelectionEnd() + throw (css::uno::RuntimeException, std::exception) override; + + virtual sal_Bool SAL_CALL setSelection(::sal_Int32 nStartIndex, + ::sal_Int32 nEndIndex) + throw (css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception) override; + + virtual OUString SAL_CALL getText() + throw (css::uno::RuntimeException, std::exception) override; + + virtual OUString SAL_CALL getTextRange(::sal_Int32 nStartIndex, + ::sal_Int32 nEndIndex) + throw (css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception) override; + + virtual css::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; + virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; + virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; + + virtual sal_Bool SAL_CALL copyText(::sal_Int32 nStartIndex, + ::sal_Int32 nEndIndex) + throw (css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception) override; + + virtual sal_Bool SAL_CALL cutText(::sal_Int32 nStartIndex, + ::sal_Int32 nEndIndex) + throw (css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception) override; + + virtual sal_Bool SAL_CALL pasteText(::sal_Int32 nIndex) + throw (css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception) override; + + virtual sal_Bool SAL_CALL deleteText(::sal_Int32 nStartIndex, + ::sal_Int32 nEndIndex) + throw (css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception) override; + + virtual sal_Bool SAL_CALL insertText(OUString const & rText, + ::sal_Int32 nIndex) + throw (css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception) override; + + virtual sal_Bool SAL_CALL replaceText( + ::sal_Int32 nStartIndex, ::sal_Int32 nEndIndex, + OUString const & rReplacement) + throw (css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception) override; + + virtual sal_Bool SAL_CALL setAttributes( + ::sal_Int32 nStartIndex, ::sal_Int32 nEndIndex, + css::uno::Sequence< css::beans::PropertyValue > const & + rAttributeSet) + throw (css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception) override; + + virtual sal_Bool SAL_CALL setText(OUString const & rText) + throw (css::uno::RuntimeException, std::exception) override; + + virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL + getDefaultAttributes(const css::uno::Sequence< OUString >& RequestedAttributes) + throw (css::uno::RuntimeException, std::exception) override; + + virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL + getRunAttributes(::sal_Int32 Index, const css::uno::Sequence< OUString >& RequestedAttributes) + throw (css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception) override; + + virtual ::sal_Int32 SAL_CALL getLineNumberAtIndex( ::sal_Int32 nIndex ) + throw (css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception) override; + + virtual css::accessibility::TextSegment SAL_CALL getTextAtLineNumber( ::sal_Int32 nLineNo ) + throw (css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception) override; + + virtual css::accessibility::TextSegment SAL_CALL getTextAtLineWithCaret( ) + throw (css::uno::RuntimeException, std::exception) override; + + virtual ::sal_Int32 SAL_CALL getNumberOfLineWithCaret( ) + throw (css::uno::RuntimeException, std::exception) override; + + virtual void SAL_CALL addAccessibleEventListener( + css::uno::Reference< + css::accessibility::XAccessibleEventListener > const & rListener) + throw (css::uno::RuntimeException, std::exception) override; + + virtual void SAL_CALL removeAccessibleEventListener( + css::uno::Reference< + css::accessibility::XAccessibleEventListener > const & rListener) + throw (css::uno::RuntimeException, std::exception) override; + + virtual void SAL_CALL disposing() override; + + virtual OUString implGetText() override; + + virtual css::lang::Locale implGetLocale() override; + + virtual void implGetSelection(::sal_Int32 & rStartIndex, + ::sal_Int32 & rEndIndex) override; + + // Throws css::lang::DisposedException: + void checkDisposed(); + + ::rtl::Reference< Document > m_xDocument; + Paragraphs::size_type m_nNumber; + + /// client id in the AccessibleEventNotifier queue + sal_uInt32 m_nClientId; + + OUString m_aParagraphText; +}; + + +typedef std::unordered_map< OUString, + css::beans::PropertyValue, + OUStringHash > tPropValMap; + +class Document: public ::VCLXAccessibleComponent, public ::SfxListener +{ +public: + Document(::VCLXWindow * pVclXWindow, ::TextEngine & rEngine, + ::TextView & rView); + + const css::uno::Reference< css::accessibility::XAccessible >& + getAccessible() { return m_xAccessible; } + + // Must be called only after init has been called. + css::lang::Locale retrieveLocale(); + + // Must be called only after init has been called. + // To make it possible for this method to be (indirectly) called from + // within Paragraph's constructor (i.e., when the Paragraph's ref count is + // still zero), pass a "Paragraph const *" instead of a + // "::rtl::Reference< Paragraph > const &". + ::sal_Int32 retrieveParagraphIndex(Paragraph const * pParagraph); + + // Must be called only after init has been called. + // To make it possible for this method to be (indirectly) called from + // within Paragraph's constructor (i.e., when the Paragraph's ref count is + // still zero), pass a "Paragraph const *" instead of a + // "::rtl::Reference< Paragraph > const &". + ::sal_Int64 retrieveParagraphState(Paragraph const * pParagraph); + + // Must be called only after init has been called. + // To make it possible for this method to be (indirectly) called from + // within Paragraph's constructor (i.e., when the Paragraph's ref count is + // still zero), pass a "Paragraph const &" instead of a + // "::rtl::Reference< Paragraph > const &". + css::awt::Rectangle + retrieveParagraphBounds(Paragraph const * pParagraph, bool bAbsolute); + + // Must be called only after init has been called. + // To make it possible for this method to be (indirectly) called from + // within Paragraph's constructor (i.e., when the Paragraph's ref count is + // still zero), pass a "Paragraph const &" instead of a + // "::rtl::Reference< Paragraph > const &". + OUString retrieveParagraphText(Paragraph const * pParagraph); + + // Must be called only after init has been called. + // To make it possible for this method to be (indirectly) called from + // within Paragraph's constructor (i.e., when the Paragraph's ref count is + // still zero), pass a "Paragraph const &" instead of a + // "::rtl::Reference< Paragraph > const &". + void retrieveParagraphSelection(Paragraph const * pParagraph, + ::sal_Int32 * pBegin, ::sal_Int32 * pEnd); + + // Must be called only after init has been called. + // To make it possible for this method to be (indirectly) called from + // within Paragraph's constructor (i.e., when the Paragraph's ref count is + // still zero), pass a "Paragraph const *" instead of a + // "::rtl::Reference< Paragraph > const &". + ::sal_Int32 retrieveParagraphCaretPosition(Paragraph const * pParagraph); + + // Must be called only after init has been called. + // To make it possible for this method to be (indirectly) called from + // within Paragraph's constructor (i.e., when the Paragraph's ref count is + // still zero), pass a "Paragraph const &" instead of a + // "::rtl::Reference< Paragraph > const &". + // Throws css::lang::IndexOutOfBoundsException. + css::awt::Rectangle + retrieveCharacterBounds(Paragraph const * pParagraph, + ::sal_Int32 nIndex); + + // Must be called only after init has been called. + // To make it possible for this method to be (indirectly) called from + // within Paragraph's constructor (i.e., when the Paragraph's ref count is + // still zero), pass a "Paragraph const &" instead of a + // "::rtl::Reference< Paragraph > const &". + ::sal_Int32 retrieveCharacterIndex(Paragraph const * pParagraph, + css::awt::Point const & rPoint); + + // Must be called only after init has been called. + // To make it possible for this method to be (indirectly) called from + // within Paragraph's constructor (i.e., when the Paragraph's ref count is + // still zero), pass a "Paragraph const &" instead of a + // "::rtl::Reference< Paragraph > const &". + // Throws css::lang::IndexOutOfBoundsException. + css::uno::Sequence< css::beans::PropertyValue > retrieveCharacterAttributes( + Paragraph const * pParagraph, ::sal_Int32 nIndex, + const css::uno::Sequence< OUString >& aRequestedAttributes); + + // Must be called only after init has been called. + // To make it possible for this method to be (indirectly) called from + // within Paragraph's constructor (i.e., when the Paragraph's ref count is + // still zero), pass a "Paragraph const &" instead of a + // "::rtl::Reference< Paragraph > const &". + css::uno::Sequence< css::beans::PropertyValue > retrieveDefaultAttributes( + Paragraph const * pParagraph, + const css::uno::Sequence< OUString >& RequestedAttributes); + + // Must be called only after init has been called. + // To make it possible for this method to be (indirectly) called from + // within Paragraph's constructor (i.e., when the Paragraph's ref count is + // still zero), pass a "Paragraph const &" instead of a + // "::rtl::Reference< Paragraph > const &". + // Throws css::lang::IndexOutOfBoundsException. + css::uno::Sequence< css::beans::PropertyValue > retrieveRunAttributes( + Paragraph const * pParagraph, ::sal_Int32 Index, + const css::uno::Sequence< OUString >& RequestedAttributes); + + // Must be called only after init has been called. + // To make it possible for this method to be (indirectly) called from + // within Paragraph's constructor (i.e., when the Paragraph's ref count is + // still zero), pass a "Paragraph const &" instead of a + // "::rtl::Reference< Paragraph > const &". + void changeParagraphText(Paragraph * pParagraph, + OUString const & rText); + + // Must be called only after init has been called. + // To make it possible for this method to be (indirectly) called from + // within Paragraph's constructor (i.e., when the Paragraph's ref count is + // still zero), pass a "Paragraph const &" instead of a + // "::rtl::Reference< Paragraph > const &". + // Throws css::lang::IndexOutOfBoundsException. + void changeParagraphText(Paragraph * pParagraph, ::sal_Int32 nBegin, + ::sal_Int32 nEnd, bool bCut, bool bPaste, + OUString const & rText); + + // Must be called only after init has been called. + // To make it possible for this method to be (indirectly) called from + // within Paragraph's constructor (i.e., when the Paragraph's ref count is + // still zero), pass a "Paragraph const &" instead of a + // "::rtl::Reference< Paragraph > const &". + // Throws css::lang::IndexOutOfBoundsException. + void copyParagraphText(Paragraph const * pParagraph, + ::sal_Int32 nBegin, ::sal_Int32 nEnd); + + // Must be called only after init has been called. + // To make it possible for this method to be (indirectly) called from + // within Paragraph's constructor (i.e., when the Paragraph's ref count is + // still zero), pass a "Paragraph const &" instead of a + // "::rtl::Reference< Paragraph > const &". + // Throws css::lang::IndexOutOfBoundsException. + void changeParagraphAttributes( + Paragraph * pParagraph, ::sal_Int32 nBegin, ::sal_Int32 nEnd, + css::uno::Sequence< css::beans::PropertyValue > const & + rAttributeSet); + + // Must be called only after init has been called. + // To make it possible for this method to be (indirectly) called from + // within Paragraph's constructor (i.e., when the Paragraph's ref count is + // still zero), pass a "Paragraph const &" instead of a + // "::rtl::Reference< Paragraph > const &". + // Throws css::lang::IndexOutOfBoundsException. + void changeParagraphSelection(Paragraph * pParagraph, + ::sal_Int32 nBegin, ::sal_Int32 nEnd); + + css::i18n::Boundary + retrieveParagraphLineBoundary( Paragraph const * pParagraph, + ::sal_Int32 nIndex, ::sal_Int32 *pLineNo = nullptr); + + css::i18n::Boundary + retrieveParagraphBoundaryOfLine( Paragraph const * pParagraph, + ::sal_Int32 nIndex ); + + sal_Int32 retrieveParagraphLineWithCursor( Paragraph const * pParagraph ); + + css::uno::Reference< css::accessibility::XAccessibleRelationSet > + retrieveParagraphRelationSet( Paragraph const * pParagraph ); + +private: + virtual ::sal_Int32 SAL_CALL getAccessibleChildCount() + throw (css::uno::RuntimeException, std::exception) override; + + virtual css::uno::Reference< css::accessibility::XAccessible > + SAL_CALL getAccessibleChild(::sal_Int32 i) + throw (css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception) override; + + virtual ::sal_Int16 SAL_CALL getAccessibleRole() + throw (css::uno::RuntimeException, std::exception) override; + + virtual css::uno::Reference< css::accessibility::XAccessible > + SAL_CALL getAccessibleAtPoint(css::awt::Point const & rPoint) + throw (css::uno::RuntimeException, std::exception) override; + + virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) override; + virtual void FillAccessibleRelationSet( utl::AccessibleRelationSetHelper& rRelationSet ) override; + + // ??? Will be called with both the external (Solar) and internal mutex + // locked: + virtual void SAL_CALL disposing() override; + + // ??? Will be called with the external (Solar) mutex locked. + // init will already have been called. + virtual void Notify(::SfxBroadcaster & rBC, ::SfxHint const & rHint) override; + + // Assuming that this will only be called with the external (Solar) mutex + // locked. + // init will already have been called. + DECL_LINK_TYPED(WindowEventHandler, VclWindowEvent&, void); + + // Must be called with both the external (Solar) and internal mutex + // locked. + void init(); + + // Must be called with both the external (Solar) and internal mutex + // locked, and after init has been called: + static ::rtl::Reference< Paragraph > + getParagraph(Paragraphs::iterator const & rIt); + + // Must be called with both the external (Solar) and internal mutex + // locked, and after init has been called. + // Throws css::uno::RuntimeException. + css::uno::Reference< css::accessibility::XAccessible > + getAccessibleChild(Paragraphs::iterator const & rIt); + + // Must be called with both the external (Solar) and internal mutex + // locked, and after init has been called: + void determineVisibleRange(); + + // Must be called with both the external (Solar) and internal mutex + // locked, and after init has been called: + void notifyVisibleRangeChanges( + Paragraphs::iterator const & rOldVisibleBegin, + Paragraphs::iterator const & rOldVisibleEnd, + Paragraphs::iterator const & rInserted); + + // Must be called with both the external (Solar) and internal mutex + // locked, and after init has been called: + void changeParagraphText(::sal_uLong nNumber, ::sal_uInt16 nBegin, ::sal_uInt16 nEnd, + bool bCut, bool bPaste, + OUString const & rText); + + void + handleParagraphNotifications(); + + void handleSelectionChangeNotification(); + + ::sal_Int32 getSelectionType(::sal_Int32 nNewFirstPara, ::sal_Int32 nNewFirstPos, ::sal_Int32 nNewLastPara, ::sal_Int32 nNewLastPos); + void sendEvent(::sal_Int32 start, ::sal_Int32 end, ::sal_Int16 nEventId); + + void disposeParagraphs(); + + static css::uno::Any mapFontColor(::Color const & rColor); + + static ::Color mapFontColor(css::uno::Any const & rColor); + + static css::uno::Any mapFontWeight(::FontWeight nWeight); + + static ::FontWeight mapFontWeight(css::uno::Any const & rWeight); + + static void retrieveDefaultAttributesImpl( + Paragraph const * pParagraph, + const css::uno::Sequence< OUString >& RequestedAttributes, + tPropValMap& rDefAttrSeq); + + void retrieveRunAttributesImpl( + Paragraph const * pParagraph, ::sal_Int32 Index, + const css::uno::Sequence< OUString >& RequestedAttributes, + tPropValMap& rRunAttrSeq); + + css::uno::Reference< css::accessibility::XAccessible > m_xAccessible; + ::TextEngine & m_rEngine; + ::TextView & m_rView; + + SfxListenerGuard m_aEngineListener; + WindowListenerGuard m_aViewListener; + + // All the following members have valid values only after calling init: + + std::unique_ptr< Paragraphs > m_xParagraphs; + + // m_nViewOffset is from the start of the document (0) to the start of the + // current view, and m_nViewHeight is the height of the view: + ::sal_Int32 m_nViewOffset; + ::sal_Int32 m_nViewHeight; + + // m_aVisibleBegin points to the first Paragraph that is (partially) + // contained in the view, and m_aVisibleEnd points past the last Paragraph + // that is (partially) contained. If no Paragraphs are (partially) in the + // view, both m_aVisibleBegin and m_aVisibleEnd are set to + // m_xParagraphs->end(). These values are only changed by + // determineVisibleRange. + Paragraphs::iterator m_aVisibleBegin; + Paragraphs::iterator m_aVisibleEnd; + + // m_nVisibleBeginOffset is from m_nViewOffset back to the start of the + // Paragraph pointed to by m_aVisibleBegin (and always has a non-negative + // value). If m_aVisibleBegin == m_xParagraphs->end(), + // m_nVisibleBeginOffset is set to 0. These values are only changed by + // determineVisibleRange. + ::sal_Int32 m_nVisibleBeginOffset; + + // If no selection has yet been set, all the following four variables are + // set to -1. m_nSelectionLastPara/Pos is also the cursor position. + ::sal_Int32 m_nSelectionFirstPara; + ::sal_Int32 m_nSelectionFirstPos; + ::sal_Int32 m_nSelectionLastPara; + ::sal_Int32 m_nSelectionLastPos; + + Paragraphs::iterator m_aFocused; + + ::std::queue< ::TextHint > m_aParagraphNotifications; + bool m_bSelectionChangedNotification; +}; + +} + +#endif // INCLUDED_ACCESSIBILITY_INC_EXTENDED_TEXTWINDOWACCESSIBILITY_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/helper/IComboListBoxHelper.hxx b/accessibility/inc/helper/IComboListBoxHelper.hxx new file mode 100644 index 000000000000..8d528be793db --- /dev/null +++ b/accessibility/inc/helper/IComboListBoxHelper.hxx @@ -0,0 +1,69 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_ACCESSIBILITY_INC_HELPER_ICOMBOLISTBOXHELPER_HXX +#define INCLUDED_ACCESSIBILITY_INC_HELPER_ICOMBOLISTBOXHELPER_HXX + +#include + +#include +#include + +namespace com { namespace sun { namespace star { namespace datatransfer { namespace clipboard { + class XClipboard; +} } } } } + +class Point; +class Rectangle; +namespace vcl { class Window; } +namespace accessibility +{ + class IComboListBoxHelper + { + public: + virtual ~IComboListBoxHelper() = 0; + + virtual OUString GetEntry( sal_Int32 nPos ) const = 0; + virtual Rectangle GetDropDownPosSizePixel( ) const = 0; + virtual Rectangle GetBoundingRectangle( sal_uInt16 nItem ) const = 0; + virtual Rectangle GetWindowExtentsRelative() = 0; + virtual bool IsEnabled() const = 0; + virtual bool IsEntryVisible( sal_Int32 nPos ) const = 0; + virtual sal_uInt16 GetDisplayLineCount() const = 0; + virtual void GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const = 0; + virtual WinBits GetStyle() const = 0; + virtual bool IsMultiSelectionEnabled() const = 0; + virtual sal_Int32 GetTopEntry() const = 0; + virtual bool IsEntryPosSelected( sal_Int32 nPos ) const = 0; + virtual sal_Int32 GetEntryCount() const = 0; + virtual void Select() = 0; + virtual void SelectEntryPos( sal_Int32 nPos, bool bSelect = true ) = 0; + virtual sal_Int32 GetSelectEntryCount() const = 0; + virtual void SetNoSelection() = 0; + virtual sal_Int32 GetSelectEntryPos( sal_Int32 nSelIndex = 0 ) const = 0; + virtual bool IsInDropDown() const = 0; + virtual Rectangle GetEntryCharacterBounds( const sal_Int32 _nEntryPos, const sal_Int32 _nCharacterIndex ) const = 0; + virtual long GetIndexForPoint( const Point& rPoint, sal_Int32 & nPos ) const = 0; + virtual css::uno::Reference< css::datatransfer::clipboard::XClipboard > + GetClipboard() = 0; + }; +} +#endif // INCLUDED_ACCESSIBILITY_INC_HELPER_ICOMBOLISTBOXHELPER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ + diff --git a/accessibility/inc/helper/accessiblestrings.hrc b/accessibility/inc/helper/accessiblestrings.hrc new file mode 100644 index 000000000000..60c4392a7562 --- /dev/null +++ b/accessibility/inc/helper/accessiblestrings.hrc @@ -0,0 +1,51 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef ACCESSIBILITY_HELPER_ACCESSIBLESTRINGS_HRC_ +#define ACCESSIBILITY_HELPER_ACCESSIBLESTRINGS_HRC_ + +#define RID_TK_ACC_START 1000 + +// Accessible Action Id's +#define RID_STR_ACC_ACTION_CLICK ( RID_TK_ACC_START + 0 ) +#define RID_STR_ACC_ACTION_TOGGLEPOPUP ( RID_TK_ACC_START + 1 ) +#define RID_STR_ACC_ACTION_SELECT ( RID_TK_ACC_START + 2 ) +#define RID_STR_ACC_ACTION_INCLINE ( RID_TK_ACC_START + 3 ) +#define RID_STR_ACC_ACTION_DECLINE ( RID_TK_ACC_START + 4 ) +#define RID_STR_ACC_ACTION_INCBLOCK ( RID_TK_ACC_START + 5 ) +#define RID_STR_ACC_ACTION_DECBLOCK ( RID_TK_ACC_START + 6 ) +#define RID_STR_ACC_NAME_PREVIEW ( RID_TK_ACC_START + 7 ) + +#define STR_SVT_ACC_ACTION_EXPAND ( RID_TK_ACC_START + 8 ) +#define STR_SVT_ACC_ACTION_COLLAPSE ( RID_TK_ACC_START + 9 ) +#define STR_SVT_ACC_LISTENTRY_SELCTED_STATE ( RID_TK_ACC_START + 10 ) + +#define RID_STR_ACC_ACTION_CHECK ( RID_TK_ACC_START + 11 ) +#define RID_STR_ACC_ACTION_UNCHECK ( RID_TK_ACC_START + 12 ) +#define RID_STR_ACC_ACTION_DOUBLE_CLICK ( RID_TK_ACC_START + 13 ) +#define RID_STR_ACC_SCROLLBAR_NAME_VERTICAL ( RID_TK_ACC_START + 14 ) +#define RID_STR_ACC_SCROLLBAR_NAME_HORIZONTAL ( RID_TK_ACC_START + 15 ) +#define RID_STR_ACC_PANEL_DESCRIPTION ( RID_TK_ACC_START + 16 ) + +#define RID_STR_ACC_NAME_BROWSEBUTTON ( RID_TK_ACC_START + 100 ) +#define RID_STR_ACC_DESC_PANELDECL_TABBAR ( RID_TK_ACC_START + 101 ) + +#endif // ACCESSIBILITY_HELPER_ACCESSIBLESTRINGS_HRC_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/helper/accresmgr.hxx b/accessibility/inc/helper/accresmgr.hxx new file mode 100644 index 000000000000..38ceaa172abd --- /dev/null +++ b/accessibility/inc/helper/accresmgr.hxx @@ -0,0 +1,66 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_HELPER_ACCRESMGR_HXX +#define INCLUDED_ACCESSIBILITY_INC_HELPER_ACCRESMGR_HXX + +#include + +class SimpleResMgr; + +#define TK_RES_STRING(id) ::accessibility::TkResMgr::loadString(id) + + +// TkResMgr + +namespace accessibility +{ + +class TkResMgr +{ + static SimpleResMgr* m_pImpl; + +private: + // no instantiation allowed + TkResMgr() = delete; + ~TkResMgr() { } + + // we'll instantiate one static member of the following class, + // which in its dtor ensures that m_pImpl will be deleted + class EnsureDelete + { + public: + EnsureDelete() { } + ~EnsureDelete(); + }; + friend class EnsureDelete; + +protected: + static void ensureImplExists(); + +public: + // loads the string with the specified resource id + static OUString loadString( sal_uInt16 nResId ); +}; + +} + +#endif // INCLUDED_ACCESSIBILITY_INC_HELPER_ACCRESMGR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/helper/characterattributeshelper.hxx b/accessibility/inc/helper/characterattributeshelper.hxx new file mode 100644 index 000000000000..6b679a9d5b6a --- /dev/null +++ b/accessibility/inc/helper/characterattributeshelper.hxx @@ -0,0 +1,52 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_HELPER_CHARACTERATTRIBUTESHELPER_HXX +#define INCLUDED_ACCESSIBILITY_INC_HELPER_CHARACTERATTRIBUTESHELPER_HXX + +#include +#include +#include + +#include + + +// class CharacterAttributesHelper + + +class CharacterAttributesHelper +{ +private: + + typedef ::std::map< OUString, css::uno::Any > AttributeMap; + + AttributeMap m_aAttributeMap; + +public: + + CharacterAttributesHelper( const vcl::Font& rFont, sal_Int32 nBackColor, sal_Int32 nColor ); + ~CharacterAttributesHelper(); + + std::vector< css::beans::PropertyValue > GetCharacterAttributes(); + css::uno::Sequence< css::beans::PropertyValue > GetCharacterAttributes( const css::uno::Sequence< OUString >& aRequestedAttributes ); +}; + +#endif // INCLUDED_ACCESSIBILITY_INC_HELPER_CHARACTERATTRIBUTESHELPER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/helper/listboxhelper.hxx b/accessibility/inc/helper/listboxhelper.hxx new file mode 100644 index 000000000000..9236d32a7b13 --- /dev/null +++ b/accessibility/inc/helper/listboxhelper.hxx @@ -0,0 +1,189 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_HELPER_LISTBOXHELPER_HXX +#define INCLUDED_ACCESSIBILITY_INC_HELPER_LISTBOXHELPER_HXX + +#include +#include +#include +#include + + +// globals + + +const sal_Int32 DEFAULT_INDEX_IN_PARENT = -1; + + +// class VCLListBoxHelper + + +template< class T > class VCLListBoxHelper : public ::accessibility::IComboListBoxHelper +{ +private: + T& m_aComboListBox; + +public: + inline + VCLListBoxHelper( T& _pListBox ) : + m_aComboListBox( _pListBox ){} + + + virtual OUString GetEntry( sal_Int32 nPos ) const override + { + return m_aComboListBox.GetEntry( nPos ); + } + + virtual Rectangle GetDropDownPosSizePixel() const override + { + Rectangle aTemp = m_aComboListBox.GetWindowExtentsRelative(nullptr); + Rectangle aRet = m_aComboListBox.GetDropDownPosSizePixel(); + aRet.Move(aTemp.TopLeft().X(),aTemp.TopLeft().Y()); + return aRet; + } + + virtual Rectangle GetBoundingRectangle( sal_uInt16 nItem ) const override + { + Rectangle aRect; + if ( m_aComboListBox.IsInDropDown() && IsEntryVisible( nItem ) ) + { + Rectangle aTemp = m_aComboListBox.GetDropDownPosSizePixel(); + Size aSize = aTemp.GetSize(); + aSize.Height() /= m_aComboListBox.GetDisplayLineCount(); + Point aTopLeft = aTemp.TopLeft(); + aTopLeft.Y() += aSize.Height() * ( nItem - m_aComboListBox.GetTopEntry() ); + aRect = Rectangle( aTopLeft, aSize ); + } + else + aRect = m_aComboListBox.GetBoundingRectangle( nItem ); + return aRect; + } + + virtual Rectangle GetWindowExtentsRelative() override + { + return m_aComboListBox.GetWindowExtentsRelative( nullptr ); + } + + virtual bool IsEnabled() const override + { + return m_aComboListBox.IsEnabled(); + } + + virtual bool IsEntryVisible( sal_Int32 nPos ) const override + { + sal_Int32 nTopEntry = m_aComboListBox.GetTopEntry(); + sal_uInt16 nLines = m_aComboListBox.GetDisplayLineCount(); + return ( nPos >= nTopEntry && nPos < ( nTopEntry + nLines ) ); + } + + virtual sal_uInt16 GetDisplayLineCount() const override + { + return m_aComboListBox.GetDisplayLineCount(); + } + + virtual void GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const override + { + m_aComboListBox.GetMaxVisColumnsAndLines(rnCols,rnLines); + } + + virtual WinBits GetStyle() const override + { + return m_aComboListBox.GetStyle(); + } + + virtual bool IsMultiSelectionEnabled() const override + { + return m_aComboListBox.IsMultiSelectionEnabled(); + } + + virtual sal_Int32 GetTopEntry() const override + { + return m_aComboListBox.GetTopEntry(); + } + + virtual bool IsEntryPosSelected( sal_Int32 nPos ) const override + { + return m_aComboListBox.IsEntryPosSelected(nPos); + } + + virtual sal_Int32 GetEntryCount() const override + { + return m_aComboListBox.GetEntryCount(); + } + + virtual void Select() override + { + m_aComboListBox.Select(); + } + + virtual void SelectEntryPos( sal_Int32 nPos, bool bSelect = true ) override + { + m_aComboListBox.SelectEntryPos(nPos,bSelect); + } + + virtual sal_Int32 GetSelectEntryCount() const override + { + return m_aComboListBox.GetSelectEntryCount(); + } + + virtual void SetNoSelection() override + { + m_aComboListBox.SetNoSelection(); + } + + virtual sal_Int32 GetSelectEntryPos( sal_Int32 nSelIndex = 0 ) const override + { + return m_aComboListBox.GetSelectEntryPos(nSelIndex); + } + + virtual bool IsInDropDown() const override + { + return m_aComboListBox.IsInDropDown(); + } + + virtual Rectangle GetEntryCharacterBounds( const sal_Int32 _nEntryPos, const sal_Int32 _nCharacterIndex ) const override + { + Rectangle aRect; + + Pair aEntryCharacterRange = m_aComboListBox.GetLineStartEnd( _nEntryPos ); + if ( aEntryCharacterRange.A() + _nCharacterIndex <= aEntryCharacterRange.B() ) + { + long nIndex = aEntryCharacterRange.A() + _nCharacterIndex; + aRect = m_aComboListBox.GetCharacterBounds( nIndex ); + } + return aRect; + } + + long GetIndexForPoint( const Point& rPoint, sal_Int32& nPos ) const override + { + return m_aComboListBox.GetIndexForPoint( rPoint, nPos ); + } + + css::uno::Reference< css::datatransfer::clipboard::XClipboard > + GetClipboard() override + { + return m_aComboListBox.GetClipboard(); + } + +}; + +#endif // INCLUDED_ACCESSIBILITY_INC_HELPER_LISTBOXHELPER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/pch/precompiled_acc.hxx b/accessibility/inc/pch/precompiled_acc.hxx index c0ab3af65eb0..f0c4ba2f934a 100644 --- a/accessibility/inc/pch/precompiled_acc.hxx +++ b/accessibility/inc/pch/precompiled_acc.hxx @@ -337,21 +337,21 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/standard/accessiblemenubasecomponent.hxx b/accessibility/inc/standard/accessiblemenubasecomponent.hxx new file mode 100644 index 000000000000..167c957c5aca --- /dev/null +++ b/accessibility/inc/standard/accessiblemenubasecomponent.hxx @@ -0,0 +1,145 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_STANDARD_ACCESSIBLEMENUBASECOMPONENT_HXX +#define INCLUDED_ACCESSIBILITY_INC_STANDARD_ACCESSIBLEMENUBASECOMPONENT_HXX + +#include +#include +#include +#include +#include +#include + +#include + +class Menu; +class VclSimpleEvent; +class VclMenuEvent; +class VCLExternalSolarLock; + +namespace utl { +class AccessibleStateSetHelper; +} + + +// class OAccessibleMenuBaseComponent + +typedef ::cppu::ImplHelper2< + css::accessibility::XAccessible, + css::lang::XServiceInfo > OAccessibleMenuBaseComponent_BASE; + +class OAccessibleMenuBaseComponent : public comphelper::OAccessibleExtendedComponentHelper, + public OAccessibleMenuBaseComponent_BASE +{ + friend class OAccessibleMenuItemComponent; + friend class VCLXAccessibleMenuItem; + friend class VCLXAccessibleMenu; + +private: + VCLExternalSolarLock* m_pExternalLock; + +protected: + typedef ::std::vector< css::uno::Reference< css::accessibility::XAccessible > > AccessibleChildren; + + AccessibleChildren m_aAccessibleChildren; + Menu* m_pMenu; + + bool m_bEnabled; + bool m_bFocused; + bool m_bVisible; + bool m_bSelected; + bool m_bChecked; + + virtual bool IsEnabled(); + virtual bool IsFocused(); + virtual bool IsVisible(); + virtual bool IsSelected(); + virtual bool IsChecked(); + + void SetEnabled( bool bEnabled ); + void SetFocused( bool bFocused ); + void SetVisible( bool bVisible ); + void SetSelected( bool bSelected ); + void SetChecked( bool bChecked ); + + void UpdateEnabled( sal_Int32 i, bool bEnabled ); + void UpdateFocused( sal_Int32 i, bool bFocused ); + void UpdateVisible(); + void UpdateSelected( sal_Int32 i, bool bSelected ); + void UpdateChecked( sal_Int32 i, bool bChecked ); + void UpdateAccessibleName( sal_Int32 i ); + void UpdateItemText( sal_Int32 i ); + + sal_Int32 GetChildCount(); + + css::uno::Reference< css::accessibility::XAccessible > GetChild( sal_Int32 i ); + css::uno::Reference< css::accessibility::XAccessible > GetChildAt( const css::awt::Point& rPoint ); + + void InsertChild( sal_Int32 i ); + void RemoveChild( sal_Int32 i ); + + virtual bool IsHighlighted(); + bool IsChildHighlighted(); + + virtual bool IsMenuHideDisabledEntries(); + + void SelectChild( sal_Int32 i ); + void DeSelectAll(); + bool IsChildSelected( sal_Int32 i ); + + virtual void Select(); + virtual void DeSelect(); + virtual void Click(); + virtual bool IsPopupMenuOpen(); + + DECL_LINK_TYPED( MenuEventListener, VclMenuEvent&, void ); + + void ProcessMenuEvent( const VclMenuEvent& rVclMenuEvent ); + + virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) = 0; + + // XComponent + virtual void SAL_CALL disposing() override; + +public: + OAccessibleMenuBaseComponent( Menu* pMenu ); + virtual ~OAccessibleMenuBaseComponent(); + + void SetStates(); + + // XInterface + DECLARE_XINTERFACE() + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XServiceInfo + virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessible + virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleContext + virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (css::uno::RuntimeException, std::exception) override; +}; + +#endif // INCLUDED_ACCESSIBILITY_INC_STANDARD_ACCESSIBLEMENUBASECOMPONENT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/standard/accessiblemenucomponent.hxx b/accessibility/inc/standard/accessiblemenucomponent.hxx new file mode 100644 index 000000000000..eb570e07a827 --- /dev/null +++ b/accessibility/inc/standard/accessiblemenucomponent.hxx @@ -0,0 +1,89 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_STANDARD_ACCESSIBLEMENUCOMPONENT_HXX +#define INCLUDED_ACCESSIBILITY_INC_STANDARD_ACCESSIBLEMENUCOMPONENT_HXX + +#include +#include +#include + + +// class OAccessibleMenuComponent + +typedef ::cppu::ImplHelper1< + css::accessibility::XAccessibleSelection > OAccessibleMenuComponent_BASE; + +class OAccessibleMenuComponent : public OAccessibleMenuBaseComponent, + public OAccessibleMenuComponent_BASE +{ +protected: + virtual bool IsEnabled() override; + virtual bool IsVisible() override; + + virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) override; + + // OCommonAccessibleComponent + virtual css::awt::Rectangle implGetBounds( ) throw (css::uno::RuntimeException) override; + +public: + OAccessibleMenuComponent( Menu* pMenu ); + virtual ~OAccessibleMenuComponent(); + + // XInterface + DECLARE_XINTERFACE() + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleDescription( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleName( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::lang::Locale SAL_CALL getLocale( ) throw (css::accessibility::IllegalAccessibleComponentStateException, css::uno::RuntimeException, std::exception) override; + + // XAccessibleComponent + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::awt::Point SAL_CALL getLocationOnScreen( ) throw (css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL grabFocus( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getForeground( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getBackground( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleExtendedComponent + virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getTitledBorderText( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getToolTipText( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleSelection + virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL clearAccessibleSelection( ) throw (css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL selectAllAccessibleChildren( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; +}; + +#endif // INCLUDED_ACCESSIBILITY_INC_STANDARD_ACCESSIBLEMENUCOMPONENT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/standard/accessiblemenuitemcomponent.hxx b/accessibility/inc/standard/accessiblemenuitemcomponent.hxx new file mode 100644 index 000000000000..84d0cc22e309 --- /dev/null +++ b/accessibility/inc/standard/accessiblemenuitemcomponent.hxx @@ -0,0 +1,90 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_STANDARD_ACCESSIBLEMENUITEMCOMPONENT_HXX +#define INCLUDED_ACCESSIBILITY_INC_STANDARD_ACCESSIBLEMENUITEMCOMPONENT_HXX + +#include + + +// class OAccessibleMenuItemComponent + + +class OAccessibleMenuItemComponent : public OAccessibleMenuBaseComponent +{ + friend class OAccessibleMenuBaseComponent; + +protected: + Menu* m_pParent; + sal_uInt16 m_nItemPos; + OUString m_sAccessibleName; + OUString m_sItemText; + + virtual bool IsEnabled() override; + virtual bool IsVisible() override; + virtual void Select() override; + virtual void DeSelect() override; + virtual void Click() override; + + void SetItemPos( sal_uInt16 nItemPos ); + void SetAccessibleName( const OUString& sAccessibleName ); + OUString GetAccessibleName(); + void SetItemText( const OUString& sItemText ); + OUString GetItemText(); + + virtual bool IsMenuHideDisabledEntries() override; + + virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) override; + + // OCommonAccessibleComponent + virtual css::awt::Rectangle implGetBounds( ) throw (css::uno::RuntimeException) override; + + // XComponent + virtual void SAL_CALL disposing() override; + +public: + OAccessibleMenuItemComponent( Menu* pParent, sal_uInt16 nItemPos, Menu* pMenu ); + virtual ~OAccessibleMenuItemComponent(); + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleDescription( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleName( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::lang::Locale SAL_CALL getLocale( ) throw (css::accessibility::IllegalAccessibleComponentStateException, css::uno::RuntimeException, std::exception) override; + + // XAccessibleComponent + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL grabFocus( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getForeground( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getBackground( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleExtendedComponent + virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getTitledBorderText( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getToolTipText( ) throw (css::uno::RuntimeException, std::exception) override; +}; + +#endif // INCLUDED_ACCESSIBILITY_INC_STANDARD_ACCESSIBLEMENUITEMCOMPONENT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/standard/vclxaccessiblebox.hxx b/accessibility/inc/standard/vclxaccessiblebox.hxx new file mode 100644 index 000000000000..1943f1e2ce21 --- /dev/null +++ b/accessibility/inc/standard/vclxaccessiblebox.hxx @@ -0,0 +1,185 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEBOX_HXX +#define INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEBOX_HXX + +#include +#include +#include +#include +#include +#include + + +typedef ::cppu::ImplHelper3< + css::accessibility::XAccessible, + css::accessibility::XAccessibleValue, + css::accessibility::XAccessibleAction + > VCLXAccessibleBox_BASE; + + +/** Base class for list- and combo boxes. This class manages the box' + children. The classed derived from this one have only to implement the + IsValid method and return the correct implementation name. +*/ +class VCLXAccessibleBox + : public VCLXAccessibleComponent, + public VCLXAccessibleBox_BASE +{ +public: + enum BoxType {COMBOBOX, LISTBOX}; + + /** The constructor is initialized with the box type which may be + either COMBOBOX or LISTBOX and a flag + indicating whether the box is a drop down box. + */ + VCLXAccessibleBox (VCLXWindow* pVCLXindow, BoxType aType, bool bIsDropDownBox); + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XInterface + DECLARE_XINTERFACE() + + + // XAccessible + + virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL + getAccessibleContext( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleContext + + /** Each object has one or two children: an optional text field and the + actual list. The text field is not provided for non drop down list + boxes. + */ + sal_Int32 SAL_CALL getAccessibleChildCount() + throw (css::uno::RuntimeException, std::exception) override; + /** For drop down list boxes the text field is a not editable + VCLXAccessibleTextField, for combo boxes it is an + editable VLCAccessibleEdit. + */ + css::uno::Reference< css::accessibility::XAccessible> SAL_CALL + getAccessibleChild (sal_Int32 i) + throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + /** The role is always AccessibleRole::COMBO_BOX. + */ + sal_Int16 SAL_CALL getAccessibleRole() + throw (css::uno::RuntimeException, std::exception) override; + + sal_Int32 SAL_CALL getAccessibleIndexInParent() + throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleAction + + /** There is one action for drop down boxes and none for others. + */ + virtual sal_Int32 SAL_CALL getAccessibleActionCount() + throw (css::uno::RuntimeException, std::exception) override; + /** The action for drop down boxes lets the user toggle the visibility of the + popup menu. + */ + virtual sal_Bool SAL_CALL doAccessibleAction (sal_Int32 nIndex) + throw (css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception) override; + /** The returned string is associated with resource + RID_STR_ACC_ACTION_TOGGLEPOPUP. + */ + virtual OUString SAL_CALL getAccessibleActionDescription (sal_Int32 nIndex) + throw (css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception) override; + /** No keybinding returned so far. + */ + virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL + getAccessibleActionKeyBinding( sal_Int32 nIndex ) + throw (css::lang::IndexOutOfBoundsException, + css::uno::RuntimeException, std::exception) override; + + // XComponent + + /** This method is called from the implementation helper during an + XComponent::dispose() call. + */ + virtual void SAL_CALL disposing() override; + + // XAccessibleValue + + virtual css::uno::Any SAL_CALL getCurrentValue( ) + throw (css::uno::RuntimeException, std::exception) override; + + virtual sal_Bool SAL_CALL setCurrentValue( + const css::uno::Any& aNumber ) + throw (css::uno::RuntimeException, std::exception) override; + + virtual css::uno::Any SAL_CALL getMaximumValue( ) + throw (css::uno::RuntimeException, std::exception) override; + + virtual css::uno::Any SAL_CALL getMinimumValue( ) + throw (css::uno::RuntimeException, std::exception) override; +protected: + /** Specifies whether the box is a combo box or a list box. List boxes + have multi selection. + */ + BoxType m_aBoxType; + + /// Specifies whether the box is a drop down box and thus has an action. + bool m_bIsDropDownBox; + + /// The child that represents the text field if there is one. + css::uno::Reference< css::accessibility::XAccessible> + m_xText; + + /// The child that contains the items of this box. + css::uno::Reference< css::accessibility::XAccessible> + m_xList; + + /** This flag specifies whether an object has a text field as child + regardless of whether that child being currently instantiated or + not. + */ + bool m_bHasTextChild; + + /** This flag specifies whether an object has a list as child regardless + of whether that child being currently instantiated or not. This + flag is always true in the current implementation because the list + child is just another wrapper around this object and thus has the + same life time. + */ + bool m_bHasListChild; + + virtual ~VCLXAccessibleBox(); + + /** Returns true when the object is valid. + */ + virtual bool IsValid() const = 0; + + virtual void ProcessWindowChildEvent (const VclWindowEvent& rVclWindowEvent) override; + virtual void ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent) override; + + virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) override; + +private: + /// Index in parent. This is settable from the outside. + sal_Int32 m_nIndexInParent; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/standard/vclxaccessiblebutton.hxx b/accessibility/inc/standard/vclxaccessiblebutton.hxx new file mode 100644 index 000000000000..e5f4a1280cf7 --- /dev/null +++ b/accessibility/inc/standard/vclxaccessiblebutton.hxx @@ -0,0 +1,78 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEBUTTON_HXX +#define INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEBUTTON_HXX + +#include + +#include +#include + +#include + + +// class VCLXAccessibleButton + + +typedef ::cppu::ImplHelper2< + css::accessibility::XAccessibleAction, + css::accessibility::XAccessibleValue > VCLXAccessibleButton_BASE; + +class VCLXAccessibleButton : public VCLXAccessibleTextComponent, + public VCLXAccessibleButton_BASE +{ +protected: + virtual ~VCLXAccessibleButton(); + + virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; + virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) override; + +public: + VCLXAccessibleButton( VCLXWindow* pVCLXindow ); + + // XInterface + DECLARE_XINTERFACE() + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleContext + virtual OUString SAL_CALL getAccessibleName( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleAction + virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL doAccessibleAction ( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + + // XAccessibleValue + virtual css::uno::Any SAL_CALL getCurrentValue( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL setCurrentValue( const css::uno::Any& aNumber ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Any SAL_CALL getMaximumValue( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Any SAL_CALL getMinimumValue( ) throw (css::uno::RuntimeException, std::exception) override; +}; + +#endif // INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEBUTTON_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/standard/vclxaccessiblecheckbox.hxx b/accessibility/inc/standard/vclxaccessiblecheckbox.hxx new file mode 100644 index 000000000000..ca406a2480f4 --- /dev/null +++ b/accessibility/inc/standard/vclxaccessiblecheckbox.hxx @@ -0,0 +1,85 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLECHECKBOX_HXX +#define INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLECHECKBOX_HXX + +#include + +#include +#include + +#include + + +// class VCLXAccessibleCheckBox + + +typedef ::cppu::ImplHelper2< + css::accessibility::XAccessibleAction, + css::accessibility::XAccessibleValue > VCLXAccessibleCheckBox_BASE; + +class VCLXAccessibleCheckBox : public VCLXAccessibleTextComponent, + public VCLXAccessibleCheckBox_BASE +{ +private: + bool m_bChecked; + bool m_bIndeterminate; + +protected: + virtual ~VCLXAccessibleCheckBox(); + + bool IsChecked(); + bool IsIndeterminate(); + + void SetChecked( bool bChecked ); + void SetIndeterminate( bool bIndeterminate ); + + virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; + virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) override; + +public: + VCLXAccessibleCheckBox( VCLXWindow* pVCLXindow ); + + // XInterface + DECLARE_XINTERFACE() + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleAction + virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL doAccessibleAction ( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + + // XAccessibleValue + virtual css::uno::Any SAL_CALL getCurrentValue( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL setCurrentValue( const css::uno::Any& aNumber ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Any SAL_CALL getMaximumValue( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Any SAL_CALL getMinimumValue( ) throw (css::uno::RuntimeException, std::exception) override; +}; + +#endif // INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLECHECKBOX_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/standard/vclxaccessiblecombobox.hxx b/accessibility/inc/standard/vclxaccessiblecombobox.hxx new file mode 100644 index 000000000000..4fd6bf829055 --- /dev/null +++ b/accessibility/inc/standard/vclxaccessiblecombobox.hxx @@ -0,0 +1,57 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLECOMBOBOX_HXX +#define INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLECOMBOBOX_HXX + +#include +#include +#include + + +/** The accessible combobox has two children. The first is the text field + represented by an object of the VCLXAccessibleEdit class. + The second is the list containing all items and is represented by an + object of the VCLXAccessibleList class which does not + support selection at the moment. +*/ +class VCLXAccessibleComboBox + : public VCLXAccessibleBox +{ +public: + VCLXAccessibleComboBox (VCLXWindow* pVCLXindow); + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() + throw (css::uno::RuntimeException, std::exception) override; + // Return combo box specific services. + virtual css::uno::Sequence< OUString > SAL_CALL + getSupportedServiceNames() + throw (css::uno::RuntimeException, std::exception) override; + +protected: + virtual ~VCLXAccessibleComboBox(); + + virtual bool IsValid() const override; + virtual void ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent) override; +}; + +#endif // INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLECOMBOBOX_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/standard/vclxaccessibledropdowncombobox.hxx b/accessibility/inc/standard/vclxaccessibledropdowncombobox.hxx new file mode 100644 index 000000000000..e6ae12834aa6 --- /dev/null +++ b/accessibility/inc/standard/vclxaccessibledropdowncombobox.hxx @@ -0,0 +1,56 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEDROPDOWNCOMBOBOX_HXX +#define INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEDROPDOWNCOMBOBOX_HXX + +#include +#include +#include + +/** The accessible drop down combobox has two children. The first is the + text field represented by an object of the + VCLXAccessibleEdit class. The second is the list + containing all items and is represented by an object of the + VCLXAccessibleList class which does not support selection + at the moment. +*/ +class VCLXAccessibleDropDownComboBox : public VCLXAccessibleBox +{ +public: + VCLXAccessibleDropDownComboBox (VCLXWindow* pVCLXindow); + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() + throw (css::uno::RuntimeException, std::exception) override; + // Return drop down combo box specific services. + virtual css::uno::Sequence< OUString > SAL_CALL + getSupportedServiceNames() + throw (css::uno::RuntimeException, std::exception) override; + +protected: + virtual ~VCLXAccessibleDropDownComboBox(); + + virtual bool IsValid() const override; + virtual void ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent) override; +}; + +#endif // INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEDROPDOWNCOMBOBOX_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/standard/vclxaccessibledropdownlistbox.hxx b/accessibility/inc/standard/vclxaccessibledropdownlistbox.hxx new file mode 100644 index 000000000000..f18945d3bdc3 --- /dev/null +++ b/accessibility/inc/standard/vclxaccessibledropdownlistbox.hxx @@ -0,0 +1,56 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEDROPDOWNLISTBOX_HXX +#define INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEDROPDOWNLISTBOX_HXX + +#include +#include + +/** The accessible drop down combobox has two children. The first is the + text field represented by an object of the + VCLXAccessibleTextField class which can not be edited. The + second is the list containing all items and is represented by an object + of the VCLXAccessibleListBoxList class which does support + selection. +*/ +class VCLXAccessibleDropDownListBox : public VCLXAccessibleBox +{ +public: + VCLXAccessibleDropDownListBox (VCLXWindow* pVCLXindow); + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() + throw (css::uno::RuntimeException, std::exception) override; + // Return drop down list box specific services. + virtual css::uno::Sequence< OUString > SAL_CALL + getSupportedServiceNames() + throw (css::uno::RuntimeException, std::exception) override; + +protected: + virtual ~VCLXAccessibleDropDownListBox(); + + virtual bool IsValid() const override; + virtual void ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent) override; + +}; + +#endif // INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEDROPDOWNLISTBOX_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/standard/vclxaccessibleedit.hxx b/accessibility/inc/standard/vclxaccessibleedit.hxx new file mode 100644 index 000000000000..429588f1bb78 --- /dev/null +++ b/accessibility/inc/standard/vclxaccessibleedit.hxx @@ -0,0 +1,111 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEEDIT_HXX +#define INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEEDIT_HXX + +#include +#include +#include + +#include + + +// class VCLXAccessibleEdit + + +typedef ::cppu::ImplHelper2< + css::accessibility::XAccessibleAction, + css::accessibility::XAccessibleEditableText > VCLXAccessibleEdit_BASE; + +class VCLXAccessibleEdit : public VCLXAccessibleTextComponent, + public VCLXAccessibleEdit_BASE +{ + friend class VCLXAccessibleBox; + +private: + sal_Int32 m_nSelectionStart; + sal_Int32 m_nCaretPosition; + +protected: + virtual ~VCLXAccessibleEdit(); + + virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; + virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) override; + + // OCommonAccessibleText + virtual OUString implGetText() override; + virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override; + +public: + VCLXAccessibleEdit( VCLXWindow* pVCLXindow ); + + // XInterface + DECLARE_XINTERFACE() + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleAction + virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL doAccessibleAction ( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + + // XAccessibleText + virtual sal_Int32 SAL_CALL getCaretPosition( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getCharacterCount( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getSelectedText( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getSelectionStart( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getSelectionEnd( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getText( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; + virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; + virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + + // XAccessibleEditableText + virtual sal_Bool SAL_CALL cutText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL pasteText( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL deleteText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL insertText( const OUString& sText, sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL replaceText( sal_Int32 nStartIndex, sal_Int32 nEndIndex, const OUString& sReplacement ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL setAttributes( sal_Int32 nStartIndex, sal_Int32 nEndIndex, const css::uno::Sequence< css::beans::PropertyValue >& aAttributeSet ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL setText( const OUString& sText ) throw (css::uno::RuntimeException, std::exception) override; +}; + +#endif // INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEEDIT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/standard/vclxaccessiblefixedhyperlink.hxx b/accessibility/inc/standard/vclxaccessiblefixedhyperlink.hxx new file mode 100644 index 000000000000..246988d26775 --- /dev/null +++ b/accessibility/inc/standard/vclxaccessiblefixedhyperlink.hxx @@ -0,0 +1,47 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEFIXEDHYPERLINK_HXX +#define INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEFIXEDHYPERLINK_HXX + +#include + + +// class VCLXAccessibleFixedHyperlink + + +class VCLXAccessibleFixedHyperlink : public VCLXAccessibleTextComponent +{ +protected: + virtual ~VCLXAccessibleFixedHyperlink(); + + virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) override; + virtual void implGetLineBoundary( css::i18n::Boundary& rBoundary, sal_Int32 nIndex ) override; + +public: + VCLXAccessibleFixedHyperlink( VCLXWindow* pVCLXindow ); + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; +}; + +#endif // INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEFIXEDHYPERLINK_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/standard/vclxaccessiblefixedtext.hxx b/accessibility/inc/standard/vclxaccessiblefixedtext.hxx new file mode 100644 index 000000000000..c5a52e9d430d --- /dev/null +++ b/accessibility/inc/standard/vclxaccessiblefixedtext.hxx @@ -0,0 +1,47 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEFIXEDTEXT_HXX +#define INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEFIXEDTEXT_HXX + +#include + + +// class VCLXAccessibleFixedText + + +class VCLXAccessibleFixedText : public VCLXAccessibleTextComponent +{ +protected: + virtual ~VCLXAccessibleFixedText(); + + virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) override; + virtual void implGetLineBoundary( css::i18n::Boundary& rBoundary, sal_Int32 nIndex ) override; + +public: + VCLXAccessibleFixedText( VCLXWindow* pVCLXindow ); + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; +}; + +#endif // INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEFIXEDTEXT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/standard/vclxaccessiblelist.hxx b/accessibility/inc/standard/vclxaccessiblelist.hxx new file mode 100644 index 000000000000..7476f8603fd3 --- /dev/null +++ b/accessibility/inc/standard/vclxaccessiblelist.hxx @@ -0,0 +1,210 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLELIST_HXX +#define INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLELIST_HXX + +#include +#include +#include "standard/vclxaccessiblelistitem.hxx" +#include +#include +#include +#include +#include +#include + +typedef ::cppu::ImplHelper2< + css::accessibility::XAccessible, + css::accessibility::XAccessibleSelection + > VCLXAccessibleList_BASE; + +typedef std::vector< css::uno::WeakReference< css::accessibility::XAccessible > > + ListItems; + +namespace accessibility +{ + class IComboListBoxHelper; +} + + +/** Base class for the list contained in list- and combo boxes. This class + does not support selection because lists of combo boxes give no direct + access to their underlying list implementation. Look into derived + classes for selection. +*/ +class VCLXAccessibleList + : public VCLXAccessibleComponent, + public VCLXAccessibleList_BASE +{ +public: + enum BoxType {COMBOBOX, LISTBOX}; + + VCLXAccessibleList (VCLXWindow* pVCLXindow, BoxType aBoxType, + const css::uno::Reference< + css::accessibility::XAccessible >& _xParent); + + /** The index that is passed to this method is returned on following + calls to getAccessibleIndexInParent. + */ + void SetIndexInParent (sal_Int32 nIndex); + + /** Process some of the events and delegate the rest to the base classes. + */ + virtual void ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent) override; + virtual void FillAccessibleRelationSet( utl::AccessibleRelationSetHelper& rRelationSet ) override; + + /** Called on reception of selection events this method checks all known + list items for a possible change in their selection state and + updates that accordingly. No accessibility events are send because + the XAccessibleSelection interface is not supported and the items + are transient. + @param sTextOfSelectedItem + This string contains the text of the currently selected + item. It is used to retrieve the index of that item. + */ + void UpdateSelection (const OUString& sTextOfSelectedItem); + + // XInterface + DECLARE_XINTERFACE() + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XAccessible + virtual css::uno::Reference< css::accessibility::XAccessibleContext> SAL_CALL + getAccessibleContext() + throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount() + throw (css::uno::RuntimeException, std::exception) override; + css::uno::Reference< css::accessibility::XAccessible> SAL_CALL + getAccessibleChild (sal_Int32 i) + throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL + getAccessibleParent( ) + throw (css::uno::RuntimeException, std::exception) override; + + /** The index returned as index in parent is always the one set with the + SetIndexInParent() method. + */ + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() + throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int16 SAL_CALL getAccessibleRole() + throw (css::uno::RuntimeException, std::exception) override; + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() + throw (css::uno::RuntimeException, std::exception) override; + // Return list specific services. + virtual css::uno::Sequence< OUString > SAL_CALL + getSupportedServiceNames() + throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleSelection + virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL clearAccessibleSelection( ) throw (css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL selectAllAccessibleChildren( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + + virtual css::awt::Point SAL_CALL getLocationOnScreen( ) throw (css::uno::RuntimeException, std::exception) override; + bool IsInDropDown(); + void HandleDropOpen(); + void ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent, bool b_IsDropDownList); + void UpdateSelection_Acc (const ::rtl::OUString& sTextOfSelectedItem, bool b_IsDropDownList); + void UpdateSelection_Impl_Acc (bool b_IsDropDownList); + + void UpdateFocus_Impl_Acc ( sal_Int32 nPos, bool b_IsDropDownList) ; + static void NotifyListItem(css::uno::Any& val); +protected: + BoxType m_aBoxType; + ::accessibility::IComboListBoxHelper* m_pListBoxHelper; + ListItems m_aAccessibleChildren; + sal_Int32 m_nVisibleLineCount; + /// Index in parent. This is settable from the outside. + sal_Int32 m_nIndexInParent; + sal_Int32 m_nLastTopEntry; + sal_Int32 m_nLastSelectedPos; + bool m_bDisableProcessEvent; + bool m_bVisible; + sal_Int32 m_nCurSelectedPos; + + + virtual ~VCLXAccessibleList(); + + /** This function is called from the implementation helper during a + XComponent::dispose call. Free the list of items and the items themselves. + */ + virtual void SAL_CALL disposing() override; + + /** This method adds the states + AccessibleStateType::FOCUSABLE and possibly + AccessibleStateType::MULTI_SELECTABLE to the state set + of the base classes. + */ + virtual void FillAccessibleStateSet (utl::AccessibleStateSetHelper& rStateSet) override; + + /** Create the specified child and insert it into the list of children. + Sets the child's states. + */ + css::uno::Reference< css::accessibility::XAccessible > + CreateChild (sal_Int32 i); + + /** Call this method when the item list has been changed, i.e. items + have been deleted or inserted. + @param bItemInserted + Indicate whether items have been inserted (TRUE) or removed (FALSE). + @param nIndex + Index of the new or removed item. A value of -1 indicates that + the whole list has been cleared. + */ + void HandleChangedItemList (bool bItemInserted, sal_Int32 nIndex); + + // VCLXAccessibleComponent + virtual css::awt::Rectangle implGetBounds( ) throw (css::uno::RuntimeException) override; + +private: + /** We need to save the accessible parent to return it in getAccessibleParent(), + because this method of the base class returns the wrong parent. + */ + css::uno::Reference< css::accessibility::XAccessible > m_xParent; + + + /** dispose all items aand clears the container + */ + void clearItems(); + + void UpdateEntryRange_Impl(); +protected: + void UpdateSelection_Impl(sal_Int32 nPos = 0); + bool checkEntrySelected(sal_Int32 _nPos, + css::uno::Any& _rNewValue, + css::uno::Reference< css::accessibility::XAccessible >& _rxNewAcc); +private: + void notifyVisibleStates(bool _bSetNew ); + void UpdateVisibleLineCount(); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/standard/vclxaccessiblelistbox.hxx b/accessibility/inc/standard/vclxaccessiblelistbox.hxx new file mode 100644 index 000000000000..22d24eec687f --- /dev/null +++ b/accessibility/inc/standard/vclxaccessiblelistbox.hxx @@ -0,0 +1,56 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLELISTBOX_HXX +#define INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLELISTBOX_HXX + +#include +#include +#include +#include + + +/** The accessible drop down combobox has one children. It is the list + containing all items and is represented by an object of the + VCLXAccessibleListBoxList class which does support + selection. +*/ +class VCLXAccessibleListBox : public VCLXAccessibleBox +{ +public: + VCLXAccessibleListBox (VCLXWindow* pVCLXindow); + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() + throw (css::uno::RuntimeException, std::exception) override; + // Return list box specific services. + virtual css::uno::Sequence< OUString > SAL_CALL + getSupportedServiceNames() + throw (css::uno::RuntimeException, std::exception) override; + +protected: + virtual ~VCLXAccessibleListBox(); + + virtual bool IsValid() const override; + virtual void ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent) override; +}; + +#endif // INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLELISTBOX_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/standard/vclxaccessiblelistitem.hxx b/accessibility/inc/standard/vclxaccessiblelistitem.hxx new file mode 100644 index 000000000000..1a1e2f958eae --- /dev/null +++ b/accessibility/inc/standard/vclxaccessiblelistitem.hxx @@ -0,0 +1,173 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLELISTITEM_HXX +#define INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLELISTITEM_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// forward --------------------------------------------------------------- + +namespace com { namespace sun { namespace star { namespace awt { + struct Point; + struct Rectangle; + struct Size; + class XFocusListener; +} } } } + +namespace accessibility +{ + class IComboListBoxHelper; +} + +// class VCLXAccessibleListItem ------------------------------------------ + +typedef ::cppu::WeakAggComponentImplHelper6< css::accessibility::XAccessible + , css::accessibility::XAccessibleContext + , css::accessibility::XAccessibleComponent + , css::accessibility::XAccessibleEventBroadcaster + , css::accessibility::XAccessibleText + , css::lang::XServiceInfo > VCLXAccessibleListItem_BASE; + +/** the class OAccessibleListBoxEntry represents the base class for an accessible object of a listbox entry +*/ +class VCLXAccessibleListItem : public ::comphelper::OBaseMutex, + public ::comphelper::OCommonAccessibleText, + public VCLXAccessibleListItem_BASE +{ +private: + OUString m_sEntryText; + sal_Int32 m_nIndexInParent; + bool m_bSelected; + bool m_bVisible; + +protected: + /// client id in the AccessibleEventNotifier queue + sal_uInt32 m_nClientId; + ::accessibility::IComboListBoxHelper* m_pListBoxHelper; + + css::uno::Reference< css::accessibility::XAccessible > m_xParent; + css::uno::Reference< css::accessibility::XAccessibleContext > m_xParentContext; + +protected: + virtual ~VCLXAccessibleListItem(); + /** this function is called upon disposing the component + */ + virtual void SAL_CALL disposing() override; + + // OCommonAccessibleText + virtual OUString implGetText() override; + virtual css::lang::Locale implGetLocale() override; + virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override; + +public: + /** OAccessibleBase needs a valid view + @param _pListBoxHelper + is the list- or combobox for which we implement an accessible object + @param _nIndexInParent + is the position of the entry inside the listbox + @param _xParent + is our parent accessible object + */ + VCLXAccessibleListItem( ::accessibility::IComboListBoxHelper* _pListBoxHelper, + sal_Int32 _nIndexInParent, + const css::uno::Reference< css::accessibility::XAccessible >& _xParent ); + + void NotifyAccessibleEvent( sal_Int16 _nEventId, const css::uno::Any& _aOldValue, const css::uno::Any& _aNewValue ); + + inline bool IsSelected() const { return m_bSelected; } + void SetSelected( bool _bSelected ); + void SetVisible( bool _bVisible ); + + // XInterface + virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) throw(css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL acquire( ) throw() override; + virtual void SAL_CALL release( ) throw() override; + + // XTypeProvider + virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (css::uno::RuntimeException, std::exception) override; + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; + + // XAccessible + virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleDescription( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleName( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::lang::Locale SAL_CALL getLocale( ) throw (css::accessibility::IllegalAccessibleComponentStateException, css::uno::RuntimeException, std::exception) override; + + // XAccessibleComponent + virtual sal_Bool SAL_CALL containsPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::awt::Rectangle SAL_CALL getBounds( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::awt::Point SAL_CALL getLocation( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::awt::Point SAL_CALL getLocationOnScreen( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::awt::Size SAL_CALL getSize( ) throw (css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL grabFocus( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getForeground() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getBackground() throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleText + virtual sal_Int32 SAL_CALL getCaretPosition() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getCharacterCount() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getSelectedText() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getSelectionStart() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getSelectionEnd() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getText() throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; + virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; + virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + + // XAccessibleEventBroadcaster + virtual void SAL_CALL addAccessibleEventListener( const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener ) throw (css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL removeAccessibleEventListener( const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener ) throw (css::uno::RuntimeException, std::exception) override; +}; + +#endif // ACCESSIBILITY_STANDARD_ACCESSIBLELISTBOXENTRY_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/standard/vclxaccessiblemenu.hxx b/accessibility/inc/standard/vclxaccessiblemenu.hxx new file mode 100644 index 000000000000..98ba4ec19eac --- /dev/null +++ b/accessibility/inc/standard/vclxaccessiblemenu.hxx @@ -0,0 +1,79 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEMENU_HXX +#define INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEMENU_HXX + +#include +#include + +#include + + +// class VCLXAccessibleMenu + + +typedef ::cppu::ImplHelper1 < + css::accessibility::XAccessibleSelection > VCLXAccessibleMenu_BASE; + +class VCLXAccessibleMenu : public VCLXAccessibleMenuItem, + public VCLXAccessibleMenu_BASE +{ +protected: + virtual bool IsFocused() override; + virtual bool IsPopupMenuOpen() override; + +public: + VCLXAccessibleMenu( Menu* pParent, sal_uInt16 nItemPos, Menu* pMenu ); + virtual ~VCLXAccessibleMenu(); + + // XInterface + DECLARE_XINTERFACE() + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleComponent + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleSelection + virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL clearAccessibleSelection( ) throw (css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL selectAllAccessibleChildren( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + + // XAccessibleAction + virtual ::rtl::OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; +}; + +#endif // INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEMENU_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/standard/vclxaccessiblemenubar.hxx b/accessibility/inc/standard/vclxaccessiblemenubar.hxx new file mode 100644 index 000000000000..9ea5c585ae28 --- /dev/null +++ b/accessibility/inc/standard/vclxaccessiblemenubar.hxx @@ -0,0 +1,66 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEMENUBAR_HXX +#define INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEMENUBAR_HXX + +#include +#include + +class VclSimpleEvent; +class VclWindowEvent; +namespace vcl { class Window; } + + +// class VCLXAccessibleMenuBar + + +class VCLXAccessibleMenuBar : public OAccessibleMenuComponent +{ +protected: + VclPtr m_pWindow; + + virtual bool IsFocused() override; + + DECL_LINK_TYPED( WindowEventListener, VclWindowEvent&, void ); + + void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); + + // XComponent + virtual void SAL_CALL disposing() override; + +public: + VCLXAccessibleMenuBar( Menu* pMenu ); + virtual ~VCLXAccessibleMenuBar(); + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleExtendedComponent + virtual sal_Int32 SAL_CALL getBackground( ) throw (css::uno::RuntimeException, std::exception) override; +}; + +#endif // INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEMENUBAR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/standard/vclxaccessiblemenuitem.hxx b/accessibility/inc/standard/vclxaccessiblemenuitem.hxx new file mode 100644 index 000000000000..df2249ab6d22 --- /dev/null +++ b/accessibility/inc/standard/vclxaccessiblemenuitem.hxx @@ -0,0 +1,109 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEMENUITEM_HXX +#define INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEMENUITEM_HXX + +#include + +#include +#include + +#include +#include + + +// class VCLXAccessibleMenuItem + + +typedef ::cppu::ImplHelper3< + css::accessibility::XAccessibleText, + css::accessibility::XAccessibleAction, + css::accessibility::XAccessibleValue > VCLXAccessibleMenuItem_BASE; + +class VCLXAccessibleMenuItem : public OAccessibleMenuItemComponent, + public ::comphelper::OCommonAccessibleText, + public VCLXAccessibleMenuItem_BASE +{ +protected: + virtual bool IsFocused() override; + virtual bool IsSelected() override; + virtual bool IsChecked() override; + + virtual bool IsHighlighted() override; + + virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) override; + + // OCommonAccessibleText + virtual OUString implGetText() override; + virtual css::lang::Locale implGetLocale() override; + virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override; + +public: + VCLXAccessibleMenuItem( Menu* pParent, sal_uInt16 nItemPos, Menu* pMenu = nullptr ); + virtual ~VCLXAccessibleMenuItem(); + + // XInterface + DECLARE_XINTERFACE() + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleContext + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleText + virtual sal_Int32 SAL_CALL getCaretPosition() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getCharacterCount() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getSelectedText() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getSelectionStart() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getSelectionEnd() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getText() throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; + virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; + virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + + // XAccessibleAction + virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL doAccessibleAction ( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + + // XAccessibleValue + virtual css::uno::Any SAL_CALL getCurrentValue( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL setCurrentValue( const css::uno::Any& aNumber ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Any SAL_CALL getMaximumValue( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Any SAL_CALL getMinimumValue( ) throw (css::uno::RuntimeException, std::exception) override; +}; + +#endif // INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEMENUITEM_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/standard/vclxaccessiblemenuseparator.hxx b/accessibility/inc/standard/vclxaccessiblemenuseparator.hxx new file mode 100644 index 000000000000..065740cc2691 --- /dev/null +++ b/accessibility/inc/standard/vclxaccessiblemenuseparator.hxx @@ -0,0 +1,46 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEMENUSEPARATOR_HXX +#define INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEMENUSEPARATOR_HXX + +#include + + +// class VCLXAccessibleMenuSeparator + + +class VCLXAccessibleMenuSeparator : public OAccessibleMenuItemComponent +{ +public: + VCLXAccessibleMenuSeparator( Menu* pParent, sal_uInt16 nItemPos, Menu* pMenu = nullptr ); + virtual ~VCLXAccessibleMenuSeparator(); + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleContext + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; +}; + + +#endif // INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEMENUSEPARATOR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/standard/vclxaccessiblepopupmenu.hxx b/accessibility/inc/standard/vclxaccessiblepopupmenu.hxx new file mode 100644 index 000000000000..bae088140c0a --- /dev/null +++ b/accessibility/inc/standard/vclxaccessiblepopupmenu.hxx @@ -0,0 +1,52 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEPOPUPMENU_HXX +#define INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEPOPUPMENU_HXX + +#include + + +// class VCLXAccessiblePopupMenu + + +class VCLXAccessiblePopupMenu : public OAccessibleMenuComponent +{ +protected: + virtual bool IsFocused() override; + +public: + VCLXAccessiblePopupMenu( Menu* pMenu ); + virtual ~VCLXAccessiblePopupMenu(); + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleExtendedComponent + virtual sal_Int32 SAL_CALL getBackground( ) throw (css::uno::RuntimeException, std::exception) override; +}; + +#endif // INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLEPOPUPMENU_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/standard/vclxaccessibleradiobutton.hxx b/accessibility/inc/standard/vclxaccessibleradiobutton.hxx new file mode 100644 index 000000000000..8a13c7eb116a --- /dev/null +++ b/accessibility/inc/standard/vclxaccessibleradiobutton.hxx @@ -0,0 +1,76 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLERADIOBUTTON_HXX +#define INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLERADIOBUTTON_HXX + +#include + +#include +#include + +#include + + +// class VCLXAccessibleRadioButton + + +typedef ::cppu::ImplHelper2< + css::accessibility::XAccessibleAction, + css::accessibility::XAccessibleValue > VCLXAccessibleRadioButton_BASE; + +class VCLXAccessibleRadioButton : public VCLXAccessibleTextComponent, + public VCLXAccessibleRadioButton_BASE +{ +protected: + virtual ~VCLXAccessibleRadioButton(); + + virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; + virtual void FillAccessibleRelationSet( utl::AccessibleRelationSetHelper& rRelationSet ) override; + virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) override; + +public: + VCLXAccessibleRadioButton( VCLXWindow* pVCLXindow ); + + // XInterface + DECLARE_XINTERFACE() + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleAction + virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL doAccessibleAction ( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + + // XAccessibleValue + virtual css::uno::Any SAL_CALL getCurrentValue( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL setCurrentValue( const css::uno::Any& aNumber ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Any SAL_CALL getMaximumValue( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Any SAL_CALL getMinimumValue( ) throw (css::uno::RuntimeException, std::exception) override; +}; + +#endif // INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLERADIOBUTTON_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/standard/vclxaccessiblescrollbar.hxx b/accessibility/inc/standard/vclxaccessiblescrollbar.hxx new file mode 100644 index 000000000000..40f51cceaa45 --- /dev/null +++ b/accessibility/inc/standard/vclxaccessiblescrollbar.hxx @@ -0,0 +1,79 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLESCROLLBAR_HXX +#define INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLESCROLLBAR_HXX + +#include + +#include +#include + +#include + + +// class VCLXAccessibleScrollBar + + +typedef ::cppu::ImplHelper2< + css::accessibility::XAccessibleAction, + css::accessibility::XAccessibleValue > VCLXAccessibleScrollBar_BASE; + +class VCLXAccessibleScrollBar : public VCLXAccessibleComponent, + public VCLXAccessibleScrollBar_BASE +{ +protected: + virtual ~VCLXAccessibleScrollBar(); + + virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; + virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) override; + +public: + VCLXAccessibleScrollBar( VCLXWindow* pVCLXindow ); + + // XInterface + DECLARE_XINTERFACE() + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleAction + virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL doAccessibleAction ( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + + // XAccessibleValue + virtual css::uno::Any SAL_CALL getCurrentValue( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL setCurrentValue( const css::uno::Any& aNumber ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Any SAL_CALL getMaximumValue( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Any SAL_CALL getMinimumValue( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleContext + ::rtl::OUString SAL_CALL getAccessibleName( ) throw (css::uno::RuntimeException, std::exception) override; + +}; + +#endif // INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLESCROLLBAR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/standard/vclxaccessiblestatusbar.hxx b/accessibility/inc/standard/vclxaccessiblestatusbar.hxx new file mode 100644 index 000000000000..24fd96e8ad58 --- /dev/null +++ b/accessibility/inc/standard/vclxaccessiblestatusbar.hxx @@ -0,0 +1,74 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLESTATUSBAR_HXX +#define INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLESTATUSBAR_HXX + +#include +#include + +#include + +class StatusBar; + + +// class VCLXAccessibleStatusBar + + +class VCLXAccessibleStatusBar : public VCLXAccessibleComponent +{ +private: + typedef ::std::vector< css::uno::Reference< css::accessibility::XAccessible > > AccessibleChildren; + + AccessibleChildren m_aAccessibleChildren; + VclPtr m_pStatusBar; + +protected: + void UpdateShowing( sal_Int32 i, bool bShowing ); + void UpdateItemName( sal_Int32 i ); + void UpdateItemText( sal_Int32 i ); + + void InsertChild( sal_Int32 i ); + void RemoveChild( sal_Int32 i ); + + virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; + + // XComponent + virtual void SAL_CALL disposing() override; + +public: + VCLXAccessibleStatusBar( VCLXWindow* pVCLXWindow ); + virtual ~VCLXAccessibleStatusBar(); + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + + // XAccessibleComponent + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; +}; + + +#endif // INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLESTATUSBAR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/standard/vclxaccessiblestatusbaritem.hxx b/accessibility/inc/standard/vclxaccessiblestatusbaritem.hxx new file mode 100644 index 000000000000..fb919df30207 --- /dev/null +++ b/accessibility/inc/standard/vclxaccessiblestatusbaritem.hxx @@ -0,0 +1,134 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLESTATUSBARITEM_HXX +#define INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLESTATUSBARITEM_HXX + +#include +#include +#include +#include +#include + +class StatusBar; +class VCLExternalSolarLock; + +namespace utl { +class AccessibleStateSetHelper; +} + + +// class VCLXAccessibleStatusBarItem + + +typedef ::comphelper::OAccessibleTextHelper AccessibleTextHelper_BASE; + +typedef ::cppu::ImplHelper2< + css::accessibility::XAccessible, + css::lang::XServiceInfo > VCLXAccessibleStatusBarItem_BASE; + +class VCLXAccessibleStatusBarItem : public AccessibleTextHelper_BASE, + public VCLXAccessibleStatusBarItem_BASE +{ + friend class VCLXAccessibleStatusBar; + +private: + VCLExternalSolarLock* m_pExternalLock; + VclPtr m_pStatusBar; + sal_uInt16 m_nItemId; + OUString m_sItemName; + OUString m_sItemText; + bool m_bShowing; + +protected: + bool IsShowing(); + void SetShowing( bool bShowing ); + void SetItemName( const OUString& sItemName ); + OUString GetItemName(); + void SetItemText( const OUString& sItemText ); + OUString GetItemText(); + sal_uInt16 GetItemId() const { return m_nItemId; } + + void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ); + + // OCommonAccessibleComponent + virtual css::awt::Rectangle implGetBounds( ) throw (css::uno::RuntimeException) override; + + // OCommonAccessibleText + virtual OUString implGetText() override; + virtual css::lang::Locale implGetLocale() override; + virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override; + + // XComponent + virtual void SAL_CALL disposing() override; + +public: + VCLXAccessibleStatusBarItem( StatusBar* pStatusBar, sal_uInt16 nItemId ); + virtual ~VCLXAccessibleStatusBarItem(); + + // XInterface + DECLARE_XINTERFACE() + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; + + // XAccessible + virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleDescription( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleName( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::lang::Locale SAL_CALL getLocale( ) throw (css::accessibility::IllegalAccessibleComponentStateException, css::uno::RuntimeException, std::exception) override; + + // XAccessibleComponent + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL grabFocus( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getForeground( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getBackground( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleExtendedComponent + virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getTitledBorderText( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getToolTipText( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleText + virtual sal_Int32 SAL_CALL getCaretPosition() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; +}; + +#endif // INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLESTATUSBARITEM_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/standard/vclxaccessibletabcontrol.hxx b/accessibility/inc/standard/vclxaccessibletabcontrol.hxx new file mode 100644 index 000000000000..d024176132f4 --- /dev/null +++ b/accessibility/inc/standard/vclxaccessibletabcontrol.hxx @@ -0,0 +1,96 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLETABCONTROL_HXX +#define INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLETABCONTROL_HXX + +#include +#include +#include + +#include + +class TabControl; + + +// class VCLXAccessibleTabControl + + +typedef ::cppu::ImplHelper1 < + css::accessibility::XAccessibleSelection > VCLXAccessibleTabControl_BASE; + +class VCLXAccessibleTabControl : public VCLXAccessibleComponent, + public VCLXAccessibleTabControl_BASE +{ +private: + typedef ::std::vector< css::uno::Reference< css::accessibility::XAccessible > > AccessibleChildren; + + AccessibleChildren m_aAccessibleChildren; + VclPtr m_pTabControl; + +protected: + void UpdateFocused(); + void UpdateSelected( sal_Int32 i, bool bSelected ); + void UpdatePageText( sal_Int32 i ); + void UpdateTabPage( sal_Int32 i, bool bNew ); + + void InsertChild( sal_Int32 i ); + void RemoveChild( sal_Int32 i ); + + virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; + virtual void ProcessWindowChildEvent( const VclWindowEvent& rVclWindowEvent ) override; + virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) override; + + // XComponent + virtual void SAL_CALL disposing() override; + +public: + VCLXAccessibleTabControl( VCLXWindow* pVCLXWindow ); + virtual ~VCLXAccessibleTabControl(); + + // XInterface + DECLARE_XINTERFACE() + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleName( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleSelection + virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL clearAccessibleSelection( ) throw (css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL selectAllAccessibleChildren( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; +}; + + +#endif // INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLETABCONTROL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/standard/vclxaccessibletabpage.hxx b/accessibility/inc/standard/vclxaccessibletabpage.hxx new file mode 100644 index 000000000000..4ea0d272a2cb --- /dev/null +++ b/accessibility/inc/standard/vclxaccessibletabpage.hxx @@ -0,0 +1,139 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLETABPAGE_HXX +#define INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLETABPAGE_HXX + +#include +#include +#include +#include +#include + + +class TabControl; +class VCLExternalSolarLock; + +namespace utl { +class AccessibleStateSetHelper; +} + + +// class VCLXAccessibleTabPage + + +typedef ::comphelper::OAccessibleTextHelper AccessibleTextHelper_BASE; + +typedef ::cppu::ImplHelper2< + css::accessibility::XAccessible, + css::lang::XServiceInfo > VCLXAccessibleTabPage_BASE; + +class VCLXAccessibleTabPage : public AccessibleTextHelper_BASE, + public VCLXAccessibleTabPage_BASE +{ + friend class VCLXAccessibleTabControl; + +private: + VCLExternalSolarLock* m_pExternalLock; + VclPtr m_pTabControl; + sal_uInt16 m_nPageId; + bool m_bFocused; + bool m_bSelected; + OUString m_sPageText; + +protected: + bool IsFocused(); + bool IsSelected(); + + void SetFocused( bool bFocused ); + void SetSelected( bool bSelected ); + void SetPageText( const OUString& sPageText ); + OUString GetPageText(); + + void Update( bool bNew ); + + sal_uInt16 GetPageId() const { return m_nPageId; } + + void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ); + + // OCommonAccessibleComponent + virtual css::awt::Rectangle implGetBounds( ) throw (css::uno::RuntimeException) override; + + // OCommonAccessibleText + virtual OUString implGetText() override; + virtual css::lang::Locale implGetLocale() override; + virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override; + + // XComponent + virtual void SAL_CALL disposing() override; + +public: + VCLXAccessibleTabPage( TabControl* pTabControl, sal_uInt16 nPageId ); + virtual ~VCLXAccessibleTabPage(); + + // XInterface + DECLARE_XINTERFACE() + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; + + // XAccessible + virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleDescription( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleName( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::lang::Locale SAL_CALL getLocale( ) throw (css::accessibility::IllegalAccessibleComponentStateException, css::uno::RuntimeException, std::exception) override; + + // XAccessibleComponent + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL grabFocus( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getForeground( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getBackground( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleExtendedComponent + virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getTitledBorderText( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getToolTipText( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleText + virtual sal_Int32 SAL_CALL getCaretPosition() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; +}; + +#endif // INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLETABPAGE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/standard/vclxaccessibletabpagewindow.hxx b/accessibility/inc/standard/vclxaccessibletabpagewindow.hxx new file mode 100644 index 000000000000..b485f081173f --- /dev/null +++ b/accessibility/inc/standard/vclxaccessibletabpagewindow.hxx @@ -0,0 +1,60 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLETABPAGEWINDOW_HXX +#define INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLETABPAGEWINDOW_HXX + +#include +#include + + +class TabControl; +class TabPage; + + +// class VCLXAccessibleTabPageWindow + + +class VCLXAccessibleTabPageWindow : public VCLXAccessibleComponent +{ +private: + VclPtr m_pTabControl; + VclPtr m_pTabPage; + sal_uInt16 m_nPageId; + +protected: + // OCommonAccessibleComponent + virtual css::awt::Rectangle implGetBounds( ) throw (css::uno::RuntimeException) override; + + // XComponent + virtual void SAL_CALL disposing() override; + +public: + VCLXAccessibleTabPageWindow( VCLXWindow* pVCLXWindow ); + virtual ~VCLXAccessibleTabPageWindow(); + + // XAccessibleContext + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (css::uno::RuntimeException, std::exception) override; +}; + + +#endif // INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLETABPAGEWINDOW_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/standard/vclxaccessibletextcomponent.hxx b/accessibility/inc/standard/vclxaccessibletextcomponent.hxx new file mode 100644 index 000000000000..24cc9c34a3cb --- /dev/null +++ b/accessibility/inc/standard/vclxaccessibletextcomponent.hxx @@ -0,0 +1,85 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLETEXTCOMPONENT_HXX +#define INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLETEXTCOMPONENT_HXX + +#include +#include + + +// class VCLXAccessibleTextComponent + + +typedef ::cppu::ImplHelper1 < + css::accessibility::XAccessibleText > VCLXAccessibleTextComponent_BASE; + +class VCLXAccessibleTextComponent : public VCLXAccessibleComponent, + public ::comphelper::OCommonAccessibleText, + public VCLXAccessibleTextComponent_BASE +{ +protected: + OUString m_sText; + + void SetText( const OUString& sText ); + + virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; + + // OCommonAccessibleText + virtual OUString implGetText() override; + virtual css::lang::Locale implGetLocale() override; + virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override; + + // XComponent + virtual void SAL_CALL disposing() override; + +public: + VCLXAccessibleTextComponent( VCLXWindow* pVCLXWindow ); + virtual ~VCLXAccessibleTextComponent(); + + // XInterface + DECLARE_XINTERFACE() + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XAccessibleText + virtual sal_Int32 SAL_CALL getCaretPosition() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getCharacterCount() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getSelectedText() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getSelectionStart() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getSelectionEnd() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getText() throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; + virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; + virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (css::lang::IndexOutOfBoundsException, css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; +}; + + +#endif // INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLETEXTCOMPONENT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/standard/vclxaccessibletextfield.hxx b/accessibility/inc/standard/vclxaccessibletextfield.hxx new file mode 100644 index 000000000000..d71b7c275e96 --- /dev/null +++ b/accessibility/inc/standard/vclxaccessibletextfield.hxx @@ -0,0 +1,92 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLETEXTFIELD_HXX +#define INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLETEXTFIELD_HXX + +#include + +#include + +typedef ::cppu::ImplHelper1< css::accessibility::XAccessible > VCLXAccessible_BASE; + + +/** This class represents non editable text fields. The object passed to + the constructor is expected to be a list (a ListBox to be + more specific). From this always the selected item is token to be made + accessible by this class. When the selected item changes then also the + exported text changes. +*/ +class VCLXAccessibleTextField : + public VCLXAccessibleTextComponent, + public VCLXAccessible_BASE +{ +public: + VCLXAccessibleTextField (VCLXWindow* pVCLXindow, + const css::uno::Reference< css::accessibility::XAccessible >& _xParent); + + // XInterface + DECLARE_XINTERFACE() + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XAccessible + css::uno::Reference< css::accessibility::XAccessibleContext> SAL_CALL + getAccessibleContext() + throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleContext + sal_Int32 SAL_CALL getAccessibleChildCount() + throw (css::uno::RuntimeException, std::exception) override; + css::uno::Reference< css::accessibility::XAccessible> SAL_CALL + getAccessibleChild (sal_Int32 i) + throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + sal_Int16 SAL_CALL getAccessibleRole() + throw (css::uno::RuntimeException, std::exception) override; + css::uno::Reference< css::accessibility::XAccessible > SAL_CALL + getAccessibleParent( ) + throw (css::uno::RuntimeException, std::exception) override; + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() + throw (css::uno::RuntimeException, std::exception) override; + // Return text field specific services. + virtual css::uno::Sequence< OUString > SAL_CALL + getSupportedServiceNames() + throw (css::uno::RuntimeException, std::exception) override; + +protected: + virtual ~VCLXAccessibleTextField(); + + /** With this method the text of the currently selected item is made + available to the VCLXAccessibleTextComponent base class. + */ + OUString implGetText() override; + +private: + /** We need to save the accessible parent to return it in getAccessibleParent(), + because this method of the base class returns the wrong parent. + */ + css::uno::Reference< css::accessibility::XAccessible > m_xParent; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/standard/vclxaccessibletoolbox.hxx b/accessibility/inc/standard/vclxaccessibletoolbox.hxx new file mode 100644 index 000000000000..63dfa107829a --- /dev/null +++ b/accessibility/inc/standard/vclxaccessibletoolbox.hxx @@ -0,0 +1,105 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLETOOLBOX_HXX +#define INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLETOOLBOX_HXX + +#include +#include +#include + + +// class VCLXAccessibleToolBox + + +typedef ::cppu::ImplHelper1 < css::accessibility::XAccessibleSelection > VCLXAccessibleToolBox_BASE; + +typedef std::map< sal_Int32, css::uno::Reference< css::accessibility::XAccessible > > ToolBoxItemsMap; + +class VCLXAccessibleToolBoxItem; +class ToolBox; + +class VCLXAccessibleToolBox : public VCLXAccessibleComponent, public VCLXAccessibleToolBox_BASE +{ +private: + ToolBoxItemsMap m_aAccessibleChildren; + + VCLXAccessibleToolBoxItem* GetItem_Impl( sal_Int32 _nPos ); + + void UpdateFocus_Impl(); + void ReleaseFocus_Impl( sal_Int32 _nPos ); + void UpdateChecked_Impl( sal_Int32 _nPos ); + void UpdateIndeterminate_Impl( sal_Int32 _nPos ); + void UpdateItem_Impl( sal_Int32 _nPos ); + void UpdateAllItems_Impl(); + void UpdateItemName_Impl( sal_Int32 _nPos ); + void UpdateItemEnabled_Impl( sal_Int32 _nPos ); + void UpdateCustomPopupItemp_Impl( vcl::Window* pWindow, bool bOpen ); + void HandleSubToolBarEvent( const VclWindowEvent& rVclWindowEvent ); + void ReleaseSubToolBox( ToolBox* _pSubToolBox ); + +protected: + virtual ~VCLXAccessibleToolBox(); + + virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) override; + virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) override; + virtual void ProcessWindowChildEvent( const VclWindowEvent& rVclWindowEvent ) override; + + virtual css::uno::Reference< css::accessibility::XAccessible > GetChildAccessible( const VclWindowEvent& rVclWindowEvent ) override; + css::uno::Reference< css::accessibility::XAccessible > GetItemWindowAccessible( const VclWindowEvent& rVclWindowEvent ); + + // XComponent + virtual void SAL_CALL disposing() override; + +public: + VCLXAccessibleToolBox( VCLXWindow* pVCLXWindow ); + + // XInterface + DECLARE_XINTERFACE( ) + + // XTypeProvider + DECLARE_XTYPEPROVIDER( ) + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleSelection + virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL clearAccessibleSelection( ) throw (css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL selectAllAccessibleChildren( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nChildIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + +private: + void implReleaseToolboxItem( + ToolBoxItemsMap::iterator& _rMapPos, + bool _bNotifyRemoval + ); +}; + +#endif // INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLETOOLBOX_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/inc/standard/vclxaccessibletoolboxitem.hxx b/accessibility/inc/standard/vclxaccessibletoolboxitem.hxx new file mode 100644 index 000000000000..3411640637c7 --- /dev/null +++ b/accessibility/inc/standard/vclxaccessibletoolboxitem.hxx @@ -0,0 +1,154 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLETOOLBOXITEM_HXX +#define INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLETOOLBOXITEM_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class ToolBox; + +typedef ::comphelper::OAccessibleTextHelper AccessibleTextHelper_BASE; +typedef ::cppu::ImplHelper4 < css::accessibility::XAccessible, + css::accessibility::XAccessibleAction, + css::accessibility::XAccessibleValue, + css::lang::XServiceInfo > VCLXAccessibleToolBoxItem_BASE; + +class VCLExternalSolarLock; + +class VCLXAccessibleToolBoxItem : public AccessibleTextHelper_BASE, + public VCLXAccessibleToolBoxItem_BASE +{ +private: + OUString m_sOldName; + VclPtr m_pToolBox; + VCLExternalSolarLock* m_pExternalLock; + sal_Int32 m_nIndexInParent; + sal_Int16 m_nRole; + sal_uInt16 m_nItemId; + bool m_bHasFocus; + bool m_bIsChecked; + bool m_bIndeterminate; + + css::uno::Reference< css::accessibility::XAccessible > m_xChild; + +public: + inline sal_Int32 getIndexInParent() const { return m_nIndexInParent; } + inline void setIndexInParent( sal_Int32 _nNewIndex ) { m_nIndexInParent = _nNewIndex; } + +protected: + virtual ~VCLXAccessibleToolBoxItem(); + + virtual void SAL_CALL disposing() override; + + /// implements the calculation of the bounding rectangle + virtual css::awt::Rectangle implGetBounds( ) throw (css::uno::RuntimeException) override; + + // OCommonAccessibleText + virtual OUString implGetText() override; + virtual css::lang::Locale implGetLocale() override; + virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) override; + + OUString GetText(); + +public: + VCLXAccessibleToolBoxItem( ToolBox* _pToolBox, sal_Int32 _nPos ); + + void SetFocus( bool _bFocus ); + inline bool HasFocus() const { return m_bHasFocus; } + void SetChecked( bool _bCheck ); + void SetIndeterminate( bool _bIndeterminate ); + inline void ReleaseToolBox() { m_pToolBox = nullptr; } + void NameChanged(); + void SetChild( const css::uno::Reference< css::accessibility::XAccessible >& _xChild ); + const css::uno::Reference< css::accessibility::XAccessible >& + GetChild() const { return m_xChild; } + void NotifyChildEvent( const css::uno::Reference< css::accessibility::XAccessible >& _xChild, bool _bShow ); + + void ToggleEnableState(); + + // XInterface + DECLARE_XINTERFACE( ) + DECLARE_XTYPEPROVIDER( ) + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception) override; + + // XAccessible + virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleDescription( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleName( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleText + virtual sal_Int32 SAL_CALL getCaretPosition() throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + + // XAccessibleComponent + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) throw (css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL grabFocus( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getForeground( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Int32 SAL_CALL getBackground( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleExtendedComponent + virtual css::uno::Reference< css::awt::XFont > SAL_CALL getFont( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getTitledBorderText( ) throw (css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getToolTipText( ) throw (css::uno::RuntimeException, std::exception) override; + + // XAccessibleAction + virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL doAccessibleAction ( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override; + + // XAccessibleValue + virtual css::uno::Any SAL_CALL getCurrentValue( ) throw (css::uno::RuntimeException, std::exception) override; + virtual sal_Bool SAL_CALL setCurrentValue( const css::uno::Any& aNumber ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Any SAL_CALL getMaximumValue( ) throw (css::uno::RuntimeException, std::exception) override; + virtual css::uno::Any SAL_CALL getMinimumValue( ) throw (css::uno::RuntimeException, std::exception) override; +}; + +#endif // INCLUDED_ACCESSIBILITY_INC_STANDARD_VCLXACCESSIBLETOOLBOXITEM_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/accessibility/source/extended/AccessibleBrowseBox.cxx b/accessibility/source/extended/AccessibleBrowseBox.cxx index c1edec8deddc..70b7c1702c24 100644 --- a/accessibility/source/extended/AccessibleBrowseBox.cxx +++ b/accessibility/source/extended/AccessibleBrowseBox.cxx @@ -17,9 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "accessibility/extended/AccessibleBrowseBox.hxx" -#include "accessibility/extended/AccessibleBrowseBoxTable.hxx" -#include "accessibility/extended/AccessibleBrowseBoxHeaderBar.hxx" +#include "extended/AccessibleBrowseBox.hxx" +#include "extended/AccessibleBrowseBoxTable.hxx" +#include "extended/AccessibleBrowseBoxHeaderBar.hxx" #include #include #include @@ -72,7 +72,7 @@ void AccessibleBrowseBox::setCreator( const css::uno::Reference< css::accessibil { #if OSL_DEBUG_LEVEL > 0 css::uno::Reference< css::accessibility::XAccessible > xCreator(m_xImpl->m_aCreator); - OSL_ENSURE( !xCreator.is(), "accessibility/extended/AccessibleBrowseBox::setCreator: creator already set!" ); + OSL_ENSURE( !xCreator.is(), "extended/AccessibleBrowseBox::setCreator: creator already set!" ); #endif m_xImpl->m_aCreator = _rxCreator; } @@ -281,7 +281,7 @@ AccessibleBrowseBox::implGetFixedChild( sal_Int32 nChildIndex ) AccessibleBrowseBoxTable* AccessibleBrowseBox::createAccessibleTable() { css::uno::Reference< css::accessibility::XAccessible > xCreator(m_xImpl->m_aCreator); - OSL_ENSURE( xCreator.is(), "accessibility/extended/AccessibleBrowseBox::createAccessibleTable: my creator died - how this?" ); + OSL_ENSURE( xCreator.is(), "extended/AccessibleBrowseBox::createAccessibleTable: my creator died - how this?" ); return new AccessibleBrowseBoxTable( xCreator, *mpBrowseBox ); } @@ -333,7 +333,7 @@ css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL Accessibl ::osl::MutexGuard aGuard( m_aMutex ); OSL_ENSURE( ( m_pContext && m_xContext.is() ) || ( !m_pContext && !m_xContext.is() ), - "accessibility/extended/AccessibleBrowseBoxAccess::getAccessibleContext: inconsistency!" ); + "extended/AccessibleBrowseBoxAccess::getAccessibleContext: inconsistency!" ); // if the context died meanwhile (there is no listener, so it won't tell us explicitily when this happens), // then reset and re-create. diff --git a/accessibility/source/extended/AccessibleBrowseBoxBase.cxx b/accessibility/source/extended/AccessibleBrowseBoxBase.cxx index 3387cbb91e30..1ff3c7558e26 100644 --- a/accessibility/source/extended/AccessibleBrowseBoxBase.cxx +++ b/accessibility/source/extended/AccessibleBrowseBoxBase.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "accessibility/extended/AccessibleBrowseBoxBase.hxx" +#include "extended/AccessibleBrowseBoxBase.hxx" #include #include #include diff --git a/accessibility/source/extended/AccessibleBrowseBoxCheckBoxCell.cxx b/accessibility/source/extended/AccessibleBrowseBoxCheckBoxCell.cxx index cd805ae9d5fe..da37ca0baf0a 100644 --- a/accessibility/source/extended/AccessibleBrowseBoxCheckBoxCell.cxx +++ b/accessibility/source/extended/AccessibleBrowseBoxCheckBoxCell.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include diff --git a/accessibility/source/extended/AccessibleBrowseBoxHeaderBar.cxx b/accessibility/source/extended/AccessibleBrowseBoxHeaderBar.cxx index 07225c233181..7cdefc5274a3 100644 --- a/accessibility/source/extended/AccessibleBrowseBoxHeaderBar.cxx +++ b/accessibility/source/extended/AccessibleBrowseBoxHeaderBar.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "accessibility/extended/AccessibleBrowseBoxHeaderBar.hxx" +#include "extended/AccessibleBrowseBoxHeaderBar.hxx" #include #include @@ -43,7 +43,7 @@ AccessibleBrowseBoxHeaderBar::AccessibleBrowseBoxHeaderBar( AccessibleBrowseBoxTableBase( rxParent, rBrowseBox,eObjType ) { OSL_ENSURE( isRowBar() || isColumnBar(), - "accessibility/extended/AccessibleBrowseBoxHeaderBar - invalid object type" ); + "extended/AccessibleBrowseBoxHeaderBar - invalid object type" ); } AccessibleBrowseBoxHeaderBar::~AccessibleBrowseBoxHeaderBar() diff --git a/accessibility/source/extended/AccessibleBrowseBoxHeaderCell.cxx b/accessibility/source/extended/AccessibleBrowseBoxHeaderCell.cxx index c7332aafbea2..c40b79885200 100644 --- a/accessibility/source/extended/AccessibleBrowseBoxHeaderCell.cxx +++ b/accessibility/source/extended/AccessibleBrowseBoxHeaderCell.cxx @@ -18,9 +18,9 @@ */ -#include "accessibility/extended/AccessibleBrowseBoxHeaderCell.hxx" +#include "extended/AccessibleBrowseBoxHeaderCell.hxx" #include -#include "accessibility/extended/AccessibleBrowseBox.hxx" +#include "extended/AccessibleBrowseBox.hxx" namespace accessibility { diff --git a/accessibility/source/extended/AccessibleBrowseBoxTable.cxx b/accessibility/source/extended/AccessibleBrowseBoxTable.cxx index f8ba7101202e..4123dd8b0cc9 100644 --- a/accessibility/source/extended/AccessibleBrowseBoxTable.cxx +++ b/accessibility/source/extended/AccessibleBrowseBoxTable.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "accessibility/extended/AccessibleBrowseBoxTable.hxx" +#include "extended/AccessibleBrowseBoxTable.hxx" #include diff --git a/accessibility/source/extended/AccessibleBrowseBoxTableBase.cxx b/accessibility/source/extended/AccessibleBrowseBoxTableBase.cxx index 43faaca52cdc..0abc93ba7719 100644 --- a/accessibility/source/extended/AccessibleBrowseBoxTableBase.cxx +++ b/accessibility/source/extended/AccessibleBrowseBoxTableBase.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "accessibility/extended/AccessibleBrowseBoxTableBase.hxx" +#include "extended/AccessibleBrowseBoxTableBase.hxx" #include #include #include diff --git a/accessibility/source/extended/AccessibleBrowseBoxTableCell.cxx b/accessibility/source/extended/AccessibleBrowseBoxTableCell.cxx index bcfe90550771..a8b5a5377184 100644 --- a/accessibility/source/extended/AccessibleBrowseBoxTableCell.cxx +++ b/accessibility/source/extended/AccessibleBrowseBoxTableCell.cxx @@ -18,7 +18,7 @@ */ -#include "accessibility/extended/AccessibleBrowseBoxTableCell.hxx" +#include "extended/AccessibleBrowseBoxTableCell.hxx" #include #include #include diff --git a/accessibility/source/extended/AccessibleGridControl.cxx b/accessibility/source/extended/AccessibleGridControl.cxx index 5c32dcf0ac5a..d647bc8b0e4f 100644 --- a/accessibility/source/extended/AccessibleGridControl.cxx +++ b/accessibility/source/extended/AccessibleGridControl.cxx @@ -17,9 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "accessibility/extended/AccessibleGridControl.hxx" -#include "accessibility/extended/AccessibleGridControlTable.hxx" -#include "accessibility/extended/AccessibleGridControlHeader.hxx" +#include "extended/AccessibleGridControl.hxx" +#include "extended/AccessibleGridControlTable.hxx" +#include "extended/AccessibleGridControlHeader.hxx" #include #include #include @@ -305,7 +305,7 @@ AccessibleGridControl::implGetFixedChild( sal_Int32 nChildIndex ) AccessibleGridControlTable* AccessibleGridControl::createAccessibleTable() { css::uno::Reference< css::accessibility::XAccessible > xCreator(m_xImpl->m_aCreator); - OSL_ENSURE( xCreator.is(), "accessibility/extended/AccessibleGridControl::createAccessibleTable: my creator died - how this?" ); + OSL_ENSURE( xCreator.is(), "extended/AccessibleGridControl::createAccessibleTable: my creator died - how this?" ); return new AccessibleGridControlTable( xCreator, m_aTable, TCTYPE_TABLE ); } @@ -418,7 +418,7 @@ css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL Accessibl SolarMutexGuard g; OSL_ENSURE( ( m_pContext && m_xContext.is() ) || ( !m_pContext && !m_xContext.is() ), - "accessibility/extended/AccessibleGridControlAccess::getAccessibleContext: inconsistency!" ); + "extended/AccessibleGridControlAccess::getAccessibleContext: inconsistency!" ); // if the context died meanwhile (we're no listener, so it won't tell us explicitily when this happens), // then reset an re-create. diff --git a/accessibility/source/extended/AccessibleGridControlBase.cxx b/accessibility/source/extended/AccessibleGridControlBase.cxx index 3f858f6968ae..088d56fcd432 100644 --- a/accessibility/source/extended/AccessibleGridControlBase.cxx +++ b/accessibility/source/extended/AccessibleGridControlBase.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include #include diff --git a/accessibility/source/extended/AccessibleGridControlHeader.cxx b/accessibility/source/extended/AccessibleGridControlHeader.cxx index dd34536640fd..c8d5c5551f2f 100644 --- a/accessibility/source/extended/AccessibleGridControlHeader.cxx +++ b/accessibility/source/extended/AccessibleGridControlHeader.cxx @@ -17,9 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "accessibility/extended/AccessibleGridControlHeader.hxx" -#include "accessibility/extended/AccessibleGridControlHeaderCell.hxx" -#include "accessibility/extended/AccessibleGridControlTableCell.hxx" +#include "extended/AccessibleGridControlHeader.hxx" +#include "extended/AccessibleGridControlHeaderCell.hxx" +#include "extended/AccessibleGridControlTableCell.hxx" #include #include @@ -45,7 +45,7 @@ AccessibleGridControlHeader::AccessibleGridControlHeader( AccessibleGridControlTableBase( rxParent, rTable, eObjType ) { OSL_ENSURE( isRowBar() || isColumnBar(), - "accessibility/extended/AccessibleGridControlHeaderBar - invalid object type" ); + "extended/AccessibleGridControlHeaderBar - invalid object type" ); } AccessibleGridControlHeader::~AccessibleGridControlHeader() diff --git a/accessibility/source/extended/AccessibleGridControlHeaderCell.cxx b/accessibility/source/extended/AccessibleGridControlHeaderCell.cxx index 0ce82c76adaa..8d9825936692 100644 --- a/accessibility/source/extended/AccessibleGridControlHeaderCell.cxx +++ b/accessibility/source/extended/AccessibleGridControlHeaderCell.cxx @@ -18,9 +18,9 @@ */ -#include "accessibility/extended/AccessibleGridControlHeaderCell.hxx" +#include "extended/AccessibleGridControlHeaderCell.hxx" #include -#include "accessibility/extended/AccessibleGridControl.hxx" +#include "extended/AccessibleGridControl.hxx" namespace accessibility { diff --git a/accessibility/source/extended/AccessibleGridControlTable.cxx b/accessibility/source/extended/AccessibleGridControlTable.cxx index faff58d6018e..bdf7ea23cfc0 100644 --- a/accessibility/source/extended/AccessibleGridControlTable.cxx +++ b/accessibility/source/extended/AccessibleGridControlTable.cxx @@ -17,8 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "accessibility/extended/AccessibleGridControlTable.hxx" -#include "accessibility/extended/AccessibleGridControlTableCell.hxx" +#include "extended/AccessibleGridControlTable.hxx" +#include "extended/AccessibleGridControlTableCell.hxx" #include diff --git a/accessibility/source/extended/AccessibleGridControlTableBase.cxx b/accessibility/source/extended/AccessibleGridControlTableBase.cxx index a226b6e9c9ff..a98e1f58b9c4 100644 --- a/accessibility/source/extended/AccessibleGridControlTableBase.cxx +++ b/accessibility/source/extended/AccessibleGridControlTableBase.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "accessibility/extended/AccessibleGridControlTableBase.hxx" +#include "extended/AccessibleGridControlTableBase.hxx" #include #include #include diff --git a/accessibility/source/extended/AccessibleGridControlTableCell.cxx b/accessibility/source/extended/AccessibleGridControlTableCell.cxx index b2ca0eefd176..85bd0022fe49 100644 --- a/accessibility/source/extended/AccessibleGridControlTableCell.cxx +++ b/accessibility/source/extended/AccessibleGridControlTableCell.cxx @@ -18,7 +18,7 @@ */ -#include "accessibility/extended/AccessibleGridControlTableCell.hxx" +#include "extended/AccessibleGridControlTableCell.hxx" #include #include #include diff --git a/accessibility/source/extended/accessiblebrowseboxcell.cxx b/accessibility/source/extended/accessiblebrowseboxcell.cxx index e454f5a4372a..feaa074f214b 100644 --- a/accessibility/source/extended/accessiblebrowseboxcell.cxx +++ b/accessibility/source/extended/accessiblebrowseboxcell.cxx @@ -19,7 +19,7 @@ #include #include -#include +#include namespace accessibility { diff --git a/accessibility/source/extended/accessibleeditbrowseboxcell.cxx b/accessibility/source/extended/accessibleeditbrowseboxcell.cxx index be7adb43ee73..7344acf3edce 100644 --- a/accessibility/source/extended/accessibleeditbrowseboxcell.cxx +++ b/accessibility/source/extended/accessibleeditbrowseboxcell.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include #include diff --git a/accessibility/source/extended/accessibleiconchoicectrl.cxx b/accessibility/source/extended/accessibleiconchoicectrl.cxx index 172438bcfdeb..aa9d9abc5754 100644 --- a/accessibility/source/extended/accessibleiconchoicectrl.cxx +++ b/accessibility/source/extended/accessibleiconchoicectrl.cxx @@ -17,8 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "accessibility/extended/accessibleiconchoicectrl.hxx" -#include "accessibility/extended/accessibleiconchoicectrlentry.hxx" +#include "extended/accessibleiconchoicectrl.hxx" +#include "extended/accessibleiconchoicectrlentry.hxx" #include #include #include diff --git a/accessibility/source/extended/accessibleiconchoicectrlentry.cxx b/accessibility/source/extended/accessibleiconchoicectrlentry.cxx index 1a3c24c322f8..119e603b4c7b 100644 --- a/accessibility/source/extended/accessibleiconchoicectrlentry.cxx +++ b/accessibility/source/extended/accessibleiconchoicectrlentry.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include #include diff --git a/accessibility/source/extended/accessiblelistbox.cxx b/accessibility/source/extended/accessiblelistbox.cxx index 63c2b5d45efa..a1838a4c370d 100644 --- a/accessibility/source/extended/accessiblelistbox.cxx +++ b/accessibility/source/extended/accessiblelistbox.cxx @@ -17,8 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include +#include +#include #include #include #include diff --git a/accessibility/source/extended/accessiblelistboxentry.cxx b/accessibility/source/extended/accessiblelistboxentry.cxx index 12af82ab3e8c..0999c432a19a 100644 --- a/accessibility/source/extended/accessiblelistboxentry.cxx +++ b/accessibility/source/extended/accessiblelistboxentry.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "accessibility/extended/accessiblelistboxentry.hxx" +#include "extended/accessiblelistboxentry.hxx" #include #include #include @@ -40,8 +40,8 @@ #include #include #include -#include -#include +#include +#include #include #define ACCESSIBLE_ACTION_COUNT 1 diff --git a/accessibility/source/extended/accessibletabbar.cxx b/accessibility/source/extended/accessibletabbar.cxx index 9b5cd91e683b..750a37688a59 100644 --- a/accessibility/source/extended/accessibletabbar.cxx +++ b/accessibility/source/extended/accessibletabbar.cxx @@ -17,9 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include -#include +#include #include #include #include diff --git a/accessibility/source/extended/accessibletabbarbase.cxx b/accessibility/source/extended/accessibletabbarbase.cxx index e103a0e818b8..11a26f8aa637 100644 --- a/accessibility/source/extended/accessibletabbarbase.cxx +++ b/accessibility/source/extended/accessibletabbarbase.cxx @@ -17,9 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "accessibility/extended/accessibletabbarbase.hxx" +#include "extended/accessibletabbarbase.hxx" #ifndef ACCESSIBILITY_EXT_ACCESSIBLETABBARPAGELIST -#include "accessibility/extended/accessibletabbarpagelist.hxx" +#include "extended/accessibletabbarpagelist.hxx" #endif #include #include diff --git a/accessibility/source/extended/accessibletabbarpage.cxx b/accessibility/source/extended/accessibletabbarpage.cxx index ad7f437d8002..c1d0a48f0182 100644 --- a/accessibility/source/extended/accessibletabbarpage.cxx +++ b/accessibility/source/extended/accessibletabbarpage.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include #include diff --git a/accessibility/source/extended/accessibletabbarpagelist.cxx b/accessibility/source/extended/accessibletabbarpagelist.cxx index 0ef33627c4c0..17e1fe9767cf 100644 --- a/accessibility/source/extended/accessibletabbarpagelist.cxx +++ b/accessibility/source/extended/accessibletabbarpagelist.cxx @@ -17,9 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include -#include +#include #include #include #include diff --git a/accessibility/source/extended/accessibletablistbox.cxx b/accessibility/source/extended/accessibletablistbox.cxx index fccc8e8d300b..b92d0d82dbce 100644 --- a/accessibility/source/extended/accessibletablistbox.cxx +++ b/accessibility/source/extended/accessibletablistbox.cxx @@ -18,8 +18,8 @@ */ -#include "accessibility/extended/accessibletablistbox.hxx" -#include "accessibility/extended/accessibletablistboxtable.hxx" +#include "extended/accessibletablistbox.hxx" +#include "extended/accessibletablistboxtable.hxx" #include #include diff --git a/accessibility/source/extended/accessibletablistboxtable.cxx b/accessibility/source/extended/accessibletablistboxtable.cxx index 92f1a230221d..f13ad1619032 100644 --- a/accessibility/source/extended/accessibletablistboxtable.cxx +++ b/accessibility/source/extended/accessibletablistboxtable.cxx @@ -18,9 +18,9 @@ */ -#include "accessibility/extended/accessibletablistboxtable.hxx" -#include "accessibility/extended/AccessibleBrowseBoxTableCell.hxx" -#include "accessibility/extended/AccessibleBrowseBoxCheckBoxCell.hxx" +#include "extended/accessibletablistboxtable.hxx" +#include "extended/AccessibleBrowseBoxTableCell.hxx" +#include "extended/AccessibleBrowseBoxCheckBoxCell.hxx" #include #include diff --git a/accessibility/source/extended/listboxaccessible.cxx b/accessibility/source/extended/listboxaccessible.cxx index 47fb3b62b821..533b3e208e66 100644 --- a/accessibility/source/extended/listboxaccessible.cxx +++ b/accessibility/source/extended/listboxaccessible.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include diff --git a/accessibility/source/extended/textwindowaccessibility.cxx b/accessibility/source/extended/textwindowaccessibility.cxx index 33454e83d6ab..61175803e86b 100644 --- a/accessibility/source/extended/textwindowaccessibility.cxx +++ b/accessibility/source/extended/textwindowaccessibility.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include #include diff --git a/accessibility/source/helper/IComboListBoxHelper.cxx b/accessibility/source/helper/IComboListBoxHelper.cxx index 1edaae97391e..5c3ce6b94076 100644 --- a/accessibility/source/helper/IComboListBoxHelper.cxx +++ b/accessibility/source/helper/IComboListBoxHelper.cxx @@ -7,7 +7,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include +#include namespace accessibility { diff --git a/accessibility/source/helper/acc_factory.cxx b/accessibility/source/helper/acc_factory.cxx index 45587c9ccae5..f4c8597445c4 100644 --- a/accessibility/source/helper/acc_factory.cxx +++ b/accessibility/source/helper/acc_factory.cxx @@ -22,40 +22,40 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include -#include +#include #include #include diff --git a/accessibility/source/helper/accessiblestrings.src b/accessibility/source/helper/accessiblestrings.src index f112af3b48bb..63e30670df76 100644 --- a/accessibility/source/helper/accessiblestrings.src +++ b/accessibility/source/helper/accessiblestrings.src @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include String RID_STR_ACC_ACTION_CLICK { diff --git a/accessibility/source/helper/accresmgr.cxx b/accessibility/source/helper/accresmgr.cxx index 25c5a515fd08..ca09872bc8c3 100644 --- a/accessibility/source/helper/accresmgr.cxx +++ b/accessibility/source/helper/accresmgr.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include diff --git a/accessibility/source/helper/characterattributeshelper.cxx b/accessibility/source/helper/characterattributeshelper.cxx index cc02ef63030e..4e33d1bc184a 100644 --- a/accessibility/source/helper/characterattributeshelper.cxx +++ b/accessibility/source/helper/characterattributeshelper.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include diff --git a/accessibility/source/standard/accessiblemenubasecomponent.cxx b/accessibility/source/standard/accessiblemenubasecomponent.cxx index 9ef64b410fc6..4c4ecc7d624a 100644 --- a/accessibility/source/standard/accessiblemenubasecomponent.cxx +++ b/accessibility/source/standard/accessiblemenubasecomponent.cxx @@ -17,10 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/accessibility/source/standard/accessiblemenucomponent.cxx b/accessibility/source/standard/accessiblemenucomponent.cxx index 16fe428bd6bc..2fc95d3afcca 100644 --- a/accessibility/source/standard/accessiblemenucomponent.cxx +++ b/accessibility/source/standard/accessiblemenucomponent.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include diff --git a/accessibility/source/standard/accessiblemenuitemcomponent.cxx b/accessibility/source/standard/accessiblemenuitemcomponent.cxx index 41d27b01bcef..50a83c63192b 100644 --- a/accessibility/source/standard/accessiblemenuitemcomponent.cxx +++ b/accessibility/source/standard/accessiblemenuitemcomponent.cxx @@ -17,11 +17,11 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include -#include -#include +#include +#include #include #include #include diff --git a/accessibility/source/standard/vclxaccessiblebox.cxx b/accessibility/source/standard/vclxaccessiblebox.cxx index ae4e5a66ac15..bee3e6d5ccad 100644 --- a/accessibility/source/standard/vclxaccessiblebox.cxx +++ b/accessibility/source/standard/vclxaccessiblebox.cxx @@ -17,11 +17,11 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -30,8 +30,8 @@ #include #include #include -#include -#include +#include +#include using namespace ::com::sun::star; using namespace ::com::sun::star::uno; diff --git a/accessibility/source/standard/vclxaccessiblebutton.cxx b/accessibility/source/standard/vclxaccessiblebutton.cxx index 66da4236b020..99c8c6b15b52 100644 --- a/accessibility/source/standard/vclxaccessiblebutton.cxx +++ b/accessibility/source/standard/vclxaccessiblebutton.cxx @@ -17,9 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include -#include +#include +#include +#include #include #include diff --git a/accessibility/source/standard/vclxaccessiblecheckbox.cxx b/accessibility/source/standard/vclxaccessiblecheckbox.cxx index c54e064d94b5..e66e236a8809 100644 --- a/accessibility/source/standard/vclxaccessiblecheckbox.cxx +++ b/accessibility/source/standard/vclxaccessiblecheckbox.cxx @@ -17,11 +17,11 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include -#include -#include +#include +#include #include #include diff --git a/accessibility/source/standard/vclxaccessiblecombobox.cxx b/accessibility/source/standard/vclxaccessiblecombobox.cxx index 1da4234a4f6b..3ff31db6c0c6 100644 --- a/accessibility/source/standard/vclxaccessiblecombobox.cxx +++ b/accessibility/source/standard/vclxaccessiblecombobox.cxx @@ -17,8 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include +#include +#include #include #include #include diff --git a/accessibility/source/standard/vclxaccessibledropdowncombobox.cxx b/accessibility/source/standard/vclxaccessibledropdowncombobox.cxx index 54c245cbb6ba..408e2be10a16 100644 --- a/accessibility/source/standard/vclxaccessibledropdowncombobox.cxx +++ b/accessibility/source/standard/vclxaccessibledropdowncombobox.cxx @@ -17,12 +17,12 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/accessibility/source/standard/vclxaccessibledropdownlistbox.cxx b/accessibility/source/standard/vclxaccessibledropdownlistbox.cxx index 67d060f46806..8e54c51f11d6 100644 --- a/accessibility/source/standard/vclxaccessibledropdownlistbox.cxx +++ b/accessibility/source/standard/vclxaccessibledropdownlistbox.cxx @@ -18,10 +18,10 @@ */ -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/accessibility/source/standard/vclxaccessibleedit.cxx b/accessibility/source/standard/vclxaccessibleedit.cxx index 9ef00251c6ad..5d48aeaf7e7a 100644 --- a/accessibility/source/standard/vclxaccessibleedit.cxx +++ b/accessibility/source/standard/vclxaccessibleedit.cxx @@ -17,12 +17,12 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include -#include -#include +#include +#include #include #include diff --git a/accessibility/source/standard/vclxaccessiblefixedhyperlink.cxx b/accessibility/source/standard/vclxaccessiblefixedhyperlink.cxx index 9e2580f0594c..9ea2234345a8 100644 --- a/accessibility/source/standard/vclxaccessiblefixedhyperlink.cxx +++ b/accessibility/source/standard/vclxaccessiblefixedhyperlink.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include using namespace ::com::sun::star; diff --git a/accessibility/source/standard/vclxaccessiblefixedtext.cxx b/accessibility/source/standard/vclxaccessiblefixedtext.cxx index b6645b356aff..3a8744815870 100644 --- a/accessibility/source/standard/vclxaccessiblefixedtext.cxx +++ b/accessibility/source/standard/vclxaccessiblefixedtext.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include diff --git a/accessibility/source/standard/vclxaccessiblelist.cxx b/accessibility/source/standard/vclxaccessiblelist.cxx index c425f3c204d5..66e1fa2d5134 100644 --- a/accessibility/source/standard/vclxaccessiblelist.cxx +++ b/accessibility/source/standard/vclxaccessiblelist.cxx @@ -17,9 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include -#include +#include +#include +#include #include #include diff --git a/accessibility/source/standard/vclxaccessiblelistbox.cxx b/accessibility/source/standard/vclxaccessiblelistbox.cxx index 0db8a0671670..5c9c34e1a1c3 100644 --- a/accessibility/source/standard/vclxaccessiblelistbox.cxx +++ b/accessibility/source/standard/vclxaccessiblelistbox.cxx @@ -17,9 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include -#include +#include +#include +#include #include diff --git a/accessibility/source/standard/vclxaccessiblelistitem.cxx b/accessibility/source/standard/vclxaccessiblelistitem.cxx index 26cd9d842906..c950953babe1 100644 --- a/accessibility/source/standard/vclxaccessiblelistitem.cxx +++ b/accessibility/source/standard/vclxaccessiblelistitem.cxx @@ -17,9 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include -#include +#include #include #include #include diff --git a/accessibility/source/standard/vclxaccessiblemenu.cxx b/accessibility/source/standard/vclxaccessiblemenu.cxx index a251fdd21b63..7fc965960cbd 100644 --- a/accessibility/source/standard/vclxaccessiblemenu.cxx +++ b/accessibility/source/standard/vclxaccessiblemenu.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include diff --git a/accessibility/source/standard/vclxaccessiblemenubar.cxx b/accessibility/source/standard/vclxaccessiblemenubar.cxx index 17b3cb46d9b7..fead9be98f11 100644 --- a/accessibility/source/standard/vclxaccessiblemenubar.cxx +++ b/accessibility/source/standard/vclxaccessiblemenubar.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include diff --git a/accessibility/source/standard/vclxaccessiblemenuitem.cxx b/accessibility/source/standard/vclxaccessiblemenuitem.cxx index 074fb357a05d..533def411843 100644 --- a/accessibility/source/standard/vclxaccessiblemenuitem.cxx +++ b/accessibility/source/standard/vclxaccessiblemenuitem.cxx @@ -17,11 +17,11 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include -#include +#include +#include +#include #include -#include +#include #include #include diff --git a/accessibility/source/standard/vclxaccessiblemenuseparator.cxx b/accessibility/source/standard/vclxaccessiblemenuseparator.cxx index 8c58c3fc285a..a7d9cdda042d 100644 --- a/accessibility/source/standard/vclxaccessiblemenuseparator.cxx +++ b/accessibility/source/standard/vclxaccessiblemenuseparator.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include diff --git a/accessibility/source/standard/vclxaccessiblepopupmenu.cxx b/accessibility/source/standard/vclxaccessiblepopupmenu.cxx index 6d48f189b9ce..a3c77b28fc42 100644 --- a/accessibility/source/standard/vclxaccessiblepopupmenu.cxx +++ b/accessibility/source/standard/vclxaccessiblepopupmenu.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include diff --git a/accessibility/source/standard/vclxaccessibleradiobutton.cxx b/accessibility/source/standard/vclxaccessibleradiobutton.cxx index d9ad6f09e52e..1951db4420e0 100644 --- a/accessibility/source/standard/vclxaccessibleradiobutton.cxx +++ b/accessibility/source/standard/vclxaccessibleradiobutton.cxx @@ -17,11 +17,11 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include -#include -#include +#include +#include #include #include diff --git a/accessibility/source/standard/vclxaccessiblescrollbar.cxx b/accessibility/source/standard/vclxaccessiblescrollbar.cxx index f3675f7a57db..8da901e7b0e3 100644 --- a/accessibility/source/standard/vclxaccessiblescrollbar.cxx +++ b/accessibility/source/standard/vclxaccessiblescrollbar.cxx @@ -17,11 +17,11 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include -#include -#include +#include +#include #include #include diff --git a/accessibility/source/standard/vclxaccessiblestatusbar.cxx b/accessibility/source/standard/vclxaccessiblestatusbar.cxx index 25029fa85778..5499e62efd1e 100644 --- a/accessibility/source/standard/vclxaccessiblestatusbar.cxx +++ b/accessibility/source/standard/vclxaccessiblestatusbar.cxx @@ -17,8 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include +#include +#include #include #include #include diff --git a/accessibility/source/standard/vclxaccessiblestatusbaritem.cxx b/accessibility/source/standard/vclxaccessiblestatusbaritem.cxx index 0f4c1b1f5eef..ae8526f421c9 100644 --- a/accessibility/source/standard/vclxaccessiblestatusbaritem.cxx +++ b/accessibility/source/standard/vclxaccessiblestatusbaritem.cxx @@ -17,10 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include -#include +#include #include #include diff --git a/accessibility/source/standard/vclxaccessibletabcontrol.cxx b/accessibility/source/standard/vclxaccessibletabcontrol.cxx index e9ee495f527e..2f3be213e90f 100644 --- a/accessibility/source/standard/vclxaccessibletabcontrol.cxx +++ b/accessibility/source/standard/vclxaccessibletabcontrol.cxx @@ -17,8 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include +#include +#include #include #include diff --git a/accessibility/source/standard/vclxaccessibletabpage.cxx b/accessibility/source/standard/vclxaccessibletabpage.cxx index bb70bdf77880..f8dd10442a42 100644 --- a/accessibility/source/standard/vclxaccessibletabpage.cxx +++ b/accessibility/source/standard/vclxaccessibletabpage.cxx @@ -17,10 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include -#include +#include #include #include diff --git a/accessibility/source/standard/vclxaccessibletabpagewindow.cxx b/accessibility/source/standard/vclxaccessibletabpagewindow.cxx index 430b4a4937cf..94283017d80e 100644 --- a/accessibility/source/standard/vclxaccessibletabpagewindow.cxx +++ b/accessibility/source/standard/vclxaccessibletabpagewindow.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include #include diff --git a/accessibility/source/standard/vclxaccessibletextcomponent.cxx b/accessibility/source/standard/vclxaccessibletextcomponent.cxx index 159898b7e48b..8a0543f676e0 100644 --- a/accessibility/source/standard/vclxaccessibletextcomponent.cxx +++ b/accessibility/source/standard/vclxaccessibletextcomponent.cxx @@ -17,10 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include -#include +#include #include #include diff --git a/accessibility/source/standard/vclxaccessibletextfield.cxx b/accessibility/source/standard/vclxaccessibletextfield.cxx index 71c647e77da0..0b34a576dc77 100644 --- a/accessibility/source/standard/vclxaccessibletextfield.cxx +++ b/accessibility/source/standard/vclxaccessibletextfield.cxx @@ -17,9 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include -#include +#include #include #include diff --git a/accessibility/source/standard/vclxaccessibletoolbox.cxx b/accessibility/source/standard/vclxaccessibletoolbox.cxx index 5e830ecab06e..9efb9266ae30 100644 --- a/accessibility/source/standard/vclxaccessibletoolbox.cxx +++ b/accessibility/source/standard/vclxaccessibletoolbox.cxx @@ -18,8 +18,8 @@ */ #include -#include -#include +#include +#include #include #include diff --git a/accessibility/source/standard/vclxaccessibletoolboxitem.cxx b/accessibility/source/standard/vclxaccessibletoolboxitem.cxx index fc4c7ed15fbb..f772b7f11789 100644 --- a/accessibility/source/standard/vclxaccessibletoolboxitem.cxx +++ b/accessibility/source/standard/vclxaccessibletoolboxitem.cxx @@ -17,10 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include -#include -#include +#include +#include #include #include #include diff --git a/bridges/inc/arraypointer.hxx b/bridges/inc/arraypointer.hxx new file mode 100644 index 000000000000..84e5297f3eb4 --- /dev/null +++ b/bridges/inc/arraypointer.hxx @@ -0,0 +1,49 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_BRIDGES_INC_ARRAYPOINTER_HXX +#define INCLUDED_BRIDGES_INC_ARRAYPOINTER_HXX + +#include "sal/config.h" + +namespace bridges { namespace cpp_uno { namespace shared { + +/** + * A simple smart pointer that holds an array until it is being released. + */ +template< typename T > class ArrayPointer { +public: + ArrayPointer(T * p): p_(p) {} + + ~ArrayPointer() { delete[] p_; } + + T * release() { T * t = p_; p_ = 0; return t; } + +private: + ArrayPointer(ArrayPointer &); // not defined + void operator =(ArrayPointer &); // not defined + + T * p_; +}; + +} } } + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bridges/inc/bridge.hxx b/bridges/inc/bridge.hxx new file mode 100644 index 000000000000..5e3b146217b0 --- /dev/null +++ b/bridges/inc/bridge.hxx @@ -0,0 +1,122 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_BRIDGES_INC_BRIDGE_HXX +#define INCLUDED_BRIDGES_INC_BRIDGE_HXX + +#include "osl/interlck.h" +#include "sal/types.h" +#include "typelib/typedescription.h" +#include "uno/environment.h" +#include "uno/mapping.h" + +namespace bridges { namespace cpp_uno { namespace shared { + +// private: +extern "C" typedef void SAL_CALL FreeMapping(uno_Mapping *); +FreeMapping freeMapping; + +// private: +extern "C" +typedef void SAL_CALL AcquireMapping(uno_Mapping *); +AcquireMapping acquireMapping; + +// private: +extern "C" +typedef void SAL_CALL ReleaseMapping(uno_Mapping *); +ReleaseMapping releaseMapping; + +// private: +extern "C" typedef void SAL_CALL Cpp2unoMapping( + uno_Mapping *, void **, void *, typelib_InterfaceTypeDescription *); +Cpp2unoMapping cpp2unoMapping; + +// private: +extern "C" typedef void SAL_CALL Uno2cppMapping( + uno_Mapping *, void **, void *, typelib_InterfaceTypeDescription *); +Uno2cppMapping uno2cppMapping; + +/** + * Holding environments and mappings. + */ +class Bridge { +public: + // Interface for generic/component.cxx: + + static uno_Mapping * createMapping( + uno_ExtEnvironment * pCppEnv, uno_ExtEnvironment * pUnoEnv, + bool bExportCpp2Uno); + + // Interface for Cpp/UnoInterfaceProxy: + + void acquire(); + void release(); + + // Interface for individual CPP--UNO bridges: + + uno_ExtEnvironment * getCppEnv() { return pCppEnv; } + uno_ExtEnvironment * getUnoEnv() { return pUnoEnv; } + + uno_Mapping * getCpp2Uno() { return &aCpp2Uno; } + uno_Mapping * getUno2Cpp() { return &aUno2Cpp; } + +private: + Bridge(Bridge &) = delete; + void operator =(const Bridge&) = delete; + + Bridge( + uno_ExtEnvironment * pCppEnv_, uno_ExtEnvironment * pUnoEnv_, + bool bExportCpp2Uno_); + + ~Bridge(); + + struct Mapping: public uno_Mapping { + Bridge * pBridge; + }; + + oslInterlockedCount nRef; + + uno_ExtEnvironment * pCppEnv; + uno_ExtEnvironment * pUnoEnv; + + Mapping aCpp2Uno; + Mapping aUno2Cpp; + + bool bExportCpp2Uno; + + friend void SAL_CALL freeMapping(uno_Mapping * pMapping); + + friend void SAL_CALL acquireMapping(uno_Mapping * pMapping); + + friend void SAL_CALL releaseMapping(uno_Mapping * pMapping); + + friend void SAL_CALL cpp2unoMapping( + uno_Mapping * pMapping, void ** ppUnoI, void * pCppI, + typelib_InterfaceTypeDescription * pTypeDescr); + + friend void SAL_CALL uno2cppMapping( + uno_Mapping * pMapping, void ** ppCppI, void * pUnoI, + typelib_InterfaceTypeDescription * pTypeDescr); +}; + +} } } + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bridges/inc/bridges/cpp_uno/shared/arraypointer.hxx b/bridges/inc/bridges/cpp_uno/shared/arraypointer.hxx deleted file mode 100644 index c5018c32b967..000000000000 --- a/bridges/inc/bridges/cpp_uno/shared/arraypointer.hxx +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_BRIDGES_INC_BRIDGES_CPP_UNO_SHARED_ARRAYPOINTER_HXX -#define INCLUDED_BRIDGES_INC_BRIDGES_CPP_UNO_SHARED_ARRAYPOINTER_HXX - -#include "sal/config.h" - -namespace bridges { namespace cpp_uno { namespace shared { - -/** - * A simple smart pointer that holds an array until it is being released. - */ -template< typename T > class ArrayPointer { -public: - ArrayPointer(T * p): p_(p) {} - - ~ArrayPointer() { delete[] p_; } - - T * release() { T * t = p_; p_ = 0; return t; } - -private: - ArrayPointer(ArrayPointer &); // not defined - void operator =(ArrayPointer &); // not defined - - T * p_; -}; - -} } } - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bridges/inc/bridges/cpp_uno/shared/bridge.hxx b/bridges/inc/bridges/cpp_uno/shared/bridge.hxx deleted file mode 100644 index 9cfa92bcddef..000000000000 --- a/bridges/inc/bridges/cpp_uno/shared/bridge.hxx +++ /dev/null @@ -1,122 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_BRIDGES_INC_BRIDGES_CPP_UNO_SHARED_BRIDGE_HXX -#define INCLUDED_BRIDGES_INC_BRIDGES_CPP_UNO_SHARED_BRIDGE_HXX - -#include "osl/interlck.h" -#include "sal/types.h" -#include "typelib/typedescription.h" -#include "uno/environment.h" -#include "uno/mapping.h" - -namespace bridges { namespace cpp_uno { namespace shared { - -// private: -extern "C" typedef void SAL_CALL FreeMapping(uno_Mapping *); -FreeMapping freeMapping; - -// private: -extern "C" -typedef void SAL_CALL AcquireMapping(uno_Mapping *); -AcquireMapping acquireMapping; - -// private: -extern "C" -typedef void SAL_CALL ReleaseMapping(uno_Mapping *); -ReleaseMapping releaseMapping; - -// private: -extern "C" typedef void SAL_CALL Cpp2unoMapping( - uno_Mapping *, void **, void *, typelib_InterfaceTypeDescription *); -Cpp2unoMapping cpp2unoMapping; - -// private: -extern "C" typedef void SAL_CALL Uno2cppMapping( - uno_Mapping *, void **, void *, typelib_InterfaceTypeDescription *); -Uno2cppMapping uno2cppMapping; - -/** - * Holding environments and mappings. - */ -class Bridge { -public: - // Interface for generic/component.cxx: - - static uno_Mapping * createMapping( - uno_ExtEnvironment * pCppEnv, uno_ExtEnvironment * pUnoEnv, - bool bExportCpp2Uno); - - // Interface for Cpp/UnoInterfaceProxy: - - void acquire(); - void release(); - - // Interface for individual CPP--UNO bridges: - - uno_ExtEnvironment * getCppEnv() { return pCppEnv; } - uno_ExtEnvironment * getUnoEnv() { return pUnoEnv; } - - uno_Mapping * getCpp2Uno() { return &aCpp2Uno; } - uno_Mapping * getUno2Cpp() { return &aUno2Cpp; } - -private: - Bridge(Bridge &) = delete; - void operator =(const Bridge&) = delete; - - Bridge( - uno_ExtEnvironment * pCppEnv_, uno_ExtEnvironment * pUnoEnv_, - bool bExportCpp2Uno_); - - ~Bridge(); - - struct Mapping: public uno_Mapping { - Bridge * pBridge; - }; - - oslInterlockedCount nRef; - - uno_ExtEnvironment * pCppEnv; - uno_ExtEnvironment * pUnoEnv; - - Mapping aCpp2Uno; - Mapping aUno2Cpp; - - bool bExportCpp2Uno; - - friend void SAL_CALL freeMapping(uno_Mapping * pMapping); - - friend void SAL_CALL acquireMapping(uno_Mapping * pMapping); - - friend void SAL_CALL releaseMapping(uno_Mapping * pMapping); - - friend void SAL_CALL cpp2unoMapping( - uno_Mapping * pMapping, void ** ppUnoI, void * pCppI, - typelib_InterfaceTypeDescription * pTypeDescr); - - friend void SAL_CALL uno2cppMapping( - uno_Mapping * pMapping, void ** ppCppI, void * pUnoI, - typelib_InterfaceTypeDescription * pTypeDescr); -}; - -} } } - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bridges/inc/bridges/cpp_uno/shared/cppinterfaceproxy.hxx b/bridges/inc/bridges/cpp_uno/shared/cppinterfaceproxy.hxx deleted file mode 100644 index 4002af6395b3..000000000000 --- a/bridges/inc/bridges/cpp_uno/shared/cppinterfaceproxy.hxx +++ /dev/null @@ -1,100 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_BRIDGES_INC_BRIDGES_CPP_UNO_SHARED_CPPINTERFACEPROXY_HXX -#define INCLUDED_BRIDGES_INC_BRIDGES_CPP_UNO_SHARED_CPPINTERFACEPROXY_HXX - -#include "osl/interlck.h" -#include "rtl/ustring.hxx" -#include "sal/types.h" -#include "typelib/typedescription.h" -#include "uno/dispatcher.h" -#include "uno/environment.h" -#include "bridges/cpp_uno/shared/vtablefactory.hxx" - -namespace com { namespace sun { namespace star { namespace uno { - class XInterface; -} } } } - -namespace bridges { namespace cpp_uno { namespace shared { - -class Bridge; - -extern "C" typedef void SAL_CALL FreeCppInterfaceProxy( - uno_ExtEnvironment * pEnv, void * pInterface); -FreeCppInterfaceProxy freeCppInterfaceProxy; - -/** - * A cpp proxy wrapping a uno interface. - */ -class CppInterfaceProxy { -public: - // Interface for Bridge: - - static com::sun::star::uno::XInterface * create( - Bridge * pBridge, uno_Interface * pUnoI, - typelib_InterfaceTypeDescription * pTypeDescr, - OUString const & rOId); - - // Interface for individual CPP--UNO bridges: - - Bridge * getBridge() { return pBridge; } - uno_Interface * getUnoI() { return pUnoI; } - typelib_InterfaceTypeDescription * getTypeDescr() { return pTypeDescr; } - const OUString& getOid() { return oid; } - - // non virtual methods called on incoming vtable calls #1, #2 - void acquireProxy(); - void releaseProxy(); - - static CppInterfaceProxy * castInterfaceToProxy(void * pInterface); - -private: - CppInterfaceProxy(CppInterfaceProxy &) = delete; - void operator =(const CppInterfaceProxy&) = delete; - - CppInterfaceProxy( - Bridge * pBridge_, uno_Interface * pUnoI_, - typelib_InterfaceTypeDescription * pTypeDescr_, - OUString const & rOId_); - - ~CppInterfaceProxy(); - - static com::sun::star::uno::XInterface * castProxyToInterface( - CppInterfaceProxy * pProxy); - - oslInterlockedCount nRef; - Bridge * pBridge; - - // mapping information - uno_Interface * pUnoI; // wrapped interface - typelib_InterfaceTypeDescription * pTypeDescr; - OUString oid; - - VtableFactory::Slot * vtables[1]; - - friend void SAL_CALL freeCppInterfaceProxy( - uno_ExtEnvironment * pEnv, void * pInterface); -}; - -} } } - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bridges/inc/bridges/cpp_uno/shared/except.hxx b/bridges/inc/bridges/cpp_uno/shared/except.hxx deleted file mode 100644 index fcb455297bf2..000000000000 --- a/bridges/inc/bridges/cpp_uno/shared/except.hxx +++ /dev/null @@ -1,41 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_BRIDGES_INC_BRIDGES_CPP_UNO_SHARED_EXCEPT_HXX -#define INCLUDED_BRIDGES_INC_BRIDGES_CPP_UNO_SHARED_EXCEPT_HXX - -#if _MSC_VER >= 1900 // VC 2015 (and later?) -// extern "C" void** __cdecl __current_exception() -// is defined in MSVS14.0/VC/crt/src/vcruntime/frame.cpp: -// return &__vcrt_getptd()->_curexception; -// -// __vcrt_getptd is defined in vcruntime_internal.h: -//typedef struct __vcrt_ptd -//{ -// // C++ Exception Handling (EH) state -// unsigned long _NLG_dwCode; // Required by NLG routines -//[...] -//void* _curexception; // current exception -//[...] -extern "C" void** __current_exception(); -#endif - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bridges/inc/bridges/cpp_uno/shared/types.hxx b/bridges/inc/bridges/cpp_uno/shared/types.hxx deleted file mode 100644 index d5ecd5eb2c25..000000000000 --- a/bridges/inc/bridges/cpp_uno/shared/types.hxx +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_BRIDGES_INC_BRIDGES_CPP_UNO_SHARED_TYPES_HXX -#define INCLUDED_BRIDGES_INC_BRIDGES_CPP_UNO_SHARED_TYPES_HXX - -#include "typelib/typeclass.h" -#include "typelib/typedescription.h" - -namespace bridges { namespace cpp_uno { namespace shared { - -/** - * Determines whether a type is a "simple" type (VOID, BOOLEAN, BYTE, SHORT, - * UNSIGNED SHORT, LONG, UNSIGNED LONG, HYPER, UNSIGNED HYPER, FLOAT, DOUBLE, - * CHAR, or an enum type). - * - * @param typeClass a type class - * @return true if the given type is "simple" - */ -bool isSimpleType(typelib_TypeClass typeClass); - -/** - * Determines whether a type is a "simple" type (VOID, BOOLEAN, BYTE, SHORT, - * UNSIGNED SHORT, LONG, UNSIGNED LONG, HYPER, UNSIGNED HYPER, FLOAT, DOUBLE, - * CHAR, or an enum type). - * - * @param type a non-null pointer to a type description reference - * @return true if the given type is "simple" - */ -bool isSimpleType(typelib_TypeDescriptionReference const * type); - -/** - * Determines whether a type is a "simple" type (VOID, BOOLEAN, BYTE, SHORT, - * UNSIGNED SHORT, LONG, UNSIGNED LONG, HYPER, UNSIGNED HYPER, FLOAT, DOUBLE, - * CHAR, or an enum type). - * - * @param type a non-null pointer to a type description - * @return true if the given type is "simple" - */ -bool isSimpleType(typelib_TypeDescription const * type); - -/** - * Determines whether a type relates to an interface type (is itself an - * interface type, or might contain entities of interface type). - * - * @param type a non-null pointer to a type description - * @return true if the given type relates to an interface type - */ -bool relatesToInterfaceType(typelib_TypeDescription const * type); - -} } } - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bridges/inc/bridges/cpp_uno/shared/unointerfaceproxy.hxx b/bridges/inc/bridges/cpp_uno/shared/unointerfaceproxy.hxx deleted file mode 100644 index f678765b7826..000000000000 --- a/bridges/inc/bridges/cpp_uno/shared/unointerfaceproxy.hxx +++ /dev/null @@ -1,110 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_BRIDGES_INC_BRIDGES_CPP_UNO_SHARED_UNOINTERFACEPROXY_HXX -#define INCLUDED_BRIDGES_INC_BRIDGES_CPP_UNO_SHARED_UNOINTERFACEPROXY_HXX - -#include "osl/interlck.h" -#include "rtl/ustring.hxx" -#include "sal/types.h" -#include "typelib/typedescription.h" -#include "uno/dispatcher.h" -#include "uno/environment.h" - -namespace com { namespace sun { namespace star { namespace uno { - class XInterface; -} } } } - -namespace bridges { namespace cpp_uno { namespace shared { - -class Bridge; - -extern "C" typedef void SAL_CALL FreeUnoInterfaceProxy( - uno_ExtEnvironment * pEnv, void * pProxy); -FreeUnoInterfaceProxy freeUnoInterfaceProxy; - -// private: -extern "C" typedef void SAL_CALL UnoInterfaceProxyDispatch( - uno_Interface * pUnoI, typelib_TypeDescription const * pMemberDescr, - void * pReturn, void * pArgs[], uno_Any ** ppException); -UnoInterfaceProxyDispatch unoInterfaceProxyDispatch; - // this function is not defined in the generic part, but instead has to be - // defined individually for each CPP--UNO bridge - -// private: -extern "C" typedef void SAL_CALL AcquireProxy(uno_Interface *); -AcquireProxy acquireProxy; - -// private: -extern "C" typedef void SAL_CALL ReleaseProxy(uno_Interface *); -ReleaseProxy releaseProxy; - -/** - * A uno proxy wrapping a cpp interface. - */ -class UnoInterfaceProxy: public uno_Interface { -public: - // Interface for Bridge: - - static UnoInterfaceProxy * create( - Bridge * pBridge, com::sun::star::uno::XInterface * pCppI, - typelib_InterfaceTypeDescription * pTypeDescr, - OUString const & rOId); - - // Interface for individual CPP--UNO bridges: - - Bridge * getBridge() { return pBridge; } - com::sun::star::uno::XInterface * getCppI() { return pCppI; } - -private: - UnoInterfaceProxy(UnoInterfaceProxy &) = delete; - void operator =(const UnoInterfaceProxy&) = delete; - - UnoInterfaceProxy( - Bridge * pBridge_, com::sun::star::uno::XInterface * pCppI_, - typelib_InterfaceTypeDescription * pTypeDescr_, - OUString const & rOId_); - - ~UnoInterfaceProxy(); - - oslInterlockedCount nRef; - Bridge * pBridge; - - // mapping information - com::sun::star::uno::XInterface * pCppI; // wrapped interface - typelib_InterfaceTypeDescription * pTypeDescr; - OUString oid; - - friend void SAL_CALL freeUnoInterfaceProxy( - uno_ExtEnvironment * pEnv, void * pProxy); - - friend void SAL_CALL unoInterfaceProxyDispatch( - uno_Interface * pUnoI, typelib_TypeDescription const * pMemberDescr, - void * pReturn, void * pArgs[], uno_Any ** ppException); - - friend void SAL_CALL acquireProxy(uno_Interface * pUnoI); - - friend void SAL_CALL releaseProxy(uno_Interface * pUnoI); -}; - -} } } - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bridges/inc/bridges/cpp_uno/shared/vtablefactory.hxx b/bridges/inc/bridges/cpp_uno/shared/vtablefactory.hxx deleted file mode 100644 index 19fe4e7a0fa5..000000000000 --- a/bridges/inc/bridges/cpp_uno/shared/vtablefactory.hxx +++ /dev/null @@ -1,222 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_BRIDGES_INC_BRIDGES_CPP_UNO_SHARED_VTABLEFACTORY_HXX -#define INCLUDED_BRIDGES_INC_BRIDGES_CPP_UNO_SHARED_VTABLEFACTORY_HXX - -#include "osl/mutex.hxx" -#include "rtl/alloc.h" -#include "rtl/ustring.hxx" -#include "sal/types.h" -#include "typelib/typedescription.hxx" - -#include - -/*See: http://people.redhat.com/drepper/selinux-mem.html*/ -#if defined(LINUX) || defined(OPENBSD) || defined(FREEBSD) \ - || defined(NETBSD) || defined(DRAGONFLY) || defined (ANDROID) -#define USE_DOUBLE_MMAP -#endif - -namespace bridges { namespace cpp_uno { namespace shared { - -/** Hand out vtable structures for interface type descriptions. - */ -class VtableFactory { -public: - // This structure is not defined in the generic part, but instead has to be - // defined individually for each CPP--UNO bridge: - /** A vtable slot. - */ - struct Slot; - - /** A raw vtable block. - */ - struct Block { - /** The start of the raw vtable block. - - It points to the start of the allocated memory block, whereas the - vtable pointer typically points some bytes into the block (e.g., - skipping an RTTI pointer, see mapBlockToVtable). Also, the block - contains any generated code snippets, after the vtable itself. - */ - void * start; - -#ifdef USE_DOUBLE_MMAP - /** When separately mmapping the block for writing and executing - exec points to the same memory as start, except start is used - exclusively for writing and exec for executing - */ - void * exec; - - /** File handle for the underlying anonymous file - */ - int fd; -#endif - - /** The size of the raw vtable block, in bytes. - */ - sal_Size size; - }; - - /** The vtable structure corresponding to an interface type. - */ - struct Vtables { - /** The number of blocks/vtables. - */ - sal_Int32 count; - - /** An array of blocks, representing the multiple vtables of a - (multiple-inheritance) type. - -

A block is a raw vtable. It points to the start of the allocated - memory block, whereas the vtable pointer typically points some bytes - into the block (e.g., skipping an RTTI pointer, see - mapBlockToVtable). Also, the block contains any generated code - snippets, after the vtable itself.

- */ - Block * blocks; - Vtables() - : count(0) - , blocks(nullptr) - { - } - }; - - VtableFactory(); - - ~VtableFactory(); - - /** Given an interface type description, return its corresponding vtable - structure. - */ - Vtables getVtables(typelib_InterfaceTypeDescription * type); - - // This function is not defined in the generic part, but instead has to be - // defined individually for each CPP--UNO bridge: - /** Given a pointer to a block, turn it into a vtable pointer. - */ - static Slot * mapBlockToVtable(void * block); - -private: - class GuardedBlocks; - friend class GuardedBlocks; - - class BaseOffset; - - VtableFactory(VtableFactory &) = delete; - void operator =(const VtableFactory&) = delete; - - bool createBlock(Block &block, sal_Int32 slotCount) const; - - void freeBlock(Block const & block) const; - - sal_Int32 createVtables( - GuardedBlocks & blocks, BaseOffset const & baseOffset, - typelib_InterfaceTypeDescription * type, sal_Int32 vtableNumber, - typelib_InterfaceTypeDescription * mostDerived, bool includePrimary) - const; - - // This function is not defined in the generic part, but instead has to be - // defined individually for each CPP--UNO bridge: - /** Calculate the size of a raw vtable block. - - @param slotCount the number of virtual function slots the returned - vtable block shall support (if there are any platform-specific slots, - like an RTTI pointer, or a pointer to a destructor, they are not covered - by slotCount) - @return the size of the raw vtable block, in bytes - */ - static sal_Size getBlockSize(sal_Int32 slotCount); - - // This function is not defined in the generic part, but instead has to be - // defined individually for each CPP--UNO bridge: - /** Initialize a raw vtable block. - - @param block the start address of the raw vtable block - @param slotCount the number of slots - @param vtableNumber zero-based count across all the most derived type's - vtables (for vtable's "offset to top" slot) - @param type non-null most derived type (for vtable's "typeinfo pointer" - slot) - @return a pointer past the last vtable slot - */ - static Slot * initializeBlock( - void * block, sal_Int32 slotCount, sal_Int32 vtableNumber, - typelib_InterfaceTypeDescription * type); - - // This function is not defined in the generic part, but instead has to be - // defined individually for each CPP--UNO bridge: - /** Fill the vtable slots corresponding to all local (i.e., not inherited) - functions of a given interface type (and generate any necessary code - snippets for them). - - @param slots on input, points past the vtable slot to be filled with - the last virtual function local to the given type; on output, points to - the vtable slot filled with the first virtual function local to the - given type - @param code points to the start of the area where code snippets can be - generated - @param writetoexecdiff when the same code area is mapped twice, once for - writing for code-generation, and once for code-execution, then this - records the offset from a writable address to its executable address - @param type the interface type description for which to generate vtable - slots - @param functionOffset the function offset of the first vtable slot - (typically coded into the code snippet for that vtable slot) - @param functionCount the number of vtable slots to fill (the number of - local functions of the given type, passed in so that it need not be - recomputed) - @param vtableOffset the offset of this vtable (needed to adjust the - this pointer, typically coded into the code snippets for all the filled - vtable slots) - @return a pointer to the remaining code snippet area - */ - static unsigned char * addLocalFunctions( - Slot ** slots, unsigned char * code, -#ifdef USE_DOUBLE_MMAP - sal_PtrDiff writetoexecdiff, -#endif - typelib_InterfaceTypeDescription const * type, sal_Int32 functionOffset, - sal_Int32 functionCount, sal_Int32 vtableOffset); - - // This function is not defined in the generic part, but instead has to be - // defined individually for each CPP--UNO bridge: - /** Flush all the generated code snippets of a vtable, on platforms that - require it. - - @param begin points to the start of the code snippet area - @param end points behind the end of the code snippet area - */ - static void flushCode( - unsigned char const * begin, unsigned char const * end); - - typedef std::unordered_map< OUString, Vtables, OUStringHash > Map; - - osl::Mutex m_mutex; - Map m_map; - - rtl_arena_type * m_arena; -}; - -} } } - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bridges/inc/bridges/cpp_uno/shared/vtables.hxx b/bridges/inc/bridges/cpp_uno/shared/vtables.hxx deleted file mode 100644 index ee9a2a3deea2..000000000000 --- a/bridges/inc/bridges/cpp_uno/shared/vtables.hxx +++ /dev/null @@ -1,102 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_BRIDGES_INC_BRIDGES_CPP_UNO_SHARED_VTABLES_HXX -#define INCLUDED_BRIDGES_INC_BRIDGES_CPP_UNO_SHARED_VTABLES_HXX - -#include "sal/types.h" -#include "typelib/typedescription.h" - -namespace bridges { namespace cpp_uno { namespace shared { - -/** - * Calculate the number of local functions of an interface type. - * - *

Local functions are those not inherited from any base types. The - * number of functions is potentially larger than the number of - * members, as each read–write attribute member counts as two - * functions.

- * - * @param type a non-null pointer to an interface type description, for which - * typelib_typedescription_complete must already have been - * executed - * @return the number of local functions of the given interface type - */ -sal_Int32 getLocalFunctions(typelib_InterfaceTypeDescription const * type); - -/** - * Calculate the number of primary functions of an interface type. - * - *

The number of primary functions of an interface is the number of local - * functions of that interface (see getLocalFunctions), plus the - * number of primary functions of that interface's first base type (if it has at - * least one base type).

- * - * @param type a pointer to an interface type description; may be null - * @return the number of primary functions of the given interface type, or zero - * if the given interface type is null - */ -sal_Int32 getPrimaryFunctions(typelib_InterfaceTypeDescription * type); - -/** - * Represents a vtable slot of a C++ class. - */ -struct VtableSlot { - /** - * The offset of the vtable. - * - *

Multiple-inheritance C++ classes have more than one vtable. The - * offset is logical (not a byte offset), and must be - * non-negative.

- */ - sal_Int32 offset; - - /** - * The index within the vtable. - * - *

The index is logical (not a byte offset), and must be - * non-negative.

- */ - sal_Int32 index; -}; - -/** - * Calculates the vtable slot associated with an interface attribute member. - * - * @param ifcMember a non-null pointer to an interface attribute member - * description - * @return the vtable slot associated with the given interface member - */ -VtableSlot getVtableSlot( - typelib_InterfaceAttributeTypeDescription const * ifcMember); - -/** - * Calculates the vtable slot associated with an interface method member. - * - * @param ifcMember a non-null pointer to an interface method member description - * @return the vtable slot associated with the given interface member - */ -VtableSlot getVtableSlot( - typelib_InterfaceMethodTypeDescription const * ifcMember); - -} } } - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bridges/inc/cppinterfaceproxy.hxx b/bridges/inc/cppinterfaceproxy.hxx new file mode 100644 index 000000000000..13a2b2235f02 --- /dev/null +++ b/bridges/inc/cppinterfaceproxy.hxx @@ -0,0 +1,100 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_BRIDGES_INC_CPPINTERFACEPROXY_HXX +#define INCLUDED_BRIDGES_INC_CPPINTERFACEPROXY_HXX + +#include "osl/interlck.h" +#include "rtl/ustring.hxx" +#include "sal/types.h" +#include "typelib/typedescription.h" +#include "uno/dispatcher.h" +#include "uno/environment.h" +#include "vtablefactory.hxx" + +namespace com { namespace sun { namespace star { namespace uno { + class XInterface; +} } } } + +namespace bridges { namespace cpp_uno { namespace shared { + +class Bridge; + +extern "C" typedef void SAL_CALL FreeCppInterfaceProxy( + uno_ExtEnvironment * pEnv, void * pInterface); +FreeCppInterfaceProxy freeCppInterfaceProxy; + +/** + * A cpp proxy wrapping a uno interface. + */ +class CppInterfaceProxy { +public: + // Interface for Bridge: + + static com::sun::star::uno::XInterface * create( + Bridge * pBridge, uno_Interface * pUnoI, + typelib_InterfaceTypeDescription * pTypeDescr, + OUString const & rOId); + + // Interface for individual CPP--UNO bridges: + + Bridge * getBridge() { return pBridge; } + uno_Interface * getUnoI() { return pUnoI; } + typelib_InterfaceTypeDescription * getTypeDescr() { return pTypeDescr; } + const OUString& getOid() { return oid; } + + // non virtual methods called on incoming vtable calls #1, #2 + void acquireProxy(); + void releaseProxy(); + + static CppInterfaceProxy * castInterfaceToProxy(void * pInterface); + +private: + CppInterfaceProxy(CppInterfaceProxy &) = delete; + void operator =(const CppInterfaceProxy&) = delete; + + CppInterfaceProxy( + Bridge * pBridge_, uno_Interface * pUnoI_, + typelib_InterfaceTypeDescription * pTypeDescr_, + OUString const & rOId_); + + ~CppInterfaceProxy(); + + static com::sun::star::uno::XInterface * castProxyToInterface( + CppInterfaceProxy * pProxy); + + oslInterlockedCount nRef; + Bridge * pBridge; + + // mapping information + uno_Interface * pUnoI; // wrapped interface + typelib_InterfaceTypeDescription * pTypeDescr; + OUString oid; + + VtableFactory::Slot * vtables[1]; + + friend void SAL_CALL freeCppInterfaceProxy( + uno_ExtEnvironment * pEnv, void * pInterface); +}; + +} } } + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bridges/inc/except.hxx b/bridges/inc/except.hxx new file mode 100644 index 000000000000..32e911321161 --- /dev/null +++ b/bridges/inc/except.hxx @@ -0,0 +1,41 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_BRIDGES_INC_EXCEPT_HXX +#define INCLUDED_BRIDGES_INC_EXCEPT_HXX + +#if _MSC_VER >= 1900 // VC 2015 (and later?) +// extern "C" void** __cdecl __current_exception() +// is defined in MSVS14.0/VC/crt/src/vcruntime/frame.cpp: +// return &__vcrt_getptd()->_curexception; +// +// __vcrt_getptd is defined in vcruntime_internal.h: +//typedef struct __vcrt_ptd +//{ +// // C++ Exception Handling (EH) state +// unsigned long _NLG_dwCode; // Required by NLG routines +//[...] +//void* _curexception; // current exception +//[...] +extern "C" void** __current_exception(); +#endif + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bridges/inc/types.hxx b/bridges/inc/types.hxx new file mode 100644 index 000000000000..12e8812b5c8e --- /dev/null +++ b/bridges/inc/types.hxx @@ -0,0 +1,71 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_BRIDGES_INC_TYPES_HXX +#define INCLUDED_BRIDGES_INC_TYPES_HXX + +#include "typelib/typeclass.h" +#include "typelib/typedescription.h" + +namespace bridges { namespace cpp_uno { namespace shared { + +/** + * Determines whether a type is a "simple" type (VOID, BOOLEAN, BYTE, SHORT, + * UNSIGNED SHORT, LONG, UNSIGNED LONG, HYPER, UNSIGNED HYPER, FLOAT, DOUBLE, + * CHAR, or an enum type). + * + * @param typeClass a type class + * @return true if the given type is "simple" + */ +bool isSimpleType(typelib_TypeClass typeClass); + +/** + * Determines whether a type is a "simple" type (VOID, BOOLEAN, BYTE, SHORT, + * UNSIGNED SHORT, LONG, UNSIGNED LONG, HYPER, UNSIGNED HYPER, FLOAT, DOUBLE, + * CHAR, or an enum type). + * + * @param type a non-null pointer to a type description reference + * @return true if the given type is "simple" + */ +bool isSimpleType(typelib_TypeDescriptionReference const * type); + +/** + * Determines whether a type is a "simple" type (VOID, BOOLEAN, BYTE, SHORT, + * UNSIGNED SHORT, LONG, UNSIGNED LONG, HYPER, UNSIGNED HYPER, FLOAT, DOUBLE, + * CHAR, or an enum type). + * + * @param type a non-null pointer to a type description + * @return true if the given type is "simple" + */ +bool isSimpleType(typelib_TypeDescription const * type); + +/** + * Determines whether a type relates to an interface type (is itself an + * interface type, or might contain entities of interface type). + * + * @param type a non-null pointer to a type description + * @return true if the given type relates to an interface type + */ +bool relatesToInterfaceType(typelib_TypeDescription const * type); + +} } } + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bridges/inc/unointerfaceproxy.hxx b/bridges/inc/unointerfaceproxy.hxx new file mode 100644 index 000000000000..c9697d3491a8 --- /dev/null +++ b/bridges/inc/unointerfaceproxy.hxx @@ -0,0 +1,110 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_BRIDGES_INC_UNOINTERFACEPROXY_HXX +#define INCLUDED_BRIDGES_INC_UNOINTERFACEPROXY_HXX + +#include "osl/interlck.h" +#include "rtl/ustring.hxx" +#include "sal/types.h" +#include "typelib/typedescription.h" +#include "uno/dispatcher.h" +#include "uno/environment.h" + +namespace com { namespace sun { namespace star { namespace uno { + class XInterface; +} } } } + +namespace bridges { namespace cpp_uno { namespace shared { + +class Bridge; + +extern "C" typedef void SAL_CALL FreeUnoInterfaceProxy( + uno_ExtEnvironment * pEnv, void * pProxy); +FreeUnoInterfaceProxy freeUnoInterfaceProxy; + +// private: +extern "C" typedef void SAL_CALL UnoInterfaceProxyDispatch( + uno_Interface * pUnoI, typelib_TypeDescription const * pMemberDescr, + void * pReturn, void * pArgs[], uno_Any ** ppException); +UnoInterfaceProxyDispatch unoInterfaceProxyDispatch; + // this function is not defined in the generic part, but instead has to be + // defined individually for each CPP--UNO bridge + +// private: +extern "C" typedef void SAL_CALL AcquireProxy(uno_Interface *); +AcquireProxy acquireProxy; + +// private: +extern "C" typedef void SAL_CALL ReleaseProxy(uno_Interface *); +ReleaseProxy releaseProxy; + +/** + * A uno proxy wrapping a cpp interface. + */ +class UnoInterfaceProxy: public uno_Interface { +public: + // Interface for Bridge: + + static UnoInterfaceProxy * create( + Bridge * pBridge, com::sun::star::uno::XInterface * pCppI, + typelib_InterfaceTypeDescription * pTypeDescr, + OUString const & rOId); + + // Interface for individual CPP--UNO bridges: + + Bridge * getBridge() { return pBridge; } + com::sun::star::uno::XInterface * getCppI() { return pCppI; } + +private: + UnoInterfaceProxy(UnoInterfaceProxy &) = delete; + void operator =(const UnoInterfaceProxy&) = delete; + + UnoInterfaceProxy( + Bridge * pBridge_, com::sun::star::uno::XInterface * pCppI_, + typelib_InterfaceTypeDescription * pTypeDescr_, + OUString const & rOId_); + + ~UnoInterfaceProxy(); + + oslInterlockedCount nRef; + Bridge * pBridge; + + // mapping information + com::sun::star::uno::XInterface * pCppI; // wrapped interface + typelib_InterfaceTypeDescription * pTypeDescr; + OUString oid; + + friend void SAL_CALL freeUnoInterfaceProxy( + uno_ExtEnvironment * pEnv, void * pProxy); + + friend void SAL_CALL unoInterfaceProxyDispatch( + uno_Interface * pUnoI, typelib_TypeDescription const * pMemberDescr, + void * pReturn, void * pArgs[], uno_Any ** ppException); + + friend void SAL_CALL acquireProxy(uno_Interface * pUnoI); + + friend void SAL_CALL releaseProxy(uno_Interface * pUnoI); +}; + +} } } + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bridges/inc/vtablefactory.hxx b/bridges/inc/vtablefactory.hxx new file mode 100644 index 000000000000..7e8566e72ec4 --- /dev/null +++ b/bridges/inc/vtablefactory.hxx @@ -0,0 +1,222 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_BRIDGES_INC_VTABLEFACTORY_HXX +#define INCLUDED_BRIDGES_INC_VTABLEFACTORY_HXX + +#include "osl/mutex.hxx" +#include "rtl/alloc.h" +#include "rtl/ustring.hxx" +#include "sal/types.h" +#include "typelib/typedescription.hxx" + +#include + +/*See: http://people.redhat.com/drepper/selinux-mem.html*/ +#if defined(LINUX) || defined(OPENBSD) || defined(FREEBSD) \ + || defined(NETBSD) || defined(DRAGONFLY) || defined (ANDROID) +#define USE_DOUBLE_MMAP +#endif + +namespace bridges { namespace cpp_uno { namespace shared { + +/** Hand out vtable structures for interface type descriptions. + */ +class VtableFactory { +public: + // This structure is not defined in the generic part, but instead has to be + // defined individually for each CPP--UNO bridge: + /** A vtable slot. + */ + struct Slot; + + /** A raw vtable block. + */ + struct Block { + /** The start of the raw vtable block. + + It points to the start of the allocated memory block, whereas the + vtable pointer typically points some bytes into the block (e.g., + skipping an RTTI pointer, see mapBlockToVtable). Also, the block + contains any generated code snippets, after the vtable itself. + */ + void * start; + +#ifdef USE_DOUBLE_MMAP + /** When separately mmapping the block for writing and executing + exec points to the same memory as start, except start is used + exclusively for writing and exec for executing + */ + void * exec; + + /** File handle for the underlying anonymous file + */ + int fd; +#endif + + /** The size of the raw vtable block, in bytes. + */ + sal_Size size; + }; + + /** The vtable structure corresponding to an interface type. + */ + struct Vtables { + /** The number of blocks/vtables. + */ + sal_Int32 count; + + /** An array of blocks, representing the multiple vtables of a + (multiple-inheritance) type. + +

A block is a raw vtable. It points to the start of the allocated + memory block, whereas the vtable pointer typically points some bytes + into the block (e.g., skipping an RTTI pointer, see + mapBlockToVtable). Also, the block contains any generated code + snippets, after the vtable itself.

+ */ + Block * blocks; + Vtables() + : count(0) + , blocks(nullptr) + { + } + }; + + VtableFactory(); + + ~VtableFactory(); + + /** Given an interface type description, return its corresponding vtable + structure. + */ + Vtables getVtables(typelib_InterfaceTypeDescription * type); + + // This function is not defined in the generic part, but instead has to be + // defined individually for each CPP--UNO bridge: + /** Given a pointer to a block, turn it into a vtable pointer. + */ + static Slot * mapBlockToVtable(void * block); + +private: + class GuardedBlocks; + friend class GuardedBlocks; + + class BaseOffset; + + VtableFactory(VtableFactory &) = delete; + void operator =(const VtableFactory&) = delete; + + bool createBlock(Block &block, sal_Int32 slotCount) const; + + void freeBlock(Block const & block) const; + + sal_Int32 createVtables( + GuardedBlocks & blocks, BaseOffset const & baseOffset, + typelib_InterfaceTypeDescription * type, sal_Int32 vtableNumber, + typelib_InterfaceTypeDescription * mostDerived, bool includePrimary) + const; + + // This function is not defined in the generic part, but instead has to be + // defined individually for each CPP--UNO bridge: + /** Calculate the size of a raw vtable block. + + @param slotCount the number of virtual function slots the returned + vtable block shall support (if there are any platform-specific slots, + like an RTTI pointer, or a pointer to a destructor, they are not covered + by slotCount) + @return the size of the raw vtable block, in bytes + */ + static sal_Size getBlockSize(sal_Int32 slotCount); + + // This function is not defined in the generic part, but instead has to be + // defined individually for each CPP--UNO bridge: + /** Initialize a raw vtable block. + + @param block the start address of the raw vtable block + @param slotCount the number of slots + @param vtableNumber zero-based count across all the most derived type's + vtables (for vtable's "offset to top" slot) + @param type non-null most derived type (for vtable's "typeinfo pointer" + slot) + @return a pointer past the last vtable slot + */ + static Slot * initializeBlock( + void * block, sal_Int32 slotCount, sal_Int32 vtableNumber, + typelib_InterfaceTypeDescription * type); + + // This function is not defined in the generic part, but instead has to be + // defined individually for each CPP--UNO bridge: + /** Fill the vtable slots corresponding to all local (i.e., not inherited) + functions of a given interface type (and generate any necessary code + snippets for them). + + @param slots on input, points past the vtable slot to be filled with + the last virtual function local to the given type; on output, points to + the vtable slot filled with the first virtual function local to the + given type + @param code points to the start of the area where code snippets can be + generated + @param writetoexecdiff when the same code area is mapped twice, once for + writing for code-generation, and once for code-execution, then this + records the offset from a writable address to its executable address + @param type the interface type description for which to generate vtable + slots + @param functionOffset the function offset of the first vtable slot + (typically coded into the code snippet for that vtable slot) + @param functionCount the number of vtable slots to fill (the number of + local functions of the given type, passed in so that it need not be + recomputed) + @param vtableOffset the offset of this vtable (needed to adjust the + this pointer, typically coded into the code snippets for all the filled + vtable slots) + @return a pointer to the remaining code snippet area + */ + static unsigned char * addLocalFunctions( + Slot ** slots, unsigned char * code, +#ifdef USE_DOUBLE_MMAP + sal_PtrDiff writetoexecdiff, +#endif + typelib_InterfaceTypeDescription const * type, sal_Int32 functionOffset, + sal_Int32 functionCount, sal_Int32 vtableOffset); + + // This function is not defined in the generic part, but instead has to be + // defined individually for each CPP--UNO bridge: + /** Flush all the generated code snippets of a vtable, on platforms that + require it. + + @param begin points to the start of the code snippet area + @param end points behind the end of the code snippet area + */ + static void flushCode( + unsigned char const * begin, unsigned char const * end); + + typedef std::unordered_map< OUString, Vtables, OUStringHash > Map; + + osl::Mutex m_mutex; + Map m_map; + + rtl_arena_type * m_arena; +}; + +} } } + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bridges/inc/vtables.hxx b/bridges/inc/vtables.hxx new file mode 100644 index 000000000000..cd4c2f183c02 --- /dev/null +++ b/bridges/inc/vtables.hxx @@ -0,0 +1,102 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_BRIDGES_INC_VTABLES_HXX +#define INCLUDED_BRIDGES_INC_VTABLES_HXX + +#include "sal/types.h" +#include "typelib/typedescription.h" + +namespace bridges { namespace cpp_uno { namespace shared { + +/** + * Calculate the number of local functions of an interface type. + * + *

Local functions are those not inherited from any base types. The + * number of functions is potentially larger than the number of + * members, as each read–write attribute member counts as two + * functions.

+ * + * @param type a non-null pointer to an interface type description, for which + * typelib_typedescription_complete must already have been + * executed + * @return the number of local functions of the given interface type + */ +sal_Int32 getLocalFunctions(typelib_InterfaceTypeDescription const * type); + +/** + * Calculate the number of primary functions of an interface type. + * + *

The number of primary functions of an interface is the number of local + * functions of that interface (see getLocalFunctions), plus the + * number of primary functions of that interface's first base type (if it has at + * least one base type).

+ * + * @param type a pointer to an interface type description; may be null + * @return the number of primary functions of the given interface type, or zero + * if the given interface type is null + */ +sal_Int32 getPrimaryFunctions(typelib_InterfaceTypeDescription * type); + +/** + * Represents a vtable slot of a C++ class. + */ +struct VtableSlot { + /** + * The offset of the vtable. + * + *

Multiple-inheritance C++ classes have more than one vtable. The + * offset is logical (not a byte offset), and must be + * non-negative.

+ */ + sal_Int32 offset; + + /** + * The index within the vtable. + * + *

The index is logical (not a byte offset), and must be + * non-negative.

+ */ + sal_Int32 index; +}; + +/** + * Calculates the vtable slot associated with an interface attribute member. + * + * @param ifcMember a non-null pointer to an interface attribute member + * description + * @return the vtable slot associated with the given interface member + */ +VtableSlot getVtableSlot( + typelib_InterfaceAttributeTypeDescription const * ifcMember); + +/** + * Calculates the vtable slot associated with an interface method member. + * + * @param ifcMember a non-null pointer to an interface method member description + * @return the vtable slot associated with the given interface member + */ +VtableSlot getVtableSlot( + typelib_InterfaceMethodTypeDescription const * ifcMember); + +} } } + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bridges/source/cpp_uno/gcc3_aix_powerpc/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_aix_powerpc/cpp2uno.cxx index 0bb976716435..35dff67c18b6 100644 --- a/bridges/source/cpp_uno/gcc3_aix_powerpc/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_aix_powerpc/cpp2uno.cxx @@ -22,10 +22,10 @@ #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/vtablefactory.hxx" +#include "bridge.hxx" +#include "cppinterfaceproxy.hxx" +#include "types.hxx" +#include "vtablefactory.hxx" #include "share.hxx" diff --git a/bridges/source/cpp_uno/gcc3_aix_powerpc/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_aix_powerpc/uno2cpp.cxx index 8c2c0c061df9..5996460314a2 100644 --- a/bridges/source/cpp_uno/gcc3_aix_powerpc/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_aix_powerpc/uno2cpp.cxx @@ -23,10 +23,10 @@ #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/unointerfaceproxy.hxx" -#include "bridges/cpp_uno/shared/vtables.hxx" +#include "bridge.hxx" +#include "types.hxx" +#include "unointerfaceproxy.hxx" +#include "vtables.hxx" #include "share.hxx" #include diff --git a/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno-arm.cxx b/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno-arm.cxx index 9bd110a4b1da..64a214f1f142 100644 --- a/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno-arm.cxx +++ b/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno-arm.cxx @@ -39,10 +39,10 @@ #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/vtablefactory.hxx" +#include "bridge.hxx" +#include "cppinterfaceproxy.hxx" +#include "types.hxx" +#include "vtablefactory.hxx" #include "share.hxx" diff --git a/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno-arm64.cxx b/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno-arm64.cxx index 98ac5173eb8a..1f77e4970791 100644 --- a/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno-arm64.cxx +++ b/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno-arm64.cxx @@ -32,10 +32,10 @@ #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/vtablefactory.hxx" +#include "bridge.hxx" +#include "cppinterfaceproxy.hxx" +#include "types.hxx" +#include "vtablefactory.hxx" #include "share.hxx" diff --git a/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno-i386.cxx b/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno-i386.cxx index 5eb41411db75..addf41403bc3 100644 --- a/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno-i386.cxx +++ b/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno-i386.cxx @@ -35,10 +35,10 @@ #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/vtablefactory.hxx" +#include "bridge.hxx" +#include "cppinterfaceproxy.hxx" +#include "types.hxx" +#include "vtablefactory.hxx" #include "share.hxx" diff --git a/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno.cxx index 5fc6d624104d..46726a8b30ba 100644 --- a/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno.cxx @@ -20,7 +20,7 @@ // If we eventually get around to factoring out stuff from // cpp2uno-arm.cxx and cpp2uno-i386.cxx here, this is where to put it. -#include "bridges/cpp_uno/shared/vtablefactory.hxx" +#include "vtablefactory.hxx" void bridges::cpp_uno::shared::VtableFactory::flushCode( unsigned char const *, unsigned char const *) diff --git a/bridges/source/cpp_uno/gcc3_ios_arm/uno2cpp-arm.cxx b/bridges/source/cpp_uno/gcc3_ios_arm/uno2cpp-arm.cxx index 718bc980ef81..a48d88a36885 100644 --- a/bridges/source/cpp_uno/gcc3_ios_arm/uno2cpp-arm.cxx +++ b/bridges/source/cpp_uno/gcc3_ios_arm/uno2cpp-arm.cxx @@ -31,10 +31,10 @@ #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/unointerfaceproxy.hxx" -#include "bridges/cpp_uno/shared/vtables.hxx" +#include "bridge.hxx" +#include "types.hxx" +#include "unointerfaceproxy.hxx" +#include "vtables.hxx" #include "share.hxx" diff --git a/bridges/source/cpp_uno/gcc3_ios_arm/uno2cpp-arm64.cxx b/bridges/source/cpp_uno/gcc3_ios_arm/uno2cpp-arm64.cxx index 78e38fea6d2d..24a5704a6bfd 100644 --- a/bridges/source/cpp_uno/gcc3_ios_arm/uno2cpp-arm64.cxx +++ b/bridges/source/cpp_uno/gcc3_ios_arm/uno2cpp-arm64.cxx @@ -21,10 +21,10 @@ #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/unointerfaceproxy.hxx" -#include "bridges/cpp_uno/shared/vtables.hxx" +#include "bridge.hxx" +#include "types.hxx" +#include "unointerfaceproxy.hxx" +#include "vtables.hxx" #include "share.hxx" diff --git a/bridges/source/cpp_uno/gcc3_ios_arm/uno2cpp-i386.cxx b/bridges/source/cpp_uno/gcc3_ios_arm/uno2cpp-i386.cxx index 54af31e6c9d8..0102ea186196 100644 --- a/bridges/source/cpp_uno/gcc3_ios_arm/uno2cpp-i386.cxx +++ b/bridges/source/cpp_uno/gcc3_ios_arm/uno2cpp-i386.cxx @@ -26,10 +26,10 @@ #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/unointerfaceproxy.hxx" -#include "bridges/cpp_uno/shared/vtables.hxx" +#include "bridge.hxx" +#include "types.hxx" +#include "unointerfaceproxy.hxx" +#include "vtables.hxx" #include "share.hxx" diff --git a/bridges/source/cpp_uno/gcc3_ios_arm/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_ios_arm/uno2cpp.cxx index 1ab4839fd88d..17bd59583737 100644 --- a/bridges/source/cpp_uno/gcc3_ios_arm/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_ios_arm/uno2cpp.cxx @@ -17,10 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/unointerfaceproxy.hxx" -#include "bridges/cpp_uno/shared/vtables.hxx" +#include "bridge.hxx" +#include "types.hxx" +#include "unointerfaceproxy.hxx" +#include "vtables.hxx" #include "share.hxx" diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx index 7f23e1ef5c6b..e700aa8fd86a 100644 --- a/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx @@ -35,10 +35,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_aarch64/uno2cpp.cxx index aa484bc2668c..4e7d69b0a871 100644 --- a/bridges/source/cpp_uno/gcc3_linux_aarch64/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/uno2cpp.cxx @@ -26,10 +26,10 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include diff --git a/bridges/source/cpp_uno/gcc3_linux_alpha/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_alpha/cpp2uno.cxx index f132d7e8c728..7425acdcc66d 100644 --- a/bridges/source/cpp_uno/gcc3_linux_alpha/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_alpha/cpp2uno.cxx @@ -23,10 +23,10 @@ #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/vtablefactory.hxx" +#include "bridge.hxx" +#include "cppinterfaceproxy.hxx" +#include "types.hxx" +#include "vtablefactory.hxx" #include "share.hxx" #include diff --git a/bridges/source/cpp_uno/gcc3_linux_alpha/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_alpha/uno2cpp.cxx index 4c04088016fc..d13e2dd3eeb7 100644 --- a/bridges/source/cpp_uno/gcc3_linux_alpha/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_alpha/uno2cpp.cxx @@ -23,10 +23,10 @@ #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/unointerfaceproxy.hxx" -#include "bridges/cpp_uno/shared/vtables.hxx" +#include "bridge.hxx" +#include "types.hxx" +#include "unointerfaceproxy.hxx" +#include "vtables.hxx" #include "share.hxx" diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx index c7b5fd94cbc0..1dbf12f92f60 100644 --- a/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx @@ -28,10 +28,10 @@ #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/vtablefactory.hxx" +#include "bridge.hxx" +#include "cppinterfaceproxy.hxx" +#include "types.hxx" +#include "vtablefactory.hxx" #include "share.hxx" diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx index f9960819bde7..8942d1f948bd 100644 --- a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx @@ -24,10 +24,10 @@ #include "com/sun/star/uno/RuntimeException.hpp" #include -#include -#include -#include -#include +#include +#include +#include +#include #include "share.hxx" diff --git a/bridges/source/cpp_uno/gcc3_linux_hppa/call.cxx b/bridges/source/cpp_uno/gcc3_linux_hppa/call.cxx index e992110f9807..29f01bfbdede 100644 --- a/bridges/source/cpp_uno/gcc3_linux_hppa/call.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_hppa/call.cxx @@ -24,10 +24,10 @@ #include "com/sun/star/uno/RuntimeException.hpp" #include -#include -#include -#include -#include +#include +#include +#include +#include #include "share.hxx" diff --git a/bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx index d20cc0b7476f..97377d760430 100644 --- a/bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx @@ -28,10 +28,10 @@ #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/vtablefactory.hxx" +#include "bridge.hxx" +#include "cppinterfaceproxy.hxx" +#include "types.hxx" +#include "vtablefactory.hxx" #include "share.hxx" diff --git a/bridges/source/cpp_uno/gcc3_linux_hppa/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_hppa/uno2cpp.cxx index 86958ad8f94a..730f38f69022 100644 --- a/bridges/source/cpp_uno/gcc3_linux_hppa/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_hppa/uno2cpp.cxx @@ -24,10 +24,10 @@ #include "com/sun/star/uno/RuntimeException.hpp" #include -#include -#include -#include -#include +#include +#include +#include +#include #include "share.hxx" diff --git a/bridges/source/cpp_uno/gcc3_linux_ia64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_ia64/cpp2uno.cxx index ec333fd659c5..7874de3dab51 100644 --- a/bridges/source/cpp_uno/gcc3_linux_ia64/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_ia64/cpp2uno.cxx @@ -23,10 +23,10 @@ #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/vtablefactory.hxx" +#include "bridge.hxx" +#include "cppinterfaceproxy.hxx" +#include "types.hxx" +#include "vtablefactory.hxx" #include "share.hxx" #include diff --git a/bridges/source/cpp_uno/gcc3_linux_ia64/share.hxx b/bridges/source/cpp_uno/gcc3_linux_ia64/share.hxx index a24dd4078bd7..1b24c9253b4b 100644 --- a/bridges/source/cpp_uno/gcc3_linux_ia64/share.hxx +++ b/bridges/source/cpp_uno/gcc3_linux_ia64/share.hxx @@ -24,7 +24,7 @@ #include #include #include -#include "bridges/cpp_uno/shared/vtablefactory.hxx" +#include "vtablefactory.hxx" namespace CPPU_CURRENT_NAMESPACE { diff --git a/bridges/source/cpp_uno/gcc3_linux_ia64/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_ia64/uno2cpp.cxx index a395a5dd8c17..b87a848a3ff3 100644 --- a/bridges/source/cpp_uno/gcc3_linux_ia64/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_ia64/uno2cpp.cxx @@ -23,10 +23,10 @@ #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/unointerfaceproxy.hxx" -#include "bridges/cpp_uno/shared/vtables.hxx" +#include "bridge.hxx" +#include "types.hxx" +#include "unointerfaceproxy.hxx" +#include "vtables.hxx" #include "share.hxx" diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_intel/cpp2uno.cxx index 70784124d0be..fcbe63047345 100644 --- a/bridges/source/cpp_uno/gcc3_linux_intel/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_intel/cpp2uno.cxx @@ -24,10 +24,10 @@ #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/vtablefactory.hxx" +#include "bridge.hxx" +#include "cppinterfaceproxy.hxx" +#include "types.hxx" +#include "vtablefactory.hxx" #include "call.hxx" #include "share.hxx" diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx index 351bac12a1d2..d7679ea5e490 100644 --- a/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx @@ -24,10 +24,10 @@ #include "com/sun/star/uno/RuntimeException.hpp" #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/unointerfaceproxy.hxx" -#include "bridges/cpp_uno/shared/vtables.hxx" +#include "bridge.hxx" +#include "types.hxx" +#include "unointerfaceproxy.hxx" +#include "vtables.hxx" #include "callvirtualmethod.hxx" #include "share.hxx" diff --git a/bridges/source/cpp_uno/gcc3_linux_m68k/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_m68k/cpp2uno.cxx index 824993d88d9f..53851c25be97 100644 --- a/bridges/source/cpp_uno/gcc3_linux_m68k/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_m68k/cpp2uno.cxx @@ -28,10 +28,10 @@ #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/vtablefactory.hxx" +#include "bridge.hxx" +#include "cppinterfaceproxy.hxx" +#include "types.hxx" +#include "vtablefactory.hxx" #include "share.hxx" diff --git a/bridges/source/cpp_uno/gcc3_linux_m68k/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_m68k/uno2cpp.cxx index b5b8606b46ee..2808dc45b38d 100644 --- a/bridges/source/cpp_uno/gcc3_linux_m68k/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_m68k/uno2cpp.cxx @@ -24,10 +24,10 @@ #include "com/sun/star/uno/RuntimeException.hpp" #include -#include -#include -#include -#include +#include +#include +#include +#include #include "share.hxx" diff --git a/bridges/source/cpp_uno/gcc3_linux_mips/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_mips/cpp2uno.cxx index 6e0a7dc72eb3..aeb07301d18f 100644 --- a/bridges/source/cpp_uno/gcc3_linux_mips/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_mips/cpp2uno.cxx @@ -21,10 +21,10 @@ #include #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/vtablefactory.hxx" +#include "bridge.hxx" +#include "cppinterfaceproxy.hxx" +#include "types.hxx" +#include "vtablefactory.hxx" #include "share.hxx" #include diff --git a/bridges/source/cpp_uno/gcc3_linux_mips/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_mips/uno2cpp.cxx index 8d904658775f..74fb519f5ea2 100644 --- a/bridges/source/cpp_uno/gcc3_linux_mips/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_mips/uno2cpp.cxx @@ -22,10 +22,10 @@ #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/unointerfaceproxy.hxx" -#include "bridges/cpp_uno/shared/vtables.hxx" +#include "bridge.hxx" +#include "types.hxx" +#include "unointerfaceproxy.hxx" +#include "vtables.hxx" #include "share.hxx" diff --git a/bridges/source/cpp_uno/gcc3_linux_mips64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_mips64/cpp2uno.cxx index 8f510c82ecc6..fba5df3a3457 100644 --- a/bridges/source/cpp_uno/gcc3_linux_mips64/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_mips64/cpp2uno.cxx @@ -21,10 +21,10 @@ #include #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/vtablefactory.hxx" +#include "bridge.hxx" +#include "cppinterfaceproxy.hxx" +#include "types.hxx" +#include "vtablefactory.hxx" #include "call.hxx" #include "share.hxx" diff --git a/bridges/source/cpp_uno/gcc3_linux_mips64/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_mips64/uno2cpp.cxx index 859ffe5b3142..d2a3c1c3c0f3 100644 --- a/bridges/source/cpp_uno/gcc3_linux_mips64/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_mips64/uno2cpp.cxx @@ -23,10 +23,10 @@ #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/unointerfaceproxy.hxx" -#include "bridges/cpp_uno/shared/vtables.hxx" +#include "bridge.hxx" +#include "types.hxx" +#include "unointerfaceproxy.hxx" +#include "vtables.hxx" #include "share.hxx" diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_powerpc/cpp2uno.cxx index 69a590cb6b6f..f3327f9d7ce3 100644 --- a/bridges/source/cpp_uno/gcc3_linux_powerpc/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_powerpc/cpp2uno.cxx @@ -25,10 +25,10 @@ #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/vtablefactory.hxx" +#include "bridge.hxx" +#include "cppinterfaceproxy.hxx" +#include "types.hxx" +#include "vtablefactory.hxx" #include "share.hxx" diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_powerpc/uno2cpp.cxx index 6b26bcdd4d45..070c899215d3 100644 --- a/bridges/source/cpp_uno/gcc3_linux_powerpc/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_powerpc/uno2cpp.cxx @@ -23,10 +23,10 @@ #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/unointerfaceproxy.hxx" -#include "bridges/cpp_uno/shared/vtables.hxx" +#include "bridge.hxx" +#include "types.hxx" +#include "unointerfaceproxy.hxx" +#include "vtables.hxx" #include "share.hxx" diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx index 6ac003b2ab8f..f9384a5ec057 100644 --- a/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx @@ -23,10 +23,10 @@ #include #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/vtablefactory.hxx" +#include "bridge.hxx" +#include "cppinterfaceproxy.hxx" +#include "types.hxx" +#include "vtablefactory.hxx" #include "share.hxx" #include diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx index 28dfaf8f118e..7beb1a330ecb 100644 --- a/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx @@ -23,10 +23,10 @@ #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/unointerfaceproxy.hxx" -#include "bridges/cpp_uno/shared/vtables.hxx" +#include "bridge.hxx" +#include "types.hxx" +#include "unointerfaceproxy.hxx" +#include "vtables.hxx" #include "share.hxx" diff --git a/bridges/source/cpp_uno/gcc3_linux_s390/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_s390/cpp2uno.cxx index a14021ea5ae0..a9d386f98dc5 100644 --- a/bridges/source/cpp_uno/gcc3_linux_s390/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_s390/cpp2uno.cxx @@ -23,10 +23,10 @@ #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/vtablefactory.hxx" +#include "bridge.hxx" +#include "cppinterfaceproxy.hxx" +#include "types.hxx" +#include "vtablefactory.hxx" #include "share.hxx" #include diff --git a/bridges/source/cpp_uno/gcc3_linux_s390/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_s390/uno2cpp.cxx index 575e22dfd98e..0b19523a4594 100644 --- a/bridges/source/cpp_uno/gcc3_linux_s390/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_s390/uno2cpp.cxx @@ -23,10 +23,10 @@ #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/unointerfaceproxy.hxx" -#include "bridges/cpp_uno/shared/vtables.hxx" +#include "bridge.hxx" +#include "types.hxx" +#include "unointerfaceproxy.hxx" +#include "vtables.hxx" #include "share.hxx" diff --git a/bridges/source/cpp_uno/gcc3_linux_s390x/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_s390x/cpp2uno.cxx index 82fd47258734..7db6d13422c1 100644 --- a/bridges/source/cpp_uno/gcc3_linux_s390x/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_s390x/cpp2uno.cxx @@ -23,10 +23,10 @@ #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/vtablefactory.hxx" +#include "bridge.hxx" +#include "cppinterfaceproxy.hxx" +#include "types.hxx" +#include "vtablefactory.hxx" #include "share.hxx" #include diff --git a/bridges/source/cpp_uno/gcc3_linux_s390x/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_s390x/uno2cpp.cxx index ac6260c1caec..0e206f891424 100644 --- a/bridges/source/cpp_uno/gcc3_linux_s390x/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_s390x/uno2cpp.cxx @@ -23,10 +23,10 @@ #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/unointerfaceproxy.hxx" -#include "bridges/cpp_uno/shared/vtables.hxx" +#include "bridge.hxx" +#include "types.hxx" +#include "unointerfaceproxy.hxx" +#include "vtables.hxx" #include "share.hxx" diff --git a/bridges/source/cpp_uno/gcc3_linux_sparc/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_sparc/cpp2uno.cxx index 966bac6a1366..b47f81f94a56 100644 --- a/bridges/source/cpp_uno/gcc3_linux_sparc/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_sparc/cpp2uno.cxx @@ -21,10 +21,10 @@ #include #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/vtablefactory.hxx" +#include "bridge.hxx" +#include "cppinterfaceproxy.hxx" +#include "types.hxx" +#include "vtablefactory.hxx" #include "share.hxx" using namespace com::sun::star::uno; diff --git a/bridges/source/cpp_uno/gcc3_linux_sparc/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_sparc/uno2cpp.cxx index 5f105abdd0cd..817955d9b9fa 100644 --- a/bridges/source/cpp_uno/gcc3_linux_sparc/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_sparc/uno2cpp.cxx @@ -21,10 +21,10 @@ #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/unointerfaceproxy.hxx" -#include "bridges/cpp_uno/shared/vtables.hxx" +#include "bridge.hxx" +#include "types.hxx" +#include "unointerfaceproxy.hxx" +#include "vtables.hxx" #include "share.hxx" diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx index c30249d08af7..c389edefbca8 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx @@ -31,10 +31,10 @@ #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/vtablefactory.hxx" +#include "bridge.hxx" +#include "cppinterfaceproxy.hxx" +#include "types.hxx" +#include "vtablefactory.hxx" #include "abi.hxx" #include "call.hxx" diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx index 647d3ec38b09..71e76a9f3b09 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx @@ -29,10 +29,10 @@ #include "com/sun/star/uno/RuntimeException.hpp" #include -#include -#include -#include "bridges/cpp_uno/shared/unointerfaceproxy.hxx" -#include "bridges/cpp_uno/shared/vtables.hxx" +#include +#include +#include "unointerfaceproxy.hxx" +#include "vtables.hxx" #include "abi.hxx" #include "callvirtualmethod.hxx" diff --git a/bridges/source/cpp_uno/gcc3_macosx_x86-64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_macosx_x86-64/cpp2uno.cxx index d80a66a860b6..6786c9530150 100644 --- a/bridges/source/cpp_uno/gcc3_macosx_x86-64/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_macosx_x86-64/cpp2uno.cxx @@ -30,10 +30,10 @@ #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/vtablefactory.hxx" +#include "bridge.hxx" +#include "cppinterfaceproxy.hxx" +#include "types.hxx" +#include "vtablefactory.hxx" #include "abi.hxx" #include "call.hxx" diff --git a/bridges/source/cpp_uno/gcc3_macosx_x86-64/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_macosx_x86-64/uno2cpp.cxx index 1555f55b7bf8..ecf906633966 100644 --- a/bridges/source/cpp_uno/gcc3_macosx_x86-64/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_macosx_x86-64/uno2cpp.cxx @@ -29,10 +29,10 @@ #include "com/sun/star/uno/RuntimeException.hpp" #include -#include -#include -#include "bridges/cpp_uno/shared/unointerfaceproxy.hxx" -#include "bridges/cpp_uno/shared/vtables.hxx" +#include +#include +#include "unointerfaceproxy.hxx" +#include "vtables.hxx" #include "abi.hxx" #include "callvirtualmethod.hxx" diff --git a/bridges/source/cpp_uno/gcc3_solaris_intel/callvirtualmethod.cxx b/bridges/source/cpp_uno/gcc3_solaris_intel/callvirtualmethod.cxx index 00f9bdca31e6..1f54296fce11 100644 --- a/bridges/source/cpp_uno/gcc3_solaris_intel/callvirtualmethod.cxx +++ b/bridges/source/cpp_uno/gcc3_solaris_intel/callvirtualmethod.cxx @@ -21,10 +21,10 @@ #include "com/sun/star/uno/RuntimeException.hpp" #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/unointerfaceproxy.hxx" -#include "bridges/cpp_uno/shared/vtables.hxx" +#include "bridge.hxx" +#include "types.hxx" +#include "unointerfaceproxy.hxx" +#include "vtables.hxx" #include "share.hxx" diff --git a/bridges/source/cpp_uno/gcc3_solaris_intel/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_solaris_intel/cpp2uno.cxx index aee85cc7eae2..21c5722d76be 100644 --- a/bridges/source/cpp_uno/gcc3_solaris_intel/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_solaris_intel/cpp2uno.cxx @@ -27,10 +27,10 @@ #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/vtablefactory.hxx" +#include "bridge.hxx" +#include "cppinterfaceproxy.hxx" +#include "types.hxx" +#include "vtablefactory.hxx" #include "share.hxx" diff --git a/bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx index e031f7f877dd..977f934e939f 100644 --- a/bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx @@ -25,10 +25,10 @@ #include "com/sun/star/uno/RuntimeException.hpp" #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/unointerfaceproxy.hxx" -#include "bridges/cpp_uno/shared/vtables.hxx" +#include "bridge.hxx" +#include "types.hxx" +#include "unointerfaceproxy.hxx" +#include "vtables.hxx" #include "share.hxx" diff --git a/bridges/source/cpp_uno/gcc3_solaris_sparc/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_solaris_sparc/cpp2uno.cxx index 4b22dc843076..949912276d39 100644 --- a/bridges/source/cpp_uno/gcc3_solaris_sparc/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_solaris_sparc/cpp2uno.cxx @@ -21,10 +21,10 @@ #include #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/vtablefactory.hxx" +#include "bridge.hxx" +#include "cppinterfaceproxy.hxx" +#include "types.hxx" +#include "vtablefactory.hxx" #include "share.hxx" #include diff --git a/bridges/source/cpp_uno/gcc3_solaris_sparc/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_solaris_sparc/uno2cpp.cxx index 132e31dddabc..91abdaabae9a 100644 --- a/bridges/source/cpp_uno/gcc3_solaris_sparc/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_solaris_sparc/uno2cpp.cxx @@ -21,10 +21,10 @@ #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/unointerfaceproxy.hxx" -#include "bridges/cpp_uno/shared/vtables.hxx" +#include "bridge.hxx" +#include "types.hxx" +#include "unointerfaceproxy.hxx" +#include "vtables.hxx" #include "share.hxx" diff --git a/bridges/source/cpp_uno/mingw_intel/cpp2uno.cxx b/bridges/source/cpp_uno/mingw_intel/cpp2uno.cxx index abe666fc8ddb..d69366938b18 100644 --- a/bridges/source/cpp_uno/mingw_intel/cpp2uno.cxx +++ b/bridges/source/cpp_uno/mingw_intel/cpp2uno.cxx @@ -25,10 +25,10 @@ #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/vtablefactory.hxx" +#include "bridge.hxx" +#include "cppinterfaceproxy.hxx" +#include "types.hxx" +#include "vtablefactory.hxx" #include "share.hxx" #include "smallstruct.hxx" diff --git a/bridges/source/cpp_uno/mingw_intel/smallstruct.cxx b/bridges/source/cpp_uno/mingw_intel/smallstruct.cxx index 2f617e96cd37..58c0338630f2 100644 --- a/bridges/source/cpp_uno/mingw_intel/smallstruct.cxx +++ b/bridges/source/cpp_uno/mingw_intel/smallstruct.cxx @@ -18,7 +18,7 @@ */ -#include "bridges/cpp_uno/shared/types.hxx" +#include "types.hxx" #include "typelib/typeclass.h" #include "typelib/typedescription.h" diff --git a/bridges/source/cpp_uno/mingw_intel/uno2cpp.cxx b/bridges/source/cpp_uno/mingw_intel/uno2cpp.cxx index 75c3a34dc61f..5353da36848a 100644 --- a/bridges/source/cpp_uno/mingw_intel/uno2cpp.cxx +++ b/bridges/source/cpp_uno/mingw_intel/uno2cpp.cxx @@ -23,10 +23,10 @@ #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/unointerfaceproxy.hxx" -#include "bridges/cpp_uno/shared/vtables.hxx" +#include "bridge.hxx" +#include "types.hxx" +#include "unointerfaceproxy.hxx" +#include "vtables.hxx" #include "callvirtualmethod.hxx" #include "share.hxx" diff --git a/bridges/source/cpp_uno/mingw_x86-64/cpp2uno.cxx b/bridges/source/cpp_uno/mingw_x86-64/cpp2uno.cxx index 08c7b7b3df87..d64252008ae1 100644 --- a/bridges/source/cpp_uno/mingw_x86-64/cpp2uno.cxx +++ b/bridges/source/cpp_uno/mingw_x86-64/cpp2uno.cxx @@ -30,10 +30,10 @@ #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/vtablefactory.hxx" +#include "bridge.hxx" +#include "cppinterfaceproxy.hxx" +#include "types.hxx" +#include "vtablefactory.hxx" #include "abi.hxx" #include "share.hxx" diff --git a/bridges/source/cpp_uno/mingw_x86-64/uno2cpp.cxx b/bridges/source/cpp_uno/mingw_x86-64/uno2cpp.cxx index 9706f0cc2d04..88dc1532a2cf 100644 --- a/bridges/source/cpp_uno/mingw_x86-64/uno2cpp.cxx +++ b/bridges/source/cpp_uno/mingw_x86-64/uno2cpp.cxx @@ -28,10 +28,10 @@ #include #include -#include -#include -#include "bridges/cpp_uno/shared/unointerfaceproxy.hxx" -#include "bridges/cpp_uno/shared/vtables.hxx" +#include +#include +#include "unointerfaceproxy.hxx" +#include "vtables.hxx" #include "abi.hxx" #include "callvirtualmethod.hxx" diff --git a/bridges/source/cpp_uno/msvc_win32_intel/cpp2uno.cxx b/bridges/source/cpp_uno/msvc_win32_intel/cpp2uno.cxx index 58e4d642efe4..62480db64929 100644 --- a/bridges/source/cpp_uno/msvc_win32_intel/cpp2uno.cxx +++ b/bridges/source/cpp_uno/msvc_win32_intel/cpp2uno.cxx @@ -25,10 +25,10 @@ #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/vtablefactory.hxx" +#include "bridge.hxx" +#include "cppinterfaceproxy.hxx" +#include "types.hxx" +#include "vtablefactory.hxx" #include "msci.hxx" diff --git a/bridges/source/cpp_uno/msvc_win32_intel/except.cxx b/bridges/source/cpp_uno/msvc_win32_intel/except.cxx index f8c4ff6bfeba..d6c6271802c7 100644 --- a/bridges/source/cpp_uno/msvc_win32_intel/except.cxx +++ b/bridges/source/cpp_uno/msvc_win32_intel/except.cxx @@ -33,7 +33,7 @@ #include "com/sun/star/uno/Any.hxx" #include #include "msci.hxx" -#include "bridges/cpp_uno/shared/except.hxx" +#include "except.hxx" #pragma pack(push, 8) diff --git a/bridges/source/cpp_uno/msvc_win32_intel/uno2cpp.cxx b/bridges/source/cpp_uno/msvc_win32_intel/uno2cpp.cxx index f1007dd55aec..bbc7fb985709 100644 --- a/bridges/source/cpp_uno/msvc_win32_intel/uno2cpp.cxx +++ b/bridges/source/cpp_uno/msvc_win32_intel/uno2cpp.cxx @@ -23,10 +23,10 @@ #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/unointerfaceproxy.hxx" -#include "bridges/cpp_uno/shared/vtables.hxx" +#include "bridge.hxx" +#include "types.hxx" +#include "unointerfaceproxy.hxx" +#include "vtables.hxx" #include "msci.hxx" diff --git a/bridges/source/cpp_uno/msvc_win32_x86-64/cpp2uno.cxx b/bridges/source/cpp_uno/msvc_win32_x86-64/cpp2uno.cxx index a1a27c126970..c1a650bbc81f 100644 --- a/bridges/source/cpp_uno/msvc_win32_x86-64/cpp2uno.cxx +++ b/bridges/source/cpp_uno/msvc_win32_x86-64/cpp2uno.cxx @@ -25,10 +25,10 @@ #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/vtablefactory.hxx" +#include "bridge.hxx" +#include "cppinterfaceproxy.hxx" +#include "types.hxx" +#include "vtablefactory.hxx" #include "mscx.hxx" diff --git a/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx b/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx index 9d8056d1fdc4..f66e9b15b6cc 100644 --- a/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx +++ b/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx @@ -250,7 +250,7 @@ void #include "com/sun/star/uno/Any.hxx" #include #include "mscx.hxx" -#include "bridges/cpp_uno/shared/except.hxx" +#include "except.hxx" //TOOD: Work around missing __CxxDetectRethrow in clang-cl for now (predefined // in cl, ): diff --git a/bridges/source/cpp_uno/msvc_win32_x86-64/uno2cpp.cxx b/bridges/source/cpp_uno/msvc_win32_x86-64/uno2cpp.cxx index 05d3ec9f7408..4e455f9d4a44 100644 --- a/bridges/source/cpp_uno/msvc_win32_x86-64/uno2cpp.cxx +++ b/bridges/source/cpp_uno/msvc_win32_x86-64/uno2cpp.cxx @@ -26,10 +26,10 @@ #include #include -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/types.hxx" -#include "bridges/cpp_uno/shared/unointerfaceproxy.hxx" -#include "bridges/cpp_uno/shared/vtables.hxx" +#include "bridge.hxx" +#include "types.hxx" +#include "unointerfaceproxy.hxx" +#include "vtables.hxx" #include "mscx.hxx" diff --git a/bridges/source/cpp_uno/shared/bridge.cxx b/bridges/source/cpp_uno/shared/bridge.cxx index 42b83f8a9f79..004f8954986e 100644 --- a/bridges/source/cpp_uno/shared/bridge.cxx +++ b/bridges/source/cpp_uno/shared/bridge.cxx @@ -18,10 +18,10 @@ */ -#include "bridges/cpp_uno/shared/bridge.hxx" +#include "bridge.hxx" -#include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx" -#include "bridges/cpp_uno/shared/unointerfaceproxy.hxx" +#include "cppinterfaceproxy.hxx" +#include "unointerfaceproxy.hxx" #include "com/sun/star/uno/XInterface.hpp" #include "osl/interlck.h" diff --git a/bridges/source/cpp_uno/shared/component.cxx b/bridges/source/cpp_uno/shared/component.cxx index 97a0214f6705..0e5759239d5b 100644 --- a/bridges/source/cpp_uno/shared/component.cxx +++ b/bridges/source/cpp_uno/shared/component.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "bridges/cpp_uno/shared/bridge.hxx" +#include "bridge.hxx" #include "com/sun/star/uno/Reference.hxx" #include "com/sun/star/uno/RuntimeException.hpp" diff --git a/bridges/source/cpp_uno/shared/cppinterfaceproxy.cxx b/bridges/source/cpp_uno/shared/cppinterfaceproxy.cxx index ec8c33a7f42e..f7f2eda4777e 100644 --- a/bridges/source/cpp_uno/shared/cppinterfaceproxy.cxx +++ b/bridges/source/cpp_uno/shared/cppinterfaceproxy.cxx @@ -17,12 +17,12 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx" +#include "cppinterfaceproxy.hxx" #include "guardedarray.hxx" -#include "bridges/cpp_uno/shared/bridge.hxx" -#include "bridges/cpp_uno/shared/vtablefactory.hxx" +#include "bridge.hxx" +#include "vtablefactory.hxx" #include "com/sun/star/uno/XInterface.hpp" #include "osl/getglobalmutex.hxx" diff --git a/bridges/source/cpp_uno/shared/types.cxx b/bridges/source/cpp_uno/shared/types.cxx index 07b048dda239..a4bdb1bbe25f 100644 --- a/bridges/source/cpp_uno/shared/types.cxx +++ b/bridges/source/cpp_uno/shared/types.cxx @@ -18,7 +18,7 @@ */ -#include "bridges/cpp_uno/shared/types.hxx" +#include "types.hxx" #include "typelib/typeclass.h" #include "typelib/typedescription.h" diff --git a/bridges/source/cpp_uno/shared/unointerfaceproxy.cxx b/bridges/source/cpp_uno/shared/unointerfaceproxy.cxx index 6b7aae26649e..e36ced8e5d6e 100644 --- a/bridges/source/cpp_uno/shared/unointerfaceproxy.cxx +++ b/bridges/source/cpp_uno/shared/unointerfaceproxy.cxx @@ -17,9 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "bridges/cpp_uno/shared/unointerfaceproxy.hxx" +#include "unointerfaceproxy.hxx" -#include "bridges/cpp_uno/shared/bridge.hxx" +#include "bridge.hxx" #include "com/sun/star/uno/XInterface.hpp" #include "osl/interlck.h" diff --git a/bridges/source/cpp_uno/shared/vtablefactory.cxx b/bridges/source/cpp_uno/shared/vtablefactory.cxx index 3e1564c844ef..c2c6b8e93ecb 100644 --- a/bridges/source/cpp_uno/shared/vtablefactory.cxx +++ b/bridges/source/cpp_uno/shared/vtablefactory.cxx @@ -18,11 +18,11 @@ */ -#include "bridges/cpp_uno/shared/vtablefactory.hxx" +#include "vtablefactory.hxx" #include "guardedarray.hxx" -#include "bridges/cpp_uno/shared/vtables.hxx" +#include "vtables.hxx" #include "osl/thread.h" #include "osl/security.hxx" diff --git a/bridges/source/cpp_uno/shared/vtables.cxx b/bridges/source/cpp_uno/shared/vtables.cxx index 2571cc80d5b5..4e70a2c5e44e 100644 --- a/bridges/source/cpp_uno/shared/vtables.cxx +++ b/bridges/source/cpp_uno/shared/vtables.cxx @@ -18,7 +18,7 @@ */ -#include "bridges/cpp_uno/shared/vtables.hxx" +#include "vtables.hxx" #include "sal/types.h" #include "typelib/typedescription.h" diff --git a/idlc/inc/astattribute.hxx b/idlc/inc/astattribute.hxx new file mode 100644 index 000000000000..2d88b47e4082 --- /dev/null +++ b/idlc/inc/astattribute.hxx @@ -0,0 +1,110 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_IDLC_INC_ASTATTRIBUTE_HXX +#define INCLUDED_IDLC_INC_ASTATTRIBUTE_HXX + +#include +#include "astscope.hxx" + +#include +#include + +namespace typereg { class Writer; } + +class AstAttribute: public AstDeclaration, public AstScope { +public: + AstAttribute( + sal_uInt32 flags, AstType const * type, OString const & name, + AstScope * scope): + AstDeclaration(NT_attribute, name, scope), + AstScope(NT_attribute), m_flags(flags), m_pType(type) + {} + + AstAttribute(NodeType nodeType, sal_uInt32 flags, AstType const * pType, const OString& name, AstScope* pScope) + : AstDeclaration(nodeType, name, pScope), AstScope(nodeType) + , m_flags(flags) + , m_pType(pType) + {} + virtual ~AstAttribute() {} + + void setExceptions( + OUString const * getDoc, DeclList const * getExc, + OUString const * setDoc, DeclList const * setExc) + { + if (getDoc != nullptr) { + m_getDocumentation = *getDoc; + } + if (getExc != nullptr) { + m_getExceptions = *getExc; + } + if (setDoc != nullptr) { + m_setDocumentation = *setDoc; + } + if (setExc != nullptr) { + m_setExceptions = *setExc; + } + } + + DeclList::size_type getGetExceptionCount() const + { return m_getExceptions.size(); } + + DeclList::size_type getSetExceptionCount() const + { return m_setExceptions.size(); } + + AstType const * getType() const + { return m_pType; } + bool isReadonly() const + { return ((m_flags & AF_READONLY) == AF_READONLY); } + bool isOptional() const + { return ((m_flags & AF_OPTIONAL) == AF_OPTIONAL); } + bool isBound() const + { return ((m_flags & AF_BOUND) == AF_BOUND); } + bool isMayBeVoid() const + { return ((m_flags & AF_MAYBEVOID) == AF_MAYBEVOID); } + bool isConstrained() const + { return ((m_flags & AF_CONSTRAINED) == AF_CONSTRAINED); } + bool isTransient() const + { return ((m_flags & AF_TRANSIENT) == AF_TRANSIENT); } + bool isMayBeAmbiguous() const + { return ((m_flags & AF_MAYBEAMBIGUOUS) == AF_MAYBEAMBIGUOUS); } + bool isMayBeDefault() const + { return ((m_flags & AF_MAYBEDEFAULT) == AF_MAYBEDEFAULT); } + bool isRemoveable() const + { return ((m_flags & AF_REMOVABLE) == AF_REMOVABLE); } + + bool dumpBlob( + typereg::Writer & rBlob, sal_uInt16 index, sal_uInt16 * methodIndex); + +private: + void dumpExceptions( + typereg::Writer & writer, OUString const & documentation, + DeclList const & exceptions, RTMethodMode flags, + sal_uInt16 * methodIndex); + + const sal_uInt32 m_flags; + AstType const * m_pType; + OUString m_getDocumentation; + DeclList m_getExceptions; + OUString m_setDocumentation; + DeclList m_setExceptions; +}; + +#endif // INCLUDED_IDLC_INC_ASTATTRIBUTE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astbasetype.hxx b/idlc/inc/astbasetype.hxx new file mode 100644 index 000000000000..a7edf3d817b0 --- /dev/null +++ b/idlc/inc/astbasetype.hxx @@ -0,0 +1,55 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_IDLC_INC_ASTBASETYPE_HXX +#define INCLUDED_IDLC_INC_ASTBASETYPE_HXX + +#include +#include + + +class AstBaseType : public AstType +{ +public: + AstBaseType(const ExprType type, const OString& name, AstScope* pScope) + : AstType(NT_predefined, name, pScope) + , m_exprType(type) + {} + + virtual ~AstBaseType() {} + + virtual bool isUnsigned() const override { + switch (m_exprType) { + case ET_ushort: + case ET_ulong: + case ET_uhyper: + return true; + default: + return false; + } + } + + ExprType getExprType() const + { return m_exprType; } +private: + const ExprType m_exprType; +}; + +#endif // INCLUDED_IDLC_INC_ASTBASETYPE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astconstant.hxx b/idlc/inc/astconstant.hxx new file mode 100644 index 000000000000..7453c47954b3 --- /dev/null +++ b/idlc/inc/astconstant.hxx @@ -0,0 +1,50 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_IDLC_INC_ASTCONSTANT_HXX +#define INCLUDED_IDLC_INC_ASTCONSTANT_HXX + +#include +#include + +namespace typereg { class Writer; } + +class AstConstant : public AstDeclaration +{ +public: + AstConstant(const ExprType type, const NodeType nodeType, + AstExpression* pExpr, const OString& name, AstScope* pScope); + AstConstant(const ExprType type, AstExpression* pExpr, + const OString& name, AstScope* pScope); + virtual ~AstConstant(); + + AstExpression* getConstValue() + { return m_pConstValue; } + ExprType getConstValueType() const + { return m_constValueType; } + + bool dumpBlob( + typereg::Writer & rBlob, sal_uInt16 index, bool published); +private: + AstExpression* m_pConstValue; + const ExprType m_constValueType; +}; + +#endif // INCLUDED_IDLC_INC_ASTCONSTANT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astconstants.hxx b/idlc/inc/astconstants.hxx new file mode 100644 index 000000000000..f3f7f3bed2d1 --- /dev/null +++ b/idlc/inc/astconstants.hxx @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_IDLC_INC_ASTCONSTANTS_HXX +#define INCLUDED_IDLC_INC_ASTCONSTANTS_HXX + +#include + +class AstConstants : public AstModule +{ +public: + AstConstants(const OString& name, AstScope* pScope) + : AstModule(NT_constants, name, pScope) + {} + virtual ~AstConstants() {} +}; + +#endif // INCLUDED_IDLC_INC_ASTCONSTANTS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astdeclaration.hxx b/idlc/inc/astdeclaration.hxx new file mode 100644 index 000000000000..c6a76d9aa4a2 --- /dev/null +++ b/idlc/inc/astdeclaration.hxx @@ -0,0 +1,132 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_IDLC_INC_ASTDECLARATION_HXX +#define INCLUDED_IDLC_INC_ASTDECLARATION_HXX + +#include +#include + +class AstScope; + +// Enum defining the different kinds of Ast nodes +enum NodeType +{ + NT_object, // Denotes an object + NT_service, // Denotes an servcie + NT_interface_member, // Denotes an interface which is exported from object + NT_service_member, // Denotes an service which is exported from object + NT_observes, // Denotes an observed interface + NT_needs, // Denotes an needed service + NT_module, // Denotes a module + NT_root, // Denotes the root of AST + NT_interface, // Denotes an interface + NT_constants, // Denotes a constant group + NT_const, // Denotes a constant + NT_exception, // Denotes an exception + NT_attribute, // Denotes an attribute + NT_property, // Denotes an property + NT_operation, // Denotes an operation + NT_parameter, // Denotes an op. parameter + NT_struct, // Denotes either a plain struct type, or a + // polymorphic struct type template + NT_type_parameter, // Denotes a type parameter of a polymorphic struct + // type template + NT_instantiated_struct, // Denotes an instantiated polymorphic struct type + NT_member, // Denotes a member in structure, exception + NT_enum, // Denotes an enumeration + NT_enum_val, // Denotes an enum. value + NT_sequence, // Denotes an IDL sequence + NT_typedef, // Denotes a typedef + NT_predefined, // Denotes a predefined type + NT_singleton // Denotes a singleton +}; + +class AstDeclaration +{ +public: + // Constructors + AstDeclaration(NodeType type, const OString& name, AstScope* pScope); + virtual ~AstDeclaration(); + + // Data access + const OString& getLocalName() const + { return m_localName; } + const OString& getScopedName() const + { return m_scopedName; } + const OString& getFullName() + { return m_fullName; } + virtual const sal_Char* getRelativName() const + { return m_fullName.getStr()+1; } + AstScope* getScope() + { return m_pScope; } + const AstScope* getScope() const + { return m_pScope; } + NodeType getNodeType() const + { return m_nodeType; } + bool isInMainfile() const + { return m_bInMainFile; } + void setInMainfile(bool bInMainfile) + { m_bInMainFile = bInMainfile; } + bool isImported() const + { return m_bImported; } + void setImported(bool bImported) + { m_bImported = bImported; } + sal_Int32 getLineNumber() const + { return m_lineNumber; } + void setLineNumber(sal_Int32 lineNumber) + { m_lineNumber = lineNumber; } + const OString& getFileName() const + { return m_fileName; } + void setFileName(const OString& rFileName) + { m_fileName = rFileName; } + const OUString& getDocumentation() const + { return m_documentation; } + void setDocumentation(const OUString& rDocumentation) + { m_documentation = rDocumentation; } + + virtual bool isType() const; + + bool hasAncestor(AstDeclaration* pDecl); + + void setPublished() { m_bPublished = true; } + bool isPublished() const { return m_bPublished; } + + virtual bool dump(RegistryKey& rKey); + + bool isPredefined() { return m_bPredefined; } + void setPredefined(bool bPredefined); + +protected: + OString m_localName; + OString m_scopedName; // full qualified name + OString m_fullName; // full qualified name with '/' as separator + AstScope* m_pScope; + NodeType m_nodeType; + bool m_bImported; // imported ? + bool m_bInMainFile; // defined in main file + bool m_bPublished; + bool m_bPredefined; + sal_Int32 m_lineNumber; // line number defined in + OString m_fileName; // fileName defined in + OUString m_documentation; // fileName defined in +}; + +#endif // INCLUDED_IDLC_INC_ASTDECLARATION_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astenum.hxx b/idlc/inc/astenum.hxx new file mode 100644 index 000000000000..c60ff2839bfe --- /dev/null +++ b/idlc/inc/astenum.hxx @@ -0,0 +1,48 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_IDLC_INC_ASTENUM_HXX +#define INCLUDED_IDLC_INC_ASTENUM_HXX + +#include +#include +#include + +class AstEnum : public AstType + , public AstScope +{ +public: + AstEnum(const OString& name, AstScope* pScope); + + virtual ~AstEnum(); + + sal_Int32 getEnumValueCount() + { return m_enumValueCount++; } + + AstConstant* checkValue(AstExpression* pExpr); + + virtual bool dump(RegistryKey& rKey) override; + + virtual AstDeclaration* addDeclaration(AstDeclaration* pDecl) override; +private: + sal_Int32 m_enumValueCount; +}; + +#endif // INCLUDED_IDLC_INC_ASTENUM_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astexception.hxx b/idlc/inc/astexception.hxx new file mode 100644 index 000000000000..64790c694048 --- /dev/null +++ b/idlc/inc/astexception.hxx @@ -0,0 +1,36 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_IDLC_INC_ASTEXCEPTION_HXX +#define INCLUDED_IDLC_INC_ASTEXCEPTION_HXX + +#include + +class AstException : public AstStruct +{ +public: + AstException(const OString& name, AstException* pBaseType, AstScope* pScope) + : AstStruct(NT_exception, name, pBaseType, pScope) + {} + + virtual ~AstException() {} +}; + +#endif // INCLUDED_IDLC_INC_ASTEXCEPTION_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astexpression.hxx b/idlc/inc/astexpression.hxx new file mode 100644 index 000000000000..ca060719ef2e --- /dev/null +++ b/idlc/inc/astexpression.hxx @@ -0,0 +1,143 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_IDLC_INC_ASTEXPRESSION_HXX +#define INCLUDED_IDLC_INC_ASTEXPRESSION_HXX + +#include + +#include + +#include + +// Enum to define all the different operators to combine expressions +enum ExprComb +{ + EC_add, // '+' + EC_minus, // '-' + EC_mul, // '*' + EC_div, // '/' + EC_mod, // '%' + EC_or, // '|' + EC_xor, // '^' + EC_and, // '&' + EC_left, // '<<' + EC_right, // '>>' + EC_u_plus, // unary '+' + EC_u_minus, // unary '-' + EC_bit_neg, // '~' + EC_none, // No operator (missing) + EC_symbol // a symbol (function or constant name) +}; + +// Enum to define expression type +enum ExprType +{ + ET_short, // Expression value is short + ET_ushort, // Expression value is unsigned short + ET_long, // Expression value is long + ET_ulong, // Expression value is unsigned long + ET_hyper, // Expression value is hyper (64 bit) + ET_uhyper, // Expression value is unsigned hyper + ET_float, // Expression value is 32-bit float + ET_double, // Expression value is 64-bit float + ET_char, // Expression value is char + ET_byte, // Expression value is byte + ET_boolean, // Expression value is boolean + ET_string, // Expression value is char * + ET_any, // Expression value is any of above + ET_void, // Expression value is void (absent) + ET_type, // Expression value is type + ET_none // Expression value is missing +}; + +// Structure to describe value of constant expression and its type +struct AstExprValue +{ + union + { + sal_uInt8 byval; // Contains byte expression value + sal_Int16 sval; // Contains short expression value + sal_uInt16 usval; // Contains unsigned short expr value + sal_Int32 lval; // Contains long expression value + sal_uInt32 ulval; // Contains unsigned long expr value + sal_Int64 hval; // Contains hyper expression value + sal_uInt64 uhval; // Contains unsigned hyper expr value + bool bval; // Contains boolean expression value + float fval; // Contains 32-bit float expr value + double dval; // Contains 64-bit float expr value + } u; + ExprType et; +}; + +const sal_Char* SAL_CALL exprTypeToString(ExprType t); + +class AstExpression +{ +public: + // Constructor(s) + AstExpression(ExprComb c, AstExpression *pExpr1, AstExpression *pExpr2); + + AstExpression(sal_Int32 l); + AstExpression(sal_Int32 l, ExprType et); + AstExpression(sal_Int64 h); + AstExpression(sal_uInt64 uh); + AstExpression(double d); + AstExpression(OString* scopedName); + + virtual ~AstExpression(); + + // Data Accessors + ExprComb getCombOperator() + { return m_combOperator; } + AstExprValue* getExprValue() + { return m_exprValue; } + + // Evaluation and value coercion + bool coerce(ExprType type); + + // Evaluate then store value inside this AstExpression + void evaluate(); + + // Compare to AstExpressions + bool compare(AstExpression *pExpr); + + OString toString(); +private: + // Fill out the lineno, filename and definition scope details + void fillDefinitionDetails(); + // Evaluate different sets of operators + std::unique_ptr eval_bin_op(); + std::unique_ptr eval_bit_op(); + std::unique_ptr eval_un_op(); + AstExprValue* eval_symbol(); + + AstScope* m_pScope; // scope defined in + sal_Int32 m_lineNo; // line number defined in + OString m_fileName; // fileName defined in + + ExprComb m_combOperator; + AstExpression* m_subExpr1; + AstExpression* m_subExpr2; + AstExprValue* m_exprValue; + OString* m_pSymbolicName; +}; + +#endif // INCLUDED_IDLC_INC_ASTEXPRESSION_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astinterface.hxx b/idlc/inc/astinterface.hxx new file mode 100644 index 000000000000..caabbe669f11 --- /dev/null +++ b/idlc/inc/astinterface.hxx @@ -0,0 +1,126 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_IDLC_INC_ASTINTERFACE_HXX +#define INCLUDED_IDLC_INC_ASTINTERFACE_HXX + +#include +#include +#include "inheritedinterface.hxx" + +#include +#include + +class AstInterface : public AstType + , public AstScope +{ +public: + typedef std::vector< InheritedInterface > InheritedInterfaces; + + typedef std::vector< AstInterface const * > DoubleInterfaceDeclarations; + + struct DoubleMemberDeclaration { + AstDeclaration const * first; + AstDeclaration const * second; + }; + + typedef std::vector< DoubleMemberDeclaration > DoubleMemberDeclarations; + + struct DoubleDeclarations { + DoubleInterfaceDeclarations interfaces; + DoubleMemberDeclarations members; + }; + + AstInterface( + const OString& name, AstInterface const * pInherits, + AstScope* pScope); + virtual ~AstInterface(); + + InheritedInterfaces const & getAllInheritedInterfaces() const + { return m_inheritedInterfaces; } + + bool hasMandatoryInheritedInterfaces() const + { return m_mandatoryInterfaces > 0; } + + void setDefined() { m_bIsDefined = true; } + bool isDefined() const + { return m_bIsDefined; } + + bool usesSingleInheritance() const { return m_bSingleInheritance; } + + DoubleDeclarations checkInheritedInterfaceClashes( + AstInterface const * ifc, bool optional) const; + + void addInheritedInterface( + AstType const * ifc, bool optional, + OUString const & documentation); + + DoubleMemberDeclarations checkMemberClashes( + AstDeclaration const * member) const; + + void addMember(AstDeclaration /*TODO: const*/ * member); + + void forwardDefined(AstInterface const & def); + + virtual bool dump(RegistryKey& rKey) override; + +private: + enum InterfaceKind { + INTERFACE_INDIRECT_OPTIONAL, INTERFACE_DIRECT_OPTIONAL, + INTERFACE_INDIRECT_MANDATORY, INTERFACE_DIRECT_MANDATORY }; + + struct VisibleMember { + explicit VisibleMember(AstDeclaration const * theMandatory = nullptr): + mandatory(theMandatory) {} + + typedef std::map< OString, AstDeclaration const * > Optionals; + + AstDeclaration const * mandatory; + Optionals optionals; + }; + + typedef std::map< OString, InterfaceKind > VisibleInterfaces; + typedef std::map< OString, VisibleMember > VisibleMembers; + + void checkInheritedInterfaceClashes( + DoubleDeclarations & doubleDeclarations, + std::set< OString > & seenInterfaces, AstInterface const * ifc, + bool direct, bool optional, bool mainOptional) const; + + void checkMemberClashes( + DoubleMemberDeclarations & doubleMembers, AstDeclaration const * member, + bool checkOptional) const; + + void addVisibleInterface( + AstInterface const * ifc, bool direct, bool optional); + + void addOptionalVisibleMembers(AstInterface const * ifc); + + bool increment(sal_uInt16 * counter, char const * sort) const; + + InheritedInterfaces m_inheritedInterfaces; + InheritedInterfaces::size_type m_mandatoryInterfaces; + bool m_bIsDefined; + bool m_bSingleInheritance; + VisibleInterfaces m_visibleInterfaces; + VisibleMembers m_visibleMembers; +}; + +#endif // INCLUDED_IDLC_INC_ASTINTERFACE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astinterfacemember.hxx b/idlc/inc/astinterfacemember.hxx new file mode 100644 index 000000000000..1740d3518085 --- /dev/null +++ b/idlc/inc/astinterfacemember.hxx @@ -0,0 +1,46 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_IDLC_INC_ASTINTERFACEMEMBER_HXX +#define INCLUDED_IDLC_INC_ASTINTERFACEMEMBER_HXX + +#include + +class AstInterfaceMember : public AstDeclaration +{ +public: + AstInterfaceMember(const sal_uInt32 flags, AstInterface* pRealInterface, + const OString& name, AstScope* pScope) + : AstDeclaration(NT_interface_member, name, pScope) + , m_flags(flags) + , m_pRealInterface(pRealInterface) + {} + virtual ~AstInterfaceMember() {} + + AstInterface* getRealInterface() + { return m_pRealInterface; } + bool isOptional() + { return ((m_flags & AF_OPTIONAL) == AF_OPTIONAL); } +private: + const sal_uInt32 m_flags; + AstInterface* m_pRealInterface; +}; + +#endif // INCLUDED_IDLC_INC_ASTINTERFACEMEMBER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astmember.hxx b/idlc/inc/astmember.hxx new file mode 100644 index 000000000000..d01dbde7922c --- /dev/null +++ b/idlc/inc/astmember.hxx @@ -0,0 +1,50 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_IDLC_INC_ASTMEMBER_HXX +#define INCLUDED_IDLC_INC_ASTMEMBER_HXX + +#include "astdeclaration.hxx" + +class AstScope; +class AstType; + +class AstMember: public AstDeclaration { +public: + AstMember( + AstType const * pType, OString const & name, AstScope * pScope): + AstDeclaration(NT_member, name, pScope), m_pType(pType) {} + + virtual ~AstMember() {} + + AstType const * getType() const { return m_pType; } + +protected: + AstMember( + NodeType type, AstType const * pType, OString const & name, + AstScope * pScope): + AstDeclaration(type, name, pScope), m_pType(pType) {} + +private: + AstType const * m_pType; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astmodule.hxx b/idlc/inc/astmodule.hxx new file mode 100644 index 000000000000..770c11a856a9 --- /dev/null +++ b/idlc/inc/astmodule.hxx @@ -0,0 +1,44 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_IDLC_INC_ASTMODULE_HXX +#define INCLUDED_IDLC_INC_ASTMODULE_HXX + +#include +#include + +class AstModule : public AstDeclaration + , public AstScope +{ +public: + AstModule(const OString& name, AstScope* pScope) + : AstDeclaration(NT_module, name, pScope) + , AstScope(NT_module) + {} + AstModule(NodeType type, const OString& name, AstScope* pScope) + : AstDeclaration(type, name, pScope) + , AstScope(type) + {} + virtual ~AstModule() {} + + virtual bool dump(RegistryKey& rKey) override; +}; + +#endif // INCLUDED_IDLC_INC_ASTMODULE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astneeds.hxx b/idlc/inc/astneeds.hxx new file mode 100644 index 000000000000..6674e2804695 --- /dev/null +++ b/idlc/inc/astneeds.hxx @@ -0,0 +1,41 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_IDLC_INC_ASTNEEDS_HXX +#define INCLUDED_IDLC_INC_ASTNEEDS_HXX + +#include + +class AstNeeds : public AstDeclaration +{ +public: + AstNeeds(AstService* pRealService, const OString& name, AstScope* pScope) + : AstDeclaration(NT_needs, name, pScope) + , m_pRealService(pRealService) + {} + virtual ~AstNeeds() {} + + AstService* getRealService() + { return m_pRealService; } +private: + AstService* m_pRealService; +}; + +#endif // INCLUDED_IDLC_INC_ASTNEEDS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astobserves.hxx b/idlc/inc/astobserves.hxx new file mode 100644 index 000000000000..c7760096a095 --- /dev/null +++ b/idlc/inc/astobserves.hxx @@ -0,0 +1,41 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_IDLC_INC_ASTOBSERVES_HXX +#define INCLUDED_IDLC_INC_ASTOBSERVES_HXX + +#include + +class AstObserves : public AstDeclaration +{ +public: + AstObserves(AstInterface* pRealInterface, const OString& name, AstScope* pScope) + : AstDeclaration(NT_observes, name, pScope) + , m_pRealInterface(pRealInterface) + {} + virtual ~AstObserves() {} + + AstInterface* getRealInterface() + { return m_pRealInterface; } +private: + AstInterface* m_pRealInterface; +}; + +#endif // INCLUDED_IDLC_INC_ASTOBSERVES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astoperation.hxx b/idlc/inc/astoperation.hxx new file mode 100644 index 000000000000..775c74fc0c43 --- /dev/null +++ b/idlc/inc/astoperation.hxx @@ -0,0 +1,59 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_IDLC_INC_ASTOPERATION_HXX +#define INCLUDED_IDLC_INC_ASTOPERATION_HXX + +#include +#include + +namespace typereg { class Writer; } + +class AstType; + +class AstOperation : public AstDeclaration + , public AstScope +{ +public: + AstOperation(AstType const * pReturnType, const OString& name, AstScope* pScope) + : AstDeclaration(NT_operation, name, pScope) + , AstScope(NT_operation) + , m_pReturnType(pReturnType) + {} + virtual ~AstOperation() {} + + bool isVariadic() const; + + bool isConstructor() const { return m_pReturnType == nullptr; } + + void setExceptions(DeclList const * pExceptions); + sal_uInt16 nExceptions() + { return (sal_uInt16)(m_exceptions.size()); } + + bool dumpBlob(typereg::Writer & rBlob, sal_uInt16 index); + + // scope management + virtual AstDeclaration* addDeclaration(AstDeclaration* pDecl) override; +private: + AstType const * m_pReturnType; + DeclList m_exceptions; +}; + +#endif // INCLUDED_IDLC_INC_ASTOPERATION_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astparameter.hxx b/idlc/inc/astparameter.hxx new file mode 100644 index 000000000000..250aeaed33f5 --- /dev/null +++ b/idlc/inc/astparameter.hxx @@ -0,0 +1,48 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_IDLC_INC_ASTPARAMETER_HXX +#define INCLUDED_IDLC_INC_ASTPARAMETER_HXX + +#include + +enum Direction { DIR_IN, DIR_OUT, DIR_INOUT }; + +class AstParameter: public AstMember { +public: + AstParameter( + Direction direction, bool rest, AstType const * type, + OString const & name, AstScope * scope): + AstMember(NT_parameter, type, name, scope), m_direction(direction), + m_rest(rest) {} + + virtual ~AstParameter() {} + + Direction getDirection() const { return m_direction; } + + bool isRest() const { return m_rest; } + +private: + Direction m_direction; + bool m_rest; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astscope.hxx b/idlc/inc/astscope.hxx new file mode 100644 index 000000000000..9db54d61aa13 --- /dev/null +++ b/idlc/inc/astscope.hxx @@ -0,0 +1,70 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_IDLC_INC_ASTSCOPE_HXX +#define INCLUDED_IDLC_INC_ASTSCOPE_HXX + +#include + +class AstExpression; +#include +#include + +class AstScope +{ +public: + AstScope(NodeType nodeType); + virtual ~AstScope(); + + NodeType getScopeNodeType() const + { return m_nodeType; } + + virtual AstDeclaration* addDeclaration(AstDeclaration* pDecl); + + sal_uInt32 nMembers() const + { return (sal_uInt32)(m_declarations.size()); } + DeclList::const_iterator getIteratorBegin() const + { return m_declarations.begin(); } + DeclList::const_iterator getIteratorEnd() const + { return m_declarations.end(); } + sal_uInt16 getNodeCount(NodeType nType); + + // Name look up mechanism + AstDeclaration* lookupByName(const OString& scopedName); + // Look up the identifier 'name' specified only in the local scope + AstDeclaration* lookupByNameLocal(const OString& name) const; + + AstDeclaration* lookupInInherited(const OString& scopedName) const; + + // Look up a predefined type by its ExprType + AstDeclaration* lookupPrimitiveType(ExprType type); + + AstDeclaration* lookupForAdd(AstDeclaration* pDecl); + +protected: + inline AstDeclaration const * getLast() const + { return m_declarations.back(); } + +private: + DeclList m_declarations; + NodeType m_nodeType; +}; + +#endif // INCLUDED_IDLC_INC_ASTSCOPE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astsequence.hxx b/idlc/inc/astsequence.hxx new file mode 100644 index 000000000000..bdc132872455 --- /dev/null +++ b/idlc/inc/astsequence.hxx @@ -0,0 +1,52 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_IDLC_INC_ASTSEQUENCE_HXX +#define INCLUDED_IDLC_INC_ASTSEQUENCE_HXX + +#include + +class AstSequence : public AstType +{ +public: + AstSequence(AstType const * pMemberType, AstScope* pScope) + : AstType(NT_sequence, OString("[]")+pMemberType->getScopedName(), pScope) + , m_pMemberType(pMemberType) + , m_pRelativName(nullptr) + {} + virtual ~AstSequence() + { + if ( m_pRelativName ) + delete m_pRelativName; + } + + AstType const * getMemberType() const + { return m_pMemberType; } + + virtual bool isUnsigned() const override + { return m_pMemberType != nullptr && m_pMemberType->isUnsigned(); } + + virtual const sal_Char* getRelativName() const override; +private: + AstType const * m_pMemberType; + mutable OString* m_pRelativName; +}; + +#endif // INCLUDED_IDLC_INC_ASTSEQUENCE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astservice.hxx b/idlc/inc/astservice.hxx new file mode 100644 index 000000000000..400e7c6f2313 --- /dev/null +++ b/idlc/inc/astservice.hxx @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_IDLC_INC_ASTSERVICE_HXX +#define INCLUDED_IDLC_INC_ASTSERVICE_HXX + +#include +#include + +class AstService : public AstDeclaration + , public AstScope +{ +public: + AstService(const OString& name, AstScope* pScope) + : AstDeclaration(NT_service, name, pScope) + , AstScope(NT_service) + , m_singleInterfaceBasedService(false) + , m_defaultConstructor(false) + {} + AstService(const NodeType type, const OString& name, AstScope* pScope) + : AstDeclaration(type, name, pScope) + , AstScope(type) + , m_singleInterfaceBasedService(false) + , m_defaultConstructor(false) + {} + virtual ~AstService() {} + + virtual bool dump(RegistryKey& rKey) override; + + void setSingleInterfaceBasedService() + { m_singleInterfaceBasedService = true; } + + void setDefaultConstructor(bool b) { m_defaultConstructor = b; } + + bool isSingleInterfaceBasedService() const + { return m_singleInterfaceBasedService; } + + bool checkLastConstructor() const; + +private: + bool m_singleInterfaceBasedService; + bool m_defaultConstructor; +}; + +#endif // INCLUDED_IDLC_INC_ASTSERVICE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/astservicemember.hxx b/idlc/inc/astservicemember.hxx new file mode 100644 index 000000000000..13cd97298bf7 --- /dev/null +++ b/idlc/inc/astservicemember.hxx @@ -0,0 +1,46 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_IDLC_INC_ASTSERVICEMEMBER_HXX +#define INCLUDED_IDLC_INC_ASTSERVICEMEMBER_HXX + +#include + +class AstServiceMember : public AstDeclaration +{ +public: + AstServiceMember(const sal_uInt32 flags, AstService* pRealService, + const OString& name, AstScope* pScope) + : AstDeclaration(NT_service_member, name, pScope) + , m_flags(flags) + , m_pRealService(pRealService) + {} + virtual ~AstServiceMember() {} + + AstService* getRealService() + { return m_pRealService; } + bool isOptional() + { return ((m_flags & AF_OPTIONAL) == AF_OPTIONAL); } +private: + const sal_uInt32 m_flags; + AstService* m_pRealService; +}; + +#endif // INCLUDED_IDLC_INC_ASTSERVICEMEMBER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/aststack.hxx b/idlc/inc/aststack.hxx new file mode 100644 index 000000000000..c704e91f91b3 --- /dev/null +++ b/idlc/inc/aststack.hxx @@ -0,0 +1,49 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_IDLC_INC_ASTSTACK_HXX +#define INCLUDED_IDLC_INC_ASTSTACK_HXX + +#include + +class AstScope; + +class AstStack +{ +public: + AstStack(); + virtual ~AstStack(); + + sal_uInt32 depth() { return m_top;} + AstScope* top(); + AstScope* bottom(); + AstScope* nextToTop(); + AstScope* topNonNull(); + AstStack* push(AstScope* pScope); + void pop(); + void clear(); + +private: + AstScope** m_stack; + sal_uInt32 m_size; + sal_uInt32 m_top; +}; + +#endif // INCLUDED_IDLC_INC_ASTSTACK_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/aststruct.hxx b/idlc/inc/aststruct.hxx new file mode 100644 index 000000000000..280f23165d43 --- /dev/null +++ b/idlc/inc/aststruct.hxx @@ -0,0 +1,58 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_IDLC_INC_ASTSTRUCT_HXX +#define INCLUDED_IDLC_INC_ASTSTRUCT_HXX + +#include +#include +#include "idlctypes.hxx" + +class AstStruct; + +class AstStruct : public AstType + , public AstScope +{ +public: + AstStruct( + const OString& name, + std::vector< OString > const & typeParameters, + AstStruct const* pBaseType, AstScope* pScope); + + AstStruct(const NodeType type, + const OString& name, + AstStruct const* pBaseType, + AstScope* pScope); + virtual ~AstStruct(); + + DeclList::size_type getTypeParameterCount() const + { return m_typeParameters.size(); } + + AstDeclaration const * findTypeParameter(OString const & name) const; + + virtual bool isType() const override; + + virtual bool dump(RegistryKey& rKey) override; +private: + AstStruct const* m_pBaseType; + DeclList m_typeParameters; +}; + +#endif // INCLUDED_IDLC_INC_ASTSTRUCT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/aststructinstance.hxx b/idlc/inc/aststructinstance.hxx new file mode 100644 index 000000000000..877fcd249ed1 --- /dev/null +++ b/idlc/inc/aststructinstance.hxx @@ -0,0 +1,49 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_IDLC_INC_ASTSTRUCTINSTANCE_HXX +#define INCLUDED_IDLC_INC_ASTSTRUCTINSTANCE_HXX + +#include "asttype.hxx" +#include "idlctypes.hxx" + +class AstScope; + +class AstStructInstance: public AstType { +public: + AstStructInstance( + AstType const * typeTemplate, DeclList const * typeArguments, + AstScope * scope); + + AstType const * getTypeTemplate() const { return m_typeTemplate; } + + DeclList::const_iterator getTypeArgumentsBegin() const + { return m_typeArguments.begin(); } + + DeclList::const_iterator getTypeArgumentsEnd() const + { return m_typeArguments.end(); } + +private: + AstType const * m_typeTemplate; + DeclList m_typeArguments; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/asttype.hxx b/idlc/inc/asttype.hxx new file mode 100644 index 000000000000..67f8d4d075ee --- /dev/null +++ b/idlc/inc/asttype.hxx @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_IDLC_INC_ASTTYPE_HXX +#define INCLUDED_IDLC_INC_ASTTYPE_HXX + +#include + +class AstType : public AstDeclaration +{ +public: + AstType(const NodeType type, const OString& name, AstScope* pScope) + : AstDeclaration(type, name, pScope) + {} + + virtual ~AstType() {} + + virtual bool isUnsigned() const { return false; } +}; + +#endif // INCLUDED_IDLC_INC_ASTTYPE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/asttypedef.hxx b/idlc/inc/asttypedef.hxx new file mode 100644 index 000000000000..2f9017200592 --- /dev/null +++ b/idlc/inc/asttypedef.hxx @@ -0,0 +1,46 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_IDLC_INC_ASTTYPEDEF_HXX +#define INCLUDED_IDLC_INC_ASTTYPEDEF_HXX + +#include + +class AstTypeDef : public AstType +{ +public: + AstTypeDef( + AstType const * baseType, OString const & name, AstScope * scope): + AstType(NT_typedef, name, scope), m_pBaseType(baseType) {} + + virtual ~AstTypeDef() {} + + AstType const * getBaseType() const + { return m_pBaseType; } + + virtual bool isUnsigned() const override + { return m_pBaseType != nullptr && m_pBaseType->isUnsigned(); } + + virtual bool dump(RegistryKey& rKey) override; +private: + AstType const * m_pBaseType; +}; + +#endif // INCLUDED_IDLC_INC_ASTTYPEDEF_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/errorhandler.hxx b/idlc/inc/errorhandler.hxx new file mode 100644 index 000000000000..8770cc93ac61 --- /dev/null +++ b/idlc/inc/errorhandler.hxx @@ -0,0 +1,132 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_IDLC_INC_ERRORHANDLER_HXX +#define INCLUDED_IDLC_INC_ERRORHANDLER_HXX + +#include +#include +#include + +enum ErrorCode +{ + EIDL_NONE, // No error + EIDL_SYNTAX_ERROR, // Syntax error in IDL input + // More details will be gleaned from examining + // the parse state + EIDL_REDEF, // Redefinition + EIDL_REDEF_SCOPE, // Redefinition inside defining scope + EIDL_DEF_USE, // Definition after use + EIDL_COERCION_FAILURE, // Coercion failure + EIDL_SCOPE_CONFLICT, // Between fwd declare and full declare + EIDL_ILLEGAL_ADD, // Illegal add action + EIDL_ILLEGAL_USE, // Illegal type used in expression + EIDL_ILLEGAL_RAISES, // Error in "raises" clause + EIDL_CANT_INHERIT, // Cannot inherit from non-interface + EIDL_LOOKUP_ERROR, // Identifier not found + EIDL_INHERIT_FWD_ERROR, // Cannot inherit from fwd decl interface + EIDL_CONSTANT_EXPECTED, // We got something else.. + EIDL_NAME_CASE_ERROR, // Spelling differences found + EIDL_EVAL_ERROR, // Error in evaluating expression + EIDL_AMBIGUOUS, // Ambiguous name definition + EIDL_DECL_NOT_DEFINED, // Forward declared but never defined + EIDL_FWD_DECL_LOOKUP, // Tried to lookup in fwd declared intf + EIDL_RECURSIVE_TYPE, // Illegal recursive use of type + EIDL_NOT_A_TYPE, // Not a type + EIDL_TYPE_NOT_VALID, // Type is not valid in this context + EIDL_INTERFACEMEMBER_LOOKUP, // interface is not defined or a fwd declaration not exists + EIDL_SERVICEMEMBER_LOOKUP, + EIDL_TYPE_IDENT_CONFLICT, // type and identifier has equal names + EIDL_WRONGATTRIBUTEFLAG, + EIDL_DEFINED_ATTRIBUTEFLAG, + EIDL_WRONGATTRIBUTEKEYWORD, + EIDL_MISSINGATTRIBUTEKEYWORD, + EIDL_BAD_ATTRIBUTE_FLAGS, + EIDL_OPTIONALEXPECTED, + EIDL_MIXED_INHERITANCE, + EIDL_DOUBLE_INHERITANCE, + EIDL_DOUBLE_MEMBER, + EIDL_CONSTRUCTOR_PARAMETER_NOT_IN, + EIDL_CONSTRUCTOR_REST_PARAMETER_NOT_FIRST, + EIDL_REST_PARAMETER_NOT_LAST, + EIDL_REST_PARAMETER_NOT_ANY, + EIDL_METHOD_HAS_REST_PARAMETER, + EIDL_READONLY_ATTRIBUTE_SET_EXCEPTIONS, + EIDL_UNSIGNED_TYPE_ARGUMENT, + EIDL_WRONG_NUMBER_OF_TYPE_ARGUMENTS, + EIDL_INSTANTIATED_STRUCT_TYPE_TYPEDEF, + EIDL_IDENTICAL_TYPE_PARAMETERS, + EIDL_STRUCT_TYPE_TEMPLATE_WITH_BASE, + EIDL_PUBLISHED_FORWARD, + EIDL_PUBLISHED_USES_UNPUBLISHED, + EIDL_SIMILAR_CONSTRUCTORS +}; + +enum WarningCode +{ + WIDL_EXPID_CONFLICT, // exception id conflict + WIDL_REQID_CONFLICT, // request id conflict + WIDL_INHERIT_IDCONFLICT, // request id conflict inheritance tree + WIDL_TYPE_IDENT_CONFLICT, // type and identifier has equal names + WIDL_WRONG_NAMING_CONV // type or identifier doesn't fulfill the UNO naming convention +}; + +class ErrorHandler +{ +public: + // Report errors with varying numbers of arguments + static void error0(ErrorCode e); + static void error1(ErrorCode e, AstDeclaration const * d); + static void error2( + ErrorCode e, AstDeclaration const * d1, AstDeclaration const * d2); + static void error3(ErrorCode e, AstDeclaration* d1, AstDeclaration* d2, AstDeclaration* d3); + + // Warning + static void warning0(WarningCode e, const sal_Char* warningmsg); + + // Report a syntax error in IDL input + static void syntaxError(ParseState state, sal_Int32 lineNumber, const sal_Char* errmsg); + + // Report an unsuccessful coercion attempt + static void coercionError(AstExpression *pExpr, ExprType et); + + // Report a failed name lookup attempt + static void lookupError(const OString& n); + // Report a failed name lookup attempt + static void lookupError(ErrorCode e, const OString& n, AstDeclaration* pScope); + + + // Report a type error + static void noTypeError(AstDeclaration const * pDecl); + + static void inheritanceError(NodeType nodeType, const OString* name, AstDeclaration* pDecl); + + static void flagError(ErrorCode e, sal_uInt32 flag); + + static void forwardLookupError(const AstDeclaration* pForward, const OString& name); + + static void constantExpected(AstDeclaration* pDecl, const OString& name); + + static void evalError(AstExpression* pExpr); + + static bool checkPublished(AstDeclaration const * decl, bool bOptional=false); +}; + +#endif // INCLUDED_IDLC_INC_ERRORHANDLER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/fehelper.hxx b/idlc/inc/fehelper.hxx new file mode 100644 index 000000000000..61bc51638dad --- /dev/null +++ b/idlc/inc/fehelper.hxx @@ -0,0 +1,76 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_IDLC_INC_FEHELPER_HXX +#define INCLUDED_IDLC_INC_FEHELPER_HXX + +#include +#include + +#include + +class FeDeclarator +{ +public: + FeDeclarator(const OString& name); + virtual ~FeDeclarator(); + const OString& getName() + { return m_name; } + bool checkType(AstDeclaration const * pType); + static AstType const * compose(AstDeclaration const * pDecl); +private: + OString m_name; +}; + +typedef ::std::list< FeDeclarator* > FeDeclList; + +class FeInheritanceHeader +{ +public: + FeInheritanceHeader( + NodeType nodeType, OString* pName, OString* pInherits, + std::vector< OString > * typeParameters); + + virtual ~FeInheritanceHeader() + { + if ( m_pName ) + delete m_pName; + } + + NodeType getNodeType() + { return m_nodeType; } + OString* getName() + { return m_pName; } + AstDeclaration* getInherits() + { return m_pInherits; } + + std::vector< OString > const & getTypeParameters() const + { return m_typeParameters; } + +private: + void initializeInherits(OString* pinherits); + + NodeType m_nodeType; + OString* m_pName; + AstDeclaration* m_pInherits; + std::vector< OString > m_typeParameters; +}; + +#endif // INCLUDED_IDLC_INC_FEHELPER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/idlc.hxx b/idlc/inc/idlc.hxx new file mode 100644 index 000000000000..56fda18c9386 --- /dev/null +++ b/idlc/inc/idlc.hxx @@ -0,0 +1,166 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_IDLC_INC_IDLC_HXX +#define INCLUDED_IDLC_INC_IDLC_HXX + +#include +#include +#include + +#ifdef SAL_UNX +#define SEPARATOR '/' +#define PATH_SEPARATOR "/" +#else +#define SEPARATOR '\\' +#define PATH_SEPARATOR "\\" +#endif + +class AstInterface; +class AstModule; +class AstType; +class Options; +class ErrorHandler; + +class Idlc +{ +public: + Idlc(Options* pOptions); + virtual ~Idlc(); + + void init(); + + bool dumpDeps(OString const& rDepFile, + OString const& rTarget); + + Options* getOptions() + { return m_pOptions; } + AstStack* scopes() + { return m_pScopes; } + AstModule* getRoot() + { return m_pRoot; } + const OString& getFileName() + { return m_fileName; } + void setFileName(const OString& fileName) + { m_fileName = fileName; addInclude(fileName); } + const OString& getMainFileName() + { return m_mainFileName; } + void setMainFileName(const OString& mainFileName) + { m_mainFileName = mainFileName; } + const OString& getRealFileName() + { return m_realFileName; } + void setRealFileName(const OString& realFileName) + { m_realFileName = realFileName; } + const OString& getDocumentation() + { + m_bIsDocValid = false; + return m_documentation; + } + void setDocumentation(const OString& documentation) + { + m_documentation = documentation; + m_bIsDocValid = true; + } + OUString processDocumentation(); + bool isInMainFile() + { return m_bIsInMainfile; } + void setInMainfile(bool bInMainfile) + { m_bIsInMainfile = bInMainfile; } + sal_uInt32 getErrorCount() + { return m_errorCount; } + void incErrorCount() + { m_errorCount++; } + sal_uInt32 getWarningCount() + { return m_warningCount; } + void incWarningCount() + { m_warningCount++; } + sal_uInt32 getLineNumber() + { return m_lineNumber; } + sal_uInt32 getOffsetStart() + { return m_offsetStart; } + sal_uInt32 getOffsetEnd() + { return m_offsetEnd; } + void setOffset( sal_uInt32 start, sal_uInt32 end) + { m_offsetStart = start; m_offsetEnd = end; } + void setLineNumber(sal_uInt32 lineNumber) + { m_lineNumber = lineNumber; } + void incLineNumber() + { m_lineNumber++; } + ParseState getParseState() + { return m_parseState; } + void setParseState(ParseState parseState) + { m_parseState = parseState; } + + void addInclude(const OString& inc) + { m_includes.insert(inc); } + + void setPublished(bool published) { m_published = published; } + bool isPublished() const { return m_published; } + + void reset(); +private: + Options* m_pOptions; + AstStack* m_pScopes; + AstModule* m_pRoot; + ErrorHandler* m_pErrorHandler; + OString m_fileName; + OString m_mainFileName; + OString m_realFileName; + OString m_documentation; + bool m_bIsDocValid; + bool m_bGenerateDoc; + bool m_bIsInMainfile; + bool m_published; + sal_uInt32 m_errorCount; + sal_uInt32 m_warningCount; + sal_uInt32 m_lineNumber; + sal_uInt32 m_offsetStart; + sal_uInt32 m_offsetEnd; + ParseState m_parseState; + StringSet m_includes; +}; + + +typedef ::std::pair< OString, OString > sPair_t; +sal_Int32 compileFile(const OString * pathname); + // a null pathname means stdin +sal_Int32 produceFile(const OString& filenameBase, + sPair_t const*const pDepFile); + // filenameBase is filename without ".idl" +void removeIfExists(const OString& pathname); + +bool copyFile(const OString* source, const OString& target); + // a null source means stdin + +bool isFileUrl(const OString& fileName); +OString convertToAbsoluteSystemPath(const OString& fileName); +OString convertToFileUrl(const OString& fileName); + +Idlc* SAL_CALL idlc(); +Idlc* SAL_CALL setIdlc(Options* pOptions); + +AstDeclaration const * resolveTypedefs(AstDeclaration const * type); + +AstDeclaration const * deconstructAndResolveTypedefs( + AstDeclaration const * type, sal_Int32 * rank); + +AstInterface const * resolveInterfaceTypedefs(AstType const * type); + +#endif // INCLUDED_IDLC_INC_IDLC_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/idlc/astattribute.hxx b/idlc/inc/idlc/astattribute.hxx deleted file mode 100644 index 86e4c0de7c74..000000000000 --- a/idlc/inc/idlc/astattribute.hxx +++ /dev/null @@ -1,110 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_IDLC_ASTATTRIBUTE_HXX -#define INCLUDED_IDLC_INC_IDLC_ASTATTRIBUTE_HXX - -#include -#include "idlc/astscope.hxx" - -#include -#include - -namespace typereg { class Writer; } - -class AstAttribute: public AstDeclaration, public AstScope { -public: - AstAttribute( - sal_uInt32 flags, AstType const * type, OString const & name, - AstScope * scope): - AstDeclaration(NT_attribute, name, scope), - AstScope(NT_attribute), m_flags(flags), m_pType(type) - {} - - AstAttribute(NodeType nodeType, sal_uInt32 flags, AstType const * pType, const OString& name, AstScope* pScope) - : AstDeclaration(nodeType, name, pScope), AstScope(nodeType) - , m_flags(flags) - , m_pType(pType) - {} - virtual ~AstAttribute() {} - - void setExceptions( - OUString const * getDoc, DeclList const * getExc, - OUString const * setDoc, DeclList const * setExc) - { - if (getDoc != nullptr) { - m_getDocumentation = *getDoc; - } - if (getExc != nullptr) { - m_getExceptions = *getExc; - } - if (setDoc != nullptr) { - m_setDocumentation = *setDoc; - } - if (setExc != nullptr) { - m_setExceptions = *setExc; - } - } - - DeclList::size_type getGetExceptionCount() const - { return m_getExceptions.size(); } - - DeclList::size_type getSetExceptionCount() const - { return m_setExceptions.size(); } - - AstType const * getType() const - { return m_pType; } - bool isReadonly() const - { return ((m_flags & AF_READONLY) == AF_READONLY); } - bool isOptional() const - { return ((m_flags & AF_OPTIONAL) == AF_OPTIONAL); } - bool isBound() const - { return ((m_flags & AF_BOUND) == AF_BOUND); } - bool isMayBeVoid() const - { return ((m_flags & AF_MAYBEVOID) == AF_MAYBEVOID); } - bool isConstrained() const - { return ((m_flags & AF_CONSTRAINED) == AF_CONSTRAINED); } - bool isTransient() const - { return ((m_flags & AF_TRANSIENT) == AF_TRANSIENT); } - bool isMayBeAmbiguous() const - { return ((m_flags & AF_MAYBEAMBIGUOUS) == AF_MAYBEAMBIGUOUS); } - bool isMayBeDefault() const - { return ((m_flags & AF_MAYBEDEFAULT) == AF_MAYBEDEFAULT); } - bool isRemoveable() const - { return ((m_flags & AF_REMOVABLE) == AF_REMOVABLE); } - - bool dumpBlob( - typereg::Writer & rBlob, sal_uInt16 index, sal_uInt16 * methodIndex); - -private: - void dumpExceptions( - typereg::Writer & writer, OUString const & documentation, - DeclList const & exceptions, RTMethodMode flags, - sal_uInt16 * methodIndex); - - const sal_uInt32 m_flags; - AstType const * m_pType; - OUString m_getDocumentation; - DeclList m_getExceptions; - OUString m_setDocumentation; - DeclList m_setExceptions; -}; - -#endif // INCLUDED_IDLC_INC_IDLC_ASTATTRIBUTE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/idlc/astbasetype.hxx b/idlc/inc/idlc/astbasetype.hxx deleted file mode 100644 index 048e8bb42b1a..000000000000 --- a/idlc/inc/idlc/astbasetype.hxx +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_IDLC_ASTBASETYPE_HXX -#define INCLUDED_IDLC_INC_IDLC_ASTBASETYPE_HXX - -#include -#include - - -class AstBaseType : public AstType -{ -public: - AstBaseType(const ExprType type, const OString& name, AstScope* pScope) - : AstType(NT_predefined, name, pScope) - , m_exprType(type) - {} - - virtual ~AstBaseType() {} - - virtual bool isUnsigned() const override { - switch (m_exprType) { - case ET_ushort: - case ET_ulong: - case ET_uhyper: - return true; - default: - return false; - } - } - - ExprType getExprType() const - { return m_exprType; } -private: - const ExprType m_exprType; -}; - -#endif // INCLUDED_IDLC_INC_IDLC_ASTBASETYPE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/idlc/astconstant.hxx b/idlc/inc/idlc/astconstant.hxx deleted file mode 100644 index cfad728f6aaf..000000000000 --- a/idlc/inc/idlc/astconstant.hxx +++ /dev/null @@ -1,50 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_IDLC_ASTCONSTANT_HXX -#define INCLUDED_IDLC_INC_IDLC_ASTCONSTANT_HXX - -#include -#include - -namespace typereg { class Writer; } - -class AstConstant : public AstDeclaration -{ -public: - AstConstant(const ExprType type, const NodeType nodeType, - AstExpression* pExpr, const OString& name, AstScope* pScope); - AstConstant(const ExprType type, AstExpression* pExpr, - const OString& name, AstScope* pScope); - virtual ~AstConstant(); - - AstExpression* getConstValue() - { return m_pConstValue; } - ExprType getConstValueType() const - { return m_constValueType; } - - bool dumpBlob( - typereg::Writer & rBlob, sal_uInt16 index, bool published); -private: - AstExpression* m_pConstValue; - const ExprType m_constValueType; -}; - -#endif // INCLUDED_IDLC_INC_IDLC_ASTCONSTANT_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/idlc/astconstants.hxx b/idlc/inc/idlc/astconstants.hxx deleted file mode 100644 index 65b2da863dca..000000000000 --- a/idlc/inc/idlc/astconstants.hxx +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_IDLC_ASTCONSTANTS_HXX -#define INCLUDED_IDLC_INC_IDLC_ASTCONSTANTS_HXX - -#include - -class AstConstants : public AstModule -{ -public: - AstConstants(const OString& name, AstScope* pScope) - : AstModule(NT_constants, name, pScope) - {} - virtual ~AstConstants() {} -}; - -#endif // INCLUDED_IDLC_INC_IDLC_ASTCONSTANTS_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/idlc/astdeclaration.hxx b/idlc/inc/idlc/astdeclaration.hxx deleted file mode 100644 index 6b329e961a7c..000000000000 --- a/idlc/inc/idlc/astdeclaration.hxx +++ /dev/null @@ -1,132 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_IDLC_ASTDECLARATION_HXX -#define INCLUDED_IDLC_INC_IDLC_ASTDECLARATION_HXX - -#include -#include - -class AstScope; - -// Enum defining the different kinds of Ast nodes -enum NodeType -{ - NT_object, // Denotes an object - NT_service, // Denotes an servcie - NT_interface_member, // Denotes an interface which is exported from object - NT_service_member, // Denotes an service which is exported from object - NT_observes, // Denotes an observed interface - NT_needs, // Denotes an needed service - NT_module, // Denotes a module - NT_root, // Denotes the root of AST - NT_interface, // Denotes an interface - NT_constants, // Denotes a constant group - NT_const, // Denotes a constant - NT_exception, // Denotes an exception - NT_attribute, // Denotes an attribute - NT_property, // Denotes an property - NT_operation, // Denotes an operation - NT_parameter, // Denotes an op. parameter - NT_struct, // Denotes either a plain struct type, or a - // polymorphic struct type template - NT_type_parameter, // Denotes a type parameter of a polymorphic struct - // type template - NT_instantiated_struct, // Denotes an instantiated polymorphic struct type - NT_member, // Denotes a member in structure, exception - NT_enum, // Denotes an enumeration - NT_enum_val, // Denotes an enum. value - NT_sequence, // Denotes an IDL sequence - NT_typedef, // Denotes a typedef - NT_predefined, // Denotes a predefined type - NT_singleton // Denotes a singleton -}; - -class AstDeclaration -{ -public: - // Constructors - AstDeclaration(NodeType type, const OString& name, AstScope* pScope); - virtual ~AstDeclaration(); - - // Data access - const OString& getLocalName() const - { return m_localName; } - const OString& getScopedName() const - { return m_scopedName; } - const OString& getFullName() - { return m_fullName; } - virtual const sal_Char* getRelativName() const - { return m_fullName.getStr()+1; } - AstScope* getScope() - { return m_pScope; } - const AstScope* getScope() const - { return m_pScope; } - NodeType getNodeType() const - { return m_nodeType; } - bool isInMainfile() const - { return m_bInMainFile; } - void setInMainfile(bool bInMainfile) - { m_bInMainFile = bInMainfile; } - bool isImported() const - { return m_bImported; } - void setImported(bool bImported) - { m_bImported = bImported; } - sal_Int32 getLineNumber() const - { return m_lineNumber; } - void setLineNumber(sal_Int32 lineNumber) - { m_lineNumber = lineNumber; } - const OString& getFileName() const - { return m_fileName; } - void setFileName(const OString& rFileName) - { m_fileName = rFileName; } - const OUString& getDocumentation() const - { return m_documentation; } - void setDocumentation(const OUString& rDocumentation) - { m_documentation = rDocumentation; } - - virtual bool isType() const; - - bool hasAncestor(AstDeclaration* pDecl); - - void setPublished() { m_bPublished = true; } - bool isPublished() const { return m_bPublished; } - - virtual bool dump(RegistryKey& rKey); - - bool isPredefined() { return m_bPredefined; } - void setPredefined(bool bPredefined); - -protected: - OString m_localName; - OString m_scopedName; // full qualified name - OString m_fullName; // full qualified name with '/' as separator - AstScope* m_pScope; - NodeType m_nodeType; - bool m_bImported; // imported ? - bool m_bInMainFile; // defined in main file - bool m_bPublished; - bool m_bPredefined; - sal_Int32 m_lineNumber; // line number defined in - OString m_fileName; // fileName defined in - OUString m_documentation; // fileName defined in -}; - -#endif // INCLUDED_IDLC_INC_IDLC_ASTDECLARATION_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/idlc/astenum.hxx b/idlc/inc/idlc/astenum.hxx deleted file mode 100644 index 0bdf764905a6..000000000000 --- a/idlc/inc/idlc/astenum.hxx +++ /dev/null @@ -1,48 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_IDLC_ASTENUM_HXX -#define INCLUDED_IDLC_INC_IDLC_ASTENUM_HXX - -#include -#include -#include - -class AstEnum : public AstType - , public AstScope -{ -public: - AstEnum(const OString& name, AstScope* pScope); - - virtual ~AstEnum(); - - sal_Int32 getEnumValueCount() - { return m_enumValueCount++; } - - AstConstant* checkValue(AstExpression* pExpr); - - virtual bool dump(RegistryKey& rKey) override; - - virtual AstDeclaration* addDeclaration(AstDeclaration* pDecl) override; -private: - sal_Int32 m_enumValueCount; -}; - -#endif // INCLUDED_IDLC_INC_IDLC_ASTENUM_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/idlc/astexception.hxx b/idlc/inc/idlc/astexception.hxx deleted file mode 100644 index efa9805d868f..000000000000 --- a/idlc/inc/idlc/astexception.hxx +++ /dev/null @@ -1,36 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_IDLC_ASTEXCEPTION_HXX -#define INCLUDED_IDLC_INC_IDLC_ASTEXCEPTION_HXX - -#include - -class AstException : public AstStruct -{ -public: - AstException(const OString& name, AstException* pBaseType, AstScope* pScope) - : AstStruct(NT_exception, name, pBaseType, pScope) - {} - - virtual ~AstException() {} -}; - -#endif // INCLUDED_IDLC_INC_IDLC_ASTEXCEPTION_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/idlc/astexpression.hxx b/idlc/inc/idlc/astexpression.hxx deleted file mode 100644 index 4e51e8bfb51a..000000000000 --- a/idlc/inc/idlc/astexpression.hxx +++ /dev/null @@ -1,143 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_IDLC_ASTEXPRESSION_HXX -#define INCLUDED_IDLC_INC_IDLC_ASTEXPRESSION_HXX - -#include - -#include - -#include - -// Enum to define all the different operators to combine expressions -enum ExprComb -{ - EC_add, // '+' - EC_minus, // '-' - EC_mul, // '*' - EC_div, // '/' - EC_mod, // '%' - EC_or, // '|' - EC_xor, // '^' - EC_and, // '&' - EC_left, // '<<' - EC_right, // '>>' - EC_u_plus, // unary '+' - EC_u_minus, // unary '-' - EC_bit_neg, // '~' - EC_none, // No operator (missing) - EC_symbol // a symbol (function or constant name) -}; - -// Enum to define expression type -enum ExprType -{ - ET_short, // Expression value is short - ET_ushort, // Expression value is unsigned short - ET_long, // Expression value is long - ET_ulong, // Expression value is unsigned long - ET_hyper, // Expression value is hyper (64 bit) - ET_uhyper, // Expression value is unsigned hyper - ET_float, // Expression value is 32-bit float - ET_double, // Expression value is 64-bit float - ET_char, // Expression value is char - ET_byte, // Expression value is byte - ET_boolean, // Expression value is boolean - ET_string, // Expression value is char * - ET_any, // Expression value is any of above - ET_void, // Expression value is void (absent) - ET_type, // Expression value is type - ET_none // Expression value is missing -}; - -// Structure to describe value of constant expression and its type -struct AstExprValue -{ - union - { - sal_uInt8 byval; // Contains byte expression value - sal_Int16 sval; // Contains short expression value - sal_uInt16 usval; // Contains unsigned short expr value - sal_Int32 lval; // Contains long expression value - sal_uInt32 ulval; // Contains unsigned long expr value - sal_Int64 hval; // Contains hyper expression value - sal_uInt64 uhval; // Contains unsigned hyper expr value - bool bval; // Contains boolean expression value - float fval; // Contains 32-bit float expr value - double dval; // Contains 64-bit float expr value - } u; - ExprType et; -}; - -const sal_Char* SAL_CALL exprTypeToString(ExprType t); - -class AstExpression -{ -public: - // Constructor(s) - AstExpression(ExprComb c, AstExpression *pExpr1, AstExpression *pExpr2); - - AstExpression(sal_Int32 l); - AstExpression(sal_Int32 l, ExprType et); - AstExpression(sal_Int64 h); - AstExpression(sal_uInt64 uh); - AstExpression(double d); - AstExpression(OString* scopedName); - - virtual ~AstExpression(); - - // Data Accessors - ExprComb getCombOperator() - { return m_combOperator; } - AstExprValue* getExprValue() - { return m_exprValue; } - - // Evaluation and value coercion - bool coerce(ExprType type); - - // Evaluate then store value inside this AstExpression - void evaluate(); - - // Compare to AstExpressions - bool compare(AstExpression *pExpr); - - OString toString(); -private: - // Fill out the lineno, filename and definition scope details - void fillDefinitionDetails(); - // Evaluate different sets of operators - std::unique_ptr eval_bin_op(); - std::unique_ptr eval_bit_op(); - std::unique_ptr eval_un_op(); - AstExprValue* eval_symbol(); - - AstScope* m_pScope; // scope defined in - sal_Int32 m_lineNo; // line number defined in - OString m_fileName; // fileName defined in - - ExprComb m_combOperator; - AstExpression* m_subExpr1; - AstExpression* m_subExpr2; - AstExprValue* m_exprValue; - OString* m_pSymbolicName; -}; - -#endif // INCLUDED_IDLC_INC_IDLC_ASTEXPRESSION_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/idlc/astinterface.hxx b/idlc/inc/idlc/astinterface.hxx deleted file mode 100644 index 99f9dee5eea5..000000000000 --- a/idlc/inc/idlc/astinterface.hxx +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_IDLC_ASTINTERFACE_HXX -#define INCLUDED_IDLC_INC_IDLC_ASTINTERFACE_HXX - -#include -#include -#include "idlc/inheritedinterface.hxx" - -#include -#include - -class AstInterface : public AstType - , public AstScope -{ -public: - typedef std::vector< InheritedInterface > InheritedInterfaces; - - typedef std::vector< AstInterface const * > DoubleInterfaceDeclarations; - - struct DoubleMemberDeclaration { - AstDeclaration const * first; - AstDeclaration const * second; - }; - - typedef std::vector< DoubleMemberDeclaration > DoubleMemberDeclarations; - - struct DoubleDeclarations { - DoubleInterfaceDeclarations interfaces; - DoubleMemberDeclarations members; - }; - - AstInterface( - const OString& name, AstInterface const * pInherits, - AstScope* pScope); - virtual ~AstInterface(); - - InheritedInterfaces const & getAllInheritedInterfaces() const - { return m_inheritedInterfaces; } - - bool hasMandatoryInheritedInterfaces() const - { return m_mandatoryInterfaces > 0; } - - void setDefined() { m_bIsDefined = true; } - bool isDefined() const - { return m_bIsDefined; } - - bool usesSingleInheritance() const { return m_bSingleInheritance; } - - DoubleDeclarations checkInheritedInterfaceClashes( - AstInterface const * ifc, bool optional) const; - - void addInheritedInterface( - AstType const * ifc, bool optional, - OUString const & documentation); - - DoubleMemberDeclarations checkMemberClashes( - AstDeclaration const * member) const; - - void addMember(AstDeclaration /*TODO: const*/ * member); - - void forwardDefined(AstInterface const & def); - - virtual bool dump(RegistryKey& rKey) override; - -private: - enum InterfaceKind { - INTERFACE_INDIRECT_OPTIONAL, INTERFACE_DIRECT_OPTIONAL, - INTERFACE_INDIRECT_MANDATORY, INTERFACE_DIRECT_MANDATORY }; - - struct VisibleMember { - explicit VisibleMember(AstDeclaration const * theMandatory = nullptr): - mandatory(theMandatory) {} - - typedef std::map< OString, AstDeclaration const * > Optionals; - - AstDeclaration const * mandatory; - Optionals optionals; - }; - - typedef std::map< OString, InterfaceKind > VisibleInterfaces; - typedef std::map< OString, VisibleMember > VisibleMembers; - - void checkInheritedInterfaceClashes( - DoubleDeclarations & doubleDeclarations, - std::set< OString > & seenInterfaces, AstInterface const * ifc, - bool direct, bool optional, bool mainOptional) const; - - void checkMemberClashes( - DoubleMemberDeclarations & doubleMembers, AstDeclaration const * member, - bool checkOptional) const; - - void addVisibleInterface( - AstInterface const * ifc, bool direct, bool optional); - - void addOptionalVisibleMembers(AstInterface const * ifc); - - bool increment(sal_uInt16 * counter, char const * sort) const; - - InheritedInterfaces m_inheritedInterfaces; - InheritedInterfaces::size_type m_mandatoryInterfaces; - bool m_bIsDefined; - bool m_bSingleInheritance; - VisibleInterfaces m_visibleInterfaces; - VisibleMembers m_visibleMembers; -}; - -#endif // INCLUDED_IDLC_INC_IDLC_ASTINTERFACE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/idlc/astinterfacemember.hxx b/idlc/inc/idlc/astinterfacemember.hxx deleted file mode 100644 index faaba11b939d..000000000000 --- a/idlc/inc/idlc/astinterfacemember.hxx +++ /dev/null @@ -1,46 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_IDLC_ASTINTERFACEMEMBER_HXX -#define INCLUDED_IDLC_INC_IDLC_ASTINTERFACEMEMBER_HXX - -#include - -class AstInterfaceMember : public AstDeclaration -{ -public: - AstInterfaceMember(const sal_uInt32 flags, AstInterface* pRealInterface, - const OString& name, AstScope* pScope) - : AstDeclaration(NT_interface_member, name, pScope) - , m_flags(flags) - , m_pRealInterface(pRealInterface) - {} - virtual ~AstInterfaceMember() {} - - AstInterface* getRealInterface() - { return m_pRealInterface; } - bool isOptional() - { return ((m_flags & AF_OPTIONAL) == AF_OPTIONAL); } -private: - const sal_uInt32 m_flags; - AstInterface* m_pRealInterface; -}; - -#endif // INCLUDED_IDLC_INC_IDLC_ASTINTERFACEMEMBER_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/idlc/astmember.hxx b/idlc/inc/idlc/astmember.hxx deleted file mode 100644 index 52a5042e0226..000000000000 --- a/idlc/inc/idlc/astmember.hxx +++ /dev/null @@ -1,50 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_IDLC_INC_IDLC_ASTMEMBER_HXX -#define INCLUDED_IDLC_INC_IDLC_ASTMEMBER_HXX - -#include "idlc/astdeclaration.hxx" - -class AstScope; -class AstType; - -class AstMember: public AstDeclaration { -public: - AstMember( - AstType const * pType, OString const & name, AstScope * pScope): - AstDeclaration(NT_member, name, pScope), m_pType(pType) {} - - virtual ~AstMember() {} - - AstType const * getType() const { return m_pType; } - -protected: - AstMember( - NodeType type, AstType const * pType, OString const & name, - AstScope * pScope): - AstDeclaration(type, name, pScope), m_pType(pType) {} - -private: - AstType const * m_pType; -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/idlc/astmodule.hxx b/idlc/inc/idlc/astmodule.hxx deleted file mode 100644 index 37bf965a7c05..000000000000 --- a/idlc/inc/idlc/astmodule.hxx +++ /dev/null @@ -1,44 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_IDLC_ASTMODULE_HXX -#define INCLUDED_IDLC_INC_IDLC_ASTMODULE_HXX - -#include -#include - -class AstModule : public AstDeclaration - , public AstScope -{ -public: - AstModule(const OString& name, AstScope* pScope) - : AstDeclaration(NT_module, name, pScope) - , AstScope(NT_module) - {} - AstModule(NodeType type, const OString& name, AstScope* pScope) - : AstDeclaration(type, name, pScope) - , AstScope(type) - {} - virtual ~AstModule() {} - - virtual bool dump(RegistryKey& rKey) override; -}; - -#endif // INCLUDED_IDLC_INC_IDLC_ASTMODULE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/idlc/astneeds.hxx b/idlc/inc/idlc/astneeds.hxx deleted file mode 100644 index f96a2bb82690..000000000000 --- a/idlc/inc/idlc/astneeds.hxx +++ /dev/null @@ -1,41 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_IDLC_ASTNEEDS_HXX -#define INCLUDED_IDLC_INC_IDLC_ASTNEEDS_HXX - -#include - -class AstNeeds : public AstDeclaration -{ -public: - AstNeeds(AstService* pRealService, const OString& name, AstScope* pScope) - : AstDeclaration(NT_needs, name, pScope) - , m_pRealService(pRealService) - {} - virtual ~AstNeeds() {} - - AstService* getRealService() - { return m_pRealService; } -private: - AstService* m_pRealService; -}; - -#endif // INCLUDED_IDLC_INC_IDLC_ASTNEEDS_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/idlc/astobserves.hxx b/idlc/inc/idlc/astobserves.hxx deleted file mode 100644 index 9f84d0cbeecb..000000000000 --- a/idlc/inc/idlc/astobserves.hxx +++ /dev/null @@ -1,41 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_IDLC_ASTOBSERVES_HXX -#define INCLUDED_IDLC_INC_IDLC_ASTOBSERVES_HXX - -#include - -class AstObserves : public AstDeclaration -{ -public: - AstObserves(AstInterface* pRealInterface, const OString& name, AstScope* pScope) - : AstDeclaration(NT_observes, name, pScope) - , m_pRealInterface(pRealInterface) - {} - virtual ~AstObserves() {} - - AstInterface* getRealInterface() - { return m_pRealInterface; } -private: - AstInterface* m_pRealInterface; -}; - -#endif // INCLUDED_IDLC_INC_IDLC_ASTOBSERVES_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/idlc/astoperation.hxx b/idlc/inc/idlc/astoperation.hxx deleted file mode 100644 index a0a4f7b86cc6..000000000000 --- a/idlc/inc/idlc/astoperation.hxx +++ /dev/null @@ -1,59 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_IDLC_ASTOPERATION_HXX -#define INCLUDED_IDLC_INC_IDLC_ASTOPERATION_HXX - -#include -#include - -namespace typereg { class Writer; } - -class AstType; - -class AstOperation : public AstDeclaration - , public AstScope -{ -public: - AstOperation(AstType const * pReturnType, const OString& name, AstScope* pScope) - : AstDeclaration(NT_operation, name, pScope) - , AstScope(NT_operation) - , m_pReturnType(pReturnType) - {} - virtual ~AstOperation() {} - - bool isVariadic() const; - - bool isConstructor() const { return m_pReturnType == nullptr; } - - void setExceptions(DeclList const * pExceptions); - sal_uInt16 nExceptions() - { return (sal_uInt16)(m_exceptions.size()); } - - bool dumpBlob(typereg::Writer & rBlob, sal_uInt16 index); - - // scope management - virtual AstDeclaration* addDeclaration(AstDeclaration* pDecl) override; -private: - AstType const * m_pReturnType; - DeclList m_exceptions; -}; - -#endif // INCLUDED_IDLC_INC_IDLC_ASTOPERATION_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/idlc/astparameter.hxx b/idlc/inc/idlc/astparameter.hxx deleted file mode 100644 index 18a84d3583f7..000000000000 --- a/idlc/inc/idlc/astparameter.hxx +++ /dev/null @@ -1,48 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_IDLC_INC_IDLC_ASTPARAMETER_HXX -#define INCLUDED_IDLC_INC_IDLC_ASTPARAMETER_HXX - -#include - -enum Direction { DIR_IN, DIR_OUT, DIR_INOUT }; - -class AstParameter: public AstMember { -public: - AstParameter( - Direction direction, bool rest, AstType const * type, - OString const & name, AstScope * scope): - AstMember(NT_parameter, type, name, scope), m_direction(direction), - m_rest(rest) {} - - virtual ~AstParameter() {} - - Direction getDirection() const { return m_direction; } - - bool isRest() const { return m_rest; } - -private: - Direction m_direction; - bool m_rest; -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/idlc/astscope.hxx b/idlc/inc/idlc/astscope.hxx deleted file mode 100644 index c7d64a16dc2e..000000000000 --- a/idlc/inc/idlc/astscope.hxx +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_IDLC_ASTSCOPE_HXX -#define INCLUDED_IDLC_INC_IDLC_ASTSCOPE_HXX - -#include - -class AstExpression; -#include -#include - -class AstScope -{ -public: - AstScope(NodeType nodeType); - virtual ~AstScope(); - - NodeType getScopeNodeType() const - { return m_nodeType; } - - virtual AstDeclaration* addDeclaration(AstDeclaration* pDecl); - - sal_uInt32 nMembers() const - { return (sal_uInt32)(m_declarations.size()); } - DeclList::const_iterator getIteratorBegin() const - { return m_declarations.begin(); } - DeclList::const_iterator getIteratorEnd() const - { return m_declarations.end(); } - sal_uInt16 getNodeCount(NodeType nType); - - // Name look up mechanism - AstDeclaration* lookupByName(const OString& scopedName); - // Look up the identifier 'name' specified only in the local scope - AstDeclaration* lookupByNameLocal(const OString& name) const; - - AstDeclaration* lookupInInherited(const OString& scopedName) const; - - // Look up a predefined type by its ExprType - AstDeclaration* lookupPrimitiveType(ExprType type); - - AstDeclaration* lookupForAdd(AstDeclaration* pDecl); - -protected: - inline AstDeclaration const * getLast() const - { return m_declarations.back(); } - -private: - DeclList m_declarations; - NodeType m_nodeType; -}; - -#endif // INCLUDED_IDLC_INC_IDLC_ASTSCOPE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/idlc/astsequence.hxx b/idlc/inc/idlc/astsequence.hxx deleted file mode 100644 index 1eefbea3f949..000000000000 --- a/idlc/inc/idlc/astsequence.hxx +++ /dev/null @@ -1,52 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_IDLC_ASTSEQUENCE_HXX -#define INCLUDED_IDLC_INC_IDLC_ASTSEQUENCE_HXX - -#include - -class AstSequence : public AstType -{ -public: - AstSequence(AstType const * pMemberType, AstScope* pScope) - : AstType(NT_sequence, OString("[]")+pMemberType->getScopedName(), pScope) - , m_pMemberType(pMemberType) - , m_pRelativName(nullptr) - {} - virtual ~AstSequence() - { - if ( m_pRelativName ) - delete m_pRelativName; - } - - AstType const * getMemberType() const - { return m_pMemberType; } - - virtual bool isUnsigned() const override - { return m_pMemberType != nullptr && m_pMemberType->isUnsigned(); } - - virtual const sal_Char* getRelativName() const override; -private: - AstType const * m_pMemberType; - mutable OString* m_pRelativName; -}; - -#endif // INCLUDED_IDLC_INC_IDLC_ASTSEQUENCE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/idlc/astservice.hxx b/idlc/inc/idlc/astservice.hxx deleted file mode 100644 index 8112db6a3652..000000000000 --- a/idlc/inc/idlc/astservice.hxx +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_IDLC_ASTSERVICE_HXX -#define INCLUDED_IDLC_INC_IDLC_ASTSERVICE_HXX - -#include -#include - -class AstService : public AstDeclaration - , public AstScope -{ -public: - AstService(const OString& name, AstScope* pScope) - : AstDeclaration(NT_service, name, pScope) - , AstScope(NT_service) - , m_singleInterfaceBasedService(false) - , m_defaultConstructor(false) - {} - AstService(const NodeType type, const OString& name, AstScope* pScope) - : AstDeclaration(type, name, pScope) - , AstScope(type) - , m_singleInterfaceBasedService(false) - , m_defaultConstructor(false) - {} - virtual ~AstService() {} - - virtual bool dump(RegistryKey& rKey) override; - - void setSingleInterfaceBasedService() - { m_singleInterfaceBasedService = true; } - - void setDefaultConstructor(bool b) { m_defaultConstructor = b; } - - bool isSingleInterfaceBasedService() const - { return m_singleInterfaceBasedService; } - - bool checkLastConstructor() const; - -private: - bool m_singleInterfaceBasedService; - bool m_defaultConstructor; -}; - -#endif // INCLUDED_IDLC_INC_IDLC_ASTSERVICE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/idlc/astservicemember.hxx b/idlc/inc/idlc/astservicemember.hxx deleted file mode 100644 index 0f08527211d8..000000000000 --- a/idlc/inc/idlc/astservicemember.hxx +++ /dev/null @@ -1,46 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_IDLC_ASTSERVICEMEMBER_HXX -#define INCLUDED_IDLC_INC_IDLC_ASTSERVICEMEMBER_HXX - -#include - -class AstServiceMember : public AstDeclaration -{ -public: - AstServiceMember(const sal_uInt32 flags, AstService* pRealService, - const OString& name, AstScope* pScope) - : AstDeclaration(NT_service_member, name, pScope) - , m_flags(flags) - , m_pRealService(pRealService) - {} - virtual ~AstServiceMember() {} - - AstService* getRealService() - { return m_pRealService; } - bool isOptional() - { return ((m_flags & AF_OPTIONAL) == AF_OPTIONAL); } -private: - const sal_uInt32 m_flags; - AstService* m_pRealService; -}; - -#endif // INCLUDED_IDLC_INC_IDLC_ASTSERVICEMEMBER_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/idlc/aststack.hxx b/idlc/inc/idlc/aststack.hxx deleted file mode 100644 index 0a63c31e2331..000000000000 --- a/idlc/inc/idlc/aststack.hxx +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_IDLC_ASTSTACK_HXX -#define INCLUDED_IDLC_INC_IDLC_ASTSTACK_HXX - -#include - -class AstScope; - -class AstStack -{ -public: - AstStack(); - virtual ~AstStack(); - - sal_uInt32 depth() { return m_top;} - AstScope* top(); - AstScope* bottom(); - AstScope* nextToTop(); - AstScope* topNonNull(); - AstStack* push(AstScope* pScope); - void pop(); - void clear(); - -private: - AstScope** m_stack; - sal_uInt32 m_size; - sal_uInt32 m_top; -}; - -#endif // INCLUDED_IDLC_INC_IDLC_ASTSTACK_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/idlc/aststruct.hxx b/idlc/inc/idlc/aststruct.hxx deleted file mode 100644 index 2a3330bf6114..000000000000 --- a/idlc/inc/idlc/aststruct.hxx +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_IDLC_ASTSTRUCT_HXX -#define INCLUDED_IDLC_INC_IDLC_ASTSTRUCT_HXX - -#include -#include -#include "idlc/idlctypes.hxx" - -class AstStruct; - -class AstStruct : public AstType - , public AstScope -{ -public: - AstStruct( - const OString& name, - std::vector< OString > const & typeParameters, - AstStruct const* pBaseType, AstScope* pScope); - - AstStruct(const NodeType type, - const OString& name, - AstStruct const* pBaseType, - AstScope* pScope); - virtual ~AstStruct(); - - DeclList::size_type getTypeParameterCount() const - { return m_typeParameters.size(); } - - AstDeclaration const * findTypeParameter(OString const & name) const; - - virtual bool isType() const override; - - virtual bool dump(RegistryKey& rKey) override; -private: - AstStruct const* m_pBaseType; - DeclList m_typeParameters; -}; - -#endif // INCLUDED_IDLC_INC_IDLC_ASTSTRUCT_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/idlc/aststructinstance.hxx b/idlc/inc/idlc/aststructinstance.hxx deleted file mode 100644 index 706d6cb1c0db..000000000000 --- a/idlc/inc/idlc/aststructinstance.hxx +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_IDLC_INC_IDLC_ASTSTRUCTINSTANCE_HXX -#define INCLUDED_IDLC_INC_IDLC_ASTSTRUCTINSTANCE_HXX - -#include "idlc/asttype.hxx" -#include "idlc/idlctypes.hxx" - -class AstScope; - -class AstStructInstance: public AstType { -public: - AstStructInstance( - AstType const * typeTemplate, DeclList const * typeArguments, - AstScope * scope); - - AstType const * getTypeTemplate() const { return m_typeTemplate; } - - DeclList::const_iterator getTypeArgumentsBegin() const - { return m_typeArguments.begin(); } - - DeclList::const_iterator getTypeArgumentsEnd() const - { return m_typeArguments.end(); } - -private: - AstType const * m_typeTemplate; - DeclList m_typeArguments; -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/idlc/asttype.hxx b/idlc/inc/idlc/asttype.hxx deleted file mode 100644 index caecefda4f09..000000000000 --- a/idlc/inc/idlc/asttype.hxx +++ /dev/null @@ -1,38 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_IDLC_ASTTYPE_HXX -#define INCLUDED_IDLC_INC_IDLC_ASTTYPE_HXX - -#include - -class AstType : public AstDeclaration -{ -public: - AstType(const NodeType type, const OString& name, AstScope* pScope) - : AstDeclaration(type, name, pScope) - {} - - virtual ~AstType() {} - - virtual bool isUnsigned() const { return false; } -}; - -#endif // INCLUDED_IDLC_INC_IDLC_ASTTYPE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/idlc/asttypedef.hxx b/idlc/inc/idlc/asttypedef.hxx deleted file mode 100644 index d31b7d62fc6f..000000000000 --- a/idlc/inc/idlc/asttypedef.hxx +++ /dev/null @@ -1,46 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_IDLC_ASTTYPEDEF_HXX -#define INCLUDED_IDLC_INC_IDLC_ASTTYPEDEF_HXX - -#include - -class AstTypeDef : public AstType -{ -public: - AstTypeDef( - AstType const * baseType, OString const & name, AstScope * scope): - AstType(NT_typedef, name, scope), m_pBaseType(baseType) {} - - virtual ~AstTypeDef() {} - - AstType const * getBaseType() const - { return m_pBaseType; } - - virtual bool isUnsigned() const override - { return m_pBaseType != nullptr && m_pBaseType->isUnsigned(); } - - virtual bool dump(RegistryKey& rKey) override; -private: - AstType const * m_pBaseType; -}; - -#endif // INCLUDED_IDLC_INC_IDLC_ASTTYPEDEF_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/idlc/errorhandler.hxx b/idlc/inc/idlc/errorhandler.hxx deleted file mode 100644 index 7f7fd614fc43..000000000000 --- a/idlc/inc/idlc/errorhandler.hxx +++ /dev/null @@ -1,132 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_IDLC_ERRORHANDLER_HXX -#define INCLUDED_IDLC_INC_IDLC_ERRORHANDLER_HXX - -#include -#include -#include - -enum ErrorCode -{ - EIDL_NONE, // No error - EIDL_SYNTAX_ERROR, // Syntax error in IDL input - // More details will be gleaned from examining - // the parse state - EIDL_REDEF, // Redefinition - EIDL_REDEF_SCOPE, // Redefinition inside defining scope - EIDL_DEF_USE, // Definition after use - EIDL_COERCION_FAILURE, // Coercion failure - EIDL_SCOPE_CONFLICT, // Between fwd declare and full declare - EIDL_ILLEGAL_ADD, // Illegal add action - EIDL_ILLEGAL_USE, // Illegal type used in expression - EIDL_ILLEGAL_RAISES, // Error in "raises" clause - EIDL_CANT_INHERIT, // Cannot inherit from non-interface - EIDL_LOOKUP_ERROR, // Identifier not found - EIDL_INHERIT_FWD_ERROR, // Cannot inherit from fwd decl interface - EIDL_CONSTANT_EXPECTED, // We got something else.. - EIDL_NAME_CASE_ERROR, // Spelling differences found - EIDL_EVAL_ERROR, // Error in evaluating expression - EIDL_AMBIGUOUS, // Ambiguous name definition - EIDL_DECL_NOT_DEFINED, // Forward declared but never defined - EIDL_FWD_DECL_LOOKUP, // Tried to lookup in fwd declared intf - EIDL_RECURSIVE_TYPE, // Illegal recursive use of type - EIDL_NOT_A_TYPE, // Not a type - EIDL_TYPE_NOT_VALID, // Type is not valid in this context - EIDL_INTERFACEMEMBER_LOOKUP, // interface is not defined or a fwd declaration not exists - EIDL_SERVICEMEMBER_LOOKUP, - EIDL_TYPE_IDENT_CONFLICT, // type and identifier has equal names - EIDL_WRONGATTRIBUTEFLAG, - EIDL_DEFINED_ATTRIBUTEFLAG, - EIDL_WRONGATTRIBUTEKEYWORD, - EIDL_MISSINGATTRIBUTEKEYWORD, - EIDL_BAD_ATTRIBUTE_FLAGS, - EIDL_OPTIONALEXPECTED, - EIDL_MIXED_INHERITANCE, - EIDL_DOUBLE_INHERITANCE, - EIDL_DOUBLE_MEMBER, - EIDL_CONSTRUCTOR_PARAMETER_NOT_IN, - EIDL_CONSTRUCTOR_REST_PARAMETER_NOT_FIRST, - EIDL_REST_PARAMETER_NOT_LAST, - EIDL_REST_PARAMETER_NOT_ANY, - EIDL_METHOD_HAS_REST_PARAMETER, - EIDL_READONLY_ATTRIBUTE_SET_EXCEPTIONS, - EIDL_UNSIGNED_TYPE_ARGUMENT, - EIDL_WRONG_NUMBER_OF_TYPE_ARGUMENTS, - EIDL_INSTANTIATED_STRUCT_TYPE_TYPEDEF, - EIDL_IDENTICAL_TYPE_PARAMETERS, - EIDL_STRUCT_TYPE_TEMPLATE_WITH_BASE, - EIDL_PUBLISHED_FORWARD, - EIDL_PUBLISHED_USES_UNPUBLISHED, - EIDL_SIMILAR_CONSTRUCTORS -}; - -enum WarningCode -{ - WIDL_EXPID_CONFLICT, // exception id conflict - WIDL_REQID_CONFLICT, // request id conflict - WIDL_INHERIT_IDCONFLICT, // request id conflict inheritance tree - WIDL_TYPE_IDENT_CONFLICT, // type and identifier has equal names - WIDL_WRONG_NAMING_CONV // type or identifier doesn't fulfill the UNO naming convention -}; - -class ErrorHandler -{ -public: - // Report errors with varying numbers of arguments - static void error0(ErrorCode e); - static void error1(ErrorCode e, AstDeclaration const * d); - static void error2( - ErrorCode e, AstDeclaration const * d1, AstDeclaration const * d2); - static void error3(ErrorCode e, AstDeclaration* d1, AstDeclaration* d2, AstDeclaration* d3); - - // Warning - static void warning0(WarningCode e, const sal_Char* warningmsg); - - // Report a syntax error in IDL input - static void syntaxError(ParseState state, sal_Int32 lineNumber, const sal_Char* errmsg); - - // Report an unsuccessful coercion attempt - static void coercionError(AstExpression *pExpr, ExprType et); - - // Report a failed name lookup attempt - static void lookupError(const OString& n); - // Report a failed name lookup attempt - static void lookupError(ErrorCode e, const OString& n, AstDeclaration* pScope); - - - // Report a type error - static void noTypeError(AstDeclaration const * pDecl); - - static void inheritanceError(NodeType nodeType, const OString* name, AstDeclaration* pDecl); - - static void flagError(ErrorCode e, sal_uInt32 flag); - - static void forwardLookupError(const AstDeclaration* pForward, const OString& name); - - static void constantExpected(AstDeclaration* pDecl, const OString& name); - - static void evalError(AstExpression* pExpr); - - static bool checkPublished(AstDeclaration const * decl, bool bOptional=false); -}; - -#endif // INCLUDED_IDLC_INC_IDLC_ERRORHANDLER_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/idlc/fehelper.hxx b/idlc/inc/idlc/fehelper.hxx deleted file mode 100644 index 1af64561a128..000000000000 --- a/idlc/inc/idlc/fehelper.hxx +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_IDLC_FEHELPER_HXX -#define INCLUDED_IDLC_INC_IDLC_FEHELPER_HXX - -#include -#include - -#include - -class FeDeclarator -{ -public: - FeDeclarator(const OString& name); - virtual ~FeDeclarator(); - const OString& getName() - { return m_name; } - bool checkType(AstDeclaration const * pType); - static AstType const * compose(AstDeclaration const * pDecl); -private: - OString m_name; -}; - -typedef ::std::list< FeDeclarator* > FeDeclList; - -class FeInheritanceHeader -{ -public: - FeInheritanceHeader( - NodeType nodeType, OString* pName, OString* pInherits, - std::vector< OString > * typeParameters); - - virtual ~FeInheritanceHeader() - { - if ( m_pName ) - delete m_pName; - } - - NodeType getNodeType() - { return m_nodeType; } - OString* getName() - { return m_pName; } - AstDeclaration* getInherits() - { return m_pInherits; } - - std::vector< OString > const & getTypeParameters() const - { return m_typeParameters; } - -private: - void initializeInherits(OString* pinherits); - - NodeType m_nodeType; - OString* m_pName; - AstDeclaration* m_pInherits; - std::vector< OString > m_typeParameters; -}; - -#endif // INCLUDED_IDLC_INC_IDLC_FEHELPER_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/idlc/idlc.hxx b/idlc/inc/idlc/idlc.hxx deleted file mode 100644 index 7d92c7f9493e..000000000000 --- a/idlc/inc/idlc/idlc.hxx +++ /dev/null @@ -1,166 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_IDLC_IDLC_HXX -#define INCLUDED_IDLC_INC_IDLC_IDLC_HXX - -#include -#include -#include - -#ifdef SAL_UNX -#define SEPARATOR '/' -#define PATH_SEPARATOR "/" -#else -#define SEPARATOR '\\' -#define PATH_SEPARATOR "\\" -#endif - -class AstInterface; -class AstModule; -class AstType; -class Options; -class ErrorHandler; - -class Idlc -{ -public: - Idlc(Options* pOptions); - virtual ~Idlc(); - - void init(); - - bool dumpDeps(OString const& rDepFile, - OString const& rTarget); - - Options* getOptions() - { return m_pOptions; } - AstStack* scopes() - { return m_pScopes; } - AstModule* getRoot() - { return m_pRoot; } - const OString& getFileName() - { return m_fileName; } - void setFileName(const OString& fileName) - { m_fileName = fileName; addInclude(fileName); } - const OString& getMainFileName() - { return m_mainFileName; } - void setMainFileName(const OString& mainFileName) - { m_mainFileName = mainFileName; } - const OString& getRealFileName() - { return m_realFileName; } - void setRealFileName(const OString& realFileName) - { m_realFileName = realFileName; } - const OString& getDocumentation() - { - m_bIsDocValid = false; - return m_documentation; - } - void setDocumentation(const OString& documentation) - { - m_documentation = documentation; - m_bIsDocValid = true; - } - OUString processDocumentation(); - bool isInMainFile() - { return m_bIsInMainfile; } - void setInMainfile(bool bInMainfile) - { m_bIsInMainfile = bInMainfile; } - sal_uInt32 getErrorCount() - { return m_errorCount; } - void incErrorCount() - { m_errorCount++; } - sal_uInt32 getWarningCount() - { return m_warningCount; } - void incWarningCount() - { m_warningCount++; } - sal_uInt32 getLineNumber() - { return m_lineNumber; } - sal_uInt32 getOffsetStart() - { return m_offsetStart; } - sal_uInt32 getOffsetEnd() - { return m_offsetEnd; } - void setOffset( sal_uInt32 start, sal_uInt32 end) - { m_offsetStart = start; m_offsetEnd = end; } - void setLineNumber(sal_uInt32 lineNumber) - { m_lineNumber = lineNumber; } - void incLineNumber() - { m_lineNumber++; } - ParseState getParseState() - { return m_parseState; } - void setParseState(ParseState parseState) - { m_parseState = parseState; } - - void addInclude(const OString& inc) - { m_includes.insert(inc); } - - void setPublished(bool published) { m_published = published; } - bool isPublished() const { return m_published; } - - void reset(); -private: - Options* m_pOptions; - AstStack* m_pScopes; - AstModule* m_pRoot; - ErrorHandler* m_pErrorHandler; - OString m_fileName; - OString m_mainFileName; - OString m_realFileName; - OString m_documentation; - bool m_bIsDocValid; - bool m_bGenerateDoc; - bool m_bIsInMainfile; - bool m_published; - sal_uInt32 m_errorCount; - sal_uInt32 m_warningCount; - sal_uInt32 m_lineNumber; - sal_uInt32 m_offsetStart; - sal_uInt32 m_offsetEnd; - ParseState m_parseState; - StringSet m_includes; -}; - - -typedef ::std::pair< OString, OString > sPair_t; -sal_Int32 compileFile(const OString * pathname); - // a null pathname means stdin -sal_Int32 produceFile(const OString& filenameBase, - sPair_t const*const pDepFile); - // filenameBase is filename without ".idl" -void removeIfExists(const OString& pathname); - -bool copyFile(const OString* source, const OString& target); - // a null source means stdin - -bool isFileUrl(const OString& fileName); -OString convertToAbsoluteSystemPath(const OString& fileName); -OString convertToFileUrl(const OString& fileName); - -Idlc* SAL_CALL idlc(); -Idlc* SAL_CALL setIdlc(Options* pOptions); - -AstDeclaration const * resolveTypedefs(AstDeclaration const * type); - -AstDeclaration const * deconstructAndResolveTypedefs( - AstDeclaration const * type, sal_Int32 * rank); - -AstInterface const * resolveInterfaceTypedefs(AstType const * type); - -#endif // INCLUDED_IDLC_INC_IDLC_IDLC_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/idlc/idlctypes.hxx b/idlc/inc/idlc/idlctypes.hxx deleted file mode 100644 index bbea0ba45cf0..000000000000 --- a/idlc/inc/idlc/idlctypes.hxx +++ /dev/null @@ -1,209 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_IDLC_INC_IDLC_IDLCTYPES_HXX -#define INCLUDED_IDLC_INC_IDLC_IDLCTYPES_HXX - -#include - -#include -#include -#include -#include -#include - -#include -#include - -struct LessString -{ - bool operator()(const OString& str1, const OString& str2) const - { - return (str1 < str2); - } -}; - -typedef ::std::list< OString > StringList; -typedef ::std::vector< OString > StringVector; -typedef ::std::set< OString, LessString > StringSet; - -class AstDeclaration; - -typedef std::list< AstDeclaration* > DeclList; - -class AstScope; -AstDeclaration* SAL_CALL scopeAsDecl(AstScope* pScope); -AstScope* SAL_CALL declAsScope(AstDeclaration* pDecl); - -#ifdef _MSC_VER -#pragma warning( disable : 4541 ) -#endif - -// flags used for attributes, properties and services -#define AF_INVALID 0x0000 -#define AF_READONLY 0x0001 -#define AF_OPTIONAL 0x0002 -#define AF_MAYBEVOID 0x0004 -#define AF_BOUND 0x0008 -#define AF_CONSTRAINED 0x0010 -#define AF_TRANSIENT 0x0020 -#define AF_MAYBEAMBIGUOUS 0x0040 -#define AF_MAYBEDEFAULT 0x0080 -#define AF_REMOVABLE 0x0100 -#define AF_ATTRIBUTE 0x0200 -#define AF_PROPERTY 0x0400 - -enum ParseState -{ - PS_NoState, - PS_TypeDeclSeen, // Seen complete typedef declaration - PS_ConstantDeclSeen, // Seen complete const declaration - PS_ExceptionDeclSeen, // Seen complete exception declaration - PS_InterfaceDeclSeen, // Seen complete interface declaration - PS_ServiceDeclSeen, // Seen complete service declaration - PS_SingletonDeclSeen, // Seen complete singleton declaration - PS_ModuleDeclSeen, // Seen complete module declaration - PS_AttributeDeclSeen, // Seen complete attribute declaration - PS_PropertyDeclSeen, // Seen complete property declaration - PS_OperationDeclSeen, // Seen complete operation declaration - PS_InterfaceInheritanceDeclSeen, // Seen complete interface inheritance decl - PS_ConstantsDeclSeen, // Seen complete constants declaration - - PS_ServiceSeen, // Seen a SERVICE keyword - PS_ServiceIDSeen, // Seen the service ID - PS_ServiceSqSeen, // '{' seen for service - PS_ServiceQsSeen, // '}' seen for service - PS_ServiceBodySeen, // Seen complete service body - PS_ServiceMemberSeen, // Seen a service member - PS_ServiceIFHeadSeen, // Seen an interface member header - PS_ServiceSHeadSeen, // Seen an service member header - - PS_SingletonSeen, // Seen a SINGLETON keyword - PS_SingletonIDSeen, // Seen the singleton ID - PS_SingletonSqSeen, // '{' seen for singleton - PS_SingletonQsSeen, // '}' seen for singleton - PS_SingletonBodySeen, // Seen complete singleton body - PS_SingletonMemberSeen, // Seen a singleton member - - PS_ModuleSeen, // Seen a MODULE keyword - PS_ModuleIDSeen, // Seen the module ID - PS_ModuleSqSeen, // '{' seen for module - PS_ModuleQsSeen, // '}' seen for module - PS_ModuleBodySeen, // Seen complete module body - - PS_ConstantsSeen, // Seen a CONSTANTS keyword - PS_ConstantsIDSeen, // Seen the constants ID - PS_ConstantsSqSeen, // '{' seen for constants - PS_ConstantsQsSeen, // '}' seen for constants - PS_ConstantsBodySeen, // Seen complete constants body - - PS_InterfaceSeen, // Seen an INTERFACE keyword - PS_InterfaceIDSeen, // Seen the interface ID - PS_InterfaceHeadSeen, // Seen the interface head - PS_InheritSpecSeen, // Seen a complete inheritance spec - PS_ForwardDeclSeen, // Forward interface decl seen - PS_InterfaceSqSeen, // '{' seen for interface - PS_InterfaceQsSeen, // '}' seen for interface - PS_InterfaceBodySeen, // Seen an interface body - PS_InheritColonSeen, // Seen ':' in inheritance list - - PS_SNListCommaSeen, // Seen ',' in list of scoped names - PS_ScopedNameSeen, // Seen a complete scoped name - PS_SN_IDSeen, // Seen an identifier as part of a scoped name - PS_ScopeDelimSeen, // Seen a scope delim as party of a scoped name - - PS_ConstSeen, // Seen a CONST keyword - PS_ConstTypeSeen, // Parsed the type of a constant - PS_ConstIDSeen, // Seen the constant ID - PS_ConstAssignSeen, // Seen the '=' - PS_ConstExprSeen, // Seen the constant value expression - - PS_TypedefSeen, // Seen a TYPEDEF keyword - PS_TypeSpecSeen, // Seen a complete type specification - PS_DeclaratorsSeen, // Seen a complete list of declarators - - PS_StructSeen, // Seen a STRUCT keyword - PS_StructHeaderSeen, // Seen struct header - PS_StructIDSeen, // Seen the struct ID - PS_StructSqSeen, // '{' seen for struct - PS_StructQsSeen, // '}' seen for struct - PS_StructBodySeen, // Seen complete body of struct decl - - PS_MemberTypeSeen, // Seen type of struct or except member - PS_MemberDeclsSeen, // Seen decls of struct or except members - PS_MemberDeclsCompleted,// Completed one struct or except member to ';' - - PS_EnumSeen, // Seen an ENUM keyword - PS_EnumIDSeen, // Seen the enum ID - PS_EnumSqSeen, // Seen '{' for enum - PS_EnumQsSeen, // Seen '}' for enum - PS_EnumBodySeen, // Seen complete enum body - PS_EnumCommaSeen, // Seen ',' in list of enumerators - - PS_SequenceSeen, // Seen a SEQUENCE keyword - PS_SequenceSqSeen, // Seen '<' for sequence - PS_SequenceQsSeen, // Seen '>' for sequence - PS_SequenceTypeSeen, // Seen type decl for sequence - - PS_FlagHeaderSeen, // Seen the attribute|property|interface member head - PS_AttrSeen, // Seen ATTRIBUTE keyword - PS_AttrTypeSeen, // Seen type decl for attribute - PS_AttrCompleted, // Seen complete attribute declaration - PS_ReadOnlySeen, // Seen READONLY keyword - PS_OptionalSeen, // Seen OPTIONAL keyword - PS_MayBeVoidSeen, // Seen MAYBEVOID yword - PS_BoundSeen, // Seen BOUND keyword - PS_ConstrainedSeen, // Seen CONSTRAINED keyword - PS_TransientSeen, // Seen TRANSIENT keyword - PS_MayBeAmbigiousSeen, // Seen MAYBEAMBIGIOUS keyword - PS_MayBeDefaultSeen, // Seen MAYBEDEFAULT keyword - PS_RemoveableSeen, // Seen REMOVABLE keyword - - PS_PropertySeen, // Seen PROPERTY keyword - PS_PropertyTypeSeen, // Seen type decl for property - PS_PropertyCompleted, // Seen complete property declaration - - PS_ExceptSeen, // Seen EXCEPTION keyword - PS_ExceptHeaderSeen, // Seen exception header keyword - PS_ExceptIDSeen, // Seen exception identifier - PS_ExceptSqSeen, // Seen '{' for exception - PS_ExceptQsSeen, // Seen '}' for exception - PS_ExceptBodySeen, // Seen complete exception body - - PS_OpTypeSeen, // Seen operation return type - PS_OpIDSeen, // Seen operation ID - PS_OpParsCompleted, // Completed operation param list - PS_OpCompleted, // Completed operation statement - PS_OpSqSeen, // Seen '(' for operation - PS_OpQsSeen, // Seen ')' for operation - PS_OpParCommaSeen, // Seen ',' in list of op params - PS_OpParDirSeen, // Seen parameter direction - PS_OpParTypeSeen, // Seen parameter type - PS_OpParDeclSeen, // Seen parameter declaration - - PS_RaiseSeen, // Seen RAISES keyword - PS_RaiseSqSeen, // Seen '(' for RAISES - PS_RaiseQsSeen, // Seen ')' for RAISES - - PS_DeclsCommaSeen, // Seen ',' in declarators list - PS_DeclsDeclSeen // Seen complete decl in decls list -}; - -#endif // INCLUDED_IDLC_INC_IDLC_IDLCTYPES_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/idlc/inheritedinterface.hxx b/idlc/inc/idlc/inheritedinterface.hxx deleted file mode 100644 index afe0c99b9207..000000000000 --- a/idlc/inc/idlc/inheritedinterface.hxx +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_IDLC_INC_IDLC_INHERITEDINTERFACE_HXX -#define INCLUDED_IDLC_INC_IDLC_INHERITEDINTERFACE_HXX - -#include "idlc/idlc.hxx" - -#include - -class AstInterface; -class AstType; - -class InheritedInterface { -public: - InheritedInterface( - AstType const * theInterface, bool theOptional, - OUString const & theDocumentation): - interface(theInterface), optional(theOptional), - documentation(theDocumentation) {} - - AstType const * getInterface() const { return interface; } - - AstInterface const * getResolved() const - { return resolveInterfaceTypedefs(interface); } - - bool isOptional() const { return optional; } - - const OUString& getDocumentation() const { return documentation; } - -private: - AstType const * interface; - bool optional; - OUString documentation; -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/idlc/options.hxx b/idlc/inc/idlc/options.hxx deleted file mode 100644 index 2f4c02dcd404..000000000000 --- a/idlc/inc/idlc/options.hxx +++ /dev/null @@ -1,83 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_IDLC_INC_IDLC_OPTIONS_HXX -#define INCLUDED_IDLC_INC_IDLC_OPTIONS_HXX - -#include - -typedef std::unordered_map< OString, - OString, - OStringHash > OptionMap; - -class IllegalArgument -{ -public: - IllegalArgument(const OString& msg) - : m_message(msg) {} - - OString m_message; -}; - - -class Options -{ -public: - explicit Options(char const * progname); - ~Options(); - - static bool checkArgument(std::vector< std::string > & rArgs, char const * arg, size_t len); - static bool checkCommandFile(std::vector< std::string > & rArgs, char const * filename); - - bool initOptions(std::vector< std::string > & rArgs) - throw(IllegalArgument); - static bool badOption(char const * reason, std::string const & rArg) - throw(IllegalArgument); - bool setOption(char const * option, std::string const & rArg); - -#if 0 /* @@@ */ - sal_Bool initOptions(int ac, char* av[], sal_Bool bCmdFile=sal_False) - throw( IllegalArgument ); -#endif /* @@@ */ - - OString prepareHelp(); - OString prepareVersion(); - - const OString& getProgramName() const { return m_program;} - bool isValid(const OString& option); - const OString& getOption(const OString& option) - throw( IllegalArgument ); - - const StringVector& getInputFiles() const { return m_inputFiles; } - bool readStdin() const { return m_stdin; } - bool verbose() const { return m_verbose; } - bool quiet() const { return m_quiet; } - -protected: - OString m_program; - StringVector m_inputFiles; - bool m_stdin; - bool m_verbose; - bool m_quiet; - OptionMap m_options; -}; - -#endif // INCLUDED_IDLC_INC_IDLC_OPTIONS_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/idlctypes.hxx b/idlc/inc/idlctypes.hxx new file mode 100644 index 000000000000..36903ce8f7e6 --- /dev/null +++ b/idlc/inc/idlctypes.hxx @@ -0,0 +1,209 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_IDLC_INC_IDLCTYPES_HXX +#define INCLUDED_IDLC_INC_IDLCTYPES_HXX + +#include + +#include +#include +#include +#include +#include + +#include +#include + +struct LessString +{ + bool operator()(const OString& str1, const OString& str2) const + { + return (str1 < str2); + } +}; + +typedef ::std::list< OString > StringList; +typedef ::std::vector< OString > StringVector; +typedef ::std::set< OString, LessString > StringSet; + +class AstDeclaration; + +typedef std::list< AstDeclaration* > DeclList; + +class AstScope; +AstDeclaration* SAL_CALL scopeAsDecl(AstScope* pScope); +AstScope* SAL_CALL declAsScope(AstDeclaration* pDecl); + +#ifdef _MSC_VER +#pragma warning( disable : 4541 ) +#endif + +// flags used for attributes, properties and services +#define AF_INVALID 0x0000 +#define AF_READONLY 0x0001 +#define AF_OPTIONAL 0x0002 +#define AF_MAYBEVOID 0x0004 +#define AF_BOUND 0x0008 +#define AF_CONSTRAINED 0x0010 +#define AF_TRANSIENT 0x0020 +#define AF_MAYBEAMBIGUOUS 0x0040 +#define AF_MAYBEDEFAULT 0x0080 +#define AF_REMOVABLE 0x0100 +#define AF_ATTRIBUTE 0x0200 +#define AF_PROPERTY 0x0400 + +enum ParseState +{ + PS_NoState, + PS_TypeDeclSeen, // Seen complete typedef declaration + PS_ConstantDeclSeen, // Seen complete const declaration + PS_ExceptionDeclSeen, // Seen complete exception declaration + PS_InterfaceDeclSeen, // Seen complete interface declaration + PS_ServiceDeclSeen, // Seen complete service declaration + PS_SingletonDeclSeen, // Seen complete singleton declaration + PS_ModuleDeclSeen, // Seen complete module declaration + PS_AttributeDeclSeen, // Seen complete attribute declaration + PS_PropertyDeclSeen, // Seen complete property declaration + PS_OperationDeclSeen, // Seen complete operation declaration + PS_InterfaceInheritanceDeclSeen, // Seen complete interface inheritance decl + PS_ConstantsDeclSeen, // Seen complete constants declaration + + PS_ServiceSeen, // Seen a SERVICE keyword + PS_ServiceIDSeen, // Seen the service ID + PS_ServiceSqSeen, // '{' seen for service + PS_ServiceQsSeen, // '}' seen for service + PS_ServiceBodySeen, // Seen complete service body + PS_ServiceMemberSeen, // Seen a service member + PS_ServiceIFHeadSeen, // Seen an interface member header + PS_ServiceSHeadSeen, // Seen an service member header + + PS_SingletonSeen, // Seen a SINGLETON keyword + PS_SingletonIDSeen, // Seen the singleton ID + PS_SingletonSqSeen, // '{' seen for singleton + PS_SingletonQsSeen, // '}' seen for singleton + PS_SingletonBodySeen, // Seen complete singleton body + PS_SingletonMemberSeen, // Seen a singleton member + + PS_ModuleSeen, // Seen a MODULE keyword + PS_ModuleIDSeen, // Seen the module ID + PS_ModuleSqSeen, // '{' seen for module + PS_ModuleQsSeen, // '}' seen for module + PS_ModuleBodySeen, // Seen complete module body + + PS_ConstantsSeen, // Seen a CONSTANTS keyword + PS_ConstantsIDSeen, // Seen the constants ID + PS_ConstantsSqSeen, // '{' seen for constants + PS_ConstantsQsSeen, // '}' seen for constants + PS_ConstantsBodySeen, // Seen complete constants body + + PS_InterfaceSeen, // Seen an INTERFACE keyword + PS_InterfaceIDSeen, // Seen the interface ID + PS_InterfaceHeadSeen, // Seen the interface head + PS_InheritSpecSeen, // Seen a complete inheritance spec + PS_ForwardDeclSeen, // Forward interface decl seen + PS_InterfaceSqSeen, // '{' seen for interface + PS_InterfaceQsSeen, // '}' seen for interface + PS_InterfaceBodySeen, // Seen an interface body + PS_InheritColonSeen, // Seen ':' in inheritance list + + PS_SNListCommaSeen, // Seen ',' in list of scoped names + PS_ScopedNameSeen, // Seen a complete scoped name + PS_SN_IDSeen, // Seen an identifier as part of a scoped name + PS_ScopeDelimSeen, // Seen a scope delim as party of a scoped name + + PS_ConstSeen, // Seen a CONST keyword + PS_ConstTypeSeen, // Parsed the type of a constant + PS_ConstIDSeen, // Seen the constant ID + PS_ConstAssignSeen, // Seen the '=' + PS_ConstExprSeen, // Seen the constant value expression + + PS_TypedefSeen, // Seen a TYPEDEF keyword + PS_TypeSpecSeen, // Seen a complete type specification + PS_DeclaratorsSeen, // Seen a complete list of declarators + + PS_StructSeen, // Seen a STRUCT keyword + PS_StructHeaderSeen, // Seen struct header + PS_StructIDSeen, // Seen the struct ID + PS_StructSqSeen, // '{' seen for struct + PS_StructQsSeen, // '}' seen for struct + PS_StructBodySeen, // Seen complete body of struct decl + + PS_MemberTypeSeen, // Seen type of struct or except member + PS_MemberDeclsSeen, // Seen decls of struct or except members + PS_MemberDeclsCompleted,// Completed one struct or except member to ';' + + PS_EnumSeen, // Seen an ENUM keyword + PS_EnumIDSeen, // Seen the enum ID + PS_EnumSqSeen, // Seen '{' for enum + PS_EnumQsSeen, // Seen '}' for enum + PS_EnumBodySeen, // Seen complete enum body + PS_EnumCommaSeen, // Seen ',' in list of enumerators + + PS_SequenceSeen, // Seen a SEQUENCE keyword + PS_SequenceSqSeen, // Seen '<' for sequence + PS_SequenceQsSeen, // Seen '>' for sequence + PS_SequenceTypeSeen, // Seen type decl for sequence + + PS_FlagHeaderSeen, // Seen the attribute|property|interface member head + PS_AttrSeen, // Seen ATTRIBUTE keyword + PS_AttrTypeSeen, // Seen type decl for attribute + PS_AttrCompleted, // Seen complete attribute declaration + PS_ReadOnlySeen, // Seen READONLY keyword + PS_OptionalSeen, // Seen OPTIONAL keyword + PS_MayBeVoidSeen, // Seen MAYBEVOID yword + PS_BoundSeen, // Seen BOUND keyword + PS_ConstrainedSeen, // Seen CONSTRAINED keyword + PS_TransientSeen, // Seen TRANSIENT keyword + PS_MayBeAmbigiousSeen, // Seen MAYBEAMBIGIOUS keyword + PS_MayBeDefaultSeen, // Seen MAYBEDEFAULT keyword + PS_RemoveableSeen, // Seen REMOVABLE keyword + + PS_PropertySeen, // Seen PROPERTY keyword + PS_PropertyTypeSeen, // Seen type decl for property + PS_PropertyCompleted, // Seen complete property declaration + + PS_ExceptSeen, // Seen EXCEPTION keyword + PS_ExceptHeaderSeen, // Seen exception header keyword + PS_ExceptIDSeen, // Seen exception identifier + PS_ExceptSqSeen, // Seen '{' for exception + PS_ExceptQsSeen, // Seen '}' for exception + PS_ExceptBodySeen, // Seen complete exception body + + PS_OpTypeSeen, // Seen operation return type + PS_OpIDSeen, // Seen operation ID + PS_OpParsCompleted, // Completed operation param list + PS_OpCompleted, // Completed operation statement + PS_OpSqSeen, // Seen '(' for operation + PS_OpQsSeen, // Seen ')' for operation + PS_OpParCommaSeen, // Seen ',' in list of op params + PS_OpParDirSeen, // Seen parameter direction + PS_OpParTypeSeen, // Seen parameter type + PS_OpParDeclSeen, // Seen parameter declaration + + PS_RaiseSeen, // Seen RAISES keyword + PS_RaiseSqSeen, // Seen '(' for RAISES + PS_RaiseQsSeen, // Seen ')' for RAISES + + PS_DeclsCommaSeen, // Seen ',' in declarators list + PS_DeclsDeclSeen // Seen complete decl in decls list +}; + +#endif // INCLUDED_IDLC_INC_IDLCTYPES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/inheritedinterface.hxx b/idlc/inc/inheritedinterface.hxx new file mode 100644 index 000000000000..10e6ace39342 --- /dev/null +++ b/idlc/inc/inheritedinterface.hxx @@ -0,0 +1,55 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_IDLC_INC_INHERITEDINTERFACE_HXX +#define INCLUDED_IDLC_INC_INHERITEDINTERFACE_HXX + +#include "idlc.hxx" + +#include + +class AstInterface; +class AstType; + +class InheritedInterface { +public: + InheritedInterface( + AstType const * theInterface, bool theOptional, + OUString const & theDocumentation): + interface(theInterface), optional(theOptional), + documentation(theDocumentation) {} + + AstType const * getInterface() const { return interface; } + + AstInterface const * getResolved() const + { return resolveInterfaceTypedefs(interface); } + + bool isOptional() const { return optional; } + + const OUString& getDocumentation() const { return documentation; } + +private: + AstType const * interface; + bool optional; + OUString documentation; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/options.hxx b/idlc/inc/options.hxx new file mode 100644 index 000000000000..3fbfc4586d1f --- /dev/null +++ b/idlc/inc/options.hxx @@ -0,0 +1,83 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_IDLC_INC_OPTIONS_HXX +#define INCLUDED_IDLC_INC_OPTIONS_HXX + +#include + +typedef std::unordered_map< OString, + OString, + OStringHash > OptionMap; + +class IllegalArgument +{ +public: + IllegalArgument(const OString& msg) + : m_message(msg) {} + + OString m_message; +}; + + +class Options +{ +public: + explicit Options(char const * progname); + ~Options(); + + static bool checkArgument(std::vector< std::string > & rArgs, char const * arg, size_t len); + static bool checkCommandFile(std::vector< std::string > & rArgs, char const * filename); + + bool initOptions(std::vector< std::string > & rArgs) + throw(IllegalArgument); + static bool badOption(char const * reason, std::string const & rArg) + throw(IllegalArgument); + bool setOption(char const * option, std::string const & rArg); + +#if 0 /* @@@ */ + sal_Bool initOptions(int ac, char* av[], sal_Bool bCmdFile=sal_False) + throw( IllegalArgument ); +#endif /* @@@ */ + + OString prepareHelp(); + OString prepareVersion(); + + const OString& getProgramName() const { return m_program;} + bool isValid(const OString& option); + const OString& getOption(const OString& option) + throw( IllegalArgument ); + + const StringVector& getInputFiles() const { return m_inputFiles; } + bool readStdin() const { return m_stdin; } + bool verbose() const { return m_verbose; } + bool quiet() const { return m_quiet; } + +protected: + OString m_program; + StringVector m_inputFiles; + bool m_stdin; + bool m_verbose; + bool m_quiet; + OptionMap m_options; +}; + +#endif // INCLUDED_IDLC_INC_OPTIONS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/source/astconstant.cxx b/idlc/source/astconstant.cxx index ce38dcbfa461..54d235fa32ed 100644 --- a/idlc/source/astconstant.cxx +++ b/idlc/source/astconstant.cxx @@ -17,8 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include +#include +#include #include diff --git a/idlc/source/astdeclaration.cxx b/idlc/source/astdeclaration.cxx index fa889f96ab33..064cc324480c 100644 --- a/idlc/source/astdeclaration.cxx +++ b/idlc/source/astdeclaration.cxx @@ -17,8 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include +#include +#include #include #include diff --git a/idlc/source/astdump.cxx b/idlc/source/astdump.cxx index c8a87ec77bbc..9c84e54218ea 100644 --- a/idlc/source/astdump.cxx +++ b/idlc/source/astdump.cxx @@ -17,17 +17,17 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "idlc/astoperation.hxx" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "astoperation.hxx" #include diff --git a/idlc/source/astenum.cxx b/idlc/source/astenum.cxx index cb2a4572b3b1..f3a20fce50b8 100644 --- a/idlc/source/astenum.cxx +++ b/idlc/source/astenum.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include diff --git a/idlc/source/astexpression.cxx b/idlc/source/astexpression.cxx index 2ffd67fd3a27..4e583b35e43c 100644 --- a/idlc/source/astexpression.cxx +++ b/idlc/source/astexpression.cxx @@ -18,10 +18,10 @@ */ -#include -#include -#include -#include +#include +#include +#include +#include #include diff --git a/idlc/source/astinterface.cxx b/idlc/source/astinterface.cxx index e1336fb0a3f5..8add687cc0be 100644 --- a/idlc/source/astinterface.cxx +++ b/idlc/source/astinterface.cxx @@ -17,10 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include -#include -#include "idlc/idlc.hxx" +#include +#include +#include +#include "idlc.hxx" #include #include diff --git a/idlc/source/astoperation.cxx b/idlc/source/astoperation.cxx index 921a3e5365b1..78c4e452a915 100644 --- a/idlc/source/astoperation.cxx +++ b/idlc/source/astoperation.cxx @@ -17,11 +17,11 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include diff --git a/idlc/source/astscope.cxx b/idlc/source/astscope.cxx index 23b62fa45675..7c064bd9dc3b 100644 --- a/idlc/source/astscope.cxx +++ b/idlc/source/astscope.cxx @@ -17,10 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include -#include -#include +#include +#include +#include +#include #include diff --git a/idlc/source/astservice.cxx b/idlc/source/astservice.cxx index 794a527d9fea..83cb3fbd35c9 100644 --- a/idlc/source/astservice.cxx +++ b/idlc/source/astservice.cxx @@ -20,10 +20,10 @@ #include -#include "idlc/astmember.hxx" -#include "idlc/astoperation.hxx" -#include "idlc/astservice.hxx" -#include "idlc/asttype.hxx" +#include "astmember.hxx" +#include "astoperation.hxx" +#include "astservice.hxx" +#include "asttype.hxx" bool AstService::checkLastConstructor() const { AstOperation const * last = static_cast< AstOperation const * >(getLast()); diff --git a/idlc/source/aststack.cxx b/idlc/source/aststack.cxx index 83fed47377eb..1eaddbaabb42 100644 --- a/idlc/source/aststack.cxx +++ b/idlc/source/aststack.cxx @@ -18,8 +18,8 @@ */ #include -#include -#include +#include +#include #define STACKSIZE_INCREMENT 64 diff --git a/idlc/source/aststruct.cxx b/idlc/source/aststruct.cxx index 2fb9d6ffc869..5245f06c90f8 100644 --- a/idlc/source/aststruct.cxx +++ b/idlc/source/aststruct.cxx @@ -17,8 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include +#include +#include #include #include diff --git a/idlc/source/aststructinstance.cxx b/idlc/source/aststructinstance.cxx index 3c5bb6740c34..0c18d7273901 100644 --- a/idlc/source/aststructinstance.cxx +++ b/idlc/source/aststructinstance.cxx @@ -18,10 +18,10 @@ */ -#include "idlc/aststructinstance.hxx" +#include "aststructinstance.hxx" -#include "idlc/asttype.hxx" -#include "idlc/idlctypes.hxx" +#include "asttype.hxx" +#include "idlctypes.hxx" #include #include diff --git a/idlc/source/errorhandler.cxx b/idlc/source/errorhandler.cxx index 5ed259f46a37..ed8f0cbd0801 100644 --- a/idlc/source/errorhandler.cxx +++ b/idlc/source/errorhandler.cxx @@ -17,8 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include +#include +#include static const sal_Char* errorCodeToMessage(ErrorCode eCode) { diff --git a/idlc/source/fehelper.cxx b/idlc/source/fehelper.cxx index 704c9539c2a1..47cb63af32bd 100644 --- a/idlc/source/fehelper.cxx +++ b/idlc/source/fehelper.cxx @@ -17,9 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include -#include "idlc/idlc.hxx" +#include +#include +#include "idlc.hxx" FeDeclarator::FeDeclarator(const OString& name) : m_name(name) diff --git a/idlc/source/idlc.cxx b/idlc/source/idlc.cxx index 97fe49a2a1bc..74e4c35dd457 100644 --- a/idlc/source/idlc.cxx +++ b/idlc/source/idlc.cxx @@ -17,22 +17,22 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "idlc/astdeclaration.hxx" -#include "idlc/astparameter.hxx" -#include "idlc/astsequence.hxx" -#include "idlc/asttype.hxx" -#include "idlc/asttypedef.hxx" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "astdeclaration.hxx" +#include "astparameter.hxx" +#include "astsequence.hxx" +#include "asttype.hxx" +#include "asttypedef.hxx" #include #include diff --git a/idlc/source/idlccompile.cxx b/idlc/source/idlccompile.cxx index 26431583bf29..1cc5fac9005d 100644 --- a/idlc/source/idlccompile.cxx +++ b/idlc/source/idlccompile.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include #include diff --git a/idlc/source/idlcmain.cxx b/idlc/source/idlcmain.cxx index 616a3aa135bf..d610246dcc46 100644 --- a/idlc/source/idlcmain.cxx +++ b/idlc/source/idlcmain.cxx @@ -18,7 +18,7 @@ */ -#include "idlc/idlc.hxx" +#include "idlc.hxx" #include #include diff --git a/idlc/source/idlcproduce.cxx b/idlc/source/idlcproduce.cxx index fba3d6bbe0af..1588dd312154 100644 --- a/idlc/source/idlcproduce.cxx +++ b/idlc/source/idlcproduce.cxx @@ -17,8 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include +#include +#include #include #include #include diff --git a/idlc/source/options.cxx b/idlc/source/options.cxx index 23de54ad0728..9a3eee6daf47 100644 --- a/idlc/source/options.cxx +++ b/idlc/source/options.cxx @@ -18,7 +18,7 @@ */ -#include "idlc/options.hxx" +#include "options.hxx" #include #include diff --git a/idlc/source/parser.y b/idlc/source/parser.y index edd636cdd776..c0459163ed80 100644 --- a/idlc/source/parser.y +++ b/idlc/source/parser.y @@ -24,27 +24,27 @@ %{ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "idlc/aststructinstance.hxx" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "aststructinstance.hxx" #include "attributeexceptions.hxx" diff --git a/idlc/source/scanner.l b/idlc/source/scanner.l index 16ee27a93fe4..f1484bc0bab9 100644 --- a/idlc/source/scanner.l +++ b/idlc/source/scanner.l @@ -29,9 +29,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "attributeexceptions.hxx" diff --git a/pyuno/inc/pyuno.hxx b/pyuno/inc/pyuno.hxx new file mode 100644 index 000000000000..eac255469a6b --- /dev/null +++ b/pyuno/inc/pyuno.hxx @@ -0,0 +1,316 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_PYUNO_INC_PYUNO_HXX +#define INCLUDED_PYUNO_INC_PYUNO_HXX + +#ifndef Py_PYTHON_H +#if defined _MSC_VER +#pragma warning(push, 1) +#endif +#include +#if defined _MSC_VER +#pragma warning(pop) +#endif +#endif // #ifdef Py_PYTHON_H +#include +#include +#include + +/** + External interface of the Python UNO bridge. + + This is a C++ interface, because the core UNO components + invocation and proxyfactory are used to implement the bridge. + + This interface is somewhat private and my change in future. + + A scripting framework implementation may use this interface + to do the necessary conversions. +*/ + +#if defined LO_DLLIMPLEMENTATION_PYUNO +#define LO_DLLPUBLIC_PYUNO SAL_DLLPUBLIC_EXPORT +#else +#define LO_DLLPUBLIC_PYUNO SAL_DLLPUBLIC_IMPORT +#endif + +/** function called by the python runtime to initialize the + pyuno module. + + preconditions: python has been initialized before and + the global interpreter lock is held +*/ + +extern "C" LO_DLLPUBLIC_PYUNO +#if PY_MAJOR_VERSION >= 3 + PyObject* SAL_CALL PyInit_pyuno(); +#else + void SAL_CALL initpyuno(); +#endif + +namespace pyuno +{ + +enum NotNull +{ + /** definition of a no acquire enum for ctors + */ + NOT_NULL +}; + +/** Helper class for keeping references to python objects. + BEWARE: Look up every python function you use to check + whether you get an acquired or not acquired object pointer + (python terminus for a not acquired object pointer + is 'borrowed reference'). Use in the acquired pointer cases the + PyRef( pointer, SAL_NO_ACQUIRE) ctor. + + precondition: python has been initialized before and + the global interpreter lock is held + +*/ +class PyRef +{ + PyObject *m; +public: + PyRef () : m(nullptr) {} + PyRef( PyObject * p ) : m( p ) { Py_XINCREF( m ); } + + PyRef( PyObject * p, __sal_NoAcquire ) : m( p ) {} + + PyRef( PyObject * p, __sal_NoAcquire, NotNull ) : m( p ) + { + if (!m) + throw std::bad_alloc(); + } + + PyRef( const PyRef &r ) : m( r.get() ) { Py_XINCREF( m ); } + + ~PyRef() { Py_XDECREF( m ); } + + PyObject *get() const { return m; } + + PyObject * getAcquired() const + { + Py_XINCREF( m ); + return m; + } + + PyRef & operator = ( const PyRef & r ) + { + PyObject *tmp = m; + m = r.getAcquired(); + Py_XDECREF( tmp ); + return *this; + } + + bool operator == ( const PyRef & r ) const + { + return r.get() == m; + } + + /** clears the reference without decreasing the reference count + only seldom needed ! */ + void scratch() + { + m = nullptr; + } + + /** returns 1 when the reference points to a python object python object, + otherwise 0. + */ + bool is() const + { + return m != nullptr; + } + + struct Hash + { + sal_IntPtr operator () ( const PyRef &r) const { return sal_IntPtr( r.get() ); } + }; +}; + +struct stRuntimeImpl; +typedef struct stRuntimeImpl RuntimeImpl; + +enum ConversionMode { ACCEPT_UNO_ANY, REJECT_UNO_ANY }; + + +/** The pyuno::Runtime class keeps the internal state of the python UNO bridge + for the currently in use python interpreter. + + You may keep a Runtime instance, use it from a different thread, etc. But you must + make sure to fulfill all preconditions mentioned for the specific methods. +*/ + +class LO_DLLPUBLIC_PYUNO Runtime +{ + RuntimeImpl *impl; + + /** + Safely unpacks a Python iterator into a sequence, then + stores it in an Any. Used internally by pyObject2Any + */ + bool pyIterUnpack( PyObject *const, css::uno::Any & ) const; +public: + ~Runtime( ); + + /** + preconditions: python has been initialized before, + the global interpreter lock is held and pyuno + has been initialized for the currently used interpreter. + + Note: This method exists for efficiency reasons to save + lookup costs for any2PyObject and pyObject2Any + + @throw RuntimeException in case the runtime has not been + initialized before + */ + Runtime() throw( css::uno::RuntimeException ); + + Runtime( const Runtime & ); + Runtime & operator = ( const Runtime & ); + + /** Initializes the python-UNO bridge. May be called only once per python interpreter. + + @param ctx the component context is used to instantiate bridge services needed + for bridging such as invocation, typeconverter, invocationadapterfactory, etc. + + preconditions: python has been initialized before and + the global interpreter lock is held and pyuno is not + initialized (see isInitialized() ). + + @throw RuntimeException in case the thread is not attached or the runtime + has not been initialized. + */ + static void SAL_CALL initialize( + const css::uno::Reference< css::uno::XComponentContext > & ctx ) + throw ( css::uno::RuntimeException, std::exception ); + + /** Checks, whether the uno runtime is already initialized in the current python interpreter. + */ + static bool SAL_CALL isInitialized() throw (css::uno::RuntimeException); + + /** converts something contained in an UNO Any to a Python object + + preconditions: python has been initialized before, + the global interpreter lock is held and pyuno::Runtime + has been initialized. + */ + PyRef any2PyObject (const css::uno::Any &source ) const + throw ( css::script::CannotConvertException, + css::lang::IllegalArgumentException, + css::uno::RuntimeException ); + + /** converts a Python object to a UNO any + + preconditions: python has been initialized before, + the global interpreter lock is held and pyuno + has been initialized + */ + css::uno::Any pyObject2Any ( + const PyRef & source , enum ConversionMode mode = REJECT_UNO_ANY ) const + throw ( css::uno::RuntimeException); + + /** extracts a proper uno exception from a given python exception + */ + css::uno::Any extractUnoException( + const PyRef & excType, const PyRef & excValue, const PyRef & excTraceback) const; + + /** Returns the internal handle. Should only be used by the module implementation + */ + RuntimeImpl *getImpl() const { return impl; } +}; + + +/** helper class for attaching the current thread to the python runtime. + + Attaching is done creating a new threadstate for the given interpreter + and acquiring the global interpreter lock. + + Usage: + + ... don't use python here + { + PyThreadAttach guard( PyInterpreterState_Head() ); + { + ... do whatever python code you want + { + PyThreadDetach antiguard; + ... don't use python here + } + ... do whatever python code you want + } + } + ... don't use python here + + Note: The additional scope brackets after the PyThreadAttach are needed, + e.g. when you would leave them away, dtors of potential pyrefs + may be called after the thread has detached again. + */ +class LO_DLLPUBLIC_PYUNO PyThreadAttach +{ + PyThreadState *tstate; + PyThreadAttach ( const PyThreadAttach & ) = delete; + PyThreadAttach & operator = ( const PyThreadAttach & ) = delete; +public: + + /** Creates a new python threadstate and acquires the global interpreter lock. + precondition: The current thread MUST NOT hold the global interpreter lock. + postcondition: The global interpreter lock is acquired + + @raises css::uno::RuntimeException + in case no pythread state could be created + */ + PyThreadAttach( PyInterpreterState *interp) throw ( css::uno::RuntimeException ); + + + /** Releases the global interpreter lock and destroys the thread state. + */ + ~PyThreadAttach(); +}; + +/** helper class for detaching the current thread from the python runtime + to do some blocking, non-python related operation. + + @see PyThreadAttach +*/ +class LO_DLLPUBLIC_PYUNO PyThreadDetach +{ + PyThreadState *tstate; + PyThreadDetach ( const PyThreadDetach & ) = delete; + PyThreadDetach & operator = ( const PyThreadDetach & ) = delete; + +public: + /** Releases the global interpreter lock. + + precondition: The current thread MUST hold the global interpreter lock. + postcondition: The current thread does not hold the global interpreter lock anymore. + */ + PyThreadDetach() throw ( css::uno::RuntimeException ); + /** Acquires the global interpreter lock again + */ + ~PyThreadDetach(); +}; + +} +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/pyuno/inc/pyuno/pyuno.hxx b/pyuno/inc/pyuno/pyuno.hxx deleted file mode 100644 index 6e3a030b0790..000000000000 --- a/pyuno/inc/pyuno/pyuno.hxx +++ /dev/null @@ -1,316 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_PYUNO_INC_PYUNO_PYUNO_HXX -#define INCLUDED_PYUNO_INC_PYUNO_PYUNO_HXX - -#ifndef Py_PYTHON_H -#if defined _MSC_VER -#pragma warning(push, 1) -#endif -#include -#if defined _MSC_VER -#pragma warning(pop) -#endif -#endif // #ifdef Py_PYTHON_H -#include -#include -#include - -/** - External interface of the Python UNO bridge. - - This is a C++ interface, because the core UNO components - invocation and proxyfactory are used to implement the bridge. - - This interface is somewhat private and my change in future. - - A scripting framework implementation may use this interface - to do the necessary conversions. -*/ - -#if defined LO_DLLIMPLEMENTATION_PYUNO -#define LO_DLLPUBLIC_PYUNO SAL_DLLPUBLIC_EXPORT -#else -#define LO_DLLPUBLIC_PYUNO SAL_DLLPUBLIC_IMPORT -#endif - -/** function called by the python runtime to initialize the - pyuno module. - - preconditions: python has been initialized before and - the global interpreter lock is held -*/ - -extern "C" LO_DLLPUBLIC_PYUNO -#if PY_MAJOR_VERSION >= 3 - PyObject* SAL_CALL PyInit_pyuno(); -#else - void SAL_CALL initpyuno(); -#endif - -namespace pyuno -{ - -enum NotNull -{ - /** definition of a no acquire enum for ctors - */ - NOT_NULL -}; - -/** Helper class for keeping references to python objects. - BEWARE: Look up every python function you use to check - whether you get an acquired or not acquired object pointer - (python terminus for a not acquired object pointer - is 'borrowed reference'). Use in the acquired pointer cases the - PyRef( pointer, SAL_NO_ACQUIRE) ctor. - - precondition: python has been initialized before and - the global interpreter lock is held - -*/ -class PyRef -{ - PyObject *m; -public: - PyRef () : m(nullptr) {} - PyRef( PyObject * p ) : m( p ) { Py_XINCREF( m ); } - - PyRef( PyObject * p, __sal_NoAcquire ) : m( p ) {} - - PyRef( PyObject * p, __sal_NoAcquire, NotNull ) : m( p ) - { - if (!m) - throw std::bad_alloc(); - } - - PyRef( const PyRef &r ) : m( r.get() ) { Py_XINCREF( m ); } - - ~PyRef() { Py_XDECREF( m ); } - - PyObject *get() const { return m; } - - PyObject * getAcquired() const - { - Py_XINCREF( m ); - return m; - } - - PyRef & operator = ( const PyRef & r ) - { - PyObject *tmp = m; - m = r.getAcquired(); - Py_XDECREF( tmp ); - return *this; - } - - bool operator == ( const PyRef & r ) const - { - return r.get() == m; - } - - /** clears the reference without decreasing the reference count - only seldom needed ! */ - void scratch() - { - m = nullptr; - } - - /** returns 1 when the reference points to a python object python object, - otherwise 0. - */ - bool is() const - { - return m != nullptr; - } - - struct Hash - { - sal_IntPtr operator () ( const PyRef &r) const { return sal_IntPtr( r.get() ); } - }; -}; - -struct stRuntimeImpl; -typedef struct stRuntimeImpl RuntimeImpl; - -enum ConversionMode { ACCEPT_UNO_ANY, REJECT_UNO_ANY }; - - -/** The pyuno::Runtime class keeps the internal state of the python UNO bridge - for the currently in use python interpreter. - - You may keep a Runtime instance, use it from a different thread, etc. But you must - make sure to fulfill all preconditions mentioned for the specific methods. -*/ - -class LO_DLLPUBLIC_PYUNO Runtime -{ - RuntimeImpl *impl; - - /** - Safely unpacks a Python iterator into a sequence, then - stores it in an Any. Used internally by pyObject2Any - */ - bool pyIterUnpack( PyObject *const, css::uno::Any & ) const; -public: - ~Runtime( ); - - /** - preconditions: python has been initialized before, - the global interpreter lock is held and pyuno - has been initialized for the currently used interpreter. - - Note: This method exists for efficiency reasons to save - lookup costs for any2PyObject and pyObject2Any - - @throw RuntimeException in case the runtime has not been - initialized before - */ - Runtime() throw( css::uno::RuntimeException ); - - Runtime( const Runtime & ); - Runtime & operator = ( const Runtime & ); - - /** Initializes the python-UNO bridge. May be called only once per python interpreter. - - @param ctx the component context is used to instantiate bridge services needed - for bridging such as invocation, typeconverter, invocationadapterfactory, etc. - - preconditions: python has been initialized before and - the global interpreter lock is held and pyuno is not - initialized (see isInitialized() ). - - @throw RuntimeException in case the thread is not attached or the runtime - has not been initialized. - */ - static void SAL_CALL initialize( - const css::uno::Reference< css::uno::XComponentContext > & ctx ) - throw ( css::uno::RuntimeException, std::exception ); - - /** Checks, whether the uno runtime is already initialized in the current python interpreter. - */ - static bool SAL_CALL isInitialized() throw (css::uno::RuntimeException); - - /** converts something contained in an UNO Any to a Python object - - preconditions: python has been initialized before, - the global interpreter lock is held and pyuno::Runtime - has been initialized. - */ - PyRef any2PyObject (const css::uno::Any &source ) const - throw ( css::script::CannotConvertException, - css::lang::IllegalArgumentException, - css::uno::RuntimeException ); - - /** converts a Python object to a UNO any - - preconditions: python has been initialized before, - the global interpreter lock is held and pyuno - has been initialized - */ - css::uno::Any pyObject2Any ( - const PyRef & source , enum ConversionMode mode = REJECT_UNO_ANY ) const - throw ( css::uno::RuntimeException); - - /** extracts a proper uno exception from a given python exception - */ - css::uno::Any extractUnoException( - const PyRef & excType, const PyRef & excValue, const PyRef & excTraceback) const; - - /** Returns the internal handle. Should only be used by the module implementation - */ - RuntimeImpl *getImpl() const { return impl; } -}; - - -/** helper class for attaching the current thread to the python runtime. - - Attaching is done creating a new threadstate for the given interpreter - and acquiring the global interpreter lock. - - Usage: - - ... don't use python here - { - PyThreadAttach guard( PyInterpreterState_Head() ); - { - ... do whatever python code you want - { - PyThreadDetach antiguard; - ... don't use python here - } - ... do whatever python code you want - } - } - ... don't use python here - - Note: The additional scope brackets after the PyThreadAttach are needed, - e.g. when you would leave them away, dtors of potential pyrefs - may be called after the thread has detached again. - */ -class LO_DLLPUBLIC_PYUNO PyThreadAttach -{ - PyThreadState *tstate; - PyThreadAttach ( const PyThreadAttach & ) = delete; - PyThreadAttach & operator = ( const PyThreadAttach & ) = delete; -public: - - /** Creates a new python threadstate and acquires the global interpreter lock. - precondition: The current thread MUST NOT hold the global interpreter lock. - postcondition: The global interpreter lock is acquired - - @raises css::uno::RuntimeException - in case no pythread state could be created - */ - PyThreadAttach( PyInterpreterState *interp) throw ( css::uno::RuntimeException ); - - - /** Releases the global interpreter lock and destroys the thread state. - */ - ~PyThreadAttach(); -}; - -/** helper class for detaching the current thread from the python runtime - to do some blocking, non-python related operation. - - @see PyThreadAttach -*/ -class LO_DLLPUBLIC_PYUNO PyThreadDetach -{ - PyThreadState *tstate; - PyThreadDetach ( const PyThreadDetach & ) = delete; - PyThreadDetach & operator = ( const PyThreadDetach & ) = delete; - -public: - /** Releases the global interpreter lock. - - precondition: The current thread MUST hold the global interpreter lock. - postcondition: The current thread does not hold the global interpreter lock anymore. - */ - PyThreadDetach() throw ( css::uno::RuntimeException ); - /** Acquires the global interpreter lock again - */ - ~PyThreadDetach(); -}; - -} -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/pyuno/source/loader/pyuno_loader.cxx b/pyuno/source/loader/pyuno_loader.cxx index ce5bca5e5402..ef16cfb1872e 100644 --- a/pyuno/source/loader/pyuno_loader.cxx +++ b/pyuno/source/loader/pyuno_loader.cxx @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include diff --git a/pyuno/source/module/pyuno_impl.hxx b/pyuno/source/module/pyuno_impl.hxx index 0452da7cef6f..834333e61e7d 100644 --- a/pyuno/source/module/pyuno_impl.hxx +++ b/pyuno/source/module/pyuno_impl.hxx @@ -46,7 +46,7 @@ typedef long Py_hash_t; # define Py_TPFLAGS_HAVE_SEQUENCE_IN 0 #endif -#include +#include #include #include diff --git a/svgio/inc/pch/precompiled_svgio.hxx b/svgio/inc/pch/precompiled_svgio.hxx index 6f8ee9eb9f07..1fbc10a68688 100644 --- a/svgio/inc/pch/precompiled_svgio.hxx +++ b/svgio/inc/pch/precompiled_svgio.hxx @@ -56,11 +56,11 @@ #include #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svganode.hxx b/svgio/inc/svganode.hxx new file mode 100644 index 000000000000..ac07032f7adf --- /dev/null +++ b/svgio/inc/svganode.hxx @@ -0,0 +1,58 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVGIO_INC_SVGANODE_HXX +#define INCLUDED_SVGIO_INC_SVGANODE_HXX + +#include +#include + +namespace svgio +{ + namespace svgreader + { + class SvgANode : public SvgNode + { + private: + /// use styles + SvgStyleAttributes maSvgStyleAttributes; + + /// variable scan values, dependent of given XAttributeList + basegfx::B2DHomMatrix* mpaTransform; + + public: + SvgANode( + SvgDocument& rDocument, + SvgNode* pParent); + virtual ~SvgANode(); + + virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; + virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; + virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const override; + + /// transform content + const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; } + void setTransform(const basegfx::B2DHomMatrix* pMatrix = nullptr) { if(mpaTransform) delete mpaTransform; mpaTransform = nullptr; if(pMatrix) mpaTransform = new basegfx::B2DHomMatrix(*pMatrix); } + }; + } // end of namespace svgreader +} // end of namespace svgio + +#endif // INCLUDED_SVGIO_INC_SVGANODE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgcharacternode.hxx b/svgio/inc/svgcharacternode.hxx new file mode 100644 index 000000000000..1025617e5c27 --- /dev/null +++ b/svgio/inc/svgcharacternode.hxx @@ -0,0 +1,169 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVGIO_INC_SVGCHARACTERNODE_HXX +#define INCLUDED_SVGIO_INC_SVGCHARACTERNODE_HXX + +#include + +namespace drawinglayer { namespace primitive2d { class TextSimplePortionPrimitive2D; }} + +namespace svgio +{ + namespace svgreader + { + class SvgTextPositions + { + private: + SvgNumberVector maX; + SvgNumberVector maY; + SvgNumberVector maDx; + SvgNumberVector maDy; + SvgNumberVector maRotate; + SvgNumber maTextLength; + + /// bitfield + bool mbLengthAdjust : 1; // true = spacing, false = spacingAndGlyphs + + public: + SvgTextPositions(); + + void parseTextPositionAttributes(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent); + + /// X content + const SvgNumberVector& getX() const { return maX; } + void setX(const SvgNumberVector& aX) { maX = aX; } + + /// Y content + const SvgNumberVector& getY() const { return maY; } + void setY(const SvgNumberVector& aY) { maY = aY; } + + /// Dx content + const SvgNumberVector& getDx() const { return maDx; } + void setDx(const SvgNumberVector& aDx) { maDx = aDx; } + + /// Dy content + const SvgNumberVector& getDy() const { return maDy; } + void setDy(const SvgNumberVector& aDy) { maDy = aDy; } + + /// Rotate content + const SvgNumberVector& getRotate() const { return maRotate; } + void setRotate(const SvgNumberVector& aRotate) { maRotate = aRotate; } + + /// TextLength content + const SvgNumber& getTextLength() const { return maTextLength; } + void setTextLength(const SvgNumber& rTextLength = SvgNumber()) { maTextLength = rTextLength; } + + /// LengthAdjust content + bool getLengthAdjust() const { return mbLengthAdjust; } + void setLengthAdjust(bool bNew) { mbLengthAdjust = bNew; } + }; + } // end of namespace svgreader +} // end of namespace svgio + + +namespace svgio +{ + namespace svgreader + { + class SvgTextPosition + { + private: + SvgTextPosition* mpParent; + ::std::vector< double > maX; + ::std::vector< double > maY; + ::std::vector< double > maRotate; + double mfTextLength; + + // absolute, current, advancing position + basegfx::B2DPoint maPosition; + + // advancing rotation index + sal_uInt32 mnRotationIndex; + + /// bitfield + bool mbLengthAdjust : 1; // true = spacing, false = spacingAndGlyphs + bool mbAbsoluteX : 1; + + public: + SvgTextPosition( + SvgTextPosition* pParent, + const InfoProvider& rInfoProvider, + const SvgTextPositions& rSvgTextPositions); + + // data read access + const SvgTextPosition* getParent() const { return mpParent; } + const ::std::vector< double >& getX() const { return maX; } + double getTextLength() const { return mfTextLength; } + bool getLengthAdjust() const { return mbLengthAdjust; } + bool getAbsoluteX() const { return mbAbsoluteX; } + + // get/set absolute, current, advancing position + const basegfx::B2DPoint& getPosition() const { return maPosition; } + void setPosition(const basegfx::B2DPoint& rNew) { maPosition = rNew; } + + // rotation handling + bool isRotated() const; + double consumeRotation(); + }; + } // end of namespace svgreader +} // end of namespace svgio + + +namespace svgio +{ + namespace svgreader + { + class SvgCharacterNode : public SvgNode + { + private: + /// the string data + OUString maText; + + /// local helpers + drawinglayer::primitive2d::TextSimplePortionPrimitive2D* createSimpleTextPrimitive( + SvgTextPosition& rSvgTextPosition, + const SvgStyleAttributes& rSvgStyleAttributes) const; + void decomposeTextWithStyle( + drawinglayer::primitive2d::Primitive2DContainer& rTarget, + SvgTextPosition& rSvgTextPosition, + const SvgStyleAttributes& rSvgStyleAttributes) const; + + public: + SvgCharacterNode( + SvgDocument& rDocument, + SvgNode* pParent, + const OUString& rText); + virtual ~SvgCharacterNode(); + + virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; + void decomposeText(drawinglayer::primitive2d::Primitive2DContainer& rTarget, SvgTextPosition& rSvgTextPosition) const; + void whiteSpaceHandling(); + void addGap(); + void concatenate(const OUString& rText); + + /// Text content + const OUString& getText() const { return maText; } + }; + } // end of namespace svgreader +} // end of namespace svgio + +#endif // INCLUDED_SVGIO_INC_SVGCHARACTERNODE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgcirclenode.hxx b/svgio/inc/svgcirclenode.hxx new file mode 100644 index 000000000000..99f661dc53d4 --- /dev/null +++ b/svgio/inc/svgcirclenode.hxx @@ -0,0 +1,73 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVGIO_INC_SVGCIRCLENODE_HXX +#define INCLUDED_SVGIO_INC_SVGCIRCLENODE_HXX + +#include +#include + +namespace svgio +{ + namespace svgreader + { + class SvgCircleNode : public SvgNode + { + private: + /// use styles + SvgStyleAttributes maSvgStyleAttributes; + + /// variable scan values, dependent of given XAttributeList + SvgNumber maCx; + SvgNumber maCy; + SvgNumber maR; + basegfx::B2DHomMatrix* mpaTransform; + + public: + SvgCircleNode( + SvgDocument& rDocument, + SvgNode* pParent); + virtual ~SvgCircleNode(); + + virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; + virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; + virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const override; + + /// Cx content, set if found in current context + const SvgNumber& getCx() const { return maCx; } + void setCx(const SvgNumber& rCx = SvgNumber()) { maCx = rCx; } + + /// Cy content, set if found in current context + const SvgNumber& getCy() const { return maCy; } + void setCy(const SvgNumber& rCy = SvgNumber()) { maCy = rCy; } + + /// R content, set if found in current context + const SvgNumber& getR() const { return maR; } + void setR(const SvgNumber& rR = SvgNumber()) { maR = rR; } + + /// transform content, set if found in current context + const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; } + void setTransform(const basegfx::B2DHomMatrix* pMatrix = nullptr) { if(mpaTransform) delete mpaTransform; mpaTransform = nullptr; if(pMatrix) mpaTransform = new basegfx::B2DHomMatrix(*pMatrix); } + }; + } // end of namespace svgreader +} // end of namespace svgio + +#endif // INCLUDED_SVGIO_INC_SVGCIRCLENODE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgclippathnode.hxx b/svgio/inc/svgclippathnode.hxx new file mode 100644 index 000000000000..9bd7504f8183 --- /dev/null +++ b/svgio/inc/svgclippathnode.hxx @@ -0,0 +1,68 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVGIO_INC_SVGCLIPPATHNODE_HXX +#define INCLUDED_SVGIO_INC_SVGCLIPPATHNODE_HXX + +#include +#include + +namespace svgio +{ + namespace svgreader + { + class SvgClipPathNode : public SvgNode + { + private: + /// use styles + SvgStyleAttributes maSvgStyleAttributes; + + /// variable scan values, dependent of given XAttributeList + basegfx::B2DHomMatrix* mpaTransform; + SvgUnits maClipPathUnits; + + public: + SvgClipPathNode( + SvgDocument& rDocument, + SvgNode* pParent); + virtual ~SvgClipPathNode(); + + virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; + virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; + virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const override; + + /// apply contained clipPath to given geometry #i124852# transform may be needed + void apply( + drawinglayer::primitive2d::Primitive2DContainer& rTarget, + const basegfx::B2DHomMatrix* pTransform) const; + + /// clipPathUnits content + SvgUnits getClipPathUnits() const { return maClipPathUnits; } + void setClipPathUnits(const SvgUnits aClipPathUnits) { maClipPathUnits = aClipPathUnits; } + + /// transform content + const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; } + void setTransform(const basegfx::B2DHomMatrix* pMatrix = nullptr) { if(mpaTransform) delete mpaTransform; mpaTransform = nullptr; if(pMatrix) mpaTransform = new basegfx::B2DHomMatrix(*pMatrix); } + }; + } // end of namespace svgreader +} // end of namespace svgio + +#endif // INCLUDED_SVGIO_INC_SVGCLIPPATHNODE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgdocument.hxx b/svgio/inc/svgdocument.hxx new file mode 100644 index 000000000000..687fc494c2c3 --- /dev/null +++ b/svgio/inc/svgdocument.hxx @@ -0,0 +1,83 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVGIO_INC_SVGDOCUMENT_HXX +#define INCLUDED_SVGIO_INC_SVGDOCUMENT_HXX + +#include +#include + +namespace svgio +{ + namespace svgreader + { + class SvgDocument + { + private: + /// the document hierarchy with all root nodes + SvgNodeVector maNodes; + + /// the absolute path of the Svg file in progress (if available) + const OUString maAbsolutePath; + + /// hash mapper to find nodes by their id + typedef std::unordered_map< OUString, const SvgNode*, + OUStringHash > IdTokenMapper; + typedef std::pair< const OUString, const SvgNode* > IdTokenValueType; + IdTokenMapper maIdTokenMapperList; + + /// hash mapper to find css styles by their id + typedef std::unordered_map< OUString, const SvgStyleAttributes*, OUStringHash > IdStyleTokenMapper; + typedef std::pair< const OUString, const SvgStyleAttributes* > IdStyleTokenValueType; + IdStyleTokenMapper maIdStyleTokenMapperList; + + public: + explicit SvgDocument(const OUString& rAbsolutePath); + ~SvgDocument(); + + SvgDocument(const SvgDocument&) = delete; + SvgDocument& operator=(const SvgDocument&) = delete; + + /// append another root node, ownership changes + void appendNode(SvgNode* pNode); + + /// add/remove nodes with Id to mapper + void addSvgNodeToMapper(const OUString& rStr, const SvgNode& rNode); + void removeSvgNodeFromMapper(const OUString& rStr); + + /// find a node by its Id + const SvgNode* findSvgNodeById(const OUString& rStr) const; + + /// add/remove styles to mapper + void addSvgStyleAttributesToMapper(const OUString& rStr, const SvgStyleAttributes& rSvgStyleAttributes); + + /// find a style by its Id + bool hasGlobalCssStyleAttributes() const { return !maIdStyleTokenMapperList.empty(); } + const SvgStyleAttributes* findGlobalCssStyleAttributes(const OUString& rStr) const; + + /// data read access + const SvgNodeVector& getSvgNodeVector() const { return maNodes; } + const OUString& getAbsolutePath() const { return maAbsolutePath; } + }; + } // end of namespace svgreader +} // end of namespace svgio + +#endif // INCLUDED_SVGIO_INC_SVGDOCUMENT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgdocumenthandler.hxx b/svgio/inc/svgdocumenthandler.hxx new file mode 100644 index 000000000000..5069fdbd2eda --- /dev/null +++ b/svgio/inc/svgdocumenthandler.hxx @@ -0,0 +1,68 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVGIO_INC_SVGDOCUMENTHANDLER_HXX +#define INCLUDED_SVGIO_INC_SVGDOCUMENTHANDLER_HXX + +#include +#include +#include + +namespace svgio { namespace svgreader { class SvgCharacterNode; }} + +namespace svgio +{ + namespace svgreader + { + class SvgDocHdl : public cppu::WeakImplHelper< css::xml::sax::XDocumentHandler > + { + private: + // the complete SVG Document + SvgDocument maDocument; + + // current node for parsing + SvgNode* mpTarget; + + // text collector string stack for css styles + std::vector< OUString > maCssContents; + + bool bSkip; + + public: + SvgDocHdl(const OUString& rAbsolutePath); + virtual ~SvgDocHdl(); + + // Methods XDocumentHandler + virtual void SAL_CALL startDocument( ) throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL endDocument( ) throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL startElement( const OUString& aName, const css::uno::Reference< css::xml::sax::XAttributeList >& xAttribs ) throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL endElement( const OUString& aName ) throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL characters( const OUString& aChars ) throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL ignorableWhitespace( const OUString& aWhitespaces ) throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL processingInstruction( const OUString& aTarget, const OUString& aData ) throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL setDocumentLocator( const css::uno::Reference< css::xml::sax::XLocator >& xLocator ) throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) override; + + const SvgDocument& getSvgDocument() const { return maDocument; } + }; + } // end of namespace svgreader +} // end of namespace svgio + +#endif // INCLUDED_SVGIO_INC_SVGDOCUMENTHANDLER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgellipsenode.hxx b/svgio/inc/svgellipsenode.hxx new file mode 100644 index 000000000000..4e51cff871ec --- /dev/null +++ b/svgio/inc/svgellipsenode.hxx @@ -0,0 +1,78 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVGIO_INC_SVGELLIPSENODE_HXX +#define INCLUDED_SVGIO_INC_SVGELLIPSENODE_HXX + +#include +#include + +namespace svgio +{ + namespace svgreader + { + class SvgEllipseNode : public SvgNode + { + private: + /// use styles + SvgStyleAttributes maSvgStyleAttributes; + + /// variable scan values, dependent of given XAttributeList + SvgNumber maCx; + SvgNumber maCy; + SvgNumber maRx; + SvgNumber maRy; + basegfx::B2DHomMatrix* mpaTransform; + + public: + SvgEllipseNode( + SvgDocument& rDocument, + SvgNode* pParent); + virtual ~SvgEllipseNode(); + + virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; + virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; + virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const override; + + /// Cx content, set if found in current context + const SvgNumber& getCx() const { return maCx; } + void setCx(const SvgNumber& rCx = SvgNumber()) { maCx = rCx; } + + /// Cy content, set if found in current context + const SvgNumber& getCy() const { return maCy; } + void setCy(const SvgNumber& rCy = SvgNumber()) { maCy = rCy; } + + /// Rx content, set if found in current context + const SvgNumber& getRx() const { return maRx; } + void setRx(const SvgNumber& rRx = SvgNumber()) { maRx = rRx; } + + /// Ry content, set if found in current context + const SvgNumber& getRy() const { return maRy; } + void setRy(const SvgNumber& rRy = SvgNumber()) { maRy = rRy; } + + /// transform content, set if found in current context + const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; } + void setTransform(const basegfx::B2DHomMatrix* pMatrix = nullptr) { if(mpaTransform) delete mpaTransform; mpaTransform = nullptr; if(pMatrix) mpaTransform = new basegfx::B2DHomMatrix(*pMatrix); } + }; + } // end of namespace svgreader +} // end of namespace svgio + +#endif // INCLUDED_SVGIO_INC_SVGELLIPSENODE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svggnode.hxx b/svgio/inc/svggnode.hxx new file mode 100644 index 000000000000..9eb4e022d3d9 --- /dev/null +++ b/svgio/inc/svggnode.hxx @@ -0,0 +1,59 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVGIO_INC_SVGGNODE_HXX +#define INCLUDED_SVGIO_INC_SVGGNODE_HXX + +#include +#include + +namespace svgio +{ + namespace svgreader + { + class SvgGNode : public SvgNode + { + private: + /// use styles + SvgStyleAttributes maSvgStyleAttributes; + + /// variable scan values, dependent of given XAttributeList + basegfx::B2DHomMatrix* mpaTransform; + + public: + SvgGNode( + SVGToken aType, + SvgDocument& rDocument, + SvgNode* pParent); + virtual ~SvgGNode(); + + virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; + virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; + virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const override; + + /// transform content + const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; } + void setTransform(const basegfx::B2DHomMatrix* pMatrix = nullptr) { if(mpaTransform) delete mpaTransform; mpaTransform = nullptr; if(pMatrix) mpaTransform = new basegfx::B2DHomMatrix(*pMatrix); } + }; + } // end of namespace svgreader +} // end of namespace svgio + +#endif // INCLUDED_SVGIO_INC_SVGGNODE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svggradientnode.hxx b/svgio/inc/svggradientnode.hxx new file mode 100644 index 000000000000..5e2bea70317b --- /dev/null +++ b/svgio/inc/svggradientnode.hxx @@ -0,0 +1,130 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVGIO_INC_SVGGRADIENTNODE_HXX +#define INCLUDED_SVGIO_INC_SVGGRADIENTNODE_HXX + +#include +#include +#include + +namespace svgio +{ + namespace svgreader + { + class SvgGradientNode : public SvgNode + { + private: + /// use styles + SvgStyleAttributes maSvgStyleAttributes; + + /// linear gradient values + SvgNumber maX1; + SvgNumber maY1; + SvgNumber maX2; + SvgNumber maY2; + + /// radial gradient values + SvgNumber maCx; + SvgNumber maCy; + SvgNumber maR; + SvgNumber maFx; + SvgNumber maFy; + + /// variable scan values, dependent of given XAttributeList + SvgUnits maGradientUnits; + drawinglayer::primitive2d::SpreadMethod maSpreadMethod; + basegfx::B2DHomMatrix* mpaGradientTransform; + + /// link to another gradient used as style. If maXLink + /// is set, the node can be fetched on demand by using + // tryToFindLink (buffered) + OUString maXLink; + const SvgGradientNode* mpXLink; + + /// link on demand + void tryToFindLink(); + + public: + SvgGradientNode( + SVGToken aType, + SvgDocument& rDocument, + SvgNode* pParent); + virtual ~SvgGradientNode(); + + virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; + virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; + + /// collect gradient stop entries + void collectGradientEntries(drawinglayer::primitive2d::SvgGradientEntryVector& aVector) const; + + /// x1 content + const SvgNumber getX1() const; + void setX1(const SvgNumber& rX1 = SvgNumber()) { maX1 = rX1; } + + /// y1 content + const SvgNumber getY1() const; + void setY1(const SvgNumber& rY1 = SvgNumber()) { maY1 = rY1; } + + /// x2 content + const SvgNumber getX2() const; + void setX2(const SvgNumber& rX2 = SvgNumber()) { maX2 = rX2; } + + /// y2 content + const SvgNumber getY2() const; + void setY2(const SvgNumber& rY2 = SvgNumber()) { maY2 = rY2; } + + /// Cx content + const SvgNumber getCx() const; + void setCx(const SvgNumber& rCx = SvgNumber()) { maCx = rCx; } + + /// Cy content + const SvgNumber getCy() const; + void setCy(const SvgNumber& rCy = SvgNumber()) { maCy = rCy; } + + /// R content + const SvgNumber getR() const; + void setR(const SvgNumber& rR = SvgNumber()) { maR = rR; } + + /// Fx content + const SvgNumber* getFx() const; + void setFx(const SvgNumber& rFx = SvgNumber()) { maFx = rFx; } + + /// Fy content + const SvgNumber* getFy() const; + void setFy(const SvgNumber& rFy = SvgNumber()) { maFy = rFy; } + + /// gradientUnits content + SvgUnits getGradientUnits() const { return maGradientUnits; } + void setGradientUnits(const SvgUnits aGradientUnits) { maGradientUnits = aGradientUnits; } + + /// SpreadMethod content + drawinglayer::primitive2d::SpreadMethod getSpreadMethod() const { return maSpreadMethod; } + void setSpreadMethod(const drawinglayer::primitive2d::SpreadMethod aSpreadMethod) { maSpreadMethod = aSpreadMethod; } + + /// transform content, set if found in current context + const basegfx::B2DHomMatrix* getGradientTransform() const; + void setGradientTransform(const basegfx::B2DHomMatrix* pMatrix = nullptr); + }; + } // end of namespace svgreader +} // end of namespace svgio + +#endif // INCLUDED_SVGIO_INC_SVGGRADIENTNODE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svggradientstopnode.hxx b/svgio/inc/svggradientstopnode.hxx new file mode 100644 index 000000000000..d25898e96c06 --- /dev/null +++ b/svgio/inc/svggradientstopnode.hxx @@ -0,0 +1,57 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVGIO_INC_SVGGRADIENTSTOPNODE_HXX +#define INCLUDED_SVGIO_INC_SVGGRADIENTSTOPNODE_HXX + +#include +#include + +namespace svgio +{ + namespace svgreader + { + class SvgGradientStopNode : public SvgNode + { + private: + /// use styles + SvgStyleAttributes maSvgStyleAttributes; + + /// local attributes + SvgNumber maOffset; + + public: + SvgGradientStopNode( + SvgDocument& rDocument, + SvgNode* pParent); + virtual ~SvgGradientStopNode(); + + virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; + virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; + + /// offset content + const SvgNumber& getOffset() const { return maOffset; } + void setOffset(const SvgNumber& rOffset = SvgNumber()) { maOffset = rOffset; } + }; + } // end of namespace svgreader +} // end of namespace svgio + +#endif // INCLUDED_SVGIO_INC_SVGGRADIENTSTOPNODE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgimagenode.hxx b/svgio/inc/svgimagenode.hxx new file mode 100644 index 000000000000..f723d147ecf3 --- /dev/null +++ b/svgio/inc/svgimagenode.hxx @@ -0,0 +1,89 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVGIO_INC_SVGIMAGENODE_HXX +#define INCLUDED_SVGIO_INC_SVGIMAGENODE_HXX + +#include +#include + +namespace svgio +{ + namespace svgreader + { + class SvgImageNode : public SvgNode + { + private: + /// use styles + SvgStyleAttributes maSvgStyleAttributes; + + /// variable scan values, dependent of given XAttributeList + SvgAspectRatio maSvgAspectRatio; + basegfx::B2DHomMatrix* mpaTransform; + SvgNumber maX; + SvgNumber maY; + SvgNumber maWidth; + SvgNumber maHeight; + + OUString maXLink; // internal link + OUString maUrl; // external link + + OUString maMimeType; // mimetype and + OUString maData; // base64 data + + public: + SvgImageNode( + SvgDocument& rDocument, + SvgNode* pParent); + virtual ~SvgImageNode(); + + virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; + virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; + virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const override; + + /// SvgAspectRatio content + const SvgAspectRatio& getSvgAspectRatio() const { return maSvgAspectRatio; } + void setSvgAspectRatio(const SvgAspectRatio& rSvgAspectRatio = SvgAspectRatio()) { maSvgAspectRatio = rSvgAspectRatio; } + + /// transform content, set if found in current context + const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; } + void setTransform(const basegfx::B2DHomMatrix* pMatrix = nullptr) { if(mpaTransform) delete mpaTransform; mpaTransform = nullptr; if(pMatrix) mpaTransform = new basegfx::B2DHomMatrix(*pMatrix); } + + /// x content, set if found in current context + const SvgNumber& getX() const { return maX; } + void setX(const SvgNumber& rX = SvgNumber()) { maX = rX; } + + /// y content, set if found in current context + const SvgNumber& getY() const { return maY; } + void setY(const SvgNumber& rY = SvgNumber()) { maY = rY; } + + /// width content, set if found in current context + const SvgNumber& getWidth() const { return maWidth; } + void setWidth(const SvgNumber& rWidth = SvgNumber()) { maWidth = rWidth; } + + /// height content, set if found in current context + const SvgNumber& getHeight() const { return maHeight; } + void setHeight(const SvgNumber& rHeight = SvgNumber()) { maHeight = rHeight; } + }; + } // end of namespace svgreader +} // end of namespace svgio + +#endif // INCLUDED_SVGIO_INC_SVGIMAGENODE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgio/svgreader/svganode.hxx b/svgio/inc/svgio/svgreader/svganode.hxx deleted file mode 100644 index d58224a120da..000000000000 --- a/svgio/inc/svgio/svgreader/svganode.hxx +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGANODE_HXX -#define INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGANODE_HXX - -#include -#include - -namespace svgio -{ - namespace svgreader - { - class SvgANode : public SvgNode - { - private: - /// use styles - SvgStyleAttributes maSvgStyleAttributes; - - /// variable scan values, dependent of given XAttributeList - basegfx::B2DHomMatrix* mpaTransform; - - public: - SvgANode( - SvgDocument& rDocument, - SvgNode* pParent); - virtual ~SvgANode(); - - virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; - virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; - virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const override; - - /// transform content - const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; } - void setTransform(const basegfx::B2DHomMatrix* pMatrix = nullptr) { if(mpaTransform) delete mpaTransform; mpaTransform = nullptr; if(pMatrix) mpaTransform = new basegfx::B2DHomMatrix(*pMatrix); } - }; - } // end of namespace svgreader -} // end of namespace svgio - -#endif // INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGANODE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgio/svgreader/svgcharacternode.hxx b/svgio/inc/svgio/svgreader/svgcharacternode.hxx deleted file mode 100644 index c1cbd8192594..000000000000 --- a/svgio/inc/svgio/svgreader/svgcharacternode.hxx +++ /dev/null @@ -1,169 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGCHARACTERNODE_HXX -#define INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGCHARACTERNODE_HXX - -#include - -namespace drawinglayer { namespace primitive2d { class TextSimplePortionPrimitive2D; }} - -namespace svgio -{ - namespace svgreader - { - class SvgTextPositions - { - private: - SvgNumberVector maX; - SvgNumberVector maY; - SvgNumberVector maDx; - SvgNumberVector maDy; - SvgNumberVector maRotate; - SvgNumber maTextLength; - - /// bitfield - bool mbLengthAdjust : 1; // true = spacing, false = spacingAndGlyphs - - public: - SvgTextPositions(); - - void parseTextPositionAttributes(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent); - - /// X content - const SvgNumberVector& getX() const { return maX; } - void setX(const SvgNumberVector& aX) { maX = aX; } - - /// Y content - const SvgNumberVector& getY() const { return maY; } - void setY(const SvgNumberVector& aY) { maY = aY; } - - /// Dx content - const SvgNumberVector& getDx() const { return maDx; } - void setDx(const SvgNumberVector& aDx) { maDx = aDx; } - - /// Dy content - const SvgNumberVector& getDy() const { return maDy; } - void setDy(const SvgNumberVector& aDy) { maDy = aDy; } - - /// Rotate content - const SvgNumberVector& getRotate() const { return maRotate; } - void setRotate(const SvgNumberVector& aRotate) { maRotate = aRotate; } - - /// TextLength content - const SvgNumber& getTextLength() const { return maTextLength; } - void setTextLength(const SvgNumber& rTextLength = SvgNumber()) { maTextLength = rTextLength; } - - /// LengthAdjust content - bool getLengthAdjust() const { return mbLengthAdjust; } - void setLengthAdjust(bool bNew) { mbLengthAdjust = bNew; } - }; - } // end of namespace svgreader -} // end of namespace svgio - - -namespace svgio -{ - namespace svgreader - { - class SvgTextPosition - { - private: - SvgTextPosition* mpParent; - ::std::vector< double > maX; - ::std::vector< double > maY; - ::std::vector< double > maRotate; - double mfTextLength; - - // absolute, current, advancing position - basegfx::B2DPoint maPosition; - - // advancing rotation index - sal_uInt32 mnRotationIndex; - - /// bitfield - bool mbLengthAdjust : 1; // true = spacing, false = spacingAndGlyphs - bool mbAbsoluteX : 1; - - public: - SvgTextPosition( - SvgTextPosition* pParent, - const InfoProvider& rInfoProvider, - const SvgTextPositions& rSvgTextPositions); - - // data read access - const SvgTextPosition* getParent() const { return mpParent; } - const ::std::vector< double >& getX() const { return maX; } - double getTextLength() const { return mfTextLength; } - bool getLengthAdjust() const { return mbLengthAdjust; } - bool getAbsoluteX() const { return mbAbsoluteX; } - - // get/set absolute, current, advancing position - const basegfx::B2DPoint& getPosition() const { return maPosition; } - void setPosition(const basegfx::B2DPoint& rNew) { maPosition = rNew; } - - // rotation handling - bool isRotated() const; - double consumeRotation(); - }; - } // end of namespace svgreader -} // end of namespace svgio - - -namespace svgio -{ - namespace svgreader - { - class SvgCharacterNode : public SvgNode - { - private: - /// the string data - OUString maText; - - /// local helpers - drawinglayer::primitive2d::TextSimplePortionPrimitive2D* createSimpleTextPrimitive( - SvgTextPosition& rSvgTextPosition, - const SvgStyleAttributes& rSvgStyleAttributes) const; - void decomposeTextWithStyle( - drawinglayer::primitive2d::Primitive2DContainer& rTarget, - SvgTextPosition& rSvgTextPosition, - const SvgStyleAttributes& rSvgStyleAttributes) const; - - public: - SvgCharacterNode( - SvgDocument& rDocument, - SvgNode* pParent, - const OUString& rText); - virtual ~SvgCharacterNode(); - - virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; - void decomposeText(drawinglayer::primitive2d::Primitive2DContainer& rTarget, SvgTextPosition& rSvgTextPosition) const; - void whiteSpaceHandling(); - void addGap(); - void concatenate(const OUString& rText); - - /// Text content - const OUString& getText() const { return maText; } - }; - } // end of namespace svgreader -} // end of namespace svgio - -#endif // INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGCHARACTERNODE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgio/svgreader/svgcirclenode.hxx b/svgio/inc/svgio/svgreader/svgcirclenode.hxx deleted file mode 100644 index 9acbe907cf38..000000000000 --- a/svgio/inc/svgio/svgreader/svgcirclenode.hxx +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGCIRCLENODE_HXX -#define INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGCIRCLENODE_HXX - -#include -#include - -namespace svgio -{ - namespace svgreader - { - class SvgCircleNode : public SvgNode - { - private: - /// use styles - SvgStyleAttributes maSvgStyleAttributes; - - /// variable scan values, dependent of given XAttributeList - SvgNumber maCx; - SvgNumber maCy; - SvgNumber maR; - basegfx::B2DHomMatrix* mpaTransform; - - public: - SvgCircleNode( - SvgDocument& rDocument, - SvgNode* pParent); - virtual ~SvgCircleNode(); - - virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; - virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; - virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const override; - - /// Cx content, set if found in current context - const SvgNumber& getCx() const { return maCx; } - void setCx(const SvgNumber& rCx = SvgNumber()) { maCx = rCx; } - - /// Cy content, set if found in current context - const SvgNumber& getCy() const { return maCy; } - void setCy(const SvgNumber& rCy = SvgNumber()) { maCy = rCy; } - - /// R content, set if found in current context - const SvgNumber& getR() const { return maR; } - void setR(const SvgNumber& rR = SvgNumber()) { maR = rR; } - - /// transform content, set if found in current context - const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; } - void setTransform(const basegfx::B2DHomMatrix* pMatrix = nullptr) { if(mpaTransform) delete mpaTransform; mpaTransform = nullptr; if(pMatrix) mpaTransform = new basegfx::B2DHomMatrix(*pMatrix); } - }; - } // end of namespace svgreader -} // end of namespace svgio - -#endif // INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGCIRCLENODE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgio/svgreader/svgclippathnode.hxx b/svgio/inc/svgio/svgreader/svgclippathnode.hxx deleted file mode 100644 index 706d4bd84df2..000000000000 --- a/svgio/inc/svgio/svgreader/svgclippathnode.hxx +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGCLIPPATHNODE_HXX -#define INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGCLIPPATHNODE_HXX - -#include -#include - -namespace svgio -{ - namespace svgreader - { - class SvgClipPathNode : public SvgNode - { - private: - /// use styles - SvgStyleAttributes maSvgStyleAttributes; - - /// variable scan values, dependent of given XAttributeList - basegfx::B2DHomMatrix* mpaTransform; - SvgUnits maClipPathUnits; - - public: - SvgClipPathNode( - SvgDocument& rDocument, - SvgNode* pParent); - virtual ~SvgClipPathNode(); - - virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; - virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; - virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const override; - - /// apply contained clipPath to given geometry #i124852# transform may be needed - void apply( - drawinglayer::primitive2d::Primitive2DContainer& rTarget, - const basegfx::B2DHomMatrix* pTransform) const; - - /// clipPathUnits content - SvgUnits getClipPathUnits() const { return maClipPathUnits; } - void setClipPathUnits(const SvgUnits aClipPathUnits) { maClipPathUnits = aClipPathUnits; } - - /// transform content - const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; } - void setTransform(const basegfx::B2DHomMatrix* pMatrix = nullptr) { if(mpaTransform) delete mpaTransform; mpaTransform = nullptr; if(pMatrix) mpaTransform = new basegfx::B2DHomMatrix(*pMatrix); } - }; - } // end of namespace svgreader -} // end of namespace svgio - -#endif // INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGCLIPPATHNODE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgio/svgreader/svgdocument.hxx b/svgio/inc/svgio/svgreader/svgdocument.hxx deleted file mode 100644 index 5a4b63119d7b..000000000000 --- a/svgio/inc/svgio/svgreader/svgdocument.hxx +++ /dev/null @@ -1,83 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGDOCUMENT_HXX -#define INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGDOCUMENT_HXX - -#include -#include - -namespace svgio -{ - namespace svgreader - { - class SvgDocument - { - private: - /// the document hierarchy with all root nodes - SvgNodeVector maNodes; - - /// the absolute path of the Svg file in progress (if available) - const OUString maAbsolutePath; - - /// hash mapper to find nodes by their id - typedef std::unordered_map< OUString, const SvgNode*, - OUStringHash > IdTokenMapper; - typedef std::pair< const OUString, const SvgNode* > IdTokenValueType; - IdTokenMapper maIdTokenMapperList; - - /// hash mapper to find css styles by their id - typedef std::unordered_map< OUString, const SvgStyleAttributes*, OUStringHash > IdStyleTokenMapper; - typedef std::pair< const OUString, const SvgStyleAttributes* > IdStyleTokenValueType; - IdStyleTokenMapper maIdStyleTokenMapperList; - - public: - explicit SvgDocument(const OUString& rAbsolutePath); - ~SvgDocument(); - - SvgDocument(const SvgDocument&) = delete; - SvgDocument& operator=(const SvgDocument&) = delete; - - /// append another root node, ownership changes - void appendNode(SvgNode* pNode); - - /// add/remove nodes with Id to mapper - void addSvgNodeToMapper(const OUString& rStr, const SvgNode& rNode); - void removeSvgNodeFromMapper(const OUString& rStr); - - /// find a node by its Id - const SvgNode* findSvgNodeById(const OUString& rStr) const; - - /// add/remove styles to mapper - void addSvgStyleAttributesToMapper(const OUString& rStr, const SvgStyleAttributes& rSvgStyleAttributes); - - /// find a style by its Id - bool hasGlobalCssStyleAttributes() const { return !maIdStyleTokenMapperList.empty(); } - const SvgStyleAttributes* findGlobalCssStyleAttributes(const OUString& rStr) const; - - /// data read access - const SvgNodeVector& getSvgNodeVector() const { return maNodes; } - const OUString& getAbsolutePath() const { return maAbsolutePath; } - }; - } // end of namespace svgreader -} // end of namespace svgio - -#endif // INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGDOCUMENT_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgio/svgreader/svgdocumenthandler.hxx b/svgio/inc/svgio/svgreader/svgdocumenthandler.hxx deleted file mode 100644 index bc1d10a27821..000000000000 --- a/svgio/inc/svgio/svgreader/svgdocumenthandler.hxx +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGDOCUMENTHANDLER_HXX -#define INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGDOCUMENTHANDLER_HXX - -#include -#include -#include - -namespace svgio { namespace svgreader { class SvgCharacterNode; }} - -namespace svgio -{ - namespace svgreader - { - class SvgDocHdl : public cppu::WeakImplHelper< css::xml::sax::XDocumentHandler > - { - private: - // the complete SVG Document - SvgDocument maDocument; - - // current node for parsing - SvgNode* mpTarget; - - // text collector string stack for css styles - std::vector< OUString > maCssContents; - - bool bSkip; - - public: - SvgDocHdl(const OUString& rAbsolutePath); - virtual ~SvgDocHdl(); - - // Methods XDocumentHandler - virtual void SAL_CALL startDocument( ) throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL endDocument( ) throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL startElement( const OUString& aName, const css::uno::Reference< css::xml::sax::XAttributeList >& xAttribs ) throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL endElement( const OUString& aName ) throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL characters( const OUString& aChars ) throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL ignorableWhitespace( const OUString& aWhitespaces ) throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL processingInstruction( const OUString& aTarget, const OUString& aData ) throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL setDocumentLocator( const css::uno::Reference< css::xml::sax::XLocator >& xLocator ) throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) override; - - const SvgDocument& getSvgDocument() const { return maDocument; } - }; - } // end of namespace svgreader -} // end of namespace svgio - -#endif // INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGDOCUMENTHANDLER_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgio/svgreader/svgellipsenode.hxx b/svgio/inc/svgio/svgreader/svgellipsenode.hxx deleted file mode 100644 index 040235c75af8..000000000000 --- a/svgio/inc/svgio/svgreader/svgellipsenode.hxx +++ /dev/null @@ -1,78 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGELLIPSENODE_HXX -#define INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGELLIPSENODE_HXX - -#include -#include - -namespace svgio -{ - namespace svgreader - { - class SvgEllipseNode : public SvgNode - { - private: - /// use styles - SvgStyleAttributes maSvgStyleAttributes; - - /// variable scan values, dependent of given XAttributeList - SvgNumber maCx; - SvgNumber maCy; - SvgNumber maRx; - SvgNumber maRy; - basegfx::B2DHomMatrix* mpaTransform; - - public: - SvgEllipseNode( - SvgDocument& rDocument, - SvgNode* pParent); - virtual ~SvgEllipseNode(); - - virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; - virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; - virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const override; - - /// Cx content, set if found in current context - const SvgNumber& getCx() const { return maCx; } - void setCx(const SvgNumber& rCx = SvgNumber()) { maCx = rCx; } - - /// Cy content, set if found in current context - const SvgNumber& getCy() const { return maCy; } - void setCy(const SvgNumber& rCy = SvgNumber()) { maCy = rCy; } - - /// Rx content, set if found in current context - const SvgNumber& getRx() const { return maRx; } - void setRx(const SvgNumber& rRx = SvgNumber()) { maRx = rRx; } - - /// Ry content, set if found in current context - const SvgNumber& getRy() const { return maRy; } - void setRy(const SvgNumber& rRy = SvgNumber()) { maRy = rRy; } - - /// transform content, set if found in current context - const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; } - void setTransform(const basegfx::B2DHomMatrix* pMatrix = nullptr) { if(mpaTransform) delete mpaTransform; mpaTransform = nullptr; if(pMatrix) mpaTransform = new basegfx::B2DHomMatrix(*pMatrix); } - }; - } // end of namespace svgreader -} // end of namespace svgio - -#endif // INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGELLIPSENODE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgio/svgreader/svggnode.hxx b/svgio/inc/svgio/svgreader/svggnode.hxx deleted file mode 100644 index 8d9ad9dec53f..000000000000 --- a/svgio/inc/svgio/svgreader/svggnode.hxx +++ /dev/null @@ -1,59 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGGNODE_HXX -#define INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGGNODE_HXX - -#include -#include - -namespace svgio -{ - namespace svgreader - { - class SvgGNode : public SvgNode - { - private: - /// use styles - SvgStyleAttributes maSvgStyleAttributes; - - /// variable scan values, dependent of given XAttributeList - basegfx::B2DHomMatrix* mpaTransform; - - public: - SvgGNode( - SVGToken aType, - SvgDocument& rDocument, - SvgNode* pParent); - virtual ~SvgGNode(); - - virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; - virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; - virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const override; - - /// transform content - const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; } - void setTransform(const basegfx::B2DHomMatrix* pMatrix = nullptr) { if(mpaTransform) delete mpaTransform; mpaTransform = nullptr; if(pMatrix) mpaTransform = new basegfx::B2DHomMatrix(*pMatrix); } - }; - } // end of namespace svgreader -} // end of namespace svgio - -#endif // INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGGNODE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgio/svgreader/svggradientnode.hxx b/svgio/inc/svgio/svgreader/svggradientnode.hxx deleted file mode 100644 index 43a9752c418b..000000000000 --- a/svgio/inc/svgio/svgreader/svggradientnode.hxx +++ /dev/null @@ -1,130 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGGRADIENTNODE_HXX -#define INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGGRADIENTNODE_HXX - -#include -#include -#include - -namespace svgio -{ - namespace svgreader - { - class SvgGradientNode : public SvgNode - { - private: - /// use styles - SvgStyleAttributes maSvgStyleAttributes; - - /// linear gradient values - SvgNumber maX1; - SvgNumber maY1; - SvgNumber maX2; - SvgNumber maY2; - - /// radial gradient values - SvgNumber maCx; - SvgNumber maCy; - SvgNumber maR; - SvgNumber maFx; - SvgNumber maFy; - - /// variable scan values, dependent of given XAttributeList - SvgUnits maGradientUnits; - drawinglayer::primitive2d::SpreadMethod maSpreadMethod; - basegfx::B2DHomMatrix* mpaGradientTransform; - - /// link to another gradient used as style. If maXLink - /// is set, the node can be fetched on demand by using - // tryToFindLink (buffered) - OUString maXLink; - const SvgGradientNode* mpXLink; - - /// link on demand - void tryToFindLink(); - - public: - SvgGradientNode( - SVGToken aType, - SvgDocument& rDocument, - SvgNode* pParent); - virtual ~SvgGradientNode(); - - virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; - virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; - - /// collect gradient stop entries - void collectGradientEntries(drawinglayer::primitive2d::SvgGradientEntryVector& aVector) const; - - /// x1 content - const SvgNumber getX1() const; - void setX1(const SvgNumber& rX1 = SvgNumber()) { maX1 = rX1; } - - /// y1 content - const SvgNumber getY1() const; - void setY1(const SvgNumber& rY1 = SvgNumber()) { maY1 = rY1; } - - /// x2 content - const SvgNumber getX2() const; - void setX2(const SvgNumber& rX2 = SvgNumber()) { maX2 = rX2; } - - /// y2 content - const SvgNumber getY2() const; - void setY2(const SvgNumber& rY2 = SvgNumber()) { maY2 = rY2; } - - /// Cx content - const SvgNumber getCx() const; - void setCx(const SvgNumber& rCx = SvgNumber()) { maCx = rCx; } - - /// Cy content - const SvgNumber getCy() const; - void setCy(const SvgNumber& rCy = SvgNumber()) { maCy = rCy; } - - /// R content - const SvgNumber getR() const; - void setR(const SvgNumber& rR = SvgNumber()) { maR = rR; } - - /// Fx content - const SvgNumber* getFx() const; - void setFx(const SvgNumber& rFx = SvgNumber()) { maFx = rFx; } - - /// Fy content - const SvgNumber* getFy() const; - void setFy(const SvgNumber& rFy = SvgNumber()) { maFy = rFy; } - - /// gradientUnits content - SvgUnits getGradientUnits() const { return maGradientUnits; } - void setGradientUnits(const SvgUnits aGradientUnits) { maGradientUnits = aGradientUnits; } - - /// SpreadMethod content - drawinglayer::primitive2d::SpreadMethod getSpreadMethod() const { return maSpreadMethod; } - void setSpreadMethod(const drawinglayer::primitive2d::SpreadMethod aSpreadMethod) { maSpreadMethod = aSpreadMethod; } - - /// transform content, set if found in current context - const basegfx::B2DHomMatrix* getGradientTransform() const; - void setGradientTransform(const basegfx::B2DHomMatrix* pMatrix = nullptr); - }; - } // end of namespace svgreader -} // end of namespace svgio - -#endif // INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGGRADIENTNODE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgio/svgreader/svggradientstopnode.hxx b/svgio/inc/svgio/svgreader/svggradientstopnode.hxx deleted file mode 100644 index 055b47b0e5cd..000000000000 --- a/svgio/inc/svgio/svgreader/svggradientstopnode.hxx +++ /dev/null @@ -1,57 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGGRADIENTSTOPNODE_HXX -#define INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGGRADIENTSTOPNODE_HXX - -#include -#include - -namespace svgio -{ - namespace svgreader - { - class SvgGradientStopNode : public SvgNode - { - private: - /// use styles - SvgStyleAttributes maSvgStyleAttributes; - - /// local attributes - SvgNumber maOffset; - - public: - SvgGradientStopNode( - SvgDocument& rDocument, - SvgNode* pParent); - virtual ~SvgGradientStopNode(); - - virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; - virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; - - /// offset content - const SvgNumber& getOffset() const { return maOffset; } - void setOffset(const SvgNumber& rOffset = SvgNumber()) { maOffset = rOffset; } - }; - } // end of namespace svgreader -} // end of namespace svgio - -#endif // INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGGRADIENTSTOPNODE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgio/svgreader/svgimagenode.hxx b/svgio/inc/svgio/svgreader/svgimagenode.hxx deleted file mode 100644 index c21a9f5eaf3e..000000000000 --- a/svgio/inc/svgio/svgreader/svgimagenode.hxx +++ /dev/null @@ -1,89 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGIMAGENODE_HXX -#define INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGIMAGENODE_HXX - -#include -#include - -namespace svgio -{ - namespace svgreader - { - class SvgImageNode : public SvgNode - { - private: - /// use styles - SvgStyleAttributes maSvgStyleAttributes; - - /// variable scan values, dependent of given XAttributeList - SvgAspectRatio maSvgAspectRatio; - basegfx::B2DHomMatrix* mpaTransform; - SvgNumber maX; - SvgNumber maY; - SvgNumber maWidth; - SvgNumber maHeight; - - OUString maXLink; // internal link - OUString maUrl; // external link - - OUString maMimeType; // mimetype and - OUString maData; // base64 data - - public: - SvgImageNode( - SvgDocument& rDocument, - SvgNode* pParent); - virtual ~SvgImageNode(); - - virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; - virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; - virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const override; - - /// SvgAspectRatio content - const SvgAspectRatio& getSvgAspectRatio() const { return maSvgAspectRatio; } - void setSvgAspectRatio(const SvgAspectRatio& rSvgAspectRatio = SvgAspectRatio()) { maSvgAspectRatio = rSvgAspectRatio; } - - /// transform content, set if found in current context - const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; } - void setTransform(const basegfx::B2DHomMatrix* pMatrix = nullptr) { if(mpaTransform) delete mpaTransform; mpaTransform = nullptr; if(pMatrix) mpaTransform = new basegfx::B2DHomMatrix(*pMatrix); } - - /// x content, set if found in current context - const SvgNumber& getX() const { return maX; } - void setX(const SvgNumber& rX = SvgNumber()) { maX = rX; } - - /// y content, set if found in current context - const SvgNumber& getY() const { return maY; } - void setY(const SvgNumber& rY = SvgNumber()) { maY = rY; } - - /// width content, set if found in current context - const SvgNumber& getWidth() const { return maWidth; } - void setWidth(const SvgNumber& rWidth = SvgNumber()) { maWidth = rWidth; } - - /// height content, set if found in current context - const SvgNumber& getHeight() const { return maHeight; } - void setHeight(const SvgNumber& rHeight = SvgNumber()) { maHeight = rHeight; } - }; - } // end of namespace svgreader -} // end of namespace svgio - -#endif // INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGIMAGENODE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgio/svgreader/svglinenode.hxx b/svgio/inc/svgio/svgreader/svglinenode.hxx deleted file mode 100644 index 23e20bd3088e..000000000000 --- a/svgio/inc/svgio/svgreader/svglinenode.hxx +++ /dev/null @@ -1,78 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGLINENODE_HXX -#define INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGLINENODE_HXX - -#include -#include - -namespace svgio -{ - namespace svgreader - { - class SvgLineNode : public SvgNode - { - private: - /// use styles - SvgStyleAttributes maSvgStyleAttributes; - - /// variable scan values, dependent of given XAttributeList - SvgNumber maX1; - SvgNumber maY1; - SvgNumber maX2; - SvgNumber maY2; - basegfx::B2DHomMatrix* mpaTransform; - - public: - SvgLineNode( - SvgDocument& rDocument, - SvgNode* pParent); - virtual ~SvgLineNode(); - - virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; - virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; - virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const override; - - /// X1 content, set if found in current context - const SvgNumber& getX1() const { return maX1; } - void setX1(const SvgNumber& rX1 = SvgNumber()) { maX1 = rX1; } - - /// Y1 content, set if found in current context - const SvgNumber& getY1() const { return maY1; } - void setY1(const SvgNumber& rY1 = SvgNumber()) { maY1 = rY1; } - - /// X2 content, set if found in current context - const SvgNumber& getX2() const { return maX2; } - void setX2(const SvgNumber& rX2 = SvgNumber()) { maX2 = rX2; } - - /// Y2 content, set if found in current context - const SvgNumber& getY2() const { return maY2; } - void setY2(const SvgNumber& rY2 = SvgNumber()) { maY2 = rY2; } - - /// transform content, set if found in current context - const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; } - void setTransform(const basegfx::B2DHomMatrix* pMatrix = nullptr) { if(mpaTransform) delete mpaTransform; mpaTransform = nullptr; if(pMatrix) mpaTransform = new basegfx::B2DHomMatrix(*pMatrix); } - }; - } // end of namespace svgreader -} // end of namespace svgio - -#endif // INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGLINENODE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgio/svgreader/svgmarkernode.hxx b/svgio/inc/svgio/svgreader/svgmarkernode.hxx deleted file mode 100644 index f0cca96096ce..000000000000 --- a/svgio/inc/svgio/svgreader/svgmarkernode.hxx +++ /dev/null @@ -1,116 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGMARKERNODE_HXX -#define INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGMARKERNODE_HXX - -#include -#include - -namespace svgio -{ - namespace svgreader - { - class SvgMarkerNode : public SvgNode - { - public: - enum MarkerUnits - { - strokeWidth, - userSpaceOnUse - }; - - private: - /// buffered decomposition - drawinglayer::primitive2d::Primitive2DContainer aPrimitives; - - /// use styles - SvgStyleAttributes maSvgStyleAttributes; - - /// variable scan values, dependent of given XAttributeList - basegfx::B2DRange* mpViewBox; - SvgAspectRatio maSvgAspectRatio; - SvgNumber maRefX; - SvgNumber maRefY; - MarkerUnits maMarkerUnits; - SvgNumber maMarkerWidth; - SvgNumber maMarkerHeight; - double mfAngle; - - /// bitfield - bool mbOrientAuto : 1; // true == on, false == fAngle valid - - public: - SvgMarkerNode( - SvgDocument& rDocument, - SvgNode* pParent); - virtual ~SvgMarkerNode(); - - virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; - virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; - - /// get marker primitives buffered, uses decomposeSvgNode internally - const drawinglayer::primitive2d::Primitive2DContainer& getMarkerPrimitives() const; - - /// InfoProvider support for % values - virtual const basegfx::B2DRange getCurrentViewPort() const override; - - /// viewBox content - const basegfx::B2DRange* getViewBox() const { return mpViewBox; } - void setViewBox(const basegfx::B2DRange* pViewBox = nullptr) { if(mpViewBox) delete mpViewBox; mpViewBox = nullptr; if(pViewBox) mpViewBox = new basegfx::B2DRange(*pViewBox); } - - /// SvgAspectRatio content - const SvgAspectRatio& getSvgAspectRatio() const { return maSvgAspectRatio; } - void setSvgAspectRatio(const SvgAspectRatio& rSvgAspectRatio = SvgAspectRatio()) { maSvgAspectRatio = rSvgAspectRatio; } - - /// RefX content, set if found in current context - const SvgNumber& getRefX() const { return maRefX; } - void setRefX(const SvgNumber& rRefX = SvgNumber()) { maRefX = rRefX; } - - /// RefY content, set if found in current context - const SvgNumber& getRefY() const { return maRefY; } - void setRefY(const SvgNumber& rRefY = SvgNumber()) { maRefY = rRefY; } - - /// MarkerUnits content - MarkerUnits getMarkerUnits() const { return maMarkerUnits; } - void setMarkerUnits(const MarkerUnits aMarkerUnits) { maMarkerUnits = aMarkerUnits; } - - /// MarkerWidth content, set if found in current context - const SvgNumber& getMarkerWidth() const { return maMarkerWidth; } - void setMarkerWidth(const SvgNumber& rMarkerWidth = SvgNumber()) { maMarkerWidth = rMarkerWidth; } - - /// MarkerHeight content, set if found in current context - const SvgNumber& getMarkerHeight() const { return maMarkerHeight; } - void setMarkerHeight(const SvgNumber& rMarkerHeight = SvgNumber()) { maMarkerHeight = rMarkerHeight; } - - /// Angle content, set if found in current context - double getAngle() const { return mfAngle; } - void setAngle(double fAngle = 0.0) { mfAngle = fAngle; mbOrientAuto = false; } - - /// OrientAuto content, set if found in current context - bool getOrientAuto() const { return mbOrientAuto; } - void setOrientAuto() { mbOrientAuto = true; } - - }; - } // end of namespace svgreader -} // end of namespace svgio - -#endif // INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGMARKERNODE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgio/svgreader/svgmasknode.hxx b/svgio/inc/svgio/svgreader/svgmasknode.hxx deleted file mode 100644 index 84c4bb1de38a..000000000000 --- a/svgio/inc/svgio/svgreader/svgmasknode.hxx +++ /dev/null @@ -1,93 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGMASKNODE_HXX -#define INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGMASKNODE_HXX - -#include -#include - -namespace svgio -{ - namespace svgreader - { - class SvgMaskNode : public SvgNode - { - private: - /// use styles - SvgStyleAttributes maSvgStyleAttributes; - - /// variable scan values, dependent of given XAttributeList - SvgNumber maX; - SvgNumber maY; - SvgNumber maWidth; - SvgNumber maHeight; - basegfx::B2DHomMatrix* mpaTransform; - SvgUnits maMaskUnits; - SvgUnits maMaskContentUnits; - - public: - SvgMaskNode( - SvgDocument& rDocument, - SvgNode* pParent); - virtual ~SvgMaskNode(); - - virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; - virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; - virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const override; - - /// apply contained clipPath to given geometry #i124852# transform may be needed - void apply( - drawinglayer::primitive2d::Primitive2DContainer& rTarget, - const basegfx::B2DHomMatrix* pTransform) const; - - /// x content, set if found in current context - const SvgNumber& getX() const { return maX; } - void setX(const SvgNumber& rX = SvgNumber()) { maX = rX; } - - /// y content, set if found in current context - const SvgNumber& getY() const { return maY; } - void setY(const SvgNumber& rY = SvgNumber()) { maY = rY; } - - /// width content, set if found in current context - const SvgNumber& getWidth() const { return maWidth; } - void setWidth(const SvgNumber& rWidth = SvgNumber()) { maWidth = rWidth; } - - /// height content, set if found in current context - const SvgNumber& getHeight() const { return maHeight; } - void setHeight(const SvgNumber& rHeight = SvgNumber()) { maHeight = rHeight; } - - /// transform content - const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; } - void setTransform(const basegfx::B2DHomMatrix* pMatrix = nullptr) { if(mpaTransform) delete mpaTransform; mpaTransform = nullptr; if(pMatrix) mpaTransform = new basegfx::B2DHomMatrix(*pMatrix); } - - /// MaskUnits content - SvgUnits getMaskUnits() const { return maMaskUnits; } - void setMaskUnits(const SvgUnits aMaskUnits) { maMaskUnits = aMaskUnits; } - - /// MaskContentUnits content - SvgUnits getMaskContentUnits() const { return maMaskContentUnits; } - void setMaskContentUnits(const SvgUnits aMaskContentUnits) { maMaskContentUnits = aMaskContentUnits; } - }; - } // end of namespace svgreader -} // end of namespace svgio - -#endif // INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGMASKNODE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgio/svgreader/svgnode.hxx b/svgio/inc/svgio/svgreader/svgnode.hxx deleted file mode 100644 index 1b8359dde9b6..000000000000 --- a/svgio/inc/svgio/svgreader/svgnode.hxx +++ /dev/null @@ -1,190 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGNODE_HXX -#define INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGNODE_HXX - -#include -#include -#include -#include -#include -#include - -// predefines -namespace svgio -{ - namespace svgreader - { - class SvgNode; - class SvgDocument; - class SvgStyleAttributes; - } -} - - -namespace svgio -{ - namespace svgreader - { - typedef ::std::vector< SvgNode* > SvgNodeVector; - typedef ::std::vector< const SvgStyleAttributes* > SvgStyleAttributeVector; - - enum XmlSpace - { - XmlSpace_notset, - XmlSpace_default, - XmlSpace_preserve - }; - - // display property (see SVG 1.1. 11.5), not inheritable - enum Display // #i121656# - { - Display_inline, // the default - Display_block, - Display_list_item, - Display_run_in, - Display_compact, - Display_marker, - Display_table, - Display_inline_table, - Display_table_row_group, - Display_table_header_group, - Display_table_footer_group, - Display_table_row, - Display_table_column_group, - Display_table_column, - Display_table_cell, - Display_table_caption, - Display_none, - Display_inherit - }; - - // helper to convert a string associated with a token of type SVGTokenDisplay - // to the enum Display. Empty strings return the default 'Display_inline' with - // which members should be initialized - Display getDisplayFromContent(const OUString& aContent); - - class SvgNode : public InfoProvider - { - private: - /// basic data, Type, document we belong to and parent (if not root) - SVGToken maType; - SvgDocument& mrDocument; - const SvgNode* mpParent; - const SvgNode* mpAlternativeParent; - - /// sub hierarchy - SvgNodeVector maChildren; - - /// Id svan value - OUString* mpId; - - /// Class svan value - OUString* mpClass; - - /// XmlSpace value - XmlSpace maXmlSpace; - - /// Display value #i121656# - Display maDisplay; - - // CSS style vector chain, used in decompose phase and built up once per node. - // It contains the StyleHierarchy for the local node. INdependent from the - // node hierarchy itself which also needs to be used in style entry solving - SvgStyleAttributeVector maCssStyleVector; - - /// possible local CssStyle, e.g. style="fill:red; stroke:red;" - SvgStyleAttributes* mpLocalCssStyle; - - /// bitfield - // flag if maCssStyleVector is already computed (done only once) - bool mbCssStyleVectorBuilt : 1; - - protected: - /// helper to evtl. link to css style - const SvgStyleAttributes* checkForCssStyle(const OUString& rClassStr, const SvgStyleAttributes& rOriginal) const; - - /// helper for filling the CssStyle vector once dependent on mbCssStyleVectorBuilt - void fillCssStyleVector(const OUString& rClassStr, const SvgStyleAttributes& rOriginal); - void fillCssStyleVectorUsingHierarchyAndSelectors( - const OUString& rClassStr, - const SvgNode& rCurrent, - const OUString& aConcatenated); - - public: - SvgNode( - SVGToken aType, - SvgDocument& rDocument, - SvgNode* pParent); - virtual ~SvgNode(); - SvgNode(const SvgNode&) = delete; - SvgNode& operator=(const SvgNode&) = delete; - - /// scan helper to read and interpret a local CssStyle to mpLocalCssStyle - void readLocalCssStyle(const OUString& aContent); - - /// style helpers - void parseAttributes(const css::uno::Reference< css::xml::sax::XAttributeList >& xAttribs); - virtual const SvgStyleAttributes* getSvgStyleAttributes() const; - virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent); - virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const; - - /// #i125258# tell if this node is allowed to have a parent style (e.g. defs do not) - virtual bool supportsParentStyle() const; - - /// basic data read access - SVGToken getType() const { return maType; } - const SvgDocument& getDocument() const { return mrDocument; } - const SvgNode* getParent() const { if(mpAlternativeParent) return mpAlternativeParent; return mpParent; } - const SvgNodeVector& getChildren() const { return maChildren; } - - /// InfoProvider support for %, em and ex values - virtual const basegfx::B2DRange getCurrentViewPort() const override; - virtual double getCurrentFontSizeInherited() const override; - virtual double getCurrentXHeightInherited() const override; - - virtual double getCurrentFontSize() const; - double getCurrentXHeight() const; - - /// Id access - const OUString* getId() const { return mpId; } - void setId(const OUString* pfId = nullptr); - - /// Class access - const OUString* getClass() const { return mpClass; } - void setClass(const OUString* pfClass = nullptr); - - /// XmlSpace access - XmlSpace getXmlSpace() const; - void setXmlSpace(XmlSpace eXmlSpace = XmlSpace_notset) { maXmlSpace = eXmlSpace; } - - /// Display access #i121656# - Display getDisplay() const { return maDisplay; } - void setDisplay(Display eDisplay = Display_inherit) { maDisplay = eDisplay; } - - /// alternative parent - void setAlternativeParent(const SvgNode* pAlternativeParent = nullptr) { mpAlternativeParent = pAlternativeParent; } - }; - } // end of namespace svgreader -} // end of namespace svgio - -#endif // INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGNODE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgio/svgreader/svgpaint.hxx b/svgio/inc/svgio/svgreader/svgpaint.hxx deleted file mode 100644 index bab262adebdd..000000000000 --- a/svgio/inc/svgio/svgreader/svgpaint.hxx +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGPAINT_HXX -#define INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGPAINT_HXX - -#include - -namespace svgio -{ - namespace svgreader - { - class SvgPaint - { - private: - basegfx::BColor maColor; - - /// bitfield - bool mbSet : 1; - bool mbOn : 1; - bool mbCurrent : 1; - - public: - SvgPaint(const basegfx::BColor& rColor = basegfx::BColor(0.0, 0.0, 0.0), bool bSet = false, bool bOn = false, bool bCurrent = false) - : maColor(rColor), - mbSet(bSet), - mbOn(bOn), - mbCurrent(bCurrent) - { - } - - const basegfx::BColor& getBColor() const { return maColor; } - bool isSet() const { return mbSet; } - bool isOn() const { return mbOn; } - bool isCurrent() const { return mbCurrent; } - }; - } // end of namespace svgreader -} // end of namespace svgio - -#endif // INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGPAINT_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgio/svgreader/svgpathnode.hxx b/svgio/inc/svgio/svgreader/svgpathnode.hxx deleted file mode 100644 index 0c24244455fb..000000000000 --- a/svgio/inc/svgio/svgreader/svgpathnode.hxx +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGPATHNODE_HXX -#define INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGPATHNODE_HXX - -#include -#include -#include - -namespace svgio -{ - namespace svgreader - { - class SvgPathNode : public SvgNode - { - private: - /// use styles - SvgStyleAttributes maSvgStyleAttributes; - - /// variable scan values, dependent of given XAttributeList - basegfx::B2DPolyPolygon* mpPolyPolygon; - basegfx::B2DHomMatrix* mpaTransform; - SvgNumber maPathLength; - basegfx::tools::PointIndexSet maHelpPointIndices; - - public: - SvgPathNode( - SvgDocument& rDocument, - SvgNode* pParent); - virtual ~SvgPathNode(); - - virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; - virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; - virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const override; - - /// path content, set if found in current context - const basegfx::B2DPolyPolygon* getPath() const { return mpPolyPolygon; } - void setPath(const basegfx::B2DPolyPolygon* pPath = nullptr) { if(mpPolyPolygon) delete mpPolyPolygon; mpPolyPolygon = nullptr; if(pPath) mpPolyPolygon = new basegfx::B2DPolyPolygon(*pPath); } - - /// transform content, set if found in current context - const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; } - void setTransform(const basegfx::B2DHomMatrix* pMatrix = nullptr) { if(mpaTransform) delete mpaTransform; mpaTransform = nullptr; if(pMatrix) mpaTransform = new basegfx::B2DHomMatrix(*pMatrix); } - - /// PathLength content - const SvgNumber& getPathLength() const { return maPathLength; } - void setPathLength(const SvgNumber& rPathLength = SvgNumber()) { maPathLength = rPathLength; } - }; - } // end of namespace svgreader -} // end of namespace svgio - -#endif // INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGPATHNODE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgio/svgreader/svgpatternnode.hxx b/svgio/inc/svgio/svgreader/svgpatternnode.hxx deleted file mode 100644 index a5b6870ba8fe..000000000000 --- a/svgio/inc/svgio/svgreader/svgpatternnode.hxx +++ /dev/null @@ -1,119 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGPATTERNNODE_HXX -#define INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGPATTERNNODE_HXX - -#include -#include - -namespace svgio -{ - namespace svgreader - { - class SvgPatternNode : public SvgNode - { - private: - /// buffered decomposition - drawinglayer::primitive2d::Primitive2DContainer aPrimitives; - - /// use styles - SvgStyleAttributes maSvgStyleAttributes; - - /// variable scan values, dependent of given XAttributeList - basegfx::B2DRange* mpViewBox; - SvgAspectRatio maSvgAspectRatio; - SvgNumber maX; - SvgNumber maY; - SvgNumber maWidth; - SvgNumber maHeight; - SvgUnits* mpPatternUnits; - SvgUnits* mpPatternContentUnits; - basegfx::B2DHomMatrix* mpaPatternTransform; - - /// link to another pattern used as style. If maXLink - /// is set, the node can be fetched on demand by using - // tryToFindLink (buffered) - OUString maXLink; - const SvgPatternNode* mpXLink; - - /// link on demand - void tryToFindLink(); - - public: - SvgPatternNode( - SvgDocument& rDocument, - SvgNode* pParent); - virtual ~SvgPatternNode(); - - virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; - virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; - - /// global helpers - void getValuesRelative(double& rfX, double& rfY, double& rfW, double& rfH, const basegfx::B2DRange& rGeoRange, SvgNode& rUser) const; - - /// get pattern primitives buffered, uses decomposeSvgNode internally - const drawinglayer::primitive2d::Primitive2DContainer& getPatternPrimitives() const; - - /// InfoProvider support for % values - virtual const basegfx::B2DRange getCurrentViewPort() const override; - - /// viewBox content - const basegfx::B2DRange* getViewBox() const; - void setViewBox(const basegfx::B2DRange* pViewBox = nullptr) { if(mpViewBox) delete mpViewBox; mpViewBox = nullptr; if(pViewBox) mpViewBox = new basegfx::B2DRange(*pViewBox); } - - /// SvgAspectRatio content - const SvgAspectRatio& getSvgAspectRatio() const; - void setSvgAspectRatio(const SvgAspectRatio& rSvgAspectRatio = SvgAspectRatio()) { maSvgAspectRatio = rSvgAspectRatio; } - - /// X content, set if found in current context - const SvgNumber& getX() const; - void setX(const SvgNumber& rX = SvgNumber()) { maX = rX; } - - /// Y content, set if found in current context - const SvgNumber& getY() const; - void setY(const SvgNumber& rY = SvgNumber()) { maY = rY; } - - /// Width content, set if found in current context - const SvgNumber& getWidth() const; - void setWidth(const SvgNumber& rWidth = SvgNumber()) { maWidth = rWidth; } - - /// Height content, set if found in current context - const SvgNumber& getHeight() const; - void setHeight(const SvgNumber& rHeight = SvgNumber()) { maHeight = rHeight; } - - /// PatternUnits content - const SvgUnits* getPatternUnits() const; - void setPatternUnits(const SvgUnits aPatternUnits) { if(mpPatternUnits) delete mpPatternUnits; mpPatternUnits = nullptr; mpPatternUnits = new SvgUnits(aPatternUnits); } - - /// PatternContentUnits content - const SvgUnits* getPatternContentUnits() const; - void setPatternContentUnits(const SvgUnits aPatternContentUnits) { if(mpPatternContentUnits) delete mpPatternContentUnits; mpPatternContentUnits = nullptr; mpPatternContentUnits = new SvgUnits(aPatternContentUnits); } - - /// PatternTransform content - const basegfx::B2DHomMatrix* getPatternTransform() const; - void setPatternTransform(const basegfx::B2DHomMatrix* pMatrix = nullptr) { if(mpaPatternTransform) delete mpaPatternTransform; mpaPatternTransform = nullptr; if(pMatrix) mpaPatternTransform = new basegfx::B2DHomMatrix(*pMatrix); } - - }; - } // end of namespace svgreader -} // end of namespace svgio - -#endif // INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGPATTERNNODE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgio/svgreader/svgpolynode.hxx b/svgio/inc/svgio/svgreader/svgpolynode.hxx deleted file mode 100644 index 0e47c7499c2e..000000000000 --- a/svgio/inc/svgio/svgreader/svgpolynode.hxx +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGPOLYNODE_HXX -#define INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGPOLYNODE_HXX - -#include -#include -#include - -namespace svgio -{ - namespace svgreader - { - class SvgPolyNode : public SvgNode - { - private: - /// use styles - SvgStyleAttributes maSvgStyleAttributes; - - /// variable scan values, dependent of given XAttributeList - basegfx::B2DPolygon* mpPolygon; - basegfx::B2DHomMatrix* mpaTransform; - - /// bitfield - bool mbIsPolyline : 1; // true = polyline, false = polygon - - public: - SvgPolyNode( - SvgDocument& rDocument, - SvgNode* pParent, - bool bIsPolyline); - virtual ~SvgPolyNode(); - - virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; - virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; - virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const override; - - /// type read access - bool isPolyline() const { return mbIsPolyline; } - - /// Polygon content, set if found in current context - const basegfx::B2DPolygon* getPolygon() const { return mpPolygon; } - void setPolygon(const basegfx::B2DPolygon* pPolygon = nullptr) { if(mpPolygon) delete mpPolygon; mpPolygon = nullptr; if(pPolygon) mpPolygon = new basegfx::B2DPolygon(*pPolygon); } - - /// transform content, set if found in current context - const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; } - void setTransform(const basegfx::B2DHomMatrix* pMatrix = nullptr) { if(mpaTransform) delete mpaTransform; mpaTransform = nullptr; if(pMatrix) mpaTransform = new basegfx::B2DHomMatrix(*pMatrix); } - }; - } // end of namespace svgreader -} // end of namespace svgio - -#endif // INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGPOLYNODE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgio/svgreader/svgrectnode.hxx b/svgio/inc/svgio/svgreader/svgrectnode.hxx deleted file mode 100644 index f103876ab49a..000000000000 --- a/svgio/inc/svgio/svgreader/svgrectnode.hxx +++ /dev/null @@ -1,88 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGRECTNODE_HXX -#define INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGRECTNODE_HXX - -#include -#include - -namespace svgio -{ - namespace svgreader - { - class SvgRectNode : public SvgNode - { - private: - /// use styles - SvgStyleAttributes maSvgStyleAttributes; - - /// variable scan values, dependent of given XAttributeList - SvgNumber maX; - SvgNumber maY; - SvgNumber maWidth; - SvgNumber maHeight; - SvgNumber maRx; - SvgNumber maRy; - basegfx::B2DHomMatrix* mpaTransform; - - public: - SvgRectNode( - SvgDocument& rDocument, - SvgNode* pParent); - virtual ~SvgRectNode(); - - virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; - virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; - virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const override; - - /// x content, set if found in current context - const SvgNumber& getX() const { return maX; } - void setX(const SvgNumber& rX = SvgNumber()) { maX = rX; } - - /// y content, set if found in current context - const SvgNumber& getY() const { return maY; } - void setY(const SvgNumber& rY = SvgNumber()) { maY = rY; } - - /// width content, set if found in current context - const SvgNumber& getWidth() const { return maWidth; } - void setWidth(const SvgNumber& rWidth = SvgNumber()) { maWidth = rWidth; } - - /// height content, set if found in current context - const SvgNumber& getHeight() const { return maHeight; } - void setHeight(const SvgNumber& rHeight = SvgNumber()) { maHeight = rHeight; } - - /// Rx content, set if found in current context - const SvgNumber& getRx() const { return maRx; } - void setRx(const SvgNumber& rRx = SvgNumber()) { maRx = rRx; } - - /// Ry content, set if found in current context - const SvgNumber& getRy() const { return maRy; } - void setRy(const SvgNumber& rRy = SvgNumber()) { maRy = rRy; } - - /// transform content, set if found in current context - const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; } - void setTransform(const basegfx::B2DHomMatrix* pMatrix = nullptr) { if(mpaTransform) delete mpaTransform; mpaTransform = nullptr; if(pMatrix) mpaTransform = new basegfx::B2DHomMatrix(*pMatrix); } - }; - } // end of namespace svgreader -} // end of namespace svgio - -#endif // INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGRECTNODE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgio/svgreader/svgstyleattributes.hxx b/svgio/inc/svgio/svgreader/svgstyleattributes.hxx deleted file mode 100644 index 141218b3e042..000000000000 --- a/svgio/inc/svgio/svgreader/svgstyleattributes.hxx +++ /dev/null @@ -1,478 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGSTYLEATTRIBUTES_HXX -#define INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGSTYLEATTRIBUTES_HXX - -#include -#include -#include -#include - - -// predefines - -namespace svgio { namespace svgreader { - class SvgGradientNode; - class SvgPatternNode; - class SvgMarkerNode; - class SvgClipPathNode; - class SvgMaskNode; -}} - - -namespace svgio -{ - namespace svgreader - { - enum StrokeLinecap - { - StrokeLinecap_notset, - StrokeLinecap_butt, - StrokeLinecap_round, - StrokeLinecap_square - }; - - enum StrokeLinejoin - { - StrokeLinejoin_notset, - StrokeLinejoin_miter, - StrokeLinejoin_round, - StrokeLinejoin_bevel - }; - - enum FontSize - { - FontSize_notset, - FontSize_xx_small, - FontSize_x_small, - FontSize_small, - FontSize_smaller, - FontSize_medium, - FontSize_large, - FontSize_larger, - FontSize_x_large, - FontSize_xx_large, - FontSize_initial - }; - - enum FontStretch - { - FontStretch_notset, - FontStretch_normal, - FontStretch_wider, - FontStretch_narrower, - FontStretch_ultra_condensed, - FontStretch_extra_condensed, - FontStretch_condensed, - FontStretch_semi_condensed, - FontStretch_semi_expanded, - FontStretch_expanded, - FontStretch_extra_expanded, - FontStretch_ultra_expanded - }; - - FontStretch getWider(FontStretch aSource); - FontStretch getNarrower(FontStretch aSource); - - enum FontStyle - { - FontStyle_notset, - FontStyle_normal, - FontStyle_italic, - FontStyle_oblique - }; - - enum FontVariant - { - FontVariant_notset, - FontVariant_normal, - FontVariant_small_caps - }; - - enum FontWeight - { - FontWeight_notset, - FontWeight_100, - FontWeight_200, - FontWeight_300, - FontWeight_400, // same as FontWeight_normal - FontWeight_500, - FontWeight_600, - FontWeight_700, // same as FontWeight_bold - FontWeight_800, - FontWeight_900, - FontWeight_bolder, - FontWeight_lighter, - }; - - FontWeight getBolder(FontWeight aSource); - FontWeight getLighter(FontWeight aSource); - ::FontWeight getVclFontWeight(FontWeight aSource); - - enum TextAlign - { - TextAlign_notset, - TextAlign_left, - TextAlign_right, - TextAlign_center, - TextAlign_justify - }; - - enum TextDecoration - { - TextDecoration_notset, - TextDecoration_none, - TextDecoration_underline, - TextDecoration_overline, - TextDecoration_line_through, - TextDecoration_blink - }; - - enum TextAnchor - { - TextAnchor_notset, - TextAnchor_start, - TextAnchor_middle, - TextAnchor_end - }; - - enum FillRule - { - FillRule_notset, - FillRule_nonzero, - FillRule_evenodd - }; - - enum BaselineShift - { - BaselineShift_Baseline, - BaselineShift_Sub, - BaselineShift_Super, - BaselineShift_Percentage, - BaselineShift_Length - }; - - enum Visibility - { - Visibility_notset, - Visibility_visible, - Visibility_hidden, - Visibility_collapse, - Visibility_inherit - }; - - class SvgStyleAttributes - { - private: - SvgNode& mrOwner; - const SvgStyleAttributes* mpCssStyleParent; - SvgPaint maFill; - SvgPaint maStroke; - SvgPaint maStopColor; - SvgNumber maStrokeWidth; - SvgNumber maStopOpacity; - const SvgGradientNode* mpSvgGradientNodeFill; - const SvgGradientNode* mpSvgGradientNodeStroke; - const SvgPatternNode* mpSvgPatternNodeFill; - const SvgPatternNode* mpSvgPatternNodeStroke; - SvgNumber maFillOpacity; - SvgNumberVector maStrokeDasharray; - SvgNumber maStrokeDashOffset; - StrokeLinecap maStrokeLinecap; - StrokeLinejoin maStrokeLinejoin; - SvgNumber maStrokeMiterLimit; - SvgNumber maStrokeOpacity; - SvgStringVector maFontFamily; - FontSize maFontSize; - SvgNumber maFontSizeNumber; - FontStretch maFontStretch; - FontStyle maFontStyle; - FontVariant maFontVariant; - FontWeight maFontWeight; - TextAlign maTextAlign; - TextDecoration maTextDecoration; - TextAnchor maTextAnchor; - SvgPaint maColor; - SvgNumber maOpacity; - Visibility maVisibility; - OUString maTitle; - OUString maDesc; - - /// link to content. If set, the node can be fetched on demand - OUString maClipPathXLink; - const SvgClipPathNode* mpClipPathXLink; - OUString maMaskXLink; - const SvgMaskNode* mpMaskXLink; - - /// link to markers. If set, the node can be fetched on demand - OUString maMarkerStartXLink; - const SvgMarkerNode* mpMarkerStartXLink; - OUString maMarkerMidXLink; - const SvgMarkerNode* mpMarkerMidXLink; - OUString maMarkerEndXLink; - const SvgMarkerNode* mpMarkerEndXLink; - - /// fill rule - FillRule maFillRule; - - // ClipRule setting (only valid when mbIsClipPathContent == true, default is FillRule_nonzero) - FillRule maClipRule; - - // BaselineShift: Type and number (in case of BaselineShift_Percentage or BaselineShift_Length) - BaselineShift maBaselineShift; - SvgNumber maBaselineShiftNumber; - - /// bitfield - - // defines if this attributes are part of a ClipPath. If yes, - // rough geometry will be created on decomposition by patching - // values for fill, stroke, strokeWidth and others - bool mbIsClipPathContent : 1; - - // #121221# Defines if evtl. an empty array *is* set - bool mbStrokeDasharraySet : 1; - - /// internal helpers - void add_fillGradient( - const basegfx::B2DPolyPolygon& rPath, - drawinglayer::primitive2d::Primitive2DContainer& rTarget, - const SvgGradientNode& rFillGradient, - const basegfx::B2DRange& rGeoRange) const; - void add_fillPatternTransform( - const basegfx::B2DPolyPolygon& rPath, - drawinglayer::primitive2d::Primitive2DContainer& rTarget, - const SvgPatternNode& rFillGradient, - const basegfx::B2DRange& rGeoRange) const; - void add_fillPattern( - const basegfx::B2DPolyPolygon& rPath, - drawinglayer::primitive2d::Primitive2DContainer& rTarget, - const SvgPatternNode& rFillGradient, - const basegfx::B2DRange& rGeoRange) const; - void add_fill( - const basegfx::B2DPolyPolygon& rPath, - drawinglayer::primitive2d::Primitive2DContainer& rTarget, - const basegfx::B2DRange& rGeoRange) const; - void add_stroke( - const basegfx::B2DPolyPolygon& rPath, - drawinglayer::primitive2d::Primitive2DContainer& rTarget, - const basegfx::B2DRange& rGeoRange) const; - bool prepare_singleMarker( - drawinglayer::primitive2d::Primitive2DContainer& rMarkerPrimitives, - basegfx::B2DHomMatrix& rMarkerTransform, - basegfx::B2DRange& rClipRange, - const SvgMarkerNode& rMarker) const; - void add_markers( - const basegfx::B2DPolyPolygon& rPath, - drawinglayer::primitive2d::Primitive2DContainer& rTarget, - const basegfx::tools::PointIndexSet* pHelpPointIndices) const; - - public: - /// local attribute scanner - void parseStyleAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& rContent, - bool bCaseIndependent); - - /// helper which does the necessary with a given path - void add_text( - drawinglayer::primitive2d::Primitive2DContainer& rTarget, - drawinglayer::primitive2d::Primitive2DContainer& rSource) const; - void add_path( - const basegfx::B2DPolyPolygon& rPath, - drawinglayer::primitive2d::Primitive2DContainer& rTarget, - const basegfx::tools::PointIndexSet* pHelpPointIndices) const; - void add_postProcess( - drawinglayer::primitive2d::Primitive2DContainer& rTarget, - const drawinglayer::primitive2d::Primitive2DContainer& rSource, - const basegfx::B2DHomMatrix* pTransform) const; - - /// helper to set mpCssStyleParent temporarily for CSS style hierarchies - void setCssStyleParent(const SvgStyleAttributes* pNew) { mpCssStyleParent = pNew; } - const SvgStyleAttributes* getCssStyleParent() const { return mpCssStyleParent; } - - /// scan helpers - void readCssStyle(const OUString& rCandidate); - const SvgStyleAttributes* getParentStyle() const; - - SvgStyleAttributes(SvgNode& rOwner); - ~SvgStyleAttributes(); - - /// fill content - bool isFillSet() const; // #i125258# ask if fill is a direct hard attribute (no hierarchy) - const basegfx::BColor* getFill() const; - void setFill(const SvgPaint& rFill) { maFill = rFill; } - - /// stroke content - const basegfx::BColor* getStroke() const; - void setStroke(const SvgPaint& rStroke) { maStroke = rStroke; } - - /// stop color content - const basegfx::BColor& getStopColor() const; - void setStopColor(const SvgPaint& rStopColor) { maStopColor = rStopColor; } - - /// stroke-width content - SvgNumber getStrokeWidth() const; - void setStrokeWidth(const SvgNumber& rStrokeWidth = SvgNumber()) { maStrokeWidth = rStrokeWidth; } - - /// stop opacity content - SvgNumber getStopOpacity() const; - void setStopOpacity(const SvgNumber& rStopOpacity = SvgNumber()) { maStopOpacity = rStopOpacity; } - - /// access to evtl. set fill gradient - const SvgGradientNode* getSvgGradientNodeFill() const; - void setSvgGradientNodeFill(const SvgGradientNode* pNew) { mpSvgGradientNodeFill = pNew; } - - /// access to evtl. set fill pattern - const SvgPatternNode* getSvgPatternNodeFill() const; - void setSvgPatternNodeFill(const SvgPatternNode* pNew) { mpSvgPatternNodeFill = pNew; } - - /// access to evtl. set stroke gradient - const SvgGradientNode* getSvgGradientNodeStroke() const; - void setSvgGradientNodeStroke(const SvgGradientNode* pNew) { mpSvgGradientNodeStroke = pNew; } - - /// access to evtl. set stroke pattern - const SvgPatternNode* getSvgPatternNodeStroke() const; - void setSvgPatternNodeStroke(const SvgPatternNode* pNew) { mpSvgPatternNodeStroke = pNew; } - - /// fill opacity content - SvgNumber getFillOpacity() const; - void setFillOpacity(const SvgNumber& rFillOpacity = SvgNumber()) { maFillOpacity = rFillOpacity; } - - /// fill rule content - FillRule getFillRule() const; - - /// fill StrokeDasharray content - const SvgNumberVector& getStrokeDasharray() const; - void setStrokeDasharray(const SvgNumberVector& rStrokeDasharray = SvgNumberVector()) { maStrokeDasharray = rStrokeDasharray; } - - /// #121221# StrokeDasharray needs a set state, it *may* be set to empty by purpose - bool getStrokeDasharraySet() const { return mbStrokeDasharraySet; } - void setStrokeDasharraySet(bool bNew) { mbStrokeDasharraySet = bNew; } - - /// StrokeDashOffset content - SvgNumber getStrokeDashOffset() const; - void setStrokeDashOffset(const SvgNumber& rStrokeDashOffset = SvgNumber()) { maStrokeDashOffset = rStrokeDashOffset; } - - /// StrokeLinecap content - StrokeLinecap getStrokeLinecap() const; - void setStrokeLinecap(const StrokeLinecap aStrokeLinecap = StrokeLinecap_notset) { maStrokeLinecap = aStrokeLinecap; } - - /// StrokeLinejoin content - StrokeLinejoin getStrokeLinejoin() const; - void setStrokeLinejoin(const StrokeLinejoin aStrokeLinejoin = StrokeLinejoin_notset) { maStrokeLinejoin = aStrokeLinejoin; } - - /// StrokeMiterLimit content - SvgNumber getStrokeMiterLimit() const; - void setStrokeMiterLimit(const SvgNumber& rStrokeMiterLimit = SvgNumber(4.0,Unit_none,false)) { maStrokeMiterLimit = rStrokeMiterLimit; } - - /// StrokeOpacity content - SvgNumber getStrokeOpacity() const; - void setStrokeOpacity(const SvgNumber& rStrokeOpacity = SvgNumber()) { maStrokeOpacity = rStrokeOpacity; } - - /// Font content - const SvgStringVector& getFontFamily() const; - void setFontFamily(const SvgStringVector& rSvgStringVector = SvgStringVector()) { maFontFamily = rSvgStringVector; } - - /// FontSize content - void setFontSize(const FontSize aFontSize = FontSize_notset) { maFontSize = aFontSize; } - void setFontSizeNumber(const SvgNumber& rFontSize = SvgNumber()) { maFontSizeNumber = rFontSize; } - SvgNumber getFontSizeNumber() const; - - /// FontStretch content - FontStretch getFontStretch() const; - void setFontStretch(const FontStretch aFontStretch = FontStretch_notset) { maFontStretch = aFontStretch; } - - /// FontStyle content - FontStyle getFontStyle() const; - void setFontStyle(const FontStyle aFontStyle = FontStyle_notset) { maFontStyle = aFontStyle; } - - /// FontVariant content - void setFontVariant(const FontVariant aFontVariant = FontVariant_notset) { maFontVariant = aFontVariant; } - - /// FontWeight content - FontWeight getFontWeight() const; - void setFontWeight(const FontWeight aFontWeight = FontWeight_notset) { maFontWeight = aFontWeight; } - - /// TextAlign content - TextAlign getTextAlign() const; - void setTextAlign(const TextAlign aTextAlign = TextAlign_notset) { maTextAlign = aTextAlign; } - - /// TextDecoration content - const SvgStyleAttributes* getTextDecorationDefiningSvgStyleAttributes() const; - TextDecoration getTextDecoration() const; - void setTextDecoration(const TextDecoration aTextDecoration = TextDecoration_notset) { maTextDecoration = aTextDecoration; } - - /// TextAnchor content - TextAnchor getTextAnchor() const; - void setTextAnchor(const TextAnchor aTextAnchor = TextAnchor_notset) { maTextAnchor = aTextAnchor; } - - /// Color content - const basegfx::BColor* getColor() const; - void setColor(const SvgPaint& rColor) { maColor = rColor; } - - /// Resolve current color (defaults to black if no color is specified) - const basegfx::BColor* getCurrentColor() const; - - /// Opacity content - SvgNumber getOpacity() const; - void setOpacity(const SvgNumber& rOpacity = SvgNumber()) { maOpacity = rOpacity; } - - /// Visibility - Visibility getVisibility() const; - void setVisibility(const Visibility aVisibility = Visibility_notset) { maVisibility = aVisibility; } - - // Title content - const OUString& getTitle() const { return maTitle; } - void setTitle(const OUString& rNew) { maTitle = rNew; } - - // Desc content - const OUString& getDesc() const { return maDesc; } - void setDesc(const OUString& rNew) { maDesc = rNew; } - - // ClipPathXLink content - OUString getClipPathXLink() const; - const SvgClipPathNode* accessClipPathXLink() const; - - // MaskXLink content - OUString getMaskXLink() const; - const SvgMaskNode* accessMaskXLink() const; - - // MarkerStartXLink content - OUString getMarkerStartXLink() const; - const SvgMarkerNode* accessMarkerStartXLink() const; - - // MarkerMidXLink content - OUString getMarkerMidXLink() const; - const SvgMarkerNode* accessMarkerMidXLink() const; - - // MarkerEndXLink content - OUString getMarkerEndXLink() const; - const SvgMarkerNode* accessMarkerEndXLink() const; - - // BaselineShift - void setBaselineShift(const BaselineShift aBaselineShift = BaselineShift_Baseline) { maBaselineShift = aBaselineShift; } - BaselineShift getBaselineShift() const { return maBaselineShift; } - void setBaselineShiftNumber(const SvgNumber& rBaselineShift = SvgNumber()) { maBaselineShiftNumber = rBaselineShift; } - SvgNumber getBaselineShiftNumber() const; - }; - } // end of namespace svgreader -} // end of namespace svgio - -#endif // INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGSTYLEATTRIBUTES_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgio/svgreader/svgstylenode.hxx b/svgio/inc/svgio/svgreader/svgstylenode.hxx deleted file mode 100644 index 8ee7fceec3c2..000000000000 --- a/svgio/inc/svgio/svgreader/svgstylenode.hxx +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGSTYLENODE_HXX -#define INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGSTYLENODE_HXX - -#include -#include - -namespace svgio -{ - namespace svgreader - { - class SvgStyleNode : public SvgNode - { - private: - /// use styles - std::vector< SvgStyleAttributes* > maSvgStyleAttributes; - - /// bitfield - bool mbTextCss : 1; // true == type is 'text/css' - - public: - SvgStyleNode( - SvgDocument& rDocument, - SvgNode* pParent); - virtual ~SvgStyleNode(); - - /// #i125258# tell if this node is allowed to have a parent style (e.g. defs do not) - virtual bool supportsParentStyle() const override; - - virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; - - /// CssStyleSheet add helpers - void addCssStyleSheet(const OUString& aSelectors, const SvgStyleAttributes& rNewStyle); - void addCssStyleSheet(const OUString& aSelectors, const OUString& aContent); - void addCssStyleSheet(const OUString& aSelectorsAndContent); - - /// textCss access - bool isTextCss() const { return mbTextCss; } - void setTextCss(bool bNew) { mbTextCss = bNew; } - }; - } // end of namespace svgreader -} // end of namespace svgio - -#endif // INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGSTYLENODE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgio/svgreader/svgsvgnode.hxx b/svgio/inc/svgio/svgreader/svgsvgnode.hxx deleted file mode 100644 index 15d49505bc4c..000000000000 --- a/svgio/inc/svgio/svgreader/svgsvgnode.hxx +++ /dev/null @@ -1,104 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGSVGNODE_HXX -#define INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGSVGNODE_HXX - -#include - -namespace svgio -{ - namespace svgreader - { - class SvgSvgNode : public SvgNode - { - private: - /// use styles - SvgStyleAttributes maSvgStyleAttributes; - - /// variable scan values, dependent of given XAttributeList - basegfx::B2DRange* mpViewBox; - SvgAspectRatio maSvgAspectRatio; - SvgNumber maX; - SvgNumber maY; - SvgNumber maWidth; - SvgNumber maHeight; - SvgNumber maVersion; - - /// #i125258# bitfield - bool mbStyleAttributesInitialized : 1; - - // #i125258# on-demand init hard attributes when this is the outmost svg element - // and more (see implementation) - void initializeStyleAttributes(); - - public: - SvgSvgNode( - SvgDocument& rDocument, - SvgNode* pParent); - virtual ~SvgSvgNode(); - - virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; - virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; - virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const override; - - /// Seeks width and height of viewport, which is current before the new viewport is set. - // needed for percentage unit in x, y, width or height - void seekReferenceWidth(double& fWidth, bool& bHasFound) const; - void seekReferenceHeight(double& fHeight, bool& bHasFound) const; - - /// InfoProvider support for % values in children - // The returned 'CurrentViewPort' is the viewport as it is set by this svg element - // and as it is needed to resolve relative values in children - // The method does not check for invalid width and height - virtual const basegfx::B2DRange getCurrentViewPort() const override; - - /// viewBox content - const basegfx::B2DRange* getViewBox() const { return mpViewBox; } - void setViewBox(const basegfx::B2DRange* pViewBox = nullptr) { if(mpViewBox) delete mpViewBox; mpViewBox = nullptr; if(pViewBox) mpViewBox = new basegfx::B2DRange(*pViewBox); } - - /// SvgAspectRatio content - const SvgAspectRatio& getSvgAspectRatio() const { return maSvgAspectRatio; } - void setSvgAspectRatio(const SvgAspectRatio& rSvgAspectRatio = SvgAspectRatio()) { maSvgAspectRatio = rSvgAspectRatio; } - - /// x content - const SvgNumber& getX() const { return maX; } - void setX(const SvgNumber& rX = SvgNumber()) { maX = rX; } - - /// y content - const SvgNumber& getY() const { return maY; } - void setY(const SvgNumber& rY = SvgNumber()) { maY = rY; } - - /// width content - const SvgNumber& getWidth() const { return maWidth; } - void setWidth(const SvgNumber& rWidth = SvgNumber()) { maWidth = rWidth; } - - /// height content - const SvgNumber& getHeight() const { return maHeight; } - void setHeight(const SvgNumber& rHeight = SvgNumber()) { maHeight = rHeight; } - - /// version content - void setVersion(const SvgNumber& rVersion = SvgNumber()) { maVersion = rVersion; } - }; - } // end of namespace svgreader -} // end of namespace svgio - -#endif // INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGSVGNODE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgio/svgreader/svgsymbolnode.hxx b/svgio/inc/svgio/svgreader/svgsymbolnode.hxx deleted file mode 100644 index 6fb3d6e8d7b4..000000000000 --- a/svgio/inc/svgio/svgreader/svgsymbolnode.hxx +++ /dev/null @@ -1,59 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGSYMBOLNODE_HXX -#define INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGSYMBOLNODE_HXX - -#include - -namespace svgio -{ - namespace svgreader - { - class SvgSymbolNode : public SvgNode - { - private: - /// use styles - SvgStyleAttributes maSvgStyleAttributes; - - /// variable scan values, dependent of given XAttributeList - basegfx::B2DRange* mpViewBox; - SvgAspectRatio maSvgAspectRatio; - - public: - SvgSymbolNode( - SvgDocument& rDocument, - SvgNode* pParent); - virtual ~SvgSymbolNode(); - - virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; - virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; - - /// viewBox content - void setViewBox(const basegfx::B2DRange* pViewBox = nullptr) { if(mpViewBox) delete mpViewBox; mpViewBox = nullptr; if(pViewBox) mpViewBox = new basegfx::B2DRange(*pViewBox); } - - /// SvgAspectRatio content - void setSvgAspectRatio(const SvgAspectRatio& rSvgAspectRatio = SvgAspectRatio()) { maSvgAspectRatio = rSvgAspectRatio; } - }; - } // end of namespace svgreader -} // end of namespace svgio - -#endif // INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGSYMBOLNODE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgio/svgreader/svgtextnode.hxx b/svgio/inc/svgio/svgreader/svgtextnode.hxx deleted file mode 100644 index 86c13216d1f5..000000000000 --- a/svgio/inc/svgio/svgreader/svgtextnode.hxx +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGTEXTNODE_HXX -#define INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGTEXTNODE_HXX - -#include -#include -#include - -namespace svgio -{ - namespace svgreader - { - class SvgTextNode : public SvgNode - { - private: - /// use styles - SvgStyleAttributes maSvgStyleAttributes; - - /// variable scan values, dependent of given XAttributeList - basegfx::B2DHomMatrix* mpaTransform; - SvgTextPositions maSvgTextPositions; - - /// local helpers - void DecomposeChild( - const SvgNode& rCandidate, - drawinglayer::primitive2d::Primitive2DContainer& rTarget, - SvgTextPosition& rSvgTextPosition) const; - static void addTextPrimitives( - const SvgNode& rCandidate, - drawinglayer::primitive2d::Primitive2DContainer& rTarget, - drawinglayer::primitive2d::Primitive2DContainer& rSource); - - public: - SvgTextNode( - SvgDocument& rDocument, - SvgNode* pParent); - virtual ~SvgTextNode(); - - virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; - virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; - virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const override; - - virtual double getCurrentFontSize() const override; - - /// transform content, set if found in current context - const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; } - void setTransform(const basegfx::B2DHomMatrix* pMatrix = nullptr) { if(mpaTransform) delete mpaTransform; mpaTransform = nullptr; if(pMatrix) mpaTransform = new basegfx::B2DHomMatrix(*pMatrix); } - - /// access to SvgTextPositions - const SvgTextPositions& getSvgTextPositions() const { return maSvgTextPositions; } - }; - } // end of namespace svgreader -} // end of namespace svgio - -#endif // INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGTEXTNODE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgio/svgreader/svgtextpathnode.hxx b/svgio/inc/svgio/svgreader/svgtextpathnode.hxx deleted file mode 100644 index c0e4242ed27d..000000000000 --- a/svgio/inc/svgio/svgreader/svgtextpathnode.hxx +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGTEXTPATHNODE_HXX -#define INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGTEXTPATHNODE_HXX - -#include -#include -#include - -namespace svgio -{ - namespace svgreader - { - class SvgTextPathNode : public SvgNode - { - private: - /// use styles - SvgStyleAttributes maSvgStyleAttributes; - - /// link to path content. If maXLink - /// is set, the node can be fetched on demand - OUString maXLink; - - /// variable scan values, dependent of given XAttributeList - SvgNumber maStartOffset; - - /// bitfield - bool mbMethod : 1; // true = align, false = stretch - bool mbSpacing : 1; // true = auto, false = exact - - public: - SvgTextPathNode( - SvgDocument& rDocument, - SvgNode* pParent); - virtual ~SvgTextPathNode(); - - virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; - virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; - void decomposePathNode( - const drawinglayer::primitive2d::Primitive2DContainer& rPathContent, - drawinglayer::primitive2d::Primitive2DContainer& rTarget, - const basegfx::B2DPoint& rTextStart) const; - bool isValid() const; - - /// StartOffset content - const SvgNumber& getStartOffset() const { return maStartOffset; } - void setStartOffset(const SvgNumber& rStartOffset = SvgNumber()) { maStartOffset = rStartOffset; } - - /// Method content - void setMethod(bool bNew) { mbMethod = bNew; } - - /// Spacing content - void setSpacing(bool bNew) { mbSpacing = bNew; } - }; - } // end of namespace svgreader -} // end of namespace svgio - -#endif // INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGTEXTPATHNODE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgio/svgreader/svgtitledescnode.hxx b/svgio/inc/svgio/svgreader/svgtitledescnode.hxx deleted file mode 100644 index 26e737c24b1a..000000000000 --- a/svgio/inc/svgio/svgreader/svgtitledescnode.hxx +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGTITLEDESCNODE_HXX -#define INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGTITLEDESCNODE_HXX - -#include - - -namespace svgio -{ - namespace svgreader - { - class SvgTitleDescNode : public SvgNode - { - private: - /// contained chars - OUString maText; - - public: - SvgTitleDescNode( - SVGToken aType, - SvgDocument& rDocument, - SvgNode* pParent); - virtual ~SvgTitleDescNode(); - - /// add new chars - void concatenate(const OUString& rChars); - - /// x content, set if found in current context - const OUString& getText() const { return maText; } - }; - } // end of namespace svgreader -} // end of namespace svgio - - -#endif // INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGTITLEDESCNODE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgio/svgreader/svgtoken.hxx b/svgio/inc/svgio/svgreader/svgtoken.hxx deleted file mode 100644 index 112102f8b4cc..000000000000 --- a/svgio/inc/svgio/svgreader/svgtoken.hxx +++ /dev/null @@ -1,196 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGTOKEN_HXX -#define INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGTOKEN_HXX - -#include - -namespace svgio -{ - namespace svgreader - { - // SVG token mapper with hashing - enum SVGToken - { - SVGTokenUnknown = 0, - - // diverse attribute tokens - SVGTokenWidth, - SVGTokenHeight, - SVGTokenViewBox, - SVGTokenTransform, - SVGTokenStyle, - SVGTokenDisplay, // #i121656# - SVGTokenD, - SVGTokenX, - SVGTokenY, - SVGTokenXmlns, - SVGTokenVersion, - SVGTokenId, - SVGTokenRx, - SVGTokenRy, - SVGTokenPoints, - SVGTokenDx, - SVGTokenDy, - SVGTokenRotate, - SVGTokenTextLength, - SVGTokenLengthAdjust, - SVGTokenFont, - SVGTokenFontFamily, - SVGTokenFontSize, - SVGTokenFontSizeAdjust, - SVGTokenFontStretch, - SVGTokenFontStyle, - SVGTokenFontVariant, - SVGTokenFontWeight, - SVGTokenDirection, - SVGTokenLetterSpacing, - SVGTokenTextDecoration, - SVGTokenUnicodeBidi, - SVGTokenWordSpacing, - SVGTokenCharacter, // not in the hash, just for simple text handling in SvgCharacterNode - SVGTokenTspan, - SVGTokenTref, - SVGTokenTextPath, - SVGTokenStartOffset, - SVGTokenMethod, - SVGTokenSpacing, - SVGTokenTextAlign, - SVGTokenPathLength, - SVGTokenType, - SVGTokenClass, - SVGTokenTextAnchor, - SVGTokenXmlSpace, - SVGTokenColor, - SVGTokenClipPathNode, - SVGTokenClipPathProperty, - SVGTokenMask, - SVGTokenClipPathUnits, - SVGTokenMaskUnits, - SVGTokenMaskContentUnits, - SVGTokenClipRule, - SVGTokenMarker, - SVGTokenMarkerStart, - SVGTokenMarkerMid, - SVGTokenMarkerEnd, - SVGTokenRefX, - SVGTokenRefY, - SVGTokenMarkerUnits, - SVGTokenMarkerWidth, - SVGTokenMarkerHeight, - SVGTokenOrient, - SVGTokenPattern, - SVGTokenPatternUnits, - SVGTokenPatternContentUnits, - SVGTokenPatternTransform, - SVGTokenOpacity, - SVGTokenVisibility, - SVGTokenTitle, - SVGTokenDesc, - - // AspectRatio and params - SVGTokenPreserveAspectRatio, - SVGTokenDefer, - SVGTokenNone, - SVGTokenXMinYMin, - SVGTokenXMidYMin, - SVGTokenXMaxYMin, - SVGTokenXMinYMid, - SVGTokenXMidYMid, - SVGTokenXMaxYMid, - SVGTokenXMinYMax, - SVGTokenXMidYMax, - SVGTokenXMaxYMax, - SVGTokenMeet, - SVGTokenSlice, - - // structural elements - SVGTokenDefs, - SVGTokenG, - SVGTokenSvg, - SVGTokenSymbol, - SVGTokenUse, - SVGTokenA, - - // shape elements - SVGTokenCircle, - SVGTokenEllipse, - SVGTokenLine, - SVGTokenPath, - SVGTokenPolygon, - SVGTokenPolyline, - SVGTokenRect, - SVGTokenImage, - - // gradient elements and tokens - SVGTokenLinearGradient, - SVGTokenRadialGradient, - SVGTokenStop, - SVGTokenOffset, - SVGTokenX1, - SVGTokenY1, - SVGTokenX2, - SVGTokenY2, - SVGTokenCx, - SVGTokenCy, - SVGTokenFx, - SVGTokenFy, - SVGTokenR, - SVGTokenGradientUnits, - SVGTokenGradientTransform, - SVGTokenSpreadMethod, - SVGTokenXlinkHref, - SVGTokenStopColor, - SVGTokenStopOpacity, - - // fill tokens - SVGTokenFill, - SVGTokenFillOpacity, - SVGTokenFillRule, - - // stroke tokens - SVGTokenStroke, - SVGTokenStrokeDasharray, - SVGTokenStrokeDashoffset, - SVGTokenStrokeLinecap, - SVGTokenStrokeLinejoin, - SVGTokenStrokeMiterlimit, - SVGTokenStrokeOpacity, - SVGTokenStrokeWidth, - - // text tokens - SVGTokenText, - SVGTokenBaselineShift, - - SVGTokenFlowRoot, - - SVGTokenLast - }; - - SVGToken StrToSVGToken(const OUString& rStr, bool bCaseIndependent); - - const OUString getStrTitle(); - const OUString getStrDesc(); - } // end of namespace svgreader -} // end of namespace svgio - -#endif // INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGTOKEN_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgio/svgreader/svgtools.hxx b/svgio/inc/svgio/svgreader/svgtools.hxx deleted file mode 100644 index eccf3ac0df84..000000000000 --- a/svgio/inc/svgio/svgreader/svgtools.hxx +++ /dev/null @@ -1,233 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGTOOLS_HXX -#define INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGTOOLS_HXX - -#include -#include -#include -#include -#include - -namespace svgio -{ - namespace svgreader - { -#ifdef DBG_UTIL - // error helper - void myAssert(const OUString& rMessage); -#endif - -// recommended value for this device dependent unit, see CSS2 section 4.3.2 Lengths -#define F_SVG_PIXEL_PER_INCH 96.0 - - // common non-token strings - struct commonStrings - { - static const OUString aStrUserSpaceOnUse; - static const OUString aStrObjectBoundingBox; - static const OUString aStrNonzero; - static const OUString aStrEvenOdd; - }; - - enum SvgUnits - { - userSpaceOnUse, - objectBoundingBox - }; - - enum NumberType - { - xcoordinate, - ycoordinate, - length - }; - - class InfoProvider - { - public: - virtual ~InfoProvider() {} - virtual const basegfx::B2DRange getCurrentViewPort() const = 0; - /// return font size of node inherited from parents - virtual double getCurrentFontSizeInherited() const = 0; - /// return xheight of node inherited from parents - virtual double getCurrentXHeightInherited() const = 0; - }; - - enum SvgUnit - { - Unit_em = 0, // relative to current font size - Unit_ex, // relative to current x-height - - Unit_px, // 'user unit' - Unit_pt, // points, 1.25 px - Unit_pc, // 15.0 px - Unit_cm, // 35.43307 px - Unit_mm, // 3.543307 px - Unit_in, // 90 px - - Unit_percent, // relative to range - Unit_none // for stroke-miterlimit, which has no unit - }; - - class SvgNumber - { - private: - double mfNumber; - SvgUnit meUnit; - - /// bitfield - bool mbSet : 1; - - public: - SvgNumber() - : mfNumber(0.0), - meUnit(Unit_px), - mbSet(false) - { - } - - SvgNumber(double fNum, SvgUnit aSvgUnit = Unit_px, bool bSet = true) - : mfNumber(fNum), - meUnit(aSvgUnit), - mbSet(bSet) - { - } - - double getNumber() const - { - return mfNumber; - } - - SvgUnit getUnit() const - { - return meUnit; - } - - bool isSet() const - { - return mbSet; - } - - bool isPositive() const; - - // Only usable in cases, when the unit is not Unit_percent, otherwise use method solve - double solveNonPercentage(const InfoProvider& rInfoProvider) const; - - double solve(const InfoProvider& rInfoProvider, NumberType aNumberType = length) const; - - - }; - - typedef ::std::vector< SvgNumber > SvgNumberVector; - - enum SvgAlign - { - Align_none, - Align_xMinYMin, - Align_xMidYMin, - Align_xMaxYMin, - Align_xMinYMid, - Align_xMidYMid, // default - Align_xMaxYMid, - Align_xMinYMax, - Align_xMidYMax, - Align_xMaxYMax - }; - - class SvgAspectRatio - { - private: - SvgAlign maSvgAlign; - - /// bitfield - bool mbMeetOrSlice : 1; // true = meet (default), false = slice - bool mbSet : 1; - - public: - SvgAspectRatio() - : maSvgAlign(Align_xMidYMid), - mbMeetOrSlice(true), - mbSet(false) - { - } - - SvgAspectRatio(SvgAlign aSvgAlign, bool bMeetOrSlice) - : maSvgAlign(aSvgAlign), - mbMeetOrSlice(bMeetOrSlice), - mbSet(true) - { - } - - /// data read access - SvgAlign getSvgAlign() const { return maSvgAlign; } - bool isMeetOrSlice() const { return mbMeetOrSlice; } - bool isSet() const { return mbSet; } - - /// tooling - static basegfx::B2DHomMatrix createLinearMapping(const basegfx::B2DRange& rTarget, const basegfx::B2DRange& rSource); - basegfx::B2DHomMatrix createMapping(const basegfx::B2DRange& rTarget, const basegfx::B2DRange& rSource) const; - }; - - void skip_char(const OUString& rCandidate, sal_Unicode aChar, sal_Int32& nPos, const sal_Int32 nLen); - void skip_char(const OUString& rCandidate, sal_Unicode aCharA, sal_Unicode nCharB, sal_Int32& nPos, const sal_Int32 nLen); - void copySign(const OUString& rCandidate, sal_Int32& nPos, OUStringBuffer& rTarget, const sal_Int32 nLen); - void copyNumber(const OUString& rCandidate, sal_Int32& nPos, OUStringBuffer& rTarget, const sal_Int32 nLen); - void copyHex(const OUString& rCandidate, sal_Int32& nPos, OUStringBuffer& rTarget, const sal_Int32 nLen); - void copyString(const OUString& rCandidate, sal_Int32& nPos, OUStringBuffer& rTarget, const sal_Int32 nLen); - void copyToLimiter(const OUString& rCandidate, sal_Unicode aLimiter, sal_Int32& nPos, OUStringBuffer& rTarget, const sal_Int32 nLen); - bool readNumber(const OUString& rCandidate, sal_Int32& nPos, double& fNum, const sal_Int32 nLen); - SvgUnit readUnit(const OUString& rCandidate, sal_Int32& nPos, const sal_Int32 nLen); - bool readNumberAndUnit(const OUString& rCandidate, sal_Int32& nPos, SvgNumber& aNum, const sal_Int32 nLen); - bool readAngle(const OUString& rCandidate, sal_Int32& nPos, double& fAngle, const sal_Int32 nLen); - sal_Int32 read_hex(sal_Unicode aChar); - bool match_colorKeyword(basegfx::BColor& rColor, const OUString& rName, bool bCaseIndependent); - bool read_color(const OUString& rCandidate, basegfx::BColor& rColor, bool bCaseIndependent, SvgNumber& rOpacity); - basegfx::B2DRange readViewBox(const OUString& rCandidate, InfoProvider& rInfoProvider); - basegfx::B2DHomMatrix readTransform(const OUString& rCandidate, InfoProvider& rInfoProvider); - bool readSingleNumber(const OUString& rCandidate, SvgNumber& aNum); - bool readLocalUrl(const OUString& rCandidate, OUString& rURL); - bool readSvgPaint(const OUString& rCandidate, SvgPaint& rSvgPaint, OUString& rURL, bool bCaseIndependent, SvgNumber& rOpacity); - - bool readSvgNumberVector(const OUString& rCandidate, SvgNumberVector& rSvgNumberVector); - ::std::vector< double > solveSvgNumberVector(const SvgNumberVector& rInput, const InfoProvider& rInfoProvider); - - SvgAspectRatio readSvgAspectRatio(const OUString& rCandidate); - - typedef ::std::vector< OUString > SvgStringVector; - bool readSvgStringVector(const OUString& rCandidate, SvgStringVector& rSvgStringVector); - - void readImageLink(const OUString& rCandidate, OUString& rXLink, OUString& rUrl, OUString& rMimeType, OUString& rData); - - OUString convert(const OUString& rCandidate, sal_Unicode nPattern, sal_Unicode nNew, bool bRemove); - OUString consolidateContiguousSpace(const OUString& rCandidate); - OUString whiteSpaceHandlingDefault(const OUString& rCandidate); - OUString whiteSpaceHandlingPreserve(const OUString& rCandidate); - - // #125325# removes block comment of the general form '/* ... */', returns - // an adapted string or the original if no comments included - OUString removeBlockComments(const OUString& rCandidate); - - } // end of namespace svgreader -} // end of namespace svgio - -#endif // INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGTOOLS_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgio/svgreader/svgtrefnode.hxx b/svgio/inc/svgio/svgreader/svgtrefnode.hxx deleted file mode 100644 index 2440e88bf267..000000000000 --- a/svgio/inc/svgio/svgreader/svgtrefnode.hxx +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGTREFNODE_HXX -#define INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGTREFNODE_HXX - -#include -#include -#include - -namespace svgio -{ - namespace svgreader - { - class SvgTrefNode : public SvgNode - { - private: - /// use styles - SvgStyleAttributes maSvgStyleAttributes; - - /// link to text content. If maXLink - /// is set, the node can be fetched on demand - OUString maXLink; - - public: - SvgTrefNode( - SvgDocument& rDocument, - SvgNode* pParent); - virtual ~SvgTrefNode(); - - virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; - virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; - - /// access to referenced SvgTextNode - const SvgTextNode* getReferencedSvgTextNode() const; - }; - } // end of namespace svgreader -} // end of namespace svgio - -#endif // INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGTREFNODE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgio/svgreader/svgtspannode.hxx b/svgio/inc/svgio/svgreader/svgtspannode.hxx deleted file mode 100644 index fd906e04f8b3..000000000000 --- a/svgio/inc/svgio/svgreader/svgtspannode.hxx +++ /dev/null @@ -1,59 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGTSPANNODE_HXX -#define INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGTSPANNODE_HXX - -#include -#include -#include - -namespace svgio -{ - namespace svgreader - { - class SvgTspanNode : public SvgNode - { - private: - /// use styles - SvgStyleAttributes maSvgStyleAttributes; - - /// variable scan values, dependent of given XAttributeList - SvgTextPositions maSvgTextPositions; - - public: - SvgTspanNode( - SvgDocument& rDocument, - SvgNode* pParent); - virtual ~SvgTspanNode(); - - virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; - virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; - - virtual double getCurrentFontSize() const override; - - /// access to SvgTextPositions - const SvgTextPositions& getSvgTextPositions() const { return maSvgTextPositions; } - }; - } // end of namespace svgreader -} // end of namespace svgio - -#endif // INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGTSPANNODE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgio/svgreader/svgusenode.hxx b/svgio/inc/svgio/svgreader/svgusenode.hxx deleted file mode 100644 index d235747e5ff4..000000000000 --- a/svgio/inc/svgio/svgreader/svgusenode.hxx +++ /dev/null @@ -1,80 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGUSENODE_HXX -#define INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGUSENODE_HXX - -#include -#include - -namespace svgio -{ - namespace svgreader - { - class SvgUseNode : public SvgNode - { - private: - /// use styles - SvgStyleAttributes maSvgStyleAttributes; - - /// variable scan values, dependent of given XAttributeList - basegfx::B2DHomMatrix* mpaTransform; - SvgNumber maX; - SvgNumber maY; - SvgNumber maWidth; - SvgNumber maHeight; - - /// link to content. If maXLink is set, the node can be fetched - // on demand - OUString maXLink; - - public: - SvgUseNode( - SvgDocument& rDocument, - SvgNode* pParent); - virtual ~SvgUseNode(); - - virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; - virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; - virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const override; - - /// transform content - const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; } - void setTransform(const basegfx::B2DHomMatrix* pMatrix = nullptr) { if(mpaTransform) delete mpaTransform; mpaTransform = nullptr; if(pMatrix) mpaTransform = new basegfx::B2DHomMatrix(*pMatrix); } - - /// x content - const SvgNumber& getX() const { return maX; } - void setX(const SvgNumber& rX = SvgNumber()) { maX = rX; } - - /// y content - const SvgNumber& getY() const { return maY; } - void setY(const SvgNumber& rY = SvgNumber()) { maY = rY; } - - /// width content - void setWidth(const SvgNumber& rWidth = SvgNumber()) { maWidth = rWidth; } - - /// height content - void setHeight(const SvgNumber& rHeight = SvgNumber()) { maHeight = rHeight; } - }; - } // end of namespace svgreader -} // end of namespace svgio - -#endif // INCLUDED_SVGIO_INC_SVGIO_SVGREADER_SVGUSENODE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svglinenode.hxx b/svgio/inc/svglinenode.hxx new file mode 100644 index 000000000000..336c2cd4ca80 --- /dev/null +++ b/svgio/inc/svglinenode.hxx @@ -0,0 +1,78 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVGIO_INC_SVGLINENODE_HXX +#define INCLUDED_SVGIO_INC_SVGLINENODE_HXX + +#include +#include + +namespace svgio +{ + namespace svgreader + { + class SvgLineNode : public SvgNode + { + private: + /// use styles + SvgStyleAttributes maSvgStyleAttributes; + + /// variable scan values, dependent of given XAttributeList + SvgNumber maX1; + SvgNumber maY1; + SvgNumber maX2; + SvgNumber maY2; + basegfx::B2DHomMatrix* mpaTransform; + + public: + SvgLineNode( + SvgDocument& rDocument, + SvgNode* pParent); + virtual ~SvgLineNode(); + + virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; + virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; + virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const override; + + /// X1 content, set if found in current context + const SvgNumber& getX1() const { return maX1; } + void setX1(const SvgNumber& rX1 = SvgNumber()) { maX1 = rX1; } + + /// Y1 content, set if found in current context + const SvgNumber& getY1() const { return maY1; } + void setY1(const SvgNumber& rY1 = SvgNumber()) { maY1 = rY1; } + + /// X2 content, set if found in current context + const SvgNumber& getX2() const { return maX2; } + void setX2(const SvgNumber& rX2 = SvgNumber()) { maX2 = rX2; } + + /// Y2 content, set if found in current context + const SvgNumber& getY2() const { return maY2; } + void setY2(const SvgNumber& rY2 = SvgNumber()) { maY2 = rY2; } + + /// transform content, set if found in current context + const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; } + void setTransform(const basegfx::B2DHomMatrix* pMatrix = nullptr) { if(mpaTransform) delete mpaTransform; mpaTransform = nullptr; if(pMatrix) mpaTransform = new basegfx::B2DHomMatrix(*pMatrix); } + }; + } // end of namespace svgreader +} // end of namespace svgio + +#endif // INCLUDED_SVGIO_INC_SVGLINENODE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgmarkernode.hxx b/svgio/inc/svgmarkernode.hxx new file mode 100644 index 000000000000..aa61806f1a10 --- /dev/null +++ b/svgio/inc/svgmarkernode.hxx @@ -0,0 +1,116 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVGIO_INC_SVGMARKERNODE_HXX +#define INCLUDED_SVGIO_INC_SVGMARKERNODE_HXX + +#include +#include + +namespace svgio +{ + namespace svgreader + { + class SvgMarkerNode : public SvgNode + { + public: + enum MarkerUnits + { + strokeWidth, + userSpaceOnUse + }; + + private: + /// buffered decomposition + drawinglayer::primitive2d::Primitive2DContainer aPrimitives; + + /// use styles + SvgStyleAttributes maSvgStyleAttributes; + + /// variable scan values, dependent of given XAttributeList + basegfx::B2DRange* mpViewBox; + SvgAspectRatio maSvgAspectRatio; + SvgNumber maRefX; + SvgNumber maRefY; + MarkerUnits maMarkerUnits; + SvgNumber maMarkerWidth; + SvgNumber maMarkerHeight; + double mfAngle; + + /// bitfield + bool mbOrientAuto : 1; // true == on, false == fAngle valid + + public: + SvgMarkerNode( + SvgDocument& rDocument, + SvgNode* pParent); + virtual ~SvgMarkerNode(); + + virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; + virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; + + /// get marker primitives buffered, uses decomposeSvgNode internally + const drawinglayer::primitive2d::Primitive2DContainer& getMarkerPrimitives() const; + + /// InfoProvider support for % values + virtual const basegfx::B2DRange getCurrentViewPort() const override; + + /// viewBox content + const basegfx::B2DRange* getViewBox() const { return mpViewBox; } + void setViewBox(const basegfx::B2DRange* pViewBox = nullptr) { if(mpViewBox) delete mpViewBox; mpViewBox = nullptr; if(pViewBox) mpViewBox = new basegfx::B2DRange(*pViewBox); } + + /// SvgAspectRatio content + const SvgAspectRatio& getSvgAspectRatio() const { return maSvgAspectRatio; } + void setSvgAspectRatio(const SvgAspectRatio& rSvgAspectRatio = SvgAspectRatio()) { maSvgAspectRatio = rSvgAspectRatio; } + + /// RefX content, set if found in current context + const SvgNumber& getRefX() const { return maRefX; } + void setRefX(const SvgNumber& rRefX = SvgNumber()) { maRefX = rRefX; } + + /// RefY content, set if found in current context + const SvgNumber& getRefY() const { return maRefY; } + void setRefY(const SvgNumber& rRefY = SvgNumber()) { maRefY = rRefY; } + + /// MarkerUnits content + MarkerUnits getMarkerUnits() const { return maMarkerUnits; } + void setMarkerUnits(const MarkerUnits aMarkerUnits) { maMarkerUnits = aMarkerUnits; } + + /// MarkerWidth content, set if found in current context + const SvgNumber& getMarkerWidth() const { return maMarkerWidth; } + void setMarkerWidth(const SvgNumber& rMarkerWidth = SvgNumber()) { maMarkerWidth = rMarkerWidth; } + + /// MarkerHeight content, set if found in current context + const SvgNumber& getMarkerHeight() const { return maMarkerHeight; } + void setMarkerHeight(const SvgNumber& rMarkerHeight = SvgNumber()) { maMarkerHeight = rMarkerHeight; } + + /// Angle content, set if found in current context + double getAngle() const { return mfAngle; } + void setAngle(double fAngle = 0.0) { mfAngle = fAngle; mbOrientAuto = false; } + + /// OrientAuto content, set if found in current context + bool getOrientAuto() const { return mbOrientAuto; } + void setOrientAuto() { mbOrientAuto = true; } + + }; + } // end of namespace svgreader +} // end of namespace svgio + +#endif // INCLUDED_SVGIO_INC_SVGMARKERNODE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgmasknode.hxx b/svgio/inc/svgmasknode.hxx new file mode 100644 index 000000000000..8e04fffc38f4 --- /dev/null +++ b/svgio/inc/svgmasknode.hxx @@ -0,0 +1,93 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVGIO_INC_SVGMASKNODE_HXX +#define INCLUDED_SVGIO_INC_SVGMASKNODE_HXX + +#include +#include + +namespace svgio +{ + namespace svgreader + { + class SvgMaskNode : public SvgNode + { + private: + /// use styles + SvgStyleAttributes maSvgStyleAttributes; + + /// variable scan values, dependent of given XAttributeList + SvgNumber maX; + SvgNumber maY; + SvgNumber maWidth; + SvgNumber maHeight; + basegfx::B2DHomMatrix* mpaTransform; + SvgUnits maMaskUnits; + SvgUnits maMaskContentUnits; + + public: + SvgMaskNode( + SvgDocument& rDocument, + SvgNode* pParent); + virtual ~SvgMaskNode(); + + virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; + virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; + virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const override; + + /// apply contained clipPath to given geometry #i124852# transform may be needed + void apply( + drawinglayer::primitive2d::Primitive2DContainer& rTarget, + const basegfx::B2DHomMatrix* pTransform) const; + + /// x content, set if found in current context + const SvgNumber& getX() const { return maX; } + void setX(const SvgNumber& rX = SvgNumber()) { maX = rX; } + + /// y content, set if found in current context + const SvgNumber& getY() const { return maY; } + void setY(const SvgNumber& rY = SvgNumber()) { maY = rY; } + + /// width content, set if found in current context + const SvgNumber& getWidth() const { return maWidth; } + void setWidth(const SvgNumber& rWidth = SvgNumber()) { maWidth = rWidth; } + + /// height content, set if found in current context + const SvgNumber& getHeight() const { return maHeight; } + void setHeight(const SvgNumber& rHeight = SvgNumber()) { maHeight = rHeight; } + + /// transform content + const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; } + void setTransform(const basegfx::B2DHomMatrix* pMatrix = nullptr) { if(mpaTransform) delete mpaTransform; mpaTransform = nullptr; if(pMatrix) mpaTransform = new basegfx::B2DHomMatrix(*pMatrix); } + + /// MaskUnits content + SvgUnits getMaskUnits() const { return maMaskUnits; } + void setMaskUnits(const SvgUnits aMaskUnits) { maMaskUnits = aMaskUnits; } + + /// MaskContentUnits content + SvgUnits getMaskContentUnits() const { return maMaskContentUnits; } + void setMaskContentUnits(const SvgUnits aMaskContentUnits) { maMaskContentUnits = aMaskContentUnits; } + }; + } // end of namespace svgreader +} // end of namespace svgio + +#endif // INCLUDED_SVGIO_INC_SVGMASKNODE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgnode.hxx b/svgio/inc/svgnode.hxx new file mode 100644 index 000000000000..9df8419ad6f4 --- /dev/null +++ b/svgio/inc/svgnode.hxx @@ -0,0 +1,190 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVGIO_INC_SVGNODE_HXX +#define INCLUDED_SVGIO_INC_SVGNODE_HXX + +#include +#include +#include +#include +#include +#include + +// predefines +namespace svgio +{ + namespace svgreader + { + class SvgNode; + class SvgDocument; + class SvgStyleAttributes; + } +} + + +namespace svgio +{ + namespace svgreader + { + typedef ::std::vector< SvgNode* > SvgNodeVector; + typedef ::std::vector< const SvgStyleAttributes* > SvgStyleAttributeVector; + + enum XmlSpace + { + XmlSpace_notset, + XmlSpace_default, + XmlSpace_preserve + }; + + // display property (see SVG 1.1. 11.5), not inheritable + enum Display // #i121656# + { + Display_inline, // the default + Display_block, + Display_list_item, + Display_run_in, + Display_compact, + Display_marker, + Display_table, + Display_inline_table, + Display_table_row_group, + Display_table_header_group, + Display_table_footer_group, + Display_table_row, + Display_table_column_group, + Display_table_column, + Display_table_cell, + Display_table_caption, + Display_none, + Display_inherit + }; + + // helper to convert a string associated with a token of type SVGTokenDisplay + // to the enum Display. Empty strings return the default 'Display_inline' with + // which members should be initialized + Display getDisplayFromContent(const OUString& aContent); + + class SvgNode : public InfoProvider + { + private: + /// basic data, Type, document we belong to and parent (if not root) + SVGToken maType; + SvgDocument& mrDocument; + const SvgNode* mpParent; + const SvgNode* mpAlternativeParent; + + /// sub hierarchy + SvgNodeVector maChildren; + + /// Id svan value + OUString* mpId; + + /// Class svan value + OUString* mpClass; + + /// XmlSpace value + XmlSpace maXmlSpace; + + /// Display value #i121656# + Display maDisplay; + + // CSS style vector chain, used in decompose phase and built up once per node. + // It contains the StyleHierarchy for the local node. INdependent from the + // node hierarchy itself which also needs to be used in style entry solving + SvgStyleAttributeVector maCssStyleVector; + + /// possible local CssStyle, e.g. style="fill:red; stroke:red;" + SvgStyleAttributes* mpLocalCssStyle; + + /// bitfield + // flag if maCssStyleVector is already computed (done only once) + bool mbCssStyleVectorBuilt : 1; + + protected: + /// helper to evtl. link to css style + const SvgStyleAttributes* checkForCssStyle(const OUString& rClassStr, const SvgStyleAttributes& rOriginal) const; + + /// helper for filling the CssStyle vector once dependent on mbCssStyleVectorBuilt + void fillCssStyleVector(const OUString& rClassStr, const SvgStyleAttributes& rOriginal); + void fillCssStyleVectorUsingHierarchyAndSelectors( + const OUString& rClassStr, + const SvgNode& rCurrent, + const OUString& aConcatenated); + + public: + SvgNode( + SVGToken aType, + SvgDocument& rDocument, + SvgNode* pParent); + virtual ~SvgNode(); + SvgNode(const SvgNode&) = delete; + SvgNode& operator=(const SvgNode&) = delete; + + /// scan helper to read and interpret a local CssStyle to mpLocalCssStyle + void readLocalCssStyle(const OUString& aContent); + + /// style helpers + void parseAttributes(const css::uno::Reference< css::xml::sax::XAttributeList >& xAttribs); + virtual const SvgStyleAttributes* getSvgStyleAttributes() const; + virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent); + virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const; + + /// #i125258# tell if this node is allowed to have a parent style (e.g. defs do not) + virtual bool supportsParentStyle() const; + + /// basic data read access + SVGToken getType() const { return maType; } + const SvgDocument& getDocument() const { return mrDocument; } + const SvgNode* getParent() const { if(mpAlternativeParent) return mpAlternativeParent; return mpParent; } + const SvgNodeVector& getChildren() const { return maChildren; } + + /// InfoProvider support for %, em and ex values + virtual const basegfx::B2DRange getCurrentViewPort() const override; + virtual double getCurrentFontSizeInherited() const override; + virtual double getCurrentXHeightInherited() const override; + + virtual double getCurrentFontSize() const; + double getCurrentXHeight() const; + + /// Id access + const OUString* getId() const { return mpId; } + void setId(const OUString* pfId = nullptr); + + /// Class access + const OUString* getClass() const { return mpClass; } + void setClass(const OUString* pfClass = nullptr); + + /// XmlSpace access + XmlSpace getXmlSpace() const; + void setXmlSpace(XmlSpace eXmlSpace = XmlSpace_notset) { maXmlSpace = eXmlSpace; } + + /// Display access #i121656# + Display getDisplay() const { return maDisplay; } + void setDisplay(Display eDisplay = Display_inherit) { maDisplay = eDisplay; } + + /// alternative parent + void setAlternativeParent(const SvgNode* pAlternativeParent = nullptr) { mpAlternativeParent = pAlternativeParent; } + }; + } // end of namespace svgreader +} // end of namespace svgio + +#endif // INCLUDED_SVGIO_INC_SVGNODE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgpaint.hxx b/svgio/inc/svgpaint.hxx new file mode 100644 index 000000000000..367f801260fa --- /dev/null +++ b/svgio/inc/svgpaint.hxx @@ -0,0 +1,58 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVGIO_INC_SVGPAINT_HXX +#define INCLUDED_SVGIO_INC_SVGPAINT_HXX + +#include + +namespace svgio +{ + namespace svgreader + { + class SvgPaint + { + private: + basegfx::BColor maColor; + + /// bitfield + bool mbSet : 1; + bool mbOn : 1; + bool mbCurrent : 1; + + public: + SvgPaint(const basegfx::BColor& rColor = basegfx::BColor(0.0, 0.0, 0.0), bool bSet = false, bool bOn = false, bool bCurrent = false) + : maColor(rColor), + mbSet(bSet), + mbOn(bOn), + mbCurrent(bCurrent) + { + } + + const basegfx::BColor& getBColor() const { return maColor; } + bool isSet() const { return mbSet; } + bool isOn() const { return mbOn; } + bool isCurrent() const { return mbCurrent; } + }; + } // end of namespace svgreader +} // end of namespace svgio + +#endif // INCLUDED_SVGIO_INC_SVGPAINT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgpathnode.hxx b/svgio/inc/svgpathnode.hxx new file mode 100644 index 000000000000..2cfa01ca21ab --- /dev/null +++ b/svgio/inc/svgpathnode.hxx @@ -0,0 +1,70 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVGIO_INC_SVGPATHNODE_HXX +#define INCLUDED_SVGIO_INC_SVGPATHNODE_HXX + +#include +#include +#include + +namespace svgio +{ + namespace svgreader + { + class SvgPathNode : public SvgNode + { + private: + /// use styles + SvgStyleAttributes maSvgStyleAttributes; + + /// variable scan values, dependent of given XAttributeList + basegfx::B2DPolyPolygon* mpPolyPolygon; + basegfx::B2DHomMatrix* mpaTransform; + SvgNumber maPathLength; + basegfx::tools::PointIndexSet maHelpPointIndices; + + public: + SvgPathNode( + SvgDocument& rDocument, + SvgNode* pParent); + virtual ~SvgPathNode(); + + virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; + virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; + virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const override; + + /// path content, set if found in current context + const basegfx::B2DPolyPolygon* getPath() const { return mpPolyPolygon; } + void setPath(const basegfx::B2DPolyPolygon* pPath = nullptr) { if(mpPolyPolygon) delete mpPolyPolygon; mpPolyPolygon = nullptr; if(pPath) mpPolyPolygon = new basegfx::B2DPolyPolygon(*pPath); } + + /// transform content, set if found in current context + const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; } + void setTransform(const basegfx::B2DHomMatrix* pMatrix = nullptr) { if(mpaTransform) delete mpaTransform; mpaTransform = nullptr; if(pMatrix) mpaTransform = new basegfx::B2DHomMatrix(*pMatrix); } + + /// PathLength content + const SvgNumber& getPathLength() const { return maPathLength; } + void setPathLength(const SvgNumber& rPathLength = SvgNumber()) { maPathLength = rPathLength; } + }; + } // end of namespace svgreader +} // end of namespace svgio + +#endif // INCLUDED_SVGIO_INC_SVGPATHNODE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgpatternnode.hxx b/svgio/inc/svgpatternnode.hxx new file mode 100644 index 000000000000..cf8165996b8c --- /dev/null +++ b/svgio/inc/svgpatternnode.hxx @@ -0,0 +1,119 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVGIO_INC_SVGPATTERNNODE_HXX +#define INCLUDED_SVGIO_INC_SVGPATTERNNODE_HXX + +#include +#include + +namespace svgio +{ + namespace svgreader + { + class SvgPatternNode : public SvgNode + { + private: + /// buffered decomposition + drawinglayer::primitive2d::Primitive2DContainer aPrimitives; + + /// use styles + SvgStyleAttributes maSvgStyleAttributes; + + /// variable scan values, dependent of given XAttributeList + basegfx::B2DRange* mpViewBox; + SvgAspectRatio maSvgAspectRatio; + SvgNumber maX; + SvgNumber maY; + SvgNumber maWidth; + SvgNumber maHeight; + SvgUnits* mpPatternUnits; + SvgUnits* mpPatternContentUnits; + basegfx::B2DHomMatrix* mpaPatternTransform; + + /// link to another pattern used as style. If maXLink + /// is set, the node can be fetched on demand by using + // tryToFindLink (buffered) + OUString maXLink; + const SvgPatternNode* mpXLink; + + /// link on demand + void tryToFindLink(); + + public: + SvgPatternNode( + SvgDocument& rDocument, + SvgNode* pParent); + virtual ~SvgPatternNode(); + + virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; + virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; + + /// global helpers + void getValuesRelative(double& rfX, double& rfY, double& rfW, double& rfH, const basegfx::B2DRange& rGeoRange, SvgNode& rUser) const; + + /// get pattern primitives buffered, uses decomposeSvgNode internally + const drawinglayer::primitive2d::Primitive2DContainer& getPatternPrimitives() const; + + /// InfoProvider support for % values + virtual const basegfx::B2DRange getCurrentViewPort() const override; + + /// viewBox content + const basegfx::B2DRange* getViewBox() const; + void setViewBox(const basegfx::B2DRange* pViewBox = nullptr) { if(mpViewBox) delete mpViewBox; mpViewBox = nullptr; if(pViewBox) mpViewBox = new basegfx::B2DRange(*pViewBox); } + + /// SvgAspectRatio content + const SvgAspectRatio& getSvgAspectRatio() const; + void setSvgAspectRatio(const SvgAspectRatio& rSvgAspectRatio = SvgAspectRatio()) { maSvgAspectRatio = rSvgAspectRatio; } + + /// X content, set if found in current context + const SvgNumber& getX() const; + void setX(const SvgNumber& rX = SvgNumber()) { maX = rX; } + + /// Y content, set if found in current context + const SvgNumber& getY() const; + void setY(const SvgNumber& rY = SvgNumber()) { maY = rY; } + + /// Width content, set if found in current context + const SvgNumber& getWidth() const; + void setWidth(const SvgNumber& rWidth = SvgNumber()) { maWidth = rWidth; } + + /// Height content, set if found in current context + const SvgNumber& getHeight() const; + void setHeight(const SvgNumber& rHeight = SvgNumber()) { maHeight = rHeight; } + + /// PatternUnits content + const SvgUnits* getPatternUnits() const; + void setPatternUnits(const SvgUnits aPatternUnits) { if(mpPatternUnits) delete mpPatternUnits; mpPatternUnits = nullptr; mpPatternUnits = new SvgUnits(aPatternUnits); } + + /// PatternContentUnits content + const SvgUnits* getPatternContentUnits() const; + void setPatternContentUnits(const SvgUnits aPatternContentUnits) { if(mpPatternContentUnits) delete mpPatternContentUnits; mpPatternContentUnits = nullptr; mpPatternContentUnits = new SvgUnits(aPatternContentUnits); } + + /// PatternTransform content + const basegfx::B2DHomMatrix* getPatternTransform() const; + void setPatternTransform(const basegfx::B2DHomMatrix* pMatrix = nullptr) { if(mpaPatternTransform) delete mpaPatternTransform; mpaPatternTransform = nullptr; if(pMatrix) mpaPatternTransform = new basegfx::B2DHomMatrix(*pMatrix); } + + }; + } // end of namespace svgreader +} // end of namespace svgio + +#endif // INCLUDED_SVGIO_INC_SVGPATTERNNODE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgpolynode.hxx b/svgio/inc/svgpolynode.hxx new file mode 100644 index 000000000000..91340be62d46 --- /dev/null +++ b/svgio/inc/svgpolynode.hxx @@ -0,0 +1,71 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVGIO_INC_SVGPOLYNODE_HXX +#define INCLUDED_SVGIO_INC_SVGPOLYNODE_HXX + +#include +#include +#include + +namespace svgio +{ + namespace svgreader + { + class SvgPolyNode : public SvgNode + { + private: + /// use styles + SvgStyleAttributes maSvgStyleAttributes; + + /// variable scan values, dependent of given XAttributeList + basegfx::B2DPolygon* mpPolygon; + basegfx::B2DHomMatrix* mpaTransform; + + /// bitfield + bool mbIsPolyline : 1; // true = polyline, false = polygon + + public: + SvgPolyNode( + SvgDocument& rDocument, + SvgNode* pParent, + bool bIsPolyline); + virtual ~SvgPolyNode(); + + virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; + virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; + virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const override; + + /// type read access + bool isPolyline() const { return mbIsPolyline; } + + /// Polygon content, set if found in current context + const basegfx::B2DPolygon* getPolygon() const { return mpPolygon; } + void setPolygon(const basegfx::B2DPolygon* pPolygon = nullptr) { if(mpPolygon) delete mpPolygon; mpPolygon = nullptr; if(pPolygon) mpPolygon = new basegfx::B2DPolygon(*pPolygon); } + + /// transform content, set if found in current context + const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; } + void setTransform(const basegfx::B2DHomMatrix* pMatrix = nullptr) { if(mpaTransform) delete mpaTransform; mpaTransform = nullptr; if(pMatrix) mpaTransform = new basegfx::B2DHomMatrix(*pMatrix); } + }; + } // end of namespace svgreader +} // end of namespace svgio + +#endif // INCLUDED_SVGIO_INC_SVGPOLYNODE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgrectnode.hxx b/svgio/inc/svgrectnode.hxx new file mode 100644 index 000000000000..a16f36949b73 --- /dev/null +++ b/svgio/inc/svgrectnode.hxx @@ -0,0 +1,88 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVGIO_INC_SVGRECTNODE_HXX +#define INCLUDED_SVGIO_INC_SVGRECTNODE_HXX + +#include +#include + +namespace svgio +{ + namespace svgreader + { + class SvgRectNode : public SvgNode + { + private: + /// use styles + SvgStyleAttributes maSvgStyleAttributes; + + /// variable scan values, dependent of given XAttributeList + SvgNumber maX; + SvgNumber maY; + SvgNumber maWidth; + SvgNumber maHeight; + SvgNumber maRx; + SvgNumber maRy; + basegfx::B2DHomMatrix* mpaTransform; + + public: + SvgRectNode( + SvgDocument& rDocument, + SvgNode* pParent); + virtual ~SvgRectNode(); + + virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; + virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; + virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const override; + + /// x content, set if found in current context + const SvgNumber& getX() const { return maX; } + void setX(const SvgNumber& rX = SvgNumber()) { maX = rX; } + + /// y content, set if found in current context + const SvgNumber& getY() const { return maY; } + void setY(const SvgNumber& rY = SvgNumber()) { maY = rY; } + + /// width content, set if found in current context + const SvgNumber& getWidth() const { return maWidth; } + void setWidth(const SvgNumber& rWidth = SvgNumber()) { maWidth = rWidth; } + + /// height content, set if found in current context + const SvgNumber& getHeight() const { return maHeight; } + void setHeight(const SvgNumber& rHeight = SvgNumber()) { maHeight = rHeight; } + + /// Rx content, set if found in current context + const SvgNumber& getRx() const { return maRx; } + void setRx(const SvgNumber& rRx = SvgNumber()) { maRx = rRx; } + + /// Ry content, set if found in current context + const SvgNumber& getRy() const { return maRy; } + void setRy(const SvgNumber& rRy = SvgNumber()) { maRy = rRy; } + + /// transform content, set if found in current context + const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; } + void setTransform(const basegfx::B2DHomMatrix* pMatrix = nullptr) { if(mpaTransform) delete mpaTransform; mpaTransform = nullptr; if(pMatrix) mpaTransform = new basegfx::B2DHomMatrix(*pMatrix); } + }; + } // end of namespace svgreader +} // end of namespace svgio + +#endif // INCLUDED_SVGIO_INC_SVGRECTNODE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgstyleattributes.hxx b/svgio/inc/svgstyleattributes.hxx new file mode 100644 index 000000000000..ea9c6c26f4a4 --- /dev/null +++ b/svgio/inc/svgstyleattributes.hxx @@ -0,0 +1,478 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVGIO_INC_SVGSTYLEATTRIBUTES_HXX +#define INCLUDED_SVGIO_INC_SVGSTYLEATTRIBUTES_HXX + +#include +#include +#include +#include + + +// predefines + +namespace svgio { namespace svgreader { + class SvgGradientNode; + class SvgPatternNode; + class SvgMarkerNode; + class SvgClipPathNode; + class SvgMaskNode; +}} + + +namespace svgio +{ + namespace svgreader + { + enum StrokeLinecap + { + StrokeLinecap_notset, + StrokeLinecap_butt, + StrokeLinecap_round, + StrokeLinecap_square + }; + + enum StrokeLinejoin + { + StrokeLinejoin_notset, + StrokeLinejoin_miter, + StrokeLinejoin_round, + StrokeLinejoin_bevel + }; + + enum FontSize + { + FontSize_notset, + FontSize_xx_small, + FontSize_x_small, + FontSize_small, + FontSize_smaller, + FontSize_medium, + FontSize_large, + FontSize_larger, + FontSize_x_large, + FontSize_xx_large, + FontSize_initial + }; + + enum FontStretch + { + FontStretch_notset, + FontStretch_normal, + FontStretch_wider, + FontStretch_narrower, + FontStretch_ultra_condensed, + FontStretch_extra_condensed, + FontStretch_condensed, + FontStretch_semi_condensed, + FontStretch_semi_expanded, + FontStretch_expanded, + FontStretch_extra_expanded, + FontStretch_ultra_expanded + }; + + FontStretch getWider(FontStretch aSource); + FontStretch getNarrower(FontStretch aSource); + + enum FontStyle + { + FontStyle_notset, + FontStyle_normal, + FontStyle_italic, + FontStyle_oblique + }; + + enum FontVariant + { + FontVariant_notset, + FontVariant_normal, + FontVariant_small_caps + }; + + enum FontWeight + { + FontWeight_notset, + FontWeight_100, + FontWeight_200, + FontWeight_300, + FontWeight_400, // same as FontWeight_normal + FontWeight_500, + FontWeight_600, + FontWeight_700, // same as FontWeight_bold + FontWeight_800, + FontWeight_900, + FontWeight_bolder, + FontWeight_lighter, + }; + + FontWeight getBolder(FontWeight aSource); + FontWeight getLighter(FontWeight aSource); + ::FontWeight getVclFontWeight(FontWeight aSource); + + enum TextAlign + { + TextAlign_notset, + TextAlign_left, + TextAlign_right, + TextAlign_center, + TextAlign_justify + }; + + enum TextDecoration + { + TextDecoration_notset, + TextDecoration_none, + TextDecoration_underline, + TextDecoration_overline, + TextDecoration_line_through, + TextDecoration_blink + }; + + enum TextAnchor + { + TextAnchor_notset, + TextAnchor_start, + TextAnchor_middle, + TextAnchor_end + }; + + enum FillRule + { + FillRule_notset, + FillRule_nonzero, + FillRule_evenodd + }; + + enum BaselineShift + { + BaselineShift_Baseline, + BaselineShift_Sub, + BaselineShift_Super, + BaselineShift_Percentage, + BaselineShift_Length + }; + + enum Visibility + { + Visibility_notset, + Visibility_visible, + Visibility_hidden, + Visibility_collapse, + Visibility_inherit + }; + + class SvgStyleAttributes + { + private: + SvgNode& mrOwner; + const SvgStyleAttributes* mpCssStyleParent; + SvgPaint maFill; + SvgPaint maStroke; + SvgPaint maStopColor; + SvgNumber maStrokeWidth; + SvgNumber maStopOpacity; + const SvgGradientNode* mpSvgGradientNodeFill; + const SvgGradientNode* mpSvgGradientNodeStroke; + const SvgPatternNode* mpSvgPatternNodeFill; + const SvgPatternNode* mpSvgPatternNodeStroke; + SvgNumber maFillOpacity; + SvgNumberVector maStrokeDasharray; + SvgNumber maStrokeDashOffset; + StrokeLinecap maStrokeLinecap; + StrokeLinejoin maStrokeLinejoin; + SvgNumber maStrokeMiterLimit; + SvgNumber maStrokeOpacity; + SvgStringVector maFontFamily; + FontSize maFontSize; + SvgNumber maFontSizeNumber; + FontStretch maFontStretch; + FontStyle maFontStyle; + FontVariant maFontVariant; + FontWeight maFontWeight; + TextAlign maTextAlign; + TextDecoration maTextDecoration; + TextAnchor maTextAnchor; + SvgPaint maColor; + SvgNumber maOpacity; + Visibility maVisibility; + OUString maTitle; + OUString maDesc; + + /// link to content. If set, the node can be fetched on demand + OUString maClipPathXLink; + const SvgClipPathNode* mpClipPathXLink; + OUString maMaskXLink; + const SvgMaskNode* mpMaskXLink; + + /// link to markers. If set, the node can be fetched on demand + OUString maMarkerStartXLink; + const SvgMarkerNode* mpMarkerStartXLink; + OUString maMarkerMidXLink; + const SvgMarkerNode* mpMarkerMidXLink; + OUString maMarkerEndXLink; + const SvgMarkerNode* mpMarkerEndXLink; + + /// fill rule + FillRule maFillRule; + + // ClipRule setting (only valid when mbIsClipPathContent == true, default is FillRule_nonzero) + FillRule maClipRule; + + // BaselineShift: Type and number (in case of BaselineShift_Percentage or BaselineShift_Length) + BaselineShift maBaselineShift; + SvgNumber maBaselineShiftNumber; + + /// bitfield + + // defines if this attributes are part of a ClipPath. If yes, + // rough geometry will be created on decomposition by patching + // values for fill, stroke, strokeWidth and others + bool mbIsClipPathContent : 1; + + // #121221# Defines if evtl. an empty array *is* set + bool mbStrokeDasharraySet : 1; + + /// internal helpers + void add_fillGradient( + const basegfx::B2DPolyPolygon& rPath, + drawinglayer::primitive2d::Primitive2DContainer& rTarget, + const SvgGradientNode& rFillGradient, + const basegfx::B2DRange& rGeoRange) const; + void add_fillPatternTransform( + const basegfx::B2DPolyPolygon& rPath, + drawinglayer::primitive2d::Primitive2DContainer& rTarget, + const SvgPatternNode& rFillGradient, + const basegfx::B2DRange& rGeoRange) const; + void add_fillPattern( + const basegfx::B2DPolyPolygon& rPath, + drawinglayer::primitive2d::Primitive2DContainer& rTarget, + const SvgPatternNode& rFillGradient, + const basegfx::B2DRange& rGeoRange) const; + void add_fill( + const basegfx::B2DPolyPolygon& rPath, + drawinglayer::primitive2d::Primitive2DContainer& rTarget, + const basegfx::B2DRange& rGeoRange) const; + void add_stroke( + const basegfx::B2DPolyPolygon& rPath, + drawinglayer::primitive2d::Primitive2DContainer& rTarget, + const basegfx::B2DRange& rGeoRange) const; + bool prepare_singleMarker( + drawinglayer::primitive2d::Primitive2DContainer& rMarkerPrimitives, + basegfx::B2DHomMatrix& rMarkerTransform, + basegfx::B2DRange& rClipRange, + const SvgMarkerNode& rMarker) const; + void add_markers( + const basegfx::B2DPolyPolygon& rPath, + drawinglayer::primitive2d::Primitive2DContainer& rTarget, + const basegfx::tools::PointIndexSet* pHelpPointIndices) const; + + public: + /// local attribute scanner + void parseStyleAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& rContent, + bool bCaseIndependent); + + /// helper which does the necessary with a given path + void add_text( + drawinglayer::primitive2d::Primitive2DContainer& rTarget, + drawinglayer::primitive2d::Primitive2DContainer& rSource) const; + void add_path( + const basegfx::B2DPolyPolygon& rPath, + drawinglayer::primitive2d::Primitive2DContainer& rTarget, + const basegfx::tools::PointIndexSet* pHelpPointIndices) const; + void add_postProcess( + drawinglayer::primitive2d::Primitive2DContainer& rTarget, + const drawinglayer::primitive2d::Primitive2DContainer& rSource, + const basegfx::B2DHomMatrix* pTransform) const; + + /// helper to set mpCssStyleParent temporarily for CSS style hierarchies + void setCssStyleParent(const SvgStyleAttributes* pNew) { mpCssStyleParent = pNew; } + const SvgStyleAttributes* getCssStyleParent() const { return mpCssStyleParent; } + + /// scan helpers + void readCssStyle(const OUString& rCandidate); + const SvgStyleAttributes* getParentStyle() const; + + SvgStyleAttributes(SvgNode& rOwner); + ~SvgStyleAttributes(); + + /// fill content + bool isFillSet() const; // #i125258# ask if fill is a direct hard attribute (no hierarchy) + const basegfx::BColor* getFill() const; + void setFill(const SvgPaint& rFill) { maFill = rFill; } + + /// stroke content + const basegfx::BColor* getStroke() const; + void setStroke(const SvgPaint& rStroke) { maStroke = rStroke; } + + /// stop color content + const basegfx::BColor& getStopColor() const; + void setStopColor(const SvgPaint& rStopColor) { maStopColor = rStopColor; } + + /// stroke-width content + SvgNumber getStrokeWidth() const; + void setStrokeWidth(const SvgNumber& rStrokeWidth = SvgNumber()) { maStrokeWidth = rStrokeWidth; } + + /// stop opacity content + SvgNumber getStopOpacity() const; + void setStopOpacity(const SvgNumber& rStopOpacity = SvgNumber()) { maStopOpacity = rStopOpacity; } + + /// access to evtl. set fill gradient + const SvgGradientNode* getSvgGradientNodeFill() const; + void setSvgGradientNodeFill(const SvgGradientNode* pNew) { mpSvgGradientNodeFill = pNew; } + + /// access to evtl. set fill pattern + const SvgPatternNode* getSvgPatternNodeFill() const; + void setSvgPatternNodeFill(const SvgPatternNode* pNew) { mpSvgPatternNodeFill = pNew; } + + /// access to evtl. set stroke gradient + const SvgGradientNode* getSvgGradientNodeStroke() const; + void setSvgGradientNodeStroke(const SvgGradientNode* pNew) { mpSvgGradientNodeStroke = pNew; } + + /// access to evtl. set stroke pattern + const SvgPatternNode* getSvgPatternNodeStroke() const; + void setSvgPatternNodeStroke(const SvgPatternNode* pNew) { mpSvgPatternNodeStroke = pNew; } + + /// fill opacity content + SvgNumber getFillOpacity() const; + void setFillOpacity(const SvgNumber& rFillOpacity = SvgNumber()) { maFillOpacity = rFillOpacity; } + + /// fill rule content + FillRule getFillRule() const; + + /// fill StrokeDasharray content + const SvgNumberVector& getStrokeDasharray() const; + void setStrokeDasharray(const SvgNumberVector& rStrokeDasharray = SvgNumberVector()) { maStrokeDasharray = rStrokeDasharray; } + + /// #121221# StrokeDasharray needs a set state, it *may* be set to empty by purpose + bool getStrokeDasharraySet() const { return mbStrokeDasharraySet; } + void setStrokeDasharraySet(bool bNew) { mbStrokeDasharraySet = bNew; } + + /// StrokeDashOffset content + SvgNumber getStrokeDashOffset() const; + void setStrokeDashOffset(const SvgNumber& rStrokeDashOffset = SvgNumber()) { maStrokeDashOffset = rStrokeDashOffset; } + + /// StrokeLinecap content + StrokeLinecap getStrokeLinecap() const; + void setStrokeLinecap(const StrokeLinecap aStrokeLinecap = StrokeLinecap_notset) { maStrokeLinecap = aStrokeLinecap; } + + /// StrokeLinejoin content + StrokeLinejoin getStrokeLinejoin() const; + void setStrokeLinejoin(const StrokeLinejoin aStrokeLinejoin = StrokeLinejoin_notset) { maStrokeLinejoin = aStrokeLinejoin; } + + /// StrokeMiterLimit content + SvgNumber getStrokeMiterLimit() const; + void setStrokeMiterLimit(const SvgNumber& rStrokeMiterLimit = SvgNumber(4.0,Unit_none,false)) { maStrokeMiterLimit = rStrokeMiterLimit; } + + /// StrokeOpacity content + SvgNumber getStrokeOpacity() const; + void setStrokeOpacity(const SvgNumber& rStrokeOpacity = SvgNumber()) { maStrokeOpacity = rStrokeOpacity; } + + /// Font content + const SvgStringVector& getFontFamily() const; + void setFontFamily(const SvgStringVector& rSvgStringVector = SvgStringVector()) { maFontFamily = rSvgStringVector; } + + /// FontSize content + void setFontSize(const FontSize aFontSize = FontSize_notset) { maFontSize = aFontSize; } + void setFontSizeNumber(const SvgNumber& rFontSize = SvgNumber()) { maFontSizeNumber = rFontSize; } + SvgNumber getFontSizeNumber() const; + + /// FontStretch content + FontStretch getFontStretch() const; + void setFontStretch(const FontStretch aFontStretch = FontStretch_notset) { maFontStretch = aFontStretch; } + + /// FontStyle content + FontStyle getFontStyle() const; + void setFontStyle(const FontStyle aFontStyle = FontStyle_notset) { maFontStyle = aFontStyle; } + + /// FontVariant content + void setFontVariant(const FontVariant aFontVariant = FontVariant_notset) { maFontVariant = aFontVariant; } + + /// FontWeight content + FontWeight getFontWeight() const; + void setFontWeight(const FontWeight aFontWeight = FontWeight_notset) { maFontWeight = aFontWeight; } + + /// TextAlign content + TextAlign getTextAlign() const; + void setTextAlign(const TextAlign aTextAlign = TextAlign_notset) { maTextAlign = aTextAlign; } + + /// TextDecoration content + const SvgStyleAttributes* getTextDecorationDefiningSvgStyleAttributes() const; + TextDecoration getTextDecoration() const; + void setTextDecoration(const TextDecoration aTextDecoration = TextDecoration_notset) { maTextDecoration = aTextDecoration; } + + /// TextAnchor content + TextAnchor getTextAnchor() const; + void setTextAnchor(const TextAnchor aTextAnchor = TextAnchor_notset) { maTextAnchor = aTextAnchor; } + + /// Color content + const basegfx::BColor* getColor() const; + void setColor(const SvgPaint& rColor) { maColor = rColor; } + + /// Resolve current color (defaults to black if no color is specified) + const basegfx::BColor* getCurrentColor() const; + + /// Opacity content + SvgNumber getOpacity() const; + void setOpacity(const SvgNumber& rOpacity = SvgNumber()) { maOpacity = rOpacity; } + + /// Visibility + Visibility getVisibility() const; + void setVisibility(const Visibility aVisibility = Visibility_notset) { maVisibility = aVisibility; } + + // Title content + const OUString& getTitle() const { return maTitle; } + void setTitle(const OUString& rNew) { maTitle = rNew; } + + // Desc content + const OUString& getDesc() const { return maDesc; } + void setDesc(const OUString& rNew) { maDesc = rNew; } + + // ClipPathXLink content + OUString getClipPathXLink() const; + const SvgClipPathNode* accessClipPathXLink() const; + + // MaskXLink content + OUString getMaskXLink() const; + const SvgMaskNode* accessMaskXLink() const; + + // MarkerStartXLink content + OUString getMarkerStartXLink() const; + const SvgMarkerNode* accessMarkerStartXLink() const; + + // MarkerMidXLink content + OUString getMarkerMidXLink() const; + const SvgMarkerNode* accessMarkerMidXLink() const; + + // MarkerEndXLink content + OUString getMarkerEndXLink() const; + const SvgMarkerNode* accessMarkerEndXLink() const; + + // BaselineShift + void setBaselineShift(const BaselineShift aBaselineShift = BaselineShift_Baseline) { maBaselineShift = aBaselineShift; } + BaselineShift getBaselineShift() const { return maBaselineShift; } + void setBaselineShiftNumber(const SvgNumber& rBaselineShift = SvgNumber()) { maBaselineShiftNumber = rBaselineShift; } + SvgNumber getBaselineShiftNumber() const; + }; + } // end of namespace svgreader +} // end of namespace svgio + +#endif // INCLUDED_SVGIO_INC_SVGSTYLEATTRIBUTES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgstylenode.hxx b/svgio/inc/svgstylenode.hxx new file mode 100644 index 000000000000..86809e23f394 --- /dev/null +++ b/svgio/inc/svgstylenode.hxx @@ -0,0 +1,64 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVGIO_INC_SVGSTYLENODE_HXX +#define INCLUDED_SVGIO_INC_SVGSTYLENODE_HXX + +#include +#include + +namespace svgio +{ + namespace svgreader + { + class SvgStyleNode : public SvgNode + { + private: + /// use styles + std::vector< SvgStyleAttributes* > maSvgStyleAttributes; + + /// bitfield + bool mbTextCss : 1; // true == type is 'text/css' + + public: + SvgStyleNode( + SvgDocument& rDocument, + SvgNode* pParent); + virtual ~SvgStyleNode(); + + /// #i125258# tell if this node is allowed to have a parent style (e.g. defs do not) + virtual bool supportsParentStyle() const override; + + virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; + + /// CssStyleSheet add helpers + void addCssStyleSheet(const OUString& aSelectors, const SvgStyleAttributes& rNewStyle); + void addCssStyleSheet(const OUString& aSelectors, const OUString& aContent); + void addCssStyleSheet(const OUString& aSelectorsAndContent); + + /// textCss access + bool isTextCss() const { return mbTextCss; } + void setTextCss(bool bNew) { mbTextCss = bNew; } + }; + } // end of namespace svgreader +} // end of namespace svgio + +#endif // INCLUDED_SVGIO_INC_SVGSTYLENODE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgsvgnode.hxx b/svgio/inc/svgsvgnode.hxx new file mode 100644 index 000000000000..a256971b8719 --- /dev/null +++ b/svgio/inc/svgsvgnode.hxx @@ -0,0 +1,104 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVGIO_INC_SVGSVGNODE_HXX +#define INCLUDED_SVGIO_INC_SVGSVGNODE_HXX + +#include + +namespace svgio +{ + namespace svgreader + { + class SvgSvgNode : public SvgNode + { + private: + /// use styles + SvgStyleAttributes maSvgStyleAttributes; + + /// variable scan values, dependent of given XAttributeList + basegfx::B2DRange* mpViewBox; + SvgAspectRatio maSvgAspectRatio; + SvgNumber maX; + SvgNumber maY; + SvgNumber maWidth; + SvgNumber maHeight; + SvgNumber maVersion; + + /// #i125258# bitfield + bool mbStyleAttributesInitialized : 1; + + // #i125258# on-demand init hard attributes when this is the outmost svg element + // and more (see implementation) + void initializeStyleAttributes(); + + public: + SvgSvgNode( + SvgDocument& rDocument, + SvgNode* pParent); + virtual ~SvgSvgNode(); + + virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; + virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; + virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const override; + + /// Seeks width and height of viewport, which is current before the new viewport is set. + // needed for percentage unit in x, y, width or height + void seekReferenceWidth(double& fWidth, bool& bHasFound) const; + void seekReferenceHeight(double& fHeight, bool& bHasFound) const; + + /// InfoProvider support for % values in children + // The returned 'CurrentViewPort' is the viewport as it is set by this svg element + // and as it is needed to resolve relative values in children + // The method does not check for invalid width and height + virtual const basegfx::B2DRange getCurrentViewPort() const override; + + /// viewBox content + const basegfx::B2DRange* getViewBox() const { return mpViewBox; } + void setViewBox(const basegfx::B2DRange* pViewBox = nullptr) { if(mpViewBox) delete mpViewBox; mpViewBox = nullptr; if(pViewBox) mpViewBox = new basegfx::B2DRange(*pViewBox); } + + /// SvgAspectRatio content + const SvgAspectRatio& getSvgAspectRatio() const { return maSvgAspectRatio; } + void setSvgAspectRatio(const SvgAspectRatio& rSvgAspectRatio = SvgAspectRatio()) { maSvgAspectRatio = rSvgAspectRatio; } + + /// x content + const SvgNumber& getX() const { return maX; } + void setX(const SvgNumber& rX = SvgNumber()) { maX = rX; } + + /// y content + const SvgNumber& getY() const { return maY; } + void setY(const SvgNumber& rY = SvgNumber()) { maY = rY; } + + /// width content + const SvgNumber& getWidth() const { return maWidth; } + void setWidth(const SvgNumber& rWidth = SvgNumber()) { maWidth = rWidth; } + + /// height content + const SvgNumber& getHeight() const { return maHeight; } + void setHeight(const SvgNumber& rHeight = SvgNumber()) { maHeight = rHeight; } + + /// version content + void setVersion(const SvgNumber& rVersion = SvgNumber()) { maVersion = rVersion; } + }; + } // end of namespace svgreader +} // end of namespace svgio + +#endif // INCLUDED_SVGIO_INC_SVGSVGNODE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgsymbolnode.hxx b/svgio/inc/svgsymbolnode.hxx new file mode 100644 index 000000000000..1ec961673ada --- /dev/null +++ b/svgio/inc/svgsymbolnode.hxx @@ -0,0 +1,59 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVGIO_INC_SVGSYMBOLNODE_HXX +#define INCLUDED_SVGIO_INC_SVGSYMBOLNODE_HXX + +#include + +namespace svgio +{ + namespace svgreader + { + class SvgSymbolNode : public SvgNode + { + private: + /// use styles + SvgStyleAttributes maSvgStyleAttributes; + + /// variable scan values, dependent of given XAttributeList + basegfx::B2DRange* mpViewBox; + SvgAspectRatio maSvgAspectRatio; + + public: + SvgSymbolNode( + SvgDocument& rDocument, + SvgNode* pParent); + virtual ~SvgSymbolNode(); + + virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; + virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; + + /// viewBox content + void setViewBox(const basegfx::B2DRange* pViewBox = nullptr) { if(mpViewBox) delete mpViewBox; mpViewBox = nullptr; if(pViewBox) mpViewBox = new basegfx::B2DRange(*pViewBox); } + + /// SvgAspectRatio content + void setSvgAspectRatio(const SvgAspectRatio& rSvgAspectRatio = SvgAspectRatio()) { maSvgAspectRatio = rSvgAspectRatio; } + }; + } // end of namespace svgreader +} // end of namespace svgio + +#endif // INCLUDED_SVGIO_INC_SVGSYMBOLNODE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgtextnode.hxx b/svgio/inc/svgtextnode.hxx new file mode 100644 index 000000000000..bea1fde1c328 --- /dev/null +++ b/svgio/inc/svgtextnode.hxx @@ -0,0 +1,75 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVGIO_INC_SVGTEXTNODE_HXX +#define INCLUDED_SVGIO_INC_SVGTEXTNODE_HXX + +#include +#include +#include + +namespace svgio +{ + namespace svgreader + { + class SvgTextNode : public SvgNode + { + private: + /// use styles + SvgStyleAttributes maSvgStyleAttributes; + + /// variable scan values, dependent of given XAttributeList + basegfx::B2DHomMatrix* mpaTransform; + SvgTextPositions maSvgTextPositions; + + /// local helpers + void DecomposeChild( + const SvgNode& rCandidate, + drawinglayer::primitive2d::Primitive2DContainer& rTarget, + SvgTextPosition& rSvgTextPosition) const; + static void addTextPrimitives( + const SvgNode& rCandidate, + drawinglayer::primitive2d::Primitive2DContainer& rTarget, + drawinglayer::primitive2d::Primitive2DContainer& rSource); + + public: + SvgTextNode( + SvgDocument& rDocument, + SvgNode* pParent); + virtual ~SvgTextNode(); + + virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; + virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; + virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const override; + + virtual double getCurrentFontSize() const override; + + /// transform content, set if found in current context + const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; } + void setTransform(const basegfx::B2DHomMatrix* pMatrix = nullptr) { if(mpaTransform) delete mpaTransform; mpaTransform = nullptr; if(pMatrix) mpaTransform = new basegfx::B2DHomMatrix(*pMatrix); } + + /// access to SvgTextPositions + const SvgTextPositions& getSvgTextPositions() const { return maSvgTextPositions; } + }; + } // end of namespace svgreader +} // end of namespace svgio + +#endif // INCLUDED_SVGIO_INC_SVGTEXTNODE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgtextpathnode.hxx b/svgio/inc/svgtextpathnode.hxx new file mode 100644 index 000000000000..33c0e0a87d03 --- /dev/null +++ b/svgio/inc/svgtextpathnode.hxx @@ -0,0 +1,77 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVGIO_INC_SVGTEXTPATHNODE_HXX +#define INCLUDED_SVGIO_INC_SVGTEXTPATHNODE_HXX + +#include +#include +#include + +namespace svgio +{ + namespace svgreader + { + class SvgTextPathNode : public SvgNode + { + private: + /// use styles + SvgStyleAttributes maSvgStyleAttributes; + + /// link to path content. If maXLink + /// is set, the node can be fetched on demand + OUString maXLink; + + /// variable scan values, dependent of given XAttributeList + SvgNumber maStartOffset; + + /// bitfield + bool mbMethod : 1; // true = align, false = stretch + bool mbSpacing : 1; // true = auto, false = exact + + public: + SvgTextPathNode( + SvgDocument& rDocument, + SvgNode* pParent); + virtual ~SvgTextPathNode(); + + virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; + virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; + void decomposePathNode( + const drawinglayer::primitive2d::Primitive2DContainer& rPathContent, + drawinglayer::primitive2d::Primitive2DContainer& rTarget, + const basegfx::B2DPoint& rTextStart) const; + bool isValid() const; + + /// StartOffset content + const SvgNumber& getStartOffset() const { return maStartOffset; } + void setStartOffset(const SvgNumber& rStartOffset = SvgNumber()) { maStartOffset = rStartOffset; } + + /// Method content + void setMethod(bool bNew) { mbMethod = bNew; } + + /// Spacing content + void setSpacing(bool bNew) { mbSpacing = bNew; } + }; + } // end of namespace svgreader +} // end of namespace svgio + +#endif // INCLUDED_SVGIO_INC_SVGTEXTPATHNODE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgtitledescnode.hxx b/svgio/inc/svgtitledescnode.hxx new file mode 100644 index 000000000000..c58b694317af --- /dev/null +++ b/svgio/inc/svgtitledescnode.hxx @@ -0,0 +1,54 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVGIO_INC_SVGTITLEDESCNODE_HXX +#define INCLUDED_SVGIO_INC_SVGTITLEDESCNODE_HXX + +#include + + +namespace svgio +{ + namespace svgreader + { + class SvgTitleDescNode : public SvgNode + { + private: + /// contained chars + OUString maText; + + public: + SvgTitleDescNode( + SVGToken aType, + SvgDocument& rDocument, + SvgNode* pParent); + virtual ~SvgTitleDescNode(); + + /// add new chars + void concatenate(const OUString& rChars); + + /// x content, set if found in current context + const OUString& getText() const { return maText; } + }; + } // end of namespace svgreader +} // end of namespace svgio + + +#endif // INCLUDED_SVGIO_INC_SVGTITLEDESCNODE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgtoken.hxx b/svgio/inc/svgtoken.hxx new file mode 100644 index 000000000000..714e3807a910 --- /dev/null +++ b/svgio/inc/svgtoken.hxx @@ -0,0 +1,196 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVGIO_INC_SVGTOKEN_HXX +#define INCLUDED_SVGIO_INC_SVGTOKEN_HXX + +#include + +namespace svgio +{ + namespace svgreader + { + // SVG token mapper with hashing + enum SVGToken + { + SVGTokenUnknown = 0, + + // diverse attribute tokens + SVGTokenWidth, + SVGTokenHeight, + SVGTokenViewBox, + SVGTokenTransform, + SVGTokenStyle, + SVGTokenDisplay, // #i121656# + SVGTokenD, + SVGTokenX, + SVGTokenY, + SVGTokenXmlns, + SVGTokenVersion, + SVGTokenId, + SVGTokenRx, + SVGTokenRy, + SVGTokenPoints, + SVGTokenDx, + SVGTokenDy, + SVGTokenRotate, + SVGTokenTextLength, + SVGTokenLengthAdjust, + SVGTokenFont, + SVGTokenFontFamily, + SVGTokenFontSize, + SVGTokenFontSizeAdjust, + SVGTokenFontStretch, + SVGTokenFontStyle, + SVGTokenFontVariant, + SVGTokenFontWeight, + SVGTokenDirection, + SVGTokenLetterSpacing, + SVGTokenTextDecoration, + SVGTokenUnicodeBidi, + SVGTokenWordSpacing, + SVGTokenCharacter, // not in the hash, just for simple text handling in SvgCharacterNode + SVGTokenTspan, + SVGTokenTref, + SVGTokenTextPath, + SVGTokenStartOffset, + SVGTokenMethod, + SVGTokenSpacing, + SVGTokenTextAlign, + SVGTokenPathLength, + SVGTokenType, + SVGTokenClass, + SVGTokenTextAnchor, + SVGTokenXmlSpace, + SVGTokenColor, + SVGTokenClipPathNode, + SVGTokenClipPathProperty, + SVGTokenMask, + SVGTokenClipPathUnits, + SVGTokenMaskUnits, + SVGTokenMaskContentUnits, + SVGTokenClipRule, + SVGTokenMarker, + SVGTokenMarkerStart, + SVGTokenMarkerMid, + SVGTokenMarkerEnd, + SVGTokenRefX, + SVGTokenRefY, + SVGTokenMarkerUnits, + SVGTokenMarkerWidth, + SVGTokenMarkerHeight, + SVGTokenOrient, + SVGTokenPattern, + SVGTokenPatternUnits, + SVGTokenPatternContentUnits, + SVGTokenPatternTransform, + SVGTokenOpacity, + SVGTokenVisibility, + SVGTokenTitle, + SVGTokenDesc, + + // AspectRatio and params + SVGTokenPreserveAspectRatio, + SVGTokenDefer, + SVGTokenNone, + SVGTokenXMinYMin, + SVGTokenXMidYMin, + SVGTokenXMaxYMin, + SVGTokenXMinYMid, + SVGTokenXMidYMid, + SVGTokenXMaxYMid, + SVGTokenXMinYMax, + SVGTokenXMidYMax, + SVGTokenXMaxYMax, + SVGTokenMeet, + SVGTokenSlice, + + // structural elements + SVGTokenDefs, + SVGTokenG, + SVGTokenSvg, + SVGTokenSymbol, + SVGTokenUse, + SVGTokenA, + + // shape elements + SVGTokenCircle, + SVGTokenEllipse, + SVGTokenLine, + SVGTokenPath, + SVGTokenPolygon, + SVGTokenPolyline, + SVGTokenRect, + SVGTokenImage, + + // gradient elements and tokens + SVGTokenLinearGradient, + SVGTokenRadialGradient, + SVGTokenStop, + SVGTokenOffset, + SVGTokenX1, + SVGTokenY1, + SVGTokenX2, + SVGTokenY2, + SVGTokenCx, + SVGTokenCy, + SVGTokenFx, + SVGTokenFy, + SVGTokenR, + SVGTokenGradientUnits, + SVGTokenGradientTransform, + SVGTokenSpreadMethod, + SVGTokenXlinkHref, + SVGTokenStopColor, + SVGTokenStopOpacity, + + // fill tokens + SVGTokenFill, + SVGTokenFillOpacity, + SVGTokenFillRule, + + // stroke tokens + SVGTokenStroke, + SVGTokenStrokeDasharray, + SVGTokenStrokeDashoffset, + SVGTokenStrokeLinecap, + SVGTokenStrokeLinejoin, + SVGTokenStrokeMiterlimit, + SVGTokenStrokeOpacity, + SVGTokenStrokeWidth, + + // text tokens + SVGTokenText, + SVGTokenBaselineShift, + + SVGTokenFlowRoot, + + SVGTokenLast + }; + + SVGToken StrToSVGToken(const OUString& rStr, bool bCaseIndependent); + + const OUString getStrTitle(); + const OUString getStrDesc(); + } // end of namespace svgreader +} // end of namespace svgio + +#endif // INCLUDED_SVGIO_INC_SVGTOKEN_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgtools.hxx b/svgio/inc/svgtools.hxx new file mode 100644 index 000000000000..c00f0784c481 --- /dev/null +++ b/svgio/inc/svgtools.hxx @@ -0,0 +1,233 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVGIO_INC_SVGTOOLS_HXX +#define INCLUDED_SVGIO_INC_SVGTOOLS_HXX + +#include +#include +#include +#include +#include + +namespace svgio +{ + namespace svgreader + { +#ifdef DBG_UTIL + // error helper + void myAssert(const OUString& rMessage); +#endif + +// recommended value for this device dependent unit, see CSS2 section 4.3.2 Lengths +#define F_SVG_PIXEL_PER_INCH 96.0 + + // common non-token strings + struct commonStrings + { + static const OUString aStrUserSpaceOnUse; + static const OUString aStrObjectBoundingBox; + static const OUString aStrNonzero; + static const OUString aStrEvenOdd; + }; + + enum SvgUnits + { + userSpaceOnUse, + objectBoundingBox + }; + + enum NumberType + { + xcoordinate, + ycoordinate, + length + }; + + class InfoProvider + { + public: + virtual ~InfoProvider() {} + virtual const basegfx::B2DRange getCurrentViewPort() const = 0; + /// return font size of node inherited from parents + virtual double getCurrentFontSizeInherited() const = 0; + /// return xheight of node inherited from parents + virtual double getCurrentXHeightInherited() const = 0; + }; + + enum SvgUnit + { + Unit_em = 0, // relative to current font size + Unit_ex, // relative to current x-height + + Unit_px, // 'user unit' + Unit_pt, // points, 1.25 px + Unit_pc, // 15.0 px + Unit_cm, // 35.43307 px + Unit_mm, // 3.543307 px + Unit_in, // 90 px + + Unit_percent, // relative to range + Unit_none // for stroke-miterlimit, which has no unit + }; + + class SvgNumber + { + private: + double mfNumber; + SvgUnit meUnit; + + /// bitfield + bool mbSet : 1; + + public: + SvgNumber() + : mfNumber(0.0), + meUnit(Unit_px), + mbSet(false) + { + } + + SvgNumber(double fNum, SvgUnit aSvgUnit = Unit_px, bool bSet = true) + : mfNumber(fNum), + meUnit(aSvgUnit), + mbSet(bSet) + { + } + + double getNumber() const + { + return mfNumber; + } + + SvgUnit getUnit() const + { + return meUnit; + } + + bool isSet() const + { + return mbSet; + } + + bool isPositive() const; + + // Only usable in cases, when the unit is not Unit_percent, otherwise use method solve + double solveNonPercentage(const InfoProvider& rInfoProvider) const; + + double solve(const InfoProvider& rInfoProvider, NumberType aNumberType = length) const; + + + }; + + typedef ::std::vector< SvgNumber > SvgNumberVector; + + enum SvgAlign + { + Align_none, + Align_xMinYMin, + Align_xMidYMin, + Align_xMaxYMin, + Align_xMinYMid, + Align_xMidYMid, // default + Align_xMaxYMid, + Align_xMinYMax, + Align_xMidYMax, + Align_xMaxYMax + }; + + class SvgAspectRatio + { + private: + SvgAlign maSvgAlign; + + /// bitfield + bool mbMeetOrSlice : 1; // true = meet (default), false = slice + bool mbSet : 1; + + public: + SvgAspectRatio() + : maSvgAlign(Align_xMidYMid), + mbMeetOrSlice(true), + mbSet(false) + { + } + + SvgAspectRatio(SvgAlign aSvgAlign, bool bMeetOrSlice) + : maSvgAlign(aSvgAlign), + mbMeetOrSlice(bMeetOrSlice), + mbSet(true) + { + } + + /// data read access + SvgAlign getSvgAlign() const { return maSvgAlign; } + bool isMeetOrSlice() const { return mbMeetOrSlice; } + bool isSet() const { return mbSet; } + + /// tooling + static basegfx::B2DHomMatrix createLinearMapping(const basegfx::B2DRange& rTarget, const basegfx::B2DRange& rSource); + basegfx::B2DHomMatrix createMapping(const basegfx::B2DRange& rTarget, const basegfx::B2DRange& rSource) const; + }; + + void skip_char(const OUString& rCandidate, sal_Unicode aChar, sal_Int32& nPos, const sal_Int32 nLen); + void skip_char(const OUString& rCandidate, sal_Unicode aCharA, sal_Unicode nCharB, sal_Int32& nPos, const sal_Int32 nLen); + void copySign(const OUString& rCandidate, sal_Int32& nPos, OUStringBuffer& rTarget, const sal_Int32 nLen); + void copyNumber(const OUString& rCandidate, sal_Int32& nPos, OUStringBuffer& rTarget, const sal_Int32 nLen); + void copyHex(const OUString& rCandidate, sal_Int32& nPos, OUStringBuffer& rTarget, const sal_Int32 nLen); + void copyString(const OUString& rCandidate, sal_Int32& nPos, OUStringBuffer& rTarget, const sal_Int32 nLen); + void copyToLimiter(const OUString& rCandidate, sal_Unicode aLimiter, sal_Int32& nPos, OUStringBuffer& rTarget, const sal_Int32 nLen); + bool readNumber(const OUString& rCandidate, sal_Int32& nPos, double& fNum, const sal_Int32 nLen); + SvgUnit readUnit(const OUString& rCandidate, sal_Int32& nPos, const sal_Int32 nLen); + bool readNumberAndUnit(const OUString& rCandidate, sal_Int32& nPos, SvgNumber& aNum, const sal_Int32 nLen); + bool readAngle(const OUString& rCandidate, sal_Int32& nPos, double& fAngle, const sal_Int32 nLen); + sal_Int32 read_hex(sal_Unicode aChar); + bool match_colorKeyword(basegfx::BColor& rColor, const OUString& rName, bool bCaseIndependent); + bool read_color(const OUString& rCandidate, basegfx::BColor& rColor, bool bCaseIndependent, SvgNumber& rOpacity); + basegfx::B2DRange readViewBox(const OUString& rCandidate, InfoProvider& rInfoProvider); + basegfx::B2DHomMatrix readTransform(const OUString& rCandidate, InfoProvider& rInfoProvider); + bool readSingleNumber(const OUString& rCandidate, SvgNumber& aNum); + bool readLocalUrl(const OUString& rCandidate, OUString& rURL); + bool readSvgPaint(const OUString& rCandidate, SvgPaint& rSvgPaint, OUString& rURL, bool bCaseIndependent, SvgNumber& rOpacity); + + bool readSvgNumberVector(const OUString& rCandidate, SvgNumberVector& rSvgNumberVector); + ::std::vector< double > solveSvgNumberVector(const SvgNumberVector& rInput, const InfoProvider& rInfoProvider); + + SvgAspectRatio readSvgAspectRatio(const OUString& rCandidate); + + typedef ::std::vector< OUString > SvgStringVector; + bool readSvgStringVector(const OUString& rCandidate, SvgStringVector& rSvgStringVector); + + void readImageLink(const OUString& rCandidate, OUString& rXLink, OUString& rUrl, OUString& rMimeType, OUString& rData); + + OUString convert(const OUString& rCandidate, sal_Unicode nPattern, sal_Unicode nNew, bool bRemove); + OUString consolidateContiguousSpace(const OUString& rCandidate); + OUString whiteSpaceHandlingDefault(const OUString& rCandidate); + OUString whiteSpaceHandlingPreserve(const OUString& rCandidate); + + // #125325# removes block comment of the general form '/* ... */', returns + // an adapted string or the original if no comments included + OUString removeBlockComments(const OUString& rCandidate); + + } // end of namespace svgreader +} // end of namespace svgio + +#endif // INCLUDED_SVGIO_INC_SVGTOOLS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgtrefnode.hxx b/svgio/inc/svgtrefnode.hxx new file mode 100644 index 000000000000..e372887e6496 --- /dev/null +++ b/svgio/inc/svgtrefnode.hxx @@ -0,0 +1,58 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVGIO_INC_SVGTREFNODE_HXX +#define INCLUDED_SVGIO_INC_SVGTREFNODE_HXX + +#include +#include +#include + +namespace svgio +{ + namespace svgreader + { + class SvgTrefNode : public SvgNode + { + private: + /// use styles + SvgStyleAttributes maSvgStyleAttributes; + + /// link to text content. If maXLink + /// is set, the node can be fetched on demand + OUString maXLink; + + public: + SvgTrefNode( + SvgDocument& rDocument, + SvgNode* pParent); + virtual ~SvgTrefNode(); + + virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; + virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; + + /// access to referenced SvgTextNode + const SvgTextNode* getReferencedSvgTextNode() const; + }; + } // end of namespace svgreader +} // end of namespace svgio + +#endif // INCLUDED_SVGIO_INC_SVGTREFNODE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgtspannode.hxx b/svgio/inc/svgtspannode.hxx new file mode 100644 index 000000000000..1d982b15ef1b --- /dev/null +++ b/svgio/inc/svgtspannode.hxx @@ -0,0 +1,59 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVGIO_INC_SVGTSPANNODE_HXX +#define INCLUDED_SVGIO_INC_SVGTSPANNODE_HXX + +#include +#include +#include + +namespace svgio +{ + namespace svgreader + { + class SvgTspanNode : public SvgNode + { + private: + /// use styles + SvgStyleAttributes maSvgStyleAttributes; + + /// variable scan values, dependent of given XAttributeList + SvgTextPositions maSvgTextPositions; + + public: + SvgTspanNode( + SvgDocument& rDocument, + SvgNode* pParent); + virtual ~SvgTspanNode(); + + virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; + virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; + + virtual double getCurrentFontSize() const override; + + /// access to SvgTextPositions + const SvgTextPositions& getSvgTextPositions() const { return maSvgTextPositions; } + }; + } // end of namespace svgreader +} // end of namespace svgio + +#endif // INCLUDED_SVGIO_INC_SVGTSPANNODE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/inc/svgusenode.hxx b/svgio/inc/svgusenode.hxx new file mode 100644 index 000000000000..3807f6f121c2 --- /dev/null +++ b/svgio/inc/svgusenode.hxx @@ -0,0 +1,80 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVGIO_INC_SVGUSENODE_HXX +#define INCLUDED_SVGIO_INC_SVGUSENODE_HXX + +#include +#include + +namespace svgio +{ + namespace svgreader + { + class SvgUseNode : public SvgNode + { + private: + /// use styles + SvgStyleAttributes maSvgStyleAttributes; + + /// variable scan values, dependent of given XAttributeList + basegfx::B2DHomMatrix* mpaTransform; + SvgNumber maX; + SvgNumber maY; + SvgNumber maWidth; + SvgNumber maHeight; + + /// link to content. If maXLink is set, the node can be fetched + // on demand + OUString maXLink; + + public: + SvgUseNode( + SvgDocument& rDocument, + SvgNode* pParent); + virtual ~SvgUseNode(); + + virtual const SvgStyleAttributes* getSvgStyleAttributes() const override; + virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; + virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const override; + + /// transform content + const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; } + void setTransform(const basegfx::B2DHomMatrix* pMatrix = nullptr) { if(mpaTransform) delete mpaTransform; mpaTransform = nullptr; if(pMatrix) mpaTransform = new basegfx::B2DHomMatrix(*pMatrix); } + + /// x content + const SvgNumber& getX() const { return maX; } + void setX(const SvgNumber& rX = SvgNumber()) { maX = rX; } + + /// y content + const SvgNumber& getY() const { return maY; } + void setY(const SvgNumber& rY = SvgNumber()) { maY = rY; } + + /// width content + void setWidth(const SvgNumber& rWidth = SvgNumber()) { maWidth = rWidth; } + + /// height content + void setHeight(const SvgNumber& rHeight = SvgNumber()) { maHeight = rHeight; } + }; + } // end of namespace svgreader +} // end of namespace svgio + +#endif // INCLUDED_SVGIO_INC_SVGUSENODE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/source/svgreader/svganode.cxx b/svgio/source/svgreader/svganode.cxx index 70c53d5c0a6f..9efa57331c27 100644 --- a/svgio/source/svgreader/svganode.cxx +++ b/svgio/source/svgreader/svganode.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include diff --git a/svgio/source/svgreader/svgcharacternode.cxx b/svgio/source/svgreader/svgcharacternode.cxx index 29fd2561200c..1753f2dd4c6c 100644 --- a/svgio/source/svgreader/svgcharacternode.cxx +++ b/svgio/source/svgreader/svgcharacternode.cxx @@ -17,8 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include +#include +#include #include #include #include diff --git a/svgio/source/svgreader/svgcirclenode.cxx b/svgio/source/svgreader/svgcirclenode.cxx index 3ac0d0b93cf4..2bbbffb7d7f4 100644 --- a/svgio/source/svgreader/svgcirclenode.cxx +++ b/svgio/source/svgreader/svgcirclenode.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include diff --git a/svgio/source/svgreader/svgclippathnode.cxx b/svgio/source/svgreader/svgclippathnode.cxx index ada214bc8360..dc607c7e627e 100644 --- a/svgio/source/svgreader/svgclippathnode.cxx +++ b/svgio/source/svgreader/svgclippathnode.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include #include diff --git a/svgio/source/svgreader/svgdocument.cxx b/svgio/source/svgreader/svgdocument.cxx index 28b69a1de8a8..227ad4ae40d6 100644 --- a/svgio/source/svgreader/svgdocument.cxx +++ b/svgio/source/svgreader/svgdocument.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include namespace svgio { diff --git a/svgio/source/svgreader/svgdocumenthandler.cxx b/svgio/source/svgreader/svgdocumenthandler.cxx index e53471d59839..977b54d3b03f 100644 --- a/svgio/source/svgreader/svgdocumenthandler.cxx +++ b/svgio/source/svgreader/svgdocumenthandler.cxx @@ -17,34 +17,34 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include using namespace com::sun::star; diff --git a/svgio/source/svgreader/svgellipsenode.cxx b/svgio/source/svgreader/svgellipsenode.cxx index 2f0b12df1565..9fab41512a1e 100644 --- a/svgio/source/svgreader/svgellipsenode.cxx +++ b/svgio/source/svgreader/svgellipsenode.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include diff --git a/svgio/source/svgreader/svggnode.cxx b/svgio/source/svgreader/svggnode.cxx index 2f553786606d..c3ae8ca75c1e 100644 --- a/svgio/source/svgreader/svggnode.cxx +++ b/svgio/source/svgreader/svggnode.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include diff --git a/svgio/source/svgreader/svggradientnode.cxx b/svgio/source/svgreader/svggradientnode.cxx index 6f2560dcfa50..8137ac3fe50d 100644 --- a/svgio/source/svgreader/svggradientnode.cxx +++ b/svgio/source/svgreader/svggradientnode.cxx @@ -17,9 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include -#include +#include +#include +#include namespace svgio { diff --git a/svgio/source/svgreader/svggradientstopnode.cxx b/svgio/source/svgreader/svggradientstopnode.cxx index 506fd13ae4ff..f2f10d8019aa 100644 --- a/svgio/source/svgreader/svggradientstopnode.cxx +++ b/svgio/source/svgreader/svggradientstopnode.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include namespace svgio { diff --git a/svgio/source/svgreader/svgimagenode.cxx b/svgio/source/svgreader/svgimagenode.cxx index 53cc5641d962..074f46ff31b7 100644 --- a/svgio/source/svgreader/svgimagenode.cxx +++ b/svgio/source/svgreader/svgimagenode.cxx @@ -17,8 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include +#include +#include #include #include #include diff --git a/svgio/source/svgreader/svglinenode.cxx b/svgio/source/svgreader/svglinenode.cxx index b63fd8fa9768..2bbcadb14679 100644 --- a/svgio/source/svgreader/svglinenode.cxx +++ b/svgio/source/svgreader/svglinenode.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include diff --git a/svgio/source/svgreader/svgmarkernode.cxx b/svgio/source/svgreader/svgmarkernode.cxx index c0c2dc76ebcf..5c8ecd21a3e1 100644 --- a/svgio/source/svgreader/svgmarkernode.cxx +++ b/svgio/source/svgreader/svgmarkernode.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include namespace svgio { diff --git a/svgio/source/svgreader/svgmasknode.cxx b/svgio/source/svgreader/svgmasknode.cxx index bf72eaca25d1..4879e7e7caff 100644 --- a/svgio/source/svgreader/svgmasknode.cxx +++ b/svgio/source/svgreader/svgmasknode.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include #include diff --git a/svgio/source/svgreader/svgnode.cxx b/svgio/source/svgreader/svgnode.cxx index c9bd15adbdf1..a3a77ab15b80 100644 --- a/svgio/source/svgreader/svgnode.cxx +++ b/svgio/source/svgreader/svgnode.cxx @@ -18,9 +18,9 @@ */ #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/svgio/source/svgreader/svgpaint.cxx b/svgio/source/svgreader/svgpaint.cxx index e5aa257c14be..fdf44be8d812 100644 --- a/svgio/source/svgreader/svgpaint.cxx +++ b/svgio/source/svgreader/svgpaint.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include namespace svgio { diff --git a/svgio/source/svgreader/svgpathnode.cxx b/svgio/source/svgreader/svgpathnode.cxx index 818a98c32034..9ba246997f86 100644 --- a/svgio/source/svgreader/svgpathnode.cxx +++ b/svgio/source/svgreader/svgpathnode.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include namespace svgio diff --git a/svgio/source/svgreader/svgpatternnode.cxx b/svgio/source/svgreader/svgpatternnode.cxx index c99c4f112a69..6338f96fd1d6 100644 --- a/svgio/source/svgreader/svgpatternnode.cxx +++ b/svgio/source/svgreader/svgpatternnode.cxx @@ -17,8 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include +#include +#include namespace svgio { diff --git a/svgio/source/svgreader/svgpolynode.cxx b/svgio/source/svgreader/svgpolynode.cxx index fe9efd1c273b..378f4c74cc52 100644 --- a/svgio/source/svgreader/svgpolynode.cxx +++ b/svgio/source/svgreader/svgpolynode.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include #include diff --git a/svgio/source/svgreader/svgrectnode.cxx b/svgio/source/svgreader/svgrectnode.cxx index 7b826362fdff..ee10be205fa9 100644 --- a/svgio/source/svgreader/svgrectnode.cxx +++ b/svgio/source/svgreader/svgrectnode.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include diff --git a/svgio/source/svgreader/svgstyleattributes.cxx b/svgio/source/svgreader/svgstyleattributes.cxx index ff4a1853f2f7..db20d64902f8 100644 --- a/svgio/source/svgreader/svgstyleattributes.cxx +++ b/svgio/source/svgreader/svgstyleattributes.cxx @@ -17,24 +17,24 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include -#include -#include +#include +#include #include -#include +#include #include #include #include #include #include -#include -#include +#include +#include #include -#include +#include #include -#include +#include #include #include #include diff --git a/svgio/source/svgreader/svgstylenode.cxx b/svgio/source/svgreader/svgstylenode.cxx index 61497fcde94a..08b3eafd7bcc 100644 --- a/svgio/source/svgreader/svgstylenode.cxx +++ b/svgio/source/svgreader/svgstylenode.cxx @@ -17,8 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include +#include +#include namespace svgio { diff --git a/svgio/source/svgreader/svgsvgnode.cxx b/svgio/source/svgreader/svgsvgnode.cxx index 324ecf5a4b18..81dfd24b1ca5 100644 --- a/svgio/source/svgreader/svgsvgnode.cxx +++ b/svgio/source/svgreader/svgsvgnode.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include #include diff --git a/svgio/source/svgreader/svgsymbolnode.cxx b/svgio/source/svgreader/svgsymbolnode.cxx index aec7baef1068..85f1ea5f5cb6 100644 --- a/svgio/source/svgreader/svgsymbolnode.cxx +++ b/svgio/source/svgreader/svgsymbolnode.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include diff --git a/svgio/source/svgreader/svgtextnode.cxx b/svgio/source/svgreader/svgtextnode.cxx index ae7d0e104b85..d78912901f86 100644 --- a/svgio/source/svgreader/svgtextnode.cxx +++ b/svgio/source/svgreader/svgtextnode.cxx @@ -17,12 +17,12 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/svgio/source/svgreader/svgtextpathnode.cxx b/svgio/source/svgreader/svgtextpathnode.cxx index c4e7f426ecac..faeb257bb672 100644 --- a/svgio/source/svgreader/svgtextpathnode.cxx +++ b/svgio/source/svgreader/svgtextpathnode.cxx @@ -17,11 +17,11 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include diff --git a/svgio/source/svgreader/svgtitledescnode.cxx b/svgio/source/svgreader/svgtitledescnode.cxx index de34e2790c72..36b4cd48b250 100644 --- a/svgio/source/svgreader/svgtitledescnode.cxx +++ b/svgio/source/svgreader/svgtitledescnode.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include namespace svgio diff --git a/svgio/source/svgreader/svgtoken.cxx b/svgio/source/svgreader/svgtoken.cxx index bb9ac17e23cf..af1970b51e8a 100644 --- a/svgio/source/svgreader/svgtoken.cxx +++ b/svgio/source/svgreader/svgtoken.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include namespace svgio diff --git a/svgio/source/svgreader/svgtools.cxx b/svgio/source/svgreader/svgtools.cxx index b3925c0e1dbb..3ef273fe4e36 100644 --- a/svgio/source/svgreader/svgtools.cxx +++ b/svgio/source/svgreader/svgtools.cxx @@ -17,12 +17,12 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include #include #include -#include +#include #include namespace svgio diff --git a/svgio/source/svgreader/svgtrefnode.cxx b/svgio/source/svgreader/svgtrefnode.cxx index f698794e9e80..c9325e8a5c9c 100644 --- a/svgio/source/svgreader/svgtrefnode.cxx +++ b/svgio/source/svgreader/svgtrefnode.cxx @@ -17,8 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include +#include +#include namespace svgio { diff --git a/svgio/source/svgreader/svgtspannode.cxx b/svgio/source/svgreader/svgtspannode.cxx index 962f1c8f145d..96a85c156feb 100644 --- a/svgio/source/svgreader/svgtspannode.cxx +++ b/svgio/source/svgreader/svgtspannode.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include namespace svgio { diff --git a/svgio/source/svgreader/svgusenode.cxx b/svgio/source/svgreader/svgusenode.cxx index 84f4bbe75785..6a055d0fdd22 100644 --- a/svgio/source/svgreader/svgusenode.cxx +++ b/svgio/source/svgreader/svgusenode.cxx @@ -17,9 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include -#include +#include namespace svgio { diff --git a/svgio/source/svguno/xsvgparser.cxx b/svgio/source/svguno/xsvgparser.cxx index 14f184f87b17..7f2bcac953de 100644 --- a/svgio/source/svguno/xsvgparser.cxx +++ b/svgio/source/svguno/xsvgparser.cxx @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include "xsvgparser.hxx" diff --git a/unodevtools/inc/options.hxx b/unodevtools/inc/options.hxx new file mode 100644 index 000000000000..3ba269fe8d14 --- /dev/null +++ b/unodevtools/inc/options.hxx @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_UNODEVTOOLS_INC_OPTIONS_HXX +#define INCLUDED_UNODEVTOOLS_INC_OPTIONS_HXX + +#include "sal/config.h" + +#include + +namespace unodevtools { + + +bool readOption( OUString * pValue, const sal_Char * pOpt, + sal_uInt32 * pnIndex, const OUString & aArg); + // throws CannotDumpException + + +bool readOption( const sal_Char * pOpt, + sal_uInt32 * pnIndex, const OUString & aArg); + +} // end of namespace unodevtools + +#endif // INCLUDED_UNODEVTOOLS_INC_OPTIONS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unodevtools/inc/unodevtools/options.hxx b/unodevtools/inc/unodevtools/options.hxx deleted file mode 100644 index 566c18d01f1c..000000000000 --- a/unodevtools/inc/unodevtools/options.hxx +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_UNODEVTOOLS_INC_UNODEVTOOLS_OPTIONS_HXX -#define INCLUDED_UNODEVTOOLS_INC_UNODEVTOOLS_OPTIONS_HXX - -#include "sal/config.h" - -#include - -namespace unodevtools { - - -bool readOption( OUString * pValue, const sal_Char * pOpt, - sal_uInt32 * pnIndex, const OUString & aArg); - // throws CannotDumpException - - -bool readOption( const sal_Char * pOpt, - sal_uInt32 * pnIndex, const OUString & aArg); - -} // end of namespace unodevtools - -#endif // INCLUDED_UNODEVTOOLS_INC_UNODEVTOOLS_OPTIONS_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unodevtools/source/skeletonmaker/skeletonmaker.cxx b/unodevtools/source/skeletonmaker/skeletonmaker.cxx index c193df6de267..6fd03a6a7951 100644 --- a/unodevtools/source/skeletonmaker/skeletonmaker.cxx +++ b/unodevtools/source/skeletonmaker/skeletonmaker.cxx @@ -22,7 +22,7 @@ #include "codemaker/typemanager.hxx" #include "sal/main.h" #include "rtl/process.h" -#include "unodevtools/options.hxx" +#include "options.hxx" #include "unoidl/unoidl.hxx" #include "skeletonjava.hxx" diff --git a/unodevtools/source/unodevtools/options.cxx b/unodevtools/source/unodevtools/options.cxx index 6022e5c29669..596a2415c0e9 100644 --- a/unodevtools/source/unodevtools/options.cxx +++ b/unodevtools/source/unodevtools/options.cxx @@ -22,7 +22,7 @@ #include "codemaker/global.hxx" #include "rtl/ustring.hxx" #include "rtl/process.h" -#include "unodevtools/options.hxx" +#include "options.hxx" namespace unodevtools { diff --git a/xmlsecurity/inc/biginteger.hxx b/xmlsecurity/inc/biginteger.hxx new file mode 100644 index 000000000000..73f6259c966b --- /dev/null +++ b/xmlsecurity/inc/biginteger.hxx @@ -0,0 +1,33 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_XMLSECURITY_INC_BIGINTEGER_HXX +#define INCLUDED_XMLSECURITY_INC_BIGINTEGER_HXX + +#include +#include + +#include + +OUString bigIntegerToNumericString( const css::uno::Sequence< sal_Int8 >& serial ); +css::uno::Sequence< sal_Int8 > numericStringToBigInteger ( const OUString& serialNumber ); + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/inc/certificatechooser.hxx b/xmlsecurity/inc/certificatechooser.hxx new file mode 100644 index 000000000000..ec555b6724ee --- /dev/null +++ b/xmlsecurity/inc/certificatechooser.hxx @@ -0,0 +1,84 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_XMLSECURITY_INC_CERTIFICATECHOOSER_HXX +#define INCLUDED_XMLSECURITY_INC_CERTIFICATECHOOSER_HXX + +#include +#include +#include +#include +#include + +namespace com { +namespace sun { +namespace star { +namespace security { + class XCertificate; } +namespace xml { namespace crypto { + class XSecurityEnvironment; }} +}}} + +#include +#include + +class HeaderBar; + +class CertificateChooser : public ModalDialog +{ +private: + css::uno::Reference< css::uno::XComponentContext > mxCtx; + css::uno::Reference< css::xml::crypto::XSecurityEnvironment > mxSecurityEnvironment; + css::uno::Sequence< css::uno::Reference< css::security::XCertificate > > maCerts; + + VclPtr m_pCertLB; + VclPtr m_pViewBtn; + VclPtr m_pOKBtn; + VclPtr m_pDescriptionED; + + bool mbInitialized; + + sal_uInt16 GetSelectedEntryPos() const; + + DECL_LINK_TYPED(ViewButtonHdl, Button*, void); + DECL_LINK_TYPED(CertificateHighlightHdl, SvTreeListBox*, void ); + DECL_LINK_TYPED(CertificateSelectHdl, SvTreeListBox*, bool ); + + void ImplShowCertificateDetails(); + void ImplInitialize(); + + void HandleOneUsageBit(OUString& string, int& bits, int bit, const char *name); + +public: + CertificateChooser(vcl::Window* pParent, css::uno::Reference< css::uno::XComponentContext>& rxCtx, css::uno::Reference< css::xml::crypto::XSecurityEnvironment >& rxSecurityEnvironment); + virtual ~CertificateChooser(); + virtual void dispose() override; + + short Execute() override; + + css::uno::Reference< css::security::XCertificate > GetSelectedCertificate(); + /// Gets the description string provided when selecting the certificate. + OUString GetDescription(); + + OUString UsageInClearText(int bits); +}; + +#endif // INCLUDED_XMLSECURITY_INC_CERTIFICATECHOOSER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/inc/certificateviewer.hxx b/xmlsecurity/inc/certificateviewer.hxx new file mode 100644 index 000000000000..c0072c5077ac --- /dev/null +++ b/xmlsecurity/inc/certificateviewer.hxx @@ -0,0 +1,150 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_XMLSECURITY_INC_CERTIFICATEVIEWER_HXX +#define INCLUDED_XMLSECURITY_INC_CERTIFICATEVIEWER_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace com { +namespace sun { +namespace star { +namespace security { + class XCertificate; } +namespace xml { namespace crypto { + class XSecurityEnvironment; }} +}}} + +class CertificateViewer : public TabDialog +{ +private: + friend class CertificateViewerGeneralTP; + friend class CertificateViewerDetailsTP; + friend class CertificateViewerCertPathTP; + + VclPtr mpTabCtrl; + sal_uInt16 mnGeneralId; + sal_uInt16 mnDetailsId; + sal_uInt16 mnPathId; + + bool mbCheckForPrivateKey; + + css::uno::Reference< css::xml::crypto::XSecurityEnvironment > mxSecurityEnvironment; + css::uno::Reference< css::security::XCertificate > mxCert; +public: + CertificateViewer( vcl::Window* pParent, const css::uno::Reference< css::xml::crypto::XSecurityEnvironment >& rxSecurityEnvironment, const css::uno::Reference< css::security::XCertificate >& rXCert, bool bCheckForPrivateKey ); + virtual ~CertificateViewer(); + virtual void dispose() override; +}; + + +class CertificateViewerTP : public TabPage +{ +protected: + VclPtr mpDlg; +public: + CertificateViewerTP( vcl::Window* _pParent, const OString& rID, + const OUString& rUIXMLDescription, CertificateViewer* _pDlg ); + virtual ~CertificateViewerTP(); + virtual void dispose() override; +}; + +class CertificateViewerGeneralTP : public CertificateViewerTP +{ +private: + VclPtr m_pCertImg; + VclPtr m_pHintNotTrustedFI; + VclPtr m_pIssuedToFI; + VclPtr m_pIssuedByFI; + VclPtr m_pValidFromDateFI; + VclPtr m_pValidToDateFI; + VclPtr m_pKeyImg; + VclPtr m_pHintCorrespPrivKeyFI; +public: + CertificateViewerGeneralTP( vcl::Window* pParent, CertificateViewer* _pDlg ); + virtual ~CertificateViewerGeneralTP(); + virtual void dispose() override; + + virtual void ActivatePage() override; +}; + + +class CertificateViewerDetailsTP : public CertificateViewerTP +{ +private: + VclPtr m_pElementsLBContainer; + VclPtr m_pElementsLB; + VclPtr m_pValueDetails; + vcl::Font m_aStdFont; + vcl::Font m_aFixedWidthFont; + + DECL_LINK_TYPED( ElementSelectHdl, SvTreeListBox*, void ); + void Clear(); + void InsertElement( const OUString& _rField, const OUString& _rValue, + const OUString& _rDetails, bool _bFixedWidthFont = false ); +public: + CertificateViewerDetailsTP( vcl::Window* pParent, CertificateViewer* _pDlg ); + virtual ~CertificateViewerDetailsTP(); + virtual void dispose() override; + + virtual void ActivatePage() override; +}; + + +class CertificateViewerCertPathTP : public CertificateViewerTP +{ +private: + VclPtr mpCertPathLB; + VclPtr mpViewCertPB; + VclPtr mpCertStatusML; + + VclPtr mpParent; + bool mbFirstActivateDone; + Image maCertImage; + Image maCertNotValidatedImage; + OUString msCertOK; + OUString msCertNotValidated; + + DECL_LINK_TYPED( ViewCertHdl, Button*, void ); + DECL_LINK_TYPED( CertSelectHdl, SvTreeListBox*, void ); + void Clear(); + SvTreeListEntry* InsertCert( SvTreeListEntry* _pParent, const OUString& _rName, + const css::uno::Reference< css::security::XCertificate >& rxCert, + bool bValid); + +public: + CertificateViewerCertPathTP( vcl::Window* pParent, CertificateViewer* _pDlg ); + virtual ~CertificateViewerCertPathTP(); + virtual void dispose() override; + + virtual void ActivatePage() override; +}; + + +#endif // INCLUDED_XMLSECURITY_INC_CERTIFICATEVIEWER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/inc/digitalsignaturesdialog.hxx b/xmlsecurity/inc/digitalsignaturesdialog.hxx new file mode 100644 index 000000000000..4c3a13fe722e --- /dev/null +++ b/xmlsecurity/inc/digitalsignaturesdialog.hxx @@ -0,0 +1,129 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_XMLSECURITY_INC_DIGITALSIGNATURESDIALOG_HXX +#define INCLUDED_XMLSECURITY_INC_DIGITALSIGNATURESDIALOG_HXX + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +namespace com { +namespace sun { +namespace star { +namespace lang { + class XMultiServiceFactory; } +namespace io { + class XStream; } +namespace embed { + class XStorage; } +namespace xml { namespace dom { + class XDocumentBuilder; } } +}}} + + +class HeaderBar; + +class DigitalSignaturesDialog : public ModalDialog +{ +private: + css::uno::Reference< css::uno::XComponentContext >& mxCtx; + + DocumentSignatureManager maSignatureManager; + bool mbVerifySignatures; + bool mbSignaturesChanged; + + VclPtr m_pHintDocFT; + VclPtr m_pHintBasicFT; + VclPtr m_pHintPackageFT; + VclPtr m_pSignaturesLB; + VclPtr m_pSigsValidImg; + VclPtr m_pSigsValidFI; + VclPtr m_pSigsInvalidImg; + VclPtr m_pSigsInvalidFI; + VclPtr m_pSigsNotvalidatedImg; + VclPtr m_pSigsNotvalidatedFI; + VclPtr m_pSigsOldSignatureImg; + VclPtr m_pSigsOldSignatureFI; + + VclPtr m_pViewBtn; + VclPtr m_pAddBtn; + VclPtr m_pRemoveBtn; + + VclPtr m_pCloseBtn; + + OUString m_sODFVersion; + //Signals if the document contains already a document signature. This is only + //important when we are signing macros and if the value is true. + bool m_bHasDocumentSignature; + bool m_bWarningShowSignMacro; + + DECL_LINK_TYPED(ViewButtonHdl, Button*, void); + DECL_LINK_TYPED(AddButtonHdl, Button*, void); + DECL_LINK_TYPED(RemoveButtonHdl, Button*, void); + DECL_LINK_TYPED(SignatureHighlightHdl, SvTreeListBox*, void ); + DECL_LINK_TYPED(SignatureSelectHdl, SvTreeListBox*, bool ); + DECL_LINK_TYPED(StartVerifySignatureHdl, LinkParamNone*, bool ); + DECL_LINK_TYPED(OKButtonHdl, Button*, void ); + + void ImplGetSignatureInformations(bool bUseTempStream, bool bCacheLastSignature = true); + void ImplFillSignaturesBox(); + void ImplShowSignaturesDetails(); + + //Checks if adding is allowed. + //See the spec at specs/www/appwide/security/Electronic_Signatures_and_Security.sxw + //(6.6.2)Behaviour with regard to ODF 1.2 + bool canAdd(); + bool canRemove(); + + bool canAddRemove(); + +public: + DigitalSignaturesDialog( vcl::Window* pParent, css::uno::Reference< + css::uno::XComponentContext >& rxCtx, DocumentSignatureMode eMode, + bool bReadOnly, const OUString& sODFVersion, bool bHasDocumentSignature); + virtual ~DigitalSignaturesDialog(); + virtual void dispose() override; + + // Initialize the dialog and the security environment, returns TRUE on success + bool Init(); + + // Set the storage which should be signed or verified + void SetStorage( const css::uno::Reference < css::embed::XStorage >& rxStore ); + void SetSignatureStream( const css::uno::Reference < css::io::XStream >& rxStream ); + + // Execute the dialog... + short Execute() override; + + // Did signatures change? + bool SignaturesChanged() const { return mbSignaturesChanged; } +}; + +#endif // INCLUDED_XMLSECURITY_INC_DIGITALSIGNATURESDIALOG_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/inc/documentsignaturehelper.hxx b/xmlsecurity/inc/documentsignaturehelper.hxx new file mode 100644 index 000000000000..4767e585629a --- /dev/null +++ b/xmlsecurity/inc/documentsignaturehelper.hxx @@ -0,0 +1,102 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_XMLSECURITY_INC_DOCUMENTSIGNATUREHELPER_HXX +#define INCLUDED_XMLSECURITY_INC_DOCUMENTSIGNATUREHELPER_HXX + +#include +#include +#include "sigstruct.hxx" +#include "xmlsecuritydllapi.h" + +#include + +namespace com { +namespace sun { +namespace star { +namespace io { + class XStream; } +namespace embed { + class XStorage; } +}}} + + +/********************************************************** + DocumentSignatureHelper + + Helper class for signing and verifieng document signatures + + Functions: + 1. help to create a list of content to be signed/verified + + **********************************************************/ + +enum DocumentSignatureMode { SignatureModeDocumentContent, SignatureModeMacros, SignatureModePackage }; + +enum DocumentSignatureAlgorithm +{ + OOo2Document, + OOo3_0Document, + OOo3_2Document +}; + +struct SignatureStreamHelper +{ + css::uno::Reference < css::embed::XStorage > xSignatureStorage; + css::uno::Reference < css::io::XStream > xSignatureStream; + /// If this is embed::StorageFormats::OFOPXML, then it's expected that xSignatureStream is an empty reference. + sal_Int32 nStorageFormat; + + SignatureStreamHelper() + : nStorageFormat(0) + { + } +}; + + +class XMLSECURITY_DLLPUBLIC DocumentSignatureHelper +{ +public: + + static SignatureStreamHelper OpenSignatureStream( + const css::uno::Reference < css::embed::XStorage >& rxStore, sal_Int32 nOpenMode, + DocumentSignatureMode eDocSigMode ); + static std::vector< OUString > CreateElementList( + const css::uno::Reference < css::embed::XStorage >& rxStore, + DocumentSignatureMode eMode, + const DocumentSignatureAlgorithm mode); + static bool isODFPre_1_2(const OUString & sODFVersion); + static bool isOOo3_2_Signature(const SignatureInformation & sigInfo); + static DocumentSignatureAlgorithm getDocumentAlgorithm( + const OUString & sODFVersion, const SignatureInformation & sigInfo); + static bool checkIfAllFilesAreSigned( const ::std::vector< OUString > & sElementList, + const SignatureInformation & sigInfo, const DocumentSignatureAlgorithm alg); + static bool equalsReferenceUriManifestPath( + const OUString & rUri, const OUString & rPath); + static OUString GetDocumentContentSignatureDefaultStreamName(); + static OUString GetScriptingContentSignatureDefaultStreamName(); + static OUString GetPackageSignatureDefaultStreamName(); + /// In case the storage is OOXML, prepend a leading '/' and append content type to the element URIs. + static void AppendContentTypes(const css::uno::Reference& xStorage, std::vector& rElements); + +}; + +#endif // INCLUDED_XMLSECURITY_INC_DOCUMENTSIGNATUREHELPER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/inc/documentsignaturemanager.hxx b/xmlsecurity/inc/documentsignaturemanager.hxx index 361de61e3bec..a3881052fb88 100644 --- a/xmlsecurity/inc/documentsignaturemanager.hxx +++ b/xmlsecurity/inc/documentsignaturemanager.hxx @@ -21,11 +21,11 @@ #define INCLUDED_XMLSECURITY_INC_DOCUMENTSIGNATUREMANAGER_HXX #include "xmlsecuritydllapi.h" -#include -#include +#include +#include #include #include -#include +#include #include /// Manages signatures (addition, removal), used by DigitalSignaturesDialog. @@ -61,6 +61,6 @@ public: void write(); }; -#endif // INCLUDED_XMLSECURITY_INC_XMLSECURITY_DOCUMENTSIGNATUREMANAGER_HXX +#endif // INCLUDED_XMLSECURITY_INC_DOCUMENTSIGNATUREMANAGER_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/inc/global.hrc b/xmlsecurity/inc/global.hrc new file mode 100644 index 000000000000..00dfdd33cc58 --- /dev/null +++ b/xmlsecurity/inc/global.hrc @@ -0,0 +1,29 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_XMLSECURITY_INC_GLOBAL_HRC +#define INCLUDED_XMLSECURITY_INC_GLOBAL_HRC + +// global resource ids + +#define RID_XMLSECWB_NO_MOZILLA_PROFILE 1013 + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/inc/macrosecurity.hxx b/xmlsecurity/inc/macrosecurity.hxx new file mode 100644 index 000000000000..fb308d5a6b97 --- /dev/null +++ b/xmlsecurity/inc/macrosecurity.hxx @@ -0,0 +1,152 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_XMLSECURITY_INC_MACROSECURITY_HXX +#define INCLUDED_XMLSECURITY_INC_MACROSECURITY_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +namespace com { +namespace sun { +namespace star { +namespace xml { namespace crypto { + class XSecurityEnvironment; }} +}}} + +class MacroSecurityTP; + +class MacroSecurity : public TabDialog +{ +private: + friend class MacroSecurityLevelTP; + friend class MacroSecurityTrustedSourcesTP; + + VclPtr m_pTabCtrl; + VclPtr m_pOkBtn; + VclPtr m_pResetBtn; + + css::uno::Reference< css::uno::XComponentContext > mxCtx; + css::uno::Reference< css::xml::crypto::XSecurityEnvironment > mxSecurityEnvironment; + SvtSecurityOptions maSecOptions; + + sal_uInt16 m_nSecLevelId; + sal_uInt16 m_nSecTrustId; + + VclPtr mpLevelTP; + VclPtr mpTrustSrcTP; + + DECL_LINK_TYPED( OkBtnHdl, Button*, void ); +public: + MacroSecurity(vcl::Window* pParent, + const css::uno::Reference< css::uno::XComponentContext>& rxCtx, + const css::uno::Reference< css::xml::crypto::XSecurityEnvironment >& rxSecurityEnvironment); + virtual ~MacroSecurity(); + virtual void dispose() override; + + inline void EnableReset(bool _bEnable = true) + { + m_pResetBtn->Enable ( _bEnable ); + } +}; + +class MacroSecurityTP : public TabPage +{ +protected: + VclPtr mpDlg; +public: + MacroSecurityTP(vcl::Window* _pParent, const OString& rID, + const OUString& rUIXMLDescription, MacroSecurity* _pDlg); + virtual ~MacroSecurityTP(); + virtual void dispose() override; + + virtual void ClosePage() = 0; +}; + +class MacroSecurityLevelTP : public MacroSecurityTP +{ +private: + VclPtr m_pVeryHighRB; + VclPtr m_pHighRB; + VclPtr m_pMediumRB; + VclPtr m_pLowRB; + + sal_uInt16 mnCurLevel; + +protected: + DECL_LINK_TYPED(RadioButtonHdl, Button*, void); + +public: + MacroSecurityLevelTP( vcl::Window* pParent, MacroSecurity* _pDlg ); + virtual ~MacroSecurityLevelTP(); + virtual void dispose() override; + + virtual void ClosePage() override; +}; + + +class MacroSecurityTrustedSourcesTP : public MacroSecurityTP +{ +private: + VclPtr m_pTrustCertROFI; + VclPtr m_pTrustCertLB; + VclPtr m_pViewCertPB; + VclPtr m_pRemoveCertPB; + VclPtr m_pTrustFileROFI; + VclPtr m_pTrustFileLocLB; + VclPtr m_pAddLocPB; + VclPtr m_pRemoveLocPB; + + css::uno::Sequence< SvtSecurityOptions::Certificate > maTrustedAuthors; + + bool mbAuthorsReadonly; + bool mbURLsReadonly; + + DECL_LINK_TYPED( ViewCertPBHdl, Button*, void ); + DECL_LINK_TYPED( RemoveCertPBHdl, Button*, void ); + DECL_LINK_TYPED( AddLocPBHdl, Button*, void ); + DECL_LINK_TYPED( RemoveLocPBHdl, Button*, void ); + DECL_LINK_TYPED( TrustCertLBSelectHdl, SvTreeListBox*, void ); + DECL_LINK_TYPED( TrustFileLocLBSelectHdl, ListBox&, void ); + + void FillCertLB(); + void ImplCheckButtons(); + +public: + MacroSecurityTrustedSourcesTP(vcl::Window* pParent, MacroSecurity* _pDlg); + virtual ~MacroSecurityTrustedSourcesTP(); + virtual void dispose() override; + + virtual void ActivatePage() override; + virtual void ClosePage() override; +}; + + +#endif // INCLUDED_XMLSECURITY_INC_MACROSECURITY_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/inc/pch/precompiled_xmlsecurity.hxx b/xmlsecurity/inc/pch/precompiled_xmlsecurity.hxx index 3c566596ea91..dde0b196af29 100644 --- a/xmlsecurity/inc/pch/precompiled_xmlsecurity.hxx +++ b/xmlsecurity/inc/pch/precompiled_xmlsecurity.hxx @@ -17,7 +17,7 @@ ./bin/update_pch xmlsecurity xmlsecurity --cutoff=6 --exclude:system --include:module --include:local If after updating build fails, use the following command to locate conflicting headers: - ./bin/update_pch_bisect ./xmlsecurity/inc/pch/precompiled_xmlsecurity.hxx "make xmlsecurity.build" --find-conflicts + ./bin/update_pch_bisect ./inc/pch/precompiled_xmlsecurity.hxx "make xmlsecurity.build" --find-conflicts */ #include @@ -304,6 +304,6 @@ #include #include #include -#include +#include /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/inc/pch/precompiled_xsec_fw.hxx b/xmlsecurity/inc/pch/precompiled_xsec_fw.hxx index 8ea24be36a43..fbfaea7b1566 100644 --- a/xmlsecurity/inc/pch/precompiled_xsec_fw.hxx +++ b/xmlsecurity/inc/pch/precompiled_xsec_fw.hxx @@ -17,7 +17,7 @@ ./bin/update_pch xmlsecurity xsec_fw --cutoff=2 --exclude:system --include:module --exclude:local If after updating build fails, use the following command to locate conflicting headers: - ./bin/update_pch_bisect ./xmlsecurity/inc/pch/precompiled_xsec_fw.hxx "/opt/lo/bin/make xmlsecurity.build" --find-conflicts + ./bin/update_pch_bisect ./inc/pch/precompiled_xsec_fw.hxx "/opt/lo/bin/make xmlsecurity.build" --find-conflicts */ #include diff --git a/xmlsecurity/inc/pch/precompiled_xsec_xmlsec.hxx b/xmlsecurity/inc/pch/precompiled_xsec_xmlsec.hxx index 089c2192c4ff..aee27c5fee2f 100644 --- a/xmlsecurity/inc/pch/precompiled_xsec_xmlsec.hxx +++ b/xmlsecurity/inc/pch/precompiled_xsec_xmlsec.hxx @@ -17,7 +17,7 @@ ./bin/update_pch xmlsecurity xsec_xmlsec --cutoff=2 --exclude:system --include:module --include:local If after updating build fails, use the following command to locate conflicting headers: - ./bin/update_pch_bisect ./xmlsecurity/inc/pch/precompiled_xsec_xmlsec.hxx "make xmlsecurity.build" --find-conflicts + ./bin/update_pch_bisect ./inc/pch/precompiled_xsec_xmlsec.hxx "make xmlsecurity.build" --find-conflicts */ #include @@ -114,7 +114,7 @@ #include #include #include -#include +#include // Cleanup windows header macro pollution. #if defined(_WIN32) && defined(WINAPI) diff --git a/xmlsecurity/inc/sigstruct.hxx b/xmlsecurity/inc/sigstruct.hxx new file mode 100644 index 000000000000..8650a8f84ac2 --- /dev/null +++ b/xmlsecurity/inc/sigstruct.hxx @@ -0,0 +1,102 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_XMLSECURITY_INC_SIGSTRUCT_HXX +#define INCLUDED_XMLSECURITY_INC_SIGSTRUCT_HXX + +#include +#include +#include +#include + +#include + +/* + * type of reference + */ +enum class SignatureReferenceType +{ + SAMEDOCUMENT = 1, + BINARYSTREAM = 2, + XMLSTREAM = 3 +}; + +struct SignatureReferenceInformation +{ + SignatureReferenceType nType; + OUString ouURI; + OUString ouDigestValue; + + SignatureReferenceInformation( SignatureReferenceType type, const OUString& uri ) + { + nType = type; + ouURI = uri; + } +}; + +typedef ::std::vector< SignatureReferenceInformation > SignatureReferenceInformations; + +struct SignatureInformation +{ + sal_Int32 nSecurityId; + sal_Int32 nSecurityEnvironmentIndex; + css::xml::crypto::SecurityOperationStatus nStatus; + SignatureReferenceInformations vSignatureReferenceInfors; + OUString ouX509IssuerName; + OUString ouX509SerialNumber; + OUString ouX509Certificate; + OUString ouSignatureValue; + css::util::DateTime stDateTime; + + //We also keep the date and time as string. This is done when this + //structure is created as a result of a XML signature being read. + //When then a signature is added or another removed, then the original + //XML signatures are written again (unless they have been removed). + //If the date time string is converted into the DateTime structure + //then information can be lost because it only holds a fractional + //of a second with a accuracy of one hundredth of second. + //If the string contains + //milli seconds (because the document was created by an application other than OOo) + //and the converted time is written back, then the string looks different + //and the signature is broken. + OUString ouDateTime; + OUString ouSignatureId; + OUString ouPropertyId; + /// Characters of the element inside the signature. + OUString ouDescription; + /// The Id attribute of the element that contains the . + OUString ouDescriptionPropertyId; + /// OOXML certificate SHA-256 digest, empty for ODF. + OUString ouCertDigest; + /// A full OOXML signguature for unchanged roundtrip, empty for ODF. + css::uno::Sequence aSignatureBytes; + + SignatureInformation( sal_Int32 nId ) + { + nSecurityId = nId; + nStatus = css::xml::crypto::SecurityOperationStatus_UNKNOWN; + nSecurityEnvironmentIndex = -1; + } +}; + +typedef ::std::vector< SignatureInformation > SignatureInformations; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/inc/xmlsec-wrapper.h b/xmlsecurity/inc/xmlsec-wrapper.h new file mode 100644 index 000000000000..3d5c24b9b6f1 --- /dev/null +++ b/xmlsecurity/inc/xmlsec-wrapper.h @@ -0,0 +1,46 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_XMLSECURITY_INC_XMLSEC_WRAPPER_H +#define INCLUDED_XMLSECURITY_INC_XMLSEC_WRAPPER_H + +#include + +#include + +// Cf. xmlsec's configure.in (but which isn't used for MSVC): +#if !defined _MSC_VER && SAL_TYPES_SIZEOFPOINTER != 4 +#define XMLSEC_NO_SIZE_T +#endif + +#include "xmlsec/base64.h" +#include "xmlsec/bn.h" +#include "xmlsec/crypto.h" +#include "xmlsec/errors.h" +#include "xmlsec/io.h" +#include "xmlsec/keysmngr.h" +#include "xmlsec/strings.h" +#include "xmlsec/xmldsig.h" +#include "xmlsec/xmlenc.h" +#include "xmlsec/xmlsec.h" +#include "xmlsec/xmltree.h" + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/inc/xmlsecurity/biginteger.hxx b/xmlsecurity/inc/xmlsecurity/biginteger.hxx deleted file mode 100644 index 7b3cafa06648..000000000000 --- a/xmlsecurity/inc/xmlsecurity/biginteger.hxx +++ /dev/null @@ -1,33 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_XMLSECURITY_INC_XMLSECURITY_BIGINTEGER_HXX -#define INCLUDED_XMLSECURITY_INC_XMLSECURITY_BIGINTEGER_HXX - -#include -#include - -#include - -OUString bigIntegerToNumericString( const css::uno::Sequence< sal_Int8 >& serial ); -css::uno::Sequence< sal_Int8 > numericStringToBigInteger ( const OUString& serialNumber ); - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/inc/xmlsecurity/certificatechooser.hxx b/xmlsecurity/inc/xmlsecurity/certificatechooser.hxx deleted file mode 100644 index e24c457bfc81..000000000000 --- a/xmlsecurity/inc/xmlsecurity/certificatechooser.hxx +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_XMLSECURITY_INC_XMLSECURITY_CERTIFICATECHOOSER_HXX -#define INCLUDED_XMLSECURITY_INC_XMLSECURITY_CERTIFICATECHOOSER_HXX - -#include -#include -#include -#include -#include - -namespace com { -namespace sun { -namespace star { -namespace security { - class XCertificate; } -namespace xml { namespace crypto { - class XSecurityEnvironment; }} -}}} - -#include -#include - -class HeaderBar; - -class CertificateChooser : public ModalDialog -{ -private: - css::uno::Reference< css::uno::XComponentContext > mxCtx; - css::uno::Reference< css::xml::crypto::XSecurityEnvironment > mxSecurityEnvironment; - css::uno::Sequence< css::uno::Reference< css::security::XCertificate > > maCerts; - - VclPtr m_pCertLB; - VclPtr m_pViewBtn; - VclPtr m_pOKBtn; - VclPtr m_pDescriptionED; - - bool mbInitialized; - - sal_uInt16 GetSelectedEntryPos() const; - - DECL_LINK_TYPED(ViewButtonHdl, Button*, void); - DECL_LINK_TYPED(CertificateHighlightHdl, SvTreeListBox*, void ); - DECL_LINK_TYPED(CertificateSelectHdl, SvTreeListBox*, bool ); - - void ImplShowCertificateDetails(); - void ImplInitialize(); - - void HandleOneUsageBit(OUString& string, int& bits, int bit, const char *name); - -public: - CertificateChooser(vcl::Window* pParent, css::uno::Reference< css::uno::XComponentContext>& rxCtx, css::uno::Reference< css::xml::crypto::XSecurityEnvironment >& rxSecurityEnvironment); - virtual ~CertificateChooser(); - virtual void dispose() override; - - short Execute() override; - - css::uno::Reference< css::security::XCertificate > GetSelectedCertificate(); - /// Gets the description string provided when selecting the certificate. - OUString GetDescription(); - - OUString UsageInClearText(int bits); -}; - -#endif // INCLUDED_XMLSECURITY_INC_XMLSECURITY_CERTIFICATECHOOSER_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx b/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx deleted file mode 100644 index fa9e33f14f2b..000000000000 --- a/xmlsecurity/inc/xmlsecurity/certificateviewer.hxx +++ /dev/null @@ -1,150 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_XMLSECURITY_INC_XMLSECURITY_CERTIFICATEVIEWER_HXX -#define INCLUDED_XMLSECURITY_INC_XMLSECURITY_CERTIFICATEVIEWER_HXX - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace com { -namespace sun { -namespace star { -namespace security { - class XCertificate; } -namespace xml { namespace crypto { - class XSecurityEnvironment; }} -}}} - -class CertificateViewer : public TabDialog -{ -private: - friend class CertificateViewerGeneralTP; - friend class CertificateViewerDetailsTP; - friend class CertificateViewerCertPathTP; - - VclPtr mpTabCtrl; - sal_uInt16 mnGeneralId; - sal_uInt16 mnDetailsId; - sal_uInt16 mnPathId; - - bool mbCheckForPrivateKey; - - css::uno::Reference< css::xml::crypto::XSecurityEnvironment > mxSecurityEnvironment; - css::uno::Reference< css::security::XCertificate > mxCert; -public: - CertificateViewer( vcl::Window* pParent, const css::uno::Reference< css::xml::crypto::XSecurityEnvironment >& rxSecurityEnvironment, const css::uno::Reference< css::security::XCertificate >& rXCert, bool bCheckForPrivateKey ); - virtual ~CertificateViewer(); - virtual void dispose() override; -}; - - -class CertificateViewerTP : public TabPage -{ -protected: - VclPtr mpDlg; -public: - CertificateViewerTP( vcl::Window* _pParent, const OString& rID, - const OUString& rUIXMLDescription, CertificateViewer* _pDlg ); - virtual ~CertificateViewerTP(); - virtual void dispose() override; -}; - -class CertificateViewerGeneralTP : public CertificateViewerTP -{ -private: - VclPtr m_pCertImg; - VclPtr m_pHintNotTrustedFI; - VclPtr m_pIssuedToFI; - VclPtr m_pIssuedByFI; - VclPtr m_pValidFromDateFI; - VclPtr m_pValidToDateFI; - VclPtr m_pKeyImg; - VclPtr m_pHintCorrespPrivKeyFI; -public: - CertificateViewerGeneralTP( vcl::Window* pParent, CertificateViewer* _pDlg ); - virtual ~CertificateViewerGeneralTP(); - virtual void dispose() override; - - virtual void ActivatePage() override; -}; - - -class CertificateViewerDetailsTP : public CertificateViewerTP -{ -private: - VclPtr m_pElementsLBContainer; - VclPtr m_pElementsLB; - VclPtr m_pValueDetails; - vcl::Font m_aStdFont; - vcl::Font m_aFixedWidthFont; - - DECL_LINK_TYPED( ElementSelectHdl, SvTreeListBox*, void ); - void Clear(); - void InsertElement( const OUString& _rField, const OUString& _rValue, - const OUString& _rDetails, bool _bFixedWidthFont = false ); -public: - CertificateViewerDetailsTP( vcl::Window* pParent, CertificateViewer* _pDlg ); - virtual ~CertificateViewerDetailsTP(); - virtual void dispose() override; - - virtual void ActivatePage() override; -}; - - -class CertificateViewerCertPathTP : public CertificateViewerTP -{ -private: - VclPtr mpCertPathLB; - VclPtr mpViewCertPB; - VclPtr mpCertStatusML; - - VclPtr mpParent; - bool mbFirstActivateDone; - Image maCertImage; - Image maCertNotValidatedImage; - OUString msCertOK; - OUString msCertNotValidated; - - DECL_LINK_TYPED( ViewCertHdl, Button*, void ); - DECL_LINK_TYPED( CertSelectHdl, SvTreeListBox*, void ); - void Clear(); - SvTreeListEntry* InsertCert( SvTreeListEntry* _pParent, const OUString& _rName, - const css::uno::Reference< css::security::XCertificate >& rxCert, - bool bValid); - -public: - CertificateViewerCertPathTP( vcl::Window* pParent, CertificateViewer* _pDlg ); - virtual ~CertificateViewerCertPathTP(); - virtual void dispose() override; - - virtual void ActivatePage() override; -}; - - -#endif // INCLUDED_XMLSECURITY_INC_XMLSECURITY_CERTIFICATEVIEWER_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/inc/xmlsecurity/digitalsignaturesdialog.hxx b/xmlsecurity/inc/xmlsecurity/digitalsignaturesdialog.hxx deleted file mode 100644 index 83370dbb8c6d..000000000000 --- a/xmlsecurity/inc/xmlsecurity/digitalsignaturesdialog.hxx +++ /dev/null @@ -1,129 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_XMLSECURITY_INC_XMLSECURITY_DIGITALSIGNATURESDIALOG_HXX -#define INCLUDED_XMLSECURITY_INC_XMLSECURITY_DIGITALSIGNATURESDIALOG_HXX - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include - -namespace com { -namespace sun { -namespace star { -namespace lang { - class XMultiServiceFactory; } -namespace io { - class XStream; } -namespace embed { - class XStorage; } -namespace xml { namespace dom { - class XDocumentBuilder; } } -}}} - - -class HeaderBar; - -class DigitalSignaturesDialog : public ModalDialog -{ -private: - css::uno::Reference< css::uno::XComponentContext >& mxCtx; - - DocumentSignatureManager maSignatureManager; - bool mbVerifySignatures; - bool mbSignaturesChanged; - - VclPtr m_pHintDocFT; - VclPtr m_pHintBasicFT; - VclPtr m_pHintPackageFT; - VclPtr m_pSignaturesLB; - VclPtr m_pSigsValidImg; - VclPtr m_pSigsValidFI; - VclPtr m_pSigsInvalidImg; - VclPtr m_pSigsInvalidFI; - VclPtr m_pSigsNotvalidatedImg; - VclPtr m_pSigsNotvalidatedFI; - VclPtr m_pSigsOldSignatureImg; - VclPtr m_pSigsOldSignatureFI; - - VclPtr m_pViewBtn; - VclPtr m_pAddBtn; - VclPtr m_pRemoveBtn; - - VclPtr m_pCloseBtn; - - OUString m_sODFVersion; - //Signals if the document contains already a document signature. This is only - //important when we are signing macros and if the value is true. - bool m_bHasDocumentSignature; - bool m_bWarningShowSignMacro; - - DECL_LINK_TYPED(ViewButtonHdl, Button*, void); - DECL_LINK_TYPED(AddButtonHdl, Button*, void); - DECL_LINK_TYPED(RemoveButtonHdl, Button*, void); - DECL_LINK_TYPED(SignatureHighlightHdl, SvTreeListBox*, void ); - DECL_LINK_TYPED(SignatureSelectHdl, SvTreeListBox*, bool ); - DECL_LINK_TYPED(StartVerifySignatureHdl, LinkParamNone*, bool ); - DECL_LINK_TYPED(OKButtonHdl, Button*, void ); - - void ImplGetSignatureInformations(bool bUseTempStream, bool bCacheLastSignature = true); - void ImplFillSignaturesBox(); - void ImplShowSignaturesDetails(); - - //Checks if adding is allowed. - //See the spec at specs/www/appwide/security/Electronic_Signatures_and_Security.sxw - //(6.6.2)Behaviour with regard to ODF 1.2 - bool canAdd(); - bool canRemove(); - - bool canAddRemove(); - -public: - DigitalSignaturesDialog( vcl::Window* pParent, css::uno::Reference< - css::uno::XComponentContext >& rxCtx, DocumentSignatureMode eMode, - bool bReadOnly, const OUString& sODFVersion, bool bHasDocumentSignature); - virtual ~DigitalSignaturesDialog(); - virtual void dispose() override; - - // Initialize the dialog and the security environment, returns TRUE on success - bool Init(); - - // Set the storage which should be signed or verified - void SetStorage( const css::uno::Reference < css::embed::XStorage >& rxStore ); - void SetSignatureStream( const css::uno::Reference < css::io::XStream >& rxStream ); - - // Execute the dialog... - short Execute() override; - - // Did signatures change? - bool SignaturesChanged() const { return mbSignaturesChanged; } -}; - -#endif // INCLUDED_XMLSECURITY_INC_XMLSECURITY_DIGITALSIGNATURESDIALOG_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/inc/xmlsecurity/documentsignaturehelper.hxx b/xmlsecurity/inc/xmlsecurity/documentsignaturehelper.hxx deleted file mode 100644 index 9ccbd3aff792..000000000000 --- a/xmlsecurity/inc/xmlsecurity/documentsignaturehelper.hxx +++ /dev/null @@ -1,102 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_XMLSECURITY_INC_XMLSECURITY_DOCUMENTSIGNATUREHELPER_HXX -#define INCLUDED_XMLSECURITY_INC_XMLSECURITY_DOCUMENTSIGNATUREHELPER_HXX - -#include -#include -#include "xmlsecurity/sigstruct.hxx" -#include "xmlsecuritydllapi.h" - -#include - -namespace com { -namespace sun { -namespace star { -namespace io { - class XStream; } -namespace embed { - class XStorage; } -}}} - - -/********************************************************** - DocumentSignatureHelper - - Helper class for signing and verifieng document signatures - - Functions: - 1. help to create a list of content to be signed/verified - - **********************************************************/ - -enum DocumentSignatureMode { SignatureModeDocumentContent, SignatureModeMacros, SignatureModePackage }; - -enum DocumentSignatureAlgorithm -{ - OOo2Document, - OOo3_0Document, - OOo3_2Document -}; - -struct SignatureStreamHelper -{ - css::uno::Reference < css::embed::XStorage > xSignatureStorage; - css::uno::Reference < css::io::XStream > xSignatureStream; - /// If this is embed::StorageFormats::OFOPXML, then it's expected that xSignatureStream is an empty reference. - sal_Int32 nStorageFormat; - - SignatureStreamHelper() - : nStorageFormat(0) - { - } -}; - - -class XMLSECURITY_DLLPUBLIC DocumentSignatureHelper -{ -public: - - static SignatureStreamHelper OpenSignatureStream( - const css::uno::Reference < css::embed::XStorage >& rxStore, sal_Int32 nOpenMode, - DocumentSignatureMode eDocSigMode ); - static std::vector< OUString > CreateElementList( - const css::uno::Reference < css::embed::XStorage >& rxStore, - DocumentSignatureMode eMode, - const DocumentSignatureAlgorithm mode); - static bool isODFPre_1_2(const OUString & sODFVersion); - static bool isOOo3_2_Signature(const SignatureInformation & sigInfo); - static DocumentSignatureAlgorithm getDocumentAlgorithm( - const OUString & sODFVersion, const SignatureInformation & sigInfo); - static bool checkIfAllFilesAreSigned( const ::std::vector< OUString > & sElementList, - const SignatureInformation & sigInfo, const DocumentSignatureAlgorithm alg); - static bool equalsReferenceUriManifestPath( - const OUString & rUri, const OUString & rPath); - static OUString GetDocumentContentSignatureDefaultStreamName(); - static OUString GetScriptingContentSignatureDefaultStreamName(); - static OUString GetPackageSignatureDefaultStreamName(); - /// In case the storage is OOXML, prepend a leading '/' and append content type to the element URIs. - static void AppendContentTypes(const css::uno::Reference& xStorage, std::vector& rElements); - -}; - -#endif // INCLUDED_XMLSECURITY_INC_XMLSECURITY_DOCUMENTSIGNATUREHELPER_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/inc/xmlsecurity/global.hrc b/xmlsecurity/inc/xmlsecurity/global.hrc deleted file mode 100644 index 0b4b0ac7a58a..000000000000 --- a/xmlsecurity/inc/xmlsecurity/global.hrc +++ /dev/null @@ -1,29 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_XMLSECURITY_INC_XMLSECURITY_GLOBAL_HRC -#define INCLUDED_XMLSECURITY_INC_XMLSECURITY_GLOBAL_HRC - -// global resource ids - -#define RID_XMLSECWB_NO_MOZILLA_PROFILE 1013 - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/inc/xmlsecurity/macrosecurity.hxx b/xmlsecurity/inc/xmlsecurity/macrosecurity.hxx deleted file mode 100644 index 4c6d5f37c4a5..000000000000 --- a/xmlsecurity/inc/xmlsecurity/macrosecurity.hxx +++ /dev/null @@ -1,152 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_XMLSECURITY_INC_XMLSECURITY_MACROSECURITY_HXX -#define INCLUDED_XMLSECURITY_INC_XMLSECURITY_MACROSECURITY_HXX - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -namespace com { -namespace sun { -namespace star { -namespace xml { namespace crypto { - class XSecurityEnvironment; }} -}}} - -class MacroSecurityTP; - -class MacroSecurity : public TabDialog -{ -private: - friend class MacroSecurityLevelTP; - friend class MacroSecurityTrustedSourcesTP; - - VclPtr m_pTabCtrl; - VclPtr m_pOkBtn; - VclPtr m_pResetBtn; - - css::uno::Reference< css::uno::XComponentContext > mxCtx; - css::uno::Reference< css::xml::crypto::XSecurityEnvironment > mxSecurityEnvironment; - SvtSecurityOptions maSecOptions; - - sal_uInt16 m_nSecLevelId; - sal_uInt16 m_nSecTrustId; - - VclPtr mpLevelTP; - VclPtr mpTrustSrcTP; - - DECL_LINK_TYPED( OkBtnHdl, Button*, void ); -public: - MacroSecurity(vcl::Window* pParent, - const css::uno::Reference< css::uno::XComponentContext>& rxCtx, - const css::uno::Reference< css::xml::crypto::XSecurityEnvironment >& rxSecurityEnvironment); - virtual ~MacroSecurity(); - virtual void dispose() override; - - inline void EnableReset(bool _bEnable = true) - { - m_pResetBtn->Enable ( _bEnable ); - } -}; - -class MacroSecurityTP : public TabPage -{ -protected: - VclPtr mpDlg; -public: - MacroSecurityTP(vcl::Window* _pParent, const OString& rID, - const OUString& rUIXMLDescription, MacroSecurity* _pDlg); - virtual ~MacroSecurityTP(); - virtual void dispose() override; - - virtual void ClosePage() = 0; -}; - -class MacroSecurityLevelTP : public MacroSecurityTP -{ -private: - VclPtr m_pVeryHighRB; - VclPtr m_pHighRB; - VclPtr m_pMediumRB; - VclPtr m_pLowRB; - - sal_uInt16 mnCurLevel; - -protected: - DECL_LINK_TYPED(RadioButtonHdl, Button*, void); - -public: - MacroSecurityLevelTP( vcl::Window* pParent, MacroSecurity* _pDlg ); - virtual ~MacroSecurityLevelTP(); - virtual void dispose() override; - - virtual void ClosePage() override; -}; - - -class MacroSecurityTrustedSourcesTP : public MacroSecurityTP -{ -private: - VclPtr m_pTrustCertROFI; - VclPtr m_pTrustCertLB; - VclPtr m_pViewCertPB; - VclPtr m_pRemoveCertPB; - VclPtr m_pTrustFileROFI; - VclPtr m_pTrustFileLocLB; - VclPtr m_pAddLocPB; - VclPtr m_pRemoveLocPB; - - css::uno::Sequence< SvtSecurityOptions::Certificate > maTrustedAuthors; - - bool mbAuthorsReadonly; - bool mbURLsReadonly; - - DECL_LINK_TYPED( ViewCertPBHdl, Button*, void ); - DECL_LINK_TYPED( RemoveCertPBHdl, Button*, void ); - DECL_LINK_TYPED( AddLocPBHdl, Button*, void ); - DECL_LINK_TYPED( RemoveLocPBHdl, Button*, void ); - DECL_LINK_TYPED( TrustCertLBSelectHdl, SvTreeListBox*, void ); - DECL_LINK_TYPED( TrustFileLocLBSelectHdl, ListBox&, void ); - - void FillCertLB(); - void ImplCheckButtons(); - -public: - MacroSecurityTrustedSourcesTP(vcl::Window* pParent, MacroSecurity* _pDlg); - virtual ~MacroSecurityTrustedSourcesTP(); - virtual void dispose() override; - - virtual void ActivatePage() override; - virtual void ClosePage() override; -}; - - -#endif // INCLUDED_XMLSECURITY_INC_XMLSECURITY_MACROSECURITY_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/inc/xmlsecurity/sigstruct.hxx b/xmlsecurity/inc/xmlsecurity/sigstruct.hxx deleted file mode 100644 index 5a7df3dedd76..000000000000 --- a/xmlsecurity/inc/xmlsecurity/sigstruct.hxx +++ /dev/null @@ -1,102 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_XMLSECURITY_INC_XMLSECURITY_SIGSTRUCT_HXX -#define INCLUDED_XMLSECURITY_INC_XMLSECURITY_SIGSTRUCT_HXX - -#include -#include -#include -#include - -#include - -/* - * type of reference - */ -enum class SignatureReferenceType -{ - SAMEDOCUMENT = 1, - BINARYSTREAM = 2, - XMLSTREAM = 3 -}; - -struct SignatureReferenceInformation -{ - SignatureReferenceType nType; - OUString ouURI; - OUString ouDigestValue; - - SignatureReferenceInformation( SignatureReferenceType type, const OUString& uri ) - { - nType = type; - ouURI = uri; - } -}; - -typedef ::std::vector< SignatureReferenceInformation > SignatureReferenceInformations; - -struct SignatureInformation -{ - sal_Int32 nSecurityId; - sal_Int32 nSecurityEnvironmentIndex; - css::xml::crypto::SecurityOperationStatus nStatus; - SignatureReferenceInformations vSignatureReferenceInfors; - OUString ouX509IssuerName; - OUString ouX509SerialNumber; - OUString ouX509Certificate; - OUString ouSignatureValue; - css::util::DateTime stDateTime; - - //We also keep the date and time as string. This is done when this - //structure is created as a result of a XML signature being read. - //When then a signature is added or another removed, then the original - //XML signatures are written again (unless they have been removed). - //If the date time string is converted into the DateTime structure - //then information can be lost because it only holds a fractional - //of a second with a accuracy of one hundredth of second. - //If the string contains - //milli seconds (because the document was created by an application other than OOo) - //and the converted time is written back, then the string looks different - //and the signature is broken. - OUString ouDateTime; - OUString ouSignatureId; - OUString ouPropertyId; - /// Characters of the element inside the signature. - OUString ouDescription; - /// The Id attribute of the element that contains the . - OUString ouDescriptionPropertyId; - /// OOXML certificate SHA-256 digest, empty for ODF. - OUString ouCertDigest; - /// A full OOXML signguature for unchanged roundtrip, empty for ODF. - css::uno::Sequence aSignatureBytes; - - SignatureInformation( sal_Int32 nId ) - { - nSecurityId = nId; - nStatus = css::xml::crypto::SecurityOperationStatus_UNKNOWN; - nSecurityEnvironmentIndex = -1; - } -}; - -typedef ::std::vector< SignatureInformation > SignatureInformations; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/inc/xmlsecurity/xmlsec-wrapper.h b/xmlsecurity/inc/xmlsecurity/xmlsec-wrapper.h deleted file mode 100644 index 9d20cedd6b4a..000000000000 --- a/xmlsecurity/inc/xmlsecurity/xmlsec-wrapper.h +++ /dev/null @@ -1,46 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_XMLSECURITY_INC_XMLSECURITY_XMLSEC_WRAPPER_H -#define INCLUDED_XMLSECURITY_INC_XMLSECURITY_XMLSEC_WRAPPER_H - -#include - -#include - -// Cf. xmlsec's configure.in (but which isn't used for MSVC): -#if !defined _MSC_VER && SAL_TYPES_SIZEOFPOINTER != 4 -#define XMLSEC_NO_SIZE_T -#endif - -#include "xmlsec/base64.h" -#include "xmlsec/bn.h" -#include "xmlsec/crypto.h" -#include "xmlsec/errors.h" -#include "xmlsec/io.h" -#include "xmlsec/keysmngr.h" -#include "xmlsec/strings.h" -#include "xmlsec/xmldsig.h" -#include "xmlsec/xmlenc.h" -#include "xmlsec/xmlsec.h" -#include "xmlsec/xmltree.h" - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/inc/xmlsecurity/xmlsignaturehelper.hxx b/xmlsecurity/inc/xmlsecurity/xmlsignaturehelper.hxx deleted file mode 100644 index 869d66bbab6d..000000000000 --- a/xmlsecurity/inc/xmlsecurity/xmlsignaturehelper.hxx +++ /dev/null @@ -1,198 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_XMLSECURITY_INC_XMLSECURITY_XMLSIGNATUREHELPER_HXX -#define INCLUDED_XMLSECURITY_INC_XMLSECURITY_XMLSIGNATUREHELPER_HXX - -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -class XSecController; -class Date; -namespace tools { class Time; } - -namespace com { -namespace sun { -namespace star { -namespace io { - class XOutputStream; - class XInputStream; } -namespace embed { - class XStorage; } -}}} - -struct XMLSignatureCreationResult -{ - sal_Int32 nSecurityId; - css::xml::crypto::SecurityOperationStatus nSignatureCreationResult; - - XMLSignatureCreationResult( sal_Int32 nId, css::xml::crypto::SecurityOperationStatus nResult ) - { - nSecurityId = nId; - nSignatureCreationResult = nResult; - } -}; - -struct XMLSignatureVerifyResult -{ - sal_Int32 nSecurityId; - css::xml::crypto::SecurityOperationStatus nSignatureVerifyResult; - - XMLSignatureVerifyResult( sal_Int32 nId, css::xml::crypto::SecurityOperationStatus nResult ) - { - nSecurityId = nId; - nSignatureVerifyResult = nResult; - } -}; - - -/********************************************************** - XMLSignatureHelper - - Helper class for the XML Security framework - - Functions: - 1. help to create a security context; - 2. help to listen signature creation result; - 3. help to listen signature verify result; - 4. help to indicate which signature to verify. - - **********************************************************/ - -class XMLSECURITY_DLLPUBLIC XMLSignatureHelper -{ -private: - css::uno::Reference< css::uno::XComponentContext > mxCtx; - css::uno::Reference< css::xml::crypto::sax::XSecurityController > mxSecurityController; - css::uno::Reference< css::xml::crypto::XUriBinding > mxUriBinding; - - css::uno::Reference< css::xml::crypto::XSEInitializer > mxSEInitializer; - css::uno::Reference< css::xml::crypto::XXMLSecurityContext > mxSecurityContext; - - std::vector - maCreationResults; - std::vector - maVerifyResults; - XSecController* mpXSecController; - bool mbError; - bool mbODFPre1_2; - Link maStartVerifySignatureHdl; - -private: - DECL_LINK_TYPED( SignatureCreationResultListener, XMLSignatureCreationResult&, void ); - DECL_LINK_TYPED( SignatureVerifyResultListener, XMLSignatureVerifyResult&, void ); - DECL_LINK_TYPED( StartVerifySignatureElement, LinkParamNone*, void ); - - XMLSignatureHelper(const XMLSignatureHelper&) = delete; - -public: - XMLSignatureHelper(const css::uno::Reference< css::uno::XComponentContext >& mrCtx ); - ~XMLSignatureHelper(); - - // Initialize the security context with default crypto token. - // Returns true for success. - bool Init(); - - // Set the storage which should be used by the default UriBinding - // Must be set before StatrtMission(). - //sODFVersion indicates the ODF version - void SetStorage( const css::uno::Reference < css::embed::XStorage >& rxStorage, const OUString& sODFVersion ); - - // Argument for the Link is a uno::Reference< xml::sax::XAttributeList >* - // Return 1 to verify, 0 to skip. - // Default handler will verify all. - void SetStartVerifySignatureHdl( const Link& rLink ); - - // Get the security environment - css::uno::Reference< css::xml::crypto::XSecurityEnvironment > GetSecurityEnvironment(); - - // After signing/verifying, get information about signatures - SignatureInformation GetSignatureInformation( sal_Int32 nSecurityId ) const; - SignatureInformations GetSignatureInformations() const; - - // See XSecController for documentation - void StartMission(); - void EndMission(); - sal_Int32 GetNewSecurityId(); - /** sets data that describes the certificate. - - It is absolutely necessary that the parameter ouX509IssuerName is set. It contains - the base64 encoded certificate, which is DER encoded. The XMLSec needs it to find - the private key. Although issuer name and certificate should be sufficient to identify - the certificate the implementation in XMLSec is broken, both for Windows and mozilla. - The reason is that they use functions to find the certificate which take as parameter - the DER encoded ASN.1 issuer name. The issuer name is a DName, where most attributes - are of type DirectoryName, which is a choice of 5 string types. This information is - not contained in the issuer string and while it is converted to the ASN.1 name the - conversion function must assume a particular type, which is often wrong. For example, - the Windows function CertStrToName will use a T.61 string if the string does not contain - special characters. So if the certificate uses simple characters but encodes the - issuer attributes in Utf8, then CertStrToName will use T.61. The resulting DER encoded - ASN.1 name now contains different bytes which indicate the string type. The functions - for finding the certificate apparently use memcmp - hence they fail to find the - certificate. - */ - void SetX509Certificate(sal_Int32 nSecurityId, const OUString& ouX509IssuerName, - const OUString& ouX509SerialNumber, const OUString& ouX509Cert, const OUString& ouX509CertDigest); - - void SetDateTime( sal_Int32 nSecurityId, const Date& rDate, const tools::Time& rTime ); - void SetDescription(sal_Int32 nSecurityId, const OUString& rDescription); - - void AddForSigning( sal_Int32 securityId, const OUString& uri, const OUString& objectURL, bool bBinary ); - bool CreateAndWriteSignature( const css::uno::Reference< css::xml::sax::XDocumentHandler >& xDocumentHandler ); - bool ReadAndVerifySignature( const css::uno::Reference< css::io::XInputStream >& xInputStream ); - - // MT: ??? I think only for adding/removing, not for new signatures... - // MM: Yes, but if you want to insert a new signature into an existing signature file, those function - // will be very useful, see Mission 3 in the new "multisigdemo" program :-) - css::uno::Reference< css::xml::sax::XWriter> CreateDocumentHandlerWithHeader( const css::uno::Reference< css::io::XOutputStream >& xOutputStream ); - static void CloseDocumentHandler( const css::uno::Reference< css::xml::sax::XDocumentHandler>& xDocumentHandler ); - static void ExportSignature( const css::uno::Reference< css::xml::sax::XDocumentHandler >& xDocumentHandler, const SignatureInformation& signatureInfo ); - - /// Read and verify OOXML signatures. - bool ReadAndVerifySignatureStorage(const css::uno::Reference& xStorage, bool bCacheLastSignature = true); - /// Read and verify a single OOXML signature. - bool ReadAndVerifySignatureStorageStream(const css::uno::Reference& xInputStream); - /// Adds or removes an OOXML digital signature relation to _rels/.rels if there wasn't any before. - void EnsureSignaturesRelation(const css::uno::Reference& xStorage, bool bAdd); - /// Given that xStorage is an OOXML _xmlsignatures storage, create origin.sigs and its relations. - void ExportSignatureRelations(const css::uno::Reference& xStorage, int nSignatureCount); - /// Given that xSignatureStorage is an OOXML _xmlsignatures storage, create and write a new signature. - bool CreateAndWriteOOXMLSignature(const css::uno::Reference& xRootStorage, const css::uno::Reference& xSignatureStorage, int nSignatureIndex); - /// Similar to CreateAndWriteOOXMLSignature(), but used to write the signature to the persistent storage, not the temporary one. - void ExportOOXMLSignature(const css::uno::Reference& xRootStorage, const css::uno::Reference& xSignatureStorage, const SignatureInformation& rInformation, int nSignatureIndex); - /// Given that xStorage is an OOXML root storage, advertise signatures in its [Content_Types].xml stream. - void ExportSignatureContentTypes(const css::uno::Reference& xStorage, int nSignatureCount); -}; - -#endif // INCLUDED_XMLSECURITY_INC_XMLSECURITY_XMLSIGNATUREHELPER_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/inc/xmlsecuritydllapi.h b/xmlsecurity/inc/xmlsecuritydllapi.h index f0540c799b48..2349d239b862 100644 --- a/xmlsecurity/inc/xmlsecuritydllapi.h +++ b/xmlsecurity/inc/xmlsecuritydllapi.h @@ -7,8 +7,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef INCLUDED_XMLSECURITY_INC_XMLSECURITYDLLAPI_H -#define INCLUDED_XMLSECURITY_INC_XMLSECURITYDLLAPI_H +#ifndef INCLUDED_XMLSECURITY_INCDLLAPI_H +#define INCLUDED_XMLSECURITY_INCDLLAPI_H #include @@ -18,6 +18,6 @@ #define XMLSECURITY_DLLPUBLIC SAL_DLLPUBLIC_IMPORT #endif -#endif // INCLUDED_XMLSECURITY_INC_XMLSECURITYDLLAPI_H +#endif // INCLUDED_XMLSECURITY_INCDLLAPI_H /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/inc/xmlsignaturehelper.hxx b/xmlsecurity/inc/xmlsignaturehelper.hxx new file mode 100644 index 000000000000..4118b6304b42 --- /dev/null +++ b/xmlsecurity/inc/xmlsignaturehelper.hxx @@ -0,0 +1,198 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_XMLSECURITY_INC_XMLSIGNATUREHELPER_HXX +#define INCLUDED_XMLSECURITY_INC_XMLSIGNATUREHELPER_HXX + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +class XSecController; +class Date; +namespace tools { class Time; } + +namespace com { +namespace sun { +namespace star { +namespace io { + class XOutputStream; + class XInputStream; } +namespace embed { + class XStorage; } +}}} + +struct XMLSignatureCreationResult +{ + sal_Int32 nSecurityId; + css::xml::crypto::SecurityOperationStatus nSignatureCreationResult; + + XMLSignatureCreationResult( sal_Int32 nId, css::xml::crypto::SecurityOperationStatus nResult ) + { + nSecurityId = nId; + nSignatureCreationResult = nResult; + } +}; + +struct XMLSignatureVerifyResult +{ + sal_Int32 nSecurityId; + css::xml::crypto::SecurityOperationStatus nSignatureVerifyResult; + + XMLSignatureVerifyResult( sal_Int32 nId, css::xml::crypto::SecurityOperationStatus nResult ) + { + nSecurityId = nId; + nSignatureVerifyResult = nResult; + } +}; + + +/********************************************************** + XMLSignatureHelper + + Helper class for the XML Security framework + + Functions: + 1. help to create a security context; + 2. help to listen signature creation result; + 3. help to listen signature verify result; + 4. help to indicate which signature to verify. + + **********************************************************/ + +class XMLSECURITY_DLLPUBLIC XMLSignatureHelper +{ +private: + css::uno::Reference< css::uno::XComponentContext > mxCtx; + css::uno::Reference< css::xml::crypto::sax::XSecurityController > mxSecurityController; + css::uno::Reference< css::xml::crypto::XUriBinding > mxUriBinding; + + css::uno::Reference< css::xml::crypto::XSEInitializer > mxSEInitializer; + css::uno::Reference< css::xml::crypto::XXMLSecurityContext > mxSecurityContext; + + std::vector + maCreationResults; + std::vector + maVerifyResults; + XSecController* mpXSecController; + bool mbError; + bool mbODFPre1_2; + Link maStartVerifySignatureHdl; + +private: + DECL_LINK_TYPED( SignatureCreationResultListener, XMLSignatureCreationResult&, void ); + DECL_LINK_TYPED( SignatureVerifyResultListener, XMLSignatureVerifyResult&, void ); + DECL_LINK_TYPED( StartVerifySignatureElement, LinkParamNone*, void ); + + XMLSignatureHelper(const XMLSignatureHelper&) = delete; + +public: + XMLSignatureHelper(const css::uno::Reference< css::uno::XComponentContext >& mrCtx ); + ~XMLSignatureHelper(); + + // Initialize the security context with default crypto token. + // Returns true for success. + bool Init(); + + // Set the storage which should be used by the default UriBinding + // Must be set before StatrtMission(). + //sODFVersion indicates the ODF version + void SetStorage( const css::uno::Reference < css::embed::XStorage >& rxStorage, const OUString& sODFVersion ); + + // Argument for the Link is a uno::Reference< xml::sax::XAttributeList >* + // Return 1 to verify, 0 to skip. + // Default handler will verify all. + void SetStartVerifySignatureHdl( const Link& rLink ); + + // Get the security environment + css::uno::Reference< css::xml::crypto::XSecurityEnvironment > GetSecurityEnvironment(); + + // After signing/verifying, get information about signatures + SignatureInformation GetSignatureInformation( sal_Int32 nSecurityId ) const; + SignatureInformations GetSignatureInformations() const; + + // See XSecController for documentation + void StartMission(); + void EndMission(); + sal_Int32 GetNewSecurityId(); + /** sets data that describes the certificate. + + It is absolutely necessary that the parameter ouX509IssuerName is set. It contains + the base64 encoded certificate, which is DER encoded. The XMLSec needs it to find + the private key. Although issuer name and certificate should be sufficient to identify + the certificate the implementation in XMLSec is broken, both for Windows and mozilla. + The reason is that they use functions to find the certificate which take as parameter + the DER encoded ASN.1 issuer name. The issuer name is a DName, where most attributes + are of type DirectoryName, which is a choice of 5 string types. This information is + not contained in the issuer string and while it is converted to the ASN.1 name the + conversion function must assume a particular type, which is often wrong. For example, + the Windows function CertStrToName will use a T.61 string if the string does not contain + special characters. So if the certificate uses simple characters but encodes the + issuer attributes in Utf8, then CertStrToName will use T.61. The resulting DER encoded + ASN.1 name now contains different bytes which indicate the string type. The functions + for finding the certificate apparently use memcmp - hence they fail to find the + certificate. + */ + void SetX509Certificate(sal_Int32 nSecurityId, const OUString& ouX509IssuerName, + const OUString& ouX509SerialNumber, const OUString& ouX509Cert, const OUString& ouX509CertDigest); + + void SetDateTime( sal_Int32 nSecurityId, const Date& rDate, const tools::Time& rTime ); + void SetDescription(sal_Int32 nSecurityId, const OUString& rDescription); + + void AddForSigning( sal_Int32 securityId, const OUString& uri, const OUString& objectURL, bool bBinary ); + bool CreateAndWriteSignature( const css::uno::Reference< css::xml::sax::XDocumentHandler >& xDocumentHandler ); + bool ReadAndVerifySignature( const css::uno::Reference< css::io::XInputStream >& xInputStream ); + + // MT: ??? I think only for adding/removing, not for new signatures... + // MM: Yes, but if you want to insert a new signature into an existing signature file, those function + // will be very useful, see Mission 3 in the new "multisigdemo" program :-) + css::uno::Reference< css::xml::sax::XWriter> CreateDocumentHandlerWithHeader( const css::uno::Reference< css::io::XOutputStream >& xOutputStream ); + static void CloseDocumentHandler( const css::uno::Reference< css::xml::sax::XDocumentHandler>& xDocumentHandler ); + static void ExportSignature( const css::uno::Reference< css::xml::sax::XDocumentHandler >& xDocumentHandler, const SignatureInformation& signatureInfo ); + + /// Read and verify OOXML signatures. + bool ReadAndVerifySignatureStorage(const css::uno::Reference& xStorage, bool bCacheLastSignature = true); + /// Read and verify a single OOXML signature. + bool ReadAndVerifySignatureStorageStream(const css::uno::Reference& xInputStream); + /// Adds or removes an OOXML digital signature relation to _rels/.rels if there wasn't any before. + void EnsureSignaturesRelation(const css::uno::Reference& xStorage, bool bAdd); + /// Given that xStorage is an OOXML _xmlsignatures storage, create origin.sigs and its relations. + void ExportSignatureRelations(const css::uno::Reference& xStorage, int nSignatureCount); + /// Given that xSignatureStorage is an OOXML _xmlsignatures storage, create and write a new signature. + bool CreateAndWriteOOXMLSignature(const css::uno::Reference& xRootStorage, const css::uno::Reference& xSignatureStorage, int nSignatureIndex); + /// Similar to CreateAndWriteOOXMLSignature(), but used to write the signature to the persistent storage, not the temporary one. + void ExportOOXMLSignature(const css::uno::Reference& xRootStorage, const css::uno::Reference& xSignatureStorage, const SignatureInformation& rInformation, int nSignatureIndex); + /// Given that xStorage is an OOXML root storage, advertise signatures in its [Content_Types].xml stream. + void ExportSignatureContentTypes(const css::uno::Reference& xStorage, int nSignatureCount); +}; + +#endif // INCLUDED_XMLSECURITY_INC_XMLSIGNATUREHELPER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/qa/unit/signing/signing.cxx b/xmlsecurity/qa/unit/signing/signing.cxx index d2a9f1741f34..767b0fa33a77 100644 --- a/xmlsecurity/qa/unit/signing/signing.cxx +++ b/xmlsecurity/qa/unit/signing/signing.cxx @@ -38,8 +38,8 @@ #include #include -#include -#include +#include +#include #include using namespace com::sun::star; diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx b/xmlsecurity/source/component/documentdigitalsignatures.cxx index f510f9c9ec30..476da3da7d1c 100644 --- a/xmlsecurity/source/component/documentdigitalsignatures.cxx +++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx @@ -18,12 +18,12 @@ */ #include "documentdigitalsignatures.hxx" -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include diff --git a/xmlsecurity/source/component/documentdigitalsignatures.hxx b/xmlsecurity/source/component/documentdigitalsignatures.hxx index 3bc155b4657f..7ab640570e2d 100644 --- a/xmlsecurity/source/component/documentdigitalsignatures.hxx +++ b/xmlsecurity/source/component/documentdigitalsignatures.hxx @@ -27,7 +27,7 @@ #include #include #include -#include +#include namespace com { namespace sun { namespace star { diff --git a/xmlsecurity/source/component/warnbox.src b/xmlsecurity/source/component/warnbox.src index 7202fe958f23..38f090ce6f6c 100644 --- a/xmlsecurity/source/component/warnbox.src +++ b/xmlsecurity/source/component/warnbox.src @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include String RID_XMLSECWB_NO_MOZILLA_PROFILE { diff --git a/xmlsecurity/source/dialogs/certificatechooser.cxx b/xmlsecurity/source/dialogs/certificatechooser.cxx index 70fe823254ca..ce92dfd4a0e5 100644 --- a/xmlsecurity/source/dialogs/certificatechooser.cxx +++ b/xmlsecurity/source/dialogs/certificatechooser.cxx @@ -18,9 +18,9 @@ */ -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/xmlsecurity/source/dialogs/certificateviewer.cxx b/xmlsecurity/source/dialogs/certificateviewer.cxx index 9c4e39767f87..3749160a5078 100644 --- a/xmlsecurity/source/dialogs/certificateviewer.cxx +++ b/xmlsecurity/source/dialogs/certificateviewer.cxx @@ -17,8 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include +#include +#include #include #include diff --git a/xmlsecurity/source/dialogs/dialogs.hrc b/xmlsecurity/source/dialogs/dialogs.hrc index 65cceb6085d2..ce7e97c14118 100644 --- a/xmlsecurity/source/dialogs/dialogs.hrc +++ b/xmlsecurity/source/dialogs/dialogs.hrc @@ -21,7 +21,7 @@ #define INCLUDED_XMLSECURITY_SOURCE_DIALOGS_DIALOGS_HRC #include -#include +#include #define STD_MASKCOLOR Color{Red=0xffff;Green=0x0000;Blue=0xffff;} diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index f79296fb5d32..91bf1c33de0a 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -17,10 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.hrc b/xmlsecurity/source/dialogs/digitalsignaturesdialog.hrc index 51dee1c5aa8b..25aa5cc6a6ea 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.hrc +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.hrc @@ -20,7 +20,7 @@ #ifndef INCLUDED_DIGITALSIGNATURESDIALOG_HRC #define INCLUDED_DIGITALSIGNATURESDIALOG_HRC -//global.hrc in xmlsecurity/inc starts at 1000 +//global.hrc in inc starts at 1000 #define RID_DIGITALSIGNATUREDLG_START 2000 #define STR_XMLSECDLG_OLD_ODF_FORMAT RID_DIGITALSIGNATUREDLG_START diff --git a/xmlsecurity/source/dialogs/macrosecurity.cxx b/xmlsecurity/source/dialogs/macrosecurity.cxx index 0eaefdf75c22..9d7950e36d1a 100644 --- a/xmlsecurity/source/dialogs/macrosecurity.cxx +++ b/xmlsecurity/source/dialogs/macrosecurity.cxx @@ -18,10 +18,10 @@ */ -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/xmlsecurity/source/helper/documentsignaturehelper.cxx b/xmlsecurity/source/helper/documentsignaturehelper.cxx index 30dbede00a1f..d50a4fc497f6 100644 --- a/xmlsecurity/source/helper/documentsignaturehelper.cxx +++ b/xmlsecurity/source/helper/documentsignaturehelper.cxx @@ -18,7 +18,7 @@ */ -#include +#include #include diff --git a/xmlsecurity/source/helper/ooxmlsecexporter.hxx b/xmlsecurity/source/helper/ooxmlsecexporter.hxx index 3b3d04eadb27..1a96430bba9a 100644 --- a/xmlsecurity/source/helper/ooxmlsecexporter.hxx +++ b/xmlsecurity/source/helper/ooxmlsecexporter.hxx @@ -15,7 +15,7 @@ #include #include #include -#include +#include /// Writes a single OOXML digital signature. class OOXMLSecExporter diff --git a/xmlsecurity/source/helper/xmlsignaturehelper.cxx b/xmlsecurity/source/helper/xmlsignaturehelper.cxx index e7e8e05cdb06..b1d155449b13 100644 --- a/xmlsecurity/source/helper/xmlsignaturehelper.cxx +++ b/xmlsecurity/source/helper/xmlsignaturehelper.cxx @@ -18,8 +18,8 @@ */ -#include -#include +#include +#include #include "xsecctl.hxx" #include "xmlsignaturehelper2.hxx" diff --git a/xmlsecurity/source/helper/xmlsignaturehelper2.cxx b/xmlsecurity/source/helper/xmlsignaturehelper2.cxx index a850a83fbc60..772b7cd56a5b 100644 --- a/xmlsecurity/source/helper/xmlsignaturehelper2.cxx +++ b/xmlsecurity/source/helper/xmlsignaturehelper2.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include "xmlsignaturehelper2.hxx" #include diff --git a/xmlsecurity/source/helper/xsecctl.hxx b/xmlsecurity/source/helper/xsecctl.hxx index 4f124a2dc07e..4d02bce95dd5 100644 --- a/xmlsecurity/source/helper/xsecctl.hxx +++ b/xmlsecurity/source/helper/xsecctl.hxx @@ -20,7 +20,7 @@ #ifndef INCLUDED_XMLSECURITY_SOURCE_HELPER_XSECCTL_HXX #define INCLUDED_XMLSECURITY_SOURCE_HELPER_XSECCTL_HXX -#include +#include #include #include diff --git a/xmlsecurity/source/xmlsec/biginteger.cxx b/xmlsecurity/source/xmlsec/biginteger.cxx index 3c33ea8a36b0..5b7075c47e47 100644 --- a/xmlsecurity/source/xmlsec/biginteger.cxx +++ b/xmlsecurity/source/xmlsec/biginteger.cxx @@ -18,9 +18,9 @@ */ -#include +#include -#include "xmlsecurity/xmlsec-wrapper.h" +#include "xmlsec-wrapper.h" #include using namespace ::com::sun::star::uno ; diff --git a/xmlsecurity/source/xmlsec/errorcallback.cxx b/xmlsecurity/source/xmlsec/errorcallback.cxx index 14e4863bc2a9..d1b25b6e6dbc 100644 --- a/xmlsecurity/source/xmlsec/errorcallback.cxx +++ b/xmlsecurity/source/xmlsec/errorcallback.cxx @@ -23,7 +23,7 @@ */ #include "errorcallback.hxx" -#include "xmlsecurity/xmlsec-wrapper.h" +#include "xmlsec-wrapper.h" using namespace ::com::sun::star::xml::crypto; diff --git a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx index 84fd8e80848c..30295452e2d2 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx +++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx @@ -38,10 +38,10 @@ #include "x509certificate_mscryptimpl.hxx" #include -#include "xmlsecurity/xmlsec-wrapper.h" +#include "xmlsec-wrapper.h" #include "xmlsec/mscrypto/akmngr.h" -#include +#include #include #include diff --git a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx index ddb812bc5292..62df6b7fa85b 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx +++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.hxx @@ -45,7 +45,7 @@ #include #include -#include "xmlsecurity/xmlsec-wrapper.h" +#include "xmlsec-wrapper.h" #include diff --git a/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.cxx index 985dc2cdc149..f0c262b96db1 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.cxx +++ b/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.cxx @@ -22,7 +22,7 @@ #include "securityenvironment_mscryptimpl.hxx" -#include "xmlsecurity/xmlsec-wrapper.h" +#include "xmlsec-wrapper.h" #include "xmlsec/mscrypto/app.h" #include #include diff --git a/xmlsecurity/source/xmlsec/mscrypt/xmlencryption_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/xmlencryption_mscryptimpl.cxx index c9cbc7295c86..0ff4c0ba891f 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/xmlencryption_mscryptimpl.cxx +++ b/xmlsecurity/source/xmlsec/mscrypt/xmlencryption_mscryptimpl.cxx @@ -28,7 +28,7 @@ #include "securityenvironment_mscryptimpl.hxx" #include "errorcallback.hxx" -#include "xmlsecurity/xmlsec-wrapper.h" +#include "xmlsec-wrapper.h" #ifdef UNX #define stricmp strcasecmp diff --git a/xmlsecurity/source/xmlsec/mscrypt/xmlsecuritycontext_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/xmlsecuritycontext_mscryptimpl.cxx index 21dd902b0cfc..8615671ed291 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/xmlsecuritycontext_mscryptimpl.cxx +++ b/xmlsecurity/source/xmlsec/mscrypt/xmlsecuritycontext_mscryptimpl.cxx @@ -23,7 +23,7 @@ #include "xmlsecuritycontext_mscryptimpl.hxx" #include "xmlstreamio.hxx" -#include "xmlsecurity/xmlsec-wrapper.h" +#include "xmlsec-wrapper.h" #include "xmlsec/mscrypto/akmngr.h" using namespace ::com::sun::star::uno ; diff --git a/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx index e350282a3afd..a23af537a925 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx +++ b/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx @@ -27,7 +27,7 @@ #include "securityenvironment_mscryptimpl.hxx" #include "xmlstreamio.hxx" #include "errorcallback.hxx" -#include "xmlsecurity/xmlsec-wrapper.h" +#include "xmlsec-wrapper.h" using namespace ::com::sun::star::uno ; using namespace ::com::sun::star::lang ; diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx index 47f609bb144d..a0db87690f78 100644 --- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx @@ -29,12 +29,12 @@ #include "x509certificate_nssimpl.hxx" #include -#include "xmlsecurity/xmlsec-wrapper.h" +#include "xmlsec-wrapper.h" #include #include #include -#include +#include #include #include #include diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx index 58b91ffc2749..38ebdf031e44 100644 --- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx +++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx @@ -43,7 +43,7 @@ #include "certdb.h" #include "list" -#include "xmlsecurity/xmlsec-wrapper.h" +#include "xmlsec-wrapper.h" class SecurityEnvironment_NssImpl : public ::cppu::WeakImplHelper< css::xml::crypto::XSecurityEnvironment , diff --git a/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.cxx index bc4ae4720612..8aa9e014d3bd 100644 --- a/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.cxx @@ -28,7 +28,7 @@ #include "securityenvironment_nssimpl.hxx" #include "errorcallback.hxx" -#include "xmlsecurity/xmlsec-wrapper.h" +#include "xmlsec-wrapper.h" using namespace ::com::sun::star::uno ; using namespace ::com::sun::star::lang ; diff --git a/xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.cxx index 8cf0f94e429f..8e51babf6a08 100644 --- a/xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.cxx @@ -24,7 +24,7 @@ #include "xmlsecuritycontext_nssimpl.hxx" #include "xmlstreamio.hxx" -#include "xmlsecurity/xmlsec-wrapper.h" +#include "xmlsec-wrapper.h" using namespace ::com::sun::star::uno ; using namespace ::com::sun::star::lang ; diff --git a/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx index 21c78d578b22..1cdd52066a4f 100644 --- a/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx @@ -31,7 +31,7 @@ #include "xmlstreamio.hxx" #include "errorcallback.hxx" -#include "xmlsecurity/xmlsec-wrapper.h" +#include "xmlsec-wrapper.h" using namespace ::com::sun::star::uno ; using namespace ::com::sun::star::lang ; diff --git a/xmlsecurity/source/xmlsec/serialnumberadapter.cxx b/xmlsecurity/source/xmlsec/serialnumberadapter.cxx index 5b484224405a..1772671c8ff2 100644 --- a/xmlsecurity/source/xmlsec/serialnumberadapter.cxx +++ b/xmlsecurity/source/xmlsec/serialnumberadapter.cxx @@ -31,7 +31,7 @@ #include #include #include -#include "xmlsecurity/biginteger.hxx" +#include "biginteger.hxx" #include "serialnumberadapter.hxx" diff --git a/xmlsecurity/source/xmlsec/xmlstreamio.cxx b/xmlsecurity/source/xmlsec/xmlstreamio.cxx index 2370bd6bd7e1..2d2bb236460b 100644 --- a/xmlsecurity/source/xmlsec/xmlstreamio.cxx +++ b/xmlsecurity/source/xmlsec/xmlstreamio.cxx @@ -26,7 +26,7 @@ #include #include -#include "xmlsecurity/xmlsec-wrapper.h" +#include "xmlsec-wrapper.h" #define XMLSTREAMIO_INITIALIZED 0x01 #define XMLSTREAMIO_REGISTERED 0x02 -- cgit v1.2.3