From 940b4d1848e8c70ab7642901a68594e8016caffc Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 18:51:28 +0200 Subject: Adding upstream version 1:7.0.4. Signed-off-by: Daniel Baumann --- include/svx/AccessibilityCheckDialog.hxx | 62 + include/svx/AccessibleControlShape.hxx | 207 +++ include/svx/AccessibleGraphicShape.hxx | 105 ++ include/svx/AccessibleOLEShape.hxx | 112 ++ include/svx/AccessibleShape.hxx | 439 +++++ include/svx/AccessibleShapeInfo.hxx | 97 ++ include/svx/AccessibleShapeTreeInfo.hxx | 203 +++ include/svx/AccessibleTextHelper.hxx | 366 +++++ include/svx/ActionDescriptionProvider.hxx | 55 + include/svx/ChildrenManager.hxx | 209 +++ include/svx/ClassificationCommon.hxx | 67 + include/svx/ClassificationDialog.hxx | 89 + include/svx/ClassificationField.hxx | 99 ++ include/svx/ColorSets.hxx | 71 + include/svx/CommonStyleManager.hxx | 41 + include/svx/DiagramDataInterface.hxx | 52 + include/svx/EnhancedCustomShape2d.hxx | 222 +++ include/svx/EnhancedCustomShapeFunctionParser.hxx | 248 +++ include/svx/EnhancedCustomShapeGeometry.hxx | 105 ++ include/svx/EnhancedCustomShapeTypeNames.hxx | 35 + include/svx/IAccessibleParent.hxx | 102 ++ include/svx/IAccessibleViewForwarder.hxx | 100 ++ include/svx/IAccessibleViewForwarderListener.hxx | 52 + include/svx/ImageMapInfo.hxx | 55 + include/svx/Palette.hxx | 44 + include/svx/PaletteManager.hxx | 79 + include/svx/ParaLineSpacingPopup.hxx | 51 + include/svx/ParaSpacingControl.hxx | 121 ++ include/svx/ParseContext.hxx | 78 + include/svx/ShapeTypeHandler.hxx | 199 +++ include/svx/SmartTagItem.hxx | 82 + include/svx/SmartTagMgr.hxx | 230 +++ include/svx/SpellDialogChildWindow.hxx | 117 ++ include/svx/SvxColorChildWindow.hxx | 40 + include/svx/SvxColorValueSet.hxx | 47 + include/svx/SvxNumOptionsTabPageHelper.hxx | 50 + include/svx/SvxPresetListBox.hxx | 66 + include/svx/SvxShapeTypes.hxx | 72 + include/svx/TextCharacterSpacingPopup.hxx | 48 + include/svx/TextUnderlinePopup.hxx | 49 + include/svx/UnoNamespaceMap.hxx | 36 + include/svx/XPropertyEntry.hxx | 54 + include/svx/algitem.hxx | 97 ++ include/svx/anchorid.hxx | 46 + include/svx/autoformathelper.hxx | 222 +++ include/svx/bmpmask.hxx | 177 ++ include/svx/camera3d.hxx | 68 + include/svx/charmap.hxx | 163 ++ include/svx/charthelper.hxx | 61 + include/svx/chrtitem.hxx | 152 ++ include/svx/clipboardctl.hxx | 57 + include/svx/clipfmtitem.hxx | 62 + include/svx/colorbox.hxx | 94 ++ include/svx/colorwindow.hxx | 139 ++ include/svx/compressgraphicdialog.hxx | 102 ++ include/svx/connctrl.hxx | 69 + include/svx/contdlg.hxx | 77 + include/svx/ctredlin.hxx | 337 ++++ include/svx/cube3d.hxx | 95 ++ include/svx/dataaccessdescriptor.hxx | 131 ++ include/svx/databaselocationinput.hxx | 82 + include/svx/databaseregistrationui.hxx | 42 + include/svx/dbaexchange.hxx | 275 ++++ include/svx/dbaobjectex.hxx | 73 + include/svx/def3d.hxx | 46 + include/svx/deflt3d.hxx | 97 ++ include/svx/dialcontrol.hxx | 171 ++ include/svx/dialmgr.hxx | 30 + include/svx/dialogs.hrc | 120 ++ include/svx/dlgctl3d.hxx | 184 +++ include/svx/dlgctrl.hxx | 412 +++++ include/svx/dlgutil.hxx | 38 + include/svx/drawitem.hxx | 201 +++ include/svx/dstribut_enum.hxx | 42 + include/svx/e3ditem.hxx | 49 + include/svx/e3dsceneupdater.hxx | 70 + include/svx/e3dundo.hxx | 107 ++ include/svx/extedit.hxx | 62 + include/svx/extrusionbar.hxx | 58 + include/svx/f3dchild.hxx | 44 + include/svx/fillctrl.hxx | 111 ++ include/svx/flagsdef.hxx | 130 ++ include/svx/float3d.hxx | 291 ++++ include/svx/fmdmod.hxx | 39 + include/svx/fmdpage.hxx | 64 + include/svx/fmglob.hxx | 52 + include/svx/fmgridcl.hxx | 199 +++ include/svx/fmgridif.hxx | 533 ++++++ include/svx/fmmodel.hxx | 84 + include/svx/fmobjfac.hxx | 40 + include/svx/fmpage.hxx | 79 + include/svx/fmsearch.hxx | 66 + include/svx/fmshell.hxx | 171 ++ include/svx/fmsrccfg.hxx | 145 ++ include/svx/fmsrcimp.hxx | 349 ++++ include/svx/fmtools.hxx | 175 ++ include/svx/fmview.hxx | 156 ++ include/svx/fntctrl.hxx | 75 + include/svx/fontwork.hxx | 142 ++ include/svx/fontworkbar.hxx | 58 + include/svx/fontworkgallery.hxx | 80 + include/svx/formatpaintbrushctrl.hxx | 59 + include/svx/framebordertype.hxx | 56 + include/svx/framelink.hxx | 205 +++ include/svx/framelinkarray.hxx | 324 ++++ include/svx/frmdirlbox.hxx | 71 + include/svx/frmsel.hxx | 192 +++ include/svx/galctrl.hxx | 120 ++ include/svx/gallery.hxx | 137 ++ include/svx/gallery1.hxx | 138 ++ include/svx/galleryitem.hxx | 68 + include/svx/galmisc.hxx | 197 +++ include/svx/galtheme.hxx | 217 +++ include/svx/globl3d.hxx | 36 + include/svx/grafctrl.hxx | 121 ++ include/svx/graphctl.hxx | 161 ++ include/svx/graphichelper.hxx | 43 + include/svx/grfcrop.hxx | 69 + include/svx/grfflt.hxx | 43 + include/svx/gridctrl.hxx | 599 +++++++ include/svx/hdft.hxx | 134 ++ include/svx/helperhittest3d.hxx | 99 ++ include/svx/hexcolorcontrol.hxx | 57 + include/svx/hlnkitem.hxx | 105 ++ include/svx/hyperdlg.hxx | 50 + include/svx/ifaceids.hxx | 36 + include/svx/imapdlg.hxx | 145 ++ include/svx/insctrl.hxx | 46 + include/svx/ipolypolygoneditorcontroller.hxx | 77 + include/svx/itemwin.hxx | 64 + include/svx/itextprovider.hxx | 42 + include/svx/labelitemwindow.hxx | 30 + include/svx/langbox.hxx | 117 ++ include/svx/lathe3d.hxx | 125 ++ include/svx/layctrl.hxx | 66 + include/svx/lboxctrl.hxx | 56 + include/svx/legacyitem.hxx | 60 + include/svx/linectrl.hxx | 87 + include/svx/linkwarn.hxx | 38 + include/svx/measctrl.hxx | 55 + include/svx/modctrl.hxx | 55 + include/svx/msdffdef.hxx | 858 ++++++++++ include/svx/nbdtmg.hxx | 210 +++ include/svx/nbdtmgfact.hxx | 30 + include/svx/numfmtsh.hxx | 228 +++ include/svx/numinf.hxx | 74 + include/svx/numvset.hxx | 104 ++ include/svx/obj3d.hxx | 190 +++ include/svx/objfac3d.hxx | 48 + include/svx/ofaitem.hxx | 62 + include/svx/optgenrl.hxx | 45 + include/svx/optgrid.hxx | 136 ++ include/svx/pagectrl.hxx | 153 ++ include/svx/pageitem.hxx | 117 ++ include/svx/pagenumberlistbox.hxx | 45 + include/svx/papersizelistbox.hxx | 54 + include/svx/paraprev.hxx | 103 ++ include/svx/passwd.hxx | 55 + include/svx/polypolygoneditor.hxx | 67 + include/svx/postattr.hxx | 100 ++ include/svx/pszctrl.hxx | 48 + include/svx/rectenum.hxx | 37 + include/svx/relfld.hxx | 73 + include/svx/rotmodit.hxx | 61 + include/svx/rubydialog.hxx | 140 ++ include/svx/ruler.hxx | 285 ++++ include/svx/rulritem.hxx | 232 +++ include/svx/samecontentlistbox.hxx | 32 + include/svx/scene3d.hxx | 193 +++ include/svx/sdangitm.hxx | 42 + include/svx/sdasitm.hxx | 99 ++ include/svx/sderitm.hxx | 31 + include/svx/sdgcpitm.hxx | 45 + include/svx/sdggaitm.hxx | 46 + include/svx/sdgluitm.hxx | 58 + include/svx/sdgmoitm.hxx | 52 + include/svx/sdmetitm.hxx | 46 + include/svx/sdooitm.hxx | 43 + include/svx/sdprcitm.hxx | 57 + include/svx/sdr/animation/animationstate.hxx | 66 + include/svx/sdr/animation/objectanimator.hxx | 44 + include/svx/sdr/animation/scheduler.hxx | 102 ++ .../sdr/attribute/sdrallfillattributeshelper.hxx | 93 ++ include/svx/sdr/contact/displayinfo.hxx | 107 ++ include/svx/sdr/contact/objectcontact.hxx | 175 ++ .../svx/sdr/contact/objectcontactofpageview.hxx | 120 ++ include/svx/sdr/contact/viewcontact.hxx | 148 ++ include/svx/sdr/contact/viewcontactofe3dscene.hxx | 103 ++ .../svx/sdr/contact/viewcontactofsdrmediaobj.hxx | 75 + include/svx/sdr/contact/viewcontactofsdrobj.hxx | 87 + include/svx/sdr/contact/viewcontactofvirtobj.hxx | 54 + include/svx/sdr/contact/viewobjectcontact.hxx | 138 ++ .../svx/sdr/contact/viewobjectcontactofsdrobj.hxx | 65 + .../sdr/contact/viewobjectcontactredirector.hxx | 55 + .../svx/sdr/overlay/overlayanimatedbitmapex.hxx | 84 + include/svx/sdr/overlay/overlaybitmapex.hxx | 64 + include/svx/sdr/overlay/overlaymanager.hxx | 139 ++ include/svx/sdr/overlay/overlayobject.hxx | 206 +++ include/svx/sdr/overlay/overlayobjectlist.hxx | 72 + include/svx/sdr/overlay/overlaypolypolygon.hxx | 56 + .../overlay/overlayprimitive2dsequenceobject.hxx | 50 + include/svx/sdr/overlay/overlayselection.hxx | 80 + .../sdr/primitive2d/sdrframeborderprimitive2d.hxx | 132 ++ .../svx/sdr/primitive2d/svx_primitivetypes2d.hxx | 55 + include/svx/sdr/properties/defaultproperties.hxx | 111 ++ include/svx/sdr/properties/properties.hxx | 213 +++ include/svx/sdr/table/tablecontroller.hxx | 198 +++ include/svx/sdr/table/tabledesign.hxx | 48 + include/svx/sdrhittesthelper.hxx | 73 + include/svx/sdrmasterpagedescriptor.hxx | 79 + include/svx/sdrobjectfilter.hxx | 50 + include/svx/sdrobjectuser.hxx | 51 + include/svx/sdrpageuser.hxx | 51 + include/svx/sdrpagewindow.hxx | 99 ++ include/svx/sdrpaintwindow.hxx | 150 ++ include/svx/sdrundomanager.hxx | 70 + include/svx/sdshcitm.hxx | 31 + include/svx/sdshitm.hxx | 31 + include/svx/sdshtitm.hxx | 31 + include/svx/sdsxyitm.hxx | 35 + include/svx/sdtaaitm.hxx | 38 + include/svx/sdtacitm.hxx | 36 + include/svx/sdtaditm.hxx | 50 + include/svx/sdtagitm.hxx | 35 + include/svx/sdtaiitm.hxx | 51 + include/svx/sdtaitm.hxx | 74 + include/svx/sdtakitm.hxx | 94 ++ include/svx/sdtayitm.hxx | 35 + include/svx/sdtcfitm.hxx | 31 + include/svx/sdtditm.hxx | 43 + include/svx/sdtfchim.hxx | 44 + include/svx/sdtfsitm.hxx | 66 + include/svx/sdtmfitm.hxx | 43 + include/svx/sdynitm.hxx | 41 + include/svx/searchcharmap.hxx | 70 + include/svx/selctrl.hxx | 46 + include/svx/selectioncontroller.hxx | 86 + include/svx/shapeproperty.hxx | 42 + include/svx/shapepropertynotifier.hxx | 145 ++ include/svx/sidebar/AreaPropertyPanelBase.hxx | 178 ++ .../svx/sidebar/AreaTransparencyGradientPopup.hxx | 68 + .../svx/sidebar/ContextChangeEventMultiplexer.hxx | 65 + include/svx/sidebar/LinePropertyPanelBase.hxx | 147 ++ include/svx/sidebar/LineWidthPopup.hxx | 71 + include/svx/sidebar/SelectionAnalyzer.hxx | 75 + include/svx/sidebar/SelectionChangeHandler.hxx | 77 + include/svx/sidebar/ValueSetWithTextControl.hxx | 63 + include/svx/spacinglistbox.hxx | 35 + include/svx/sphere3d.hxx | 91 ++ include/svx/srchdlg.hxx | 269 +++ include/svx/strarray.hxx | 53 + include/svx/strings.hrc | 1717 ++++++++++++++++++++ include/svx/svdcrtv.hxx | 167 ++ include/svx/svddef.hxx | 432 +++++ include/svx/svddrag.hxx | 165 ++ include/svx/svddrgmt.hxx | 305 ++++ include/svx/svddrgv.hxx | 233 +++ include/svx/svdedtv.hxx | 414 +++++ include/svx/svdedxv.hxx | 303 ++++ include/svx/svdetc.hxx | 211 +++ include/svx/svdglev.hxx | 85 + include/svx/svdglue.hxx | 149 ++ include/svx/svdhdl.hxx | 537 ++++++ include/svx/svdhlpln.hxx | 91 ++ include/svx/svditer.hxx | 74 + include/svx/svdlayer.hxx | 166 ++ include/svx/svdmark.hxx | 263 +++ include/svx/svdmodel.hxx | 633 ++++++++ include/svx/svdmrkv.hxx | 457 ++++++ include/svx/svdoashp.hxx | 256 +++ include/svx/svdoattr.hxx | 72 + include/svx/svdobj.hxx | 1099 +++++++++++++ include/svx/svdocapt.hxx | 159 ++ include/svx/svdocirc.hxx | 147 ++ include/svx/svdoedge.hxx | 412 +++++ include/svx/svdograf.hxx | 302 ++++ include/svx/svdogrp.hxx | 114 ++ include/svx/svdomeas.hxx | 201 +++ include/svx/svdomedia.hxx | 85 + include/svx/svdoole2.hxx | 205 +++ include/svx/svdopage.hxx | 72 + include/svx/svdopath.hxx | 169 ++ include/svx/svdorect.hxx | 129 ++ include/svx/svdotable.hxx | 292 ++++ include/svx/svdotext.hxx | 636 ++++++++ include/svx/svdouno.hxx | 146 ++ include/svx/svdoutl.hxx | 53 + include/svx/svdovirt.hxx | 150 ++ include/svx/svdpage.hxx | 536 ++++++ include/svx/svdpagv.hxx | 262 +++ include/svx/svdpntv.hxx | 520 ++++++ include/svx/svdpoev.hxx | 85 + include/svx/svdpool.hxx | 50 + include/svx/svdsnpv.hxx | 289 ++++ include/svx/svdsob.hxx | 92 ++ include/svx/svdtext.hxx | 83 + include/svx/svdtrans.hxx | 302 ++++ include/svx/svdtypes.hxx | 94 ++ include/svx/svdundo.hxx | 746 +++++++++ include/svx/svdview.hxx | 281 ++++ include/svx/svdviter.hxx | 87 + include/svx/svdxcgv.hxx | 116 ++ include/svx/svx3ditems.hxx | 319 ++++ include/svx/svxdlg.hxx | 464 ++++++ include/svx/svxdllapi.h | 40 + include/svx/svxerr.hxx | 62 + include/svx/svxgrahicitem.hxx | 44 + include/svx/svxids.hrc | 1023 ++++++++++++ include/svx/svxitems.hrc | 94 ++ include/svx/swframeexample.hxx | 94 ++ include/svx/swframeposstrings.hxx | 83 + include/svx/swframetypes.hxx | 48 + include/svx/swframevalidation.hxx | 85 + include/svx/sxcecitm.hxx | 98 ++ include/svx/sxcgitm.hxx | 40 + include/svx/sxciaitm.hxx | 35 + include/svx/sxcllitm.hxx | 61 + include/svx/sxctitm.hxx | 41 + include/svx/sxekitm.hxx | 44 + include/svx/sxelditm.hxx | 48 + include/svx/sxenditm.hxx | 72 + include/svx/sxmbritm.hxx | 46 + include/svx/sxmlhitm.hxx | 65 + include/svx/sxmtfitm.hxx | 70 + include/svx/sxmtpitm.hxx | 62 + include/svx/sxmtritm.hxx | 54 + include/svx/sxmuitm.hxx | 44 + include/svx/tabarea.hxx | 37 + include/svx/tabline.hxx | 35 + include/svx/tbcontrl.hxx | 281 ++++ include/svx/tbxcolor.hxx | 55 + include/svx/tbxcolorupdate.hxx | 143 ++ include/svx/tbxctl.hxx | 54 + include/svx/transfrmhelper.hxx | 51 + include/svx/txencbox.hxx | 163 ++ include/svx/txenctab.hxx | 35 + include/svx/ucsubset.hxx | 73 + include/svx/uiobject.hxx | 37 + include/svx/unoapi.hxx | 95 ++ include/svx/unobrushitemhelper.hxx | 54 + include/svx/unofill.hxx | 37 + include/svx/unomaster.hxx | 76 + include/svx/unomid.hxx | 97 ++ include/svx/unomod.hxx | 67 + include/svx/unomodel.hxx | 109 ++ include/svx/unopage.hxx | 142 ++ include/svx/unopool.hxx | 97 ++ include/svx/unoprov.hxx | 125 ++ include/svx/unoshape.hxx | 858 ++++++++++ include/svx/unoshprp.hxx | 564 +++++++ include/svx/unoshtxt.hxx | 89 + include/svx/verttexttbxctrl.hxx | 77 + include/svx/view3d.hxx | 120 ++ include/svx/viewlayoutitem.hxx | 51 + include/svx/viewpt3d.hxx | 95 ++ include/svx/weldeditview.hxx | 87 + include/svx/xbitmap.hxx | 59 + include/svx/xbtmpit.hxx | 67 + include/svx/xcolit.hxx | 57 + include/svx/xdash.hxx | 69 + include/svx/xdef.hxx | 149 ++ include/svx/xenum.hxx | 31 + include/svx/xfillit0.hxx | 55 + include/svx/xflasit.hxx | 44 + include/svx/xflbckit.hxx | 47 + include/svx/xflbmpit.hxx | 46 + include/svx/xflbmsli.hxx | 41 + include/svx/xflbmsxy.hxx | 60 + include/svx/xflbmtit.hxx | 42 + include/svx/xflboxy.hxx | 54 + include/svx/xflbstit.hxx | 42 + include/svx/xflbtoxy.hxx | 54 + include/svx/xflclit.hxx | 56 + include/svx/xflftrit.hxx | 63 + include/svx/xflgrit.hxx | 64 + include/svx/xflhtit.hxx | 63 + include/svx/xfltrit.hxx | 46 + include/svx/xftadit.hxx | 48 + include/svx/xftdiit.hxx | 42 + include/svx/xftmrit.hxx | 42 + include/svx/xftouit.hxx | 44 + include/svx/xftshcit.hxx | 44 + include/svx/xftshit.hxx | 48 + include/svx/xftshxy.hxx | 57 + include/svx/xftstit.hxx | 43 + include/svx/xgrad.hxx | 83 + include/svx/xgrscit.hxx | 45 + include/svx/xhatch.hxx | 57 + include/svx/xit.hxx | 68 + include/svx/xlineit0.hxx | 48 + include/svx/xlinjoit.hxx | 49 + include/svx/xlnasit.hxx | 44 + include/svx/xlncapit.hxx | 50 + include/svx/xlnclit.hxx | 49 + include/svx/xlndsit.hxx | 66 + include/svx/xlnedcit.hxx | 45 + include/svx/xlnedit.hxx | 61 + include/svx/xlnedwit.hxx | 48 + include/svx/xlnstcit.hxx | 45 + include/svx/xlnstit.hxx | 61 + include/svx/xlnstwit.hxx | 48 + include/svx/xlntrit.hxx | 45 + include/svx/xlnwtit.hxx | 46 + include/svx/xmleohlp.hxx | 127 ++ include/svx/xmlexchg.hxx | 89 + include/svx/xmlgrhlp.hxx | 125 ++ include/svx/xmlsecctrl.hxx | 46 + include/svx/xoutbmp.hxx | 76 + include/svx/xpoly.hxx | 154 ++ include/svx/xpool.hxx | 50 + include/svx/xsflclit.hxx | 40 + include/svx/xtable.hxx | 404 +++++ include/svx/xtextit0.hxx | 61 + include/svx/zoom_def.hxx | 30 + include/svx/zoomctrl.hxx | 62 + include/svx/zoomsliderctrl.hxx | 56 + include/svx/zoomslideritem.hxx | 54 + 417 files changed, 52192 insertions(+) create mode 100644 include/svx/AccessibilityCheckDialog.hxx create mode 100644 include/svx/AccessibleControlShape.hxx create mode 100644 include/svx/AccessibleGraphicShape.hxx create mode 100644 include/svx/AccessibleOLEShape.hxx create mode 100644 include/svx/AccessibleShape.hxx create mode 100644 include/svx/AccessibleShapeInfo.hxx create mode 100644 include/svx/AccessibleShapeTreeInfo.hxx create mode 100644 include/svx/AccessibleTextHelper.hxx create mode 100644 include/svx/ActionDescriptionProvider.hxx create mode 100644 include/svx/ChildrenManager.hxx create mode 100644 include/svx/ClassificationCommon.hxx create mode 100644 include/svx/ClassificationDialog.hxx create mode 100644 include/svx/ClassificationField.hxx create mode 100644 include/svx/ColorSets.hxx create mode 100644 include/svx/CommonStyleManager.hxx create mode 100644 include/svx/DiagramDataInterface.hxx create mode 100644 include/svx/EnhancedCustomShape2d.hxx create mode 100644 include/svx/EnhancedCustomShapeFunctionParser.hxx create mode 100644 include/svx/EnhancedCustomShapeGeometry.hxx create mode 100644 include/svx/EnhancedCustomShapeTypeNames.hxx create mode 100644 include/svx/IAccessibleParent.hxx create mode 100644 include/svx/IAccessibleViewForwarder.hxx create mode 100644 include/svx/IAccessibleViewForwarderListener.hxx create mode 100644 include/svx/ImageMapInfo.hxx create mode 100644 include/svx/Palette.hxx create mode 100644 include/svx/PaletteManager.hxx create mode 100644 include/svx/ParaLineSpacingPopup.hxx create mode 100644 include/svx/ParaSpacingControl.hxx create mode 100644 include/svx/ParseContext.hxx create mode 100644 include/svx/ShapeTypeHandler.hxx create mode 100644 include/svx/SmartTagItem.hxx create mode 100644 include/svx/SmartTagMgr.hxx create mode 100644 include/svx/SpellDialogChildWindow.hxx create mode 100644 include/svx/SvxColorChildWindow.hxx create mode 100644 include/svx/SvxColorValueSet.hxx create mode 100644 include/svx/SvxNumOptionsTabPageHelper.hxx create mode 100644 include/svx/SvxPresetListBox.hxx create mode 100644 include/svx/SvxShapeTypes.hxx create mode 100644 include/svx/TextCharacterSpacingPopup.hxx create mode 100644 include/svx/TextUnderlinePopup.hxx create mode 100644 include/svx/UnoNamespaceMap.hxx create mode 100644 include/svx/XPropertyEntry.hxx create mode 100644 include/svx/algitem.hxx create mode 100644 include/svx/anchorid.hxx create mode 100644 include/svx/autoformathelper.hxx create mode 100644 include/svx/bmpmask.hxx create mode 100644 include/svx/camera3d.hxx create mode 100644 include/svx/charmap.hxx create mode 100644 include/svx/charthelper.hxx create mode 100644 include/svx/chrtitem.hxx create mode 100644 include/svx/clipboardctl.hxx create mode 100644 include/svx/clipfmtitem.hxx create mode 100644 include/svx/colorbox.hxx create mode 100644 include/svx/colorwindow.hxx create mode 100644 include/svx/compressgraphicdialog.hxx create mode 100644 include/svx/connctrl.hxx create mode 100644 include/svx/contdlg.hxx create mode 100644 include/svx/ctredlin.hxx create mode 100644 include/svx/cube3d.hxx create mode 100644 include/svx/dataaccessdescriptor.hxx create mode 100644 include/svx/databaselocationinput.hxx create mode 100644 include/svx/databaseregistrationui.hxx create mode 100644 include/svx/dbaexchange.hxx create mode 100644 include/svx/dbaobjectex.hxx create mode 100644 include/svx/def3d.hxx create mode 100644 include/svx/deflt3d.hxx create mode 100644 include/svx/dialcontrol.hxx create mode 100644 include/svx/dialmgr.hxx create mode 100644 include/svx/dialogs.hrc create mode 100644 include/svx/dlgctl3d.hxx create mode 100644 include/svx/dlgctrl.hxx create mode 100644 include/svx/dlgutil.hxx create mode 100644 include/svx/drawitem.hxx create mode 100644 include/svx/dstribut_enum.hxx create mode 100644 include/svx/e3ditem.hxx create mode 100644 include/svx/e3dsceneupdater.hxx create mode 100644 include/svx/e3dundo.hxx create mode 100644 include/svx/extedit.hxx create mode 100644 include/svx/extrusionbar.hxx create mode 100644 include/svx/f3dchild.hxx create mode 100644 include/svx/fillctrl.hxx create mode 100644 include/svx/flagsdef.hxx create mode 100644 include/svx/float3d.hxx create mode 100644 include/svx/fmdmod.hxx create mode 100644 include/svx/fmdpage.hxx create mode 100644 include/svx/fmglob.hxx create mode 100644 include/svx/fmgridcl.hxx create mode 100644 include/svx/fmgridif.hxx create mode 100644 include/svx/fmmodel.hxx create mode 100644 include/svx/fmobjfac.hxx create mode 100644 include/svx/fmpage.hxx create mode 100644 include/svx/fmsearch.hxx create mode 100644 include/svx/fmshell.hxx create mode 100644 include/svx/fmsrccfg.hxx create mode 100644 include/svx/fmsrcimp.hxx create mode 100644 include/svx/fmtools.hxx create mode 100644 include/svx/fmview.hxx create mode 100644 include/svx/fntctrl.hxx create mode 100644 include/svx/fontwork.hxx create mode 100644 include/svx/fontworkbar.hxx create mode 100644 include/svx/fontworkgallery.hxx create mode 100644 include/svx/formatpaintbrushctrl.hxx create mode 100644 include/svx/framebordertype.hxx create mode 100644 include/svx/framelink.hxx create mode 100644 include/svx/framelinkarray.hxx create mode 100644 include/svx/frmdirlbox.hxx create mode 100644 include/svx/frmsel.hxx create mode 100644 include/svx/galctrl.hxx create mode 100644 include/svx/gallery.hxx create mode 100644 include/svx/gallery1.hxx create mode 100644 include/svx/galleryitem.hxx create mode 100644 include/svx/galmisc.hxx create mode 100644 include/svx/galtheme.hxx create mode 100644 include/svx/globl3d.hxx create mode 100644 include/svx/grafctrl.hxx create mode 100644 include/svx/graphctl.hxx create mode 100644 include/svx/graphichelper.hxx create mode 100644 include/svx/grfcrop.hxx create mode 100644 include/svx/grfflt.hxx create mode 100644 include/svx/gridctrl.hxx create mode 100644 include/svx/hdft.hxx create mode 100644 include/svx/helperhittest3d.hxx create mode 100644 include/svx/hexcolorcontrol.hxx create mode 100644 include/svx/hlnkitem.hxx create mode 100644 include/svx/hyperdlg.hxx create mode 100644 include/svx/ifaceids.hxx create mode 100644 include/svx/imapdlg.hxx create mode 100644 include/svx/insctrl.hxx create mode 100644 include/svx/ipolypolygoneditorcontroller.hxx create mode 100644 include/svx/itemwin.hxx create mode 100644 include/svx/itextprovider.hxx create mode 100644 include/svx/labelitemwindow.hxx create mode 100644 include/svx/langbox.hxx create mode 100644 include/svx/lathe3d.hxx create mode 100644 include/svx/layctrl.hxx create mode 100644 include/svx/lboxctrl.hxx create mode 100644 include/svx/legacyitem.hxx create mode 100644 include/svx/linectrl.hxx create mode 100644 include/svx/linkwarn.hxx create mode 100644 include/svx/measctrl.hxx create mode 100644 include/svx/modctrl.hxx create mode 100644 include/svx/msdffdef.hxx create mode 100644 include/svx/nbdtmg.hxx create mode 100644 include/svx/nbdtmgfact.hxx create mode 100644 include/svx/numfmtsh.hxx create mode 100644 include/svx/numinf.hxx create mode 100644 include/svx/numvset.hxx create mode 100644 include/svx/obj3d.hxx create mode 100644 include/svx/objfac3d.hxx create mode 100644 include/svx/ofaitem.hxx create mode 100644 include/svx/optgenrl.hxx create mode 100644 include/svx/optgrid.hxx create mode 100644 include/svx/pagectrl.hxx create mode 100644 include/svx/pageitem.hxx create mode 100644 include/svx/pagenumberlistbox.hxx create mode 100644 include/svx/papersizelistbox.hxx create mode 100644 include/svx/paraprev.hxx create mode 100644 include/svx/passwd.hxx create mode 100644 include/svx/polypolygoneditor.hxx create mode 100644 include/svx/postattr.hxx create mode 100644 include/svx/pszctrl.hxx create mode 100644 include/svx/rectenum.hxx create mode 100644 include/svx/relfld.hxx create mode 100644 include/svx/rotmodit.hxx create mode 100644 include/svx/rubydialog.hxx create mode 100644 include/svx/ruler.hxx create mode 100644 include/svx/rulritem.hxx create mode 100644 include/svx/samecontentlistbox.hxx create mode 100644 include/svx/scene3d.hxx create mode 100644 include/svx/sdangitm.hxx create mode 100644 include/svx/sdasitm.hxx create mode 100644 include/svx/sderitm.hxx create mode 100644 include/svx/sdgcpitm.hxx create mode 100644 include/svx/sdggaitm.hxx create mode 100644 include/svx/sdgluitm.hxx create mode 100644 include/svx/sdgmoitm.hxx create mode 100644 include/svx/sdmetitm.hxx create mode 100644 include/svx/sdooitm.hxx create mode 100644 include/svx/sdprcitm.hxx create mode 100644 include/svx/sdr/animation/animationstate.hxx create mode 100644 include/svx/sdr/animation/objectanimator.hxx create mode 100644 include/svx/sdr/animation/scheduler.hxx create mode 100644 include/svx/sdr/attribute/sdrallfillattributeshelper.hxx create mode 100644 include/svx/sdr/contact/displayinfo.hxx create mode 100644 include/svx/sdr/contact/objectcontact.hxx create mode 100644 include/svx/sdr/contact/objectcontactofpageview.hxx create mode 100644 include/svx/sdr/contact/viewcontact.hxx create mode 100644 include/svx/sdr/contact/viewcontactofe3dscene.hxx create mode 100644 include/svx/sdr/contact/viewcontactofsdrmediaobj.hxx create mode 100644 include/svx/sdr/contact/viewcontactofsdrobj.hxx create mode 100644 include/svx/sdr/contact/viewcontactofvirtobj.hxx create mode 100644 include/svx/sdr/contact/viewobjectcontact.hxx create mode 100644 include/svx/sdr/contact/viewobjectcontactofsdrobj.hxx create mode 100644 include/svx/sdr/contact/viewobjectcontactredirector.hxx create mode 100644 include/svx/sdr/overlay/overlayanimatedbitmapex.hxx create mode 100644 include/svx/sdr/overlay/overlaybitmapex.hxx create mode 100644 include/svx/sdr/overlay/overlaymanager.hxx create mode 100644 include/svx/sdr/overlay/overlayobject.hxx create mode 100644 include/svx/sdr/overlay/overlayobjectlist.hxx create mode 100644 include/svx/sdr/overlay/overlaypolypolygon.hxx create mode 100644 include/svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx create mode 100644 include/svx/sdr/overlay/overlayselection.hxx create mode 100644 include/svx/sdr/primitive2d/sdrframeborderprimitive2d.hxx create mode 100644 include/svx/sdr/primitive2d/svx_primitivetypes2d.hxx create mode 100644 include/svx/sdr/properties/defaultproperties.hxx create mode 100644 include/svx/sdr/properties/properties.hxx create mode 100644 include/svx/sdr/table/tablecontroller.hxx create mode 100644 include/svx/sdr/table/tabledesign.hxx create mode 100644 include/svx/sdrhittesthelper.hxx create mode 100644 include/svx/sdrmasterpagedescriptor.hxx create mode 100644 include/svx/sdrobjectfilter.hxx create mode 100644 include/svx/sdrobjectuser.hxx create mode 100644 include/svx/sdrpageuser.hxx create mode 100644 include/svx/sdrpagewindow.hxx create mode 100644 include/svx/sdrpaintwindow.hxx create mode 100644 include/svx/sdrundomanager.hxx create mode 100644 include/svx/sdshcitm.hxx create mode 100644 include/svx/sdshitm.hxx create mode 100644 include/svx/sdshtitm.hxx create mode 100644 include/svx/sdsxyitm.hxx create mode 100644 include/svx/sdtaaitm.hxx create mode 100644 include/svx/sdtacitm.hxx create mode 100644 include/svx/sdtaditm.hxx create mode 100644 include/svx/sdtagitm.hxx create mode 100644 include/svx/sdtaiitm.hxx create mode 100644 include/svx/sdtaitm.hxx create mode 100644 include/svx/sdtakitm.hxx create mode 100644 include/svx/sdtayitm.hxx create mode 100644 include/svx/sdtcfitm.hxx create mode 100644 include/svx/sdtditm.hxx create mode 100644 include/svx/sdtfchim.hxx create mode 100644 include/svx/sdtfsitm.hxx create mode 100644 include/svx/sdtmfitm.hxx create mode 100644 include/svx/sdynitm.hxx create mode 100644 include/svx/searchcharmap.hxx create mode 100644 include/svx/selctrl.hxx create mode 100644 include/svx/selectioncontroller.hxx create mode 100644 include/svx/shapeproperty.hxx create mode 100644 include/svx/shapepropertynotifier.hxx create mode 100644 include/svx/sidebar/AreaPropertyPanelBase.hxx create mode 100644 include/svx/sidebar/AreaTransparencyGradientPopup.hxx create mode 100644 include/svx/sidebar/ContextChangeEventMultiplexer.hxx create mode 100644 include/svx/sidebar/LinePropertyPanelBase.hxx create mode 100644 include/svx/sidebar/LineWidthPopup.hxx create mode 100644 include/svx/sidebar/SelectionAnalyzer.hxx create mode 100644 include/svx/sidebar/SelectionChangeHandler.hxx create mode 100644 include/svx/sidebar/ValueSetWithTextControl.hxx create mode 100644 include/svx/spacinglistbox.hxx create mode 100644 include/svx/sphere3d.hxx create mode 100644 include/svx/srchdlg.hxx create mode 100644 include/svx/strarray.hxx create mode 100644 include/svx/strings.hrc create mode 100644 include/svx/svdcrtv.hxx create mode 100644 include/svx/svddef.hxx create mode 100644 include/svx/svddrag.hxx create mode 100644 include/svx/svddrgmt.hxx create mode 100644 include/svx/svddrgv.hxx create mode 100644 include/svx/svdedtv.hxx create mode 100644 include/svx/svdedxv.hxx create mode 100644 include/svx/svdetc.hxx create mode 100644 include/svx/svdglev.hxx create mode 100644 include/svx/svdglue.hxx create mode 100644 include/svx/svdhdl.hxx create mode 100644 include/svx/svdhlpln.hxx create mode 100644 include/svx/svditer.hxx create mode 100644 include/svx/svdlayer.hxx create mode 100644 include/svx/svdmark.hxx create mode 100644 include/svx/svdmodel.hxx create mode 100644 include/svx/svdmrkv.hxx create mode 100644 include/svx/svdoashp.hxx create mode 100644 include/svx/svdoattr.hxx create mode 100644 include/svx/svdobj.hxx create mode 100644 include/svx/svdocapt.hxx create mode 100644 include/svx/svdocirc.hxx create mode 100644 include/svx/svdoedge.hxx create mode 100644 include/svx/svdograf.hxx create mode 100644 include/svx/svdogrp.hxx create mode 100644 include/svx/svdomeas.hxx create mode 100644 include/svx/svdomedia.hxx create mode 100644 include/svx/svdoole2.hxx create mode 100644 include/svx/svdopage.hxx create mode 100644 include/svx/svdopath.hxx create mode 100644 include/svx/svdorect.hxx create mode 100644 include/svx/svdotable.hxx create mode 100644 include/svx/svdotext.hxx create mode 100644 include/svx/svdouno.hxx create mode 100644 include/svx/svdoutl.hxx create mode 100644 include/svx/svdovirt.hxx create mode 100644 include/svx/svdpage.hxx create mode 100644 include/svx/svdpagv.hxx create mode 100644 include/svx/svdpntv.hxx create mode 100644 include/svx/svdpoev.hxx create mode 100644 include/svx/svdpool.hxx create mode 100644 include/svx/svdsnpv.hxx create mode 100644 include/svx/svdsob.hxx create mode 100644 include/svx/svdtext.hxx create mode 100644 include/svx/svdtrans.hxx create mode 100644 include/svx/svdtypes.hxx create mode 100644 include/svx/svdundo.hxx create mode 100644 include/svx/svdview.hxx create mode 100644 include/svx/svdviter.hxx create mode 100644 include/svx/svdxcgv.hxx create mode 100644 include/svx/svx3ditems.hxx create mode 100644 include/svx/svxdlg.hxx create mode 100644 include/svx/svxdllapi.h create mode 100644 include/svx/svxerr.hxx create mode 100644 include/svx/svxgrahicitem.hxx create mode 100644 include/svx/svxids.hrc create mode 100644 include/svx/svxitems.hrc create mode 100644 include/svx/swframeexample.hxx create mode 100644 include/svx/swframeposstrings.hxx create mode 100644 include/svx/swframetypes.hxx create mode 100644 include/svx/swframevalidation.hxx create mode 100644 include/svx/sxcecitm.hxx create mode 100644 include/svx/sxcgitm.hxx create mode 100644 include/svx/sxciaitm.hxx create mode 100644 include/svx/sxcllitm.hxx create mode 100644 include/svx/sxctitm.hxx create mode 100644 include/svx/sxekitm.hxx create mode 100644 include/svx/sxelditm.hxx create mode 100644 include/svx/sxenditm.hxx create mode 100644 include/svx/sxmbritm.hxx create mode 100644 include/svx/sxmlhitm.hxx create mode 100644 include/svx/sxmtfitm.hxx create mode 100644 include/svx/sxmtpitm.hxx create mode 100644 include/svx/sxmtritm.hxx create mode 100644 include/svx/sxmuitm.hxx create mode 100644 include/svx/tabarea.hxx create mode 100644 include/svx/tabline.hxx create mode 100644 include/svx/tbcontrl.hxx create mode 100644 include/svx/tbxcolor.hxx create mode 100644 include/svx/tbxcolorupdate.hxx create mode 100644 include/svx/tbxctl.hxx create mode 100644 include/svx/transfrmhelper.hxx create mode 100644 include/svx/txencbox.hxx create mode 100644 include/svx/txenctab.hxx create mode 100644 include/svx/ucsubset.hxx create mode 100644 include/svx/uiobject.hxx create mode 100644 include/svx/unoapi.hxx create mode 100644 include/svx/unobrushitemhelper.hxx create mode 100644 include/svx/unofill.hxx create mode 100644 include/svx/unomaster.hxx create mode 100644 include/svx/unomid.hxx create mode 100644 include/svx/unomod.hxx create mode 100644 include/svx/unomodel.hxx create mode 100644 include/svx/unopage.hxx create mode 100644 include/svx/unopool.hxx create mode 100644 include/svx/unoprov.hxx create mode 100644 include/svx/unoshape.hxx create mode 100644 include/svx/unoshprp.hxx create mode 100644 include/svx/unoshtxt.hxx create mode 100644 include/svx/verttexttbxctrl.hxx create mode 100644 include/svx/view3d.hxx create mode 100644 include/svx/viewlayoutitem.hxx create mode 100644 include/svx/viewpt3d.hxx create mode 100644 include/svx/weldeditview.hxx create mode 100644 include/svx/xbitmap.hxx create mode 100644 include/svx/xbtmpit.hxx create mode 100644 include/svx/xcolit.hxx create mode 100644 include/svx/xdash.hxx create mode 100644 include/svx/xdef.hxx create mode 100644 include/svx/xenum.hxx create mode 100644 include/svx/xfillit0.hxx create mode 100644 include/svx/xflasit.hxx create mode 100644 include/svx/xflbckit.hxx create mode 100644 include/svx/xflbmpit.hxx create mode 100644 include/svx/xflbmsli.hxx create mode 100644 include/svx/xflbmsxy.hxx create mode 100644 include/svx/xflbmtit.hxx create mode 100644 include/svx/xflboxy.hxx create mode 100644 include/svx/xflbstit.hxx create mode 100644 include/svx/xflbtoxy.hxx create mode 100644 include/svx/xflclit.hxx create mode 100644 include/svx/xflftrit.hxx create mode 100644 include/svx/xflgrit.hxx create mode 100644 include/svx/xflhtit.hxx create mode 100644 include/svx/xfltrit.hxx create mode 100644 include/svx/xftadit.hxx create mode 100644 include/svx/xftdiit.hxx create mode 100644 include/svx/xftmrit.hxx create mode 100644 include/svx/xftouit.hxx create mode 100644 include/svx/xftshcit.hxx create mode 100644 include/svx/xftshit.hxx create mode 100644 include/svx/xftshxy.hxx create mode 100644 include/svx/xftstit.hxx create mode 100644 include/svx/xgrad.hxx create mode 100644 include/svx/xgrscit.hxx create mode 100644 include/svx/xhatch.hxx create mode 100644 include/svx/xit.hxx create mode 100644 include/svx/xlineit0.hxx create mode 100644 include/svx/xlinjoit.hxx create mode 100644 include/svx/xlnasit.hxx create mode 100644 include/svx/xlncapit.hxx create mode 100644 include/svx/xlnclit.hxx create mode 100644 include/svx/xlndsit.hxx create mode 100644 include/svx/xlnedcit.hxx create mode 100644 include/svx/xlnedit.hxx create mode 100644 include/svx/xlnedwit.hxx create mode 100644 include/svx/xlnstcit.hxx create mode 100644 include/svx/xlnstit.hxx create mode 100644 include/svx/xlnstwit.hxx create mode 100644 include/svx/xlntrit.hxx create mode 100644 include/svx/xlnwtit.hxx create mode 100644 include/svx/xmleohlp.hxx create mode 100644 include/svx/xmlexchg.hxx create mode 100644 include/svx/xmlgrhlp.hxx create mode 100644 include/svx/xmlsecctrl.hxx create mode 100644 include/svx/xoutbmp.hxx create mode 100644 include/svx/xpoly.hxx create mode 100644 include/svx/xpool.hxx create mode 100644 include/svx/xsflclit.hxx create mode 100644 include/svx/xtable.hxx create mode 100644 include/svx/xtextit0.hxx create mode 100644 include/svx/zoom_def.hxx create mode 100644 include/svx/zoomctrl.hxx create mode 100644 include/svx/zoomsliderctrl.hxx create mode 100644 include/svx/zoomslideritem.hxx (limited to 'include/svx') diff --git a/include/svx/AccessibilityCheckDialog.hxx b/include/svx/AccessibilityCheckDialog.hxx new file mode 100644 index 000000000..9c17aba29 --- /dev/null +++ b/include/svx/AccessibilityCheckDialog.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/. + * + */ + +#ifndef INCLUDED_SVX_ACCESSIBILITYCHECKDIALOG_HXX +#define INCLUDED_SVX_ACCESSIBILITYCHECKDIALOG_HXX + +#include +#include +#include +#include +#include +#include + +namespace svx +{ +class AccessibilityCheckEntry final +{ +private: + std::unique_ptr m_xBuilder; + std::unique_ptr m_xContainer; + std::unique_ptr m_xLabel; + std::unique_ptr m_xGotoButton; + + std::shared_ptr const& m_pAccessibilityIssue; + +public: + AccessibilityCheckEntry(weld::Container* pParent, + std::shared_ptr const& pAccessibilityIssue); + + weld::Widget* get_widget() const { return m_xContainer.get(); } + + DECL_LINK(GotoButtonClicked, weld::Button&, void); +}; + +class SVX_DLLPUBLIC AccessibilityCheckDialog final : public weld::GenericDialogController +{ +private: + sfx::AccessibilityIssueCollection m_aIssueCollection; + std::vector> m_aAccessibilityCheckEntries; + + // Controls + std::unique_ptr m_xAccessibilityCheckBox; + +public: + AccessibilityCheckDialog(weld::Window* pParent, + sfx::AccessibilityIssueCollection const& rIssueCollection); + virtual ~AccessibilityCheckDialog() override; + virtual short run() override; +}; + +} // end svx namespace + +#endif // INCLUDED_SVX_ACCESSIBILITYCHECKDIALOG_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/AccessibleControlShape.hxx b/include/svx/AccessibleControlShape.hxx new file mode 100644 index 000000000..a90ab5ee9 --- /dev/null +++ b/include/svx/AccessibleControlShape.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_SVX_ACCESSIBLECONTROLSHAPE_HXX +#define INCLUDED_SVX_ACCESSIBLECONTROLSHAPE_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace com::sun::star { + namespace accessibility { class XAccessible; } + namespace accessibility { class XAccessibleContext; } + namespace accessibility { struct AccessibleEventObject; } + namespace accessibility { class XAccessibleRelationSet; } + namespace awt { class XControl; } + namespace beans { class XPropertySet; } + namespace beans { class XPropertySetInfo; } + namespace beans { struct PropertyChangeEvent; } + namespace container { struct ContainerEvent; } + namespace lang { class XComponent; } + namespace lang { class XTypeProvider; } + namespace uno { class XAggregation; } + namespace util { struct ModeChangeEvent; } +} + +namespace comphelper +{ + class OWrappedAccessibleChildrenManager; +} + +namespace accessibility { + + class AccessibleShapeInfo; + class AccessibleShapeTreeInfo; + + typedef ::cppu::ImplHelper4 < css::beans::XPropertyChangeListener + , css::util::XModeChangeListener + , css::container::XContainerListener + , css::accessibility::XAccessibleEventListener + > AccessibleControlShape_Base; +/** @descr +*/ +class SAL_DLLPUBLIC_RTTI AccessibleControlShape final + :public AccessibleShape + ,public AccessibleControlShape_Base +{ +public: + //===== internal ======================================================== + AccessibleControlShape( + const AccessibleShapeInfo& rShapeInfo, + const AccessibleShapeTreeInfo& rShapeTreeInfo); + virtual ~AccessibleControlShape( ) override; + + const css::uno::Reference< css::beans::XPropertySet >& GetControlModel( ) const { return m_xControlModel;} + AccessibleControlShape* GetLabeledByControlShape(); + +private: + //--- XAccessibleComponent ------------------------------- + /// forward the focus to the contained control(in alive mode) + virtual void SAL_CALL grabFocus( ) override; + + //--- XAccessibleContext --------------------------------- + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) override; + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) override; + virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) override; + + //--- XServiceInfo --------------------------------------- + virtual OUString SAL_CALL getImplementationName( ) override; + + //--- XInterface ----------------------------------------- + DECLARE_XINTERFACE( ) + + //--- XTypeProvider -------------------------------------- + DECLARE_XTYPEPROVIDER( ) + + //--- XPropertyChangeListener ---------------------------- + virtual void SAL_CALL propertyChange( const css::beans::PropertyChangeEvent& _rEvent ) override; + + //--- XComponent ----------------------------------------- + virtual void SAL_CALL disposing( ) override; + + //--- XEventListener ------------------------------------- + virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override; + + //--- XModeChangeListener -------------------------------- + virtual void SAL_CALL modeChanged( const css::util::ModeChangeEvent& _rSource ) override; + + //--- XAccessibleEventListener ---------------------------- + virtual void SAL_CALL notifyEvent( const css::accessibility::AccessibleEventObject& aEvent ) override; + + // XVclContainerListener + virtual void SAL_CALL elementInserted( const css::container::ContainerEvent& Event ) override; + virtual void SAL_CALL elementRemoved( const css::container::ContainerEvent& Event ) override; + virtual void SAL_CALL elementReplaced( const css::container::ContainerEvent& Event ) override; + + /** Initialize a new shape. See the documentation of the base' constructor + for the reason of this method's existence. + */ + virtual void Init( ) override; + + /// Create a name string that contains the accessible name. + virtual OUString + CreateAccessibleBaseName( ) override; + + /** Create a unique name string that contains the accessible name. The + name consists of the base name and the index. + */ + virtual OUString + CreateAccessibleName( ) override; + + /// Create a description string that contains the accessible description. + OUString CreateAccessibleDescription(); + +#ifdef DBG_UTIL + /// Set the specified state + virtual bool SetState( sal_Int16 _nState ) override; +#endif // DBG_UTIL + + /// (safely) reads the given property from the model of the UNO control + OUString getControlModelStringProperty( const OUString& _rPropertyName ) const; + + /// ensure that our control model exists(will be retrieved upon need only) + bool ensureControlModelAccess( ); + + /// ensures that we're listening for the given property if(and only if!) necessary + bool ensureListeningState( const bool _bCurrentlyListening, const bool _bNeedNewListening, + const OUString& _rPropertyName ); + + /// starts multiplexing the state changes of our aggregate context + void startStateMultiplexing( ); + /// stops multiplexing the state changes of our aggregate context + void stopStateMultiplexing( ); + + /** adjusts our AccessibleRole, depending on the control type we're working for + +

Only to be called during initialization

+ */ + void adjustAccessibleRole( ); + + /** initializes composed states of the context + +

Some of the states of our inner context need to be propagated to the "composed context", too + (such as "checked" for check boxes). At lifetime, this is done by multiplexing state changes, + at initialization time, this method is used.

+ */ + void initializeComposedState( ); + + AccessibleControlShape(const AccessibleControlShape&) = delete; + AccessibleControlShape& operator= (const AccessibleControlShape&) = delete; + + css::uno::Reference< css::beans::XPropertySet > + m_xControlModel; + css::uno::Reference< css::beans::XPropertySetInfo > + m_xModelPropsMeta; // cache this for performance reasons + css::uno::Reference< css::awt::XControl > + m_xUnoControl; // our UNO control + + css::uno::WeakReference< css::accessibility::XAccessibleContext > + m_aControlContext; // the AccessibleContext of the control + css::uno::Reference< css::uno::XAggregation > + m_xControlContextProxy; // the proxy for "aggregating" the AccessibleContext of the control + css::uno::Reference< css::lang::XTypeProvider > + m_xControlContextTypeAccess; // cached interface of our aggregate + css::uno::Reference< css::lang::XComponent > + m_xControlContextComponent; // cached interface of our aggregate + + rtl::Reference<::comphelper::OWrappedAccessibleChildrenManager> + m_pChildManager; + + bool m_bListeningForName : 1; // are we currently listening for changes of the "Name" property? + bool m_bListeningForDesc : 1; // are we currently listening for changes of the "HelpText" property? + bool m_bMultiplexingStates : 1; // are we currently multiplexing state changes of the native context? + bool m_bDisposeNativeContext : 1; // do we need to dispose mxNativeContextComponent? + bool m_bWaitingForControl : 1; // if we are created before our control exists, we need to wait for it to appear ... +}; + +} // end of namespace accessibility + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/AccessibleGraphicShape.hxx b/include/svx/AccessibleGraphicShape.hxx new file mode 100644 index 000000000..fcffbdd39 --- /dev/null +++ b/include/svx/AccessibleGraphicShape.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_SVX_ACCESSIBLEGRAPHICSHAPE_HXX +#define INCLUDED_SVX_ACCESSIBLEGRAPHICSHAPE_HXX + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace accessibility { + +class AccessibleShapeInfo; +class AccessibleShapeTreeInfo; + +/** @descr + This class makes graphic shapes accessible. With respect to its + base class AccessibleShape it supports the additional + XAccessibleImage interface. +*/ +class SVX_DLLPUBLIC AccessibleGraphicShape + : public AccessibleShape, + public css::accessibility::XAccessibleImage +{ +public: + //===== internal ======================================================== + AccessibleGraphicShape ( + const AccessibleShapeInfo& rShapeInfo, + const AccessibleShapeTreeInfo& rShapeTreeInfo); + + virtual ~AccessibleGraphicShape() override; + + //===== XAccessibleImage ================================================ + + OUString SAL_CALL getAccessibleImageDescription() override; + + sal_Int32 SAL_CALL getAccessibleImageHeight() override; + + sal_Int32 SAL_CALL getAccessibleImageWidth() override; + + //===== XInterface ====================================================== + + virtual css::uno::Any SAL_CALL + queryInterface (const css::uno::Type & rType) override; + + virtual void SAL_CALL + acquire() + throw () override; + + virtual void SAL_CALL + release() + throw () override; + + //===== XServiceInfo ==================================================== + + /** Returns an identifier for the implementation of this object. + */ + virtual OUString SAL_CALL + getImplementationName() override; + + virtual css::uno::Sequence< OUString> SAL_CALL + getSupportedServiceNames() override; + + //===== XTypeProvider =================================================== + + virtual css::uno::Sequence< css::uno::Type> SAL_CALL + getTypes() override; + +protected: + /// Create a name string that contains the accessible name. + virtual OUString + CreateAccessibleBaseName () override; + +private: + AccessibleGraphicShape (const AccessibleGraphicShape&) = delete; + + AccessibleGraphicShape& operator= (const AccessibleGraphicShape&) = delete; +}; + +} // end of namespace accessibility + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/AccessibleOLEShape.hxx b/include/svx/AccessibleOLEShape.hxx new file mode 100644 index 000000000..5119da016 --- /dev/null +++ b/include/svx/AccessibleOLEShape.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_SVX_ACCESSIBLEOLESHAPE_HXX +#define INCLUDED_SVX_ACCESSIBLEOLESHAPE_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace com::sun::star { + namespace accessibility { class XAccessibleKeyBinding; } +} + +namespace accessibility { + +class AccessibleShapeInfo; +class AccessibleShapeTreeInfo; + +/** @descr + This class makes OLE objects accessible. With respect to its + base class AccessibleShape it supports the additional + XAccessibleAction interface. +*/ +class SVX_DLLPUBLIC AccessibleOLEShape + : public AccessibleShape, + public css::accessibility::XAccessibleAction +{ +public: + //===== internal ======================================================== + AccessibleOLEShape ( + const AccessibleShapeInfo& rShapeInfo, + const AccessibleShapeTreeInfo& rShapeTreeInfo); + virtual ~AccessibleOLEShape() override; + + //===== XAccessibleAction =============================================== + + sal_Int32 SAL_CALL getAccessibleActionCount() override; + + sal_Bool SAL_CALL doAccessibleAction (sal_Int32 nIndex) override; + + OUString SAL_CALL getAccessibleActionDescription (sal_Int32 nIndex) override; + + css::uno::Reference< + css::accessibility::XAccessibleKeyBinding> SAL_CALL getAccessibleActionKeyBinding ( + sal_Int32 nIndex) override; + + //===== XInterface ====================================================== + + virtual css::uno::Any SAL_CALL + queryInterface (const css::uno::Type & rType) override; + + virtual void SAL_CALL + acquire() + throw () override; + + virtual void SAL_CALL + release() + throw () override; + + //===== XServiceInfo ==================================================== + + virtual OUString SAL_CALL + getImplementationName() override; + + virtual css::uno::Sequence< OUString> SAL_CALL + getSupportedServiceNames() override; + + //===== XTypeProvider =================================================== + + virtual css::uno::Sequence< css::uno::Type> SAL_CALL + getTypes() override; +// ====== XAccessibleExtendedAttributes ===================================== + virtual css::uno::Any SAL_CALL getExtendedAttributes() override ; +protected: + /// Create a name string that contains the accessible name. + virtual OUString + CreateAccessibleBaseName () override; + +private: + AccessibleOLEShape (const AccessibleOLEShape&) = delete; + + AccessibleOLEShape& operator= (const AccessibleOLEShape&) = delete; +}; + +} // end of namespace accessibility + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/AccessibleShape.hxx b/include/svx/AccessibleShape.hxx new file mode 100644 index 000000000..046463e66 --- /dev/null +++ b/include/svx/AccessibleShape.hxx @@ -0,0 +1,439 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +#ifndef INCLUDED_SVX_ACCESSIBLESHAPE_HXX +#define INCLUDED_SVX_ACCESSIBLESHAPE_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 + +namespace com::sun::star { + namespace accessibility { class XAccessible; } + namespace accessibility { class XAccessibleEventListener; } + namespace accessibility { class XAccessibleHyperlink; } + namespace accessibility { class XAccessibleRelationSet; } + namespace accessibility { class XAccessibleStateSet; } + namespace beans { struct PropertyValue; } + namespace document { struct EventObject; } + namespace drawing { class XShape; } + namespace uno { class XInterface; } +} + +class SdrObject; + +namespace accessibility { + +class AccessibleShapeInfo; +class AccessibleTextHelper; +class ChildrenManager; +class IAccessibleParent; + +/** This base class provides a base implementation for all shapes. For more + detailed documentation about the methods refer to the descriptions of + the implemented interfaces. These are, among others, + XAccessible, XAccessibleContext, + XAccessibleComponent and + XAccessibleExtendedComponent. + +

The children of a shape can stem from two sources which, in case of + SVX and SD shapes, are mutually exclusive. This implementation, + however, handles both simultaneously to cope with future extensions or + shapes from other projects. +

    +
  • If this shape is a group shape, i.e. a + SvxShapeGroup or a Svx3DSceneObject, it + can have nested shapes.
  • +
  • If this shape is a descendant from SvxShapeText + then the text paragraphs are its children.
  • +
+

+ +

Accessible shapes do not listen for disposing() calls of the UNO + shapes they make accessible. This is the task of their owner, usually a + container, who can then call dispose() at the accessible object.

+*/ +class SVX_DLLPUBLIC AccessibleShape + : public AccessibleContextBase, + public AccessibleComponentBase, + public css::accessibility::XAccessibleSelection, + public css::accessibility::XAccessibleExtendedAttributes, + public css::accessibility::XAccessibleGroupPosition, + public css::accessibility::XAccessibleHypertext, + public IAccessibleViewForwarderListener, + public css::document::XShapeEventListener, + public css::lang::XUnoTunnel +{ +public: + //===== internal ======================================================== + + /** Create a new accessible object that makes the given shape accessible. + @param rShapeInfo + This object contains all information specific to the new + accessible shape. That are e.g. the shape to be made accessible + and the accessible object that will become the parent of the new + object. + @param rShapeTreeInfo + Bundle of information passed to this shape and all of its descendants. + @attention + Always call the init method after creating a + new accessible shape. This is one way to overcome the potential + problem of registering the new object with e.g. event + broadcasters. That would delete the new object if a broadcaster + would not keep a strong reference to the new object. + */ + AccessibleShape ( + const AccessibleShapeInfo& rShapeInfo, + const AccessibleShapeTreeInfo& rShapeTreeInfo); + //Solution: Overwrite the object's current name. + virtual OUString SAL_CALL getAccessibleName() override; + virtual OUString SAL_CALL getAccessibleDescription() override; + virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet> SAL_CALL getAccessibleRelationSet() override; +//===== XAccessibleSelection ============================================ + + virtual void SAL_CALL selectAccessibleChild( + sal_Int32 nChildIndex ) override; + + virtual sal_Bool SAL_CALL isAccessibleChildSelected( + sal_Int32 nChildIndex ) override; + + virtual void SAL_CALL clearAccessibleSelection( ) override; + + virtual void SAL_CALL selectAllAccessibleChildren( ) override; + + virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) override; + + virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( + sal_Int32 nSelectedChildIndex ) override; + + virtual void SAL_CALL deselectAccessibleChild( + sal_Int32 nSelectedChildIndex ) override; + + // ====== XAccessibleExtendedAttributes ===================================== + virtual css::uno::Any SAL_CALL getExtendedAttributes() override ; + /// Return this object's role. + virtual sal_Int16 SAL_CALL getAccessibleRole() override; + //===== XAccessibleGroupPosition ========================================= + virtual css::uno::Sequence< sal_Int32 > SAL_CALL + getGroupPosition( const css::uno::Any& rAny ) override; + virtual OUString SAL_CALL getObjectLink( const css::uno::Any& accoject ) override; + /** The destructor releases its children manager and text engine if + still existent. These are responsible to send appropriate events. + */ + virtual ~AccessibleShape() override; + + /** Initialize a new shape. See the documentation of the constructor + for the reason of this method's existence. + */ + virtual void Init(); + + /** Set the specified state. If the state is FOCUSED + then, additionally to the inherited functionality, the focus + listeners registered with the XAccessibleComponent + interface are called (if that state really changes). + + @param aState + The state to turn on. + + @return + The returned flag indicates whether the specified state has been + changed (), i.e. it has formerly not been set. + */ + virtual bool SetState (sal_Int16 aState) override; + + /** Reset the specified state. If the state is FOCUSED + then, additionally to the inherited functionality, the focus + listeners registered with the XAccessibleComponent + interface are called (if that state really changes). + + @param aState + The state to turn off. + + @return + The returned flag indicates whether the specified state has been + changed (), i.e. it has formerly been set. + */ + virtual bool ResetState (sal_Int16 aState) override; + + /** Return the state of the specified state. Take the + FOCUSED state from the accessible edit engine. + + @param aState + The state for which to return its value. + @return + A value of indicates that the state is set. A + value indicates an unset state or the inability to access the + entity that manages the state set. + + */ + bool GetState (sal_Int16 aState); + + + //===== XAccessibleContext ============================================== + + /// Return the number of currently visible children. + virtual sal_Int32 SAL_CALL + getAccessibleChildCount() override; + + /** Return the specified child. + @param nIndex + Index of the requested child. + @return + Reference of the requested child which is the accessible object + of a visible shape. + @throws IndexOutOfBoundsException + Throws an exception if the index is not valid. + */ + virtual css::uno::Reference< + css::accessibility::XAccessible> SAL_CALL + getAccessibleChild (sal_Int32 nIndex) override; + + + /// Return the set of current states. + virtual css::uno::Reference< + css::accessibility::XAccessibleStateSet> SAL_CALL + getAccessibleStateSet() override; + + /// Return this objects index among the parents children. + virtual sal_Int32 SAL_CALL + getAccessibleIndexInParent() override; + + //===== XAccessibleComponent ============================================ + + virtual css::uno::Reference< + css::accessibility::XAccessible > SAL_CALL + getAccessibleAtPoint (const css::awt::Point& aPoint) override; + + virtual css::awt::Rectangle SAL_CALL getBounds() override; + + virtual css::awt::Point SAL_CALL getLocation() override; + + virtual css::awt::Point SAL_CALL getLocationOnScreen() override; + + virtual css::awt::Size SAL_CALL getSize() override; + + virtual sal_Int32 SAL_CALL getForeground() override; + + virtual sal_Int32 SAL_CALL getBackground() override; + + //===== XAccessibleEventBroadcaster ===================================== + + /** This call is forwarded to a) the base class and b) to the + accessible edit engine if it is present. + + @param rxListener + This listener is informed about accessibility events. + */ + virtual void SAL_CALL + addAccessibleEventListener ( + const css::uno::Reference< + css::accessibility::XAccessibleEventListener >& rxListener) override; + + /** This call is forwarded to a) the base class and b) to the + accessible edit engine if it is present. + + @param rxListener + This listener will not be informed about accessibility events + anymore. + */ + virtual void SAL_CALL + removeAccessibleEventListener ( + const css::uno::Reference< + css::accessibility::XAccessibleEventListener >& rxListener) override; + + + //===== XInterface ====================================================== + + virtual css::uno::Any SAL_CALL + queryInterface (const css::uno::Type & rType) override; + + virtual void SAL_CALL + acquire() + throw () override; + + virtual void SAL_CALL + release() + throw () override; + + + //===== XServiceInfo ==================================================== + + /** Returns an identifier for the implementation of this object. + */ + virtual OUString SAL_CALL + getImplementationName() override; + + virtual css::uno::Sequence< OUString> SAL_CALL + getSupportedServiceNames() override; + + //===== XTypeProvider =================================================== + + virtual css::uno::Sequence< css::uno::Type> SAL_CALL + getTypes() override; + + //===== IAccessibleViewForwarderListener ================================ + virtual void ViewForwarderChanged() override; + + /** Listen for disposing events of the model. The accessible shape + remains functional when this happens. + */ + void disposing (const css::lang::EventObject& Source); + + //===== document::XShapeEventListener ======================================== + + virtual void SAL_CALL + notifyShapeEvent (const css::document::EventObject& rEventObject) override; + + + //===== XUnoTunnel ======================================================== + + UNO3_GETIMPLEMENTATION_DECL(AccessibleShape) + + //===== XAccessibleHypertext ======================================================== + virtual sal_Int32 SAL_CALL getHyperLinkCount() override; + virtual css::uno::Reference< css::accessibility::XAccessibleHyperlink > + SAL_CALL getHyperLink( sal_Int32 nLinkIndex ) override; + virtual sal_Int32 SAL_CALL getHyperLinkIndex( sal_Int32 nCharIndex ) override; + //===== XAccessibleText ================================================== + virtual sal_Int32 SAL_CALL getCaretPosition( ) override; + virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) override; + virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) override;//Shen Zhen Jie changed sal_Unicode to sal_uInt32; change back to sal_Unicode + virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const css::uno::Sequence< OUString >& aRequestedAttributes ) override; + virtual css::awt::Rectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) override; + virtual sal_Int32 SAL_CALL getCharacterCount( ) override; + virtual sal_Int32 SAL_CALL getIndexAtPoint( const css::awt::Point& aPoint ) override; + virtual OUString SAL_CALL getSelectedText( ) override; + virtual sal_Int32 SAL_CALL getSelectionStart( ) override; + virtual sal_Int32 SAL_CALL getSelectionEnd( ) override; + virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override; + virtual OUString SAL_CALL getText( ) override; + virtual OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override; + virtual css::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override; + virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override; + virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override; + virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override; + virtual sal_Bool SAL_CALL scrollSubstringTo( sal_Int32 nStartIndex, sal_Int32 nEndIndex, css::accessibility::AccessibleScrollType aScrollType) override; + + //===== Misc ======================================================== + + const css::uno::Reference< css::drawing::XShape >& + GetXShape() const { return mxShape; } + + /** set the index _nIndex at the accessible shape + @param _nIndex + The new index in parent. + */ + void setIndexInParent(sal_Int32 _nIndex) { m_nIndexInParent = _nIndex; } + +protected: + /// Children manager. May be empty if there are no children. + std::unique_ptr mpChildrenManager; + + /// Reference to the actual shape. + css::uno::Reference< + css::drawing::XShape> mxShape; + + /** Bundle of information passed to all shapes in a document tree. + */ + AccessibleShapeTreeInfo maShapeTreeInfo; + + /** the index in parent. + */ + sal_Int32 m_nIndexInParent; + + /** The accessible text engine. May be NULL if it can not be created. + */ + std::unique_ptr mpText; + + /** This object can be used to modify the child list of our parent. + */ + IAccessibleParent* mpParent; + + /** This object can be removed when we have an extra interface to ask if the shape is selected + */ + SdrObject* m_pShape; + + /** This method is called from the component helper base class while + disposing. + */ + virtual void SAL_CALL disposing() override; + + /** Create a base name string that contains the accessible name. + + @throws css::uno::RuntimeException + */ + virtual OUString + CreateAccessibleBaseName(); + + /** Create a unique name string that contains the accessible name. The + name consists of the base name and the index. + */ + virtual OUString + CreateAccessibleName() override; + + /// @throws css::uno::RuntimeException + OUString + GetFullAccessibleName(AccessibleShape *shape); + virtual OUString GetStyle(); + /** Update the OPAQUE and SELECTED state. + */ + void UpdateStates(); + +private: + AccessibleShape (const AccessibleShape&) = delete; + AccessibleShape& operator= (const AccessibleShape&) = delete; + //Old accessible name + OUString aAccName; + + /** Call this method when the title, name, or description of the mxShape + member (may) have been changed. + This method adapts the name and description members of the + AccessibleContextBase base class. + */ + void UpdateNameAndDescription(); +}; + +} // end of namespace accessibility + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/AccessibleShapeInfo.hxx b/include/svx/AccessibleShapeInfo.hxx new file mode 100644 index 000000000..5cb9bfb0d --- /dev/null +++ b/include/svx/AccessibleShapeInfo.hxx @@ -0,0 +1,97 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_ACCESSIBLESHAPEINFO_HXX +#define INCLUDED_SVX_ACCESSIBLESHAPEINFO_HXX + +#include +#include + +namespace com::sun::star { + namespace accessibility { class XAccessible; } + namespace drawing { class XShape; } +} + +namespace accessibility { + +class IAccessibleParent; + +/** @descr + This class is a container for the information specific for a single + shape that is passed to the constructor of that shape. It allows to + separate the class definitions of the shapes from the information + needed on construction. Only the shapes' implementation has to be + adapted to a modified AccessibleShapeInfo definition. + +

Note that this class complements the + AccessibleShapeTreeInfo interface which contains + information that is passed to all shapes in a subtree not just to a + single shape.

+*/ +class SVX_DLLPUBLIC AccessibleShapeInfo +{ +public: + /** The shape itself for which an accessible object is to be + constructed. + */ + css::uno::Reference< + css::drawing::XShape> mxShape; + + /** The accessible parent object of the shape. + */ + css::uno::Reference< + css::accessibility::XAccessible> mxParent; + + /** This object that may be realized by the same implementation as that + of that of mxParent can be used to modify + parent/child relationships with the shape as initiator. + Note that NULL is a valid value for this member. + */ + IAccessibleParent* mpChildrenManager; + + /** Copy the given values into the members described above. + */ + AccessibleShapeInfo ( + const css::uno::Reference< + css::drawing::XShape>& rxShape, + const css::uno::Reference< + css::accessibility::XAccessible>& rxParent, + IAccessibleParent* pChildrenManager); + + /** Copy the given values into the members described above. + The accessible parent implementation object is set to NULL. + */ + AccessibleShapeInfo ( + const css::uno::Reference< + css::drawing::XShape>& rxShape, + const css::uno::Reference< + css::accessibility::XAccessible>& rxParent); + + ~AccessibleShapeInfo(); + + AccessibleShapeInfo (const AccessibleShapeInfo&); +private: + AccessibleShapeInfo& operator= (const AccessibleShapeInfo&) = delete; +}; + +} // end of namespace accessibility + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/AccessibleShapeTreeInfo.hxx b/include/svx/AccessibleShapeTreeInfo.hxx new file mode 100644 index 000000000..220bc2649 --- /dev/null +++ b/include/svx/AccessibleShapeTreeInfo.hxx @@ -0,0 +1,203 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_ACCESSIBLESHAPETREEINFO_HXX +#define INCLUDED_SVX_ACCESSIBLESHAPETREEINFO_HXX + +#include +#include +#include + +namespace com::sun::star { + namespace accessibility { class XAccessibleComponent; } + namespace document { class XShapeEventBroadcaster; } + namespace frame { class XController; } +} + +class SdrView; + +namespace accessibility { + +class IAccessibleViewForwarder; + +/** This class bundles all information that is passed down the tree of + accessible shapes so that each shape has access to that info. + + There are basically four members that can be set and queried: +
    +
  • The model broadcaster is used for getting notified about shape + changes. Using this broadcaster makes in unnecessary to register at + each shape separately.
  • +
  • The view forwarder is responsible for transformation between + coordinate systems and for providing the visible area both with respect + to a specific window.
  • +
  • The SdrView is used for creating accessible edit engines.
  • +
  • The Window is used for creating accessible edit engines.
  • +
+*/ +class SVX_DLLPUBLIC AccessibleShapeTreeInfo +{ +public: + /** Use this constructor to create an empty object that is filled later + with more meaningful data. + */ + AccessibleShapeTreeInfo(); + + /** Create a copy of the given shape info. + @param rInfo + The shape tree info object to copy. + */ + AccessibleShapeTreeInfo (const AccessibleShapeTreeInfo& rInfo); + + ~AccessibleShapeTreeInfo(); + + AccessibleShapeTreeInfo& operator= (const AccessibleShapeTreeInfo& rInfo); + + void dispose(); + + /** Deprecated. Don't use this method. + */ + void SetDocumentWindow (const css::uno::Reference< + css::accessibility::XAccessibleComponent>& rxViewWindow); + + /** Deprecated. Don't use this method. + */ + const css::uno::Reference< + css::accessibility::XAccessibleComponent>& + GetDocumentWindow() const { return mxDocumentWindow;} + + /** Set a new broadcaster that sends events indicating shape changes. + The broadcaster usually is or belongs to a document model. + @param rxModelBroadcaster + The new broadcaster. It replaces the current one. An empty + reference may be passed to unset the broadcaster + */ + void SetModelBroadcaster (const css::uno::Reference< + css::document::XShapeEventBroadcaster>& rxModelBroadcaster); + + /** Return the current model broadcaster. + @return + The returned reference may be empty if the broadcaster has not + been set or has been set to an empty reference. + */ + const css::uno::Reference< + css::document::XShapeEventBroadcaster>& + GetModelBroadcaster() const { return mxModelBroadcaster;} + + /** Set the view that will be used to construct SvxTextEditSources which + in turn are used to create accessible edit engines. + @param pView + The new SdrView that replaces the current one. A NULL pointer + may be passed to unset the view. + */ + void SetSdrView (SdrView* pView); + + /** Return the current SdrView. + @return + The returned value may be NULL. + */ + SdrView* GetSdrView() const { return mpView;} + + /** Set a new controller. This will usually but not necessarily + correspond to the SdrView. + @param rxController + The new controller that replaces the current one. An empty + reference may be passed to unset the controller. + */ + void SetController (const css::uno::Reference< + css::frame::XController>& rxController); + + /** Return the currently set controller. + @return + The reference to the currently set controller may be empty. + */ + const css::uno::Reference< + css::frame::XController>& + GetController() const { return mxController;} + + /** Set the window that is used to construct SvxTextEditSources which in + turn is used to create accessible edit engines. + */ + void SetDevice(OutputDevice* pWindow); + + /** Return the current Window. + @return + The returned value may be NULL. + */ + vcl::Window* GetWindow() const + { + if (mpWindow && mpWindow->GetOutDevType() == OUTDEV_WINDOW) + return static_cast(mpWindow.get()); + return nullptr; + } + OutputDevice* GetDevice() const { return mpWindow;} + + /** The view forwarder allows the transformation between internal + and pixel coordinates and can be asked for the visible area. + @param pViewForwarder + This view forwarder replaces the current one. + */ + void SetViewForwarder (const IAccessibleViewForwarder* pViewForwarder); + + /** Return the current view forwarder. + @return + The returned pointer may be NULL. + */ + const IAccessibleViewForwarder* GetViewForwarder() const { return mpViewForwarder;} + +private: + /** Deprecated. + */ + css::uno::Reference< + css::accessibility::XAccessibleComponent> mxDocumentWindow; + + /** this broadcaster sends events indicating shape changes. + The broadcaster usually is or belongs to a document model. + + This once was named mxControllerBroadcaster. + */ + css::uno::Reference< + css::document::XShapeEventBroadcaster> mxModelBroadcaster; + + /** This view is necessary to construct an SvxTextEditSource which in + turn is used to create an accessible edit engine. + */ + SdrView* mpView; + + /** The controller is used e.g. for obtaining the selected shapes. + */ + css::uno::Reference< + css::frame::XController> mxController; + + /** This window is necessary to construct an SvxTextEditSource which in + turn is used to create an accessible edit engine. + */ + VclPtr mpWindow; + + /** The view forwarder allows the transformation between internal + and pixel coordinates and can be asked for the visible area. + */ + const IAccessibleViewForwarder* mpViewForwarder; +}; + +} // end of namespace accessibility + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/AccessibleTextHelper.hxx b/include/svx/AccessibleTextHelper.hxx new file mode 100644 index 000000000..5f646d832 --- /dev/null +++ b/include/svx/AccessibleTextHelper.hxx @@ -0,0 +1,366 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_ACCESSIBLETEXTHELPER_HXX +#define INCLUDED_SVX_ACCESSIBLETEXTHELPER_HXX + +#include +#include + +#include +#include +#include + +namespace com::sun::star { + namespace accessibility { class XAccessible; } + namespace accessibility { class XAccessibleEventListener; } + namespace awt { struct Point; } +} + +class Point; +class SvxEditSource; + +namespace accessibility +{ + + class AccessibleTextHelper_Impl; + + /** Helper class for objects containing EditEngine/Outliner text + + This class provides the methods from the XAccessibleContext, + XAccessibleEventBroadcaster and XAccessibleComponent + interfaces, that are common to all accessible objects + containing an edit engine. + + The text contained in the EditEngine/Outliner is presented as + children of this class, namely for every text paragraph a + AccessibleEditableTextPara child object is generated. As this + class manages these children for itself, it has to send out + AccessibleEventId::CHILD events on your + behalf. Thus, you must forward every call to your + addEventListener()/removeEventListener() methods to the + AccessibleTextHelper (methods + AddEventListener/RemoveEventListener), otherwise none or not + everyone of your event listener will notice child changes. + + You have to implement the SvxEditSource, SvxTextForwarder, + SvxViewForwarder and SvxEditViewForwarder interfaces in order + to enable your object to cooperate with this + class. SvxTextForwarder encapsulates the fact that text + objects do not necessarily have an EditEngine at their + disposal, SvxViewForwarder and SvxEditViewForwarder do the + same for the document and the edit view. The three mentioned + forwarder objects are not stored by the AccessibleTextHelper, + but fetched every time from the SvxEditSource. So you are best + off making your SvxEditSource::Get*Forwarder methods cache the + current forwarder. + + To support changes in edit mode or conversion of fixed text + into EditEngine text, you can change the SvxEditSource this + class is referring to. This might render all children invalid + and change the child count, since the AccessibleTextHelper + reinitializes itself from scratch. + + This class registers itself at the SvxEditSource as a state + listener and manages the state of its children (i.e. the + paragraphs). See the method documentation of + AccessibleTextHelper::SetEditSource for the expected + events. Generally, be prepared that when sending any of these + events via SvxEditSource::GetBroadcaster() broadcaster, the + AccessibleTextHelper will call the SvxEditSource and their + forwarder to update it's state. Avoid being inconsistent in + the facts you tell in the events, e.g. when sending a + SfxHintId::TextParaInserted event, the + SvxEditSource::GetTextForwarder().GetParagraphCount() should + already include the newly inserted paragraph. + + @attention All public methods must not be called with any + mutex hold, except when calling from the main thread (with + holds the solar mutex), unless stated otherwise. This is + because they themselves might need the solar mutex in addition + to the object mutex, and the ordering of the locking must be: + first solar mutex, then object mutex. Furthermore, state + change events might be fired internally. + + @derive Use this class in an aggregation and forward, or + derive from it and overwrite. + too. + + @see SvxEditSource + @see SvxTextForwarder + @see SvxViewForwarder + @see SvxEditViewForwarder + */ + class SVX_DLLPUBLIC AccessibleTextHelper final + { + + public: + typedef ::std::vector< sal_Int16 > VectorOfStates; + + /** Create accessible text object for given edit source + + @param pEditSource + The edit source to use. Object ownership is transferred + from the caller to the callee. The object listens on the + SvxEditSource for object disposal, so no provisions have + to be taken if the caller destroys the data (e.g. the + model) contained in the given SvxEditSource. + + */ + explicit AccessibleTextHelper( ::std::unique_ptr< SvxEditSource > && pEditSource ); + + ~AccessibleTextHelper(); + + AccessibleTextHelper( const AccessibleTextHelper& ) = delete; + AccessibleTextHelper& operator= ( const AccessibleTextHelper& ) = delete; + + /** Query the current edit source + + @attention This method returns by reference, so you are + responsible for serialization (typically, you acquired the + solar mutex when calling this method). Thus, the method + should only be called from the main office thread. + + */ + const SvxEditSource& GetEditSource() const; + + /** Set the current edit source + + @attention Might fire state change events, therefore, + don't hold any mutex except solar mutex, which you are + required to lock before. This method should only be called + from the main office thread. + + The EditSource set here is required to broadcast out the + following hints: SfxHintId::EditSourceParasMoved, + SfxHintId::EditSourceSelectionChanged, SfxHintId::TextModified, + SfxHintId::TextParaInserted, SfxHintId::TextParaRemoved, + SfxHintId::TextHeightChanged, + SfxHintId::TextViewScrolled. Otherwise, not all state changes + will get noticed by the accessibility object. Further + more, when the corresponding core object or the model is + dying, either the edit source must be set to NULL or it + has to broadcast a SfxHintId::Dying hint. + + If the SvxEditSource's managed text can change between + edit/non-edit mode (i.e. there are times when + SvxEditSource::GetEditViewForwarder(sal_False) returns + NULL), then the two additional hints are required: + SdrHintKind::BeginEdit and SdrHintKind::EndEdit. When the + AccessibleTextHelper receives a SdrHintKind::BeginEdit, it expects + the SvxEditSource already in edit mode. On a SdrHintKind::EndEdit, + edit mode must already been left. The rationale for these + events are the fact that focus and selection have to be + updated in edit mode, and completely relinquished and + reset to the parent (for the focus) in non-edit mode. + + This class does not have a dispose method, since it is not + a UNO component. Nevertheless, it holds C++ references to + several core objects, so you should issue a + SetEditSource(::std::unique_ptr()) in + your dispose() method. + + @param pEditSource + The new edit source to set. Object ownership is transferred + from the caller to the callee. + */ + void SetEditSource( ::std::unique_ptr< SvxEditSource > && pEditSource ); + + /** Set the event source + + You should set the event source before registering any + event listener and before requesting any child. Children + of this object receive the event source as their parent + accessible object. That is, the event source is best set + in your object's init method. + + @attention When setting a reference here, you should call + Dispose() when you as the owner are disposing, since until + then this object will hold that reference + + @param rInterface + The interface that should be set as the source for + accessibility events sent by this object. + */ + void SetEventSource( const css::uno::Reference< css::accessibility::XAccessible >& rInterface ); + + /** Set offset of EditEngine/Outliner from parent + + If the origin of the underlying EditEngine/Outliner does + not correspond to the upper left corner of the object + using this class, you have to specify the offset. + + @attention Might fire state change events, therefore, + don't hold any mutex except solar mutex, which you are + required to lock before. This method should only be called + from the main office thread. + + @param rPoint + The offset in screen coordinates (i.e. pixel) + */ + void SetOffset( const Point& rPoint ); + + /** Set offset the object adds to all children's indices + + This can be used if the owner of this object has children + handled by itself. Setting an offset different from 0 + leads to this object mimicking that all its children are + within the range [nOffset, GetChildCount()+nOffset). That + means, GetChild() also expects the index to be in this + range. + + @attention Might fire state change events, therefore, + don't hold any mutex except solar mutex, which you are + required to lock before. This method should only be called + from the main office thread. + + @param nOffset + The offset to add to every children's index. + */ + void SetStartIndex( sal_Int32 nOffset ); + + /** Query offset the object adds to all children's indices + + @return the offset to add to every children's index. + */ + sal_Int32 GetStartIndex() const; + + /** Sets a vector of additional accessible states. + + The states are passed to every created child object + (text paragraph). The state values are defined in + css::accessibility::AccessibleStateType. + + This function has to be called before querying for + any children (e.g. with GetChild()). + */ + void SetAdditionalChildStates( const VectorOfStates& rChildStates ); + + /** Update the visible children + + @attention Might fire state change events, therefore, + don't hold any mutex except solar mutex, which you are + required to lock before. This method should only be called + from the main office thread. + + This method reevaluates the visibility of all + children. Call this method if your visibility state has + changed somehow, e.g. if the visible area has changed and + the AccessibleTextHelper isn't notified internally + (e.g. via SfxHintId::TextViewScrolled). Normally, there should + not be a need to call this method. + */ + void UpdateChildren(); + + /** Drop all references and enter disposed state + + This method drops all references to external objects (also + the event source reference set via SetEventSource()) and + sets the object into the disposed state (i.e. the methods + return default values or throw a uno::DisposedException + exception). + */ + void Dispose(); + + /** Set the focus state of the accessibility object + + Since this class handles children which also might get the + focus, the user of this class is encouraged to delegate + focus handling. Whenever the focus state of the + surrounding object changes, this method has to be called. + + The protocol of focus handling for a user of this class is + then to call SetFocus() with the appropriate focus state, + and HaveFocus() to determine the focus state you tell the + outside. + + @attention Might fire state change events, therefore, + don't hold any mutex except solar mutex, which you are + required to lock before. This method should only be called + from the main office thread. + + @param bHaveFocus + Whether we got or we lost the focus. Set to true if + focus is gotten, false otherwise. + + @see HaveFocus() + */ + void SetFocus( bool bHaveFocus = true ); + + /** Query the focus state of the surrounding object + + If focus handling is delegated to this class, determine + focus state with this method. Be prepared that even if you + set the focus with SetFocus(true), this method might + return false. This is the case if one of the children + actually got the focus. + + @return the state of the focus ownership + */ + bool HaveFocus(); + + // XAccessibleContext child handling methods + + /** Implements getAccessibleChildCount + + @attention Don't call with locked mutexes. You may hold + the solar mutex, but this method acquires it anyway. + */ + sal_Int32 GetChildCount() const; + /** Implements getAccessibleChild + + @attention Don't call with locked mutexes. You may hold + the solar mutex, but this method acquires it anyway. + */ + css::uno::Reference< css::accessibility::XAccessible > GetChild( sal_Int32 i ); + + // XAccessibleEventBroadcaster child related methods + + /** Implements addEventListener + + @attention Don't call with locked mutexes + */ + void AddEventListener( const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener ); + /** Implements removeEventListener + + @attention Don't call with locked mutexes + */ + void RemoveEventListener( const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener ); + + // XAccessibleComponent child related methods + + /** Implements getAccessibleAt + + @attention Don't call with locked mutexes. You may hold + the solar mutex, but this method acquires it anyway. + */ + css::uno::Reference< css::accessibility::XAccessible > GetAt( const css::awt::Point& aPoint ); + + private: + + /// @dyn + const std::unique_ptr< AccessibleTextHelper_Impl > mpImpl; + + }; + +} // end of namespace accessibility + +#endif // INCLUDED_SVX_ACCESSIBLETEXTHELPER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/ActionDescriptionProvider.hxx b/include/svx/ActionDescriptionProvider.hxx new file mode 100644 index 000000000..204c4f6e9 --- /dev/null +++ b/include/svx/ActionDescriptionProvider.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_SVX_ACTIONDESCRIPTIONPROVIDER_HXX +#define INCLUDED_SVX_ACTIONDESCRIPTIONPROVIDER_HXX + +#include +#include + + +/** This class provides localized descriptions for some basic actions done with objects. +The strings are intended to be provided to the user e.g. as description for undo actions in the menu. +The name of the object acted on and the type of action needs to be given as input parameter. +*/ + +class SVX_DLLPUBLIC ActionDescriptionProvider +{ +public: + enum class ActionType + { + Insert + , Delete + , Move + , Resize + , Rotate + , Format + , MoveToTop + , MoveToBottom + , PosSize + }; + +public: + static OUString createDescription( ActionType eActionType + , const OUString& rObjectName ); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/ChildrenManager.hxx b/include/svx/ChildrenManager.hxx new file mode 100644 index 000000000..14a90c754 --- /dev/null +++ b/include/svx/ChildrenManager.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_SVX_CHILDRENMANAGER_HXX +#define INCLUDED_SVX_CHILDRENMANAGER_HXX + +#include + +#include +#include +#include + +namespace com::sun::star { + namespace accessibility { class XAccessible; } + namespace drawing { class XShape; } + namespace drawing { class XShapes; } +} + +namespace accessibility { + +class AccessibleContextBase; +class AccessibleShapeTreeInfo; +class ChildrenManagerImpl; + +/** The AccessibleChildrenManager class acts as a cache of the + accessible objects of the currently visible shapes of a draw page and as + a factory to create the corresponding accessible object for a given + shape. + +

There are two sources of shapes. The first is a list of UNO shapes. + It is passes to the constructor and can be re-set with a call to + SetShapeList. Accessibility objects which represent + these shapes are constructed usually on demand. The second source is a + set of single AccessibleShape objects added by calls to + AddAccessibleShape. These are not modified by this + class. They are only copied into the list of visible shapes depending + on their visibility. The later list can be cleared by calling + ClearAccessibleShapeList. The actual set of children + accessible through the GetChildrenCount and + GetChild methods are the accessible objects that lie + completely or partially inside the visible area obtained from the view + forwarder in the shape tree info.

+ +

A children manager registers itself at the broadcaster passed to its + constructor and transforms/forwards the received events to the listeners + of the also given context base. The transformation process includes + interpreting a document::XEventListener, the change from + XShape references to the associated XAccessible reference, and the + creation of an XAccessibleEventObject. The event object is then passed + to the fireEvent method of the context and from there + forwarded to all listeners.

+ +

Note that some of the data given to the constructor is passed to the + accessible shape objects created by that child manager which in turn + pass these data to their child managers. The data is thus propagated + down a tree of child managers/accessible shape objects from a top level + class that is usually a document/model. This is the way to give all + accessible objects access to data normally known only to the top level + owner of the shapes.

+*/ +class SVX_DLLPUBLIC ChildrenManager final +{ +public: + /** Create a children manager, which manages the children of the given + parent. The parent is used for creating accessible objects. The + list of shapes for which to create those objects is not derived from + the parent and has to be provided separately by calling one of the + update methods. + @param rxParent + The parent of the accessible objects which will be created + on demand at some point of time in the future. + @param rxShapeList + List of UNO shapes to manage. + @param rShapeTreeInfo + Bundle of information passed down the shape tree. + @param rContext + An accessible context object that is called for firing events + for new and deleted children, i.e. that holds a list of + listeners to be informed. + */ + ChildrenManager (const css::uno::Reference< + css::accessibility::XAccessible>& rxParent, + const css::uno::Reference< + css::drawing::XShapes>& rxShapeList, + const AccessibleShapeTreeInfo& rShapeTreeInfo, + AccessibleContextBase& rContext); + + /** If there still are managed children these are marked as DEFUNC and + released. + */ + ~ChildrenManager(); + + /** Return the number of currently visible accessible children. + @return + If there are no children a 0 is returned. + */ + long GetChildCount() const throw (); + + /** Return the requested accessible child or throw and + IndexOutOfBoundsException if the given index is invalid. + @param nIndex + Index of the requested child. Call getChildCount for obtaining + the number of children. + @return + In case of a valid index this method returns a reference to the + requested accessible child. This reference is empty if it has + not been possible to create the accessible object of the + corresponding shape. + @throws + Throws an IndexOutOfBoundsException if the index is not valid. + */ + css::uno::Reference< + css::accessibility::XAccessible> + GetChild (long nIndex); + /// @throws css::lang::IndexOutOfBoundsException + /// @throws css::uno::RuntimeException + css::uno::Reference< css::drawing::XShape> GetChildShape (long nIndex); + + /** Update the child manager. Take care of a modified set of children + and modified visible area. This method can optimize the update + process with respect separate updates of a modified children list + and visible area. + @param bCreateNewObjectsOnDemand + If
then accessible objects associated with the visible + shapes are created only when asked for. No event is sent on + creation. If then the accessible objects are created + before this method returns and events are sent to inform the + listeners of the new object. + */ + void Update (bool bCreateNewObjectsOnDemand = true); + + /** Replace the list of UNO shapes by the specified list. + @param xShapeList + The new list of shapes. + */ + void SetShapeList (const css::uno::Reference< + css::drawing::XShapes>& xShapeList); + + /** Add an accessible shape. The difference to the UNO shapes in the + list passed to the constructor the specified object does not have to + be created by the shape factory. This gives the caller full control + over object creation. + + @param shape must be non-null + */ + void AddAccessibleShape (css::uno::Reference const & shape); + + /** Clear the list of accessible shapes which have been added by + previous calls to AddAccessibleShape. + */ + void ClearAccessibleShapeList(); + + /** Take a new event shape tree info. Call this method to inform the + children manager of a change of the info bundle. + @param rShapeTreeInfo + The new info that replaces the current one. + */ + void SetInfo (AccessibleShapeTreeInfo const & rShapeTreeInfo); + + /** Update the SELECTED and FOCUSED states of all visible children + according to the given selection. This includes setting + and resetting the states. + */ + void UpdateSelection(); + + /** Return whether one of the shapes managed by this object has + currently the focus. + @return + Returns when there is a shape that has the focus and + when there is no such shape. + */ + bool HasFocus() const; + + /** When there is a shape that currently has the focus, + i.e. HasFocus() returns then remove the + focus from that shape. Otherwise nothing changes. + */ + void RemoveFocus(); + + void ViewForwarderChanged(); + +private: + rtl::Reference mpImpl; + + ChildrenManager (const ChildrenManager&) = delete; + ChildrenManager& operator= (const ChildrenManager&) = delete; +}; + +} // end of namespace accessibility + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/ClassificationCommon.hxx b/include/svx/ClassificationCommon.hxx new file mode 100644 index 000000000..52fc3db39 --- /dev/null +++ b/include/svx/ClassificationCommon.hxx @@ -0,0 +1,67 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + */ + +#ifndef INCLUDED_SVX_CLASSIFICATIONCOMMON_HXX +#define INCLUDED_SVX_CLASSIFICATIONCOMMON_HXX + +#include +#include +#include +#include + +namespace com::sun::star::beans +{ +class XPropertyContainer; +} +namespace com::sun::star::beans +{ +struct Property; +} +namespace svx +{ +class ClassificationResult; +} + +namespace svx +{ +namespace classification +{ +SVX_DLLPUBLIC OUString +convertClassificationResultToString(std::vector const& rResults); + +SVX_DLLPUBLIC OUString +getProperty(css::uno::Reference const& rxPropertyContainer, + OUString const& rName); + +SVX_DLLPUBLIC bool containsProperty(css::uno::Sequence const& rProperties, + OUString const& rName); + +SVX_DLLPUBLIC void +removeAllProperties(css::uno::Reference const& rxPropertyContainer); + +SVX_DLLPUBLIC bool addOrInsertDocumentProperty( + css::uno::Reference const& rxPropertyContainer, + OUString const& rsKey, OUString const& rsValue); + +SVX_DLLPUBLIC void insertFullTextualRepresentationAsDocumentProperty( + css::uno::Reference const& rxPropertyContainer, + sfx::ClassificationKeyCreator const& rKeyCreator, + std::vector const& rResults); + +SVX_DLLPUBLIC void +insertCreationOrigin(css::uno::Reference const& rxPropertyContainer, + sfx::ClassificationKeyCreator const& rKeyCreator, + sfx::ClassificationCreationOrigin eOrigin); +} +} // end svx::classification namespace + +#endif // INCLUDED_SVX_CLASSIFICATIONCOMMON_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/ClassificationDialog.hxx b/include/svx/ClassificationDialog.hxx new file mode 100644 index 000000000..d03445c77 --- /dev/null +++ b/include/svx/ClassificationDialog.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/. + * + */ + +#ifndef INCLUDED_SVX_CLASSIFICATIONDIALOG_HXX +#define INCLUDED_SVX_CLASSIFICATIONDIALOG_HXX + +#include +#include +#include +#include +#include + +namespace svx { class ClassificationEditView; } +namespace weld { class CustomWeld; } + +namespace svx { + +class SVX_DLLPUBLIC ClassificationDialog final : public weld::GenericDialogController +{ +private: + SfxClassificationHelper maHelper; + SfxClassificationHelper maInternationalHelper; + + const bool m_bPerParagraph; + const std::function m_aParagraphSignHandler; + + ImplSVEvent* m_nAsyncExpandEvent; + sal_Int32 m_nCurrentSelectedCategory; + + std::vector> m_aRecentlyUsedValuesCollection; + std::vector m_aInitialValues; + + std::unique_ptr m_xOkButton; + std::unique_ptr m_xSignButton; + std::unique_ptr m_xToolBox; + std::unique_ptr m_xRecentlyUsedListBox; + std::unique_ptr m_xClassificationListBox; + std::unique_ptr m_xInternationalClassificationListBox; + std::unique_ptr m_xMarkingLabel; + std::unique_ptr m_xMarkingListBox; + std::unique_ptr m_xIntellectualPropertyPartListBox; + std::unique_ptr m_xIntellectualPropertyPartNumberListBox; + std::unique_ptr m_xIntellectualPropertyPartAddButton; + std::unique_ptr m_xIntellectualPropertyPartEdit; + std::unique_ptr m_xIntellectualPropertyExpander; + std::unique_ptr m_xEditWindow; + std::unique_ptr m_xEditWindowWeld; + + DECL_LINK(ButtonClicked, weld::Button&, void); + DECL_LINK(OkHdl, weld::Button&, void); + DECL_LINK(SelectToolboxHdl, weld::ToggleButton&, void); + DECL_LINK(SelectClassificationHdl, weld::ComboBox&, void); + DECL_LINK(SelectMarkingHdl, weld::TreeView&, bool); + DECL_LINK(SelectIPPartNumbersHdl, weld::TreeView&, bool); + DECL_LINK(SelectRecentlyUsedHdl, weld::ComboBox&, void); + DECL_LINK(SelectIPPartHdl, weld::TreeView&, bool); + DECL_LINK(EditWindowModifiedHdl, LinkParamNone*, void); + DECL_STATIC_LINK(ClassificationDialog, ExpandedHdl, weld::Expander&, void); + DECL_STATIC_LINK(ClassificationDialog, KeyInput, const KeyEvent&, bool); + DECL_LINK(OnAsyncExpandHdl, void*, void); + + void insertField(ClassificationType eType, OUString const & rString, OUString const & rFullString, OUString const & rIdentifier = OUString()); + void insertCategoryField(sal_Int32 nID); + + void readIn(std::vector const & rInput); + void readRecentlyUsed(); + void writeRecentlyUsed(); + void toggleWidgetsDependingOnCategory(); + +public: + ClassificationDialog(weld::Window* pParent, bool bPerParagraph, const std::function& rParagraphSignHandler = [](){}); + ~ClassificationDialog() override; + + std::vector getResult(); + void setupValues(std::vector const & rInput); +}; + +} // end svx namespace + +#endif // INCLUDED_SVX_CLASSIFICATIONDIALOG_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/ClassificationField.hxx b/include/svx/ClassificationField.hxx new file mode 100644 index 000000000..f932a665f --- /dev/null +++ b/include/svx/ClassificationField.hxx @@ -0,0 +1,99 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + */ + +#ifndef INCLUDED_SVX_CLASSIFICATIONFIELD_HXX +#define INCLUDED_SVX_CLASSIFICATIONFIELD_HXX + +#include +#include +#include + +namespace svx { + +enum class ClassificationType +{ + CATEGORY, + MARKING, + TEXT, + INTELLECTUAL_PROPERTY_PART, + PARAGRAPH, +}; + +class SVX_DLLPUBLIC ClassificationResult +{ +public: + ClassificationType meType; + OUString msName; //< Display text or 'Name' field (from example.xml). + OUString msAbbreviatedName; //< Abbreviated name, displayed instead of Name. + OUString msIdentifier; //< The identifier of this entry (from example.xml). + + ClassificationResult(ClassificationType eType, const OUString& sName, + const OUString& sAbbreviatedName, const OUString& sIdentifier = "") + : meType(eType) + , msName(sName) + , msAbbreviatedName(sAbbreviatedName) + , msIdentifier(sIdentifier) + { + } + + /// Returns the text to display, which is the Abbreviated Name, if provided, otherwise Name. + OUString const & getDisplayText() const + { + return !msAbbreviatedName.isEmpty() ? msAbbreviatedName : msName; + } + + bool operator==(const ClassificationResult& rOther) const + { + return (meType == rOther.meType && + msName == rOther.msName && + msAbbreviatedName == rOther.msAbbreviatedName && + msIdentifier == rOther.msIdentifier); + } +}; + +class SVX_DLLPUBLIC ClassificationField final : public SvxFieldData +{ +public: + ClassificationType meType; + OUString msDescription; + OUString msFullClassName; + OUString msIdentifier; + + ClassificationField(ClassificationType eType, OUString const & sDescription, OUString const & sFullClassName, OUString const & sIdentifier) + : SvxFieldData() + , meType(eType) + , msDescription(sDescription) + , msFullClassName(sFullClassName) + , msIdentifier(sIdentifier) + {} + + std::unique_ptr Clone() const override + { + return std::make_unique(meType, msDescription, msFullClassName, msIdentifier); + } + + bool operator==(const SvxFieldData& rOther) const override + { + if (typeid(rOther) != typeid(*this)) + return false; + + const ClassificationField& rOtherField = static_cast(rOther); + return (meType == rOtherField.meType && + msDescription == rOtherField.msDescription && + msFullClassName == rOtherField.msFullClassName && + msIdentifier == rOtherField.msIdentifier); + } +}; + +} // end svx namespace + +#endif // INCLUDED_SVX_CLASSIFICATIONFIELD_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/ColorSets.hxx b/include/svx/ColorSets.hxx new file mode 100644 index 000000000..88e401aa3 --- /dev/null +++ b/include/svx/ColorSets.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/. + * + */ + +#ifndef INCLUDED_SVX_COLORSETS_HXX +#define INCLUDED_SVX_COLORSETS_HXX + +#include + +#include +#include +#include +#include + +namespace svx +{ + +class ColorSet +{ + OUString maColorSetName; + std::vector maColors; +public: + ColorSet(OUString const & aName); + + void add(sal_uInt32 nIndex, sal_uInt32 aColorData) + { + maColors[nIndex] = Color(aColorData); + } + + const OUString& getName() const + { + return maColorSetName; + } + const Color& getColor(sal_uInt32 nIndex) const + { + return maColors[nIndex]; + } +}; + +class SVXCORE_DLLPUBLIC ColorSets +{ + std::vector maColorSets; +public: + ColorSets(); + ~ColorSets(); + + void init(); + const std::vector& getColorSets() const + { + return maColorSets; + } + + const ColorSet& getColorSet(sal_uInt32 nIndex) + { + return maColorSets[nIndex]; + } + + const ColorSet& getColorSet(const OUString& rName); +}; + +} // end of namespace svx + +#endif // INCLUDED_SVX_COLORSETS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/CommonStyleManager.hxx b/include/svx/CommonStyleManager.hxx new file mode 100644 index 000000000..b7820beb5 --- /dev/null +++ b/include/svx/CommonStyleManager.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/. + */ + +#ifndef INCLUDED_SVX_COMMONSTYLEMANAGER_HXX +#define INCLUDED_SVX_COMMONSTYLEMANAGER_HXX + +#include +#include + +namespace sfx2 { class StylePreviewRenderer; } + +class OutputDevice; +class SfxObjectShell; +class SfxStyleSheetBase; + +namespace svx +{ + +class SVXCORE_DLLPUBLIC CommonStyleManager final : public sfx2::StyleManager +{ +public: + CommonStyleManager(SfxObjectShell& rShell) + : StyleManager(rShell) + {} + + virtual std::unique_ptr CreateStylePreviewRenderer( + OutputDevice& rOutputDev, SfxStyleSheetBase* pStyle, + long nMaxHeight) override; +}; + +} // end namespace svx + +#endif // INCLUDED_SVX_COMMONSTYLEMANAGER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/DiagramDataInterface.hxx b/include/svx/DiagramDataInterface.hxx new file mode 100644 index 000000000..f64dc3a09 --- /dev/null +++ b/include/svx/DiagramDataInterface.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_SVX_DIAGRAMDATAINTERFACE_HXX +#define INCLUDED_SVX_DIAGRAMDATAINTERFACE_HXX + +#include +#include + +#include +#include + +/// Interface class to access diagram data for UI +class SAL_NO_VTABLE SAL_DLLPUBLIC_RTTI DiagramDataInterface +{ +public: + // get text representation of data tree + virtual OUString getString() const = 0; + + // get children of provided data node + // use empty string for top-level nodes + // returns vector of (id, text) + virtual std::vector> + getChildren(const OUString& rParentId) const = 0; + + // add new top-level node to data model, returns its id + virtual OUString addNode(const OUString& rText) = 0; + + virtual bool removeNode(const OUString& rNodeId) = 0; + +protected: + ~DiagramDataInterface() throw() {} +}; + +#endif // INCLUDED_SVX_DIAGRAMDATAINTERFACE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/EnhancedCustomShape2d.hxx b/include/svx/EnhancedCustomShape2d.hxx new file mode 100644 index 000000000..8976b2bdb --- /dev/null +++ b/include/svx/EnhancedCustomShape2d.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_SVX_ENHANCEDCUSTOMSHAPE2D_HXX +#define INCLUDED_SVX_ENHANCEDCUSTOMSHAPE2D_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +namespace com::sun::star::awt { struct Point; } + +class Color; +class SdrObject; +class SdrPathObj; +class SdrObjCustomShape; + +enum class HandleFlags +{ + NONE = 0x0000, + MIRRORED_X = 0x0001, + MIRRORED_Y = 0x0002, + SWITCHED = 0x0004, + POLAR = 0x0008, + RANGE_X_MINIMUM = 0x0020, + RANGE_X_MAXIMUM = 0x0040, + RANGE_Y_MINIMUM = 0x0080, + RANGE_Y_MAXIMUM = 0x0100, + RADIUS_RANGE_MINIMUM = 0x0200, + RADIUS_RANGE_MAXIMUM = 0x0400, + REFX = 0x0800, + REFY = 0x1000, + REFANGLE = 0x2000, + REFR = 0x4000, +}; +namespace o3tl +{ + template<> struct typed_flags : is_typed_flags {}; +} + +// MSDFF_HANDLE_FLAGS_RANGE_Y seems to be not defined in +// escher, but we are using it internally in to differentiate +// between X_RANGE and Y_RANGE + +class SVXCORE_DLLPUBLIC EnhancedCustomShape2d : public SfxItemSet +{ + SdrObjCustomShape& mrSdrObjCustomShape; + MSO_SPT eSpType; + + sal_Int32 nCoordLeft; + sal_Int32 nCoordTop; + sal_Int32 nCoordWidthG; + sal_Int32 nCoordHeightG; + sal_Int32 nCoordWidth; + sal_Int32 nCoordHeight; + tools::Rectangle aLogicRect; + + double fXScale; + double fYScale; + double fXRatio; + double fYRatio; + + bool bOOXMLShape; + + sal_Int32 nXRef; + sal_Int32 nYRef; + sal_uInt32 nColorData; + + /* + + */ + struct SAL_DLLPRIVATE EquationResult { + bool bReady; + double fValue; + }; + css::uno::Sequence< OUString > seqEquations; + std::vector< std::shared_ptr< EnhancedCustomShape::ExpressionNode > > vNodesSharedPtr; + std::vector< EquationResult > vEquationResults; + + css::uno::Sequence< css::drawing::EnhancedCustomShapeSegment > seqSegments; + css::uno::Sequence< css::drawing::EnhancedCustomShapeParameterPair> seqCoordinates; + css::uno::Sequence< css::drawing::EnhancedCustomShapeTextFrame > seqTextFrames; + css::uno::Sequence< css::drawing::EnhancedCustomShapeParameterPair> seqGluePoints; + css::uno::Sequence< css::drawing::EnhancedCustomShapeAdjustmentValue > seqAdjustmentValues; + css::uno::Sequence< css::beans::PropertyValues > seqHandles; + css::uno::Sequence< css::awt::Size > seqSubViewSize; + + bool bFilled : 1; + bool bStroked : 1; + + bool bFlipH; + bool bFlipV; + sal_Int32 nRotateAngle; + + SAL_DLLPRIVATE bool SetAdjustValueAsDouble( const double& rValue, const sal_Int32 nIndex ); + SAL_DLLPRIVATE sal_Int32 GetLuminanceChange( sal_uInt32 nIndex ) const; + SAL_DLLPRIVATE Color GetColorData( const Color& rFillColor, sal_uInt32 nIndex, double dBrightness ) const; + SAL_DLLPRIVATE void AdaptObjColor( + SdrPathObj& rObj, + double dBrightness, + const SfxItemSet& rCustomShapeSet, + sal_uInt32& nColorIndex, + sal_uInt32 nColorCount); + SAL_DLLPRIVATE Point GetPoint( const css::drawing::EnhancedCustomShapeParameterPair&, + const bool bScale = true, const bool bReplaceGeoSize = false ) const; + SAL_DLLPRIVATE basegfx::B2DPoint GetPointAsB2DPoint(const css::drawing::EnhancedCustomShapeParameterPair&, + const bool bScale = true, const bool bReplaceGeoSize = false ) const; + + SAL_DLLPRIVATE void CreateSubPath( + sal_Int32& rSrcPt, + sal_Int32& rSegmentInd, + std::vector< std::pair< SdrPathObj*, double> >& rObjectList, + bool bLineGeometryNeededOnly, + bool bSortFilledObjectsToBack, + sal_Int32 nIndex); + SAL_DLLPRIVATE SdrObject* CreatePathObj( bool bLineGeometryNeededOnly ); + SAL_DLLPRIVATE void ApplyShapeAttributes( const SdrCustomShapeGeometryItem& rItem ); + + SAL_DLLPRIVATE void SetPathSize( sal_Int32 nIndex = 0 ); + + public: + + struct SAL_DLLPRIVATE Handle + { + HandleFlags nFlags; + + css::drawing::EnhancedCustomShapeParameterPair aPosition; + css::drawing::EnhancedCustomShapeParameterPair aPolar; + + sal_Int32 nRefX; + sal_Int32 nRefY; + sal_Int32 nRefAngle; + sal_Int32 nRefR; + + css::drawing::EnhancedCustomShapeParameter aRadiusRangeMinimum; + css::drawing::EnhancedCustomShapeParameter aRadiusRangeMaximum; + css::drawing::EnhancedCustomShapeParameter aXRangeMinimum; + css::drawing::EnhancedCustomShapeParameter aXRangeMaximum; + css::drawing::EnhancedCustomShapeParameter aYRangeMinimum; + css::drawing::EnhancedCustomShapeParameter aYRangeMaximum; + + Handle() + : nFlags(HandleFlags::NONE) + , nRefX( -1 ) + , nRefY( -1 ) + , nRefAngle( -1 ) + , nRefR( -1 ) + { + } + }; + + SAL_DLLPRIVATE bool IsFlipVert() const { return bFlipV; }; + SAL_DLLPRIVATE bool IsFlipHorz() const { return bFlipH; }; + SAL_DLLPRIVATE sal_Int32 GetRotateAngle() const { return nRotateAngle; }; + + SdrObject* CreateLineGeometry(); + SdrObject* CreateObject( bool bLineGeometryNeededOnly ); + void ApplyGluePoints( SdrObject* pObj ); + tools::Rectangle GetTextRect() const; + const tools::Rectangle& GetLogicRect() const { return aLogicRect; } + + sal_uInt32 GetHdlCount() const; + bool GetHandlePosition( const sal_uInt32 nIndex, Point& rReturnPosition ) const; + bool SetHandleControllerPosition( const sal_uInt32 nIndex, const css::awt::Point& rPosition ); + + EnhancedCustomShape2d(SdrObjCustomShape& rSdrObjCustomShape); + virtual ~EnhancedCustomShape2d() override; + + SAL_DLLPRIVATE double GetEnumFunc( const EnhancedCustomShape::ExpressionFunct eVal ) const; + + void GetParameter( double& rParameterReturnValue, const css::drawing::EnhancedCustomShapeParameter&, + const bool bReplaceGeoWidth, const bool bReplaceGeoHeight ) const; + SAL_DLLPRIVATE double GetAdjustValueAsDouble( const sal_Int32 nIndex ) const; + SAL_DLLPRIVATE double GetEquationValueAsDouble( const sal_Int32 nIndex ) const; + + static OUString GetEquation( const sal_uInt16 nFlags, sal_Int32 nPara1, sal_Int32 nPara2, sal_Int32 nPara3 ); + + SAL_DLLPRIVATE static void AppendEnhancedCustomShapeEquationParameter( OUString& rParameter, const sal_Int32 nPara, const bool bIsSpecialValue ); + + static void SetEnhancedCustomShapeParameter( css::drawing::EnhancedCustomShapeParameter& + rParameter, const sal_Int32 nValue ); + static void SetEnhancedCustomShapeHandleParameter( css::drawing::EnhancedCustomShapeParameter& + rParameter, const sal_Int32 nPara, const bool bIsSpecialValue, bool bHorz ); + SAL_DLLPRIVATE static bool ConvertSequenceToEnhancedCustomShape2dHandle( const css::beans::PropertyValues& rHandleProperties, + EnhancedCustomShape2d::Handle& rDestinationHandle ); + SAL_DLLPRIVATE static void SwapStartAndEndArrow( SdrObject* pObj ); +}; +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/EnhancedCustomShapeFunctionParser.hxx b/include/svx/EnhancedCustomShapeFunctionParser.hxx new file mode 100644 index 000000000..150c39efc --- /dev/null +++ b/include/svx/EnhancedCustomShapeFunctionParser.hxx @@ -0,0 +1,248 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_ENHANCEDCUSTOMSHAPEFUNCTIONPARSER_HXX +#define INCLUDED_SVX_ENHANCEDCUSTOMSHAPEFUNCTIONPARSER_HXX + +#include +#include +#include +#include +#include +#include + +#include + +struct EnhancedCustomShapeEquation +{ + sal_Int32 nOperation; + sal_Int32 nPara[ 3 ]; + + EnhancedCustomShapeEquation() : + nOperation ( 0 ) + { + nPara[ 0 ] = nPara[ 1 ] = nPara[ 2 ] = 0; + } +}; + +class EnhancedCustomShape2d; + +namespace EnhancedCustomShape { + +enum class ExpressionFunct +{ + Const, + + EnumPi, + EnumLeft, + EnumTop, + EnumRight, + EnumBottom, + EnumXStretch, + EnumYStretch, + EnumHasStroke, + EnumHasFill, + EnumWidth, + EnumHeight, + EnumLogWidth, + EnumLogHeight, + EnumAdjustment, + EnumEquation, + + UnaryAbs, + UnarySqrt, + UnarySin, + UnaryCos, + UnaryTan, + UnaryAtan, + UnaryNeg, + + BinaryPlus, + BinaryMinus, + BinaryMul, + BinaryDiv, + BinaryMin, + BinaryMax, + BinaryAtan2, + + TernaryIf +}; + +template< typename charT, typename traits > +inline std::basic_ostream & operator <<( + std::basic_ostream & stream, const ExpressionFunct& eFunc ) +{ + switch (eFunc) + { + case ExpressionFunct::Const : return stream << "const"; + + case ExpressionFunct::EnumPi : return stream << "pi"; + case ExpressionFunct::EnumLeft : return stream << "left"; + case ExpressionFunct::EnumTop : return stream << "top"; + case ExpressionFunct::EnumRight : return stream << "right"; + case ExpressionFunct::EnumBottom : return stream << "bottom"; + case ExpressionFunct::EnumXStretch : return stream << "xstretch"; + case ExpressionFunct::EnumYStretch : return stream << "ystretch"; + case ExpressionFunct::EnumHasStroke : return stream << "hasstroke"; + case ExpressionFunct::EnumHasFill : return stream << "hasfill"; + case ExpressionFunct::EnumWidth : return stream << "width"; + case ExpressionFunct::EnumHeight : return stream << "height"; + case ExpressionFunct::EnumLogWidth : return stream << "logwidth"; + case ExpressionFunct::EnumLogHeight : return stream << "logheight"; + case ExpressionFunct::EnumAdjustment : return stream << "adjustment"; + case ExpressionFunct::EnumEquation : return stream << "equation"; + + case ExpressionFunct::UnaryAbs : return stream << "abs"; + case ExpressionFunct::UnarySqrt : return stream << "sqrt"; + case ExpressionFunct::UnarySin : return stream << "sin"; + case ExpressionFunct::UnaryCos : return stream << "cos"; + case ExpressionFunct::UnaryTan : return stream << "tan"; + case ExpressionFunct::UnaryAtan : return stream << "atan"; + case ExpressionFunct::UnaryNeg : return stream << "neg"; + + case ExpressionFunct::BinaryPlus : return stream << "plus"; + case ExpressionFunct::BinaryMinus : return stream << "minus"; + case ExpressionFunct::BinaryMul : return stream << "mul"; + case ExpressionFunct::BinaryDiv : return stream << "div"; + case ExpressionFunct::BinaryMin : return stream << "min"; + case ExpressionFunct::BinaryMax : return stream << "max"; + case ExpressionFunct::BinaryAtan2 : return stream << "atan2"; + + case ExpressionFunct::TernaryIf : return stream << "if"; + + default: return stream << "?(" << static_cast(eFunc) << ")"; + } +} + +#define EXPRESSION_FLAG_SUMANGLE_MODE 1 + +SVXCORE_DLLPUBLIC void FillEquationParameter( const css::drawing::EnhancedCustomShapeParameter&, const sal_Int32, EnhancedCustomShapeEquation& ); + +class SAL_DLLPUBLIC_RTTI ExpressionNode +{ +public: + virtual ~ExpressionNode(); + + /** Predicate whether this node is constant. + + This predicate returns true, if this node is + neither time- nor ViewInfo dependent. This allows + for certain optimizations, i.e. not the full + expression tree needs be represented by + ExpressionNodes. + + @returns true, if the note is constant + */ + virtual bool isConstant() const = 0; + + /** Operator to calculate function value. + + This method calculates the function value. + */ + virtual double operator()() const = 0; + + /** Operator to retrieve the type of expression node + */ + virtual ExpressionFunct getType() const = 0; + + /** Operator to retrieve the ms version of expression + */ + virtual css::drawing::EnhancedCustomShapeParameter fillNode( + std::vector< EnhancedCustomShapeEquation >& rEquations, ExpressionNode* pOptionalArg, sal_uInt32 nFlags ) = 0; +}; + +/** This exception is thrown, when the arithmetic expression + parser failed to parse a string. + */ +struct ParseError +{ + ParseError( const char* ) {} +}; + +class FunctionParser +{ +public: + + /** Parse a string + + The following grammar is accepted by this method: + + + number_digit = '0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9' + + number = number number_digit | number_digit + + identifier = 'pi'|'left'|'top'|'right'|'bottom'|'xstretch'|'ystretch'| + 'hasstroke'|'hasfill'|'width'|'height'|'logwidth'|'logheight' + + unary_function = 'abs'|'sqrt'|'sin'|'cos'|'tan'|'atan' + binary_function = 'min'|'max'|'atan2' + ternary_function = 'if' + + function_reference = '?' 'a-z,A-Z,0-9' ' ' + modifier_reference = '$' '0-9' ' ' + + basic_expression = + number | + identifier | + function_reference | + unary_function '(' additive_expression ')' | + binary_function '(' additive_expression ',' additive_expression ')' | + ternary_function '(' additive_expression ',' additive_expression ', + ' additive_expression ')' | '(' additive_expression ')' + + unary_expression = '-' basic_expression + + multiplicative_expression = + basic_expression | + multiplicative_expression '*' basic_expression | + multiplicative_expression '/' basic_expression + + additive_expression = + multiplicative_expression | + additive_expression '+' multiplicative_expression | + additive_expression '-' multiplicative_expression + + + + @param rFunction + The string to parse + + @param rCustoShape + The CustomShape is required for calculation of dynamic values such + "hasstroke", function references and or modifier references ... + + @throws ParseError if an invalid expression is given. + + @return the generated function object. + */ + + UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) static std::shared_ptr const & parseFunction( const OUString& rFunction, const EnhancedCustomShape2d& rCustoShape ); + + // this is a singleton + FunctionParser() = delete; + FunctionParser(const FunctionParser&) = delete; + FunctionParser& operator=( const FunctionParser& ) = delete; +}; + +} + +#endif // INCLUDED_SVX_ENHANCEDCUSTOMSHAPEFUNCTIONPARSER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/EnhancedCustomShapeGeometry.hxx b/include/svx/EnhancedCustomShapeGeometry.hxx new file mode 100644 index 000000000..a52dc4820 --- /dev/null +++ b/include/svx/EnhancedCustomShapeGeometry.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_SVX_ENHANCEDCUSTOMSHAPEGEOMETRY_HXX +#define INCLUDED_SVX_ENHANCEDCUSTOMSHAPEGEOMETRY_HXX + +#include +#include +#include +#include + +struct SvxMSDffVertPair +{ + sal_Int32 nValA; + sal_Int32 nValB; +}; +struct SvxMSDffCalculationData +{ + sal_uInt16 nFlags; + sal_Int32 nVal[ 3 ]; +}; +struct SvxMSDffTextRectangles +{ + SvxMSDffVertPair nPairA; + SvxMSDffVertPair nPairB; +}; + +enum class SvxMSDffHandleFlags +{ + NONE = 0x0000, + MIRRORED_X = 0x0001, + MIRRORED_Y = 0x0002, + SWITCHED = 0x0004, + POLAR = 0x0008, + MAP = 0x0010, + RANGE = 0x0020, + RANGE_X_MIN_IS_SPECIAL = 0x0080, + RANGE_X_MAX_IS_SPECIAL = 0x0100, + RANGE_Y_MIN_IS_SPECIAL = 0x0200, + RANGE_Y_MAX_IS_SPECIAL = 0x0400, + CENTER_X_IS_SPECIAL = 0x0800, + CENTER_Y_IS_SPECIAL = 0x1000, + RADIUS_RANGE = 0x2000, +}; +namespace o3tl +{ + template<> struct typed_flags : is_typed_flags {}; +} + +struct SvxMSDffHandle +{ + SvxMSDffHandleFlags nFlags; + sal_Int32 nPositionX, nPositionY, nCenterX, nCenterY, nRangeXMin, nRangeXMax, nRangeYMin, nRangeYMax; +}; +struct mso_CustomShape +{ + SvxMSDffVertPair* pVertices; + sal_uInt32 nVertices; + sal_uInt16* pElements; + sal_uInt32 nElements; + SvxMSDffCalculationData* pCalculation; + sal_uInt32 nCalculation; + sal_Int32* pDefData; + SvxMSDffTextRectangles* pTextRect; + sal_uInt32 nTextRect; + sal_Int32 nCoordWidth; + sal_Int32 nCoordHeight; + sal_Int32 nXRef; + sal_Int32 nYRef; + SvxMSDffVertPair* pGluePoints; + sal_uInt32 nGluePoints; + SvxMSDffHandle* pHandles; + sal_uInt32 nHandles; +}; + +#define MSO_I | sal_Int32(0x80000000) + +bool SortFilledObjectsToBackByDefault( MSO_SPT eSpType ); +SVXCORE_DLLPUBLIC bool IsCustomShapeFilledByDefault( MSO_SPT eSpType ); +SVXCORE_DLLPUBLIC sal_Int16 GetCustomShapeConnectionTypeDefault( MSO_SPT eSpType ); + +// #i28269# +SVXCORE_DLLPUBLIC bool IsCustomShapeStrokedByDefault( MSO_SPT eSpType ); + +SVXCORE_DLLPUBLIC const mso_CustomShape* GetCustomShapeContent( MSO_SPT eSpType ); + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/EnhancedCustomShapeTypeNames.hxx b/include/svx/EnhancedCustomShapeTypeNames.hxx new file mode 100644 index 000000000..2e5f49da0 --- /dev/null +++ b/include/svx/EnhancedCustomShapeTypeNames.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_SVX_ENHANCEDCUSTOMSHAPETYPENAMES_HXX +#define INCLUDED_SVX_ENHANCEDCUSTOMSHAPETYPENAMES_HXX +#include +#include +#include + +namespace EnhancedCustomShapeTypeNames +{ + SVXCORE_DLLPUBLIC MSO_SPT Get( const OUString& ); + SVXCORE_DLLPUBLIC OUString Get( const MSO_SPT ); + SVXCORE_DLLPUBLIC OUString GetAccName( const OUString& ); +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/IAccessibleParent.hxx b/include/svx/IAccessibleParent.hxx new file mode 100644 index 000000000..19284a7d0 --- /dev/null +++ b/include/svx/IAccessibleParent.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_SVX_IACCESSIBLEPARENT_HXX +#define INCLUDED_SVX_IACCESSIBLEPARENT_HXX + +#include + +namespace accessibility { class AccessibleControlShape; } +namespace com::sun::star::accessibility { class XAccessible; } +namespace com::sun::star::beans { class XPropertySet; } +namespace com::sun::star::drawing { class XShape; } + +namespace accessibility { + +class AccessibleShape; +class AccessibleShapeTreeInfo; + +/** This interface contains methods missing from the + XAccessibleContext interface that allow the modification of + parent/child relationship. +*/ +class IAccessibleParent +{ +public: + /** Allow for a virtual destructor. + */ + virtual ~IAccessibleParent(){}; + + /** A call to this method requests the implementor to replace one child + with another and send the appropriate notifications. That are two + child events: One notifying the removal of the current child and one + about the existence of the new child. The index of the new child is + implementation dependent, i.e. it is not guaranteed that the + replacement has the same index as the current child has. + +

A default implementation can just use the ShapeTypeHandler::CreateAccessibleObject + to let a factory create the new instance with the parameters given, and then + place the new shape into the own structures.

+ + @param pCurrentChild + This child is about to be replaced. + + @param _rxShape + The UNO shape which the old and new child represent + + @param _nIndex + The IndexInParent of the old child. Note that the index in + parent of the replacement is not necessarily the same as + that of the current child. + + @param _rShapeTreeInfo + The TreeInfo for the old child. + + @return + If the replacement has taken place successfully is + returned. If the replacement can not be carried out or an error + occurs that does not result in an exception then is + returned. + + @throws RuntimeException + in case something went heavily wrong + */ + virtual bool ReplaceChild ( + AccessibleShape* pCurrentChild, + const css::uno::Reference< css::drawing::XShape >& _rxShape, + const long _nIndex, + const AccessibleShapeTreeInfo& _rShapeTreeInfo + ) = 0; + //Add this method to support Form Controls + /// @throws css::uno::RuntimeException + virtual AccessibleControlShape* GetAccControlShapeFromModel + (css::beans::XPropertySet*){return nullptr;}; + /// @throws css::uno::RuntimeException + virtual css::uno::Reference< + css::accessibility::XAccessible> + GetAccessibleCaption (const css::uno::Reference< + css::drawing::XShape>&){return nullptr;}; + virtual bool IsDocumentSelAll(){ return false; } +}; + +} // end of namespace accessibility + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/IAccessibleViewForwarder.hxx b/include/svx/IAccessibleViewForwarder.hxx new file mode 100644 index 000000000..247e29c41 --- /dev/null +++ b/include/svx/IAccessibleViewForwarder.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_SVX_IACCESSIBLEVIEWFORWARDER_HXX +#define INCLUDED_SVX_IACCESSIBLEVIEWFORWARDER_HXX + +#include + + +namespace accessibility { + + +/**

This interface provides the means to transform between internal + coordinates in 100th of mm and screen coordinates without giving direct + access to the underlying view. Each view forwarder represents a + specific real or virtual window. A call to + GetVisibleArea returns the visible rectangle that + corresponds to this window.

+ +

This interface is similar to the SvxViewForwarder but + differs in two important points: Firstly the GetVisArea + method returns a rectangle in internal coordinates and secondly the + transformation methods do not require explicit mapmodes. These have to + be provided implicitly by the classes that implement this + interface. A third, less important, difference are the additional + transformation methods for sizes. The reasons for their existence are + convenience and improved performance.

+ + @attention + Note, that modifications of the underlying view that lead to + different transformations between internal and screen coordinates or + change the validity of the forwarder have to be signaled separately. +*/ +class IAccessibleViewForwarder +{ +public: + IAccessibleViewForwarder() = default; + IAccessibleViewForwarder(IAccessibleViewForwarder const &) = default; + IAccessibleViewForwarder(IAccessibleViewForwarder &&) = default; + IAccessibleViewForwarder & operator =(IAccessibleViewForwarder const &) = default; + IAccessibleViewForwarder & operator =(IAccessibleViewForwarder &&) = default; + + virtual ~IAccessibleViewForwarder(){}; + + /** Returns the area of the underlying document that is visible in the + * corresponding window. + + @return + The rectangle of the visible part of the document. The values + are, contrary to the base class, in internal coordinates of + 100th of mm. + */ + virtual tools::Rectangle GetVisibleArea() const = 0; + + /** Transform the specified point from internal coordinates in 100th of + mm to an absolute screen position. + + @param rPoint + Point in internal coordinates (100th of mm). + + @return + The same point but in screen coordinates relative to the upper + left corner of the (current) screen. + */ + virtual Point LogicToPixel (const Point& rPoint) const = 0; + + /** Transform the specified size from internal coordinates in 100th of + mm to a screen oriented pixel size. + + @param rSize + Size in internal coordinates (100th of mm). + + @return + The same size but in screen coordinates. + */ + virtual Size LogicToPixel (const Size& rSize) const = 0; + +}; + +} // end of namespace accessibility + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/IAccessibleViewForwarderListener.hxx b/include/svx/IAccessibleViewForwarderListener.hxx new file mode 100644 index 000000000..d22c0db56 --- /dev/null +++ b/include/svx/IAccessibleViewForwarderListener.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_SVX_IACCESSIBLEVIEWFORWARDERLISTENER_HXX +#define INCLUDED_SVX_IACCESSIBLEVIEWFORWARDERLISTENER_HXX + + +namespace accessibility { + +/**

The purpose of this interface is to notify a user of an + IAccessibleViewForwarder when that view forwarder changes its + properties. Such a change may be one of the following: +

    +
  • Change of the coordinate transformation.
  • +
  • Change of the visible area (which in turn results in a change of the + coordinate transformation.
  • +
  • Change of the validity state of the view forwarder.
  • +*/ +class IAccessibleViewForwarderListener +{ +public: + + /** This method is called to indicate a change of the specified view + forwarder, specifically, a change in visible area. + */ + virtual void ViewForwarderChanged() = 0; + +protected: + ~IAccessibleViewForwarderListener() {} +}; + +} // end of namespace accessibility + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/ImageMapInfo.hxx b/include/svx/ImageMapInfo.hxx new file mode 100644 index 000000000..7cd8f4f17 --- /dev/null +++ b/include/svx/ImageMapInfo.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 . + */ + +#pragma once + +#include +#include +#include + +#define SVX_IMAPINFO_ID 2 + +class SVXCORE_DLLPUBLIC SvxIMapInfo final : public SdrObjUserData, public SfxListener +{ + ImageMap aImageMap; + +public: + SvxIMapInfo(const ImageMap& rImageMap) + : SdrObjUserData(SdrInventor::StarDrawUserData, SVX_IMAPINFO_ID) + , aImageMap(rImageMap){}; + + SvxIMapInfo(const SvxIMapInfo& rIMapInfo) + : SdrObjUserData(SdrInventor::StarDrawUserData, SVX_IMAPINFO_ID) + , SfxListener() + , aImageMap(rIMapInfo.aImageMap){}; + + virtual std::unique_ptr Clone(SdrObject*) const override + { + return std::unique_ptr(new SvxIMapInfo(*this)); + } + + void SetImageMap(const ImageMap& rIMap) { aImageMap = rIMap; } + const ImageMap& GetImageMap() const { return aImageMap; } + + static SvxIMapInfo* GetIMapInfo(const SdrObject* pObject); + static IMapObject* GetHitIMapObject(const SdrObject* pObj, const Point& rWinPoint, + const vcl::Window* rCmpWnd = nullptr); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/Palette.hxx b/include/svx/Palette.hxx new file mode 100644 index 000000000..c505eb412 --- /dev/null +++ b/include/svx/Palette.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_SVX_PALETTE_HXX +#define INCLUDED_SVX_PALETTE_HXX + +#include +#include + +class Color; +class SvxColorValueSet; + +typedef std::pair NamedColor; + +class Palette +{ +public: + virtual ~Palette(); + + virtual const OUString& GetName() = 0; + virtual const OUString& GetPath() = 0; + virtual void LoadColorSet(SvxColorValueSet& rColorSet) = 0; + + virtual bool IsValid() = 0; +}; + +#endif // INCLUDED_SVX_PALETTE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/PaletteManager.hxx b/include/svx/PaletteManager.hxx new file mode 100644 index 000000000..637f7d0e1 --- /dev/null +++ b/include/svx/PaletteManager.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_SVX_PALETTEMANAGER_HXX +#define INCLUDED_SVX_PALETTEMANAGER_HXX + +#include +#include +#include + +#include +#include +#include + +namespace com::sun::star::uno { class XComponentContext; } +namespace svx { class ToolboxButtonColorUpdaterBase; } +namespace weld { class Window; } + +class SVXCORE_DLLPUBLIC PaletteManager +{ + const sal_uInt16 mnMaxRecentColors; + + sal_uInt16 mnNumOfPalettes; + sal_uInt16 mnCurrentPalette; + + long mnColorCount; + svx::ToolboxButtonColorUpdaterBase* mpBtnUpdater; + + XColorListRef pColorList; + std::deque maRecentColors; + std::vector> m_Palettes; + + std::function maColorSelectFunction; + css::uno::Reference < css::uno::XComponentContext > m_context; +public: + PaletteManager(); + ~PaletteManager(); + PaletteManager(const PaletteManager&) = delete; + PaletteManager& operator=(const PaletteManager&) = delete; + void LoadPalettes(); + void ReloadColorSet(SvxColorValueSet& rColorSet); + void ReloadRecentColorSet(SvxColorValueSet& rColorSet); + std::vector GetPaletteList(); + void SetPalette( sal_Int32 nPos ); + sal_Int32 GetPalette() const; + sal_Int32 GetPaletteCount() const { return mnNumOfPalettes; } + OUString GetPaletteName(); + OUString GetSelectedPalettePath(); + + long GetColorCount() const; + long GetRecentColorCount() const; + void AddRecentColor(const Color& rRecentColor, const OUString& rColorName, bool bFront = true); + + void SetBtnUpdater(svx::ToolboxButtonColorUpdaterBase* pBtnUpdater); + void PopupColorPicker(weld::Window* pParent, const OUString& aCommand, const Color& rInitialColor); + + void SetColorSelectFunction(const std::function& aColorSelectFunction); + + static void DispatchColorCommand(const OUString& aCommand, const NamedColor& rColor); +}; + +#endif // INCLUDED_SVX_PALETTEMANAGER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/ParaLineSpacingPopup.hxx b/include/svx/ParaLineSpacingPopup.hxx new file mode 100644 index 000000000..a595b9570 --- /dev/null +++ b/include/svx/ParaLineSpacingPopup.hxx @@ -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 INCLUDED_SVX_SOURCE_SIDEBAR_PARAGRAPH_PARALINESPACINGPOPUP_HXX +#define INCLUDED_SVX_SOURCE_SIDEBAR_PARAGRAPH_PARALINESPACINGPOPUP_HXX + +#include +#include + +namespace svx { + +class SvxLineSpacingToolBoxControl final : public svt::PopupWindowController +{ +public: + explicit SvxLineSpacingToolBoxControl( const css::uno::Reference& rContext ); + virtual ~SvxLineSpacingToolBoxControl() override; + + virtual void SAL_CALL execute(sal_Int16 KeyModifier) override; + + virtual VclPtr createVclPopupWindow( vcl::Window* pParent ) override; + virtual std::unique_ptr weldPopupWindow() override; + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() override; + virtual css::uno::Sequence SAL_CALL getSupportedServiceNames() override; + + // XInitialization + virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& rArguments ) override; +}; + +} + +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/ParaSpacingControl.hxx b/include/svx/ParaSpacingControl.hxx new file mode 100644 index 000000000..cd13bb7d5 --- /dev/null +++ b/include/svx/ParaSpacingControl.hxx @@ -0,0 +1,121 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_SOURCE_SIDEBAR_PARAGRAPH_PARASPACINGCONTROL_HXX +#define INCLUDED_SVX_SOURCE_SIDEBAR_PARAGRAPH_PARASPACINGCONTROL_HXX + +#include +#include +#include + +namespace com::sun::star::ui { class XContextChangeEventMultiplexer; } +namespace com::sun::star::ui { struct ContextChangeEventObject; } +namespace vcl { class Window; } + +namespace svx { + +class ParaULSpacingControl : public SfxToolBoxControl +{ +public: + ParaULSpacingControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx); + virtual ~ParaULSpacingControl() override; + + virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState, + const SfxPoolItem* pState) override; + virtual VclPtr CreateItemWindow(vcl::Window* pParent) override = 0; +}; + +class SVX_DLLPUBLIC ParaAboveSpacingControl final : public ParaULSpacingControl +{ +public: + SFX_DECL_TOOLBOX_CONTROL(); + + ParaAboveSpacingControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx); + virtual VclPtr CreateItemWindow(vcl::Window* pParent) override; +}; + +class SVX_DLLPUBLIC ParaBelowSpacingControl final : public ParaULSpacingControl +{ +public: + SFX_DECL_TOOLBOX_CONTROL(); + + ParaBelowSpacingControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx); + virtual VclPtr CreateItemWindow(vcl::Window* pParent) override; +}; + +class ParaLRSpacingControl : public SfxToolBoxControl, + public css::ui::XContextChangeEventListener +{ +public: + ParaLRSpacingControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx); + virtual ~ParaLRSpacingControl() override; + + virtual void SAL_CALL dispose() override; + + virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState, + const SfxPoolItem* pState) override; + virtual VclPtr CreateItemWindow(vcl::Window* pParent) override = 0; + + // XContextChangeEventListener + virtual void SAL_CALL notifyContextChangeEvent(const css::ui::ContextChangeEventObject& rEvent) override; + + virtual ::css::uno::Any SAL_CALL queryInterface(const ::css::uno::Type& aType) override; + + virtual void SAL_CALL acquire() throw () override; + + virtual void SAL_CALL disposing(const ::css::lang::EventObject&) override; + + virtual void SAL_CALL release() throw () override; + +private: + css::uno::Reference m_xMultiplexer; +}; + +class SVX_DLLPUBLIC ParaLeftSpacingControl final : public ParaLRSpacingControl +{ +public: + SFX_DECL_TOOLBOX_CONTROL(); + + ParaLeftSpacingControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx); + virtual VclPtr CreateItemWindow(vcl::Window* pParent) override; +}; + +class SVX_DLLPUBLIC ParaRightSpacingControl final : public ParaLRSpacingControl +{ +public: + SFX_DECL_TOOLBOX_CONTROL(); + + ParaRightSpacingControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx); + virtual VclPtr CreateItemWindow(vcl::Window* pParent) override; +}; + +class SVX_DLLPUBLIC ParaFirstLineSpacingControl final : public ParaLRSpacingControl +{ +public: + SFX_DECL_TOOLBOX_CONTROL(); + + ParaFirstLineSpacingControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx); + virtual VclPtr CreateItemWindow(vcl::Window* pParent) override; +}; + +} + +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/ParseContext.hxx b/include/svx/ParseContext.hxx new file mode 100644 index 000000000..18c23ad20 --- /dev/null +++ b/include/svx/ParseContext.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_SVX_PARSECONTEXT_HXX +#define INCLUDED_SVX_PARSECONTEXT_HXX + +#include + +#include +#include +#include +#include + +namespace svxform +{ + + //= OSystemParseContext + + class SVXCORE_DLLPUBLIC OSystemParseContext final : public ::connectivity::IParseContext + { + private: + + ::std::vector< OUString > m_aLocalizedKeywords; + + public: + OSystemParseContext(); + + virtual ~OSystemParseContext(); + // retrieves language specific error messages + virtual OUString getErrorMessage(ErrorCode _eCodes) const override; + + // retrieves language specific keyword strings (only ASCII allowed) + virtual OString getIntlKeywordAscii(InternationalKeyCode _eKey) const override; + + // finds out, if we have an international keyword (only ASCII allowed) + virtual InternationalKeyCode getIntlKeyCode(const OString& rToken) const override; + + /** gets a locale instance which should be used when parsing in the context specified by this instance +

    if this is not overridden by derived classes, it returns the static default locale.

    + */ + virtual css::lang::Locale getPreferredLocale( ) const override; + + }; + + + //= OParseContextClient + + /** helper class which needs access to a (shared and ref-counted) OSystemParseContext + instance. + */ + class SVXCORE_DLLPUBLIC OParseContextClient + { + protected: + OParseContextClient(); + virtual ~OParseContextClient(); + + const OSystemParseContext* getParseContext() const; + }; +} +#endif // INCLUDED_SVX_PARSECONTEXT_HXX + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/ShapeTypeHandler.hxx b/include/svx/ShapeTypeHandler.hxx new file mode 100644 index 000000000..b58463879 --- /dev/null +++ b/include/svx/ShapeTypeHandler.hxx @@ -0,0 +1,199 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SHAPETYPEHANDLER_HXX +#define INCLUDED_SVX_SHAPETYPEHANDLER_HXX + +#include + +#include +#include +#include +#include + +namespace accessibility { class AccessibleShape; } +namespace accessibility { class AccessibleShapeInfo; } +namespace accessibility { class AccessibleShapeTreeInfo; } +namespace com::sun::star::drawing { class XShape; } +namespace com::sun::star::uno { template class Reference; } + +namespace accessibility { + +/** Use an integer to represent shape type ids. A ShapeTypeId is unique + inside one project but is not over the project boundaries. +*/ +typedef int ShapeTypeId; + +/** Define the function type for creating accessible objects for given + service names. +*/ +typedef AccessibleShape* (*tCreateFunction) + (const AccessibleShapeInfo& rShapeInfo, + const AccessibleShapeTreeInfo& rShapeTreeInfo, + ShapeTypeId nId); + +/** Each shape type is described by listing its id, its service name and a + function which creates a new accessible object that can represent that + service. The id has to be unique with respect to the create function. +*/ +struct ShapeTypeDescriptor +{ + ShapeTypeId mnShapeTypeId; + OUString msServiceName; + tCreateFunction maCreateFunction; + ShapeTypeDescriptor ( + ShapeTypeId nId, const OUString& sName, tCreateFunction aFunction) + : mnShapeTypeId (nId), + msServiceName (sName), + maCreateFunction (aFunction) + {} + ShapeTypeDescriptor() + : mnShapeTypeId (-1), + msServiceName (), + maCreateFunction (nullptr) + {} +}; + +/** @descr + This class is a singleton that has the purpose to transform between + service names of shapes and associated enum values and to create new + accessible objects for given shapes. +*/ +class SVX_DLLPUBLIC ShapeTypeHandler final +{ +public: + enum { UNKNOWN_SHAPE_TYPE = 0 }; + + /** This function returns a reference to the only instance of this class. + Use this instance to retrieve a shape's type and service name. + @return + Returns a reference to a ShapeTypeHandler object. + */ + static ShapeTypeHandler& Instance(); + + /** Determines the type id of a shape with the given service name. + @param aServiceName + Service name of the shape for which to return the type id. + @return + Returns the type id of the shape with the given service name or + -1 when the service name is not known. + */ + ShapeTypeId GetTypeId (const OUString& aServiceName) const; + + /** Determines the type id of the specified shape. + @param xShape + Reference to the shape for which to return the type id. + @return + Returns the type id of the specified shape or + -1 when the given reference is either not + set or the referenced object does not support the + XShapeDescriptor interface. + */ + ShapeTypeId GetTypeId (const css::uno::Reference< + css::drawing::XShape>& rxShape) const; + + /** Create a new accessible object for the given shape. + @param rShapeInfo + Bundle of information passed to the new accessible shape. + @param rShapeTreeInfo + Bundle of information passed down the shape tree. + @return + Pointer to the implementation object that implements the + XAccessible interface. This pointer may be NULL + if the specified shape is of unknown type. + */ + rtl::Reference + CreateAccessibleObject ( + const AccessibleShapeInfo& rShapeInfo, + const AccessibleShapeTreeInfo& rShapeTreeInfo) const; + + /** Add new shape types to the internal tables. Each new shape type is + described by one shape type descriptor. See + ShapeTypeDescriptor for more details. + + @param nDescriptorCount + Number of new shape types. + @param aDescriptorList + Array of new shape type descriptors. + */ + void AddShapeTypeList (int nDescriptorCount, + ShapeTypeDescriptor const aDescriptorList[]); + + /// get the accessible base name for an object + /// + /// @throws css::uno::RuntimeException + static OUString CreateAccessibleBaseName ( + const css::uno::Reference< css::drawing::XShape >& rxShape); + +private: + // Declare default constructor, copy constructor, destructor, and + // assignment operation protected so that no one accidentally creates a + // second instance of this singleton class or deletes it. + ShapeTypeHandler(); + ShapeTypeHandler (const ShapeTypeHandler& aHandler); // never implemented, this is a singleton class + ShapeTypeHandler& operator= (const ShapeTypeHandler& aHandler); // never implemented, this is a singleton class + + /** This destructor is never called at the moment. But because this + class is a singleton this is not a problem. + */ + ~ShapeTypeHandler(); + + /// Pointer to the only instance of this class. + static ShapeTypeHandler* instance; + + /** List of shape type descriptors. This list is normally build up in + several steps when libraries that implement shapes are loaded and + call the addShapeTypeList method. After that no modifications of + the list take place. + */ + ::std::vector maShapeTypeDescriptorList; + + /** This hash map allows the fast look up of a type descriptor for a + given service name. + */ + typedef std::unordered_map tServiceNameToSlotId; + mutable tServiceNameToSlotId maServiceNameToSlotId; + + /** Determine the slot id of the specified shape type. With this id + internal methods can access the associated type descriptor. + @param aServiceName + Service name of the shape for which to return the slot id. + @return + Returns the slot id of the shape with the given service name or + 0 when the service name is not known. + */ + SVX_DLLPRIVATE long GetSlotId (const OUString& aServiceName) const; + + /** Determine the slot id of the specified shape type. With this id + internal methods can access the associated type descriptor. + @param rxShape + Shape for which to return the slot id. + @return + Returns the slot id of the shape with the given service name or + 0 when the service name is not known. + */ + SVX_DLLPRIVATE long GetSlotId (const css::uno::Reference< + css::drawing::XShape>& rxShape) const; +}; + +} // end of namespace accessible + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/SmartTagItem.hxx b/include/svx/SmartTagItem.hxx new file mode 100644 index 000000000..9b8b11049 --- /dev/null +++ b/include/svx/SmartTagItem.hxx @@ -0,0 +1,82 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_SMARTTAGITEM_HXX +#define INCLUDED_SVX_SMARTTAGITEM_HXX + +#include +#include +#include +#include +#include + +namespace com::sun::star::container { + class XStringKeyMap; +} + +namespace com::sun::star::text { + class XTextRange; +} + +namespace com::sun::star::frame { + class XController; +} +class SVX_DLLPUBLIC SvxSmartTagItem final : public SfxPoolItem +{ + const css::uno::Sequence < css::uno::Sequence< css::uno::Reference< css::smarttags::XSmartTagAction > > > maActionComponentsSequence; + const css::uno::Sequence < css::uno::Sequence< sal_Int32 > > maActionIndicesSequence; + const css::uno::Sequence< css::uno::Reference< css::container::XStringKeyMap > > maStringKeyMaps; + const css::uno::Reference mxRange; + const css::uno::Reference mxController; + const css::lang::Locale maLocale; + const OUString maApplicationName; + const OUString maRangeText; + +public: + static SfxPoolItem* CreateDefault(); + + SvxSmartTagItem( const sal_uInt16 nId, + const css::uno::Sequence < css::uno::Sequence< css::uno::Reference< css::smarttags::XSmartTagAction > > >& rActionComponentsSequence, + const css::uno::Sequence < css::uno::Sequence< sal_Int32 > >& rActionIndicesSequence, + const css::uno::Sequence< css::uno::Reference< css::container::XStringKeyMap > >& rStringKeyMaps, + const css::uno::Reference& rRange, + const css::uno::Reference& rController, + const css::lang::Locale& rLocale, + const OUString& rApplicationName, + const OUString& rRangeText ); + + // "purely virtual methods" from the SfxPoolItem + virtual bool operator==( const SfxPoolItem& ) const override; + virtual SvxSmartTagItem* Clone( SfxItemPool *pPool = nullptr ) const override; + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + const css::uno::Sequence < css::uno::Sequence< css::uno::Reference< css::smarttags::XSmartTagAction > > >& GetActionComponentsSequence() const { return maActionComponentsSequence; } + const css::uno::Sequence < css::uno::Sequence< sal_Int32 > >& GetActionIndicesSequence() const { return maActionIndicesSequence; } + const css::uno::Sequence< css::uno::Reference< css::container::XStringKeyMap > >& GetStringKeyMaps() const { return maStringKeyMaps; } + const css::uno::Reference& GetTextRange() const { return mxRange; } + const css::uno::Reference& GetController() const { return mxController; } + const css::lang::Locale& GetLocale() const { return maLocale; } + const OUString& GetApplicationName() const { return maApplicationName; } + const OUString& GetRangeText() const { return maRangeText; } +}; + +#endif // INCLUDED_SVX_SMARTTAGITEM_HXX + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/SmartTagMgr.hxx b/include/svx/SmartTagMgr.hxx new file mode 100644 index 000000000..b20f68a60 --- /dev/null +++ b/include/svx/SmartTagMgr.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_SVX_SMARTTAGMGR_HXX +#define INCLUDED_SVX_SMARTTAGMGR_HXX + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +namespace com::sun::star::uno { + class XComponentContext; +} + +namespace com::sun::star::smarttags { + class XSmartTagRecognizer; + class XSmartTagAction; +} + +namespace com::sun::star::text { + class XTextMarkup; + class XTextRange; +} + +namespace com::sun::star::i18n { + class XBreakIterator; +} + +namespace com::sun::star::lang { + struct Locale; + struct EventObject; + struct ChangesEvent; +} + +namespace com::sun::star::beans { + class XPropertySet; +} + +namespace com::sun::star::frame { + class XController; +} + +/** A reference to a smart tag action + + An action service can support various actions. Therefore an ActionReference + consists of a reference to the service and index. + */ +struct ActionReference +{ + css::uno::Reference< css::smarttags::XSmartTagAction > mxSmartTagAction; + sal_Int32 mnSmartTagIndex; + ActionReference( css::uno::Reference< css::smarttags::XSmartTagAction > const & xSmartTagAction, sal_Int32 nSmartTagIndex ) + : mxSmartTagAction( xSmartTagAction), mnSmartTagIndex( nSmartTagIndex ) {} +}; + +/** The smart tag manager maintains all installed action and recognizer services + + This class organizes the available smarttag libraries and provides access functions + to these libraries. The smart tag manager is a singleton. +*/ +class SVX_DLLPUBLIC SmartTagMgr : public cppu::WeakImplHelper< css::util::XModifyListener, + css::util::XChangesListener > +{ +private: + + const OUString maApplicationName; + std::vector< css::uno::Reference< css::smarttags::XSmartTagRecognizer > > maRecognizerList; + std::vector< css::uno::Reference< css::smarttags::XSmartTagAction > > maActionList; + std::set< OUString > maDisabledSmartTagTypes; + std::multimap < OUString, ActionReference > maSmartTagMap; + mutable css::uno::Reference< css::i18n::XBreakIterator > mxBreakIter; + css::uno::Reference< css::uno::XComponentContext> mxContext; + css::uno::Reference< css::beans::XPropertySet > mxConfigurationSettings; + bool mbLabelTextWithSmartTags; + + /** Checks for installed smart tag recognizers/actions and stores them in + maRecognizerList and maActionList. + */ + void LoadLibraries(); + + /** Prepare configuration access. + */ + void PrepareConfiguration( const OUString& rConfigurationGroupName ); + + /** Reads the configuration data. + */ + void ReadConfiguration( bool bExcludedTypes, bool bRecognize ); + + /** Registers the smart tag manager as listener at the package manager. + */ + void RegisterListener(); + + /** Sets up a map that maps smart tag type names to actions references. + */ + void AssociateActionsWithRecognizers(); + +public: + + SmartTagMgr( const OUString& rApplicationName ); + virtual ~SmartTagMgr() override; + + /** Triggers configuration reading, library loading and listener registration + NOTE: MUST BE CALLED AFTER CONSTRUCTION! + */ + void Init( const OUString& rConfigurationGroupName ); + + /** Dispatches the recognize call to all installed smart tag recognizers + + @param rText + The string to be scanned by the recognizers. + + @param xMarkup + The object allows the recognizers to store any found smart tags. + + @param xController + The current controller of the document. + + @param rLocale + The locale of rText. + + @param nStart + The start offset of the text to be scanned in rText. + + @param nLen + The length of the text to be scanned. + + */ + + void RecognizeString( const OUString& rText, + const css::uno::Reference< css::text::XTextMarkup >& rMarkup, + const css::uno::Reference< css::frame::XController >& rController, + const css::lang::Locale& rLocale, + sal_uInt32 nStart, sal_uInt32 nLen ) const; + + void RecognizeTextRange(const css::uno::Reference< css::text::XTextRange>& rRange, + const css::uno::Reference< css::text::XTextMarkup >& rMarkup, + const css::uno::Reference< css::frame::XController >& rController) const; + + /** Returns all action references associated with a given list of smart tag types + + @param rSmartTagTypes + The list of types + + @param rActionComponentsSequence + Output parameter + + @param rActionIndicesSequence + Output parameter + */ + void GetActionSequences( std::vector< OUString >& rSmartTagTypes, + css::uno::Sequence < css::uno::Sequence< css::uno::Reference< css::smarttags::XSmartTagAction > > >& rActionComponentsSequence, + css::uno::Sequence < css::uno::Sequence< sal_Int32 > >& rActionIndicesSequence ) const; + + /** Returns the caption for a smart tag type. + + @param rSmartTagType + The given smart tag type. + + @param rLocale + The locale. + */ + OUString GetSmartTagCaption( const OUString& rSmartTagType, const css::lang::Locale& rLocale ) const; + + /** Returns true if the given smart tag type is enabled. + */ + bool IsSmartTagTypeEnabled( const OUString& rSmartTagType ) const; + + /** Enable or disable smart tags. + */ + bool IsLabelTextWithSmartTags() const { return mbLabelTextWithSmartTags; } + + /** Returns the number of registered recognizers. + */ + sal_uInt32 NumberOfRecognizers() const { return maRecognizerList.size(); } + + /** Returns a recognizer. + */ + css::uno::Reference< css::smarttags::XSmartTagRecognizer > const & + GetRecognizer( sal_uInt32 i ) const { return maRecognizerList[i]; } + + /** Is smart tag recognition active? + */ + bool IsSmartTagsEnabled() const { return 0 != NumberOfRecognizers() && + IsLabelTextWithSmartTags(); } + + /** Writes configuration settings. + */ + void WriteConfiguration( const bool* bLabelTextWithSmartTags, + const std::vector< OUString >* pDisabledTypes ) const; + + /** Returns the name of the application this instance has been created by. + */ + const OUString& GetApplicationName() const { return maApplicationName; } + + // css::lang::XEventListener + virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override; + + // css::util::XModifyListener + virtual void SAL_CALL modified( const css::lang::EventObject& aEvent ) override; + + // css::util::XChangesListener + virtual void SAL_CALL changesOccurred( const css::util::ChangesEvent& Event ) override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/SpellDialogChildWindow.hxx b/include/svx/SpellDialogChildWindow.hxx new file mode 100644 index 000000000..4b6df6e99 --- /dev/null +++ b/include/svx/SpellDialogChildWindow.hxx @@ -0,0 +1,117 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SPELLDIALOGCHILDWINDOW_HXX +#define INCLUDED_SVX_SPELLDIALOGCHILDWINDOW_HXX + +#include +#include +#include + +class AbstractSpellDialog; + +namespace svx { + +/** The child window wrapper of the actual spelling dialog. To use the + spelling dialog in an application you have to do the usual things: +
      +
    1. Call this class' RegisterChildWindow() method with the module + as second argument that you want the dialog included in.
    2. +
    3. In the SFX_IMPL_INTERFACE implementation of the view shell + that wants to use the dialog call RegisterChildWindow() + with the id returned by this class' GetChildWindowId() + method.
    4. +
    5. Include the item associated with this child window to the SDI + description of the view shell.
    6. +
    +*/ +class SVX_DLLPUBLIC SpellDialogChildWindow + : public SfxChildWindow +{ + friend class SpellDialog; + VclPtr m_xAbstractSpellDialog; +public: + SpellDialogChildWindow ( + vcl::Window*pParent, + sal_uInt16 nId, + SfxBindings* pBindings); + virtual ~SpellDialogChildWindow () override; + +protected: + /** This abstract method has to be defined by a derived class. It + returns the next wrong sentence. + @return + returns an empty vector if no error could be found + */ + virtual SpellPortions GetNextWrongSentence (bool bRecheck) = 0; + + /** This abstract method applies the changes made in the spelling dialog + to the document. + The dialog always updates its settings when it gets the focus. The document + can rely on the fact that the methods ApplyChangedSentence() is called for the + position that the last GetNextWrongSentence() returned. + If 'bRecheck' is set to true then the same sentence should be rechecked once from + the start. This should be used to find errors that the user has introduced by + manual changes in the edit field, and in order to not miss the still following errors + in that sentence. + */ + virtual void ApplyChangedSentence(const SpellPortions& rChanged, bool bRecheck ) = 0; + /** This methods determines whether the application supports AutoCorrection + */ + virtual bool HasAutoCorrection(); + /** This method adds a word pair to the AutoCorrection - if available + */ + virtual void AddAutoCorrection(const OUString& rOld, const OUString& rNew, LanguageType eLanguage); + /** Return the sfx bindings for this child window. They are + retrieved from the dialog so they do not have to be stored in + this class as well. The bindings may be necessary to be used + by the abstract methods. + */ + /** This method determines if grammar checking is supported + */ + virtual bool HasGrammarChecking(); + /** determines if grammar checking is switched on + */ + virtual bool IsGrammarChecking(); + /** switches grammar checking on/off + */ + virtual void SetGrammarChecking(bool bOn); + + SfxBindings& GetBindings() const; + /** Set the spell dialog into the 'resume' state. This method should be called + to notify the SpellDialog about changes in the document that invalidate the + current state which results in disabling most of the dialog controls and presenting + a "Resume" button that initiates a reinitialization. + */ + void InvalidateSpellDialog(); + /** Notifies the ChildWindow about the get focus event. The ChildWindow should no check if + the spelling dialog should be set to the 'Resume' state by calling InvalidateSpellDialog() + */ + virtual void GetFocus() = 0; + /** Notifies the ChildWindow about the lose focus event. The ChildWindow should use it to save + the current selection/state. + */ + virtual void LoseFocus() = 0; +}; + +} // end of namespace ::svx + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/SvxColorChildWindow.hxx b/include/svx/SvxColorChildWindow.hxx new file mode 100644 index 000000000..07b44a08f --- /dev/null +++ b/include/svx/SvxColorChildWindow.hxx @@ -0,0 +1,40 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_SVXCOLORCHILDWINDOW_HXX +#define INCLUDED_SVX_SVXCOLORCHILDWINDOW_HXX + +#include +#include + +/** + * Child of SfxChildWindow as a "container" for Controller + */ +class SVX_DLLPUBLIC SvxColorChildWindow final : public SfxChildWindow +{ + public: + SvxColorChildWindow( vcl::Window*, sal_uInt16, SfxBindings*, + SfxChildWinInfo* ); + + SFX_DECL_CHILDWINDOW_WITHID(SvxColorChildWindow); +}; + + +#endif // INCLUDED_SVX_SVXCOLORCHILDWINDOW_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/SvxColorValueSet.hxx b/include/svx/SvxColorValueSet.hxx new file mode 100644 index 000000000..143627ffe --- /dev/null +++ b/include/svx/SvxColorValueSet.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_SVX_SVXCOLORVALUESET_HXX +#define INCLUDED_SVX_SVXCOLORVALUESET_HXX + +#include +#include +#include + +class XColorList; + +class SVXCORE_DLLPUBLIC SvxColorValueSet : public ValueSet +{ +public: + SvxColorValueSet(std::unique_ptr pWindow); + + virtual void Resize() override; + + static sal_uInt32 getMaxRowCount(); + static sal_uInt32 getEntryEdgeLength(); + static sal_uInt32 getColumnCount(); + + void addEntriesForXColorList(const XColorList& rXColorList, sal_uInt32 nStartIndex = 1); + void addEntriesForColorSet(const std::set& rColorSet, const OUString& rNamePrefix); + Size layoutAllVisible(sal_uInt32 nEntryCount); + Size layoutToGivenHeight(sal_uInt32 nHeight, sal_uInt32 nEntryCount); +}; + +#endif // INCLUDED_SVX_SVXCOLORVALUESET_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/SvxNumOptionsTabPageHelper.hxx b/include/svx/SvxNumOptionsTabPageHelper.hxx new file mode 100644 index 000000000..98766254d --- /dev/null +++ b/include/svx/SvxNumOptionsTabPageHelper.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_SVX_SVXNUMOPTIONSTABPAGEHELPER_HXX +#define INCLUDED_SVX_SVXNUMOPTIONSTABPAGEHELPER_HXX + +#include +#include +#include + +using namespace css::uno; +using namespace css::text; + +class SVXCORE_DLLPUBLIC SvxNumOptionsTabPageHelper +{ +public: + static Reference GetNumberingProvider(); + + /** Get the numberings provided by the i18n framework (CTL, Asian, ...) and + add them to the listbox. Extended numbering schemes present in the + resource and already in the listbox but not offered by the i18n + framework per configuration are removed. + + @param nDoNotRemove + A value that shall not be removed, i.e. the ugly 0x88 + (SVX_NUM_BITMAP|0x80) + Pass ::std::numeric_limits::max() if there is no such + restriction. + */ + static void GetI18nNumbering(weld::ComboBox& rFmtLB, sal_uInt16 nDoNotRemove); +}; + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/SvxPresetListBox.hxx b/include/svx/SvxPresetListBox.hxx new file mode 100644 index 000000000..7b5cca421 --- /dev/null +++ b/include/svx/SvxPresetListBox.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_SVX_SVXPRESETLISTBOX_HXX +#define INCLUDED_SVX_SVXPRESETLISTBOX_HXX + +#include +#include +#include + +class SVXCORE_DLLPUBLIC SvxPresetListBox final : public ValueSet +{ +private: + static constexpr sal_uInt32 nColCount = 3; + Size aIconSize; + Link maRenameHdl; + Link maDeleteHdl; + + void OnMenuItemSelected(const OString& rIdent); + + template< typename ListType, typename EntryType > + void FillPresetListBoxImpl(ListType& pList, sal_uInt32 nStartIndex); + +public: + SvxPresetListBox(std::unique_ptr pWindow); + + virtual void Resize() override; + virtual bool Command(const CommandEvent& rEvent) override; + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; + Size const & GetIconSize() const { return aIconSize; } + + void SetRenameHdl( const Link& rLink ) + { + maRenameHdl = rLink; + } + void SetDeleteHdl( const Link& rLink ) + { + maDeleteHdl = rLink; + } + + void FillPresetListBox(XGradientList& pList, sal_uInt32 nStartIndex = 1); + void FillPresetListBox(XHatchList& pList, sal_uInt32 nStartIndex = 1); + void FillPresetListBox(XBitmapList& pList, sal_uInt32 nStartIndex = 1); + void FillPresetListBox(XPatternList& pList, sal_uInt32 nStartIndex = 1); + void DrawLayout(); +}; + +#endif // INCLUDED_SVX_SVXPRESETLISTBOX_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/SvxShapeTypes.hxx b/include/svx/SvxShapeTypes.hxx new file mode 100644 index 000000000..65bfa0414 --- /dev/null +++ b/include/svx/SvxShapeTypes.hxx @@ -0,0 +1,72 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVXSHAPETYPES_HXX +#define INCLUDED_SVX_SVXSHAPETYPES_HXX + +namespace accessibility { + +/** Register the SVX draw shape types with the ShapeTypeHandler singleton. + This method is usually called from the shape type handler constructor. +*/ +void RegisterDrawShapeTypes(); + +/** Enum describing all shape types known in the SVX project. +*/ +enum SvxShapeTypes +{ + DRAWING_RECTANGLE = 1, + DRAWING_ELLIPSE, + DRAWING_CONTROL, + DRAWING_CONNECTOR, + DRAWING_MEASURE, + DRAWING_LINE, + DRAWING_POLY_POLYGON, + DRAWING_POLY_LINE, + DRAWING_OPEN_BEZIER, + DRAWING_CLOSED_BEZIER, + DRAWING_OPEN_FREEHAND, + DRAWING_CLOSED_FREEHAND, + DRAWING_POLY_POLYGON_PATH, + DRAWING_POLY_LINE_PATH, + DRAWING_GRAPHIC_OBJECT, + DRAWING_GROUP, + DRAWING_TEXT, + DRAWING_OLE, + DRAWING_PAGE, + DRAWING_CAPTION, + DRAWING_FRAME, + DRAWING_PLUGIN, + DRAWING_APPLET, + DRAWING_3D_SCENE, + DRAWING_3D_CUBE, + DRAWING_3D_SPHERE, + DRAWING_3D_LATHE, + DRAWING_3D_EXTRUDE, + DRAWING_CUSTOM, + DRAWING_TABLE, /* = 30 */ + DRAWING_MEDIA, /* = 31 */ + DRAWING_END = DRAWING_MEDIA +}; + +} // end of namespace accessibility + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/TextCharacterSpacingPopup.hxx b/include/svx/TextCharacterSpacingPopup.hxx new file mode 100644 index 000000000..0c7b5b04f --- /dev/null +++ b/include/svx/TextCharacterSpacingPopup.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_SVX_TEXTCHARACTERSPACINGPOPUP_HXX +#define INCLUDED_SVX_TEXTCHARACTERSPACINGPOPUP_HXX + +#include +#include + +namespace svx { + +class TextCharacterSpacingPopup final : public svt::PopupWindowController +{ +public: + TextCharacterSpacingPopup(const css::uno::Reference& rContext); + virtual ~TextCharacterSpacingPopup() override; + + virtual std::unique_ptr weldPopupWindow() override; + virtual VclPtr createVclPopupWindow( vcl::Window* pParent ) override; + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() override; + virtual css::uno::Sequence SAL_CALL getSupportedServiceNames() override; + + // XInitialization + virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& rArguments ) override; +}; + +} // end of namespace svx + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/TextUnderlinePopup.hxx b/include/svx/TextUnderlinePopup.hxx new file mode 100644 index 000000000..1d4074f8b --- /dev/null +++ b/include/svx/TextUnderlinePopup.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_SVX_SIDEBAR_TEXT_TEXTUNDERLINEPOPUP_HXX +#define INCLUDED_SVX_SIDEBAR_TEXT_TEXTUNDERLINEPOPUP_HXX + +#include +#include + +namespace svx { + +class TextUnderlinePopup final : public svt::PopupWindowController +{ +public: + TextUnderlinePopup(const css::uno::Reference& rContext); + virtual ~TextUnderlinePopup() override; + + virtual std::unique_ptr weldPopupWindow() override; + virtual VclPtr createVclPopupWindow( vcl::Window* pParent ) override; + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() override; + virtual css::uno::Sequence SAL_CALL getSupportedServiceNames() override; + + // XInitialization + virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& rArguments ) override; +}; + +} // end of namespace svx + +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/UnoNamespaceMap.hxx b/include/svx/UnoNamespaceMap.hxx new file mode 100644 index 000000000..47fa2d474 --- /dev/null +++ b/include/svx/UnoNamespaceMap.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_SVX_UNONAMESPACEMAP_HXX +#define INCLUDED_SVX_UNONAMESPACEMAP_HXX + +#include +#include + +class SfxItemPool; + +namespace svx { + +SVX_DLLPUBLIC css::uno::Reference< css::uno::XInterface > NamespaceMap_createInstance( sal_uInt16* pWhichIds, SfxItemPool* pPool ); + +} + +#endif // INCLUDED_SVX_UNONAMESPACEMAP_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/XPropertyEntry.hxx b/include/svx/XPropertyEntry.hxx new file mode 100644 index 000000000..22514d2b8 --- /dev/null +++ b/include/svx/XPropertyEntry.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_SVX_XPROPERTYENTRY_HXX +#define INCLUDED_SVX_XPROPERTYENTRY_HXX + +#include +#include +#include + + + +class SVXCORE_DLLPUBLIC XPropertyEntry +{ +private: + OUString maPropEntryName; + BitmapEx maUiBitmap; + +protected: + XPropertyEntry(const OUString& rPropEntryName); + + XPropertyEntry(XPropertyEntry const &) = default; + XPropertyEntry(XPropertyEntry &&) = default; + +public: + virtual ~XPropertyEntry(); + + XPropertyEntry & operator =(XPropertyEntry const &) = default; + XPropertyEntry & operator =(XPropertyEntry &&) = default; + + void SetName(const OUString& rPropEntryName) { maPropEntryName = rPropEntryName; } + const OUString& GetName() const { return maPropEntryName; } + void SetUiBitmap(const BitmapEx& rUiBitmap) { maUiBitmap = rUiBitmap; } + const BitmapEx& GetUiBitmap() const { return maUiBitmap; } +}; + +#endif // INCLUDED_SVX_XPROPERTYENTRY_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/algitem.hxx b/include/svx/algitem.hxx new file mode 100644 index 000000000..cb37a21ba --- /dev/null +++ b/include/svx/algitem.hxx @@ -0,0 +1,97 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_ALGITEM_HXX +#define INCLUDED_SVX_ALGITEM_HXX + +#include +#include +#include +#include +#include +#include + +class IntlWrapper; +class SfxItemPool; + +class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxOrientationItem final : public SfxEnumItem +{ +public: + SvxOrientationItem( + const SvxCellOrientation eOrientation, + const sal_uInt16 nId ); + + SvxOrientationItem( + sal_Int32 nRotation, bool bStacked, + const sal_uInt16 nId ); + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + virtual sal_uInt16 GetValueCount() const override; + static OUString GetValueText( SvxCellOrientation nVal ); + virtual SvxOrientationItem* Clone( SfxItemPool *pPool = nullptr ) const override; + + /** Returns sal_True, if the item represents STACKED state. */ + bool IsStacked() const; + /** Returns the rotation this item represents (returns nStdAngle for STANDARD and STACKED state). */ + sal_Int32 GetRotation( sal_Int32 nStdAngle ) const; +}; + +class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxMarginItem final : public SfxPoolItem +{ + sal_Int16 nLeftMargin; + sal_Int16 nTopMargin; + sal_Int16 nRightMargin; + sal_Int16 nBottomMargin; +public: + static SfxPoolItem* CreateDefault(); + SvxMarginItem( const sal_uInt16 nId ); + SvxMarginItem( sal_Int16 nLeft, sal_Int16 nTop /*= 0*/, + sal_Int16 nRight /*= 0*/, sal_Int16 nBottom /*= 0*/, + const sal_uInt16 nId ); + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + + virtual bool operator==( const SfxPoolItem& ) const override; + virtual SvxMarginItem* Clone( SfxItemPool *pPool = nullptr ) const override; + + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + sal_Int16 GetLeftMargin() const {return nLeftMargin; } + void SetLeftMargin(sal_Int16 nLeft); + sal_Int16 GetTopMargin() const {return nTopMargin; } + void SetTopMargin(sal_Int16 nTop); + sal_Int16 GetRightMargin() const {return nRightMargin; } + void SetRightMargin(sal_Int16 nRight); + sal_Int16 GetBottomMargin() const {return nBottomMargin; } + void SetBottomMargin(sal_Int16 nBottom); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/anchorid.hxx b/include/svx/anchorid.hxx new file mode 100644 index 000000000..da7387010 --- /dev/null +++ b/include/svx/anchorid.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_SVX_ANCHORID_HXX +#define INCLUDED_SVX_ANCHORID_HXX + +#include + +enum class SvxAnchorIds +{ + NONE = 0x0000, + Paragraph = 0x0001, // Frame bound to paragraph + Character = 0x0002, // Frame bound to character + Page = 0x0004, // Frame bound to page + Fly = 0x0008, // Frame bound to other frame + /** put this into the nAnchorTypes parameter of the SvxTransformTabDialog c'tor + to disable the size controls */ + NoResize = 0x0100, + /** put this into the nAnchorTypes parameter of the SvxTransformTabDialog c'tor + to disable the protect controls */ + NoProtect = 0x0200 +}; +namespace o3tl +{ + template<> struct typed_flags : is_typed_flags {}; +} + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/autoformathelper.hxx b/include/svx/autoformathelper.hxx new file mode 100644 index 000000000..2d292b1de --- /dev/null +++ b/include/svx/autoformathelper.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_SVX_AUTOFORMATHELPER_HXX +#define INCLUDED_SVX_AUTOFORMATHELPER_HXX + +#include +#include + +class SvStream; +class SvxFontItem; +class SvxFontHeightItem; +class SvxWeightItem; +class SvxPostureItem; +class SvxUnderlineItem; +class SvxOverlineItem; +class SvxCrossedOutItem; +class SvxContourItem; +class SvxShadowedItem; +class SvxColorItem; +class SvxBoxItem; +class SvxLineItem; +class SvxBrushItem; +class SvxAdjustItem; +class SvxHorJustifyItem; +class SvxVerJustifyItem; +class SfxBoolItem; +class SvxMarginItem; +class SfxInt32Item; +class SvxRotateModeItem; + +////////////////////////////////////////////////////////////////////////////// +/// Struct with version numbers of the Items + +struct SVX_DLLPUBLIC AutoFormatVersions +{ +public: + // BlockA + sal_uInt16 nFontVersion; + sal_uInt16 nFontHeightVersion; + sal_uInt16 nWeightVersion; + sal_uInt16 nPostureVersion; + sal_uInt16 nUnderlineVersion; + sal_uInt16 nOverlineVersion; + sal_uInt16 nCrossedOutVersion; + sal_uInt16 nContourVersion; + sal_uInt16 nShadowedVersion; + sal_uInt16 nColorVersion; + sal_uInt16 nBoxVersion; + sal_uInt16 nLineVersion; + sal_uInt16 nBrushVersion; + sal_uInt16 nAdjustVersion; + + // BlockB + sal_uInt16 nHorJustifyVersion; + sal_uInt16 nVerJustifyVersion; + sal_uInt16 nOrientationVersion; + sal_uInt16 nMarginVersion; + sal_uInt16 nBoolVersion; + sal_uInt16 nInt32Version; + sal_uInt16 nRotateModeVersion; + sal_uInt16 nNumFormatVersion; + + AutoFormatVersions(); + + void LoadBlockA( SvStream& rStream, sal_uInt16 nVer ); + void LoadBlockB( SvStream& rStream, sal_uInt16 nVer ); + + static void WriteBlockA(SvStream& rStream, sal_uInt16 fileVersion); + static void WriteBlockB(SvStream& rStream, sal_uInt16 fileVersion); +}; + +////////////////////////////////////////////////////////////////////////////// + +class SVX_DLLPUBLIC AutoFormatBase +{ +protected: + // common attributes of Calc and Writer + // --- from 641 on: CJK and CTL font settings + std::unique_ptr m_aFont; + std::unique_ptr m_aHeight; + std::unique_ptr m_aWeight; + std::unique_ptr m_aPosture; + + std::unique_ptr m_aCJKFont; + std::unique_ptr m_aCJKHeight; + std::unique_ptr m_aCJKWeight; + std::unique_ptr m_aCJKPosture; + + std::unique_ptr m_aCTLFont; + std::unique_ptr m_aCTLHeight; + std::unique_ptr m_aCTLWeight; + std::unique_ptr m_aCTLPosture; + + std::unique_ptr m_aUnderline; + std::unique_ptr m_aOverline; + std::unique_ptr m_aCrossedOut; + std::unique_ptr m_aContour; + std::unique_ptr m_aShadowed; + std::unique_ptr m_aColor; + std::unique_ptr m_aBox; + std::unique_ptr m_aTLBR; + std::unique_ptr m_aBLTR; + std::unique_ptr m_aBackground; + + // Writer specific + std::unique_ptr m_aAdjust; + + // Calc specific + std::unique_ptr m_aHorJustify; + std::unique_ptr m_aVerJustify; + std::unique_ptr m_aStacked; + std::unique_ptr m_aMargin; + std::unique_ptr m_aLinebreak; + + // from SO5, 504k on, rotated text + std::unique_ptr m_aRotateAngle; + std::unique_ptr m_aRotateMode; + + // assignment-op is protected due to this being a tooling + // class, so callers need to be aware of what they do + AutoFormatBase& operator=(const AutoFormatBase&); + + AutoFormatBase(); + AutoFormatBase( const AutoFormatBase& rNew ); + ~AutoFormatBase(); + + /// Comparing based of boxes backgrounds. + bool operator==(const AutoFormatBase& rRight) const; + +public: + // The get-methods. + const SvxFontItem &GetFont() const { return *m_aFont; } + const SvxFontHeightItem &GetHeight() const { return *m_aHeight; } + const SvxWeightItem &GetWeight() const { return *m_aWeight; } + const SvxPostureItem &GetPosture() const { return *m_aPosture; } + const SvxFontItem &GetCJKFont() const { return *m_aCJKFont; } + const SvxFontHeightItem &GetCJKHeight() const { return *m_aCJKHeight; } + const SvxWeightItem &GetCJKWeight() const { return *m_aCJKWeight; } + const SvxPostureItem &GetCJKPosture() const { return *m_aCJKPosture; } + const SvxFontItem &GetCTLFont() const { return *m_aCTLFont; } + const SvxFontHeightItem &GetCTLHeight() const { return *m_aCTLHeight; } + const SvxWeightItem &GetCTLWeight() const { return *m_aCTLWeight; } + const SvxPostureItem &GetCTLPosture() const { return *m_aCTLPosture; } + const SvxUnderlineItem &GetUnderline() const { return *m_aUnderline; } + const SvxOverlineItem &GetOverline() const { return *m_aOverline; } + const SvxCrossedOutItem &GetCrossedOut() const { return *m_aCrossedOut; } + const SvxContourItem &GetContour() const { return *m_aContour; } + const SvxShadowedItem &GetShadowed() const { return *m_aShadowed; } + const SvxColorItem &GetColor() const { return *m_aColor; } + const SvxBoxItem &GetBox() const { return *m_aBox; } + const SvxLineItem& GetTLBR() const { return *m_aTLBR; } + const SvxLineItem& GetBLTR() const { return *m_aBLTR; } + const SvxBrushItem &GetBackground() const { return *m_aBackground; } + const SvxAdjustItem &GetAdjust() const { return *m_aAdjust; } + const SvxHorJustifyItem& GetHorJustify() const { return *m_aHorJustify; } + const SvxVerJustifyItem& GetVerJustify() const { return *m_aVerJustify; } + const SfxBoolItem& GetStacked() const { return *m_aStacked; } + const SvxMarginItem& GetMargin() const { return *m_aMargin; } + const SfxBoolItem& GetLinebreak() const { return *m_aLinebreak; } + const SfxInt32Item& GetRotateAngle() const { return *m_aRotateAngle; } + const SvxRotateModeItem& GetRotateMode() const { return *m_aRotateMode; } + + // The set-methods. + void SetFont( const SvxFontItem& rNew ); + void SetHeight( const SvxFontHeightItem& rNew ); + void SetWeight( const SvxWeightItem& rNew ); + void SetPosture( const SvxPostureItem& rNew ); + void SetCJKFont( const SvxFontItem& rNew ); + void SetCJKHeight( const SvxFontHeightItem& rNew ); + void SetCJKWeight( const SvxWeightItem& rNew ); + void SetCJKPosture( const SvxPostureItem& rNew ); + void SetCTLFont( const SvxFontItem& rNew ); + void SetCTLHeight( const SvxFontHeightItem& rNew ); + void SetCTLWeight( const SvxWeightItem& rNew ); + void SetCTLPosture( const SvxPostureItem& rNew ); + void SetUnderline( const SvxUnderlineItem& rNew ); + void SetOverline( const SvxOverlineItem& rNew ); + void SetCrossedOut( const SvxCrossedOutItem& rNew ); + void SetContour( const SvxContourItem& rNew ); + void SetShadowed( const SvxShadowedItem& rNew ); + void SetColor( const SvxColorItem& rNew ); + void SetBox( const SvxBoxItem& rNew ); + void SetTLBR( const SvxLineItem& rNew ); + void SetBLTR( const SvxLineItem& rNew ); + void SetBackground( const SvxBrushItem& rNew ); + void SetAdjust( const SvxAdjustItem& rNew ); + void SetHorJustify( const SvxHorJustifyItem& rNew ); + void SetVerJustify( const SvxVerJustifyItem& rNew ); + void SetStacked( const SfxBoolItem& rNew ); + void SetMargin( const SvxMarginItem& rNew ); + void SetLinebreak( const SfxBoolItem& rNew ); + void SetRotateAngle( const SfxInt32Item& rNew ); + void SetRotateMode( const SvxRotateModeItem& rNew ); + + bool LoadBlockA( SvStream& rStream, const AutoFormatVersions& rVersions, sal_uInt16 nVer ); + bool LoadBlockB( SvStream& rStream, const AutoFormatVersions& rVersions, sal_uInt16 nVer ); + + bool SaveBlockA( SvStream& rStream, sal_uInt16 fileVersion ) const; + bool SaveBlockB( SvStream& rStream, sal_uInt16 fileVersion ) const; +}; + +#endif // INCLUDED_SVX_AUTOFORMATHELPER_HXX + +////////////////////////////////////////////////////////////////////////////// +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/bmpmask.hxx b/include/svx/bmpmask.hxx new file mode 100644 index 000000000..dde83d149 --- /dev/null +++ b/include/svx/bmpmask.hxx @@ -0,0 +1,177 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_BMPMASK_HXX +#define INCLUDED_SVX_BMPMASK_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace vcl { class Window; } +namespace weld { class CustomWeld; } + +class SfxBindings; +class SfxModule; + +/************************************************************************* +|* +|* class SvxBmpMaskSelectItem +|* +\************************************************************************/ +class SvxBmpMask; + +class SvxBmpMaskSelectItem final : public SfxControllerItem +{ + SvxBmpMask &rBmpMask; + + virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, + const SfxPoolItem* pState ) override; + +public: + SvxBmpMaskSelectItem( SvxBmpMask& rMask, + SfxBindings& rBindings ); +}; + +/************************************************************************* +|* +|* Derivative from SfxChildWindow as 'container' for Float +|* +\************************************************************************/ + +class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxBmpMaskChildWindow final : public SfxChildWindow +{ + public: + SvxBmpMaskChildWindow( vcl::Window*, + sal_uInt16, SfxBindings*, + SfxChildWinInfo* ); + + SFX_DECL_CHILDWINDOW_WITHID(SvxBmpMaskChildWindow); +}; + +/************************************************************************* +|* +|* class SvxBmpMask +|* +\************************************************************************/ + +class MaskData; +class MaskSet; +class BmpColorWindow; +class ColorListBox; + +class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxBmpMask : public SfxDockingWindow +{ + friend class MaskData; + friend class MaskSet; + + std::unique_ptr m_xTbxPipette; + std::unique_ptr m_xCtlPipette; + std::unique_ptr m_xCtlPipetteWin; + std::unique_ptr m_xBtnExec; + + std::unique_ptr m_xCbx1; + std::unique_ptr m_xQSet1; + std::unique_ptr m_xQSetWin1; + std::unique_ptr m_xSp1; + std::unique_ptr m_xLbColor1; + + std::unique_ptr m_xCbx2; + std::unique_ptr m_xQSet2; + std::unique_ptr m_xQSetWin2; + std::unique_ptr m_xSp2; + std::unique_ptr m_xLbColor2; + + std::unique_ptr m_xCbx3; + std::unique_ptr m_xQSet3; + std::unique_ptr m_xQSetWin3; + std::unique_ptr m_xSp3; + std::unique_ptr m_xLbColor3; + + std::unique_ptr m_xCbx4; + std::unique_ptr m_xQSet4; + std::unique_ptr m_xQSetWin4; + std::unique_ptr m_xSp4; + std::unique_ptr m_xLbColor4; + + std::unique_ptr m_xCbxTrans; + std::unique_ptr m_xLbColorTrans; + + std::unique_ptr m_xData; + + Color aPipetteColor; + SvxBmpMaskSelectItem aSelItem; + + virtual bool Close() override; + + sal_uInt16 InitColorArrays( Color* pSrcCols, Color* pDstCols, + sal_uInt8* pTols ); + + void ImpMask( BitmapEx& rBitmap ); + GDIMetaFile ImpMask( const GDIMetaFile& rMtf ); + Animation ImpMask( const Animation& rAnimation ); + BitmapEx ImpMaskTransparent( const BitmapEx& rBitmapEx, + const Color& rColor, + const sal_uInt8 nTol ); + + GDIMetaFile GetMetaFile(const Graphic& rGraphic); + + static Animation ImpReplaceTransparency( const Animation& rAnim, + const Color& rColor ); + static GDIMetaFile ImpReplaceTransparency( const GDIMetaFile& rMtf, + const Color& rColor ); + +public: + + SvxBmpMask(SfxBindings *pBindinx, SfxChildWindow *pCW, vcl::Window* pParent); + virtual ~SvxBmpMask() override; + virtual void dispose() override; + + void SetColor( const Color& rColor ); + void PipetteClicked(); + + void SetExecState( bool bEnable ); + + Graphic Mask( const Graphic& rGraphic ); + + bool IsEyedropping() const; + + void onSelect( MaskSet* pSet ); + +private: + + /** Set names for accessible objects. This is necessary for objects + like the source color checkboxes which initially have no name and + for which the description would be read by AT. + */ + SVX_DLLPRIVATE void SetAccessibleNames(); +}; + +#endif // INCLUDED_SVX_BMPMASK_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/camera3d.hxx b/include/svx/camera3d.hxx new file mode 100644 index 000000000..4cd21601b --- /dev/null +++ b/include/svx/camera3d.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_SVX_CAMERA3D_HXX +#define INCLUDED_SVX_CAMERA3D_HXX + +#include +#include +#include +#include + +/************************************************************************* +|* +|* Camera derivative +|* +\************************************************************************/ + +class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC Camera3D final : public Viewport3D +{ + basegfx::B3DPoint aPosition; + basegfx::B3DPoint aLookAt; + double fFocalLength; + double fBankAngle; + + bool bAutoAdjustProjection; + +public: + Camera3D(const basegfx::B3DPoint& rPos, const basegfx::B3DPoint& rLookAt, + double fFocalLen = 35.0); + Camera3D(); + + void SetViewWindow(double fX, double fY, double fW, double fH); + + void SetPosition(const basegfx::B3DPoint& rNewPos); + const basegfx::B3DPoint& GetPosition() const { return aPosition; } + void SetLookAt(const basegfx::B3DPoint& rNewLookAt); + void SetPosAndLookAt(const basegfx::B3DPoint& rNewPos, const basegfx::B3DPoint& rNewLookAt); + + // Focal length in mm + void SetFocalLength(double fLen); + double GetFocalLength() const { return fFocalLength; } + + // Bank angle left/right + void SetBankAngle(double fAngle); + + void SetAutoAdjustProjection(bool bAdjust) + { bAutoAdjustProjection = bAdjust; } +}; + +#endif // INCLUDED_SVX_CAMERA3D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/charmap.hxx b/include/svx/charmap.hxx new file mode 100644 index 000000000..4b47a785b --- /dev/null +++ b/include/svx/charmap.hxx @@ -0,0 +1,163 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_CHARMAP_HXX +#define INCLUDED_SVX_CHARMAP_HXX + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace com::sun::star { + namespace accessibility { class XAccessible; } +} + +namespace com::sun::star::uno { class XComponentContext; } + +using namespace ::com::sun::star; + +#define COLUMN_COUNT 16 +#define ROW_COUNT 8 + +namespace svx +{ + struct SvxShowCharSetItem; + class SvxShowCharSetAcc; +} + +class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxShowCharSet : public weld::CustomWidgetController +{ +protected: + VclPtr mxVirDev; + vcl::Font maFont; + std::unique_ptr mxScrollArea; +public: + SvxShowCharSet(std::unique_ptr pScrollArea, const VclPtr& rVirDev); + virtual ~SvxShowCharSet() override; + + virtual void RecalculateFont(vcl::RenderContext& rRenderContext); + + void SelectCharacter( sal_UCS4 cNew ); + virtual sal_UCS4 GetSelectCharacter() const; + void createContextMenu(); + + void SetDoubleClickHdl( const Link& rLink ) { aDoubleClkHdl = rLink; } + void SetSelectHdl( const Link& rHdl ) { aSelectHdl = rHdl; } + void SetHighlightHdl( const Link& rHdl ) { aHighHdl = rHdl; } + void SetPreSelectHdl( const Link& rHdl ) { aPreSelectHdl = rHdl; } + void SetFavClickHdl( const Link& rHdl ) { aFavClickHdl = rHdl; } + static sal_uInt32& getSelectedChar(); + void SetFont( const vcl::Font& rFont ); + vcl::Font const & GetFont() const { return maFont; } + FontCharMapRef const & GetFontCharMap(); + bool isFavChar(const OUString& sTitle, const OUString& rFont); + void getFavCharacterList(); //gets both Fav char and Fav char font list + void updateFavCharacterList(const OUString& rChar, const OUString& rFont); + + virtual svx::SvxShowCharSetItem* ImplGetItem( int _nPos ); + int FirstInView() const; + virtual int LastInView() const; + int PixelToMapIndex( const Point&) const; + virtual void SelectIndex( int index, bool bFocus = false ); + void OutputIndex( int index ); + void DeSelect(); + static void CopyToClipboard(const OUString& str); + bool IsSelected(sal_uInt16 _nPos) const { return _nPos == nSelectedIndex; } + sal_uInt16 GetSelectIndexId() const { return sal::static_int_cast(nSelectedIndex); } + static sal_uInt16 GetRowPos(sal_uInt16 _nPos); + static sal_uInt16 GetColumnPos(sal_uInt16 _nPos); + + virtual sal_Int32 getMaxCharCount() const; + + virtual void Show() override { mxScrollArea->show(); } + virtual void Hide() override { mxScrollArea->hide(); } + + uno::Reference getAccessibleParent() const { return GetDrawingArea()->get_accessible_parent(); } + +private: + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; + virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override; + virtual void Resize() override; + virtual bool MouseButtonDown(const MouseEvent& rMEvt) override; + virtual bool MouseMove(const MouseEvent& rMEvt) override; + virtual bool MouseButtonUp(const MouseEvent& rMEvt) override; + virtual void GetFocus() override; + virtual void LoseFocus() override; + virtual bool KeyInput(const KeyEvent&) override; + + virtual css::uno::Reference CreateAccessible() override; + virtual FactoryFunction GetUITestFactory() const override; + +protected: + typedef std::map > ItemsMap; + ItemsMap m_aItems; + Link aDoubleClkHdl; + Link aSelectHdl; + Link aFavClickHdl; + Link aHighHdl; + Link aPreSelectHdl; + + std::deque maFavCharList; + std::deque maFavCharFontList; + + rtl::Reference m_xAccessible; + uno::Reference< uno::XComponentContext > mxContext; + long nX; + long nY; + long m_nXGap; + long m_nYGap; + bool bDrag; + + sal_Int32 nSelectedIndex; + + FontCharMapRef mxFontCharMap; + Size maFontSize; + Point maPosition; + + bool mbRecalculateFont : 1; + bool mbUpdateForeground : 1; + bool mbUpdateBackground : 1; + + +protected: + virtual void DrawChars_Impl(vcl::RenderContext& rRenderContext, int n1, int n2); + void InitSettings(vcl::RenderContext& rRenderContext); + // abstraction layers are: Unicode<->MapIndex<->Pixel + Point MapIndexToPixel( int) const; + DECL_LINK(VscrollHdl, weld::ScrolledWindow&, void); + void ContextMenuSelect(const OString& rIdent); + + void init(); + tools::Rectangle getGridRectangle(const Point &rPointUL, const Size &rOutputSize); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/charthelper.hxx b/include/svx/charthelper.hxx new file mode 100644 index 000000000..e587dbc3d --- /dev/null +++ b/include/svx/charthelper.hxx @@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_CHARTHELPER_HXX +#define INCLUDED_SVX_CHARTHELPER_HXX + +#include +#include +#include + +namespace com::sun::star { + namespace embed { class XEmbeddedObject; } + namespace frame { class XModel; } + namespace uno { template class Reference; } +} + +namespace basegfx { class B2DRange; } + +class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC ChartHelper +{ +public: + /// Use chart's XUpdatable::update() to update values. + static void updateChart( const css::uno::Reference< css::frame::XModel >& rXModel ); + + // try to access rXModel in case of a chart to get the chart content + // as sequence of primitives. Return range of primitives (chart size) in rRange; + // it will be used to embed the chart to the SdrObject transformation. This + // allows to define possible distances between chart and SDrObject bounds here + static drawinglayer::primitive2d::Primitive2DContainer tryToGetChartContentAsPrimitive2DSequence( + const css::uno::Reference< css::frame::XModel >& rXModel, + basegfx::B2DRange& rRange); + + // #i121334# Allow to switch off line and fill style by setting these as attributes + // at the OLE chart object. This is needed to allow fill styles of the covering objects + // to make their own fill/line settings work. This should not be done by changing + // the defaults at the chart (see StaticPageBackgroundDefaults_Initializer::lcl_AddDefaultsToMap) + // since this would not be saved/loaded, thus the compatibility will be better when setting it at + // newly created charts using this method + static void AdaptDefaultsForChart( + const css::uno::Reference < css::embed::XEmbeddedObject > & xEmbObj); +}; + +#endif // INCLUDED_SVX_CHARTHELPER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/chrtitem.hxx b/include/svx/chrtitem.hxx new file mode 100644 index 000000000..cb18efa0a --- /dev/null +++ b/include/svx/chrtitem.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_SVX_CHRTITEM_HXX +#define INCLUDED_SVX_CHRTITEM_HXX + +#include +#include +#include +#include +#include + +class IntlWrapper; +class SfxItemPool; + +enum class SvxChartTextOrder +{ + SideBySide, + UpDown, + DownUp, + Auto +}; + +#define CHTXTORDER_COUNT (sal_uInt16(SvxChartTextOrder::Auto) + 1) + +enum class SvxChartKindError +{ + NONE, + Variant, + Sigma, + Percent, + BigError, + Const, + StdError, + Range +}; + +#define CHERROR_COUNT (sal_uInt16(SvxChartKindError::Range) + 1) + +enum class SvxChartIndicate +{ + NONE, + Both, + Up, + Down +}; + +#define CHINDICATE_COUNT (sal_uInt16(SvxChartIndicate::Down) + 1) + +enum class SvxChartRegress +{ + NONE, + Linear, + Log, + Exp, + Power, + Polynomial, + MovingAverage, + MeanValue, + Unknown +}; + +#define CHREGRESS_COUNT (sal_uInt16(SvxChartRegress::Unknown) + 1) + +class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC SvxChartRegressItem final : public SfxEnumItem +{ +public: + SvxChartRegressItem(SvxChartRegress eRegress /*= SvxChartRegress::Linear*/, + sal_uInt16 nId ); + + virtual SvxChartRegressItem* Clone(SfxItemPool* pPool = nullptr) const override; + + sal_uInt16 GetValueCount() const override { return CHREGRESS_COUNT; } +}; + +class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC SvxChartTextOrderItem final : public SfxEnumItem +{ +public: + SvxChartTextOrderItem(SvxChartTextOrder eOrder /*= SvxChartTextOrder::SideBySide*/, + sal_uInt16 nId ); + + virtual SvxChartTextOrderItem* Clone(SfxItemPool* pPool = nullptr) const override; + + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + sal_uInt16 GetValueCount() const override { return CHTXTORDER_COUNT; } +}; + +class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC SvxChartKindErrorItem final : public SfxEnumItem +{ +public: + SvxChartKindErrorItem(SvxChartKindError /*eOrient = SvxChartKindError::NONE*/, + sal_uInt16 nId ); + + virtual SvxChartKindErrorItem* Clone(SfxItemPool* pPool = nullptr) const override; + + sal_uInt16 GetValueCount() const override { return CHERROR_COUNT; } +}; + +class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC SvxChartIndicateItem final : public SfxEnumItem +{ +public: + SvxChartIndicateItem(SvxChartIndicate eOrient /*= SvxChartIndicate::NONE*/, + sal_uInt16 nId ); + + virtual SvxChartIndicateItem* Clone(SfxItemPool* pPool = nullptr) const override; + + sal_uInt16 GetValueCount() const override { return CHINDICATE_COUNT; } +}; + +class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC SvxDoubleItem final : public SfxPoolItem +{ + double fVal; + +public: + static SfxPoolItem* CreateDefault(); + SvxDoubleItem(double fValue /*= 0.0*/, sal_uInt16 nId ); + SvxDoubleItem(const SvxDoubleItem& rItem); + + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + virtual bool GetPresentation(SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper&) const override; + + virtual bool operator == (const SfxPoolItem&) const override; + virtual SvxDoubleItem* Clone(SfxItemPool *pPool = nullptr) const override; + + double GetValue() const { return fVal; } +}; + +#endif // INCLUDED_SVX_CHRTITEM_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/clipboardctl.hxx b/include/svx/clipboardctl.hxx new file mode 100644 index 000000000..ec805c958 --- /dev/null +++ b/include/svx/clipboardctl.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_SVX_CLIPBOARDCTL_HXX +#define INCLUDED_SVX_CLIPBOARDCTL_HXX + +#include +#include +#include +#include +#include +#include + +class PopupMenu; +class SfxModule; +class ToolBox; + +class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxClipBoardControl final : public SfxToolBoxControl +{ + std::unique_ptr + pClipboardFmtItem; + VclPtr pPopup; + bool bDisabled; + + void DelPopup(); + +public: + SFX_DECL_TOOLBOX_CONTROL(); + + SvxClipBoardControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ); + virtual ~SvxClipBoardControl() override; + + void CreatePopupWindow() override; + virtual void StateChanged( sal_uInt16 nSID, + SfxItemState eState, + const SfxPoolItem* pState ) override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/clipfmtitem.hxx b/include/svx/clipfmtitem.hxx new file mode 100644 index 000000000..180c4eecc --- /dev/null +++ b/include/svx/clipfmtitem.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_SVX_CLIPFMTITEM_HXX +#define INCLUDED_SVX_CLIPFMTITEM_HXX + +#include +#include + +#include +#include +#include +#include +#include + +class SfxItemPool; +struct SvxClipboardFormatItem_Impl; + +class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC SvxClipboardFormatItem final : public SfxPoolItem +{ + virtual bool operator==( const SfxPoolItem& ) const override; + virtual SvxClipboardFormatItem* Clone( SfxItemPool *pPool = nullptr ) const override; + +public: + static SfxPoolItem* CreateDefault(); + SvxClipboardFormatItem( sal_uInt16 nId ); + SvxClipboardFormatItem( const SvxClipboardFormatItem& ); + virtual ~SvxClipboardFormatItem() override; + + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + void AddClipbrdFormat( SotClipboardFormatId nId ); + void AddClipbrdFormat( SotClipboardFormatId nId, const OUString& rName, + sal_uInt16 nPos = USHRT_MAX ); + sal_uInt16 Count() const; + + SotClipboardFormatId GetClipbrdFormatId( sal_uInt16 nPos ) const; + OUString const & GetClipbrdFormatName( sal_uInt16 nPos ) const; + +private: + std::unique_ptr pImpl; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/colorbox.hxx b/include/svx/colorbox.hxx new file mode 100644 index 000000000..51fbc00d4 --- /dev/null +++ b/include/svx/colorbox.hxx @@ -0,0 +1,94 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_SVX_COLORBOX_HXX +#define INCLUDED_SVX_COLORBOX_HXX + +#include +#include +#include + +class ColorListBox; + +class ListBoxColorWrapper +{ +public: + ListBoxColorWrapper(ColorListBox* pControl); + void operator()(const OUString& rCommand, const NamedColor& rColor); +private: + ColorListBox* mpControl; +}; + +class SVXCORE_DLLPUBLIC ColorListBox +{ +private: + friend class ListBoxColorWrapper; + std::unique_ptr m_xColorWindow; + std::unique_ptr m_xButton; + weld::Window* m_pTopLevel; + Link m_aSelectedLink; + ListBoxColorWrapper m_aColorWrapper; + Color m_aAutoDisplayColor; + Color m_aSaveColor; + NamedColor m_aSelectedColor; + sal_uInt16 m_nSlotId; + bool m_bShowNoneButton; + std::shared_ptr m_xPaletteManager; + ColorStatus m_aColorStatus; + + void Selected(const NamedColor& rNamedColor); + void createColorWindow(); + void LockWidthRequest(); + ColorWindow* getColorWindow() const; + + DECL_LINK(ToggleHdl, weld::ToggleButton&, void); + +public: + // pTopLevelWindow will be used as parent for any color picker dialog created + ColorListBox(std::unique_ptr pControl, weld::Window* pTopLevelWindow); + ~ColorListBox(); + + void SetSelectHdl(const Link& rLink) + { + m_aSelectedLink = rLink; + } + + void SetSlotId(sal_uInt16 nSlotId, bool bShowNoneButton = false); + + Color const & GetSelectEntryColor() const { return m_aSelectedColor.first; } + NamedColor const & GetSelectedEntry() const { return m_aSelectedColor; } + + void SelectEntry(const NamedColor& rColor); + void SelectEntry(const Color& rColor); + + void SetNoSelection() { getColorWindow()->SetNoSelection(); } + bool IsNoSelection() const { return getColorWindow()->IsNoSelection(); } + + void SetAutoDisplayColor(const Color &rColor) { m_aAutoDisplayColor = rColor; } + + void ShowPreview(const NamedColor &rColor); + void EnsurePaletteManager(); + + void SaveValue() { m_aSaveColor = GetSelectEntryColor(); } + bool IsValueChangedFromSaved() const { return m_aSaveColor != GetSelectEntryColor(); } + + void set_sensitive(bool sensitive) { m_xButton->set_sensitive(sensitive); } + bool get_sensitive() const { return m_xButton->get_sensitive(); } + void show() { m_xButton->show(); } + void hide() { m_xButton->hide(); } + void set_visible(bool bShow) { m_xButton->set_visible(bShow); } + void set_help_id(const OString& rHelpId) { m_xButton->set_help_id(rHelpId); } + void connect_focus_in(const Link& rLink) { m_xButton->connect_focus_in(rLink); } + void connect_focus_out(const Link& rLink) { m_xButton->connect_focus_out(rLink); } + weld::MenuButton& get_widget() { return *m_xButton; } +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/colorwindow.hxx b/include/svx/colorwindow.hxx new file mode 100644 index 000000000..ac141611d --- /dev/null +++ b/include/svx/colorwindow.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_SVX_SOURCE_TBXCTRLS_COLORWINDOW_HXX +#define INCLUDED_SVX_SOURCE_TBXCTRLS_COLORWINDOW_HXX + +#include +#include +#include +#include +#include + +#include + +namespace com::sun::star::frame { class XFrame; } + +class PaletteManager; + +class SVXCORE_DLLPUBLIC ColorStatus +{ + Color maColor; + Color maTLBRColor; + Color maBLTRColor; +public: + ColorStatus(); + ~ColorStatus(); + void statusChanged( const css::frame::FeatureStateEvent& rEvent ); + Color GetColor(); +}; + +class Button; +typedef std::function ColorSelectFunction; + +#define COL_NONE_COLOR ::Color(0x80, 0xFF, 0xFF, 0xFF) + +class SvxColorToolBoxControl; + +class SVXCORE_DLLPUBLIC MenuOrToolMenuButton +{ +private: + // either + weld::MenuButton* m_pMenuButton; + // or + weld::Toolbar* m_pToolbar; + OString m_aIdent; + // or + SvxColorToolBoxControl* m_pControl; + VclPtr m_xToolBox; + sal_uInt16 m_nId; +public: + MenuOrToolMenuButton(weld::MenuButton* pMenuButton); + MenuOrToolMenuButton(weld::Toolbar* pToolbar, const OString& rIdent); + MenuOrToolMenuButton(SvxColorToolBoxControl* pControl, ToolBox* pToolbar, sal_uInt16 nId); + ~MenuOrToolMenuButton(); + + MenuOrToolMenuButton(MenuOrToolMenuButton const &) = default; + MenuOrToolMenuButton(MenuOrToolMenuButton &&) = default; + MenuOrToolMenuButton & operator =(MenuOrToolMenuButton const &) = default; + MenuOrToolMenuButton & operator =(MenuOrToolMenuButton &&) = default; + + bool get_active() const; + void set_inactive() const; + weld::Widget* get_widget() const; +}; + +class SVXCORE_DLLPUBLIC ColorWindow final : public WeldToolbarPopup +{ +private: + const sal_uInt16 theSlotId; + OUString maCommand; + weld::Window* mpParentWindow; + MenuOrToolMenuButton maMenuButton; + std::shared_ptr mxPaletteManager; + ColorStatus& mrColorStatus; + ColorSelectFunction maColorSelectFunction; + + std::unique_ptr mxColorSet; + std::unique_ptr mxRecentColorSet; + std::unique_ptr mxPaletteListBox; + std::unique_ptr mxButtonAutoColor; + std::unique_ptr mxButtonNoneColor; + std::unique_ptr mxButtonPicker; + std::unique_ptr mxAutomaticSeparator; + std::unique_ptr mxColorSetWin; + std::unique_ptr mxRecentColorSetWin; + weld::Button* mpDefaultButton; + + Link maSelectedLink; + DECL_LINK(SelectHdl, ValueSet*, void); + DECL_LINK(SelectPaletteHdl, weld::ComboBox&, void); + DECL_LINK(AutoColorClickHdl, weld::Button&, void); + DECL_LINK(OpenPickerClickHdl, weld::Button&, void); + + static bool SelectValueSetEntry(SvxColorValueSet* pColorSet, const Color& rColor); + static NamedColor GetSelectEntryColor(ValueSet const * pColorSet); + NamedColor GetAutoColor() const; + +public: + ColorWindow(const OUString& rCommand, + std::shared_ptr const & rPaletteManager, + ColorStatus& rColorStatus, + sal_uInt16 nSlotId, + const css::uno::Reference< css::frame::XFrame >& rFrame, + weld::Window* pParentWindow, const MenuOrToolMenuButton &rMenuButton, + ColorSelectFunction const& rColorSelectFunction); + virtual ~ColorWindow() override; + void ShowNoneButton(); + void SetNoSelection(); + bool IsNoSelection() const; + void SelectEntry(const NamedColor& rColor); + void SelectEntry(const Color& rColor); + NamedColor GetSelectEntryColor() const; + + virtual void statusChanged( const css::frame::FeatureStateEvent& rEvent ) override; + + void SetSelectedHdl( const Link& rLink ) { maSelectedLink = rLink; } + + virtual void GrabFocus() override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/compressgraphicdialog.hxx b/include/svx/compressgraphicdialog.hxx new file mode 100644 index 000000000..a29225263 --- /dev/null +++ b/include/svx/compressgraphicdialog.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_SVX_COMPRESSGRAPHICDIALOG_HXX +#define INCLUDED_SVX_COMPRESSGRAPHICDIALOG_HXX + +#include +#include +#include +#include +#include +#include + +class SdrGrafObj; +class SfxBindings; +class SvStream; + +class SAL_WARN_UNUSED SVX_DLLPUBLIC CompressGraphicsDialog final : public weld::GenericDialogController +{ +private: + std::unique_ptr m_xLabelGraphicType; + std::unique_ptr m_xFixedText2; + std::unique_ptr m_xFixedText3; + std::unique_ptr m_xFixedText5; + std::unique_ptr m_xFixedText6; + + std::unique_ptr m_xReduceResolutionCB; + std::unique_ptr m_xMFNewWidth; + std::unique_ptr m_xMFNewHeight; + std::unique_ptr m_xResolutionLB; + std::unique_ptr m_xLosslessRB; + std::unique_ptr m_xJpegCompRB; + std::unique_ptr m_xCompressionMF; + std::unique_ptr m_xCompressionSlider; + std::unique_ptr m_xQualityMF; + std::unique_ptr m_xQualitySlider; + std::unique_ptr m_xBtnCalculate; + std::unique_ptr m_xInterpolationCombo; + + SdrGrafObj* m_xGraphicObj; + Graphic m_aGraphic; + Size m_aViewSize100mm; + tools::Rectangle m_aCropRectangle; + SfxBindings& m_rBindings; + + double m_dResolution; + + void Initialize(); + + DECL_LINK( SlideHdl, weld::Scale&, void ); + DECL_LINK( NewInterpolationModifiedHdl, weld::ComboBox&, void ); + DECL_LINK( NewQualityModifiedHdl, weld::Entry&, void ); + DECL_LINK( NewCompressionModifiedHdl, weld::Entry&, void ); + DECL_LINK( NewWidthModifiedHdl, weld::Entry&, void ); + DECL_LINK( NewHeightModifiedHdl, weld::Entry&, void ); + DECL_LINK( ResolutionModifiedHdl, weld::ComboBox&, void ); + DECL_LINK( ToggleCompressionRB, weld::ToggleButton&, void ); + DECL_LINK( ToggleReduceResolutionRB, weld::ToggleButton&, void ); + + DECL_LINK( CalculateClickHdl, weld::Button&, void ); + + void Update(); + void UpdateNewWidthMF(); + void UpdateNewHeightMF(); + void UpdateResolutionLB(); + + void Compress(SvStream& aStream); + + double GetViewWidthInch() const; + double GetViewHeightInch() const; + + BmpScaleFlag GetSelectedInterpolationType() const; + +public: + CompressGraphicsDialog( weld::Window* pParent, SdrGrafObj* pGraphicObj, SfxBindings& rBindings ); + CompressGraphicsDialog( weld::Window* pParent, Graphic const & rGraphic, Size rViewSize100mm, tools::Rectangle const & rCropRectangle, SfxBindings& rBindings ); + virtual ~CompressGraphicsDialog() override; + + SdrGrafObj* GetCompressedSdrGrafObj(); + Graphic GetCompressedGraphic(); + + tools::Rectangle GetScaledCropRectangle() const; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/connctrl.hxx b/include/svx/connctrl.hxx new file mode 100644 index 000000000..024fba8ed --- /dev/null +++ b/include/svx/connctrl.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_SVX_CONNCTRL_HXX +#define INCLUDED_SVX_CONNCTRL_HXX + +#include +#include +#include +#include +#include + +class SfxItemSet; +class SdrEdgeObj; +class SdrView; +class SdrPage; + +/************************************************************************* +|* +|* SvxXConnectionPreview +|* +\************************************************************************/ +class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxXConnectionPreview final : public weld::CustomWidgetController +{ + friend class SvxConnectionPage; + +private: + MapMode aNewMapMode; + SdrEdgeObj* pEdgeObj; + std::unique_ptr pSdrPage; + const SdrView* pView; + + SVX_DLLPRIVATE void AdaptSize(); + SVX_DLLPRIVATE void SetMapMode(const MapMode& rNewMapMode) { aNewMapMode = rNewMapMode; } + SVX_DLLPRIVATE const MapMode& GetMapMode() const { return aNewMapMode; } +public: + SvxXConnectionPreview(); + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; + virtual ~SvxXConnectionPreview() override; + + virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override; + virtual void Resize() override; + virtual bool MouseButtonDown(const MouseEvent& rMEvt) override; + + void SetAttributes( const SfxItemSet& rInAttrs ); + sal_uInt16 GetLineDeltaCount() const; + + void Construct(); + void SetView( const SdrView* pSdrView ) { pView = pSdrView; } +}; + +#endif // INCLUDED_SVX_CONNCTRL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/contdlg.hxx b/include/svx/contdlg.hxx new file mode 100644 index 000000000..4ad26c708 --- /dev/null +++ b/include/svx/contdlg.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_SVX_CONTDLG_HXX +#define INCLUDED_SVX_CONTDLG_HXX + +#include + +#include +#include +#include +#include +#include + +class SfxBindings; +class SfxModule; + +/************************************************************************* +|* +|* Derivation from SfxChildWindow as "container" for Float +|* +\************************************************************************/ + +class Graphic; + +class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxContourDlgChildWindow final : public SfxChildWindow +{ +public: + SvxContourDlgChildWindow( vcl::Window*, sal_uInt16, SfxBindings*, SfxChildWinInfo const * ); + + SFX_DECL_CHILDWINDOW_WITHID( SvxContourDlgChildWindow ); +}; + +class SvxSuperContourDlg; + +class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxContourDlg final : public SfxModelessDialogController +{ + std::unique_ptr m_xImpl; + +public: + + SvxContourDlg(SfxBindings *pBindings, SfxChildWindow *pCW, weld::Window* pParent); + virtual ~SvxContourDlg() override; + + const Graphic& GetGraphic() const; + bool IsGraphicChanged() const; + + tools::PolyPolygon GetPolyPolygon(); + + const void* GetEditingObject() const; + + void Update( const Graphic& rGraphic, bool bGraphicLinked, + const tools::PolyPolygon* pPolyPoly, void* pEditingObj ); + + static tools::PolyPolygon CreateAutoContour( const Graphic& rGraphic, + const tools::Rectangle* pRect = nullptr ); +}; + +#endif // INCLUDED_SVX_CONTDLG_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/ctredlin.hxx b/include/svx/ctredlin.hxx new file mode 100644 index 000000000..08538bf18 --- /dev/null +++ b/include/svx/ctredlin.hxx @@ -0,0 +1,337 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_CTREDLIN_HXX +#define INCLUDED_SVX_CTREDLIN_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace utl { + class SearchParam; + class TextSearch; +} + +namespace comphelper::string { class NaturalStringSorter; } + +class Point; +class SvViewDataEntry; +class SvtCalendarBox; + +enum class SvxRedlinDateMode +{ + BEFORE, SINCE, EQUAL, NOTEQUAL, BETWEEN, SAVE, NONE +}; + +enum class RedlineType : sal_uInt16 +{ + // Range of RedlineTypes is 0 to 127. + Insert = 0x0,// Content has been inserted. + Delete = 0x1,// Content has been deleted. + Format = 0x2,// Attributes have been applied. + Table = 0x3,// Table structure has been altered. + FmtColl = 0x4,// Style has been altered (Autoformat!). + ParagraphFormat = 0x5,// Paragraph attributes have been changed. + TableRowInsert = 0x6,// Table row has been inserted. + TableRowDelete = 0x7,// Table row has been deleted. + TableCellInsert = 0x8,// Table cell has been inserted. + TableCellDelete = 0x9,// Table cell has been deleted. + Any = USHRT_MAX // special value to indicate any redline type in some method calls +}; + +/// Struct for sorting data. +class SAL_WARN_UNUSED SVX_DLLPUBLIC RedlinData +{ +public: + RedlinData(); + virtual ~RedlinData(); + DateTime aDateTime; + void* pData; + RedlineType eType; + bool bDisabled; +}; + +class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxRedlinTable +{ +private: + std::unique_ptr xSorter; + std::unique_ptr xWriterTreeView; + std::unique_ptr xCalcTreeView; + weld::TreeView* pTreeView; + + sal_uInt16 nDatePos; + bool bAuthor; + bool bDate; + bool bComment; + bool bSorted; + SvxRedlinDateMode nDaTiMode; + DateTime aDaTiFirst; + DateTime aDaTiLast; + DateTime aDaTiFilterFirst; + DateTime aDaTiFilterLast; + OUString aAuthor; + std::unique_ptr pCommentSearcher; + + int ColCompare(const weld::TreeIter& rLeft, const weld::TreeIter& rRight); + +public: + SvxRedlinTable(std::unique_ptr xWriterControl, + std::unique_ptr xCalcControl); + + void set_size_request(int nWidth, int nHeight); + + weld::TreeView& GetWidget() { return *pTreeView; } + bool IsSorted() const { return bSorted; } + + ~SvxRedlinTable(); + + // For FilterPage only { + void SetFilterDate(bool bFlag); + void SetDateTimeMode(SvxRedlinDateMode nMode); + void SetFirstDate(const Date&); + void SetLastDate(const Date&); + void SetFirstTime(const tools::Time&); + void SetLastTime(const tools::Time&); + void SetFilterAuthor(bool bFlag); + void SetAuthor(const OUString &); + void SetFilterComment(bool bFlag); + void SetCommentParams( const utl::SearchParam* pSearchPara ); + + void UpdateFilterTest(); + // } For FilterPage only + + void SetCalcView(); + void SetWriterView(); + + bool IsValidEntry(const OUString &rAuthor, const DateTime &rDateTime, const OUString &rComment); + bool IsValidEntry(const OUString &rAuthor, const DateTime &rDateTime); + bool IsValidComment(const OUString &rComment); + + DECL_LINK(HeaderBarClick, int, void); +}; + +class SVX_DLLPUBLIC SvxTPage +{ +protected: + std::unique_ptr m_xBuilder; + std::unique_ptr m_xContainer; +public: + SvxTPage(weld::Container* pParent, const OUString& rUIXMLDescription, const OString& rID); + virtual ~SvxTPage(); + virtual void ActivatePage(); + void Show() { m_xContainer->show(); } +}; + +/// Tabpage with the filter text entries etc. +class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxTPFilter final : public SvxTPage +{ + Link aReadyLink; + Link aRefLink; + + bool bModified; + + SvxRedlinTable* m_pRedlinTable; + std::unique_ptr m_xCbDate; + std::unique_ptr m_xLbDate; + std::unique_ptr m_xDfDate; + std::unique_ptr m_xTfDate; + std::unique_ptr m_xIbClock; + std::unique_ptr m_xFtDate2; + std::unique_ptr m_xDfDate2; + std::unique_ptr m_xTfDate2; + std::unique_ptr m_xIbClock2; + std::unique_ptr m_xCbAuthor; + std::unique_ptr m_xLbAuthor; + std::unique_ptr m_xCbRange; + std::unique_ptr m_xEdRange; + std::unique_ptr m_xBtnRange; + std::unique_ptr m_xCbAction; + std::unique_ptr m_xLbAction; + std::unique_ptr m_xCbComment; + std::unique_ptr m_xEdComment; + + DECL_LINK( SelDateHdl, weld::ComboBox&, void ); + DECL_LINK( RowEnableHdl, weld::Button&, void ); + DECL_LINK( TimeHdl, weld::Button&, void ); + DECL_LINK( ModifyHdl, weld::Entry&, void ); + DECL_LINK( ModifyListBoxHdl, weld::ComboBox&, void ); + DECL_LINK( ModifyDate, SvtCalendarBox&, void ); + DECL_LINK( ModifyTime, weld::TimeSpinButton&, void ); + DECL_LINK( RefHandle, weld::Button&, void ); + + void EnableDateLine1(bool bFlag); + void EnableDateLine2(bool bFlag); + +public: + SvxTPFilter(weld::Container* pParent); + virtual ~SvxTPFilter() override; + + void DeactivatePage(); + void SetRedlinTable(SvxRedlinTable*); + + Date GetFirstDate() const; + void SetFirstDate(const Date &aDate); + tools::Time GetFirstTime() const; + void SetFirstTime(const tools::Time &aTime); + + Date GetLastDate() const; + void SetLastDate(const Date &aDate); + tools::Time GetLastTime() const; + void SetLastTime(const tools::Time &aTime); + + void SetDateMode(sal_uInt16 nMode); + SvxRedlinDateMode GetDateMode() const; + + void ClearAuthors(); + void InsertAuthor( const OUString& rString ); + OUString GetSelectedAuthor()const; + void SelectedAuthorPos(sal_Int32 nPos); + sal_Int32 SelectAuthor(const OUString& aString); + void SetComment(const OUString& rComment); + OUString GetComment()const; + + // Methods for Calc { + void SetRange(const OUString& rString); + OUString GetRange() const; + void HideRange(bool bHide=true); + void SetFocusToRange(); + // } Methods for Calc + + bool IsDate() const; + bool IsAuthor() const; + bool IsRange() const; + bool IsAction() const; + bool IsComment() const; + + void ShowAction(bool bShow=true); + + void CheckDate(bool bFlag); + void CheckAuthor(bool bFlag); + void CheckRange(bool bFlag); + void CheckAction(bool bFlag); + void CheckComment(bool bFlag); + + weld::ComboBox* GetLbAction() { return m_xLbAction.get(); } + + void SetReadyHdl( const Link& rLink ) { aReadyLink= rLink; } + + + // Methods for Calc { + void SetRefHdl( const Link& rLink ) { aRefLink = rLink; } + + void Enable( bool bEnable = true ); + // } Methods for Calc +}; + +/// Tabpage with the redlining entries. +class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxTPView final : public SvxTPage +{ +private: + + Link AcceptClickLk; + Link AcceptAllClickLk; + Link RejectClickLk; + Link RejectAllClickLk; + Link UndoClickLk; + + bool bEnableAccept; + bool bEnableAcceptAll; + bool bEnableReject; + bool bEnableRejectAll; + bool bEnableUndo; + + bool bEnableClearFormat; + bool bEnableClearFormatAll; + + weld::Window* m_pDialog; + std::unique_ptr m_xAccept; + std::unique_ptr m_xReject; + std::unique_ptr m_xAcceptAll; + std::unique_ptr m_xRejectAll; + std::unique_ptr m_xUndo; + std::unique_ptr m_xViewData; + + DECL_LINK( PbClickHdl, weld::Button&, void ); + + void EnableClearFormatButton(weld::Button&, bool bFlag); +public: + SvxTPView(weld::Container* pParent, weld::Window* pDialog, weld::Builder* pTopLevel); + virtual ~SvxTPView() override; + + SvxRedlinTable* GetTableControl() { return m_xViewData.get(); } + + void EnableAccept(bool bFlag); + void EnableAcceptAll(bool bFlag); + void EnableReject(bool bFlag); + void EnableRejectAll(bool bFlag); + void EnableClearFormat(bool bFlag); + void EnableClearFormatAll(bool bFlag); + void EnableUndo(bool bFlag=true); + void DisableUndo() {EnableUndo(false);} + void ShowUndo(); + + void SetAcceptClickHdl( const Link& rLink ) { AcceptClickLk = rLink; } + + void SetAcceptAllClickHdl( const Link& rLink ) { AcceptAllClickLk = rLink; } + + void SetRejectClickHdl( const Link& rLink ) { RejectClickLk = rLink; } + + void SetRejectAllClickHdl( const Link& rLink ) { RejectAllClickLk = rLink; } + + void SetUndoClickHdl( const Link& rLink ) { UndoClickLk = rLink; } + + virtual void ActivatePage() override; + void DeactivatePage(); +}; + +// Redlining - Control (Accept- Changes) +class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxAcceptChgCtr +{ +private: + std::unique_ptr m_xBuilder; + std::unique_ptr m_xTabCtrl; + + std::unique_ptr m_xTPFilter; + std::unique_ptr m_xTPView; + + DECL_DLLPRIVATE_LINK(ActivatePageHdl, const OString&, void); + DECL_DLLPRIVATE_LINK(DeactivatePageHdl, const OString&, bool); + +public: + SvxAcceptChgCtr(weld::Container* pParent, weld::Window* pDialog, weld::Builder* pTopLevel); + ~SvxAcceptChgCtr(); + + void ShowFilterPage(); + + SvxTPFilter* GetFilterPage() { return m_xTPFilter.get(); } + SvxTPView* GetViewPage() { return m_xTPView.get(); } + + void set_help_id(const OString& rId) { m_xTabCtrl->set_help_id(rId); } +}; + +#endif // INCLUDED_SVX_CTREDLIN_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/cube3d.hxx b/include/svx/cube3d.hxx new file mode 100644 index 000000000..d9b660fa6 --- /dev/null +++ b/include/svx/cube3d.hxx @@ -0,0 +1,95 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_CUBE3D_HXX +#define INCLUDED_SVX_CUBE3D_HXX + +#include +#include +#include +#include +#include +#include + +namespace sdr::contact { class ViewContact; } + +class E3dDefaultAttributes; + +/************************************************************************* +|* +|* | +|* Create a 3D cuboid; aPos: Center or left, bottom, behind |__ +|* (depending on bPosIsCenter) / +|* nSideFlags indicates, if only some of the cuboid surfaces can +|* be created; the corresponding bits are defined in the enum. +|* The flag bDblSided indicates whether the created surfaces are +|* two-sided (which only makes sense if not all of the surfaces were +|* created). +|* +\************************************************************************/ + +class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC E3dCubeObj final : public E3dCompoundObject +{ + // Parameter + basegfx::B3DPoint aCubePos; + basegfx::B3DVector aCubeSize; + + // BOOLeans + bool bPosIsCenter : 1; + + void SetDefaultAttributes(const E3dDefaultAttributes& rDefault); + virtual std::unique_ptr CreateObjectSpecificViewContact() override; + +private: + // protected destructor - due to final, make private + virtual ~E3dCubeObj() override; + +public: + E3dCubeObj(SdrModel& rSdrModel, + const E3dDefaultAttributes& rDefault, + const basegfx::B3DPoint& aPos, + const basegfx::B3DVector& r3DSize); + E3dCubeObj(SdrModel& rSdrModel); + + virtual sal_uInt16 GetObjIdentifier() const override; + virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const override; + + virtual E3dCubeObj* CloneSdrObject(SdrModel& rTargetModel) const override; + + // implemented mainly for the purposes of Clone() + E3dCubeObj& operator=(const E3dCubeObj& rObj); + + // Set local parameters with geometry recreation + void SetCubePos(const basegfx::B3DPoint& rNew); + const basegfx::B3DPoint& GetCubePos() const { return aCubePos; } + + void SetCubeSize(const basegfx::B3DVector& rNew); + const basegfx::B3DVector& GetCubeSize() const { return aCubeSize; } + + void SetPosIsCenter(bool bNew); + bool GetPosIsCenter() const { return bPosIsCenter; } + + // TakeObjName...() is for the display in the UI, for example "3 frames selected". + virtual OUString TakeObjNameSingul() const override; + virtual OUString TakeObjNamePlural() const override; +}; + +#endif // INCLUDED_SVX_CUBE3D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/dataaccessdescriptor.hxx b/include/svx/dataaccessdescriptor.hxx new file mode 100644 index 000000000..bc3423999 --- /dev/null +++ b/include/svx/dataaccessdescriptor.hxx @@ -0,0 +1,131 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_DATAACCESSDESCRIPTOR_HXX +#define INCLUDED_SVX_DATAACCESSDESCRIPTOR_HXX + +#include +#include +#include + +namespace com::sun::star::beans { class XPropertySet; } +namespace com::sun::star::beans { struct PropertyValue; } +namespace com::sun::star::uno { class Any; } +namespace com::sun::star::uno { template class Sequence; } +namespace com::sun::star::uno { template class Reference; } + +namespace svx +{ + class ODADescriptorImpl; + + //= DataAccessDescriptorProperty + enum class DataAccessDescriptorProperty + { + DataSource, /// data source name (string) + DatabaseLocation, /// database file URL (string) + ConnectionResource, /// database driver URL (string) + Connection, /// connection (XConnection) + + Command, /// command (string) + CommandType, /// command type (long) + EscapeProcessing, /// escape processing (boolean) + Filter, /// additional filter (string) + Cursor, /// the cursor (XResultSet) + + ColumnName, /// column name (string) + ColumnObject, /// column object (XPropertySet) + + Selection, /// selection (sequence< any >) + BookmarkSelection, /// selection are bookmarks? (boolean) + + Component /// component name (XContent) + }; + + //= ODataAccessDescriptor + + /** class encapsulating the css::sdb::DataAccessDescriptor service. + */ + class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC ODataAccessDescriptor final + { + std::unique_ptr m_pImpl; + + public: + ODataAccessDescriptor(); + ODataAccessDescriptor( const ODataAccessDescriptor& _rSource ); + ODataAccessDescriptor(ODataAccessDescriptor&& _rSource) noexcept; + ODataAccessDescriptor( const css::uno::Reference< css::beans::XPropertySet >& _rValues ); + ODataAccessDescriptor( const css::uno::Sequence< css::beans::PropertyValue >& _rValues ); + + // allows to construct a descriptor from an Any containing either an XPropertySet or a property value sequence + ODataAccessDescriptor( const css::uno::Any& _rValues ); + + ODataAccessDescriptor& operator=(const ODataAccessDescriptor& _rSource); + ODataAccessDescriptor& operator=(ODataAccessDescriptor&& _rSource) noexcept; + + ~ODataAccessDescriptor(); + + /** returns the descriptor as property value sequence +

    If you call this method more than once, without writing any values between both calls, the same object + is returned. If you wrote values, a new object is returned.

    + */ + css::uno::Sequence< css::beans::PropertyValue > const & + createPropertyValueSequence(); + + /** initialized the descriptor from the property values given + The descriptor will clear all its current settings before + initializing with the new ones. + */ + void initializeFrom( + const css::uno::Sequence< css::beans::PropertyValue >& _rValues); + + /// checks whether or not a given property is present in the descriptor + bool has(DataAccessDescriptorProperty _eWhich) const; + + /** erases the given property from the descriptor + */ + void erase(DataAccessDescriptorProperty _eWhich); + + /** empties the descriptor + */ + void clear(); + + /// return the value of a given property + const css::uno::Any& operator [] ( DataAccessDescriptorProperty _eWhich ) const; + + /** return the (modifiable) value of a given property +

    This operator is not allowed to be called if the descriptor is readonly.

    + */ + css::uno::Any& operator [] ( DataAccessDescriptorProperty _eWhich ); + + /** returns either the data source name if given or the database location + */ + OUString getDataSource() const; + + /** set the data source name, if it is not file URL + @param _sDataSourceNameOrLocation + the data source name or database location + */ + void setDataSource(const OUString& _sDataSourceNameOrLocation); + }; + +} + +#endif // INCLUDED_SVX_DATAACCESSDESCRIPTOR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/databaselocationinput.hxx b/include/svx/databaselocationinput.hxx new file mode 100644 index 000000000..edc186b89 --- /dev/null +++ b/include/svx/databaselocationinput.hxx @@ -0,0 +1,82 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_DATABASELOCATIONINPUT_HXX +#define INCLUDED_SVX_DATABASELOCATIONINPUT_HXX + +#include +#include + +#include + +class SvtURLBox; +namespace weld { class Button; class Window; } +namespace com::sun::star::uno { class XComponentContext; } +namespace com::sun::star::uno { template class Reference; } + +namespace svx +{ + //= DatabaseLocationInputController + class DatabaseLocationInputController_Impl; + /** helper class to control controls needed to input a database location + + If you allow, in your dialog, to save a database document, then you usually + have an URLBox for inputting the actual location, and a push button + to browse for a location. + + This helper class controls such two UI elements. + */ + class SAL_WARN_UNUSED SVX_DLLPUBLIC DatabaseLocationInputController + { + public: + DatabaseLocationInputController( + const css::uno::Reference& _rContext, + SvtURLBox& _rLocationInput, + weld::Button& _rBrowseButton, + weld::Window& _rDialog + ); + ~DatabaseLocationInputController(); + + /** sets the given URL at the input control, after translating it into a system path + */ + void setURL( const OUString& _rURL ); + + /** returns the current database location, in form of a URL (not a system path) + */ + OUString getURL() const; + + /** prepares committing the database location entered in the input field + + Effectively, this method checks whether the file in the location already + exists, and if so, it asks the user whether to overwrite it. + + If the method is called multiple times, this check only happens when the location + changed since the last call. + */ + bool prepareCommit(); + + private: + ::std::unique_ptr< DatabaseLocationInputController_Impl > + m_pImpl; + }; +} + +#endif // INCLUDED_SVX_DATABASELOCATIONINPUT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/databaseregistrationui.hxx b/include/svx/databaseregistrationui.hxx new file mode 100644 index 000000000..7cb5f6c55 --- /dev/null +++ b/include/svx/databaseregistrationui.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_SVX_DATABASEREGISTRATIONUI_HXX +#define INCLUDED_SVX_DATABASEREGISTRATIONUI_HXX + +#include +#include + +namespace weld { class Window; } + +#define SID_SB_POOLING_ENABLED (RID_OFA_START + 247) +#define SID_SB_DRIVER_TIMEOUTS (RID_OFA_START + 248) +#define SID_SB_DB_REGISTER (RID_OFA_START + 249) + +namespace svx +{ + /** opens a dialog which allows the user to administrate the database registrations + */ + sal_uInt16 SVX_DLLPUBLIC administrateDatabaseRegistration( weld::Window* _parentWindow ); + +} + +#endif // INCLUDED_SVX_DATABASEREGISTRATIONUI_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/dbaexchange.hxx b/include/svx/dbaexchange.hxx new file mode 100644 index 000000000..ac943d9cf --- /dev/null +++ b/include/svx/dbaexchange.hxx @@ -0,0 +1,275 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_DBAEXCHANGE_HXX +#define INCLUDED_SVX_DBAEXCHANGE_HXX + +#include + +#include +#include +#include +#include +#include +#include + +namespace com::sun::star::sdbc { class XConnection; } +namespace com::sun::star::beans { class XPropertySet; } + +// column transfer formats +enum class ColumnTransferFormatFlags +{ + FIELD_DESCRIPTOR = 0x01, // the field descriptor format + CONTROL_EXCHANGE = 0x02, // the control exchange format + COLUMN_DESCRIPTOR = 0x04, // data access descriptor for a column +}; +namespace o3tl +{ + template<> struct typed_flags : is_typed_flags {}; +} + + +namespace svx +{ + + + //= OColumnTransferable + + class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC OColumnTransferable final : public TransferDataContainer + { + public: + OColumnTransferable(ColumnTransferFormatFlags nFormats); + + /** construct the transferable from a data access descriptor + + Note that some of the aspects, in particular all which cannot be represented + as string, can only be transported via the CTF_COLUMN_DESCRIPTOR format. + + @param rDescriptor + The descriptor for the column. It must contain at least +
    • information sufficient to create a connection, that is, either one of DataSource, DatabaseLocation, + ConnectionResource, and DataAccessDescriptorProperty::Connection
    • +
    • a Command
    • +
    • a CommandType
    • +
    • a ColumnName or ColumnObject
    • +
    + */ + void setDescriptor(const ODataAccessDescriptor& rDescriptor); + + + /** construct the transferable from a DatabaseForm component and a field name + + @param _rxForm + the form which is bound to the data source which's field is to be dragged + + @param _rFieldName + the name of the field to be dragged + + @param _rxColumn + the column object. Won't be used if _nFormats does not include the CTF_COLUMN_DESCRIPTOR + flag.
    + May be . + + @param _rxConnection + the connection the column belongs to. Won't be used if _nFormats does not include the CTF_COLUMN_DESCRIPTOR + flag.
    + May be . + + @param _nFormats + supported formats. Must be a combination of the CTF_XXX flags + */ + OColumnTransferable( + const css::uno::Reference< css::beans::XPropertySet >& _rxForm, + const OUString& _rFieldName, + const css::uno::Reference< css::beans::XPropertySet >& _rxColumn, + const css::uno::Reference< css::sdbc::XConnection >& _rxConnection, + ColumnTransferFormatFlags _nFormats + ); + + /** checks whether or not a column descriptor can be extracted from the data flavor vector given + @param _rFlavors + available flavors + @param _nFormats + formats to accept + */ + static bool canExtractColumnDescriptor(const DataFlavorExVector& _rFlavors, ColumnTransferFormatFlags _nFormats); + + /** extracts a column descriptor from the transferable given + */ + static bool extractColumnDescriptor( + const TransferableDataHelper& _rData + ,OUString& _rDatasource + ,OUString& _rDatabaseLocation + ,OUString& _rConnectionResource + ,sal_Int32& _nCommandType + ,OUString& _rCommand + ,OUString& _rFieldName + ); + + /** extracts a column descriptor from the transferable given + */ + static ODataAccessDescriptor + extractColumnDescriptor(const TransferableDataHelper& _rData); + + private: + // TransferableHelper overridables + virtual void AddSupportedFormats() override; + virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) override; + + static SotClipboardFormatId getDescriptorFormatId(); + + SVX_DLLPRIVATE void implConstruct( + const OUString& _rDatasource + ,const OUString& _rConnectionResource + ,const sal_Int32 _nCommandType + ,const OUString& _rCommand + ,const OUString& _rFieldName + ); + + ODataAccessDescriptor m_aDescriptor; + OUString m_sCompatibleFormat; + ColumnTransferFormatFlags m_nFormatFlags; + }; + + + //= ODataAccessObjectTransferable + + /** class for transferring data access objects (tables, queries, statements ...) + */ + class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC ODataAccessObjectTransferable : public TransferableHelper + { + ODataAccessDescriptor m_aDescriptor; + OUString m_sCompatibleObjectDescription; + // needed to provide a SotClipboardFormatId::SBA_DATAEXCHANGE format + + public: + /** should be used copying and the connection is needed. + @param _rDatasource + The data source name. + @param _nCommandType + The kind of command. @see com.sun.star.sdbc.CommandType + @param _rCommand + The command, either a name of a table or query or a SQL statement. + */ + ODataAccessObjectTransferable( + const OUString& _rDatasourceOrLocation + ,const sal_Int32 _nCommandType + ,const OUString& _rCommand + ,const css::uno::Reference< css::sdbc::XConnection >& _rxConnection + ); + + /** should be used when copying a query object and no connection is available. + @param _rDatasource + The data source name. + @param _nCommandType + The kind of command. @see com.sun.star.sdbc.CommandType + @param _rCommand + The command, either a name of a table or query or a SQL statement. + */ + ODataAccessObjectTransferable( + const OUString& _rDatasourceOrLocation + ,const sal_Int32 _nCommandType + ,const OUString& _rCommand + ); + + /** with this ctor, only the object descriptor format will be provided + */ + ODataAccessObjectTransferable( + const css::uno::Reference< css::beans::XPropertySet >& _rxLivingForm + ); + + /** checks whether or not an object descriptor can be extracted from the data flavor vector given + @param _rFlavors + available flavors + @param _nFormats + formats to accept + */ + static bool canExtractObjectDescriptor(const DataFlavorExVector& _rFlavors); + + /** extracts an object descriptor from the transferable given + */ + static ODataAccessDescriptor + extractObjectDescriptor(const TransferableDataHelper& _rData); + + protected: + virtual void AddSupportedFormats() override; + virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) override; + virtual void ObjectReleased() override; + + protected: + const ODataAccessDescriptor& getDescriptor() const { return m_aDescriptor; } + ODataAccessDescriptor& getDescriptor() { return m_aDescriptor; } + protected: + void addCompatibleSelectionDescription( + const css::uno::Sequence< css::uno::Any >& _rSelRows + ); + // normally, a derived class could simply access getDescriptor[DataAccessDescriptorProperty::Selection] and place the sequence therein + // but unfortunately, we have this damned compatible format, and this can't be accessed in + // derived classes (our class is the only one which should be contaminated with this) + + private: + SVX_DLLPRIVATE void construct( const OUString& _rDatasourceOrLocation + ,const OUString& _rConnectionResource + ,const sal_Int32 _nCommandType + ,const OUString& _rCommand + ,const css::uno::Reference< css::sdbc::XConnection >& _rxConnection + ,bool _bAddCommand + ,const OUString& _sActiveCommand); + }; + + + //= OMultiColumnTransferable + + /** class for transferring multiple columns + */ + class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC OMultiColumnTransferable final : public TransferDataContainer + { + public: + OMultiColumnTransferable(); + + void setDescriptors(const css::uno::Sequence< css::beans::PropertyValue >& rDescriptors); + + /** checks whether or not an object descriptor can be extracted from the data flavor vector given + @param _rFlavors + available flavors + @param _nFormats + formats to accept + */ + static bool canExtractDescriptor(const DataFlavorExVector& _rFlavors); + + /** extracts an object descriptor from the transferable given + */ + static css::uno::Sequence< css::beans::PropertyValue > extractDescriptor(const TransferableDataHelper& _rData); + + private: + virtual void AddSupportedFormats() override; + virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) override; + virtual void ObjectReleased() override; + static SotClipboardFormatId getDescriptorFormatId(); + + css::uno::Sequence< css::beans::PropertyValue > m_aDescriptors; + }; + + +} + + +#endif // INCLUDED_SVX_DBAEXCHANGE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/dbaobjectex.hxx b/include/svx/dbaobjectex.hxx new file mode 100644 index 000000000..4fe92b407 --- /dev/null +++ b/include/svx/dbaobjectex.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_SVX_DBAOBJECTEX_HXX +#define INCLUDED_SVX_DBAOBJECTEX_HXX + +#include +#include +#include + +namespace com::sun::star::ucb { class XContent; } + + +namespace svx +{ + + + //= OComponentTransferable + + class SAL_WARN_UNUSED SVX_DLLPUBLIC OComponentTransferable final : public TransferableHelper + { + public: + /** construct the transferable + */ + OComponentTransferable( + const OUString& _rDatasourceOrLocation + ,const css::uno::Reference< css::ucb::XContent>& _xContent + ); + + /** checks whether or not a component descriptor can be extracted from the data flavor vector given + @param _rFlavors + available flavors + */ + static bool canExtractComponentDescriptor(const DataFlavorExVector& _rFlavors, bool _bForm ); + + /** extracts a component descriptor from the transferable given + */ + static ODataAccessDescriptor + extractComponentDescriptor(const TransferableDataHelper& _rData); + + private: + // TransferableHelper overridables + virtual void AddSupportedFormats() override; + virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) override; + + static SotClipboardFormatId getDescriptorFormatId(bool _bExtractForm); + + ODataAccessDescriptor m_aDescriptor; + }; + + +} + + +#endif // INCLUDED_SVX_DBAOBJECTEX_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/def3d.hxx b/include/svx/def3d.hxx new file mode 100644 index 000000000..5f4351d35 --- /dev/null +++ b/include/svx/def3d.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_SVX_DEF3D_HXX +#define INCLUDED_SVX_DEF3D_HXX + +#include + +const double fPiDiv180 = 0.01745329251994; +const double EPSILON = 1e-06; + +#define DEG2RAD(fAngle) (fPiDiv180 * (fAngle)) + +// 3D helper functions + +enum class E3dDragConstraint +{ + X = 0x0001, + Y = 0x0002, + Z = 0x0004, + XYZ = X | Y | Z +}; +namespace o3tl +{ + template<> struct typed_flags : is_typed_flags {}; +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/deflt3d.hxx b/include/svx/deflt3d.hxx new file mode 100644 index 000000000..f3312afd5 --- /dev/null +++ b/include/svx/deflt3d.hxx @@ -0,0 +1,97 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_DEFLT3D_HXX +#define INCLUDED_SVX_DEFLT3D_HXX + +#include +#include +#include +#include + +/************************************************************************* +|* +|* Class for managing the 3D default attributes +|* +\************************************************************************/ + +class SAL_WARN_UNUSED UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) E3dDefaultAttributes +{ +private: + // Cube object + basegfx::B3DPoint aDefaultCubePos; + basegfx::B3DVector aDefaultCubeSize; + bool bDefaultCubePosIsCenter; + + // Sphere object + basegfx::B3DPoint aDefaultSphereCenter; + basegfx::B3DVector aDefaultSphereSize; + + // Lathe object + bool bDefaultLatheSmoothed; + bool bDefaultLatheSmoothFrontBack; + bool bDefaultLatheCharacterMode; + bool bDefaultLatheCloseFront; + bool bDefaultLatheCloseBack; + + // Extrude object + bool bDefaultExtrudeSmoothed; + bool bDefaultExtrudeSmoothFrontBack; + bool bDefaultExtrudeCharacterMode; + bool bDefaultExtrudeCloseFront; + bool bDefaultExtrudeCloseBack; + +public: + // Constructor + E3dDefaultAttributes(); + + // Reset to defaults + void Reset(); + + // Cube object + const basegfx::B3DPoint& GetDefaultCubePos() const { return aDefaultCubePos; } + const basegfx::B3DVector& GetDefaultCubeSize() const { return aDefaultCubeSize; } + bool GetDefaultCubePosIsCenter() const { return bDefaultCubePosIsCenter; } + + // Sphere object + const basegfx::B3DPoint& GetDefaultSphereCenter() const { return aDefaultSphereCenter; } + const basegfx::B3DVector& GetDefaultSphereSize() const { return aDefaultSphereSize; } + + // Lathe object + bool GetDefaultLatheSmoothed() const { return bDefaultLatheSmoothed; } + bool GetDefaultLatheSmoothFrontBack() const { return bDefaultLatheSmoothFrontBack; } + bool GetDefaultLatheCharacterMode() const { return bDefaultLatheCharacterMode; } + void SetDefaultLatheCharacterMode(const bool bNew) { bDefaultLatheCharacterMode = bNew; } + bool GetDefaultLatheCloseFront() const { return bDefaultLatheCloseFront; } + bool GetDefaultLatheCloseBack() const { return bDefaultLatheCloseBack; } + + // Extrude object + bool GetDefaultExtrudeSmoothed() const { return bDefaultExtrudeSmoothed; } + bool GetDefaultExtrudeSmoothFrontBack() const { return bDefaultExtrudeSmoothFrontBack; } + bool GetDefaultExtrudeCharacterMode() const { return bDefaultExtrudeCharacterMode; } + void SetDefaultExtrudeCharacterMode(const bool bNew) { bDefaultExtrudeCharacterMode = bNew; } + bool GetDefaultExtrudeCloseFront() const { return bDefaultExtrudeCloseFront; } + void SetDefaultExtrudeCloseFront(const bool bNew) { bDefaultExtrudeCloseFront = bNew; } + bool GetDefaultExtrudeCloseBack() const { return bDefaultExtrudeCloseBack; } + void SetDefaultExtrudeCloseBack(const bool bNew) { bDefaultExtrudeCloseBack = bNew; } +}; + +#endif // INCLUDED_SVX_DEFLT3D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/dialcontrol.hxx b/include/svx/dialcontrol.hxx new file mode 100644 index 000000000..d4eb26650 --- /dev/null +++ b/include/svx/dialcontrol.hxx @@ -0,0 +1,171 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_DIALCONTROL_HXX +#define INCLUDED_SVX_DIALCONTROL_HXX + +#include +#include +#include +#include +#include + +class Edit; + +namespace svx { + + +class SAL_WARN_UNUSED DialControlBmp final : public VirtualDevice +{ +public: + explicit DialControlBmp(OutputDevice& rReference); + + void InitBitmap(const vcl::Font& rFont); + void SetSize(const Size& rSize); + void CopyBackground( const DialControlBmp& rSrc ); + void DrawBackground( const Size& rSize, bool bEnabled ); + void DrawBackground(); + void DrawElements( const OUString& rText, sal_Int32 nAngle ); + Color GetBackgroundColor() const override; + +private: + const Color& GetTextColor() const; + const Color& GetScaleLineColor() const; + const Color& GetButtonLineColor() const; + const Color& GetButtonFillColor( bool bMain ) const; + + void Init(); + + tools::Rectangle maRect; + bool mbEnabled; + OutputDevice& mrParent; + long mnCenterX; + long mnCenterY; +}; + +/** This control allows to input a rotation angle, visualized by a dial. + + Usage: A single click sets a rotation angle rounded to steps of 15 degrees. + Dragging with the left mouse button sets an exact rotation angle. Pressing + the ESCAPE key during mouse drag cancels the operation and restores the old + state of the control. + + It is possible to link a numeric field to this control using the function + SetLinkedField(). The DialControl will take full control of this numeric + field: + - Sets the rotation angle to the numeric field in mouse operations. + - Shows the value entered/modified in the numeric field. + - Enables/disables/shows/hides the field according to own state changes. + */ +class SAL_WARN_UNUSED SVX_DLLPUBLIC DialControl final : public weld::CustomWidgetController +{ +public: + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; + + virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override; + + virtual void StyleUpdated() override; + + virtual bool MouseButtonDown( const MouseEvent& rMEvt ) override; + virtual bool MouseMove( const MouseEvent& rMEvt ) override; + virtual bool MouseButtonUp( const MouseEvent& rMEvt ) override; + virtual bool KeyInput(const KeyEvent& rKEvt) override; + virtual void LoseFocus() override; + + virtual void Resize() override; + + /** Returns the current rotation angle in 1/100 degrees. */ + sal_Int32 GetRotation() const; + /** Sets the rotation to the passed value (in 1/100 degrees). */ + void SetRotation( sal_Int32 nAngle ); + /** Returns true, if the control is not in "don't care" state. */ + bool HasRotation() const; + /** Sets the control to "don't care" state. */ + void SetNoRotation(); + + /** Links the passed numeric edit field to the control (bi-directional). + * nDecimalPlaces: + * field value is unsign given decimal places + * default is 0 which means field values are in degrees, + * 2 means 100th of degree + */ + void SetLinkedField(weld::MetricSpinButton* pField, sal_Int32 nDecimalPlaces = 0); + + /** Save value for later comparison */ + void SaveValue(); + + /** Compare value with the saved value */ + bool IsValueModified() const; + + const OUString& GetText() const { return mpImpl->maText; } + void SetText(const OUString& rText) { mpImpl->maText = rText; } + + void SetModifyHdl( const Link& rLink ); + + void Init( const Size& rWinSize ); + + void set_visible(bool bVisible) + { + if (bVisible) + Show(); + else + Hide(); + } +private: + struct SAL_DLLPRIVATE DialControl_Impl + { + ScopedVclPtr mxBmpEnabled; + ScopedVclPtr mxBmpDisabled; + ScopedVclPtr mxBmpBuffered; + Link maModifyHdl; + OUString maText; + weld::MetricSpinButton* mpLinkField; + sal_Int32 mnLinkedFieldValueMultiplyer; + Size maWinSize; + vcl::Font maWinFont; + sal_Int32 mnAngle; + sal_Int32 mnInitialAngle; + sal_Int32 mnOldAngle; + long mnCenterX; + long mnCenterY; + bool mbNoRot; + + explicit DialControl_Impl(OutputDevice& rReference); + void Init( const Size& rWinSize, const vcl::Font& rWinFont ); + void SetSize( const Size& rWinSize ); + }; + std::unique_ptr< DialControl_Impl > mpImpl; + + void HandleMouseEvent( const Point& rPos, bool bInitial ); + void HandleEscapeEvent(); + + void SetRotation( sal_Int32 nAngle, bool bBroadcast ); + + void Init( const Size& rWinSize, const vcl::Font& rWinFont ); + + void InvalidateControl(); + + DECL_LINK(LinkedFieldModifyHdl, weld::MetricSpinButton&, void); +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/dialmgr.hxx b/include/svx/dialmgr.hxx new file mode 100644 index 000000000..6dc6dcaa4 --- /dev/null +++ b/include/svx/dialmgr.hxx @@ -0,0 +1,30 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_DIALMGR_HXX +#define INCLUDED_SVX_DIALMGR_HXX + +#include +#include + +SVXCORE_DLLPUBLIC std::locale SvxResLocale(); +SVXCORE_DLLPUBLIC OUString SvxResId(const char* pId); + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/dialogs.hrc b/include/svx/dialogs.hrc new file mode 100644 index 000000000..5dc3fc6fa --- /dev/null +++ b/include/svx/dialogs.hrc @@ -0,0 +1,120 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_DIALOGS_HRC +#define INCLUDED_SVX_DIALOGS_HRC + +#include + +// factory IDs of tabpages implemented in CUI +#define RID_SVXPAGE_CHAR_TWOLINES (RID_SVX_START + 242) +#define RID_SVXPAGE_EXT_PARAGRAPH (RID_SVX_START + 7) +#define RID_SVXPAGE_GRFCROP (RID_SVX_START + 238) +#define RID_SVXPAGE_CHAR_NAME (RID_SVX_START + 239) +#define RID_SVXPAGE_CHAR_EFFECTS (RID_SVX_START + 240) +#define RID_SVXPAGE_CHAR_POSITION (RID_SVX_START + 241) +#define RID_SVXPAGE_STD_PARAGRAPH (RID_SVX_START + 6) +#define RID_SVXPAGE_ALIGN_PARAGRAPH (RID_SVX_START + 187) +#define RID_SVXPAGE_PARA_ASIAN (RID_SVX_START + 245) +#define RID_SVXPAGE_TABULATOR (RID_SVX_START + 2) +#define RID_SFXPAGE_DBREGISTER (RID_OFA_START + 123) +#define RID_SVXPAGE_NUMBERFORMAT (RID_SVX_START + 41) +#define RID_SVXPAGE_ALIGNMENT (RID_SVX_START + 90) +#define RID_SVXPAGE_BORDER (RID_SVX_START + 5) +#define RID_SVXPAGE_PAGE (RID_SVX_START + 25) +#define RID_SVXPAGE_LINE (RID_SVX_START + 51) +#define RID_SVXPAGE_AREA (RID_SVX_START + 56) +#define RID_SVXPAGE_BKG (RID_SVX_START + 57) +#define RID_SVXPAGE_SHADOW (RID_SVX_START + 61) +#define RID_SVXPAGE_TRANSPARENCE (RID_SVX_START + 54) +#define RID_SVXPAGE_TEXTATTR (RID_SVX_START + 153) +#define RID_SVXPAGE_TEXTANIMATION (RID_SVX_START + 184) +#define RID_SVXPAGE_MEASURE (RID_SVX_START + 161) +#define RID_SVXPAGE_CONNECTION (RID_SVX_START + 191) +#define RID_SVXPAGE_LINE_DEF (RID_SVX_START + 52) +#define RID_SVXPAGE_LINEEND_DEF (RID_SVX_START + 53) +#define RID_SVXPAGE_NUM_OPTIONS (RID_SVX_START + 219) +#define RID_SVXPAGE_NUM_POSITION (RID_SVX_START + 220) +#define RID_SVXPAGE_PICK_SINGLE_NUM (RID_SVX_START + 215) +#define RID_SVXPAGE_PICK_BULLET (RID_SVX_START + 216) +#define RID_SVXPAGE_PICK_NUM (RID_SVX_START + 217) +#define RID_SVXPAGE_PICK_BMP (RID_SVX_START + 218) +#define RID_SVXPAGE_MACROASSIGN (RID_SVX_START + 296) + +// ID of tabpages implemented in SVX, but used in CUI +#define RID_SVXPAGE_GRID (RID_SVX_START + 152) + +// IDs of options pages of applications +#define RID_SW_TP_MAILCONFIG (RID_OFA_START + 102) +#define RID_SW_TP_STD_FONT_CJK (RID_OFA_START + 247) +#define RID_SW_TP_STD_FONT_CTL (RID_OFA_START + 251) +#define RID_SW_TP_OPTLOAD_PAGE (RID_OFA_START + 214) +#define RID_SW_TP_CONTENT_OPT (RID_OFA_START + 206) +#define RID_SW_TP_OPTSHDWCRSR (RID_OFA_START + 211) +#define RID_SW_TP_STD_FONT (RID_OFA_START + 208) +#define RID_SW_TP_OPTPRINT_PAGE (RID_OFA_START + 209) +#define RID_SW_TP_OPTTABLE_PAGE (RID_OFA_START + 210) +#define RID_SW_TP_REDLINE_OPT (RID_OFA_START + 212) +#define RID_SW_TP_DOC_STAT (RID_OFA_START + 252) +#define RID_SW_TP_OPTCOMPATIBILITY_PAGE (RID_OFA_START + 255) +#define RID_SW_TP_COMPARISON_OPT (RID_OFA_START + 257) +#define RID_SW_TP_HTML_CONTENT_OPT (RID_OFA_START + 240) +#define RID_SW_TP_HTML_OPTPRINT_PAGE (RID_OFA_START + 242) +#define RID_SW_TP_HTML_OPTTABLE_PAGE (RID_OFA_START + 243) +#define RID_SW_TP_HTML_OPTGRID_PAGE (RID_OFA_START + 244) +#define RID_SW_TP_HTML_OPTSHDWCRSR (RID_OFA_START + 246) +#define RID_SW_TP_BACKGROUND (RID_OFA_START + 217) +#define RID_SW_TP_OPTCAPTION_PAGE (RID_OFA_START + 256) +#define SID_SC_TP_LAYOUT (RID_OFA_START + 218) +#define SID_SC_TP_CONTENT (RID_OFA_START + 219) +#define SID_SC_TP_GRID (RID_OFA_START + 221) +#define SID_SC_TP_USERLISTS (RID_OFA_START + 222) +#define SID_SC_TP_CALC (RID_OFA_START + 223) +#define SID_SC_TP_CHANGES (RID_OFA_START + 224) +#define RID_SC_TP_PRINT (RID_OFA_START + 248) +#define SID_SI_TP_PRINT (RID_OFA_START + 236) +#define SID_SI_TP_CONTENTS (RID_OFA_START + 232) +#define SID_SI_TP_SNAP (RID_OFA_START + 234) +#define SID_SI_TP_MISC (RID_OFA_START + 237) +#define SID_SD_TP_PRINT (RID_OFA_START + 220) +#define SID_SD_TP_CONTENTS (RID_OFA_START + 225) +#define SID_SD_TP_SNAP (RID_OFA_START + 227) +#define SID_SD_TP_MISC (RID_OFA_START + 231) +#define RID_SC_TP_DEFAULTS (RID_OFA_START + 253) +#define SID_SC_TP_STAT (RID_OFA_START + 254) + +// if we have _a_lot_ time, we should group the resource ids by type, instead +// of grouping them by semantics. The reason is that resource ids have to be +// unique relative to a fixed type (you can't have two dialogs with the same +// resource id), but they do not need to be unique globally (means you can have +// a dialog and a string, both with the same id) +// I suggest sticking to per-type ids instead of per-semantic ids, this is +// better maintainable (IMO), and does not waste that much ids + +// "ModalDialog" resource ids + +// TabPages -------------------------------------------------------------- + +#define RID_SW_TP_OPTTEST_PAGE (RID_OFA_START + 215) +#define SID_SC_TP_FORMULA (RID_OFA_START + 259) +#define SID_SC_TP_COMPATIBILITY (RID_OFA_START + 260) + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/dlgctl3d.hxx b/include/svx/dlgctl3d.hxx new file mode 100644 index 000000000..d43ab5f4c --- /dev/null +++ b/include/svx/dlgctl3d.hxx @@ -0,0 +1,184 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_DLGCTL3D_HXX +#define INCLUDED_SVX_DLGCTL3D_HXX + +#include +#include +#include +#include +#include +#include + +class FmFormModel; +class FmFormPage; +class E3dView; +class E3dObject; +class E3dScene; + +enum class SvxPreviewObjectType { SPHERE, CUBE }; + +class SAL_WARN_UNUSED SVX_DLLPUBLIC Svx3DPreviewControl : public weld::CustomWidgetController +{ +protected: + std::unique_ptr mpModel; + FmFormPage* mpFmPage; + std::unique_ptr mp3DView; + E3dScene* mpScene; + E3dObject* mp3DObj; + SvxPreviewObjectType mnObjectType; + + void Construct(); + +public: + Svx3DPreviewControl(); + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; + virtual ~Svx3DPreviewControl() override; + + virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override; + virtual bool MouseButtonDown( const MouseEvent& rMEvt ) override; + virtual void Resize() override; + + virtual void SetObjectType(SvxPreviewObjectType nType); + SvxPreviewObjectType GetObjectType() const { return mnObjectType; } + SfxItemSet const & Get3DAttributes() const; + virtual void Set3DAttributes(const SfxItemSet& rAttr); +}; + +class SAL_WARN_UNUSED SVX_DLLPUBLIC Svx3DLightControl final : public Svx3DPreviewControl +{ + // Callback for interactive changes + Link maChangeCallback; + Link maSelectionChangeCallback; + + // lights + sal_uInt32 maSelectedLight; + + // extra objects for light control + E3dObject* mpExpansionObject; + E3dObject* mpLampBottomObject; + E3dObject* mpLampShaftObject; + std::vector< E3dObject* > maLightObjects; + + // 3d rotations of object + double mfRotateX; + double mfRotateY; + double mfRotateZ; + + // interaction parameters + Point maActionStartPoint; + double mfSaveActionStartHor; + double mfSaveActionStartVer; + double mfSaveActionStartRotZ; + + bool mbMouseMoved : 1; + bool mbMouseCaptured : 1; + bool mbGeometrySelected : 1; + + void Construct2(); + void ConstructLightObjects(); + void AdaptToSelectedLight(); + void TrySelection(Point aPosPixel); + +public: + Svx3DLightControl(); + + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; + virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override; + virtual tools::Rectangle GetFocusRect() override; + virtual bool MouseButtonDown(const MouseEvent& rMEvt) override; + virtual bool MouseMove( const MouseEvent& rMEvt ) override; + virtual bool MouseButtonUp( const MouseEvent& rMEvt ) override; + virtual void Resize() override; + + virtual void SetObjectType(SvxPreviewObjectType nType) override; + + // register user callback + void SetChangeCallback(Link aNew) { maChangeCallback = aNew; } + void SetSelectionChangeCallback(Link aNew) { maSelectionChangeCallback = aNew; } + + // selection checks + bool IsSelectionValid(); + bool IsGeometrySelected() const { return mbGeometrySelected; } + + // get/set position of selected lamp in polar coordinates, Hor:[0..360.0[ and Ver:[-90..90] degrees + void GetPosition(double& rHor, double& rVer); + void SetPosition(double fHor, double fVer); + + // get/set rotation of 3D object + void SetRotation(double fRotX, double fRotY, double fRotZ); + void GetRotation(double& rRotX, double& rRotY, double& rRotZ); + + void SelectLight(sal_uInt32 nLightNumber); + virtual void Set3DAttributes(const SfxItemSet& rAttr) override; + sal_uInt32 GetSelectedLight() const { return maSelectedLight; } + + // light data access + bool GetLightOnOff(sal_uInt32 nNum) const; + Color GetLightColor(sal_uInt32 nNum) const; + basegfx::B3DVector GetLightDirection(sal_uInt32 nNum) const; +}; + +class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxLightCtl3D +{ + // local controls + Svx3DLightControl& mrLightControl; + weld::Scale& mrHorScroller; + weld::Scale& mrVerScroller; + weld::Button& mrSwitcher; + + // callback for interactive changes + Link maUserInteractiveChangeCallback; + Link maUserSelectionChangeCallback; + +public: + SvxLightCtl3D(Svx3DLightControl& rLightControl, weld::Scale& rHori, + weld::Scale& rVert, weld::Button& rButton); + ~SvxLightCtl3D(); + + // check the selection for validity + void CheckSelection(); + + // bring further settings to the outside world + Svx3DLightControl& GetSvx3DLightControl() { return mrLightControl; } + + // register user callback + void SetUserInteractiveChangeCallback(Link aNew) { maUserInteractiveChangeCallback = aNew; } + void SetUserSelectionChangeCallback(Link aNew) { maUserSelectionChangeCallback = aNew; } + +private: + + DECL_LINK(InternalInteractiveChange, Svx3DLightControl*, void); + DECL_LINK(InternalSelectionChange, Svx3DLightControl*, void); + DECL_LINK(ScrollBarMove, weld::Scale&, void); + DECL_LINK(ButtonPress, weld::Button&, void); + DECL_LINK(KeyInput, const KeyEvent&, bool); + DECL_LINK(FocusIn, weld::Widget&, void); + + // initialize local parameters + void Init(); + + void move( double fDeltaHor, double fDeltaVer ); +}; + + +#endif // _SCH_DLGCTL3D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/dlgctrl.hxx b/include/svx/dlgctrl.hxx new file mode 100644 index 000000000..d6d299849 --- /dev/null +++ b/include/svx/dlgctrl.hxx @@ -0,0 +1,412 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_DLGCTRL_HXX +#define INCLUDED_SVX_DLGCTRL_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace com::sun::star::awt { + struct Point; +} + +/************************************************************************* +|* Derived from SfxTabPage for being able to get notified through the +|* virtual method from the control. +\************************************************************************/ + +class SAL_WARN_UNUSED SvxTabPage : public SfxTabPage +{ + +public: + SvxTabPage(weld::Container* pPage, weld::DialogController* pController, const OUString& rUIXMLDescription, const OString& rID, const SfxItemSet &rAttrSet) + : SfxTabPage(pPage, pController, rUIXMLDescription, rID, &rAttrSet) + { + } + virtual void PointChanged(weld::DrawingArea* pArea, RectPoint eRP) = 0; +}; + +/************************************************************************* +|* Control for display and selection of the corner and center points of +|* an object +\************************************************************************/ + +enum class CTL_STATE +{ + NONE = 0, + NOHORZ = 1, // no horizontal input information is used + NOVERT = 2, // no vertical input information is used +}; +namespace o3tl +{ + template<> struct typed_flags : is_typed_flags {}; +} + +class SvxRectCtlAccessibleContext; +class SvxPixelCtlAccessible; + +class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxRectCtl : public weld::CustomWidgetController +{ +private: + SvxTabPage* m_pPage; + + SVX_DLLPRIVATE static void InitSettings(vcl::RenderContext& rRenderContext); + SVX_DLLPRIVATE void InitRectBitmap(); + SVX_DLLPRIVATE BitmapEx& GetRectBitmap(); + SVX_DLLPRIVATE void Resize_Impl(const Size& rSize); + + SvxRectCtl(const SvxRectCtl&) = delete; + SvxRectCtl& operator=(const SvxRectCtl&) = delete; + +protected: + rtl::Reference pAccContext; + sal_uInt16 nBorderWidth; + Point aPtLT, aPtMT, aPtRT; + Point aPtLM, aPtMM, aPtRM; + Point aPtLB, aPtMB, aPtRB; + Point aPtNew; + RectPoint eRP, eDefRP; + std::unique_ptr pBitmap; + CTL_STATE m_nState; + + bool mbCompleteDisable : 1; + + RectPoint GetRPFromPoint( Point, bool bRTL = false ) const; + const Point& GetPointFromRP( RectPoint ) const; + Point SetActualRPWithoutInvalidate( RectPoint eNewRP ); // returns the last point + + Point GetApproxLogPtFromPixPt( const Point& rRoughPixelPoint ) const; +public: + SvxRectCtl(SvxTabPage* pPage, RectPoint eRpt = RectPoint::MM, sal_uInt16 nBorder = 200); + void SetControlSettings(RectPoint eRpt, sal_uInt16 nBorder); + virtual ~SvxRectCtl() override; + + virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) override; + virtual void Resize() override; + virtual bool MouseButtonDown(const MouseEvent&) override; + virtual bool KeyInput(const KeyEvent&) override; + virtual void GetFocus() override; + virtual void LoseFocus() override; + virtual tools::Rectangle GetFocusRect() override; + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; + virtual void StyleUpdated() override; + + void Reset(); + RectPoint GetActualRP() const { return eRP;} + void SetActualRP( RectPoint eNewRP ); + + void SetState( CTL_STATE nState ); + + static const sal_uInt8 NO_CHILDREN = 9; // returns number of usable radio buttons + + tools::Rectangle CalculateFocusRectangle() const; + tools::Rectangle CalculateFocusRectangle( RectPoint eRectPoint ) const; + + css::uno::Reference getAccessibleParent() const { return GetDrawingArea()->get_accessible_parent(); } + virtual css::uno::Reference CreateAccessible() override; + a11yrelationset get_accessible_relation_set() const { return GetDrawingArea()->get_accessible_relation_set(); } + + RectPoint GetApproxRPFromPixPt( const css::awt::Point& rPixelPoint ) const; + + bool IsCompletelyDisabled() const { return mbCompleteDisable; } + void DoCompletelyDisable(bool bNew); +}; + +/************************************************************************* +|* Control for editing bitmaps +\************************************************************************/ + +class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxPixelCtl final : public weld::CustomWidgetController +{ +private: + static sal_uInt16 constexpr nLines = 8; + static sal_uInt16 constexpr nSquares = nLines * nLines; + + SvxTabPage* m_pPage; + + Color aPixelColor; + Color aBackgroundColor; + Size aRectSize; + std::array maPixelData; + bool bPaintable; + //Add member identifying position + Point aFocusPosition; + rtl::Reference m_xAccess; + + tools::Rectangle implCalFocusRect( const Point& aPosition ); + void ChangePixel( sal_uInt16 nPixel ); + + SvxPixelCtl(SvxPixelCtl const&) = delete; + SvxPixelCtl(SvxPixelCtl&&) = delete; + SvxPixelCtl& operator=(SvxPixelCtl const&) = delete; + SvxPixelCtl& operator=(SvxPixelCtl&&) = delete; + +public: + SvxPixelCtl(SvxTabPage* pPage); + + virtual ~SvxPixelCtl() override; + + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; + virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override; + virtual bool MouseButtonDown( const MouseEvent& rMEvt ) override; + virtual void Resize() override; + virtual tools::Rectangle GetFocusRect() override; + + void SetXBitmap( const BitmapEx& rBitmapEx ); + + void SetPixelColor( const Color& rCol ) { aPixelColor = rCol; } + void SetBackgroundColor( const Color& rCol ) { aBackgroundColor = rCol; } + + static sal_uInt16 GetLineCount() { return nLines; } + + sal_uInt8 GetBitmapPixel( const sal_uInt16 nPixelNumber ) const; + std::array const & GetBitmapPixelPtr() const { return maPixelData; } + + void SetPaintable( bool bTmp ) { bPaintable = bTmp; } + void Reset(); + + css::uno::Reference getAccessibleParent() const { return GetDrawingArea()->get_accessible_parent(); } + virtual css::uno::Reference CreateAccessible() override; + a11yrelationset get_accessible_relation_set() const { return GetDrawingArea()->get_accessible_relation_set(); } + + static long GetSquares() { return nSquares ; } + long GetWidth() const { return aRectSize.getWidth() ; } + long GetHeight() const { return aRectSize.getHeight() ; } + + //Device Pixel . + long ShowPosition( const Point &pt); + + long PointToIndex(const Point &pt) const; + Point IndexToPoint(long nIndex) const ; + long GetFocusPosIndex() const ; + //Keyboard function for key input and focus handling function + virtual bool KeyInput( const KeyEvent& rKEvt ) override; + virtual void GetFocus() override; + virtual void LoseFocus() override; +}; + +/************************************************************************/ + +class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxLineLB +{ +private: + std::unique_ptr m_xControl; + + /// defines if standard fields (none, solid) are added, default is true + bool mbAddStandardFields : 1; + +public: + SvxLineLB(std::unique_ptr pControl); + + void Fill(const XDashListRef &pList); + bool getAddStandardFields() const { return mbAddStandardFields; } + void setAddStandardFields(bool bNew); + + void Append(const XDashEntry& rEntry, const BitmapEx& rBitmap ); + void Modify(const XDashEntry& rEntry, sal_Int32 nPos, const BitmapEx& rBitmap ); + + void clear() { m_xControl->clear(); } + void remove(int nPos) { m_xControl->remove(nPos); } + int get_active() const { return m_xControl->get_active(); } + void set_active(int nPos) { m_xControl->set_active(nPos); } + void set_active_text(const OUString& rStr) { m_xControl->set_active_text(rStr); } + OUString get_active_text() const { return m_xControl->get_active_text(); } + void connect_changed(const Link& rLink) { m_xControl->connect_changed(rLink); } + int get_count() const { return m_xControl->get_count(); } + void append_text(const OUString& rStr) { m_xControl->append_text(rStr); } + bool get_value_changed_from_saved() const { return m_xControl->get_value_changed_from_saved(); } + void save_value() { m_xControl->save_value(); } + void set_sensitive(bool bSensitive) { m_xControl->set_sensitive(bSensitive); } + bool get_sensitive() const { return m_xControl->get_sensitive(); } +}; + +/************************************************************************/ + +class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxLineEndLB +{ +private: + std::unique_ptr m_xControl; + +public: + SvxLineEndLB(std::unique_ptr pControl); + + void Fill( const XLineEndListRef &pList, bool bStart = true ); + + void Append( const XLineEndEntry& rEntry, const BitmapEx& rBitmap ); + void Modify( const XLineEndEntry& rEntry, sal_Int32 nPos, const BitmapEx& rBitmap ); + + void clear() { m_xControl->clear(); } + void remove(int nPos) { m_xControl->remove(nPos); } + int get_active() const { return m_xControl->get_active(); } + void set_active(int nPos) { m_xControl->set_active(nPos); } + void set_active_text(const OUString& rStr) { m_xControl->set_active_text(rStr); } + OUString get_active_text() const { return m_xControl->get_active_text(); } + void connect_changed(const Link& rLink) { m_xControl->connect_changed(rLink); } + int get_count() const { return m_xControl->get_count(); } + void append_text(const OUString& rStr) { m_xControl->append_text(rStr); } + bool get_value_changed_from_saved() const { return m_xControl->get_value_changed_from_saved(); } + void save_value() { m_xControl->save_value(); } + void set_sensitive(bool bSensitive) { m_xControl->set_sensitive(bSensitive); } + bool get_sensitive() const { return m_xControl->get_sensitive(); } +}; + +class SdrObject; +class SdrPathObj; +class SdrModel; + +class SAL_WARN_UNUSED SAL_DLLPUBLIC_RTTI SvxPreviewBase : public weld::CustomWidgetController +{ +private: + std::unique_ptr mpModel; + VclPtr mpBufferDevice; + +protected: + void InitSettings(); + + tools::Rectangle GetPreviewSize() const; + + // prepare buffered paint + void LocalPrePaint(vcl::RenderContext const & rRenderContext); + + // end and output buffered paint + void LocalPostPaint(vcl::RenderContext& rRenderContext); + +public: + SvxPreviewBase(); + virtual void SetDrawingArea(weld::DrawingArea*) override; + virtual ~SvxPreviewBase() override; + + // change support + virtual void StyleUpdated() override; + + void SetDrawMode(DrawModeFlags nDrawMode) + { + mpBufferDevice->SetDrawMode(nDrawMode); + } + + Size GetOutputSize() const + { + return mpBufferDevice->PixelToLogic(GetOutputSizePixel()); + } + + // dada read access + SdrModel& getModel() const + { + return *mpModel; + } + OutputDevice& getBufferDevice() const + { + return *mpBufferDevice; + } +}; + + +/************************************************************************* +|* +|* SvxLinePreview +|* +\************************************************************************/ + +class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxXLinePreview final : public SvxPreviewBase +{ +private: + SdrPathObj* mpLineObjA; + SdrPathObj* mpLineObjB; + SdrPathObj* mpLineObjC; + + Graphic* mpGraphic; + bool mbWithSymbol; + Size maSymbolSize; + +public: + SvxXLinePreview(); + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; + virtual ~SvxXLinePreview() override; + + void SetLineAttributes(const SfxItemSet& rItemSet); + + void ShowSymbol( bool b ) { mbWithSymbol = b; }; + void SetSymbol( Graphic* p, const Size& s ); + void ResizeSymbol( const Size& s ); + + virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override; + virtual void Resize() override; +}; + +class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxXRectPreview final : public SvxPreviewBase +{ +private: + SdrObject* mpRectangleObject; + +public: + SvxXRectPreview(); + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; + virtual ~SvxXRectPreview() override; + + void SetAttributes(const SfxItemSet& rItemSet); + + virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override; + virtual void Resize() override; +}; + +/************************************************************************* +|* +|* SvxXShadowPreview +|* +\************************************************************************/ + +class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxXShadowPreview final : public SvxPreviewBase +{ +private: + Point maShadowOffset; + + SdrObject* mpRectangleObject; + SdrObject* mpRectangleShadow; + +public: + SvxXShadowPreview(); + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; + virtual ~SvxXShadowPreview() override; + + void SetRectangleAttributes(const SfxItemSet& rItemSet); + void SetShadowAttributes(const SfxItemSet& rItemSet); + void SetShadowPosition(const Point& rPos); + + virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override; +}; + +class SvxRelativeField; + +void limitWidthForSidebar(weld::SpinButton& rSpinButton); +SVX_DLLPUBLIC void limitWidthForSidebar(SvxRelativeField& rMetricSpinButton); +//tdf#130197 Give this toolbar a width as if it had 5 standard toolbutton entries +SVX_DLLPUBLIC void padWidthForSidebar(weld::Toolbar& rToolbar, const css::uno::Reference& rFrame); + +#endif // INCLUDED_SVX_DLGCTRL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/dlgutil.hxx b/include/svx/dlgutil.hxx new file mode 100644 index 000000000..0359321e4 --- /dev/null +++ b/include/svx/dlgutil.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_SVX_DLGUTIL_HXX +#define INCLUDED_SVX_DLGUTIL_HXX + +#include +#include +#include + +class SfxItemSet; + +SVXCORE_DLLPUBLIC FieldUnit GetModuleFieldUnit( const SfxItemSet& ); +SVXCORE_DLLPUBLIC FieldUnit GetModuleFieldUnit(); +SVXCORE_DLLPUBLIC bool GetApplyCharUnit( const SfxItemSet& ); + +constexpr DrawModeFlags OUTPUT_DRAWMODE_COLOR = DrawModeFlags::Default; +constexpr DrawModeFlags OUTPUT_DRAWMODE_CONTRAST = DrawModeFlags::SettingsLine | DrawModeFlags::SettingsFill | DrawModeFlags::SettingsText | DrawModeFlags::SettingsGradient; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/drawitem.hxx b/include/svx/drawitem.hxx new file mode 100644 index 000000000..21a7d334f --- /dev/null +++ b/include/svx/drawitem.hxx @@ -0,0 +1,201 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_DRAWITEM_HXX +#define INCLUDED_SVX_DRAWITEM_HXX + +#include +#include +#include + +class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC SvxColorListItem final : public SfxPoolItem +{ + XColorListRef pColorList; + +public: + static SfxPoolItem* CreateDefault(); + + SvxColorListItem(); + SvxColorListItem( XColorListRef const & pTable, + sal_uInt16 nWhich ); + SvxColorListItem( const SvxColorListItem& ); + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + + virtual bool operator==( const SfxPoolItem& ) const override; + virtual SvxColorListItem* Clone( SfxItemPool *pPool = nullptr ) const override; + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + const XColorListRef& GetColorList() const { return pColorList; } +}; + +class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC SvxGradientListItem final : public SfxPoolItem +{ + XGradientListRef pGradientList; + +public: + static SfxPoolItem* CreateDefault(); + + SvxGradientListItem(); + SvxGradientListItem( XGradientListRef const & pList, + sal_uInt16 nWhich ); + SvxGradientListItem( const SvxGradientListItem& ); + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + + virtual bool operator==( const SfxPoolItem& ) const override; + virtual SvxGradientListItem* Clone( SfxItemPool *pPool = nullptr ) const override; + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + const XGradientListRef& GetGradientList() const { return pGradientList; } +}; + +class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC SvxHatchListItem final : public SfxPoolItem +{ + XHatchListRef pHatchList; + +public: + static SfxPoolItem* CreateDefault(); + SvxHatchListItem(); + SvxHatchListItem( XHatchListRef const & pList, + sal_uInt16 nWhich ); + SvxHatchListItem( const SvxHatchListItem& ); + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + + virtual bool operator==( const SfxPoolItem& ) const override; + virtual SvxHatchListItem* Clone( SfxItemPool *pPool = nullptr ) const override; + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + const XHatchListRef& GetHatchList() const { return pHatchList; } +}; + +class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC SvxBitmapListItem final : public SfxPoolItem +{ + XBitmapListRef pBitmapList; + +public: + static SfxPoolItem* CreateDefault(); + + SvxBitmapListItem(); + SvxBitmapListItem( XBitmapListRef const & pBL, + sal_uInt16 nWhich ); + SvxBitmapListItem( const SvxBitmapListItem& ); + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + + virtual bool operator==( const SfxPoolItem& ) const override; + virtual SvxBitmapListItem* Clone( SfxItemPool *pPool = nullptr ) const override; + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + const XBitmapListRef& GetBitmapList() const { return pBitmapList; } +}; + +class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC SvxPatternListItem final : public SfxPoolItem +{ + XPatternListRef pPatternList; + +public: + static SfxPoolItem* CreateDefault(); + + SvxPatternListItem(); + SvxPatternListItem( XPatternListRef const & pBL, + sal_uInt16 nWhich ); + SvxPatternListItem( const SvxPatternListItem& ); + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + virtual bool operator==( const SfxPoolItem& ) const override; + virtual SvxPatternListItem* Clone( SfxItemPool *pPool = nullptr ) const override; + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + const XPatternListRef& GetPatternList() const { return pPatternList; } +}; + +class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC SvxDashListItem final : public SfxPoolItem +{ + XDashListRef pDashList; + +public: + static SfxPoolItem* CreateDefault(); + + SvxDashListItem(); + SvxDashListItem( XDashListRef const & pList, + sal_uInt16 nWhich ); + SvxDashListItem( const SvxDashListItem& ); + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + + virtual bool operator==( const SfxPoolItem& ) const override; + virtual SvxDashListItem* Clone( SfxItemPool *pPool = nullptr ) const override; + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + const XDashListRef& GetDashList() const { return pDashList; } +}; + +class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC SvxLineEndListItem final : public SfxPoolItem +{ + XLineEndListRef pLineEndList; + +public: + static SfxPoolItem* CreateDefault(); + + SvxLineEndListItem(); + SvxLineEndListItem( XLineEndListRef const & pList, + sal_uInt16 nWhich ); + SvxLineEndListItem( const SvxLineEndListItem& ); + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + + virtual bool operator==( const SfxPoolItem& ) const override; + virtual SvxLineEndListItem* Clone( SfxItemPool *pPool = nullptr ) const override; + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + const XLineEndListRef& GetLineEndList() const { return pLineEndList; } +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/dstribut_enum.hxx b/include/svx/dstribut_enum.hxx new file mode 100644 index 000000000..a69e6f10e --- /dev/null +++ b/include/svx/dstribut_enum.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_SVX_DSTRIBUT_ENUM_HXX +#define INCLUDED_SVX_DSTRIBUT_ENUM_HXX + +enum class SvxDistributeHorizontal +{ + NONE = 0, + Left, + Center, + Distance, + Right +}; + +enum class SvxDistributeVertical +{ + NONE = 0, + Top, + Center, + Distance, + Bottom +}; + +#endif // INCLUDED_SVX_DSTRIBUT_ENUM_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/e3ditem.hxx b/include/svx/e3ditem.hxx new file mode 100644 index 000000000..29e7636e6 --- /dev/null +++ b/include/svx/e3ditem.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_SVX_E3DITEM_HXX +#define INCLUDED_SVX_E3DITEM_HXX + +#include +#include +#include + +class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC SvxB3DVectorItem final : public SfxPoolItem +{ + basegfx::B3DVector aVal; + +public: + SvxB3DVectorItem( sal_uInt16 nWhich, const basegfx::B3DVector& rVal ); + SvxB3DVectorItem( const SvxB3DVectorItem& ); + virtual ~SvxB3DVectorItem() override; + + virtual bool operator==( const SfxPoolItem& ) const override; + virtual SvxB3DVectorItem* Clone( SfxItemPool *pPool = nullptr ) const override; + + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + const basegfx::B3DVector& GetValue() const { return aVal; } + + void dumpAsXml(xmlTextWriterPtr pWriter) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/e3dsceneupdater.hxx b/include/svx/e3dsceneupdater.hxx new file mode 100644 index 000000000..dd7954180 --- /dev/null +++ b/include/svx/e3dsceneupdater.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_SVX_E3DSCENEUPDATER_HXX +#define INCLUDED_SVX_E3DSCENEUPDATER_HXX + +#include +#include + +class SdrObject; +class E3dScene; + +namespace drawinglayer::geometry { + class ViewInformation3D; +} + +/** Helper for 3d object changes affecting 2d geometry + + This class is a helper to encapsulate 3D object changes which shall + change the scene's 2D geometry. E.g. when moving one 3D object in a + scene, the visualisation would not change since the scene's 2D + attributes are defined by its 2D object transformation and the + changed content would be projected to the same 2D bounds as + before. To reflect the fact that the 2D positions may 'change' for + the user's imagination, it is necessary to calculate a new 2D + object transformation of the scene (the SnapRect) using the old 3D + transformation stack and the possibly modified 3D content and to + use it. This is only desirable if changes to the scene's content + are intended to change the scene's 2D geometry attributes +*/ +class SVXCORE_DLLPUBLIC E3DModifySceneSnapRectUpdater +{ + // the scene which may be changed. This gets set to the outmost scene + // of the to-be-changed 3D object when the scene has a 3d transformation + // stack at construction time. In all other cases it's set to zero and + // no action needs to be taken + E3dScene* mpScene; + + // the 3d transformation stack at the time of construction, valid when + // mpScene is not zero + std::unique_ptr mpViewInformation3D; + +public: + // the constructor evaluates and sets the members at construction time + E3DModifySceneSnapRectUpdater(const SdrObject* mpObject); + + // the destructor will take action if mpScene is not zero and modify the + // 2D geometry of the target scene + ~E3DModifySceneSnapRectUpdater(); +}; + +#endif // INCLUDED_SVX_E3DSCENEUPDATER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/e3dundo.hxx b/include/svx/e3dundo.hxx new file mode 100644 index 000000000..9c0515b86 --- /dev/null +++ b/include/svx/e3dundo.hxx @@ -0,0 +1,107 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_E3DUNDO_HXX +#define INCLUDED_SVX_E3DUNDO_HXX + +#include +#include +#include +#include + +/************************************************************************\ +|* +|* Base class for all 3D undo actions. +|* +\************************************************************************/ +class SAL_WARN_UNUSED E3dUndoAction : public SdrUndoAction +{ + protected: + E3dObject& mrMy3DObj; + + public: + E3dUndoAction(E3dObject &r3DObj) + : SdrUndoAction(r3DObj.getSdrModelFromSdrObject()), + mrMy3DObj(r3DObj) + { + } + + virtual ~E3dUndoAction () override; + + virtual bool CanRepeat(SfxRepeatTarget&) const override; +}; + +/************************************************************************\ +|* +|* Undo for 3D rotation through the rotation matrices +|* +\************************************************************************/ +class SAL_WARN_UNUSED E3dRotateUndoAction final : public E3dUndoAction +{ +private: + basegfx::B3DHomMatrix maMyOldRotation; + basegfx::B3DHomMatrix maMyNewRotation; + +public: + E3dRotateUndoAction( + E3dObject& r3DObj, + const basegfx::B3DHomMatrix &aOldRotation, + const basegfx::B3DHomMatrix &aNewRotation) + : E3dUndoAction(r3DObj), + maMyOldRotation(aOldRotation), + maMyNewRotation(aNewRotation) + { + } + + virtual ~E3dRotateUndoAction () override; + + virtual void Undo() override; + virtual void Redo() override; +}; + +/************************************************************************\ +|* +|* Undo for 3D attributes (implemented using Set3DAttributes()) +|* +\************************************************************************/ +class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC E3dAttributesUndoAction final : public SdrUndoAction +{ +private: + using SdrUndoAction::Repeat; + + SdrObject& mrObject; + const SfxItemSet maNewSet; + const SfxItemSet maOldSet; + + public: + E3dAttributesUndoAction( + E3dObject& rInObject, + const SfxItemSet& rNewSet, + const SfxItemSet& rOldSet); + + virtual ~E3dAttributesUndoAction() override; + + virtual bool CanRepeat(SfxRepeatTarget& rView) const override; + virtual void Undo() override; + virtual void Redo() override; +}; + +#endif // INCLUDED_SVX_E3DUNDO_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/extedit.hxx b/include/svx/extedit.hxx new file mode 100644 index 000000000..0168068f6 --- /dev/null +++ b/include/svx/extedit.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/. + */ + +#ifndef INCLUDED_SVX_EXTEDIT_HXX +#define INCLUDED_SVX_EXTEDIT_HXX + +#include +#include +#include +#include + +class Graphic; +class GraphicObject; +class FileChangedChecker; + +class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC ExternalToolEdit +{ +protected: + OUString m_aFileName; + + ::std::unique_ptr m_pChecker; + +public: + + ExternalToolEdit(); + virtual ~ExternalToolEdit(); + + virtual void Update( Graphic& aGraphic ) = 0; + void Edit(GraphicObject const*const pGraphic); + + void StartListeningEvent(); + + static void HandleCloseEvent( ExternalToolEdit* pData ); +}; + +class FmFormView; +class SdrObject; + +class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC SdrExternalToolEdit final +: public ExternalToolEdit + ,public SfxListener +{ +private: + FmFormView* m_pView; + SdrObject* m_pObj; + + SAL_DLLPRIVATE virtual void Update(Graphic&) override; + SAL_DLLPRIVATE virtual void Notify(SfxBroadcaster&, const SfxHint&) override; + +public: + SdrExternalToolEdit( + FmFormView* pView, + SdrObject* pObj); +}; + +#endif diff --git a/include/svx/extrusionbar.hxx b/include/svx/extrusionbar.hxx new file mode 100644 index 000000000..eec86cebf --- /dev/null +++ b/include/svx/extrusionbar.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_SVX_EXTRUSIONBAR_HXX +#define INCLUDED_SVX_EXTRUSIONBAR_HXX + +#include +#include +#include + +class SfxViewShell; +class SdrView; + +/************************************************************************/ + +namespace svx +{ + +SVXCORE_DLLPUBLIC bool checkForSelectedCustomShapes( SdrView const * pSdrView, bool bOnlyExtruded ); + +class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC ExtrusionBar final : public SfxShell +{ +public: + SFX_DECL_INTERFACE(SVX_INTERFACE_EXTRUSION_BAR) + +private: + /// SfxInterface initializer. + static void InitInterface_Impl(); + +public: + ExtrusionBar(SfxViewShell* pViewShell); + virtual ~ExtrusionBar() override; + + static void execute( SdrView* pSdrView, SfxRequest const & rReq, SfxBindings& rBindings ); + static void getState( SdrView const * pSdrView, SfxItemSet& rSet ); +}; + +} + +#endif // INCLUDED_SVX_EXTRUSIONBAR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/f3dchild.hxx b/include/svx/f3dchild.hxx new file mode 100644 index 000000000..c43f74304 --- /dev/null +++ b/include/svx/f3dchild.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_SVX_F3DCHILD_HXX +#define INCLUDED_SVX_F3DCHILD_HXX + + +#include +#include + +/************************************************************************* +|* +|* Derived from SfxChildWindow as "container" for 3D Window +|* +\************************************************************************/ + +class SAL_WARN_UNUSED SVX_DLLPUBLIC Svx3DChildWindow final : public SfxChildWindow +{ + public: + Svx3DChildWindow( vcl::Window*, sal_uInt16, SfxBindings*, SfxChildWinInfo* ); + + SFX_DECL_CHILDWINDOW_WITHID(Svx3DChildWindow); +}; + +#endif // INCLUDED_SVX_F3DCHILD_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/fillctrl.hxx b/include/svx/fillctrl.hxx new file mode 100644 index 000000000..b896fdae7 --- /dev/null +++ b/include/svx/fillctrl.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_SVX_FILLCTRL_HXX +#define INCLUDED_SVX_FILLCTRL_HXX + +#include +#include +#include +#include +#include +#include + +class XFillStyleItem; +class XFillColorItem; +class XFillGradientItem; +class XFillHatchItem; +class XFillBitmapItem; +class FillControl; + +/************************************************************************* +|* +|* Class for surface attributes (controls and controller) +|* +\************************************************************************/ + +class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxFillToolBoxControl final : public SfxToolBoxControl +{ +private: + std::unique_ptr< XFillStyleItem > mpStyleItem; + std::unique_ptr< XFillColorItem > mpColorItem; + std::unique_ptr< XFillGradientItem > mpFillGradientItem; + std::unique_ptr< XFillHatchItem > mpHatchItem; + std::unique_ptr< XFillBitmapItem > mpBitmapItem; + + VclPtr mxFillControl; + weld::ComboBox* mpLbFillType; + weld::Toolbar* mpToolBoxColor; + weld::ComboBox* mpLbFillAttr; + + css::drawing::FillStyle meLastXFS; + sal_Int32 mnLastPosGradient; + sal_Int32 mnLastPosHatch; + sal_Int32 mnLastPosBitmap; + + DECL_LINK(SelectFillTypeHdl, weld::ComboBox&, void); + DECL_LINK(SelectFillAttrHdl, weld::ComboBox&, void); + +public: + SFX_DECL_TOOLBOX_CONTROL(); + + SvxFillToolBoxControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx); + virtual ~SvxFillToolBoxControl() override; + + virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState) override; + void Update(); + virtual VclPtr CreateItemWindow(vcl::Window* pParent) override; +}; + +class SAL_WARN_UNUSED FillControl final : public InterimItemWindow +{ +private: + friend class SvxFillToolBoxControl; + + std::unique_ptr mxLbFillType; + std::unique_ptr mxToolBoxColor; + std::unique_ptr mxColorDispatch; + std::unique_ptr mxLbFillAttr; + int mnTypeCurPos; + int mnAttrCurPos; + + DECL_LINK(AttrKeyInputHdl, const KeyEvent&, bool); + DECL_LINK(TypeKeyInputHdl, const KeyEvent&, bool); + DECL_LINK(ColorKeyInputHdl, const KeyEvent&, bool); + DECL_STATIC_LINK(FillControl, DumpAsPropertyTreeHdl, boost::property_tree::ptree&, void); + DECL_LINK(AttrFocusHdl, weld::Widget&, void); + DECL_LINK(TypeFocusHdl, weld::Widget&, void); + + void SetOptimalSize(); + + virtual void DataChanged(const DataChangedEvent& rDCEvt) override; + + static void ReleaseFocus_Impl(); + +public: + FillControl(vcl::Window* pParent, const css::uno::Reference& rFrame); + virtual void dispose() override; + virtual ~FillControl() override; + + virtual void GetFocus() override; +}; + +#endif // INCLUDED_SVX_FILLCTRL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/flagsdef.hxx b/include/svx/flagsdef.hxx new file mode 100644 index 000000000..750e5c932 --- /dev/null +++ b/include/svx/flagsdef.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_SVX_FLAGSDEF_HXX +#define INCLUDED_SVX_FLAGSDEF_HXX + +#include +#include + +// Border-Modes for SvxBorderTabPage +enum class SwBorderModes +{ + NONE = 0x00, + PARA = 0x01, + TABLE = 0x02, + FRAME = 0x04, +}; + +namespace o3tl +{ + template<> struct typed_flags : is_typed_flags {}; +} + +// flags for SvxBackgroundTabPage +enum class SvxBackgroundTabFlags +{ + NONE = 0x00, + SHOW_SELECTOR = 0x01, + SHOW_TBLCTL = 0x08, + SHOW_HIGHLIGHTING = 0x10, + SHOW_CHAR_BKGCOLOR = 0x20, +}; +namespace o3tl +{ + template<> struct typed_flags : is_typed_flags {}; +} + +// flags for SvxBorderTabPage +#define SVX_HIDESHADOWCTL 0x01 + +#define DISABLE_CASEMAP (sal_uInt16(0x0001)) +#define DISABLE_WORDLINE (sal_uInt16(0x0002)) +#define DISABLE_BLINK (sal_uInt16(0x0004)) +#define DISABLE_UNDERLINE_COLOR (sal_uInt16(0x0008)) + +#define DISABLE_LANGUAGE (sal_uInt16(0x0010)) +#define DISABLE_HIDE_LANGUAGE (sal_uInt16(0x0020)) + +// flags for SvxCharBasePage's child class +#define SVX_PREVIEW_CHARACTER 0x01 +// flags for SvxCharNamePage +#define SVX_RELATIVE_MODE 0x02 +// flags for SvxCharEffectsPage +#define SVX_ENABLE_FLASH 0x04 +#define SVX_ENABLE_CHAR_TRANSPARENCY 0x08 + + +// Default values for Number Format Category List and Preview +enum class SvxNumValCategory +{ + Standard = 0, + Percent, + Currency, + Date, + Time, + Scientific, + Fraction, + Boolean, + NoValue, + LAST = NoValue +}; +const o3tl::enumarray fSvxNumValConst = { + -1234.56789012345678, // SvxNumValCategory::Standard + -0.1295, // SvxNumValCategory::Percent + -1234.0, // SvxNumValCategory::Currency + 36525.5678935185, // SvxNumValCategory::Date + 36525.5678935185, // SvxNumValCategory::Time + 12345.67889, // SvxNumValCategory::Scientific + 123.456, // SvxNumValCategory::Fraction + 1.0, // SvxNumValCategory::Boolean + 0.0 // SvxNumValCategory::NoValue +}; + +enum SvxModeType +{ + SVX_PAGE_MODE_STANDARD, + SVX_PAGE_MODE_CENTER, + SVX_PAGE_MODE_PRESENTATION +}; + +// 1/2 cm in TWIPS +// Is also used for minimum size of LayFrms of any kind +#define MM50 283 //from original svx/inc/paragrph.hxx + +enum class TabulatorDisableFlags { + TypeLeft = 0x0001, + TypeRight = 0x0002, + TypeCenter = 0x0004, + TypeDecimal = 0x0008, + TypeMask = 0x000F, + + FillNone = 0x0010, + FillPoint = 0x0020, + FillDashLine = 0x0040, + FillSolidLine = 0x0080, + FillSpecial = 0x0100, + FillMask = 0x01F0 +}; +namespace o3tl { + template<> struct typed_flags : is_typed_flags {}; +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/float3d.hxx b/include/svx/float3d.hxx new file mode 100644 index 000000000..fb24c7fa1 --- /dev/null +++ b/include/svx/float3d.hxx @@ -0,0 +1,291 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_FLOAT3D_HXX +#define INCLUDED_SVX_FLOAT3D_HXX + +#include +#include +#include +#include +#include + +#include + + +enum class ViewType3D +{ + Geo = 1, + Representation, + Light, + Texture, + Material +}; + +class FmFormModel; +class Svx3DCtrlItem; +class SvxConvertTo3DItem; +class ColorListBox; + +struct Svx3DWinImpl; + +class SVX_DLLPUBLIC LightButton final +{ +public: + explicit LightButton(std::unique_ptr xButton); + + void switchLightOn(bool bOn); + bool isLightOn() const { return m_bLightOn;} + + bool get_active() const { return m_xButton->get_active(); } + void set_active(bool bActive) { m_xButton->set_active(bActive); } + + TriState get_state() const { return m_xButton->get_state(); } + void set_state(TriState eState) { m_xButton->set_state(eState); } + + weld::ToggleButton* get_widget() const { return m_xButton.get(); } + + void connect_clicked(const Link& rLink) + { + m_xButton->connect_clicked(rLink); + } + + bool get_prev_active() const { return m_bButtonPrevActive; } + void set_prev_active(bool bPrevActive) { m_bButtonPrevActive = bPrevActive; } + +private: + std::unique_ptr m_xButton; + bool m_bLightOn; + bool m_bButtonPrevActive; +}; + +class SAL_WARN_UNUSED SVX_DLLPUBLIC Svx3DWin final : public SfxDockingWindow +{ + friend class Svx3DChildWindow; + friend class Svx3DCtrlItem; + +private: + std::unique_ptr m_xBtnGeo; + std::unique_ptr m_xBtnRepresentation; + std::unique_ptr m_xBtnLight; + std::unique_ptr m_xBtnTexture; + std::unique_ptr m_xBtnMaterial; + std::unique_ptr m_xBtnUpdate; + std::unique_ptr m_xBtnAssign; + +// geometry + std::unique_ptr m_xFLGeometrie; + std::unique_ptr m_xFtPercentDiagonal; + std::unique_ptr m_xMtrPercentDiagonal; + std::unique_ptr m_xFtBackscale; + std::unique_ptr m_xMtrBackscale; + std::unique_ptr m_xFtEndAngle; + std::unique_ptr m_xMtrEndAngle; + std::unique_ptr m_xFtDepth; + std::unique_ptr m_xMtrDepth; + + std::unique_ptr m_xFLSegments; + std::unique_ptr m_xNumHorizontal; + std::unique_ptr m_xNumVertical; + + std::unique_ptr m_xFLNormals; + std::unique_ptr m_xBtnNormalsObj; + std::unique_ptr m_xBtnNormalsFlat; + std::unique_ptr m_xBtnNormalsSphere; + std::unique_ptr m_xBtnNormalsInvert; + std::unique_ptr m_xBtnTwoSidedLighting; + std::unique_ptr m_xBtnDoubleSided; + +// presentation + std::unique_ptr m_xFLRepresentation; + std::unique_ptr m_xLbShademode; + + std::unique_ptr m_xFLShadow; + std::unique_ptr m_xBtnShadow3d; + std::unique_ptr m_xFtSlant; + std::unique_ptr m_xMtrSlant; + + std::unique_ptr m_xFLCamera; + std::unique_ptr m_xMtrDistance; + std::unique_ptr m_xMtrFocalLength; + +// lighting + std::unique_ptr m_xFLLight; + std::unique_ptr m_xBtnLight1; + std::unique_ptr m_xBtnLight2; + std::unique_ptr m_xBtnLight3; + std::unique_ptr m_xBtnLight4; + std::unique_ptr m_xBtnLight5; + std::unique_ptr m_xBtnLight6; + std::unique_ptr m_xBtnLight7; + std::unique_ptr m_xBtnLight8; + std::unique_ptr m_xLbLight1; + std::unique_ptr m_xLbLight2; + std::unique_ptr m_xLbLight3; + std::unique_ptr m_xLbLight4; + std::unique_ptr m_xLbLight5; + std::unique_ptr m_xLbLight6; + std::unique_ptr m_xLbLight7; + std::unique_ptr m_xLbLight8; + std::unique_ptr m_xBtnLightColor; + std::unique_ptr m_xLbAmbientlight; // ListBox + std::unique_ptr m_xBtnAmbientColor; // color button + +// Textures + std::unique_ptr m_xFLTexture; + std::unique_ptr m_xBtnTexLuminance; + std::unique_ptr m_xBtnTexColor; + std::unique_ptr m_xBtnTexReplace; + std::unique_ptr m_xBtnTexModulate; + std::unique_ptr m_xBtnTexBlend; + std::unique_ptr m_xBtnTexObjectX; + std::unique_ptr m_xBtnTexParallelX; + std::unique_ptr m_xBtnTexCircleX; + std::unique_ptr m_xBtnTexObjectY; + std::unique_ptr m_xBtnTexParallelY; + std::unique_ptr m_xBtnTexCircleY; + std::unique_ptr m_xBtnTexFilter; + +// material +// material editor + std::unique_ptr m_xFLMaterial; + std::unique_ptr m_xLbMatFavorites; + std::unique_ptr m_xLbMatColor; + std::unique_ptr m_xBtnMatColor; + std::unique_ptr m_xLbMatEmission; + std::unique_ptr m_xBtnEmissionColor; + + std::unique_ptr m_xFLMatSpecular; + std::unique_ptr m_xLbMatSpecular; + std::unique_ptr m_xBtnSpecularColor; + std::unique_ptr m_xMtrMatSpecularIntensity; + + std::unique_ptr m_xCtlPreview; + std::unique_ptr m_xCtlPreviewWin; + + std::unique_ptr m_xLightPreviewGrid; + std::unique_ptr m_xHoriScale; + std::unique_ptr m_xVertScale; + std::unique_ptr m_xBtn_Corner; + std::unique_ptr m_xLightPreview; + std::unique_ptr m_xCtlLightPreviewWin; + std::unique_ptr m_xCtlLightPreview; + +// bottom part + std::unique_ptr m_xBtnConvertTo3D; + std::unique_ptr m_xBtnLatheObject; + std::unique_ptr m_xBtnPerspective; + +// the rest ... + bool bUpdate; + ViewType3D eViewType; + + // Model, Page, View etc. for favourites + std::unique_ptr pModel; + + SfxBindings* pBindings; + std::unique_ptr pControllerItem; + + std::unique_ptr pConvertTo3DItem; + std::unique_ptr pConvertTo3DLatheItem; + + std::unique_ptr mpImpl; + MapUnit ePoolUnit; + FieldUnit eFUnit; + + // ItemSet used to remember set 2d attributes + std::unique_ptr mpRemember2DAttributes; + + DECL_LINK( ClickViewTypeHdl, weld::Button&, void ); + DECL_LINK( ClickUpdateHdl, weld::ToggleButton&, void ); + DECL_LINK( ClickAssignHdl, weld::Button&, void ); + DECL_LINK( ClickHdl, weld::Button&, void ); + DECL_LINK( ClickColorHdl, weld::Button&, void ); + DECL_LINK( SelectHdl, weld::ComboBox&, void ); + DECL_LINK( SelectColorHdl, ColorListBox&, void ); + DECL_LINK( ModifyMetricHdl, weld::MetricSpinButton&, void ); + DECL_LINK( ModifySpinHdl, weld::SpinButton&, void ); + void ClickLight(const LightButton& rBtn); + + DECL_LINK( ChangeSelectionCallbackHdl, SvxLightCtl3D*, void ); + + SVX_DLLPRIVATE void Construct(); + SVX_DLLPRIVATE void Reset(); + + SVX_DLLPRIVATE static void LBSelectColor( ColorListBox* pLb, const Color& rColor ); + SVX_DLLPRIVATE sal_uInt16 GetLightSource( const LightButton* pBtn ); + SVX_DLLPRIVATE ColorListBox* GetCLbByButton( const LightButton* pBtn = nullptr ); + SVX_DLLPRIVATE LightButton* GetLbByButton( const weld::Button* pBtn ); + + virtual void Resize() override; + +public: + Svx3DWin( SfxBindings* pBindings, SfxChildWindow *pCW, + vcl::Window* pParent ); + virtual ~Svx3DWin() override; + virtual void dispose() override; + + void InitColorLB(); + bool IsUpdateMode() const { return bUpdate; } + + void Update( SfxItemSet const & rSet ); + void GetAttr( SfxItemSet& rSet ); + + void UpdatePreview(); // upward (private) + void DocumentReload(); +}; + +/************************************************************************* +|* +|* Controller item for 3D Window (Floating/Docking) +|* +\************************************************************************/ + +class Svx3DCtrlItem : public SfxControllerItem +{ + protected: + virtual void StateChanged( sal_uInt16 nSId, SfxItemState eState, + const SfxPoolItem* pState ) override; + + public: + Svx3DCtrlItem( sal_uInt16, SfxBindings* ); +}; + +/************************************************************************* +|* +|* ControllerItem for State of a Slot +|* (SID_CONVERT_TO_3D, SID_CONVERT_TO_3D_LATHE_FAST) +|* +\************************************************************************/ + +class SvxConvertTo3DItem : public SfxControllerItem +{ + bool bState; + +protected: + virtual void StateChanged(sal_uInt16 nSId, SfxItemState eState, const SfxPoolItem* pState) override; + +public: + SvxConvertTo3DItem(sal_uInt16 nId, SfxBindings* pBindings); + bool GetState() const { return bState; } +}; + +#endif // INCLUDED_SVX_FLOAT3D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/fmdmod.hxx b/include/svx/fmdmod.hxx new file mode 100644 index 000000000..d5447879e --- /dev/null +++ b/include/svx/fmdmod.hxx @@ -0,0 +1,39 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_FMDMOD_HXX +#define INCLUDED_SVX_FMDMOD_HXX + +#include +#include + +class SVXCORE_DLLPUBLIC SvxFmMSFactory : public SvxUnoDrawMSFactory +{ + +public: + SvxFmMSFactory() {}; + + virtual ~SvxFmMSFactory() {} + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstance(const OUString& ServiceSpecifier) override; + virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames() override; +}; + +#endif // INCLUDED_SVX_FMDMOD_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/fmdpage.hxx b/include/svx/fmdpage.hxx new file mode 100644 index 000000000..e1bfb4089 --- /dev/null +++ b/include/svx/fmdpage.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_SVX_FMDPAGE_HXX +#define INCLUDED_SVX_FMDPAGE_HXX + +#include +#include +#include +#include + + +// SvxFmDrawPage + +class SVXCORE_DLLPUBLIC SvxFmDrawPage :public SvxDrawPage + ,public css::form::XFormsSupplier2 +{ +protected: + + // Creating a SdrObject based on a Description. Can be used by derived classes to + // support own css::drawing::Shapes (for example Controls) + virtual SdrObject *CreateSdrObject_( const css::uno::Reference< css::drawing::XShape > & xShape ) override; + + // The following method is called when a SvxShape object should be created. + // Derived classes can create a derivation or an object aggregating SvxShape. + virtual css::uno::Reference< css::drawing::XShape > CreateShape( SdrObject *pObj ) const override; + +public: + SvxFmDrawPage( SdrPage* pPage ); + virtual ~SvxFmDrawPage() throw () override; + + // UNO binding + DECLARE_UNO3_AGG_DEFAULTS(SvxFmDrawPage, SvxDrawPage) + + virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type& aType ) override; + virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override; + + virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; + + // XFormsSupplier + virtual css::uno::Reference< css::container::XNameContainer > SAL_CALL getForms() override; + + // XFormsSupplier2 + virtual sal_Bool SAL_CALL hasForms() override; +}; + +#endif // INCLUDED_SVX_FMDPAGE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/fmglob.hxx b/include/svx/fmglob.hxx new file mode 100644 index 000000000..35f3460f1 --- /dev/null +++ b/include/svx/fmglob.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_SVX_FMGLOB_HXX +#define INCLUDED_SVX_FMGLOB_HXX + +#include + +const sal_uInt16 OBJ_FM_CONTROL = css::form::FormComponentType::CONTROL; + // for form components +const sal_uInt16 OBJ_FM_EDIT = css::form::FormComponentType::TEXTFIELD; +const sal_uInt16 OBJ_FM_BUTTON = css::form::FormComponentType::COMMANDBUTTON; +const sal_uInt16 OBJ_FM_FIXEDTEXT = css::form::FormComponentType::FIXEDTEXT; +const sal_uInt16 OBJ_FM_LISTBOX = css::form::FormComponentType::LISTBOX; +const sal_uInt16 OBJ_FM_CHECKBOX = css::form::FormComponentType::CHECKBOX; +const sal_uInt16 OBJ_FM_COMBOBOX = css::form::FormComponentType::COMBOBOX; +const sal_uInt16 OBJ_FM_RADIOBUTTON = css::form::FormComponentType::RADIOBUTTON; +const sal_uInt16 OBJ_FM_GROUPBOX = css::form::FormComponentType::GROUPBOX; +const sal_uInt16 OBJ_FM_GRID = css::form::FormComponentType::GRIDCONTROL; +const sal_uInt16 OBJ_FM_IMAGEBUTTON = css::form::FormComponentType::IMAGEBUTTON; +const sal_uInt16 OBJ_FM_FILECONTROL = css::form::FormComponentType::FILECONTROL; +const sal_uInt16 OBJ_FM_DATEFIELD = css::form::FormComponentType::DATEFIELD; +const sal_uInt16 OBJ_FM_TIMEFIELD = css::form::FormComponentType::TIMEFIELD; +const sal_uInt16 OBJ_FM_NUMERICFIELD = css::form::FormComponentType::NUMERICFIELD; +const sal_uInt16 OBJ_FM_CURRENCYFIELD = css::form::FormComponentType::CURRENCYFIELD; +const sal_uInt16 OBJ_FM_PATTERNFIELD = css::form::FormComponentType::PATTERNFIELD; +const sal_uInt16 OBJ_FM_HIDDEN = css::form::FormComponentType::HIDDENCONTROL; +const sal_uInt16 OBJ_FM_IMAGECONTROL = css::form::FormComponentType::IMAGECONTROL; +const sal_uInt16 OBJ_FM_FORMATTEDFIELD = css::form::FormComponentType::PATTERNFIELD + 1; +const sal_uInt16 OBJ_FM_SCROLLBAR = css::form::FormComponentType::PATTERNFIELD + 2; +const sal_uInt16 OBJ_FM_SPINBUTTON = css::form::FormComponentType::PATTERNFIELD + 3; +const sal_uInt16 OBJ_FM_NAVIGATIONBAR = css::form::FormComponentType::PATTERNFIELD + 4; + +#endif // _FM_FMGLOB_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/fmgridcl.hxx b/include/svx/fmgridcl.hxx new file mode 100644 index 000000000..2483a4a5f --- /dev/null +++ b/include/svx/fmgridcl.hxx @@ -0,0 +1,199 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_FMGRIDCL_HXX +#define INCLUDED_SVX_FMGRIDCL_HXX + +#include +#include +#include +#include + +namespace com::sun::star::beans { class XPropertySet; } +namespace com::sun::star::container { class XIndexContainer; } +namespace com::sun::star::container { class XNameAccess; } + +// FmGridHeader + +struct FmGridHeaderData; +class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC FmGridHeader + :public ::svt::EditBrowserHeader + ,public DropTargetHelper +{ +protected: + std::unique_ptr m_pImpl; + +public: + FmGridHeader( BrowseBox* pParent, WinBits nWinBits = WB_STDHEADERBAR | WB_DRAG ); + virtual ~FmGridHeader() override; + virtual void dispose() override; + +public: + // trigger context menu execution + void triggerColumnContextMenu( const ::Point& _rPreferredPos ); + +protected: + virtual void Command( const CommandEvent& rCEvt ) override; + virtual void RequestHelp( const HelpEvent& rHEvt ) override; + virtual void Select() override; + + /** the value returned by GetItemPos is meaningless for the grid model if there are hidden columns, + so use GetModelColumnPos instead + */ + sal_uInt16 GetModelColumnPos(sal_uInt16 nId) const; + + /** This is called before executing a context menu for a column. rMenu contains the initial entries + handled by this base class' method (which always has to be called). + Derived classes may alter the menu in any way and handle any additional entries in + PostExecuteColumnContextMenu. + All disabled entries will be removed before executing the menu, so be careful with separators + near entries you probably wish to disable ... + */ + virtual void PreExecuteColumnContextMenu(sal_uInt16 nColId, PopupMenu& rMenu); + /** After executing the context menu for a column this method is called. + */ + virtual void PostExecuteColumnContextMenu(sal_uInt16 nColId, const PopupMenu& rMenu, sal_uInt16 nExecutionResult); + + // DropTargetHelper + virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) override; + virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) override; + + /** selects the column at the selection supplier. + @param nColumnId + The column id. + */ + void notifyColumnSelect(sal_uInt16 nColumnId); +private: + DECL_LINK( OnAsyncExecuteDrop, void*, void ); +}; + + +// FmGridControl + +class FmXGridPeer; +class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC FmGridControl : public DbGridControl + +{ + friend class FmGridHeader; + friend class FmXGridPeer; + + FmXGridPeer* m_pPeer; + sal_Int32 m_nCurrentSelectedColumn; // this is the column model (not the view) position... + sal_uInt16 m_nMarkedColumnId; + bool m_bSelecting; + bool m_bInColumnMove : 1; + +public: + FmGridControl( + const css::uno::Reference< css::uno::XComponentContext >&, + vcl::Window* pParent, + FmXGridPeer* _pPeer, + WinBits nBits); + + // Window + virtual void KeyInput( const KeyEvent& rKEvt ) override; + + // css::beans::XPropertyChangeListener + void propertyChange(const css::beans::PropertyChangeEvent& evt); + + // css::form::XPositioningListener + void positioned(); + + // XBound + bool commit(); + + // css::form::XInsertListener + void inserted(); + + void markColumn(sal_uInt16 nId); + bool isColumnMarked(sal_uInt16 nId) const; + + sal_Int32 GetSelectedColumn() const { return m_nCurrentSelectedColumn;} + + /** return the name of the specified object. + @param eObjType + The type to ask for + @param _nPosition + The position of a tablecell (index position), header bar column/row cell + @return + The name of the specified object. + */ + virtual OUString GetAccessibleObjectName( ::vcl::AccessibleBrowseBoxObjType eObjType,sal_Int32 _nPosition = -1) const override; + + /** return the description of the specified object. + @param eObjType + The type to ask for + @param _nPosition + The position of a tablecell (index position), header bar column/row cell + @return + The description of the specified object. + */ + virtual OUString GetAccessibleObjectDescription( ::vcl::AccessibleBrowseBoxObjType eObjType,sal_Int32 _nPosition = -1) const override; + +protected: + virtual void Command(const CommandEvent& rEvt) override; + + virtual VclPtr imp_CreateHeaderBar(BrowseBox* pParent) override; + virtual long QueryMinimumRowHeight() override; + virtual void RowHeightChanged() override; + virtual void ColumnResized(sal_uInt16 nId) override; + virtual void ColumnMoved(sal_uInt16 nId) override; + virtual void DeleteSelectedRows() override; + virtual void SetDesignMode(bool bMode) override; + virtual void CellModified() override; + virtual void HideColumn(sal_uInt16 nId) override; + virtual void ShowColumn(sal_uInt16 nId) override; + + bool IsInColumnMove() const {return m_bInColumnMove;} + + virtual void BeginCursorAction() override; + virtual void EndCursorAction() override; + virtual void Select() override; + + // Initialize columns + // a.) only by column description + void InitColumnsByModels(const css::uno::Reference< css::container::XIndexContainer >& xColumns); + // b.) during alivemode by database fields + virtual void InitColumnsByFields(const css::uno::Reference< css::container::XIndexAccess >& xFields) override; + + // some kind of impl version (for one single column) of our version of InitColumnsByFields + static void InitColumnByField( + DbGridColumn* _pColumn, + const css::uno::Reference< css::beans::XPropertySet >& _rxColumnModel, + const css::uno::Reference< css::container::XNameAccess >& _rxFieldsByNames, + const css::uno::Reference< css::container::XIndexAccess >& _rxFieldsByIndex + ); + + FmXGridPeer* GetPeer() const {return m_pPeer;} + + css::uno::Sequence< css::uno::Any> + getSelectionBookmarks(); + bool selectBookmarks(const css::uno::Sequence< css::uno::Any>& _rBookmarks); + + /** returns if a column is selected + @param _pColumn + The column to compare with. + @return + if the column is selected, otherwise + */ + bool isColumnSelected(DbGridColumn const * _pColumn); +}; + +#endif // INCLUDED_SVX_FMGRIDCL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/fmgridif.hxx b/include/svx/fmgridif.hxx new file mode 100644 index 000000000..1e7857dfb --- /dev/null +++ b/include/svx/fmgridif.hxx @@ -0,0 +1,533 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_FMGRIDIF_HXX +#define INCLUDED_SVX_FMGRIDIF_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 + +namespace com::sun::star::beans { class XPropertySet; } +namespace com::sun::star::uno { class XComponentContext; } + +class DbGridColumn; +enum class DbGridControlNavigationBarState; + +class SAL_WARN_UNUSED OWeakSubObject : public ::cppu::OWeakObject +{ +protected: + ::cppu::OWeakObject& m_rParent; + +public: + OWeakSubObject(::cppu::OWeakObject& rParent) : m_rParent(rParent) { } + + virtual void SAL_CALL acquire() throw() override { m_rParent.acquire(); } + virtual void SAL_CALL release() throw() override { m_rParent.release(); } +}; + + +// FmXModifyMultiplexer + +class SAL_WARN_UNUSED FmXModifyMultiplexer final : public OWeakSubObject + ,public ::comphelper::OInterfaceContainerHelper2 + ,public css::util::XModifyListener +{ +public: + FmXModifyMultiplexer( ::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex ); + DECLARE_UNO3_DEFAULTS(FmXModifyMultiplexer,OWeakSubObject) + virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override; + +// css::lang::XEventListener + virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override; + +// css::util::XModifyListener + virtual void SAL_CALL modified(const css::lang::EventObject& Source) override; + +// resolve ambiguity : both OWeakObject and OInterfaceContainerHelper2 have these memory operators + using OWeakSubObject::operator new; + using OWeakSubObject::operator delete; +}; + + +// FmXUpdateMultiplexer + +class SAL_WARN_UNUSED FmXUpdateMultiplexer final : public OWeakSubObject, + public ::comphelper::OInterfaceContainerHelper2, + public css::form::XUpdateListener +{ +public: + FmXUpdateMultiplexer( ::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex ); + DECLARE_UNO3_DEFAULTS(FmXUpdateMultiplexer,OWeakSubObject) + + virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override; + +// css::lang::XEventListener + virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override; + +// css::form::XUpdateListener + virtual sal_Bool SAL_CALL approveUpdate(const css::lang::EventObject &) override; + virtual void SAL_CALL updated(const css::lang::EventObject &) override; + +// resolve ambiguity : both OWeakObject and OInterfaceContainerHelper2 have these memory operators + using OWeakSubObject::operator new; + using OWeakSubObject::operator delete; +}; + + +// FmXSelectionMultiplexer + +class SAL_WARN_UNUSED FmXSelectionMultiplexer final : public OWeakSubObject + ,public ::comphelper::OInterfaceContainerHelper2 + ,public css::view::XSelectionChangeListener +{ +public: + FmXSelectionMultiplexer( ::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex ); + DECLARE_UNO3_DEFAULTS(FmXSelectionMultiplexer, OWeakSubObject) + + virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override; + +// css::lang::XEventListener + virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override; + +// css::view::XSelectionChangeListener + virtual void SAL_CALL selectionChanged( const css::lang::EventObject& aEvent ) override; + +// resolve ambiguity : both OWeakObject and OInterfaceContainerHelper2 have these memory operators + using OWeakSubObject::operator new; + using OWeakSubObject::operator delete; +}; + + +// FmXGridControlMultiplexer + +class SAL_WARN_UNUSED FmXGridControlMultiplexer final : public OWeakSubObject + ,public ::comphelper::OInterfaceContainerHelper2 + ,public css::form::XGridControlListener +{ +public: + FmXGridControlMultiplexer( ::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex ); + DECLARE_UNO3_DEFAULTS( FmXGridControlMultiplexer, OWeakSubObject ) + + virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override; + +// css::lang::XEventListener + virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override; + +// css::view::XSelectionChangeListener + virtual void SAL_CALL columnChanged( const css::lang::EventObject& _event ) override; + +// resolve ambiguity : both OWeakObject and OInterfaceContainerHelper2 have these memory operators + using OWeakSubObject::operator new; + using OWeakSubObject::operator delete; +}; + + +// FmXContainerMultiplexer + +class SAL_WARN_UNUSED FmXContainerMultiplexer final : public OWeakSubObject, + public ::comphelper::OInterfaceContainerHelper2, + public css::container::XContainerListener +{ +public: + FmXContainerMultiplexer( ::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex); + DECLARE_UNO3_DEFAULTS(FmXContainerMultiplexer,OWeakSubObject) + virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) override; + +// css::lang::XEventListener + virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override; + +// css::container::XContainerListener + virtual void SAL_CALL elementInserted(const css::container::ContainerEvent& Event) override; + virtual void SAL_CALL elementRemoved(const css::container::ContainerEvent& Event) override; + virtual void SAL_CALL elementReplaced(const css::container::ContainerEvent& Event) override; + +// resolve ambiguity : both OWeakObject and OInterfaceContainerHelper2 have these memory operators + using OWeakSubObject::operator new; + using OWeakSubObject::operator delete; +}; + + +// FmXGridControl + +typedef ::cppu::ImplHelper10< css::form::XBoundComponent, + css::form::XGridControl, + css::util::XModifyBroadcaster, + css::container::XIndexAccess, + css::container::XEnumerationAccess, + css::util::XModeSelector, + css::container::XContainer, + css::frame::XDispatchProvider, + css::frame::XDispatchProviderInterception, + css::view::XSelectionSupplier + > FmXGridControl_BASE; + +class FmXGridPeer; +class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC FmXGridControl :public UnoControl + ,public FmXGridControl_BASE +{ + FmXModifyMultiplexer m_aModifyListeners; + FmXUpdateMultiplexer m_aUpdateListeners; + FmXContainerMultiplexer m_aContainerListeners; + FmXSelectionMultiplexer m_aSelectionListeners; + FmXGridControlMultiplexer m_aGridControlListeners; + +protected: + bool m_bInDraw; + + css::uno::Reference< css::uno::XComponentContext > m_xContext; + +public: + FmXGridControl(const css::uno::Reference< css::uno::XComponentContext >&); + virtual ~FmXGridControl() override; + + // UNO binding + DECLARE_UNO3_AGG_DEFAULTS(FmXGridControl, UnoControl) + virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type& _rType) override; + +// XTypeProvider + virtual css::uno::Sequence< css::uno::Type> SAL_CALL getTypes( ) override; + virtual css::uno::Sequence SAL_CALL getImplementationId( ) override; + +// css::lang::XComponent + virtual void SAL_CALL dispose() override; + +// css::lang::XServiceInfo + virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; + virtual OUString SAL_CALL getImplementationName() override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; + +// css::awt::XControl + virtual void SAL_CALL createPeer(const css::uno::Reference< css::awt::XToolkit >& _rToolkit, const css::uno::Reference< css::awt::XWindowPeer >& Parent) override; + virtual sal_Bool SAL_CALL setModel(const css::uno::Reference< css::awt::XControlModel >& Model) override; + virtual void SAL_CALL setDesignMode(sal_Bool bOn) override; + +// css::awt::XView + virtual void SAL_CALL draw( sal_Int32 x, sal_Int32 y ) override; + +// css::form::XBoundComponent + virtual void SAL_CALL addUpdateListener(const css::uno::Reference< css::form::XUpdateListener >& l) override; + virtual void SAL_CALL removeUpdateListener(const css::uno::Reference< css::form::XUpdateListener >& l) override; + virtual sal_Bool SAL_CALL commit() override; + +// css::container::XElementAccess + virtual css::uno::Type SAL_CALL getElementType( ) override; + virtual sal_Bool SAL_CALL hasElements( ) override; + +// css::container::XEnumerationAccess + virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override; + +// css::container::XIndexAccess + virtual sal_Int32 SAL_CALL getCount() override; + virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 _rIndex) override; + +// css::form::XGridControl + virtual void SAL_CALL addGridControlListener( const css::uno::Reference< css::form::XGridControlListener >& _listener ) override; + virtual void SAL_CALL removeGridControlListener( const css::uno::Reference< css::form::XGridControlListener >& _listener ) override; + +// css::form::XGrid (base of XGridControl) + virtual sal_Int16 SAL_CALL getCurrentColumnPosition() override; + virtual void SAL_CALL setCurrentColumnPosition(sal_Int16 nPos) override; + +// css::form::XGridFieldDataSupplier (base of XGridControl) + virtual css::uno::Sequence< sal_Bool > SAL_CALL queryFieldDataType( const css::uno::Type& xType ) override; + virtual css::uno::Sequence< css::uno::Any > SAL_CALL queryFieldData( sal_Int32 nRow, const css::uno::Type& xType ) override; + +// UnoControl + virtual OUString GetComponentServiceName() override; + +// css::util::XModifyBroadcaster + virtual void SAL_CALL addModifyListener(const css::uno::Reference< css::util::XModifyListener >& l) override; + virtual void SAL_CALL removeModifyListener(const css::uno::Reference< css::util::XModifyListener >& l) override; + +// css::util::XModeSelector + virtual void SAL_CALL setMode(const OUString& Mode) override; + virtual OUString SAL_CALL getMode() override; + virtual css::uno::Sequence< OUString> SAL_CALL getSupportedModes() override; + virtual sal_Bool SAL_CALL supportsMode(const OUString& Mode) override; + +// css::container::XContainer + virtual void SAL_CALL addContainerListener(const css::uno::Reference< css::container::XContainerListener >& l) override; + virtual void SAL_CALL removeContainerListener(const css::uno::Reference< css::container::XContainerListener >& l) override; + +// css::frame::XDispatchProvider + virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch(const css::util::URL& aURL, const OUString& aTargetFrameName, sal_Int32 nSearchFlags) override; + virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches(const css::uno::Sequence< css::frame::DispatchDescriptor >& aDescripts) override; + +// css::frame::XDispatchProviderInterception + virtual void SAL_CALL registerDispatchProviderInterceptor(const css::uno::Reference< css::frame::XDispatchProviderInterceptor >& xInterceptor) override; + virtual void SAL_CALL releaseDispatchProviderInterceptor(const css::uno::Reference< css::frame::XDispatchProviderInterceptor >& xInterceptor) override; + +// css::view::XSelectionSupplier + virtual sal_Bool SAL_CALL select( const css::uno::Any& aSelection ) override; + virtual css::uno::Any SAL_CALL getSelection( ) override; + virtual void SAL_CALL addSelectionChangeListener( const css::uno::Reference< css::view::XSelectionChangeListener >& xListener ) override; + virtual void SAL_CALL removeSelectionChangeListener( const css::uno::Reference< css::view::XSelectionChangeListener >& xListener ) override; + +protected: + virtual FmXGridPeer* imp_CreatePeer(vcl::Window* pParent); + // ImplCreatePeer would be better, but doesn't work because it's not exported + +}; + + +// FmXGridPeer -> Peer for the Gridcontrol + +class FmGridControl; +class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC FmXGridPeer: + public cppu::ImplInheritanceHelper< + VCLXWindow, + css::form::XGridPeer, + css::form::XBoundComponent, + css::form::XGridControl, + css::sdb::XRowSetSupplier, + css::util::XModifyBroadcaster, + css::beans::XPropertyChangeListener, + css::container::XContainerListener, + css::sdbc::XRowSetListener, + css::form::XLoadListener, + css::view::XSelectionChangeListener, + css::container::XIndexAccess, + css::container::XEnumerationAccess, + css::util::XModeSelector, + css::container::XContainer, + css::frame::XStatusListener, + css::frame::XDispatchProvider, + css::frame::XDispatchProviderInterception, + css::form::XResetListener, + css::view::XSelectionSupplier> +{ +protected: + css::uno::Reference< css::uno::XComponentContext > m_xContext; + ::osl::Mutex m_aMutex; + +private: + css::uno::Reference< css::container::XIndexContainer > m_xColumns; + css::uno::Reference< css::sdbc::XRowSet > m_xCursor; + ::comphelper::OInterfaceContainerHelper2 m_aModifyListeners, + m_aUpdateListeners, + m_aContainerListeners, + m_aSelectionListeners, + m_aGridControlListeners; + + OUString m_aMode; + sal_Int32 m_nCursorListening; + + css::uno::Reference< css::frame::XDispatchProviderInterceptor > m_xFirstDispatchInterceptor; + + bool m_bInterceptingDispatch; + + std::unique_ptr m_pStateCache; + // one bool for each supported url + std::unique_ptr[]> m_pDispatchers; + // one dispatcher for each supported url + // (I would like to have a vector here but including the stl in an exported file seems + // very risky to me...) + + class SAL_DLLPRIVATE GridListenerDelegator; + friend class GridListenerDelegator; + std::unique_ptr m_pGridListener; + +public: + FmXGridPeer(const css::uno::Reference< css::uno::XComponentContext >&); + virtual ~FmXGridPeer() override; + + // late constructor, to always be called after the real constructor! + void Create(vcl::Window* pParent, WinBits nStyle); + +// css::lang::XUnoTunnel + UNO3_GETIMPLEMENTATION_DECL(FmXGridPeer) + +// css::form::XGridPeer + virtual css::uno::Reference< css::container::XIndexContainer > SAL_CALL getColumns( ) override; + virtual void SAL_CALL setColumns( const css::uno::Reference< css::container::XIndexContainer >& aColumns ) override final; + +// css::lang::XComponent + virtual void SAL_CALL dispose() override; + +// css::lang::XEventListener + virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override; + +// css::form::XBoundComponent + virtual void SAL_CALL addUpdateListener(const css::uno::Reference< css::form::XUpdateListener >& l) override; + virtual void SAL_CALL removeUpdateListener(const css::uno::Reference< css::form::XUpdateListener >& l) override; + virtual sal_Bool SAL_CALL commit() override; + +// css::container::XElementAccess + virtual css::uno::Type SAL_CALL getElementType( ) override; + virtual sal_Bool SAL_CALL hasElements( ) override; + +// css::container::XEnumerationAccess + virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override; + +// css::container::XIndexAccess + virtual sal_Int32 SAL_CALL getCount() override; + virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 _rIndex) override; + +// css::beans::XPropertyChangeListener + virtual void SAL_CALL propertyChange(const css::beans::PropertyChangeEvent& evt) override; + +// css::form::XLoadListener + virtual void SAL_CALL loaded(const css::lang::EventObject& rEvent) override; + virtual void SAL_CALL unloaded(const css::lang::EventObject& rEvent) override; + virtual void SAL_CALL unloading(const css::lang::EventObject& aEvent) override; + virtual void SAL_CALL reloading(const css::lang::EventObject& aEvent) override; + virtual void SAL_CALL reloaded(const css::lang::EventObject& aEvent) override; + +// css::sdbc::XRowSetListener + virtual void SAL_CALL cursorMoved(const css::lang::EventObject& event) override; + virtual void SAL_CALL rowChanged(const css::lang::EventObject& event) override; + virtual void SAL_CALL rowSetChanged(const css::lang::EventObject& event) override; + +// css::container::XContainerListener + virtual void SAL_CALL elementInserted(const css::container::ContainerEvent& Event) override; + virtual void SAL_CALL elementRemoved(const css::container::ContainerEvent& Event) override; + virtual void SAL_CALL elementReplaced(const css::container::ContainerEvent& Event) override; + +// VCLXWindow + virtual void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override; + virtual css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override; + virtual css::uno::Reference< css::accessibility::XAccessibleContext > + CreateAccessibleContext() override; + +// css::form::XGridControl + virtual void SAL_CALL addGridControlListener( const css::uno::Reference< css::form::XGridControlListener >& _listener ) override; + virtual void SAL_CALL removeGridControlListener( const css::uno::Reference< css::form::XGridControlListener >& _listener ) override; + +// css::form::XGrid (base of XGridControl) + virtual sal_Int16 SAL_CALL getCurrentColumnPosition() override; + virtual void SAL_CALL setCurrentColumnPosition(sal_Int16 nPos) override; + +// css::form::XGridFieldDataSupplier (base of XGridControl) + virtual css::uno::Sequence< sal_Bool > SAL_CALL queryFieldDataType( const css::uno::Type& xType ) override; + virtual css::uno::Sequence< css::uno::Any > SAL_CALL queryFieldData( sal_Int32 nRow, const css::uno::Type& xType ) override; + +// css::sdb::XRowSetSupplier + virtual css::uno::Reference< css::sdbc::XRowSet > SAL_CALL getRowSet() override; + virtual void SAL_CALL setRowSet(const css::uno::Reference< css::sdbc::XRowSet >& xDataSource) override final; + +// css::util::XModifyBroadcaster + virtual void SAL_CALL addModifyListener(const css::uno::Reference< css::util::XModifyListener >& l) override; + virtual void SAL_CALL removeModifyListener(const css::uno::Reference< css::util::XModifyListener >& l) override; + +// UnoControl + virtual void SAL_CALL setDesignMode(sal_Bool bOn) override; + virtual sal_Bool SAL_CALL isDesignMode() override; + +// css::view::XSelectionChangeListener + virtual void SAL_CALL selectionChanged(const css::lang::EventObject& aEvent) override; + + void CellModified(); + +// PropertyListening + void updateGrid(const css::uno::Reference< css::sdbc::XRowSet >& _rDatabaseCursor); + void startCursorListening(); + void stopCursorListening(); + +// css::util::XModeSelector + virtual void SAL_CALL setMode(const OUString& Mode) override; + virtual OUString SAL_CALL getMode() override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedModes() override; + virtual sal_Bool SAL_CALL supportsMode(const OUString& Mode) override; + +// css::container::XContainer + virtual void SAL_CALL addContainerListener(const css::uno::Reference< css::container::XContainerListener >& l) override; + virtual void SAL_CALL removeContainerListener(const css::uno::Reference< css::container::XContainerListener >& l) override; + + void columnVisible(DbGridColumn const * pColumn); + void columnHidden(DbGridColumn const * pColumn); + +// css::awt::XView + virtual void SAL_CALL draw( sal_Int32 x, sal_Int32 y ) override; + +// css::frame::XDispatchProvider + virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch(const css::util::URL& aURL, const OUString& aTargetFrameName, sal_Int32 nSearchFlags) override; + virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches(const css::uno::Sequence< css::frame::DispatchDescriptor >& aDescripts) override; + +// css::frame::XDispatchProviderInterception + virtual void SAL_CALL registerDispatchProviderInterceptor(const css::uno::Reference< css::frame::XDispatchProviderInterceptor >& xInterceptor) override; + virtual void SAL_CALL releaseDispatchProviderInterceptor(const css::uno::Reference< css::frame::XDispatchProviderInterceptor >& xInterceptor) override; + +// css::frame::XStatusListener + virtual void SAL_CALL statusChanged(const css::frame::FeatureStateEvent& Event) override; + +// css::form::XResetListener + virtual sal_Bool SAL_CALL approveReset(const css::lang::EventObject& rEvent) override; + virtual void SAL_CALL resetted(const css::lang::EventObject& rEvent) override; + +// css::view::XSelectionSupplier + virtual sal_Bool SAL_CALL select( const css::uno::Any& aSelection ) override; + virtual css::uno::Any SAL_CALL getSelection( ) override; + virtual void SAL_CALL addSelectionChangeListener( const css::uno::Reference< css::view::XSelectionChangeListener >& xListener ) override; + virtual void SAL_CALL removeSelectionChangeListener( const css::uno::Reference< css::view::XSelectionChangeListener >& xListener ) override; + +protected: + virtual VclPtr imp_CreateControl(vcl::Window* pParent, WinBits nStyle); + + static css::uno::Sequence< css::util::URL>& getSupportedURLs(); + static const std::vector& getSupportedGridSlots(); + void ConnectToDispatcher(); + void DisConnectFromDispatcher(); + void UpdateDispatches(); // will connect if not already connected and just update else + + /** If a derived class wants to listen at some column properties, it doesn't have + to override all methods affecting columns (setColumns, elementInserted, elementRemoved ...) + Instead it may use addColumnListeners and removeColumnListeners which are called in all + the cases. + */ + void addColumnListeners(const css::uno::Reference< css::beans::XPropertySet >& xCol); + void removeColumnListeners(const css::uno::Reference< css::beans::XPropertySet >& xCol); + + void selectionChanged(); + void columnChanged(); + + DECL_LINK(OnQueryGridSlotState, DbGridControlNavigationBarState, int); + DECL_LINK(OnExecuteGridSlot, DbGridControlNavigationBarState, bool); +}; + + +#endif // _SVX_FMGRID_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/fmmodel.hxx b/include/svx/fmmodel.hxx new file mode 100644 index 000000000..31ef08679 --- /dev/null +++ b/include/svx/fmmodel.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_SVX_FMMODEL_HXX +#define INCLUDED_SVX_FMMODEL_HXX + +#include +#include +#include + +class SfxObjectShell; +class SfxItemPool; +class FmXUndoEnvironment; + +struct FmFormModelImplData; +class SVXCORE_DLLPUBLIC FmFormModel : + public SdrModel +{ +private: + std::unique_ptr m_pImpl; + SfxObjectShell* m_pObjShell; + + bool m_bOpenInDesignMode : 1; + bool m_bAutoControlFocus : 1; + + FmFormModel( const FmFormModel& ) = delete; + void operator=(const FmFormModel& rSrcModel) = delete; + +public: + FmFormModel( + SfxItemPool* pPool = nullptr, + SfxObjectShell* pPers = nullptr); + + virtual ~FmFormModel() override; + + virtual SdrPage* AllocPage(bool bMasterPage) override; + virtual void InsertPage(SdrPage* pPage, sal_uInt16 nPos=0xFFFF) override; + virtual SdrPage* RemovePage(sal_uInt16 nPgNum) override; + virtual void InsertMasterPage(SdrPage* pPage, sal_uInt16 nPos=0xFFFF) override; + virtual SdrPage* RemoveMasterPage(sal_uInt16 nPgNum) override; + + SfxObjectShell* GetObjectShell() const { return m_pObjShell; } + void SetObjectShell( SfxObjectShell* pShell ); + + bool GetOpenInDesignMode() const { return m_bOpenInDesignMode; } + void SetOpenInDesignMode( bool _bOpenDesignMode ); + + bool GetAutoControlFocus() const { return m_bAutoControlFocus; } + void SetAutoControlFocus( bool _bAutoControlFocus ); + + /** check whether the OpenInDesignMode has been set explicitly or been loaded () + or if it still has the default value from construction () + */ + bool OpenInDesignModeIsDefaulted(); + + /** determines whether form controls should use the SdrModel's reference device for text rendering + */ + bool ControlsUseRefDevice() const; + + FmXUndoEnvironment& GetUndoEnv(); + +private: + void implSetOpenInDesignMode( bool _bOpenDesignMode ); +}; + +#endif // _FM_FMMODEL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/fmobjfac.hxx b/include/svx/fmobjfac.hxx new file mode 100644 index 000000000..1e3bd7f82 --- /dev/null +++ b/include/svx/fmobjfac.hxx @@ -0,0 +1,40 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_FMOBJFAC_HXX +#define INCLUDED_SVX_FMOBJFAC_HXX + +#include +#include + +class SdrObject; +struct SdrObjCreatorParams; + +class SVX_DLLPUBLIC FmFormObjFactory +{ +public: + FmFormObjFactory(); + ~FmFormObjFactory(); + + DECL_STATIC_LINK(FmFormObjFactory, MakeObject, SdrObjCreatorParams, SdrObject* ); +}; + +#endif // _FM_FMOBJFAC_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/fmpage.hxx b/include/svx/fmpage.hxx new file mode 100644 index 000000000..7459837ec --- /dev/null +++ b/include/svx/fmpage.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_SVX_FMPAGE_HXX +#define INCLUDED_SVX_FMPAGE_HXX + +#include +#include +#include + +class FmFormModel; +class FmFormPageImpl; // contains a list of all forms + +namespace com::sun::star { + namespace form { + class XForms; + } +} + +class SdrView; +class HelpEvent; + +class SVXCORE_DLLPUBLIC FmFormPage : public SdrPage +{ + FmFormPage& operator=(const FmFormPage&) = delete; + FmFormPage(const FmFormPage&) = delete; + + friend class FmFormObj; + std::unique_ptr m_pImpl; + OUString m_sPageName; + +public: + + explicit FmFormPage(FmFormModel& rModel, bool bMasterPage=false); + virtual ~FmFormPage() override; + + virtual SdrPage* CloneSdrPage(SdrModel& rTargetModel) const override; + + virtual void InsertObject(SdrObject* pObj, size_t nPos = SAL_MAX_SIZE) override; + + virtual SdrObject* RemoveObject(size_t nObjNum) override; + + // access to all forms + const css::uno::Reference< css::form::XForms>& GetForms( bool _bForceCreate = true ) const; + + FmFormPageImpl& GetImpl() const { return *m_pImpl; } + +public: + const OUString& GetName() const { return m_sPageName; } + void SetName( const OUString& rName ) { m_sPageName = rName; } + static bool RequestHelp( + vcl::Window* pWin, + SdrView const * pView, + const HelpEvent& rEvt ); + +protected: + // lateInit -> copyValuesToClonedInstance (?) + void lateInit(const FmFormPage& rPage); +}; + +#endif // INCLUDED_SVX_FMPAGE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/fmsearch.hxx b/include/svx/fmsearch.hxx new file mode 100644 index 000000000..bb0d303d1 --- /dev/null +++ b/include/svx/fmsearch.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_SVX_FMSEARCH_HXX +#define INCLUDED_SVX_FMSEARCH_HXX + +#include +#include + +#include + +#include + +namespace com::sun::star::sdbc { class XResultSet; } + +// Helper methods + +SVXCORE_DLLPUBLIC bool IsSearchableControl( const css::uno::Reference< css::uno::XInterface>& _xControl, + OUString* pCurrentText = nullptr); + // check if the control has one of the interfaces we can use for searching + // *pCurrentText will be filled with the current text of the control (as used when searching this control) + + +// Helper structs + +struct FmFoundRecordInformation +{ + css::uno::Any aPosition; // bookmark of the record in which the text was found + sal_Int16 nFieldPos; // ditto: the relative position of the column (in the string name of the field list in the constructor) + sal_Int16 nContext; // the context in which was searched and found (if the current search knows several contexts) +}; + +// FmSearchContext - information for the search in different contexts + +struct FmSearchContext +{ + // [in] + sal_Int16 nContext; // the number of the context + // [out] + css::uno::Reference< css::sdbc::XResultSet> + xCursor; // the iterator for the context + OUString strUsedFields; // a list of field names separated by ';' + ::std::vector< css::uno::Reference< css::uno::XInterface > > + arrFields; // the corresponding text interfaces for the fields in strUsedFields + OUString sFieldDisplayNames; // if not empty: names to be displayed for the searchable fields (must have the same token count as strUsedFields!) +}; + +#endif // INCLUDED_SVX_FMSEARCH_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/fmshell.hxx b/include/svx/fmshell.hxx new file mode 100644 index 000000000..809f26e29 --- /dev/null +++ b/include/svx/fmshell.hxx @@ -0,0 +1,171 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_FMSHELL_HXX +#define INCLUDED_SVX_FMSHELL_HXX + +// *************************************************************************************************** +// *************************************************************************************************** +// *************************************************************************************************** + +#include +#include +#include +#include + +#include +#include +#include + +#include + +class FmFormModel; +class FmFormPage; +class FmXFormShell; +class FmFormView; +class SdrView; +class SdrUnoObj; +class LinkParamNone; + +namespace com::sun::star::form { + class XForm; + namespace runtime { + class XFormController; + } +} + +namespace com::sun::star::awt { class XControl; } +namespace com::sun::star::awt { class XControlModel; } +template class Link; + +namespace svx +{ + class ISdrObjectFilter; +} + + +class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC FmDesignModeChangedHint final : public SfxHint +{ + bool m_bDesignMode; + +public: + FmDesignModeChangedHint( bool bDesMode ); + virtual ~FmDesignModeChangedHint() override; + + bool GetDesignMode() const { return m_bDesignMode; } +}; + +class SVXCORE_DLLPUBLIC FmFormShell final : public SfxShell +{ + friend class FmFormView; + friend class FmXFormShell; + + rtl::Reference m_pImpl; + FmFormView* m_pFormView; + FmFormModel* m_pFormModel; + + sal_uInt16 m_nLastSlot; + bool m_bDesignMode : 1; + bool m_bHasForms : 1; // flag storing if the forms on a page exist, + // only for the DesignMode, see UIFeatureChanged! + + // the marks of a FormView have changed... + void NotifyMarkListChanged(FmFormView*); + // (the FormView itself is not a broadcaster, therefore it can't always correctly notify the + // form explorer who is interested in the event) + +public: + SFX_DECL_INTERFACE(SVX_INTERFACE_FORM_SH) + +private: + /// SfxInterface initializer. + static void InitInterface_Impl(); + +public: + FmFormShell(SfxViewShell* pParent, FmFormView* pView = nullptr); + virtual ~FmFormShell() override; + + void Execute( SfxRequest& ); + void GetState( SfxItemSet& ); + virtual bool HasUIFeature(SfxShellFeature nFeature) const override; + + void ExecuteTextAttribute( SfxRequest& ); + void GetTextAttributeState( SfxItemSet& ); + + bool GetY2KState(sal_uInt16& nReturn); + void SetY2KState(sal_uInt16 n); + + void SetView(FmFormView* pView); + + FmFormView* GetFormView() const { return m_pFormView; } + FmFormModel* GetFormModel() const { return m_pFormModel; } + FmFormPage* GetCurPage() const; + FmXFormShell* GetImpl() const {return m_pImpl.get();}; + + bool PrepareClose(bool bUI = true); + + bool IsActiveControl() const; + void ForgetActiveControl(); + void SetControlActivationHandler( const Link& _rHdl ); + + virtual void Activate(bool bMDI) override; + virtual void Deactivate(bool bMDI) override; + + // helper methods for implementing XFormLayerAccess + SdrUnoObj* GetFormControl( + const css::uno::Reference< css::awt::XControlModel >& _rxModel, + const SdrView& _rView, + const OutputDevice& _rDevice, + css::uno::Reference< css::awt::XControl >& _out_rxControl + ) const; + + static css::uno::Reference< css::form::runtime::XFormController > GetFormController( + const css::uno::Reference< css::form::XForm >& _rxForm, + const SdrView& _rView, + const OutputDevice& _rDevice + ); + + /** puts the focus into the document window, if current a form control has the focus. Otherwise, moves the focus + to the control belonging to the given SdrUnoObj. + */ + void ToggleControlFocus( + const SdrUnoObj& i_rNextCandidate, + const SdrView& i_rView, + OutputDevice& i_rDevice + ) const; + + static ::std::unique_ptr< svx::ISdrObjectFilter > + CreateFocusableControlFilter( + const SdrView& i_rView, + const OutputDevice& i_rDevice + ); + + virtual bool IsDesignMode() const override { return m_bDesignMode; } + void SetDesignMode( bool _bDesignMode ); + +private: + void GetFormState(SfxItemSet &rSet, sal_uInt16 nWhich); + + // is there a form on the current page? + void DetermineForms(bool bInvalidate); + void impl_setDesignMode( bool bDesign); +}; + +#endif // INCLUDED_SVX_FMSHELL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/fmsrccfg.hxx b/include/svx/fmsrccfg.hxx new file mode 100644 index 000000000..ea8e80fe7 --- /dev/null +++ b/include/svx/fmsrccfg.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_SVX_FMSRCCFG_HXX +#define INCLUDED_SVX_FMSRCCFG_HXX + +#include +#include +#include + +enum class TransliterationFlags; + +#define MATCHING_ANYWHERE 0 +#define MATCHING_BEGINNING 1 +#define MATCHING_END 2 +#define MATCHING_WHOLETEXT 3 + +// this constants should NOT be just changed, since the SearchDialog performs no conversion of the settings of +// its ListBox, but instead just passes them along to the appropriate methods of SearchEngine +// (so if you change the constants or the order of the listbox entries in the dialog, then the other has +// to be adapted) + + +namespace svxform +{ + + + // = struct FmSearchParams - parameters of a search + + + struct SVX_DLLPUBLIC FmSearchParams + { + protected: + TransliterationFlags + nTransliterationFlags; + // they're way too sensitive for direct access... + + public: + // no bit fields at all (want to pass the addresses to the OConfigurationValueContainer) + css::uno::Sequence< OUString > + aHistory; + OUString sSingleSearchField; + + sal_Int16 nSearchForType; + sal_Int16 nPosition; + sal_Int16 nLevOther; + sal_Int16 nLevShorter; + sal_Int16 nLevLonger; + bool bLevRelaxed; + + bool bAllFields; + bool bUseFormatter; + bool bBackwards; + bool bWildcard; + bool bRegular; + bool bApproxSearch; + // the last three are mutually exclusive + + bool bSoundsLikeCJK; + + + FmSearchParams(); + + bool isIgnoreWidthCJK( ) const; + + TransliterationFlags + getTransliterationFlags( ) const { return nTransliterationFlags; } + void setTransliterationFlags( TransliterationFlags _nFlags ) { nTransliterationFlags = _nFlags; } + + bool isCaseSensitive( ) const; + void setCaseSensitive( bool _bCase ); + }; + + + // = class FmSearchConfigItem - a ConfigItem, that remembers search parameters + + + class SAL_WARN_UNUSED SVX_DLLPUBLIC FmSearchConfigItem + :protected FmSearchParams + ,public ::utl::OConfigurationValueContainer + // order matters! + { + private: + ::osl::Mutex m_aMutex; + + // wrapper properties: + // some of the members of FmSearchParams are must be translated to be stored in the configuration + OUString m_sSearchForType; + OUString m_sSearchPosition; + + bool m_bIsMatchCase; + bool m_bIsMatchFullHalfWidthForms; + bool m_bIsMatchHiraganaKatakana; + bool m_bIsMatchContractions; + bool m_bIsMatchMinusDashCho_on; + bool m_bIsMatchRepeatCharMarks; + bool m_bIsMatchVariantFormKanji; + bool m_bIsMatchOldKanaForms; + bool m_bIsMatch_DiZi_DuZu; + bool m_bIsMatch_BaVa_HaFa; + bool m_bIsMatch_TsiThiChi_DhiZi; + bool m_bIsMatch_HyuIyu_ByuVyu; + bool m_bIsMatch_SeShe_ZeJe; + bool m_bIsMatch_IaIya; + bool m_bIsMatch_KiKu; + bool m_bIsIgnorePunctuation; + bool m_bIsIgnoreWhitespace; + bool m_bIsIgnoreProlongedSoundMark; + bool m_bIsIgnoreMiddleDot; + + public: + FmSearchConfigItem(); + ~FmSearchConfigItem(); + + const FmSearchParams& getParams( ) const; + void setParams( const FmSearchParams& _rParams ); + + private: + SVX_DLLPRIVATE void implTranslateFromConfig( ); + SVX_DLLPRIVATE void implTranslateToConfig( ); + }; + + +} + + +#endif // INCLUDED_SVX_FMSRCCFG_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/fmsrcimp.hxx b/include/svx/fmsrcimp.hxx new file mode 100644 index 000000000..7f5eaa21f --- /dev/null +++ b/include/svx/fmsrcimp.hxx @@ -0,0 +1,349 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_FMSRCIMP_HXX +#define INCLUDED_SVX_FMSRCIMP_HXX + +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +namespace com::sun::star::awt { class XCheckBox; } +namespace com::sun::star::awt { class XListBox; } +namespace com::sun::star::awt { class XTextComponent; } +namespace com::sun::star::sdb { class XColumn; } + +enum class TransliterationFlags; + +/** + * struct FmSearchProgress - the owner of SearchEngine receives this structure for status updates + * (at the end of the search) + */ +struct FmSearchProgress +{ + enum class State { Progress, ProgressCounting, Canceled, Successful, NothingFound, Error }; + // (move to new record; progress during counting of records; cancelled; record found; nothing found; + // any non-processable error) + State aSearchState; + + // current record - always valid (e.g. of interest for continuing search in case of cancellation) + sal_uInt32 nCurrentRecord; + // Overflow - only valid in case of STATE_PROGRESS + bool bOverflow; + + // the position of the search cursor - valid in case of STATE_SUCCESSFULL, STATE_CANCELED and STATE_NOTHING_FOUND + css::uno::Any aBookmark; + // the field, in which the text was found - valid in case of STATE_SUCCESSFULL + sal_Int32 nFieldIndex; +}; + +/** + * class FmRecordCountListener - utility class for FmSearchEngine, listens at a certain cursor and provides + * the differences in RecordCount + */ +class SAL_WARN_UNUSED FmRecordCountListener final : public cppu::WeakImplHelper< css::beans::XPropertyChangeListener > +{ +// attribute + Link m_lnkWhoWantsToKnow; + css::uno::Reference< css::beans::XPropertySet > m_xListening; + +// attribute access +public: + void SetPropChangeHandler(const Link& lnk); + +// methods +public: + FmRecordCountListener(const css::uno::Reference< css::sdbc::XResultSet >& dbcCursor); + // the set has to support the sdb::ResultSet service + virtual ~FmRecordCountListener() override; + + // DECLARE_UNO3_AGG_DEFAULTS(FmPropertyListener, UsrObject) + // virtual sal_Bool queryInterface(css::uno::Uik aUik, css::uno::Reference< css::uno::XInterface >& rOut); + + // css::lang::XEventListener + virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override; + + // css::beans::XPropertyChangeListener + virtual void SAL_CALL propertyChange(const css::beans::PropertyChangeEvent& evt) override; + + void DisConnect(); + +private: + void NotifyCurrentCount(); + +}; + +/** + * class FmSearchEngine - Impl class for FmSearchDialog + */ +namespace svxform { + // We have three possible control types we may search in, determined by the supported interfaces : css::awt::XTextComponent, + // css::awt::XListBox, css::awt::XCheckBox. + // While searching we don't want to do this distinction for every control in every round. So we need some helpers. + class SAL_WARN_UNUSED ControlTextWrapper + { + // attributes + css::uno::Reference< css::uno::XInterface > m_xControl; + // attribute access + public: + const css::uno::Reference< css::uno::XInterface >& getControl() const{ return m_xControl; } + public: + ControlTextWrapper(const css::uno::Reference< css::uno::XInterface >& _xControl) { m_xControl = _xControl; } + virtual ~ControlTextWrapper() { } + + virtual OUString getCurrentText() const = 0; + }; + + class SAL_WARN_UNUSED SimpleTextWrapper final : public ControlTextWrapper + { + css::uno::Reference< css::awt::XTextComponent > m_xText; + public: + SimpleTextWrapper(const css::uno::Reference< css::awt::XTextComponent >& _xText); + virtual OUString getCurrentText() const override; + }; + + class SAL_WARN_UNUSED ListBoxWrapper final : public ControlTextWrapper + { + css::uno::Reference< css::awt::XListBox > m_xBox; + public: + ListBoxWrapper(const css::uno::Reference< css::awt::XListBox >& _xBox); + virtual OUString getCurrentText() const override; + }; + + class SAL_WARN_UNUSED CheckBoxWrapper final : public ControlTextWrapper + { + css::uno::Reference< css::awt::XCheckBox > m_xBox; + public: + CheckBoxWrapper(const css::uno::Reference< css::awt::XCheckBox >& _xBox); + virtual OUString getCurrentText() const override; + }; +} + +typedef std::vector< css::uno::Reference< css::uno::XInterface> > InterfaceArray; + +class SAL_WARN_UNUSED SVX_DLLPUBLIC FmSearchEngine final +{ + friend class FmSearchThread; + + enum class SearchResult { Found, NotFound, Error, Cancelled }; + enum class SearchFor { String, Null, NotNull }; + + CursorWrapper m_xSearchCursor; + std::deque m_arrFieldMapping; + // Since the iterator could have more columns, as managed here (in this field listbox), + // a mapping of this css::form keys on the indices of the respective columns is kept in the iterator + + CharClass m_aCharacterClassficator; + CollatorWrapper m_aStringCompare; + + // the collection of all interesting fields (or their css::data::XDatabaseVariant interfaces and FormatKeys) + struct FieldInfo + { + css::uno::Reference< css::sdb::XColumn > xContents; + }; + + typedef std::vector FieldCollection; + FieldCollection m_arrUsedFields; + sal_Int32 m_nCurrentFieldIndex; // the last parameter of RebuildUsedFields, it allows checks in FormatField + + std::vector> + m_aControlTexts; + + CursorWrapper m_xOriginalIterator; + CursorWrapper m_xClonedIterator; + + // Data for the decision in which field a "Found" is accepted + css::uno::Any m_aPreviousLocBookmark; // position of the last finding + FieldCollection::iterator m_iterPreviousLocField; // field of the last finding + + // Communication with the thread that does the actual searching + OUString m_strSearchExpression; // forward direction + SearchFor m_eSearchForType; // ditto + SearchResult m_srResult; // backward direction + + // The link we broadcast the progress and the result to + Link m_aProgressHandler; + bool m_bSearchingCurrently : 1; // is an (asynchronous) search running? + bool m_bCancelAsynchRequest : 1; // should be cancelled? + ::osl::Mutex m_aCancelAsynchAccess; // access to_bCancelAsynchRequest (technically only + // relevant for m_eMode == SM_USETHREAD) + + // parameters for the search + bool m_bFormatter : 1; // use field formatting + bool m_bForward : 1; // direction + bool m_bWildcard : 1; // wildcard search + bool m_bRegular : 1; // regular expression + bool m_bLevenshtein : 1; // Levenshtein search + bool m_bTransliteration : 1; // Levenshtein search + + bool m_bLevRelaxed : 1; // parameters for Levenshtein search + sal_uInt16 m_nLevOther; + sal_uInt16 m_nLevShorter; + sal_uInt16 m_nLevLonger; + + sal_uInt16 m_nPosition; // if not regular or levenshtein, then one of the MATCHING_... values + + TransliterationFlags m_nTransliterationFlags; + + +// member access +private: + SVX_DLLPRIVATE bool CancelRequested(); // provides a through m_aCancelAsynchAccess backed interpretation of m_bCancelAsynchRequest + +public: + void SetCaseSensitive(bool bSet); + bool GetCaseSensitive() const; + + void SetFormatterUsing(bool bSet); // this is somewhat more extensive, so no inline ... here + bool GetFormatterUsing() const { return m_bFormatter; } + + void SetDirection(bool bForward) { m_bForward = bForward; } + bool GetDirection() const { return m_bForward; } + + void SetWildcard(bool bSet) { m_bWildcard = bSet; } + bool GetWildcard() const { return m_bWildcard; } + + void SetRegular(bool bSet) { m_bRegular = bSet; } + bool GetRegular() const { return m_bRegular; } + + void SetLevenshtein(bool bSet) { m_bLevenshtein = bSet; } + bool GetLevenshtein() const { return m_bLevenshtein; } + + void SetIgnoreWidthCJK(bool bSet); + bool GetIgnoreWidthCJK() const; + + void SetTransliteration(bool bSet) { m_bTransliteration = bSet; } + bool GetTransliteration() const { return m_bTransliteration; } + + void SetLevRelaxed(bool bSet) { m_bLevRelaxed = bSet; } + bool GetLevRelaxed() const { return m_bLevRelaxed; } + void SetLevOther(sal_uInt16 nHowMuch) { m_nLevOther = nHowMuch; } + sal_uInt16 GetLevOther() const { return m_nLevOther; } + void SetLevShorter(sal_uInt16 nHowMuch) { m_nLevShorter = nHowMuch; } + sal_uInt16 GetLevShorter() const { return m_nLevShorter; } + void SetLevLonger(sal_uInt16 nHowMuch) { m_nLevLonger = nHowMuch; } + sal_uInt16 GetLevLonger() const { return m_nLevLonger; } + // all Lev. values will only be considered in case of m_bLevenshtein==sal_True + + void SetTransliterationFlags(TransliterationFlags _nFlags) { m_nTransliterationFlags = _nFlags; } + TransliterationFlags + GetTransliterationFlags() const { return m_nTransliterationFlags; } + + void SetPosition(sal_uInt16 nValue) { m_nPosition = nValue; } + sal_uInt16 GetPosition() const { return m_nPosition; } + // position will be ignored in case of m_bWildCard==sal_True + +public: + /** two constructs, both analogical to FmSearchDialog, therefore look this up for explanations... + xCursor has to implement css::data::DatabaseCursor service each time. + If eMode == SM_USETHREAD, a ProgressHandler should be set, because in this case the result forwarding will be done + by this handler. + If eMode != SM_USETHREAD, SearchNext and StarOver won't return, until the search has finished (independently of its + success), only then the result can be requested. If additionally the ProgressHandler is set, it will be called for + every record as well as at the end of the search. + */ + FmSearchEngine( + const css::uno::Reference< css::uno::XComponentContext >& _rxContext, + const css::uno::Reference< css::sdbc::XResultSet >& xCursor, + const OUString& strVisibleFields, + const InterfaceArray& arrFields); + + /** the link will be called on every record and after the completion of the search, the parameter is a pointer to + a FmSearchProgress structure + the handler should be in any case thread-safe + */ + void SetProgressHandler(Link aHdl) { m_aProgressHandler = aHdl; } + + /// search for the next appearance (for nDirection values check DIRECTION_*-defines) + void SearchNext(const OUString& strExpression); + /// analogous, search for "NULL" (_bSearchForNull==sal_True) or "not NULL" + void SearchNextSpecial(bool _bSearchForNull); + /// search for the next appearance, dependent on nDirection from the start or end + void StartOver(const OUString& strExpression); + /// analogous, search for "NULL" (_bSearchForNull==sal_True) or "not NULL" + void StartOverSpecial(bool _bSearchForNull); + /// invalidate previous search reference + void InvalidatePreviousLoc(); + + /** rebuilds m_arrUsedFields (nFieldIndex==-1 means all fields, otherwise it specifies the field index) + if bForce is not set, nothing will happen in case of nFieldIndex == m_nCurrentFieldIndex + (calls InvalidatePreviousLoc) + */ + void RebuildUsedFields(sal_Int32 nFieldIndex, bool bForce = false); + OUString FormatField(sal_Int32 nWhich); + + /// returns directly; once it was really aborted, ProgressHandler is called with STATE_CANCELED + void CancelSearch(); + + /** only valid, if not an (asynchronous) search is running, the next search will then be executed + on top of the new iterator with the new parameter + */ + void SwitchToContext(const css::uno::Reference< css::sdbc::XResultSet >& xCursor, const OUString& strVisibleFields, const InterfaceArray& arrFields, + sal_Int32 nFieldIndex); + +private: + void Init(const OUString& strVisibleFields); + + void SearchNextImpl(); + // this Impl method is running in SearchThread + + // start a thread-search (or call SearchNextImpl directly, depending on the search mode) + void ImplStartNextSearch(); + + SVX_DLLPRIVATE void fillControlTexts(const InterfaceArray& arrFields); + + // three methods implementing a complete search loop (null/not null, wildcard, SearchText) + // (they all have some code in common, but with this solution we have to do a distinction only once per search (before + // starting the loop), not in every loop step + SVX_DLLPRIVATE SearchResult SearchSpecial(bool _bSearchForNull, sal_Int32& nFieldPos, FieldCollection::iterator& iterFieldLoop, + const FieldCollection::iterator& iterBegin, const FieldCollection::iterator& iterEnd); + SVX_DLLPRIVATE SearchResult SearchWildcard(const OUString& strExpression, sal_Int32& nFieldPos, FieldCollection::iterator& iterFieldLoop, + const FieldCollection::iterator& iterBegin, const FieldCollection::iterator& iterEnd); + SVX_DLLPRIVATE SearchResult SearchRegularApprox(const OUString& strExpression, sal_Int32& nFieldPos, FieldCollection::iterator& iterFieldLoop, + const FieldCollection::iterator& iterBegin, const FieldCollection::iterator& iterEnd); + + SVX_DLLPRIVATE void PropagateProgress(bool _bDontPropagateOverflow); + // call the ProgressHandler with STATE_PROGRESS and the current position of the search iterator + + // helpers, that are needed several times + SVX_DLLPRIVATE bool MoveCursor(); + // moves m_xSearchIterator with respect to direction/overflow cursor + SVX_DLLPRIVATE bool MoveField(sal_Int32& nPos, FieldCollection::iterator& iter, const FieldCollection::iterator& iterBegin, const FieldCollection::iterator& iterEnd); + // moves the iterator with respect to the direction/overflow iterator/overflow cursor + SVX_DLLPRIVATE void BuildAndInsertFieldInfo(const css::uno::Reference< css::container::XIndexAccess >& xAllFields, sal_Int32 nField); + + void OnSearchTerminated(); + // is used by SearchThread, after the return from this handler the thread removes itself + DECL_LINK(OnNewRecordCount, sal_Int32, void); +}; + +#endif // INCLUDED_SVX_FMSRCIMP_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/fmtools.hxx b/include/svx/fmtools.hxx new file mode 100644 index 000000000..f0fba4e0f --- /dev/null +++ b/include/svx/fmtools.hxx @@ -0,0 +1,175 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_FMTOOLS_HXX +#define INCLUDED_SVX_FMTOOLS_HXX + +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include + +namespace com::sun::star::beans { class XPropertySet; } +namespace com::sun::star::container { class XIndexAccess; } +namespace com::sun::star::container { class XNameAccess; } +namespace com::sun::star::lang { class XComponent; } +namespace com::sun::star::lang { class XServiceInfo; } +namespace com::sun::star::sdbc { class SQLException; } +namespace com::sun::star::sdbc { class XRowSet; } +namespace com::sun::star::sdb { class SQLContext; } +namespace com::sun::star::sdb { struct SQLErrorEvent; } +namespace vcl { class Window; } + + +// common types + +// displaying a database exception for the user +// display info about a simple css::sdbc::SQLException +void displayException(const css::sdbc::SQLException&, vcl::Window* _pParent); +SVXCORE_DLLPUBLIC void displayException(const css::sdb::SQLContext&, vcl::Window* _pParent); +void displayException(const css::sdb::SQLErrorEvent&, vcl::Window* _pParent = nullptr); +void displayException(const css::uno::Any&, vcl::Window* _pParent = nullptr); + +sal_Int32 getElementPos(const css::uno::Reference< css::container::XIndexAccess>& xCont, const css::uno::Reference< css::uno::XInterface>& xElement); + +SVXCORE_DLLPUBLIC OUString getLabelName(const css::uno::Reference< css::beans::XPropertySet>& xControlModel); + + +// = class CursorWrapper - a helper class which works in common with a css::uno::Reference, +// XDatabaseBookmarkCursor and XDatabaseDirectCursor each + + +class SAL_WARN_UNUSED CursorWrapper +{ +private: + css::uno::Reference< css::uno::XInterface> m_xGeneric; + css::uno::Reference< css::sdbc::XResultSet> m_xMoveOperations; + css::uno::Reference< css::sdbcx::XRowLocate> m_xBookmarkOperations; + css::uno::Reference< css::sdbcx::XColumnsSupplier> m_xColumnsSupplier; + css::uno::Reference< css::beans::XPropertySet> m_xPropertyAccess; + +public: + // Construction/Destruction + CursorWrapper(const css::uno::Reference< css::sdbc::XRowSet>& _rxCursor, bool bUseCloned = false); + UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) CursorWrapper(const css::uno::Reference< css::sdbc::XResultSet>& _rxCursor, bool bUseCloned = false); + // if bUseCloned == sal_True, the cursor is first doubled over the XCloneable interface (which it must implement) + // and then used + + friend bool operator==(const CursorWrapper& lhs, const CursorWrapper& rhs) + { + return lhs.m_xGeneric.get() == rhs.m_xGeneric.get(); + } + + bool is() const { return m_xMoveOperations.is(); } + bool Is() const { return m_xMoveOperations.is(); } + + operator const css::uno::Reference< css::uno::XInterface>& () const{ return m_xGeneric; } + + // 'Conversions' + CursorWrapper& operator=(const css::uno::Reference< css::sdbc::XRowSet>& xCursor); + operator const css::uno::Reference< css::sdbc::XResultSet>& () const { return m_xMoveOperations; } + + const css::uno::Reference< css::beans::XPropertySet >& getPropertySet() const { return m_xPropertyAccess; } + + // css::uno::Reference< css::sdbcx::XRowLocate> + /// @throws css::sdbc::SQLException + /// @throws css::uno::RuntimeException + css::uno::Any getBookmark() + { return m_xBookmarkOperations->getBookmark(); } + /// @throws css::sdbc::SQLException + /// @throws css::uno::RuntimeException + bool moveToBookmark(const css::uno::Any& bookmark) { return m_xBookmarkOperations->moveToBookmark(bookmark); } + + // css::sdbc::XResultSet + bool isBeforeFirst() const { return m_xMoveOperations->isBeforeFirst(); } + bool isAfterLast() const { return m_xMoveOperations->isAfterLast(); } + bool isFirst() const { return m_xMoveOperations->isFirst(); } + bool isLast() const { return m_xMoveOperations->isLast(); } + void beforeFirst() { m_xMoveOperations->beforeFirst(); } + bool first() { return m_xMoveOperations->first(); } + bool last() { return m_xMoveOperations->last(); } + sal_Int32 getRow() const { return m_xMoveOperations->getRow(); } + bool absolute(sal_Int32 nPosition) { return m_xMoveOperations->absolute(nPosition); } + bool relative(sal_Int32 nCount) { return m_xMoveOperations->relative(nCount); } + bool previous() { return m_xMoveOperations->previous(); } + bool next() { return m_xMoveOperations->next(); } + void refreshRow() { m_xMoveOperations->refreshRow(); } + bool rowDeleted() { return m_xMoveOperations->rowDeleted(); } + // css::sdbcx::XColumnsSupplier + /// @throws css::uno::RuntimeException + css::uno::Reference< css::container::XNameAccess> getColumns() const { return m_xColumnsSupplier->getColumns(); } +private: + void ImplConstruct(const css::uno::Reference< css::sdbc::XResultSet>& _rxCursor, bool bUseCloned); +}; + + +class FmXDisposeMultiplexer; +class SAL_WARN_UNUSED FmXDisposeListener +{ + friend class FmXDisposeMultiplexer; + + rtl::Reference m_pAdapter; + osl::Mutex m_aMutex; + +public: + virtual ~FmXDisposeListener(); + + /// @throws css::uno::RuntimeException + virtual void disposing(sal_Int16 _nId) = 0; + +protected: + void setAdapter(FmXDisposeMultiplexer* pAdapter); +}; + +class SAL_WARN_UNUSED FmXDisposeMultiplexer : public cppu::WeakImplHelper< css::lang::XEventListener > +{ + css::uno::Reference< css::lang::XComponent> m_xObject; + FmXDisposeListener* m_pListener; + + virtual ~FmXDisposeMultiplexer() override; +public: + FmXDisposeMultiplexer(FmXDisposeListener* _pListener, const css::uno::Reference< css::lang::XComponent>& _rxObject); + +// css::lang::XEventListener + virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override; + + void dispose(); +}; + +sal_Int16 getControlTypeByObject(const css::uno::Reference< css::lang::XServiceInfo>& _rxObject); + // get the object type (OBJ_FM_...) from the services the object supports + + +bool isRowSetAlive(const css::uno::Reference< css::uno::XInterface>& _rxRowSet); + // checks if the css::sdbcx::XColumnsSupplier provided by _rxRowSet supplies any columns + + +typedef ::std::set< css::uno::Reference< css::uno::XInterface > > InterfaceBag; + +#endif // INCLUDED_SVX_FMTOOLS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/fmview.hxx b/include/svx/fmview.hxx new file mode 100644 index 000000000..00cecc94d --- /dev/null +++ b/include/svx/fmview.hxx @@ -0,0 +1,156 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_FMVIEW_HXX +#define INCLUDED_SVX_FMVIEW_HXX + +#include +#include + +namespace com::sun::star { + namespace beans { + class XPropertySet; + } + namespace util { + class XNumberFormats; + } +} + +class OutputDevice; +class FmFormObj; +class FmFormPage; +class FmFormShell; +class FmXFormView; + +namespace svx { + class ODataAccessDescriptor; + struct OXFormsDescriptor; +} + +class SdrUnoObj; +namespace com::sun::star::form { + class XForm; + namespace runtime { + class XFormController; + } +} + +class SVXCORE_DLLPUBLIC FmFormView : public E3dView +{ + rtl::Reference pImpl; + FmFormShell* pFormShell; + + void Init(); + +public: + FmFormView( + SdrModel& rSdrModel, + OutputDevice* pOut); + + virtual ~FmFormView() override; + + /** create a control pair (label/bound control) for the database field description given. + @param rFieldDesc + description of the field. see clipboard format SBA-FIELDFORMAT + @deprecated + This method is deprecated. Use the version with an ODataAccessDescriptor instead. + */ + SdrObjectUniquePtr CreateFieldControl(const OUString& rFieldDesc) const; + + /** create a control pair (label/bound control) for the database field description given. + */ + SdrObjectUniquePtr CreateFieldControl( const svx::ODataAccessDescriptor& _rColumnDescriptor ); + + /** create a control pair (label/bound control) for the xforms description given. + */ + SdrObjectUniquePtr CreateXFormsControl( const svx::OXFormsDescriptor &_rDesc ); + + virtual void MarkListHasChanged() override; + virtual void AddWindowToPaintView(OutputDevice* pNewWin, vcl::Window* pWindow) override; + virtual void DeleteWindowFromPaintView(OutputDevice* pOldWin) override; + + static void createControlLabelPair( + OutputDevice const * _pOutDev, + sal_Int32 _nXOffsetMM, + sal_Int32 _nYOffsetMM, + const css::uno::Reference< css::beans::XPropertySet >& _rxField, + const css::uno::Reference< css::util::XNumberFormats >& _rxNumberFormats, + sal_uInt16 _nControlObjectID, + SdrInventor _nInventor, + sal_uInt16 _nLabelObjectID, + + // tdf#118963 Need a SdrModel for SdrObject creation. To make the + // demand clear, hand over a SdrMldel& + SdrModel& _rModel, + + std::unique_ptr& _rpLabel, + std::unique_ptr& _rpControl + ); + + virtual SdrPageView* ShowSdrPage(SdrPage* pPage) override; + virtual void HideSdrPage() override; + + virtual bool MouseButtonDown( const MouseEvent& _rMEvt, OutputDevice* _pWin ) override; + + /** grab the focus to the first form control on the view + */ + SVX_DLLPRIVATE void GrabFirstControlFocus(); + + /** returns the form controller for a given form and a given device + */ + SVX_DLLPRIVATE css::uno::Reference< css::form::runtime::XFormController > + GetFormController( const css::uno::Reference< css::form::XForm >& _rxForm, const OutputDevice& _rDevice ) const; + + // SdrView + bool KeyInput(const KeyEvent& rKEvt, vcl::Window* pWin) override; + + /// shortcut to "GetSdrPageView() ? PTR_CAST( FmFormPage, GetSdrPageView() ) : NULL" + FmFormPage* GetCurPage(); + + SVX_DLLPRIVATE void ActivateControls(SdrPageView const *); + SVX_DLLPRIVATE void DeactivateControls(SdrPageView const *); + + SVX_DLLPRIVATE void ChangeDesignMode(bool bDesign); + + SVX_DLLPRIVATE FmXFormView* GetImpl() const { return pImpl.get(); } + SVX_DLLPRIVATE FmFormShell* GetFormShell() const { return pFormShell; } + + struct FormShellAccess { friend class FmFormShell; private: FormShellAccess() { } }; + void SetFormShell( FmFormShell* pShell, FormShellAccess ) { pFormShell = pShell; } + + struct ImplAccess { friend class FmXFormView; private: ImplAccess() { } }; + void SetMoveOutside( bool _bMoveOutside, ImplAccess ) { E3dView::SetMoveOutside( _bMoveOutside ); } + void InsertControlContainer(const css::uno::Reference< css::awt::XControlContainer >& xCC); + void RemoveControlContainer(const css::uno::Reference< css::awt::XControlContainer >& xCC); + + virtual SdrPaintWindow* BeginCompleteRedraw(OutputDevice* pOut) override; + virtual void EndCompleteRedraw(SdrPaintWindow& rPaintWindow, bool bPaintFormLayer) override; + + SVX_DLLPRIVATE const OutputDevice* GetActualOutDev() const {return mpActualOutDev;} + SVX_DLLPRIVATE bool checkUnMarkAll(const css::uno::Reference< css::uno::XInterface >& _xSource); + +private: + SVX_DLLPRIVATE FmFormObj* getMarkedGrid() const; + protected: + using E3dView::SetMoveOutside; +}; + +#endif // _FML_FMVIEW_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/fntctrl.hxx b/include/svx/fntctrl.hxx new file mode 100644 index 000000000..c84289ac9 --- /dev/null +++ b/include/svx/fntctrl.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_SVX_FNTCTRL_HXX +#define INCLUDED_SVX_FNTCTRL_HXX + +#include +#include +#include +#include +#include + +class SfxItemSet; +class FontPrevWin_Impl; + +class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxFontPrevWindow final : public weld::CustomWidgetController +{ +private: + std::unique_ptr pImpl; + + SVX_DLLPRIVATE static void ApplySettings(vcl::RenderContext& rRenderContext); + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; + SVX_DLLPRIVATE static void SetFontSize(const SfxItemSet& rSet, sal_uInt16 nSlot, SvxFont& rFont); + SVX_DLLPRIVATE static void SetFontLang(const SfxItemSet& rSet, sal_uInt16 nSlot, SvxFont& rFont); + +public: + SvxFontPrevWindow(); + virtual ~SvxFontPrevWindow() override; + + SvxFont& GetFont(); + const SvxFont& GetFont() const; + void SetFont( const SvxFont& rNormalFont, const SvxFont& rCJKFont, const SvxFont& rCTLFont ); + SvxFont& GetCJKFont(); + SvxFont& GetCTLFont(); + void SetColor( const Color& rColor ); + void ResetColor(); + void SetBackColor( const Color& rColor ); + void SetTextLineColor(const Color& rColor); + void SetOverlineColor(const Color& rColor); + void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& ) override; + + bool IsTwoLines() const; + void SetTwoLines(bool bSet); + + void SetBrackets(sal_Unicode cStart, sal_Unicode cEnd); + + void SetFontWidthScale( sal_uInt16 nScaleInPercent ); + + void AutoCorrectFontColor(); + + void SetPreviewText( const OUString& rString ); + void SetFontNameAsPreviewText(); + + void SetFromItemSet( const SfxItemSet &rSet, + bool bPreviewBackgroundToCharacter ); +}; + +#endif // INCLUDED_SVX_FNTCTRL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/fontwork.hxx b/include/svx/fontwork.hxx new file mode 100644 index 000000000..cca06cc69 --- /dev/null +++ b/include/svx/fontwork.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_SVX_FONTWORK_HXX +#define INCLUDED_SVX_FONTWORK_HXX + +#include +#include +#include +#include +#include + +class ColorListBox; + +class XFormTextAdjustItem; +class XFormTextDistanceItem; +class XFormTextStartItem; +class XFormTextStyleItem; +class XFormTextMirrorItem; +class XFormTextHideFormItem; +class XFormTextOutlineItem; +class XFormTextShadowItem; +class XFormTextShadowColorItem; +class XFormTextShadowXValItem; +class XFormTextShadowYValItem; + +/** ControllerItem for Fontwork + */ + + +class SvxFontWorkDialog; + +class SvxFontWorkControllerItem final : public SfxControllerItem +{ + SvxFontWorkDialog &rFontWorkDlg; + + virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState, + const SfxPoolItem* pState) override; + +public: + SvxFontWorkControllerItem(sal_uInt16 nId, SvxFontWorkDialog&, SfxBindings&); +}; + +/** Derived from SfxChildWindow as "container" for fontwork dialog + */ + +class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxFontWorkChildWindow final : public SfxChildWindow +{ + public: + SvxFontWorkChildWindow(vcl::Window*, sal_uInt16, SfxBindings*, SfxChildWinInfo*); + SFX_DECL_CHILDWINDOW_WITHID(SvxFontWorkChildWindow); +}; + +/** Floating window for setting attributes of text effects + */ + +class SAL_WARN_UNUSED SvxFontWorkDialog final : public SfxDockingWindow +{ +#define CONTROLLER_COUNT 11 + + SfxBindings& rBindings; + Idle aInputIdle; + + OString m_sLastStyleTbxId; + OString m_sLastAdjustTbxId; + OString m_sLastShadowTbxId; + + long nSaveShadowX; + long nSaveShadowY; + long nSaveShadowAngle; + long nSaveShadowSize; + + SvxFontWorkControllerItem* pCtrlItems[CONTROLLER_COUNT]; + + std::unique_ptr m_xTbxStyle; + std::unique_ptr m_xTbxAdjust; + + std::unique_ptr m_xMtrFldDistance; + std::unique_ptr m_xMtrFldTextStart; + + std::unique_ptr m_xTbxShadow; + + std::unique_ptr m_xFbShadowX; + std::unique_ptr m_xMtrFldShadowX; + std::unique_ptr m_xFbShadowY; + std::unique_ptr m_xMtrFldShadowY; + + std::unique_ptr m_xShadowColorLB; + + friend class SvxFontWorkChildWindow; + friend class SvxFontWorkControllerItem; + + DECL_LINK( SelectStyleHdl_Impl, const OString&, void ); + DECL_LINK( SelectAdjustHdl_Impl, const OString&, void ); + DECL_LINK( SelectShadowHdl_Impl, const OString&, void ); + + DECL_LINK( ModifyInputHdl_Impl, weld::MetricSpinButton&, void ); + DECL_LINK( InputTimeoutHdl_Impl, Timer*, void ); + + DECL_LINK( ColorSelectHdl_Impl, ColorListBox&, void ); + + void SetStyle_Impl(const XFormTextStyleItem*); + void SetAdjust_Impl(const XFormTextAdjustItem*); + void SetDistance_Impl(const XFormTextDistanceItem*); + void SetStart_Impl(const XFormTextStartItem*); + void SetMirror_Impl(const XFormTextMirrorItem*); + void SetShowForm_Impl(const XFormTextHideFormItem*); + void SetOutline_Impl(const XFormTextOutlineItem*); + void SetShadow_Impl(const XFormTextShadowItem*, bool bRestoreValues = false); + void SetShadowColor_Impl(const XFormTextShadowColorItem*); + void SetShadowXVal_Impl(const XFormTextShadowXValItem*); + void SetShadowYVal_Impl(const XFormTextShadowYValItem*); + + void ApplyImageList(); + + virtual SfxChildAlignment CheckAlignment( SfxChildAlignment eActAlign, + SfxChildAlignment eAlign ) override; +public: + SvxFontWorkDialog(SfxBindings *pBinding, SfxChildWindow *pCW, + vcl::Window* pParent); + virtual ~SvxFontWorkDialog() override; + virtual void dispose() override; +}; + +#endif // INCLUDED_SVX_FONTWORK_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/fontworkbar.hxx b/include/svx/fontworkbar.hxx new file mode 100644 index 000000000..a11e015e9 --- /dev/null +++ b/include/svx/fontworkbar.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_SVX_FONTWORKBAR_HXX +#define INCLUDED_SVX_FONTWORKBAR_HXX + +#include +#include +#include + +class SfxViewShell; +class SdrView; + +/************************************************************************/ + +namespace svx +{ + +bool SVXCORE_DLLPUBLIC checkForSelectedFontWork( SdrView const * pSdrView, sal_uInt32& nCheckStatus ); + +class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC FontworkBar final : public SfxShell +{ +public: + SFX_DECL_INTERFACE(SVX_INTERFACE_FONTWORK_BAR) + +private: + /// SfxInterface initializer. + static void InitInterface_Impl(); + +public: + FontworkBar(SfxViewShell* pViewShell); + virtual ~FontworkBar() override; + + static void execute( SdrView& rSdrView, SfxRequest const & rReq, SfxBindings& rBindings ); + static void getState( SdrView const * pSdrView, SfxItemSet& rSet ); +}; + +} + +#endif // INCLUDED_SVX_FONTWORKBAR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/fontworkgallery.hxx b/include/svx/fontworkgallery.hxx new file mode 100644 index 000000000..12648ebd6 --- /dev/null +++ b/include/svx/fontworkgallery.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_SVX_FONTWORKGALLERY_HXX +#define INCLUDED_SVX_FONTWORKGALLERY_HXX + +#include +#include +#include +#include + +class SdrView; +class SdrObject; +class SdrModel; + +namespace svx +{ + +class SAL_WARN_UNUSED FontworkCharacterSpacingDialog final : public weld::GenericDialogController +{ + std::unique_ptr m_xMtrScale; + +public: + FontworkCharacterSpacingDialog(weld::Window* pParent, sal_Int32 nScale); + virtual ~FontworkCharacterSpacingDialog() override; + + sal_Int32 getScale() const; +}; + +class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC FontWorkGalleryDialog final : public weld::GenericDialogController +{ + sal_uInt16 mnThemeId; + SdrView& mrSdrView; + + SdrObject** mppSdrObject; + SdrModel* mpDestModel; + + std::vector maFavoritesHorizontal; + + ValueSet maCtlFavorites; + std::unique_ptr mxCtlFavorites; + std::unique_ptr mxOKButton; + + void initFavorites(sal_uInt16 nThemeId); + void insertSelectedFontwork(); + void fillFavorites(sal_uInt16 nThemeId); + + DECL_LINK(DoubleClickFavoriteHdl, ValueSet*, void); + DECL_LINK(ClickOKHdl, weld::Button&, void ); + +public: + FontWorkGalleryDialog(weld::Window* pParent, SdrView& rView); + virtual ~FontWorkGalleryDialog() override; + + // SJ: if the SdrObject** is set, the SdrObject is not inserted into the page when executing the dialog + void SetSdrObjectRef( SdrObject**, SdrModel* pModel ); +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/formatpaintbrushctrl.hxx b/include/svx/formatpaintbrushctrl.hxx new file mode 100644 index 000000000..826344064 --- /dev/null +++ b/include/svx/formatpaintbrushctrl.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_SVX_FORMATPAINTBRUSHCTRL_HXX +#define INCLUDED_SVX_FORMATPAINTBRUSHCTRL_HXX + +#include +#include +#include + + +namespace svx +{ + + +class SAL_WARN_UNUSED SVX_DLLPUBLIC FormatPaintBrushToolBoxControl final : public SfxToolBoxControl +{ +public: + SFX_DECL_TOOLBOX_CONTROL(); + FormatPaintBrushToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ); + virtual ~FormatPaintBrushToolBoxControl() override; + + virtual void DoubleClick() override; + virtual void Click() override; + virtual void Select(sal_uInt16 nSelectModifier) override; + + virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, + const SfxPoolItem* pState ) override; +private: + DECL_LINK( WaitDoubleClickHdl, Timer*, void ); + void impl_executePaintBrush(); + +private: + bool m_bPersistentCopy;//indicates that the content of the format clipboard should not be erased after paste + Timer m_aDoubleClickTimer; +}; + + +} //namespace svx + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/framebordertype.hxx b/include/svx/framebordertype.hxx new file mode 100644 index 000000000..2eda99606 --- /dev/null +++ b/include/svx/framebordertype.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_SVX_FRAMEBORDERTYPE_HXX +#define INCLUDED_SVX_FRAMEBORDERTYPE_HXX + +#include + +namespace svx { + + +/** Enumerates all borders a frame selection control can contain. */ +enum class FrameBorderType +{ + NONE, /// No border (special state). + Left, /// Left frame border. + Right, /// Right frame border. + Top, /// Top frame border. + Bottom, /// Bottom frame border. + Horizontal, /// Inner horizontal frame border. + Vertical, /// Inner vertical frame border. + TLBR, /// Top-left to bottom-right frame border. + BLTR /// Bottom-left to top-right frame border. +}; + +/** The number of valid frame border types (excluding FrameBorderType::NONE). */ +const int FRAMEBORDERTYPE_COUNT = 8; + +/** Returns the frame border type from a 0-based integer index. */ +SVX_DLLPUBLIC FrameBorderType GetFrameBorderTypeFromIndex( size_t nIndex ); + +/** Returns the zero-based index of a valid frame border type. */ +size_t GetIndexFromFrameBorderType( FrameBorderType eBorder ); + + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/framelink.hxx b/include/svx/framelink.hxx new file mode 100644 index 000000000..ec94bda63 --- /dev/null +++ b/include/svx/framelink.hxx @@ -0,0 +1,205 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_FRAMELINK_HXX +#define INCLUDED_SVX_FRAMELINK_HXX + +#include +#include +#include +#include + +#include + +namespace svx { +namespace frame { + + +// Enums + + +/** Specifies how the reference points for frame borders are used. + */ +enum class RefMode +{ + /** Frame borders are drawn centered to the reference points. */ + Centered, + + /** The reference points specify the begin of the frame border width. + + The result is that horizontal lines are drawn below, and vertical lines + are drawn right of the reference points. + */ + Begin, + + /** The reference points specify the end of the frame border width. + + The result is that horizontal lines are drawn above, and vertical lines + are drawn left of the reference points. + */ + End +}; + + +// Classes + + +/** Contains the widths of primary and secondary line of a frame style. + + In the following, "frame style" is a complete style of one frame border, + i.e. the double line at the left side of the frame. A "line" is always a + trivial single line, i.e. the first line of a double frame style. + + The following states of the members of this struct are valid: + + mnPrim mnDist mnSecn frame style + ------------------------------------------------- + 0 0 0 invisible + >0 0 0 single + >0 >0 >0 double + + The behaviour of the member functions for other states is not defined. + + Per definition the primary line in double frame styles is: + - The top line for horizontal frame borders. + - The left line for vertical frame borders. + - The bottom-left line for top-left to bottom-right diagonal frame borders. + - The top-left line for bottom-left to top-right diagonal frame borders. + + The following picture shows the upper end of a vertical double frame + border. + + |<---------------- GetWidth() ----------------->| + | | + |<----- mnPrim ----->||<- mnDist ->||<- mnSecn >| + | || || | + ###################### ############# + ###################### ############# + ###################### ############# + ###################### ############# + ###################### | ############# + ###################### | ############# + | + |<- middle of the frame border + */ +class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC Style +{ +private: + class implStyle + { + private: + friend class Style; + + Color maColorPrim; + Color maColorSecn; + Color maColorGap; + bool mbUseGapColor; + RefMode meRefMode; /// Reference point handling for this frame border. + double mfPrim; /// Width of primary (single, left, or top) line. + double mfDist; /// Distance between primary and secondary line. + double mfSecn; /// Width of secondary (right or bottom) line. + double mfPatternScale; /// Scale used for line pattern spacing. + SvxBorderLineStyle mnType; + bool mbWordTableCell; + + public: + /** Constructs an invisible frame style. */ + explicit implStyle() : + maColorPrim(), + maColorSecn(), + maColorGap(), + mbUseGapColor(false), + meRefMode(RefMode::Centered), + mfPrim(0.0), + mfDist(0.0), + mfSecn(0.0), + mfPatternScale(1.0), + mnType(SvxBorderLineStyle::SOLID), + mbWordTableCell(false) + {} + }; + + /// the impl class holding the data + std::shared_ptr< implStyle > maImplStyle; + + /// call to set maImplStyle on demand + void implEnsureImplStyle(); + +public: + /** Constructs an invisible frame style. */ + explicit Style(); + /** Constructs a frame style with passed line widths. */ + explicit Style( double nP, double nD, double nS, SvxBorderLineStyle nType, double fScale ); + /** Constructs a frame style with passed color and line widths. */ + explicit Style( const Color& rColorPrim, const Color& rColorSecn, const Color& rColorGap, bool bUseGapColor, double nP, double nD, double nS, SvxBorderLineStyle nType, double fScale ); + /** Constructs a frame style from the passed SvxBorderLine struct. */ + explicit Style( const editeng::SvxBorderLine* pBorder, double fScale ); + + RefMode GetRefMode() const { if(!maImplStyle) return RefMode::Centered; return maImplStyle->meRefMode; } + Color GetColorPrim() const { if(!maImplStyle) return Color(); return maImplStyle->maColorPrim; } + Color GetColorSecn() const { if(!maImplStyle) return Color(); return maImplStyle->maColorSecn; } + Color GetColorGap() const { if(!maImplStyle) return Color(); return maImplStyle->maColorGap; } + bool UseGapColor() const { if(!maImplStyle) return false; return maImplStyle->mbUseGapColor; } + double Prim() const { if(!maImplStyle) return 0.0; return maImplStyle->mfPrim; } + double Dist() const { if(!maImplStyle) return 0.0; return maImplStyle->mfDist; } + double Secn() const { if(!maImplStyle) return 0.0; return maImplStyle->mfSecn; } + double PatternScale() const { if(!maImplStyle) return 1.0; return maImplStyle->mfPatternScale;} + SvxBorderLineStyle Type() const { if(!maImplStyle) return SvxBorderLineStyle::SOLID; return maImplStyle->mnType; } + + /// Check if this style is used - this depends on it having any width definition. + /// As can be seen in the definition comment above, Prim() *must* be non zero to have a width + bool IsUsed() const { if(!maImplStyle) return false; return 0.0 != maImplStyle->mfPrim; } + + /** Returns the total width of this frame style. */ + double GetWidth() const { if(!maImplStyle) return 0.0; implStyle* pTarget = maImplStyle.get(); return pTarget->mfPrim + pTarget->mfDist + pTarget->mfSecn; } + + /** Sets the frame style to invisible state. */ + void Clear(); + /** Sets the frame style to the passed line widths. */ + void Set( double nP, double nD, double nS ); + /** Sets the frame style to the passed line widths. */ + void Set( const Color& rColorPrim, const Color& rColorSecn, const Color& rColorGap, bool bUseGapColor, double nP, double nD, double nS ); + /** Sets the frame style to the passed SvxBorderLine struct. If nullptr, resets the style */ + void Set( const editeng::SvxBorderLine* pBorder, double fScale, sal_uInt16 nMaxWidth = SAL_MAX_UINT16 ); + + /** Sets a new reference point handling mode, does not modify other settings. */ + void SetRefMode( RefMode eRefMode ); + /** Sets a new color, does not modify other settings. */ + void SetColorPrim( const Color& rColor ); + void SetColorSecn( const Color& rColor ); + /** Sets whether to use dotted style for single hair lines. */ + void SetType( SvxBorderLineStyle nType ); + + /** Mirrors this style (exchanges primary and secondary), if it is a double frame style. */ + Style& MirrorSelf(); + + /** Enables the Word-compatible Style comparison code. */ + void SetWordTableCell(bool bWordTableCell); + + bool operator==( const Style& rOther) const; + bool operator<( const Style& rOther) const; +}; + +inline bool operator>( const Style& rL, const Style& rR ) { return rR.operator<(rL); } + +} +} + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/framelinkarray.hxx b/include/svx/framelinkarray.hxx new file mode 100644 index 000000000..d15e6d2be --- /dev/null +++ b/include/svx/framelinkarray.hxx @@ -0,0 +1,324 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_FRAMELINKARRAY_HXX +#define INCLUDED_SVX_FRAMELINKARRAY_HXX + +#include +#include +#include +#include + +class Color; + +namespace svx { +namespace frame { + +struct ArrayImpl; +class Style; + +/** Stores frame styles of an array of cells, supports merged ranges. + + This class is able to store the frame styles of an array of cells and to + draw the entire array or parts of it to any output device. + + Every cell contains the style of the left, right, top, bottom, top-left to + bottom-right, and bottom-left to top-right frame border. + + On drawing, the thicker frame border of neighbored cells is selected + automatically. All borders are drawn "connected", that means, the correct + start and end coordinates of all lines of the borders are calculated, + especially, if they are drawn together with diagonal frame borders. + + This array fully supports merged cell ranges. In a merged range, the frame + borders of the top-left cell is extended to the entire range, and all other + cells in that range are overlapped. Again, all connected frame borders, + also diagonals and frame borders from adjacent merged ranges, are handled + automatically. + + Additionally, a clipping range can be set. If such a range is used, all + frame borders outside this range are completely ignored, and are not used + in the connected border calculation anymore. + + The array can be mirrored in both directions. It is possible to specify, + whether to mirror the double frame styles, and whether to swap diagonal + frame borders. + */ +class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC Array +{ +public: + /** Constructs an empty array. */ + explicit Array(); + + /** Destructs the array. */ + ~Array(); + + // array size and column/row indexes + + /** Reinitializes the array with the specified size. Clears all styles. */ + void Initialize( size_t nWidth, size_t nHeight ); + + /** Returns the number of columns in the array. */ + size_t GetColCount() const; + + /** Returns the number of rows in the array. */ + size_t GetRowCount() const; + + /** Returns the number of cells in the array. */ + size_t GetCellCount() const; + + /** Returns the cell index from the cell address (nCol,nRow). */ + size_t GetCellIndex( size_t nCol, size_t nRow, bool bRTL) const; + + // cell border styles + + /** Sets the left frame style of the cell (nCol,nRow). Ignores merged ranges. */ + void SetCellStyleLeft( size_t nCol, size_t nRow, const Style& rStyle ); + + /** Sets the right frame style of the cell (nCol,nRow). Ignores merged ranges. */ + void SetCellStyleRight( size_t nCol, size_t nRow, const Style& rStyle ); + + /** Sets the top frame style of the cell (nCol,nRow). Ignores merged ranges. */ + void SetCellStyleTop( size_t nCol, size_t nRow, const Style& rStyle ); + + /** Sets the bottom frame style of the specified cell (nCol,nRow). Ignores merged ranges. */ + void SetCellStyleBottom( size_t nCol, size_t nRow, const Style& rStyle ); + + /** Sets the top-left to bottom-right frame style of the cell (nCol,nRow). Ignores merged ranges. */ + void SetCellStyleTLBR( size_t nCol, size_t nRow, const Style& rStyle ); + + /** Sets the bottom-left to top-right frame style of the cell (nCol,nRow). Ignores merged ranges. */ + void SetCellStyleBLTR( size_t nCol, size_t nRow, const Style& rStyle ); + + /** Sets both diagonal frame styles of the specified cell (nCol,nRow). Ignores merged ranges. */ + void SetCellStyleDiag( size_t nCol, size_t nRow, const Style& rTLBR, const Style& rBLTR ); + + /** Sets the left frame style of the specified column. Ignores merged ranges. */ + void SetColumnStyleLeft( size_t nCol, const Style& rStyle ); + + /** Sets the right frame style of the specified column. Ignores merged ranges. */ + void SetColumnStyleRight( size_t nCol, const Style& rStyle ); + + /** Sets the top frame style of the specified row. Ignores merged ranges. */ + void SetRowStyleTop( size_t nRow, const Style& rStyle ); + + /** Sets the bottom frame style of the specified row. Ignores merged ranges. */ + void SetRowStyleBottom( size_t nRow, const Style& rStyle ); + + /** Sets the rotation parameters of the cell (nCol,nRow). Ignores merged ranges. */ + void SetCellRotation(size_t nCol, size_t nRow, SvxRotateMode eRotMode, double fOrientation); + + /** Check if at least one cell is rotated */ + bool HasCellRotation() const; + + /** Returns the left frame style of the cell (nCol,nRow). + Returns thicker of own left style or right style of the cell to the left. + Returns the style only if visible (i.e. at left border of a merged range). + @return + The left frame style or an invisible style for invalid cell addresses. */ + const Style& GetCellStyleLeft( size_t nCol, size_t nRow ) const; + + /** Returns the right frame style of the cell (nCol,nRow). + Returns thicker of own right style or left style of the cell to the right. + Returns the style only if visible (i.e. at right border of a merged range). + @return + The left frame style or an invisible style for invalid cell addresses. */ + const Style& GetCellStyleRight( size_t nCol, size_t nRow ) const; + + /** Returns the top frame style of the cell (nCol,nRow). + Returns thicker of own top style or bottom style of the cell above. + Returns the style only if visible (i.e. at top border of a merged range). + @return + The top frame style or an invisible style for invalid cell addresses. */ + const Style& GetCellStyleTop( size_t nCol, size_t nRow ) const; + + /** Returns the top frame style of the cell (nCol,nRow). + Returns thicker of own top style or bottom style of the cell above. + Returns the style only if visible (i.e. at top border of a merged range). + @return + The top frame style or an invisible style for invalid cell addresses. */ + const Style& GetCellStyleBottom( size_t nCol, size_t nRow ) const; + + /** Returns the top-left to bottom-right frame style of the cell (nCol,nRow). + Ignores merged ranges; + @return + The top-left to bottom-right frame style or an invisible style for invalid cell addresses. */ + const Style& GetCellStyleTLBR( size_t nCol, size_t nRow ) const; + + /** Returns the bottom-left to top-right frame style of the cell (nCol,nRow). + Ignores merged ranges; + @return + The bottom-left to top-right frame style or an invisible style for invalid cell addresses. */ + const Style& GetCellStyleBLTR( size_t nCol, size_t nRow ) const; + + /** Returns the top-left to bottom-right frame style of the cell (nCol,nRow). + @return + The top-left to bottom-right frame style, if the cell is not part of + a merged range, or if (nCol,nRow) is the top-left corner of a merged + range (useful to find connected frame styles). + An invisible style for invalid cell addresses. */ + const Style& GetCellStyleTL( size_t nCol, size_t nRow ) const; + + /** Returns the top-left to bottom-right frame style of the cell (nCol,nRow). + @return + The top-left to bottom-right frame style, if the cell is not part of + a merged range, or if (nCol,nRow) is the bottom-right corner of a + merged range (useful to find connected frame styles). + An invisible style for invalid cell addresses. */ + const Style& GetCellStyleBR( size_t nCol, size_t nRow ) const; + + /** Returns the bottom-left to top-right frame style of the cell (nCol,nRow). + @return + The bottom-left to top-right frame style, if the cell is not part of + a merged range, or if (nCol,nRow) is the bottom-left corner of a + merged range (useful to find connected frame styles). + An invisible style for invalid cell addresses. */ + const Style& GetCellStyleBL( size_t nCol, size_t nRow ) const; + + /** Returns the bottom-left to top-right frame style of the cell (nCol,nRow). + @return + The bottom-left to top-right frame style, if the cell is not part of + a merged range, or if (nCol,nRow) is the top-right corner of a + merged range (useful to find connected frame styles). + An invisible style for invalid cell addresses. */ + const Style& GetCellStyleTR( size_t nCol, size_t nRow ) const; + + // cell merging + + /** Inserts a new merged cell range. + @precond The range must not intersect other merged ranges. */ + void SetMergedRange( size_t nFirstCol, size_t nFirstRow, size_t nLastCol, size_t nLastRow ); + + /** Sets an additional left width for the merged range that contains (nCol,nRow). + @descr Useful to handle merged ranges that are not completely part of the array. + @precond The merged range must be at the left border of the array. */ + void SetAddMergedLeftSize( size_t nCol, size_t nRow, long nAddSize ); + + /** Sets an additional right width for the merged range that contains (nCol,nRow). + @descr Useful to handle merged ranges that are not completely part of the array. + @precond The merged range must be at the right border of the array. */ + void SetAddMergedRightSize( size_t nCol, size_t nRow, long nAddSize ); + + /** Sets an additional top height for the merged range that contains (nCol,nRow). + @descr Useful to handle merged ranges that are not completely part of the array. + @precond The merged range must be at the top border of the array. */ + void SetAddMergedTopSize( size_t nCol, size_t nRow, long nAddSize ); + + /** Sets an additional bottom height for the merged range that contains (nCol,nRow). + @descr Useful to handle merged ranges that are not completely part of the array. + @precond The merged range must be at the bottom border of the array. */ + void SetAddMergedBottomSize( size_t nCol, size_t nRow, long nAddSize ); + + /** Returns true, if the cell (nCol,nRow) is part of a merged range. */ + bool IsMerged( size_t nCol, size_t nRow ) const; + + /** Returns the address of the top-left cell of the merged range that contains (nCol,nRow). */ + void GetMergedOrigin( size_t& rnFirstCol, size_t& rnFirstRow, size_t nCol, size_t nRow ) const; + + /** Returns the top-left and bottom-right address of the merged range that contains (nCol,nRow). */ + void GetMergedRange( size_t& rnFirstCol, size_t& rnFirstRow, + size_t& rnLastCol, size_t& rnLastRow, size_t nCol, size_t nRow ) const; + + // clipping + + /** Sets a clipping range. + @descr + No cell borders outside of this clipping range will be drawn. In + difference to simply using the CreateB2DPrimitiveRange() function with the same + range, a clipping range causes the drawing functions to completely + ignore the frame styles connected from outside. This is used i.e. + in Calc to print single pages and to draw the print preview. + Partly visible diagonal frame borders in merged ranges are correctly + clipped too. This array can handle only one clip range at a time. */ + void SetClipRange( size_t nFirstCol, size_t nFirstRow, size_t nLastCol, size_t nLastRow ); + + // cell coordinates + + /** Sets the X output coordinate of the left column. */ + void SetXOffset( long nXOffset ); + + /** Sets the Y output coordinate of the top row. */ + void SetYOffset( long nYOffset ); + + /** Sets the output width of the specified column. */ + void SetColWidth( size_t nCol, long nWidth ); + + /** Sets the output height of the specified row. */ + void SetRowHeight( size_t nRow, long nHeight ); + + /** Sets the same output width for all columns. */ + void SetAllColWidths( long nWidth ); + + /** Sets the same output height for all rows. */ + void SetAllRowHeights( long nHeight ); + + /** Returns the X output coordinate of the left border of the specified column. + @descr The column index returns the X output coordinate + of the right array border. */ + long GetColPosition( size_t nCol ) const; + + /** Returns the Y output coordinate of the top border of the specified row. + @descr The row index returns the Y output coordinate + of the bottom array border. */ + long GetRowPosition( size_t nRow ) const; + + /** Returns the output width of the specified range of columns. */ + long GetColWidth( size_t nFirstCol, size_t nLastCol ) const; + + /** Returns the output height of the specified range of rows. */ + long GetRowHeight( size_t nFirstRow, size_t nLastRow ) const; + + /** Returns the output width of the entire array. */ + long GetWidth() const; + + /** Returns the output height of the entire array. */ + long GetHeight() const; + + /** Returns the output range of the cell (nCol,nRow). + Returns total output range of merged ranges, if bExpandMerged is true. */ + basegfx::B2DRange GetCellRange( size_t nCol, size_t nRow, bool bExpandMerged ) const; + + // mirroring + + /** Mirrors the entire array horizontally. */ + void MirrorSelfX(); + + // drawing + + /** Draws the part of the specified range, that is inside the clipping range. + @param pForceColor + If not NULL, only this color will be used to draw all frame borders. */ + drawinglayer::primitive2d::Primitive2DContainer CreateB2DPrimitiveRange( + size_t nFirstCol, size_t nFirstRow, + size_t nLastCol, size_t nLastRow, + const Color* pForceColor ) const; + + /** Draws the part of the array, that is inside the clipping range. */ + drawinglayer::primitive2d::Primitive2DContainer CreateB2DPrimitiveArray() const; + +private: + std::unique_ptr mxImpl; +}; + +} +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/frmdirlbox.hxx b/include/svx/frmdirlbox.hxx new file mode 100644 index 000000000..4a508eea5 --- /dev/null +++ b/include/svx/frmdirlbox.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_SVX_FRMDIRLBOX_HXX +#define INCLUDED_SVX_FRMDIRLBOX_HXX + +#include +#include +#include + +namespace svx { + +/** This listbox contains entries to select horizontal text direction. + + The control works on the SvxFrameDirection enumeration (i.e. left-to-right, + right-to-left), used i.e. in conjunction with the SvxFrameDirectionItem. + */ +class SAL_WARN_UNUSED SVX_DLLPUBLIC FrameDirectionListBox +{ +private: + std::unique_ptr m_xControl; +public: + explicit FrameDirectionListBox(std::unique_ptr pControl); + virtual ~FrameDirectionListBox(); + bool get_visible() const { return m_xControl->get_visible(); } + void save_value() { m_xControl->save_value(); } + bool get_value_changed_from_saved() const { return m_xControl->get_value_changed_from_saved(); } + SvxFrameDirection get_active_id() const { return static_cast(m_xControl->get_active_id().toUInt32()); } + void set_active_id(SvxFrameDirection eDir) { m_xControl->set_active_id(OUString::number(static_cast(eDir))); } + void remove_id(SvxFrameDirection eDir) + { + int nPos = m_xControl->find_id(OUString::number(static_cast(eDir))); + if (nPos != -1) + m_xControl->remove(nPos); + } + void set_active(int pos) { m_xControl->set_active(pos); } + int get_active() const { return m_xControl->get_active(); } + void set_sensitive(bool bSensitive) { m_xControl->set_sensitive(bSensitive); } + void hide() { m_xControl->hide(); } + void set_visible(bool bVisible) { m_xControl->set_visible(bVisible); } + void show() { m_xControl->show(); } + int get_count() const { return m_xControl->get_count(); } + /** Inserts a string with corresponding direction enum into the listbox. */ + void append(SvxFrameDirection eDirection, const OUString& rString) + { + m_xControl->append(OUString::number(static_cast(eDirection)), rString); + } + void connect_changed(const Link& rLink) { m_xControl->connect_changed(rLink); } +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/frmsel.hxx b/include/svx/frmsel.hxx new file mode 100644 index 000000000..f9a619525 --- /dev/null +++ b/include/svx/frmsel.hxx @@ -0,0 +1,192 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_FRMSEL_HXX +#define INCLUDED_SVX_FRMSEL_HXX + +#include +#include +#include +#include +#include +#include + +class Color; + +enum class FrameSelFlags +{ + NONE = 0x0000, + /** If set, the left frame border is enabled. */ + Left = 0x0001, + /** If set, the right frame border is enabled. */ + Right = 0x0002, + /** If set, the top frame border is enabled. */ + Top = 0x0004, + /** If set, the bottom frame border is enabled. */ + Bottom = 0x0008, + /** If set, the inner horizontal frame border is enabled. */ + InnerHorizontal = 0x0010, + /** If set, the inner vertical frame border is enabled. */ + InnerVertical = 0x0020, + /** If set, the top-left to bottom-right diagonal frame border is enabled. */ + DiagonalTLBR = 0x0040, + /** If set, the bottom-left to top-right diagonal frame border is enabled. */ + DiagonalBLTR = 0x0080, + + /** If set, all four outer frame borders are enabled. */ + Outer = Left | Right | Top | Bottom, + + /** If set, all frame borders will support the don't care state. */ + DontCare = 0x0100 +}; +namespace o3tl +{ + template<> struct typed_flags : is_typed_flags {}; +} + +namespace svx { + +struct FrameSelectorImpl; +namespace a11y { class AccFrameSelectorChild; } + +/** All possible states of a frame border. */ +enum class FrameBorderState +{ + Show, /// Frame border has a visible style. + Hide, /// Frame border is hidden (off). + DontCare /// Frame border is in don't care state (if enabled). +}; + + +namespace a11y +{ + class AccFrameSelector; +} + +class SAL_WARN_UNUSED SVX_DLLPUBLIC FrameSelector final : public weld::CustomWidgetController +{ +public: + FrameSelector(); + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; + virtual ~FrameSelector() override; + + /** Initializes the control, enables/disables frame borders according to flags. */ + void Initialize( FrameSelFlags nFlags ); + + // enabled frame borders + + /** Returns true, if the specified frame border is enabled. */ + bool IsBorderEnabled( FrameBorderType eBorder ) const; + /** Returns the number of enabled frame borders. */ + sal_Int32 GetEnabledBorderCount() const; + /** Returns the border type from the passed index (counts only enabled frame borders). */ + FrameBorderType GetEnabledBorderType( sal_Int32 nIndex ) const; + + // frame border state and style + + /** Returns true, if the control supports the "don't care" frame border state. */ + bool SupportsDontCareState() const; + + /** Returns the state (visible/hidden/don't care) of the specified frame border. */ + FrameBorderState GetFrameBorderState( FrameBorderType eBorder ) const; + /** Returns the style of the specified frame border, if it is visible. */ + const editeng::SvxBorderLine* GetFrameBorderStyle( FrameBorderType eBorder ) const; + + /** Shows the specified frame border using the passed style, or hides it, if pStyle is 0. */ + void ShowBorder( FrameBorderType eBorder, const editeng::SvxBorderLine* pStyle ); + /** Sets the specified frame border to "don't care" state. */ + void SetBorderDontCare( FrameBorderType eBorder ); + + /** Returns true, if any enabled frame border has a visible style (not "don't care"). */ + bool IsAnyBorderVisible() const; + /** Hides all enabled frame borders. */ + void HideAllBorders(); + + /** Returns true, if all visible frame borders have equal widths. + @descr Ignores hidden and "don't care" frame borders. On success, + returns the width in the passed parameter. */ + bool GetVisibleWidth( long& rnWidth, SvxBorderLineStyle& rnStyle ) const; + /** Returns true, if all visible frame borders have equal color. + @descr Ignores hidden and "don't care" frame borders. On success, + returns the color in the passed parameter. */ + bool GetVisibleColor( Color& rColor ) const; + + // frame border selection + + /** Returns the current selection handler. */ + const Link& GetSelectHdl() const; + /** Sets the passed handler that is called if the selection of the control changes. */ + void SetSelectHdl( const Link& rHdl ); + + /** Returns true, if the specified frame border is selected. */ + bool IsBorderSelected( FrameBorderType eBorder ) const; + /** Selects or deselects the specified frame border. */ + void SelectBorder( FrameBorderType eBorder ); + /** Returns true, if any of the enabled frame borders is selected. */ + bool IsAnyBorderSelected() const; + /** Selects or deselects all frame borders. */ + void SelectAllBorders( bool bSelect ); + /** Deselects all frame borders. */ + void DeselectAllBorders() { SelectAllBorders( false ); } + + /** Selects or deselects all visible frame borders (ignores hidden and "don't care" borders). */ + void SelectAllVisibleBorders(); + + /** Sets the passed line widths to all selected frame borders (in twips). */ + void SetStyleToSelection( long nWidth, SvxBorderLineStyle nStyle ); + /** Sets the passed color to all selected frame borders. */ + void SetColorToSelection( const Color& rColor ); + + // accessibility + + css::uno::Reference getAccessibleParent() const { return GetDrawingArea()->get_accessible_parent(); } + virtual css::uno::Reference CreateAccessible() override; + a11yrelationset get_accessible_relation_set() const { return GetDrawingArea()->get_accessible_relation_set(); } + + /** Returns the accessibility child object of the specified frame border (if enabled). */ + rtl::Reference< a11y::AccFrameSelectorChild > + GetChildAccessible( FrameBorderType eBorder ); + /** Returns the accessibility child object with specified index (counts enabled frame borders only). */ + css::uno::Reference< css::accessibility::XAccessible > + GetChildAccessible( sal_Int32 nIndex ); + /** Returns the accessibility child object at the specified position (relative to control). */ + css::uno::Reference< css::accessibility::XAccessible > + GetChildAccessible( const Point& rPos ); + + /** Returns the bounding rectangle of the specified frame border (if enabled). */ + tools::Rectangle GetClickBoundRect( FrameBorderType eBorder ) const; + +private: + virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override; + virtual bool MouseButtonDown( const MouseEvent& rMEvt ) override; + virtual bool KeyInput( const KeyEvent& rKEvt ) override; + virtual void GetFocus() override; + virtual void LoseFocus() override; + virtual void StyleUpdated() override; + virtual void Resize() override; + + rtl::Reference mxAccess; /// Pointer to accessibility object of the control. + std::unique_ptr< FrameSelectorImpl > mxImpl; +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/galctrl.hxx b/include/svx/galctrl.hxx new file mode 100644 index 000000000..4bb37f68f --- /dev/null +++ b/include/svx/galctrl.hxx @@ -0,0 +1,120 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_GALCTRL_HXX +#define INCLUDED_SVX_GALCTRL_HXX + +#include +#include +#include +#include +#include +#include + +class GalleryDragDrop; +class GalleryTheme; +class GalleryBrowser2; +class INetURLObject; + +class GalleryPreview final : public weld::CustomWidgetController +{ +private: + + std::unique_ptr mxDragDropTargetHelper; + std::unique_ptr mxScrolledWindow; + GraphicObject aGraphicObj; + tools::Rectangle aPreviewRect; + GalleryBrowser2* mpParent; + GalleryTheme* mpTheme; + + bool ImplGetGraphicCenterRect( const Graphic& rGraphic, tools::Rectangle& rResultRect ) const; + + // Window + virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override; + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; + virtual bool MouseButtonDown(const MouseEvent& rMEvt) override; + virtual bool Command(const CommandEvent& rCEvt) override; + virtual bool KeyInput( const KeyEvent& rKEvt ) override; + +public: + + GalleryPreview(GalleryBrowser2* pParent, std::unique_ptr xScrolledWindow); + void SetTheme(GalleryTheme* pTheme) { mpTheme = pTheme; } + virtual ~GalleryPreview() override; + + virtual bool StartDrag() override; + + virtual void Show() override; + virtual void Hide() override; + + void SetGraphic( const Graphic& rGraphic ) { aGraphicObj.SetGraphic( rGraphic ); } + static void PreviewMedia( const INetURLObject& rURL ); +}; + +class SVXCORE_DLLPUBLIC DialogGalleryPreview final : public weld::CustomWidgetController +{ +private: + GraphicObject aGraphicObj; + tools::Rectangle aPreviewRect; + + SVX_DLLPRIVATE bool ImplGetGraphicCenterRect( const Graphic& rGraphic, tools::Rectangle& rResultRect ) const; + + SVX_DLLPRIVATE virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override; + +public: + + DialogGalleryPreview(); + + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; + void SetGraphic( const Graphic& rGraphic ) { aGraphicObj.SetGraphic( rGraphic ); } + bool SetGraphic( const INetURLObject& ); +}; + +class GalleryIconView final : public ValueSet +{ +private: + std::unique_ptr mxDragDropTargetHelper; + + GalleryBrowser2* mpParent; + GalleryTheme* mpTheme; + + // ValueSet + virtual void UserDraw( const UserDrawEvent& rUDEvt ) override; + + // Window + virtual bool MouseButtonDown( const MouseEvent& rMEvt ) override; + virtual bool Command( const CommandEvent& rCEvt ) override; + virtual bool KeyInput( const KeyEvent& rKEvt ) override; + + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; + +public: + + GalleryIconView(GalleryBrowser2* pParent, std::unique_ptr xScrolledWindow); + void SetTheme(GalleryTheme* pTheme) { mpTheme = pTheme; } + virtual ~GalleryIconView() override; + + virtual bool StartDrag() override; + + static void drawTransparenceBackground(vcl::RenderContext& rOut, const Point& rPos, const Size& rSize); +}; + +#endif // INCLUDED_SVX_GALCTRL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/gallery.hxx b/include/svx/gallery.hxx new file mode 100644 index 000000000..28d99de9f --- /dev/null +++ b/include/svx/gallery.hxx @@ -0,0 +1,137 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_GALLERY_HXX +#define INCLUDED_SVX_GALLERY_HXX + +#include +#include +#include + +// Defines for preinstalled themes +#define GALLERY_THEME_3D 1 +#define GALLERY_THEME_BULLETS 3 +#define GALLERY_THEME_HOMEPAGE 10 +#define GALLERY_THEME_HTMLBUTTONS 15 +#define GALLERY_THEME_POWERPOINT 16 +#define GALLERY_THEME_RULERS 17 +#define GALLERY_THEME_SOUNDS 18 +#define GALLERY_THEME_MYTHEME 20 +#define GALLERY_THEME_USERSOUNDS 21 +#define GALLERY_THEME_DUMMY5 36 +#define GALLERY_THEME_FONTWORK 37 +#define GALLERY_THEME_FONTWORK_VERTICAL 38 + +#define RID_GALLERY_THEME_START (6000) + +// ATTENTION: This list has to be in sync with +// * share/gallery (theme files are identified by id) +// +// Since galleries may be copied from older offices to newer, do *never* change +// these IDs except adding new ones (and adapting GALLERY_THEME_LAST). The ID +// *is* written into the binary file *.thm (which is a gallery theme combined +// of three files, *.thm, *.sdv and *.sdg) + +#define RID_GALLERY_THEME_3D (RID_GALLERY_THEME_START + 1) +#define RID_GALLERY_THEME_ANIMATIONS (RID_GALLERY_THEME_START + 2) +#define RID_GALLERY_THEME_BULLETS (RID_GALLERY_THEME_START + 3) +#define RID_GALLERY_THEME_OFFICE (RID_GALLERY_THEME_START + 4) +#define RID_GALLERY_THEME_FLAGS (RID_GALLERY_THEME_START + 5) +#define RID_GALLERY_THEME_FLOWCHARTS (RID_GALLERY_THEME_START + 6) +#define RID_GALLERY_THEME_EMOTICONS (RID_GALLERY_THEME_START + 7) +#define RID_GALLERY_THEME_PHOTOS (RID_GALLERY_THEME_START + 8) +#define RID_GALLERY_THEME_BACKGROUNDS (RID_GALLERY_THEME_START + 9) +#define RID_GALLERY_THEME_HOMEPAGE (RID_GALLERY_THEME_START + 10) +#define RID_GALLERY_THEME_INTERACTION (RID_GALLERY_THEME_START + 11) +#define RID_GALLERY_THEME_MAPS (RID_GALLERY_THEME_START + 12) +#define RID_GALLERY_THEME_PEOPLE (RID_GALLERY_THEME_START + 13) +#define RID_GALLERY_THEME_SURFACES (RID_GALLERY_THEME_START + 14) + +#define RID_GALLERY_THEME_SOUNDS (RID_GALLERY_THEME_START + 18) +#define RID_GALLERY_THEME_SYMBOLS (RID_GALLERY_THEME_START + 19) +#define RID_GALLERY_THEME_MYTHEME (RID_GALLERY_THEME_START + 20) + +#define RID_GALLERY_THEME_ARROWS (RID_GALLERY_THEME_START + 22) +#define RID_GALLERY_THEME_BALLOONS (RID_GALLERY_THEME_START + 23) +#define RID_GALLERY_THEME_KEYBOARD (RID_GALLERY_THEME_START + 24) +#define RID_GALLERY_THEME_TIME (RID_GALLERY_THEME_START + 25) +#define RID_GALLERY_THEME_PRESENTATION (RID_GALLERY_THEME_START + 26) +#define RID_GALLERY_THEME_CALENDAR (RID_GALLERY_THEME_START + 27) +#define RID_GALLERY_THEME_NAVIGATION (RID_GALLERY_THEME_START + 28) +#define RID_GALLERY_THEME_COMMUNICATION (RID_GALLERY_THEME_START + 29) +#define RID_GALLERY_THEME_FINANCES (RID_GALLERY_THEME_START + 30) +#define RID_GALLERY_THEME_COMPUTER (RID_GALLERY_THEME_START + 31) +#define RID_GALLERY_THEME_CLIMA (RID_GALLERY_THEME_START + 32) +#define RID_GALLERY_THEME_EDUCATION (RID_GALLERY_THEME_START + 33) +#define RID_GALLERY_THEME_TROUBLE (RID_GALLERY_THEME_START + 34) +#define RID_GALLERY_THEME_SCREENBEANS (RID_GALLERY_THEME_START + 35) + +#define RID_GALLERY_THEME_COMPUTERS (RID_GALLERY_THEME_START + 39) +#define RID_GALLERY_THEME_DIAGRAMS (RID_GALLERY_THEME_START + 40) +#define RID_GALLERY_THEME_ENVIRONMENT (RID_GALLERY_THEME_START + 41) +#define RID_GALLERY_THEME_FINANCE (RID_GALLERY_THEME_START + 42) +#define RID_GALLERY_THEME_TRANSPORT (RID_GALLERY_THEME_START + 43) +#define RID_GALLERY_THEME_TXTSHAPES (RID_GALLERY_THEME_START + 44) + +#define RID_GALLERY_THEME_FIRST RID_GALLERY_THEME_3D +#define RID_GALLERY_THEME_LAST RID_GALLERY_THEME_TXTSHAPES + +class SdrModel; +class Graphic; +class BitmapEx; + +class SVXCORE_DLLPUBLIC GalleryExplorer +{ +public: + + static bool FillThemeList( std::vector& rThemeList ); + + // FillObjList is filling rObjList with Strings of the internal Gallery Object URL + static bool FillObjList( const OUString& rThemeName, std::vector &rObjList ); + static bool FillObjList( const sal_uInt32 nThemeId, std::vector &rObjList ); + + // FillObjTitleList is filling the rList with the title for each gallery object + static bool FillObjListTitle( const sal_uInt32 nThemeId, std::vector< OUString >& rList ); + + static bool InsertURL( const OUString& rThemeName, const OUString& rURL ); + static bool InsertURL( sal_uInt32 nThemeId, const OUString& rURL ); + + static bool GetGraphicObj( const OUString& rThemeName, sal_uInt32 nPos, + Graphic* pGraphic ); + static bool GetGraphicObj( sal_uInt32 nThemeId, sal_uInt32 nPos, + Graphic* pGraphic ); + + static sal_uInt32 GetSdrObjCount( const OUString& rThemeName ); + static sal_uInt32 GetSdrObjCount( sal_uInt32 nThemeId ); + + static bool GetSdrObj( const OUString& rThemeName, sal_uInt32 nSdrModelPos, + SdrModel* pModel, BitmapEx* pThumb = nullptr ); + static bool GetSdrObj( sal_uInt32 nThemeId, sal_uInt32 nSdrModelPos, + SdrModel* pModel, BitmapEx* pThumb = nullptr ); + + static bool BeginLocking( const OUString& rThemeName ); + static bool BeginLocking( sal_uInt32 nThemeId ); + + static bool EndLocking( const OUString& rThemeName ); + static bool EndLocking( sal_uInt32 nThemeId ); +}; + +#endif // INCLUDED_SVX_GALLERY_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/gallery1.hxx b/include/svx/gallery1.hxx new file mode 100644 index 000000000..aa3e986f9 --- /dev/null +++ b/include/svx/gallery1.hxx @@ -0,0 +1,138 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_GALLERY1_HXX +#define INCLUDED_SVX_GALLERY1_HXX + +#include +#include +#include +#include + +#include +#include +#include + + +class GalleryThemeEntry +{ +private: + + OUString aName; + INetURLObject aThmURL; + INetURLObject aSdgURL; + INetURLObject aSdvURL; + INetURLObject aStrURL; + sal_uInt32 nId; + bool bReadOnly; + bool bModified; + bool bThemeNameFromResource; + + static INetURLObject ImplGetURLIgnoreCase( const INetURLObject& rURL ); + +public: + GalleryThemeEntry( bool bCreateUniqueURL, + const INetURLObject& rBaseURL, + const OUString& rName, + bool bReadOnly, bool bNewFile, + sal_uInt32 nId, bool bThemeNameFromResource ); + + const OUString& GetThemeName() const { return aName; } + + const INetURLObject& GetThmURL() const { return aThmURL; } + const INetURLObject& GetSdgURL() const { return aSdgURL; } + const INetURLObject& GetSdvURL() const { return aSdvURL; } + const INetURLObject& GetStrURL() const { return aStrURL; } + + OUString ReadStrFromIni(const OUString &aKeyName ); + + bool IsReadOnly() const { return bReadOnly; } + bool IsDefault() const; + + bool IsHidden() const { return aName.match("private://gallery/hidden/"); } + + bool IsModified() const { return bModified; } + void SetModified( bool bSet ) { bModified = ( bSet && !IsReadOnly() ); } + + void SetName( const OUString& rNewName ); + bool IsNameFromResource() const { return bThemeNameFromResource; } + + sal_uInt32 GetId() const { return nId; } + void SetId( sal_uInt32 nNewId, bool bResetThemeName ); +}; + +class SfxListener; +class GalleryTheme; +class GalleryThemeCacheEntry; + + +class SVXCORE_DLLPUBLIC Gallery final : public SfxBroadcaster +{ + typedef std::vector GalleryCacheThemeList; + +private: + + std::vector< std::unique_ptr > aThemeList; + GalleryCacheThemeList aThemeCache; + INetURLObject aRelURL; + INetURLObject aUserURL; + bool bMultiPath; + + SAL_DLLPRIVATE void ImplLoad( const OUString& rMultiPath ); + SAL_DLLPRIVATE void ImplLoadSubDirs( const INetURLObject& rBaseURL, bool& rbIsReadOnly ); + + GalleryThemeEntry* ImplGetThemeEntry( const OUString& rThemeName ); + + SAL_DLLPRIVATE GalleryTheme* ImplGetCachedTheme( const GalleryThemeEntry* pThemeEntry ); + SAL_DLLPRIVATE void ImplDeleteCachedTheme( GalleryTheme const * pTheme ); + + Gallery& operator=( Gallery const & ) = delete; // MSVC2015 workaround + Gallery( Gallery const & ) = delete; // MSVC2015 workaround + +public: + // only for gengal utility! + Gallery( const OUString& rMultiPath ); + virtual ~Gallery() override; + + static Gallery* GetGalleryInstance(); + + size_t GetThemeCount() const { return aThemeList.size(); } + SAL_DLLPRIVATE const GalleryThemeEntry* GetThemeInfo( size_t nPos ) + { return nPos < aThemeList.size() ? aThemeList[ nPos ].get() : nullptr; } + const GalleryThemeEntry* GetThemeInfo( const OUString& rThemeName ) { return ImplGetThemeEntry( rThemeName ); } + + bool HasTheme( const OUString& rThemeName ); + SAL_DLLPRIVATE OUString GetThemeName( sal_uInt32 nThemeId ) const; + + bool CreateTheme( const OUString& rThemeName ); + void RenameTheme( const OUString& rOldName, const OUString& rNewName ); + bool RemoveTheme( const OUString& rThemeName ); + + GalleryTheme* AcquireTheme( const OUString& rThemeName, SfxListener& rListener ); + void ReleaseTheme( GalleryTheme* pTheme, SfxListener& rListener ); + +public: + + SAL_DLLPRIVATE const INetURLObject& GetUserURL() const { return aUserURL; } + SAL_DLLPRIVATE const INetURLObject& GetRelativeURL() const { return aRelURL; } +}; + +#endif // INCLUDED_SVX_GALLERY1_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/galleryitem.hxx b/include/svx/galleryitem.hxx new file mode 100644 index 000000000..9ac8339d8 --- /dev/null +++ b/include/svx/galleryitem.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_SVX_GALLERYITEM_HXX +#define INCLUDED_SVX_GALLERYITEM_HXX + +#include +#include + +#include + +namespace com::sun::star::graphic { class XGraphic; } +namespace com::sun::star::lang { class XComponent; } + +// property names map those from css::gallery::GalleryItem +// with exception of "AsLink" and "FilterName" +#define SVXGALLERYITEM_TYPE "GalleryItemType" +#define SVXGALLERYITEM_URL "URL" +#define SVXGALLERYITEM_FILTER "FilterName" +#define SVXGALLERYITEM_DRAWING "Drawing" +#define SVXGALLERYITEM_GRAPHIC "Graphic" +#define SVXGALLERYITEM_PARAMS 5 +#define SVXGALLERYITEM_ARGNAME "GalleryItem" + +class SVXCORE_DLLPUBLIC SvxGalleryItem final : public SfxPoolItem +{ + sal_Int8 m_nType; + OUString m_aURL; + css::uno::Reference< css::lang::XComponent > m_xDrawing; + css::uno::Reference< css::graphic::XGraphic > m_xGraphic; + +public: + static SfxPoolItem* CreateDefault(); + + SvxGalleryItem(); + SvxGalleryItem( const SvxGalleryItem& ); + virtual ~SvxGalleryItem() override; + + sal_Int8 GetType() const { return m_nType; } + const OUString& GetURL() const { return m_aURL; } + const css::uno::Reference< css::graphic::XGraphic >& GetGraphic() const { return m_xGraphic; } + + // pure virtual methods from SfxPoolItem + virtual bool operator==( const SfxPoolItem& ) const override; + virtual SvxGalleryItem* Clone( SfxItemPool *pPool = nullptr ) const override; + // bridge to UNO + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/galmisc.hxx b/include/svx/galmisc.hxx new file mode 100644 index 000000000..4d7c03757 --- /dev/null +++ b/include/svx/galmisc.hxx @@ -0,0 +1,197 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_GALMISC_HXX +#define INCLUDED_SVX_GALMISC_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace com::sun::star::awt { class XProgressBar; } + +class INetURLObject; +class GalleryTheme; +class SotStorageStream; + +struct ExchangeData +{ + GalleryTheme* pTheme; + OUString aEditedTitle; + Date aThemeChangeDate; + tools::Time aThemeChangeTime; + + ExchangeData() + : pTheme(nullptr) + , aThemeChangeDate( Date::EMPTY ) + , aThemeChangeTime( tools::Time::EMPTY ) + { + } +}; + +enum class SgaObjKind +{ + NONE = 0, // abstract object + Bitmap = 1, // bitmap object + Sound = 2, // sound object + Animation = 4, // animation object + SvDraw = 5, // Svdraw object + Inet = 6 // graphics from the internet +}; + +#define ID_IMAPINFO 2 + +#define STREAMBUF_SIZE 16384L + +enum class GalleryGraphicImportRet +{ + IMPORT_NONE, IMPORT_FILE +}; + +#define GALLERY_PROGRESS_RANGE 10000 + +#define GALLERY_FG_COLOR Application::GetSettings().GetStyleSettings().GetWindowTextColor() +#define GALLERY_BG_COLOR Application::GetSettings().GetStyleSettings().GetWindowColor() +#define GALLERY_DLG_COLOR Application::GetSettings().GetStyleSettings().GetDialogColor() + +class SvStream; +class Graphic; +class FmFormModel; + +GalleryGraphicImportRet GalleryGraphicImport( const INetURLObject& rURL, Graphic& rGraphic, OUString& rFilterName ); +bool GallerySvDrawImport( SvStream& rIStm, SdrModel& rModel ); +bool CreateIMapGraphic( const FmFormModel& rModel, Graphic& rGraphic, ImageMap& rImageMap ); +SVXCORE_DLLPUBLIC OUString + GetReducedString( const INetURLObject& rURL, sal_Int32 nMaxLen ); +OUString GetSvDrawStreamNameFromURL( const INetURLObject& rSvDrawObjURL ); + +bool FileExists( const INetURLObject& rURL ); +bool CreateDir( const INetURLObject& rURL ); +bool CopyFile( const INetURLObject& rSrcURL, const INetURLObject& rDstURL ); +bool KillFile( const INetURLObject& rURL ); + +class SgaIMapInfo final : public SdrObjUserData, public SfxListener +{ + ImageMap aImageMap; + +public: + SgaIMapInfo() : SdrObjUserData( SdrInventor::SgaImap, ID_IMAPINFO ) {}; + + SgaIMapInfo( const ImageMap& rImageMap) : + SdrObjUserData( SdrInventor::SgaImap, ID_IMAPINFO ), + aImageMap( rImageMap ) {}; + + virtual std::unique_ptr Clone( SdrObject* ) const override + { + SgaIMapInfo* pInfo = new SgaIMapInfo; + pInfo->aImageMap = aImageMap; + return std::unique_ptr(pInfo); + } + + const ImageMap& GetImageMap() const { return aImageMap; } +}; + +class GraphicFilter; + +class SVXCORE_DLLPUBLIC GalleryProgress +{ + css::uno::Reference< css::awt::XProgressBar > mxProgressBar; + + public: + + GalleryProgress( const GraphicFilter* pFilter = nullptr ); + ~GalleryProgress(); + + void Update( sal_Int32 nVal, sal_Int32 nMaxVal ); +}; + +class GalleryTheme; +class GraphicObject; + +class GalleryTransferable final : public TransferDataContainer +{ +friend class GalleryTheme; +using TransferableHelper::CopyToClipboard; + + GalleryTheme* mpTheme; + SgaObjKind meObjectKind; + sal_uInt32 mnObjectPos; + tools::SvRef mxModelStream; + std::unique_ptr mpGraphicObject; + std::unique_ptr mpURL; + + void InitData( bool bLazy ); + +public: + GalleryTransferable( GalleryTheme* pTheme, sal_uInt32 nObjectPos, bool bLazy ); + virtual ~GalleryTransferable() override; + + void SelectObject(sal_uInt32 nObjectPos); + + // TransferableHelper + virtual void AddSupportedFormats() override; + virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) override; + virtual bool WriteObject( tools::SvRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, const css::datatransfer::DataFlavor& rFlavor ) override; + virtual void DragFinished( sal_Int8 nDropAction ) override; + virtual void ObjectReleased() override; + + bool StartDrag(); +}; + +enum class GalleryHintType +{ + CLOSE_THEME, + THEME_REMOVED, + THEME_RENAMED, + THEME_CREATED, + THEME_UPDATEVIEW, + CLOSE_OBJECT +}; + +class GalleryHint final : public SfxHint +{ +private: + + GalleryHintType mnType; + OUString maThemeName; + OUString maStringData; + void* mnData1; + +public: + + GalleryHint( GalleryHintType nType, const OUString& rThemeName, void* nData1 = nullptr ) : + mnType( nType ), maThemeName( rThemeName ), mnData1( nData1 ) {} + + GalleryHint( GalleryHintType nType, const OUString& rThemeName, const OUString& rStringData ) : + mnType( nType ), maThemeName( rThemeName ), maStringData( rStringData ), mnData1( nullptr ) {} + + GalleryHintType GetType() const { return mnType; } + const OUString& GetThemeName() const { return maThemeName; } + const OUString& GetStringData() const { return maStringData; } + void* GetData1() const { return mnData1; } +}; + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/galtheme.hxx b/include/svx/galtheme.hxx new file mode 100644 index 000000000..44f85f19c --- /dev/null +++ b/include/svx/galtheme.hxx @@ -0,0 +1,217 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_GALTHEME_HXX +#define INCLUDED_SVX_GALTHEME_HXX + +#include + +#include +#include +#include +#include +#include +#include +#include + +namespace weld { class ComboBox; } + +class SotStorage; +class SotStorageStream; + + +struct GalleryObject +{ + INetURLObject aURL; + sal_uInt32 nOffset; + SgaObjKind eObjKind; + bool mbDelete; + + //UI visualization buffering + BitmapEx maPreviewBitmapEx; + Size maPreparedSize; + OUString maTitle; + OUString maPath; +}; + + +class GalleryThemeEntry; +class SgaObject; +class FmFormModel; + +class Gallery; + +namespace unogallery +{ + class GalleryTheme; + class GalleryItem; +} + + +class SVXCORE_DLLPUBLIC GalleryTheme : public SfxBroadcaster +{ + friend class Gallery; + friend class GalleryThemeCacheEntry; + friend class ::unogallery::GalleryTheme; + friend class ::unogallery::GalleryItem; + +private: + + ::std::vector< std::unique_ptr > aObjectList; + OUString m_aDestDir; + bool m_bDestDirRelative; + tools::SvRef aSvDrawStorageRef; + Gallery* pParent; + GalleryThemeEntry* pThm; + sal_uInt32 mnThemeLockCount; + sal_uInt32 mnBroadcasterLockCount; + sal_uInt32 nDragPos; + bool bDragging; + bool bAbortActualize; + + SAL_DLLPRIVATE void ImplCreateSvDrawStorage(); + std::unique_ptr ImplReadSgaObject( GalleryObject const * pEntry ); + SAL_DLLPRIVATE bool ImplWriteSgaObject(const SgaObject& rObj, sal_uInt32 nPos, GalleryObject* pExistentEntry); + SAL_DLLPRIVATE void ImplWrite(); + SAL_DLLPRIVATE const GalleryObject* ImplGetGalleryObject(sal_uInt32 nPos) const + { + if (nPos < aObjectList.size()) + return aObjectList[ nPos ].get(); + return nullptr; + } + const GalleryObject* ImplGetGalleryObject( const INetURLObject& rURL ); + + SAL_DLLPRIVATE sal_uInt32 ImplGetGalleryObjectPos( const GalleryObject* pObj ) const + { + for (sal_uInt32 i = 0, n = aObjectList.size(); i < n; ++i) + if ( pObj == aObjectList[ i ].get() ) + return i; + return SAL_MAX_UINT32; + } + SAL_DLLPRIVATE static INetURLObject ImplGetURL( const GalleryObject* pObject ); + SAL_DLLPRIVATE INetURLObject ImplCreateUniqueURL( SgaObjKind eObjKind, ConvertDataFormat nFormat = ConvertDataFormat::Unknown ); + SAL_DLLPRIVATE void ImplSetModified( bool bModified ); + SAL_DLLPRIVATE void ImplBroadcast(sal_uInt32 nUpdatePos); + + SAL_DLLPRIVATE GalleryTheme( Gallery* pGallery, GalleryThemeEntry* pThemeEntry ); + + GalleryTheme(GalleryTheme const &) = delete; + void operator =(GalleryTheme const &) = delete; + +public: + + SAL_DLLPRIVATE virtual ~GalleryTheme() override; + + SAL_DLLPRIVATE static GalleryThemeEntry* CreateThemeEntry( const INetURLObject& rURL, bool bReadOnly ); + + SAL_DLLPRIVATE sal_uInt32 GetObjectCount() const { return aObjectList.size(); } + + std::unique_ptr AcquireObject(sal_uInt32 nPos); + + bool InsertObject(const SgaObject& rObj, sal_uInt32 nPos = SAL_MAX_UINT32); + void RemoveObject(sal_uInt32 nPos); + SAL_DLLPRIVATE bool ChangeObjectPos(sal_uInt32 nOldPos, sal_uInt32 nNewPos); + + const OUString& GetName() const; + + // used for building gallery themes during compilation: + SAL_DLLPRIVATE void SetDestDir(const OUString& rDestDir, bool bRelative) + { m_aDestDir = rDestDir; m_bDestDirRelative = bRelative; } + + SAL_DLLPRIVATE const INetURLObject& GetThmURL() const; + const INetURLObject& GetSdgURL() const; + SAL_DLLPRIVATE const INetURLObject& GetSdvURL() const; + SAL_DLLPRIVATE const INetURLObject& GetStrURL() const; + + sal_uInt32 GetId() const; + SAL_DLLPRIVATE void SetId( sal_uInt32 nNewId, bool bResetThemeName ); + + SAL_DLLPRIVATE void SetDragging( bool bSet ) { bDragging = bSet; } + SAL_DLLPRIVATE bool IsDragging() const { return bDragging; } + + SAL_DLLPRIVATE void LockTheme() { ++mnThemeLockCount; } + SAL_DLLPRIVATE bool UnlockTheme(); + + SAL_DLLPRIVATE void LockBroadcaster() { mnBroadcasterLockCount++; } + void UnlockBroadcaster(); + SAL_DLLPRIVATE bool IsBroadcasterLocked() const { return mnBroadcasterLockCount > 0; } + + SAL_DLLPRIVATE void SetDragPos(sal_uInt32 nPos) { nDragPos = nPos; } + SAL_DLLPRIVATE sal_uInt32 GetDragPos() const { return nDragPos; } + + bool IsReadOnly() const; + bool IsDefault() const; + + void Actualize( const Link& rActualizeLink, GalleryProgress* pProgress = nullptr ); + SAL_DLLPRIVATE void AbortActualize() { bAbortActualize = true; } + + SAL_DLLPRIVATE Gallery* GetParent() const { return pParent; } + SAL_DLLPRIVATE const tools::SvRef& GetSvDrawStorage() const; + +public: + + SAL_DLLPRIVATE SgaObjKind GetObjectKind(sal_uInt32 nPos) const + { + if (nPos < GetObjectCount()) + return ImplGetGalleryObject( nPos )->eObjKind; + return SgaObjKind::NONE; + } + + SAL_DLLPRIVATE const INetURLObject& GetObjectURL(sal_uInt32 nPos) const + { + DBG_ASSERT( nPos < GetObjectCount(), "Position out of range" ); + return ImplGetGalleryObject( nPos )->aURL; + } + + SAL_DLLPRIVATE bool GetThumb(sal_uInt32 nPos, BitmapEx& rBmp); + + bool GetGraphic(sal_uInt32 nPos, Graphic& rGraphic); + bool InsertGraphic(const Graphic& rGraphic, sal_uInt32 nInsertPos); + + bool GetModel(sal_uInt32 nPos, SdrModel& rModel); + bool InsertModel(const FmFormModel& rModel, sal_uInt32 nInsertPos); + + SAL_DLLPRIVATE bool GetModelStream(sal_uInt32 nPos, tools::SvRef const & rModelStreamRef); + SAL_DLLPRIVATE bool InsertModelStream(const tools::SvRef& rModelStream, sal_uInt32 nInsertPos); + + SAL_DLLPRIVATE bool GetURL(sal_uInt32 nPos, INetURLObject& rURL); + bool InsertURL(const INetURLObject& rURL, sal_uInt32 nInsertPos = SAL_MAX_UINT32); + SAL_DLLPRIVATE bool InsertFileOrDirURL(const INetURLObject& rFileOrDirURL, sal_uInt32 nInsertPos); + + SAL_DLLPRIVATE bool InsertTransferable(const css::uno::Reference< css::datatransfer::XTransferable >& rxTransferable, sal_uInt32 nInsertPos); + + SAL_DLLPRIVATE void CopyToClipboard(sal_uInt32 nPos); + +public: + + SAL_DLLPRIVATE SvStream& WriteData( SvStream& rOut ) const; + SAL_DLLPRIVATE SvStream& ReadData( SvStream& rIn ); + static void InsertAllThemes(weld::ComboBox& rListBox); + + // for buffering PreviewBitmaps and strings for object and path + SAL_DLLPRIVATE void GetPreviewBitmapExAndStrings(sal_uInt32 nPos, BitmapEx& rBitmapEx, Size& rSize, OUString& rTitle, OUString& rPath) const; + SAL_DLLPRIVATE void SetPreviewBitmapExAndStrings(sal_uInt32 nPos, const BitmapEx& rBitmapEx, const Size& rSize, const OUString& rTitle, const OUString& rPath); +}; + +SvStream& WriteGalleryTheme( SvStream& rOut, const GalleryTheme& rTheme ); +SvStream& ReadGalleryTheme( SvStream& rIn, GalleryTheme& rTheme ); + +#endif // INCLUDED_SVX_GALTHEME_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/globl3d.hxx b/include/svx/globl3d.hxx new file mode 100644 index 000000000..2eed87268 --- /dev/null +++ b/include/svx/globl3d.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_SVX_GLOBL3D_HXX +#define INCLUDED_SVX_GLOBL3D_HXX + +#include + +const sal_uInt16 E3D_SCENE_ID = 2; +const sal_uInt16 E3D_OBJECT_ID = 3; // should not be used, it's only a helper class for E3DScene and E3DCompoundObject +const sal_uInt16 E3D_CUBEOBJ_ID = 4; +const sal_uInt16 E3D_SPHEREOBJ_ID = 5; +const sal_uInt16 E3D_EXTRUDEOBJ_ID = 6; +const sal_uInt16 E3D_LATHEOBJ_ID = 7; +const sal_uInt16 E3D_COMPOUNDOBJ_ID = 8; +const sal_uInt16 E3D_POLYGONOBJ_ID = 9; + +#endif // INCLUDED_SVX_GLOBL3D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/grafctrl.hxx b/include/svx/grafctrl.hxx new file mode 100644 index 000000000..b22b82392 --- /dev/null +++ b/include/svx/grafctrl.hxx @@ -0,0 +1,121 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_GRAFCTRL_HXX +#define INCLUDED_SVX_GRAFCTRL_HXX + +#include +#include +#include + + +class SvxGrafToolBoxControl : public SfxToolBoxControl +{ +public: + SvxGrafToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ); + virtual ~SvxGrafToolBoxControl() override; + + virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) override; + virtual VclPtr CreateItemWindow( vcl::Window *pParent ) override; +}; + + +class SVX_DLLPUBLIC SvxGrafRedToolBoxControl final : public SvxGrafToolBoxControl +{ +public: + SFX_DECL_TOOLBOX_CONTROL(); + SvxGrafRedToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ); +}; + + +class SVX_DLLPUBLIC SvxGrafGreenToolBoxControl final : public SvxGrafToolBoxControl +{ +public: + SFX_DECL_TOOLBOX_CONTROL(); + SvxGrafGreenToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ); +}; + + +class SVX_DLLPUBLIC SvxGrafBlueToolBoxControl final : public SvxGrafToolBoxControl +{ +public: + SFX_DECL_TOOLBOX_CONTROL(); + SvxGrafBlueToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ); +}; + + +class SVX_DLLPUBLIC SvxGrafLuminanceToolBoxControl final : public SvxGrafToolBoxControl +{ +public: + SFX_DECL_TOOLBOX_CONTROL(); + SvxGrafLuminanceToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ); +}; + + +class SVX_DLLPUBLIC SvxGrafContrastToolBoxControl final : public SvxGrafToolBoxControl +{ +public: + SFX_DECL_TOOLBOX_CONTROL(); + SvxGrafContrastToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ); +}; + + +class SVX_DLLPUBLIC SvxGrafGammaToolBoxControl final : public SvxGrafToolBoxControl +{ +public: + SFX_DECL_TOOLBOX_CONTROL(); + SvxGrafGammaToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ); +}; + + +class SVX_DLLPUBLIC SvxGrafTransparenceToolBoxControl final : public SvxGrafToolBoxControl +{ +public: + SFX_DECL_TOOLBOX_CONTROL(); + SvxGrafTransparenceToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ); +}; + + +class SVX_DLLPUBLIC SvxGrafModeToolBoxControl final : public SfxToolBoxControl, public SfxListener +{ +public: + SFX_DECL_TOOLBOX_CONTROL(); + SvxGrafModeToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ); + virtual ~SvxGrafModeToolBoxControl() override; + + virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) override; + virtual VclPtr CreateItemWindow( vcl::Window *pParent ) override; +}; + + +class SdrView; +class SfxRequest; + + +class SVX_DLLPUBLIC SvxGrafAttrHelper +{ +public: + + static void ExecuteGrafAttr( SfxRequest& rReq, SdrView& rView ); + static void GetGrafAttrState( SfxItemSet& rSet, SdrView const & rView ); +}; + +#endif // INCLUDED_SVX_GRAFCTRL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/graphctl.hxx b/include/svx/graphctl.hxx new file mode 100644 index 000000000..11a5854ee --- /dev/null +++ b/include/svx/graphctl.hxx @@ -0,0 +1,161 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_GRAPHCTL_HXX +#define INCLUDED_SVX_GRAPHCTL_HXX + +#include +#include +#include + +#include +#include + +class GraphCtrl; + +class GraphCtrlUserCall final : public SdrObjUserCall +{ + GraphCtrl& rWin; + +public: + + GraphCtrlUserCall(GraphCtrl& rGraphWin) + : rWin(rGraphWin) + {} + + virtual void Changed(const SdrObject& rObj, SdrUserCallType eType, const tools::Rectangle& rOldBoundRect) override; +}; + +class SvxGraphCtrlAccessibleContext; + +class SVX_DLLPUBLIC GraphCtrl : public weld::CustomWidgetController +{ + friend class GraphCtrlView; + friend class GraphCtrlUserCall; + + Graphic aGraphic; + ScopedVclPtrInstance xVD; + Idle aUpdateIdle; + Link aMousePosLink; + Link aGraphSizeLink; + Link aUpdateLink; + MapMode aMap100; + Size aGraphSize; + Point aMousePos; + std::unique_ptr pUserCall; + SdrObjKind eObjKind; + sal_uInt16 nPolyEdit; + bool bEditMode; + bool mbSdrMode; + bool mbInIdleUpdate; + weld::Dialog* mpDialog; + + DECL_LINK( UpdateHdl, Timer*, void ); + + rtl::Reference mpAccContext; + +protected: + + std::unique_ptr pModel; + std::unique_ptr pView; + + virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override; + virtual void Resize() override; + virtual bool KeyInput(const KeyEvent& rKEvt) override; + virtual bool MouseButtonDown(const MouseEvent& rMEvt) override; + virtual bool MouseButtonUp(const MouseEvent& rMEvt) override; + virtual bool MouseMove(const MouseEvent& rMEvt) override; + + virtual void InitSdrModel(); + + virtual void SdrObjCreated( const SdrObject& rObj ); + virtual void SdrObjChanged( const SdrObject& rObj ); + virtual void MarkListHasChanged(); + + void GraphicToVD(); + + SdrObjUserCall* GetSdrUserCall() { return pUserCall.get(); } + +public: + + GraphCtrl(weld::Dialog* pDialog); + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; + virtual ~GraphCtrl() override; + + void SetGraphic( const Graphic& rGraphic, bool bNewModel = true ); + const Graphic& GetGraphic() const { return aGraphic; } + const Size& GetGraphicSize() const { return aGraphSize; } + + const Point& GetMousePos() const { return aMousePos; } + + void SetEditMode( const bool bEditMode ); + + void SetPolyEditMode( const sal_uInt16 nPolyEdit ); + sal_uInt16 GetPolyEditMode() const { return nPolyEdit; } + + void SetObjKind( const SdrObjKind eObjKind ); + + SdrModel* GetSdrModel() const { return pModel.get(); } + SdrView* GetSdrView() const { return pView.get(); } + SdrObject* GetSelectedSdrObject() const; + bool IsChanged() const { return mbSdrMode && pModel->IsChanged(); } + + void SetMousePosLink( const Link& rLink ) { aMousePosLink = rLink; } + + void SetGraphSizeLink( const Link& rLink ) { aGraphSizeLink = rLink; } + + void SetUpdateLink( const Link& rLink ) { aUpdateLink = rLink; } + void QueueIdleUpdate(); + + void SetSdrMode(bool b); + + Point GetPositionInDialog() const; + virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override; +}; + +class GraphCtrlView : public SdrView +{ + GraphCtrl& rGraphCtrl; + +protected: + + virtual void MarkListHasChanged() override + { + SdrView::MarkListHasChanged(); + rGraphCtrl.MarkListHasChanged(); + } + +public: + GraphCtrlView(SdrModel& rSdrModel, GraphCtrl* pWindow) + : SdrView(rSdrModel, &pWindow->GetDrawingArea()->get_ref_device()) + , rGraphCtrl(*pWindow) + { + } + + virtual ~GraphCtrlView() override; + + // override these so we can get the occasions SdrPaintView would call Window::Invalidate on its vcl::Window + // if it had one, and route to WidgetController::Invalidate instead + virtual rtl::Reference CreateOverlayManager(OutputDevice& rDevice) const override; + virtual void InvalidateOneWin(OutputDevice& rWin) override; + virtual void InvalidateOneWin(OutputDevice& rWin, const tools::Rectangle& rRect) override; +}; + +#endif // INCLUDED_SVX_GRAPHCTL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/graphichelper.hxx b/include/svx/graphichelper.hxx new file mode 100644 index 000000000..b582de4a2 --- /dev/null +++ b/include/svx/graphichelper.hxx @@ -0,0 +1,43 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_GRAPHICHELPER_HXX +#define INCLUDED_SVX_GRAPHICHELPER_HXX + +#include +#include + +namespace com::sun::star::drawing { class XShape; } +namespace weld { class Widget; } +namespace weld { class Window; } + +class SVXCORE_DLLPUBLIC GraphicHelper +{ + +public: + static void GetPreferredExtension( OUString& rExtension, const Graphic& rGraphic ); + static OUString ExportGraphic(weld::Window* pWin, const Graphic& rGraphic, const OUString& rGraphicName); + static void SaveShapeAsGraphic(weld::Window* pWin, const css::uno::Reference< css::drawing::XShape >& xShape); + static short HasToSaveTransformedImage(weld::Widget* pWin); +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/grfcrop.hxx b/include/svx/grfcrop.hxx new file mode 100644 index 000000000..b24aa9c0a --- /dev/null +++ b/include/svx/grfcrop.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_SVX_GRFCROP_HXX +#define INCLUDED_SVX_GRFCROP_HXX + +#include +#include + +#define GRFCROP_VERSION_SWDEFAULT 0 +#define GRFCROP_VERSION_MOVETOSVX 1 + +class SVXCORE_DLLPUBLIC SvxGrfCrop : public SfxPoolItem +{ + sal_Int32 nLeft, nRight, nTop, nBottom; +public: + SvxGrfCrop( sal_uInt16 ); + SvxGrfCrop( sal_Int32 nLeft, sal_Int32 nRight, + sal_Int32 nTop, sal_Int32 nBottom, + sal_uInt16 ); + virtual ~SvxGrfCrop() override; + + SvxGrfCrop(SvxGrfCrop const &) = default; + SvxGrfCrop(SvxGrfCrop &&) = default; + SvxGrfCrop & operator =(SvxGrfCrop const &) = delete; // due to SfxPoolItem + SvxGrfCrop & operator =(SvxGrfCrop &&) = delete; // due to SfxPoolItem + + // "pure virtual methods" from SfxPoolItem + virtual bool operator==( const SfxPoolItem& ) const override; + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, + const IntlWrapper& rIntl ) const override; + virtual bool QueryValue( css::uno::Any& rVal, + sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, + sal_uInt8 nMemberId ) override; + + void SetLeft( sal_Int32 nVal ) { nLeft = nVal; } + void SetRight( sal_Int32 nVal ) { nRight = nVal; } + void SetTop( sal_Int32 nVal ) { nTop = nVal; } + void SetBottom( sal_Int32 nVal ) { nBottom = nVal; } + + sal_Int32 GetLeft() const { return nLeft; } + sal_Int32 GetRight() const { return nRight; } + sal_Int32 GetTop() const { return nTop; } + sal_Int32 GetBottom() const { return nBottom; } +}; + +#endif // INCLUDED_SVX_GRFCROP_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/grfflt.hxx b/include/svx/grfflt.hxx new file mode 100644 index 000000000..7c24bcd38 --- /dev/null +++ b/include/svx/grfflt.hxx @@ -0,0 +1,43 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_GRFFLT_HXX +#define INCLUDED_SVX_GRFFLT_HXX + +#include + +enum class SvxGraphicFilterResult { + NONE, UnsupportedGraphicType, UnsupportedSlot +}; + +class GraphicObject; +class SfxRequest; +class SfxItemSet; + +class SVX_DLLPUBLIC SvxGraphicFilter +{ +public: + + static SvxGraphicFilterResult ExecuteGrfFilterSlot( SfxRequest const & rReq, GraphicObject& rFilterObject ); + static void DisableGraphicFilterSlots( SfxItemSet& rSet ); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/gridctrl.hxx b/include/svx/gridctrl.hxx new file mode 100644 index 000000000..90eaa9927 --- /dev/null +++ b/include/svx/gridctrl.hxx @@ -0,0 +1,599 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_GRIDCTRL_HXX +#define INCLUDED_SVX_GRIDCTRL_HXX + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +namespace comphelper { class OPropertyChangeMultiplexer; } +namespace com::sun::star::beans { struct PropertyChangeEvent; } +namespace com::sun::star::container { class XIndexAccess; } +namespace com::sun::star::sdbc { class XRowSet; } +namespace com::sun::star::sdb { class XRowsChangeListener; } +namespace com::sun::star::uno { class XComponentContext; } +namespace com::sun::star::util { class XNumberFormatter; } + +class Button; +class ImageButton; +class FixedText; + +class CursorWrapper; + +bool CompareBookmark(const css::uno::Any& aLeft, const css::uno::Any& aRight); + +namespace svxform +{ + class DataColumn; +} + +enum class GridRowStatus +{ + Clean, + Modified, + Deleted, + Invalid +}; + + +// DbGridRow, description of rows + + +class SAL_DLLPUBLIC_RTTI DbGridRow final : public SvRefBase +{ + css::uno::Any m_aBookmark; // Bookmark of the row, can be set + ::std::vector< std::unique_ptr<::svxform::DataColumn> > + m_aVariants; + GridRowStatus m_eStatus; + bool m_bIsNew; + // row is no longer valid + // is removed on the next positioning +public: + DbGridRow(); + DbGridRow(CursorWrapper* pCur, bool bPaintCursor); + void SetState(CursorWrapper* pCur, bool bPaintCursor); + + virtual ~DbGridRow() override; + + bool HasField(sal_uInt32 nPos) const { return nPos < m_aVariants.size(); } + const ::svxform::DataColumn& GetField(sal_uInt32 nPos) const { return *m_aVariants[ nPos ]; } + + void SetStatus(GridRowStatus _eStat) { m_eStatus = _eStat; } + GridRowStatus GetStatus() const { return m_eStatus; } + void SetNew(bool _bNew) { m_bIsNew = _bNew; } + bool IsNew() const { return m_bIsNew; } + + const css::uno::Any& GetBookmark() const { return m_aBookmark; } + + bool IsValid() const { return m_eStatus == GridRowStatus::Clean || m_eStatus == GridRowStatus::Modified; } + bool IsModified() const { return m_eStatus == GridRowStatus::Modified; } +}; + +typedef tools::SvRef DbGridRowRef; + + +// DbGridControl + +class DbGridColumn; + +class FmGridListener +{ +public: + virtual void selectionChanged() = 0; + virtual void columnChanged() = 0; + +protected: + ~FmGridListener() {} +}; + +#define GRID_COLUMN_NOT_FOUND SAL_MAX_UINT16 + + +// InitWindowFacet, describing which aspect of a column's Window to (re-)initialize + +enum class InitWindowFacet +{ + Font = 0x01, + Foreground = 0x02, + Background = 0x04, + WritingMode = 0x08, + All = 0x0F +}; +namespace o3tl +{ + template<> struct typed_flags : is_typed_flags {}; +} + + +// these options are or'ed and indicate, which of the single +// features can be released, default is readonly which means 0 +enum class DbGridControlOptions +{ + Readonly = 0x00, + Insert = 0x01, + Update = 0x02, + Delete = 0x04 +}; +namespace o3tl +{ + template<> struct typed_flags : is_typed_flags {}; +} + +// StatusIds for Controls of the Bar +// important for invalidation +enum class DbGridControlNavigationBarState +{ + NONE, + Text, + Absolute, + Of, + Count, + First, + Next, + Prev, + Last, + New, + Undo // related to SID_FM_RECORD_UNDO +}; + +class FmXGridSourcePropListener; +class DisposeListenerGridBridge; +class SVXCORE_DLLPUBLIC DbGridControl : public svt::EditBrowseBox +{ + friend class FmXGridSourcePropListener; + friend class GridFieldValueListener; + friend class DisposeListenerGridBridge; + +public: + + // NavigationBar + + class SAL_DLLPRIVATE NavigationBar final : public Control + { + class AbsolutePos : public NumericField + { + public: + AbsolutePos(vcl::Window* pParent, WinBits nStyle); + + virtual void KeyInput(const KeyEvent& rEvt) override; + virtual void LoseFocus() override; + }; + + friend class NavigationBar::AbsolutePos; + + // additional controls + VclPtr m_aRecordText; + VclPtr m_aAbsolute; // absolute positioning + VclPtr m_aRecordOf; + VclPtr m_aRecordCount; + + VclPtr m_aFirstBtn; // ImageButton for 'go to the first record' + VclPtr m_aPrevBtn; // ImageButton for 'go to the previous record' + VclPtr m_aNextBtn; // ImageButton for 'go to the next record' + VclPtr m_aLastBtn; // ImageButton for 'go to the last record' + VclPtr m_aNewBtn; // ImageButton for 'go to a new record' + sal_Int32 m_nCurrentPos; + + bool m_bPositioning; // protect PositionDataSource against recursion + + public: + NavigationBar(vcl::Window* pParent); + virtual ~NavigationBar() override; + virtual void dispose() override; + + // Status methods for Controls + void InvalidateAll(sal_Int32 nCurrentPos, bool bAll = false); + void InvalidateState(DbGridControlNavigationBarState nWhich) {SetState(nWhich);} + void SetState(DbGridControlNavigationBarState nWhich); + bool GetState(DbGridControlNavigationBarState nWhich) const; + sal_uInt16 ArrangeControls(); + + private: + virtual void Resize() override; + virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override; + virtual void StateChanged( StateChangedType nType ) override; + + DECL_LINK(OnClick, Button*, void); + + void PositionDataSource(sal_Int32 nRecord); + }; + + friend class DbGridControl::NavigationBar; + +private: + Link m_aMasterStateProvider; + Link m_aMasterSlotExecutor; + + css::uno::Reference< css::util::XNumberFormatter > m_xFormatter; + css::uno::Reference< css::uno::XComponentContext > m_xContext; + + std::vector< std::unique_ptr > m_aColumns; // Column description + VclPtr m_aBar; + DbGridRowRef m_xDataRow; // Row which can be modified + // comes from the data cursor + DbGridRowRef m_xSeekRow, // Row to which the iterator can set + // comes from the data cursor + + m_xEmptyRow; // record set to insert + + ImplSVEvent * m_nAsynAdjustEvent; + + // if we modify the row for the new record, we automatically insert a "new new row". + // But if somebody else inserts a new record into the data source, we have to do the same. + // For that reason we have to listen to some properties of our data source. + rtl::Reference<::comphelper::OPropertyChangeMultiplexer> m_pDataSourcePropMultiplexer; + FmXGridSourcePropListener* m_pDataSourcePropListener; + css::uno::Reference< css::sdb::XRowsChangeListener> + m_xRowSetListener; // get notification when rows were changed + + void* m_pFieldListeners; + // property listeners for field values + + std::unique_ptr m_pCursorDisposeListener; + // need to know about the disposing of the seek cursor + // construct analogous to the data source proplistener/multiplexer above : + // DisposeListenerGridBridge is a bridge from FmXDisposeListener which I don't want to be derived from + + FmGridListener* m_pGridListener; + +protected: + std::unique_ptr m_pDataCursor; // Cursor for Updates + std::unique_ptr m_pSeekCursor; // Cursor for Seeking + +private: + // iteration variables + DbGridRowRef m_xCurrentRow; + DbGridRowRef m_xPaintRow; // Row to be displayed + sal_Int32 m_nSeekPos; // Position of the SeekCursor + sal_Int32 m_nTotalCount; // is set when the data cursor finished counting the + // records. Initial value is -1 + osl::Mutex m_aDestructionSafety; + osl::Mutex m_aAdjustSafety; + + css::util::Date + m_aNullDate; // NullDate of the Numberformatter; + + BrowserMode m_nMode; + sal_Int32 m_nCurrentPos; // Current position; + ImplSVEvent * m_nDeleteEvent; // EventId for asynchronous deletion of rows + DbGridControlOptions m_nOptions; // What is the able to do (Insert, Update, Delete) + // default readonly + DbGridControlOptions m_nOptionMask; // the mask of options to be enabled in setDataSource + // (with respect to the data source capabilities) + // defaults to (insert | update | delete) + sal_uInt16 m_nLastColId; + long m_nLastRowId; + + bool m_bDesignMode : 1; // default = sal_False + bool m_bRecordCountFinal : 1; + bool m_bNavigationBar : 1; + + bool m_bSynchDisplay : 1; + bool m_bHandle : 1; + bool m_bFilterMode : 1; + bool m_bWantDestruction : 1; + bool m_bPendingAdjustRows : 1; // if an async adjust is pending, is it for AdjustRows or AdjustDataSource ? + bool m_bHideScrollbars : 1; + +protected: + bool m_bUpdating : 1; // are any updates being executed right now? + +protected: + virtual bool SeekRow(long nRow) override; + virtual void VisibleRowsChanged( long nNewTopRow, sal_uInt16 nNumRows) override; + virtual void PaintCell(OutputDevice& rDev, const tools::Rectangle& rRect, sal_uInt16 nColId) const override; + virtual RowStatus GetRowStatus(long nRow) const override; + virtual bool CursorMoving(long nNewRow, sal_uInt16 nNewCol) override; + virtual void CursorMoved() override; + virtual void ArrangeControls(sal_uInt16& nX, sal_uInt16 nY) override; + virtual sal_uInt32 GetTotalCellWidth(long nRow, sal_uInt16 nColId) override; + virtual void Command(const CommandEvent& rEvt) override; + virtual bool PreNotify(NotifyEvent& rEvt) override; + virtual void KeyInput(const KeyEvent& rEvt) override; + virtual void StateChanged( StateChangedType nType ) override; + virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; + virtual void Select() override; + + virtual ::svt::CellController* GetController(long nRow, sal_uInt16 nCol) override; + + virtual void CellModified() override; + virtual bool SaveModified() override; + virtual bool IsModified() const override; + + virtual sal_uInt16 AppendColumn(const OUString& rName, sal_uInt16 nWidth, sal_uInt16 nPos = HEADERBAR_APPEND, sal_uInt16 nId = sal_uInt16(-1)) override; + void RemoveColumn(sal_uInt16 nId); + std::unique_ptr CreateColumn(sal_uInt16 nId); + virtual void ColumnMoved(sal_uInt16 nId) override; + virtual bool SaveRow() override; + virtual bool IsTabAllowed(bool bForward) const override; + + /// hide a column + virtual void HideColumn(sal_uInt16 nId); + /// show a column + virtual void ShowColumn(sal_uInt16 nId); + + /** This is called before executing a context menu for a row. rMenu contains the initial entries + handled by this base class' method (which always has to be called). + Derived classes may alter the menu in any way and handle any additional entries in + PostExecuteColumnContextMenu. + All disabled entries will be removed before executing the menu, so be careful with separators + near entries you probably wish to disable ... + */ + virtual void PreExecuteRowContextMenu(sal_uInt16 nRow, PopupMenu& rMenu); + /** After executing the context menu for a row this method is called. + */ + virtual void PostExecuteRowContextMenu(sal_uInt16 nRow, const PopupMenu& rMenu, sal_uInt16 nExecutionResult); + + /// @throws css::uno::RuntimeException + void DataSourcePropertyChanged(const css::beans::PropertyChangeEvent& evt); + + void FieldValueChanged(sal_uInt16 _nId); + void FieldListenerDisposing(sal_uInt16 _nId); + + void disposing(sal_uInt16 _nId); + + // own overridables + /// called when the current row changed + virtual void onRowChange(); + /// called when the current column changed + virtual void onColumnChange(); + + // DragSourceHelper overridables + virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ) override; + + void executeRowContextMenu( long _nRow, const Point& _rPreferredPos ); + +public: + DbGridControl( + css::uno::Reference< css::uno::XComponentContext > const & _rxContext, + vcl::Window* pParent, + WinBits nBits); + + virtual ~DbGridControl() override; + virtual void dispose() override; + + virtual void Init() override; + virtual void InitColumnsByFields(const css::uno::Reference< css::container::XIndexAccess >& xFields) = 0; + virtual void RemoveRows() override; + + /** GetCellText returns the text at the given position + @param _nRow + the number of the row + @param _nColId + the ID of the column + @return + the text out of the cell + */ + virtual OUString GetCellText(long _nRow, sal_uInt16 _nColId) const override; + + void RemoveRows(bool bNewCursor); + + const css::uno::Reference< css::util::XNumberFormatter >& getNumberFormatter() const {return m_xFormatter;} + + // the data source + // the options can restrict but not extend the update abilities + void setDataSource(const css::uno::Reference< css::sdbc::XRowSet >& rCursor, + DbGridControlOptions nOpts = DbGridControlOptions::Insert | DbGridControlOptions::Update | DbGridControlOptions::Delete); + virtual void Dispatch(sal_uInt16 nId) override; + + CursorWrapper* getDataSource() const {return m_pDataCursor.get();} + const std::vector< std::unique_ptr >& GetColumns() const {return m_aColumns;} + + void EnableHandle(bool bEnable); + bool HasHandle() const {return m_bHandle;} + void InsertHandleColumn(); + + // which position does the column with the id in the View have, the handle column doesn't count + sal_uInt16 GetViewColumnPos( sal_uInt16 nId ) const { sal_uInt16 nPos = GetColumnPos(nId); return (nPos==BROWSER_INVALIDID) ? GRID_COLUMN_NOT_FOUND : nPos-1; } + + // which position does the column with the id in m_aColumns have, that means the css::sdbcx::Container + // returned from the GetColumns (may be different from the position returned by GetViewColumnPos + // if there are hidden columns) + sal_uInt16 GetModelColumnPos( sal_uInt16 nId ) const; + + // the number of columns in the model + sal_uInt16 GetViewColCount() const { return ColCount() - 1; } + sal_uInt16 GetModelColCount() const { return static_cast(m_aColumns.size()); } + // reverse to GetViewColumnPos: Id of position, the first non-handle column has position 0 + sal_uInt16 GetColumnIdFromViewPos( sal_uInt16 nPos ) const { return GetColumnId(nPos + 1); } + sal_uInt16 GetColumnIdFromModelPos( sal_uInt16 nPos ) const; + + virtual void SetDesignMode(bool bMode); + bool IsDesignMode() const {return m_bDesignMode;} + bool IsOpen() const {return m_pSeekCursor != nullptr;} + + void SetFilterMode(bool bMode); + bool IsFilterMode() const {return m_bFilterMode;} + bool IsFilterRow(long nRow) const {return m_bFilterMode && nRow == 0;} + + void EnableNavigationBar(bool bEnable); + bool HasNavigationBar() const {return m_bNavigationBar;} + + DbGridControlOptions GetOptions() const {return m_nOptions;} + NavigationBar& GetNavigationBar() {return *m_aBar;} + DbGridControlOptions SetOptions(DbGridControlOptions nOpt); + // The new options are interpreted with respect to the current data source. If it is unable + // to update, to insert or to restore, the according options are ignored. If the grid isn't + // connected to a data source, all options except OPT_READONLY are ignored. + + const css::util::Date& getNullDate() const {return m_aNullDate;} + + // positioning + void MoveToPosition(sal_uInt32 nPos); + void MoveToFirst(); + void MoveToNext(); + void MoveToPrev(); + void MoveToLast(); + void AppendNew(); + + // adjustment of the cursors in case the data cursor has been + // moved from the outside. + // the flag indicates if an adjustment of the row count should be + // done as well + void AdjustDataSource(bool bFull = false); + void Undo(); + + virtual void BeginCursorAction(); + virtual void EndCursorAction(); + + // is the current line being updated + bool IsUpdating() const {return m_bUpdating;} + + void RowRemoved( long nRow, long nNumRows = 1, bool bDoPaint = true ); + void RowInserted( long nRow, long nNumRows = 1, bool bDoPaint = true ); + void RowModified( long nRow ); + + void resetCurrentRow(); + + bool getDisplaySynchron() const { return m_bSynchDisplay; } + void setDisplaySynchron(bool bSync); + // when set to sal_False, the display is no longer in sync with the current cursor position + // (means that in AdjustDataSource we are jumping to a row not belonging to CursorPosition) + // when using this, you should know what you are doing, because for example entering data + // in a row in the display that is not in sync with the position of the cursor can be very critical + + const DbGridRowRef& GetCurrentRow() const {return m_xCurrentRow;} + + void SetStateProvider(const Link& rProvider) { m_aMasterStateProvider = rProvider; } + // if this link is set the given provider will be asked for the state of my items. + // the return values are interpreted as follows : + // <0 -> not specified (use default mechanism to determine the state) + // ==0 -> the item is disabled + // >0 -> the item is enabled + void SetSlotExecutor(const Link& rExecutor) { m_aMasterSlotExecutor = rExecutor; } + // analogous : if this link is set, all nav-bar slots will be routed through it when executed + // if the handler returns nonzero, no further handling of the slot occurs + + void EnablePermanentCursor(bool bEnable); + bool IsPermanentCursorEnabled() const; + + /** forces both scrollbars to be hidden + + For the horizontal scrollbar, this is overruled by enabling the navigation bar: A navigation + bar always implies a horizontal scroll bar + @seealso EnableNavigationBar + */ + void ForceHideScrollbars(); + + const css::uno::Reference< css::uno::XComponentContext >& + getContext() const { return m_xContext; } + + /// returns if the text of the given cell can be copied into the clipboard + bool canCopyCellText(sal_Int32 _nRow, sal_uInt16 _nColId); + /// copies the text of the given cell into the clipboard + void copyCellText(sal_Int32 _nRow, sal_uInt16 _nColId); + + // select in listener handling + void setGridListener( FmGridListener* _pListener ) { m_pGridListener = _pListener; } + + // helper class to grant access to selected methods from within the DbCellControl class + struct GrantControlAccess final + { + friend class DbCellControl; + friend class RowSetEventListener; + GrantControlAccess() { } + }; + + /// called when a controller needs to be re-initialized + void refreshController(sal_uInt16 _nColId, GrantControlAccess _aAccess); + + CursorWrapper* GetSeekCursor(GrantControlAccess /*_aAccess*/) const { return m_pSeekCursor.get(); } + const DbGridRowRef& GetSeekRow(GrantControlAccess /*_aAccess*/) const { return m_xSeekRow; } + void SetSeekPos(sal_Int32 nPos,GrantControlAccess /*_aAccess*/) {m_nSeekPos = nPos;} + + /** + @return + The count of additional controls of the control area. + */ + virtual sal_Int32 GetAccessibleControlCount() const override; + + /** Creates the accessible object of an additional control. + @param _nIndex + The 0-based index of the control. + @return + The XAccessible interface of the specified control. + */ + virtual css::uno::Reference< + css::accessibility::XAccessible > + CreateAccessibleControl( sal_Int32 _nIndex ) override; + + // IAccessibleTableProvider + /** Creates the accessible object of a data table cell. + @param nRow The row index of the cell. + @param nColumnId The column ID of the cell. + @return The XAccessible interface of the specified cell. */ + virtual css::uno::Reference< + css::accessibility::XAccessible > + CreateAccessibleCell( sal_Int32 nRow, sal_uInt16 nColumnId ) override; + +protected: + void RecalcRows(long nNewTopRow, sal_uInt16 nLinesOnScreen, bool bUpdateCursor); + bool SeekCursor(long nRow, bool bAbsolute = false); + void RemoveColumns(); // cleaning of own structures + void AdjustRows(); + sal_Int32 AlignSeekCursor(); + bool SetCurrent(long nNewRow); + + OUString GetCurrentRowCellText(DbGridColumn const * pCol,const DbGridRowRef& _rRow) const; + virtual void DeleteSelectedRows(); + static bool IsValid(const DbGridRowRef& _xRow) { return _xRow.is() && _xRow->IsValid(); } + + // row which is currently being appended + bool IsCurrentAppending() const; + + // empty row for insertion + bool IsInsertionRow(long nRow) const; + + void SetSeekPos(sal_Int32 nPos) {m_nSeekPos = nPos;} + sal_Int32 GetCurrentPos() const {return m_nCurrentPos;} + sal_Int32 GetSeekPos() const {return m_nSeekPos;} + sal_Int32 GetTotalCount() const {return m_nTotalCount;} + + const DbGridRowRef& GetEmptyRow() const { return m_xEmptyRow; } + const DbGridRowRef& GetSeekRow() const { return m_xSeekRow; } + const DbGridRowRef& GetPaintRow() const { return m_xPaintRow; } + + void ConnectToFields(); + void DisconnectFromFields(); + + void implAdjustInSolarThread(bool _bRows); + // calls AdjustRows or AdjustDataSource, synchron if the caller is running in the solar thread, else asynchron + +protected: + void ImplInitWindow( const InitWindowFacet _eInitWhat ); + DECL_LINK(OnDelete, void*, void); + + DECL_LINK(OnAsyncAdjust, void*, void); + // if the param is != NULL, AdjustRows will be called, else AdjustDataSource + +private: + using BrowseBox::InsertHandleColumn; +}; + +#endif // INCLUDED_SVX_GRIDCTRL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/hdft.hxx b/include/svx/hdft.hxx new file mode 100644 index 000000000..01ddead29 --- /dev/null +++ b/include/svx/hdft.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_SVX_HDFT_HXX +#define INCLUDED_SVX_HDFT_HXX + +#include + +#include + +#include +#include +#include + +namespace weld { class CustomWeld; } + +namespace svx +{ + SVX_DLLPUBLIC bool ShowBorderBackgroundDlg(weld::Window* pParent, SfxItemSet* pBBSet); +} + +class SVX_DLLPUBLIC SvxHFPage : public SfxTabPage +{ +public: + + virtual bool FillItemSet( SfxItemSet* rOutSet ) override; + virtual void Reset( const SfxItemSet* rSet ) override; + + virtual ~SvxHFPage() override; + + void DisableDeleteQueryBox() { mbDisableQueryBox = true; } + + virtual void PageCreated(const SfxAllItemSet&) override; + + void EnableDynamicSpacing(); + +protected: + static const sal_uInt16 pRanges[]; + + virtual void ActivatePage( const SfxItemSet& rSet ) override; + virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; + + SvxHFPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet, sal_uInt16 nSetId); + + sal_uInt16 nId; + std::unique_ptr pBBSet; + bool mbDisableQueryBox : 1; + bool mbEnableDrawingLayerFillStyles : 1; + + SvxPageWindow m_aBspWin; + std::unique_ptr m_xPageLbl; + std::unique_ptr m_xTurnOnBox; + std::unique_ptr m_xCntSharedBox; + std::unique_ptr m_xCntSharedFirstBox; + std::unique_ptr m_xLMLbl; + std::unique_ptrm_xLMEdit; + std::unique_ptr m_xRMLbl; + std::unique_ptr m_xRMEdit; + std::unique_ptr m_xDistFT; + std::unique_ptr m_xDistEdit; + std::unique_ptr m_xDynSpacingCB; + std::unique_ptr m_xHeightFT; + std::unique_ptr m_xHeightEdit; + std::unique_ptr m_xHeightDynBtn; + std::unique_ptr m_xBackgroundBtn; + std::unique_ptr m_xBspWin; + + void InitHandler(); + void TurnOn(const weld::ToggleButton* pButton); + DECL_LINK(TurnOnHdl, weld::ToggleButton&, void); + DECL_LINK(BackgroundHdl, weld::Button&, void); + DECL_LINK(ValueChangeHdl, weld::MetricSpinButton&, void); + void RangeHdl(); + void UpdateExample(); + +private: + SVX_DLLPRIVATE void ResetBackground_Impl( const SfxItemSet& rSet ); +}; + +class SVX_DLLPUBLIC SvxHeaderPage final : public SvxHFPage +{ +public: + static std::unique_ptr Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet ); + // returns the Which values to the range + static const sal_uInt16* GetRanges() { return pRanges; } + SVX_DLLPRIVATE SvxHeaderPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); +}; + +class SVX_DLLPUBLIC SvxFooterPage final : public SvxHFPage +{ +public: + static std::unique_ptr Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet ); + static const sal_uInt16* GetRanges() { return pRanges; } + SVX_DLLPRIVATE SvxFooterPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); +}; + +class SVX_DLLPUBLIC DeleteHeaderDialog final : public weld::MessageDialogController +{ +public: + DeleteHeaderDialog(weld::Widget* pParent) + : MessageDialogController(pParent, "svx/ui/deleteheaderdialog.ui", + "DeleteHeaderDialog") + { + } +}; + +class SVX_DLLPUBLIC DeleteFooterDialog final : public weld::MessageDialogController +{ +public: + DeleteFooterDialog(weld::Widget* pParent) + : MessageDialogController(pParent, "svx/ui/deletefooterdialog.ui", + "DeleteFooterDialog") + { + } +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/helperhittest3d.hxx b/include/svx/helperhittest3d.hxx new file mode 100644 index 000000000..f262564b9 --- /dev/null +++ b/include/svx/helperhittest3d.hxx @@ -0,0 +1,99 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_HELPERHITTEST3D_HXX +#define INCLUDED_SVX_HELPERHITTEST3D_HXX + +#include +#include + + +// predefines + +namespace basegfx { + class B2DPoint; +} + +namespace drawinglayer::geometry { + class ViewInformation3D; +} + +class E3dCompoundObject; +class E3dScene; + + +/** support for getting a ViewInformation3D for a given CompoudObject3D + with correct ObjectTransformation filled out + + @param o_rViewInformation3D + The ViewInformation3D created which will be overwritten + + @param rCandidate + The E3dCompoundObject for which the ViewInformation3D shall be + prepared + + @return + A pointer to the found and used root scene. This is also a hint + if the operation succeeded or not, since when object has no root + scene (is not inserted to a model), an empty ViewInformation3D + will be used +*/ +E3dScene* fillViewInformation3DForCompoundObject( + drawinglayer::geometry::ViewInformation3D& o_rViewInformation3D, + const E3dCompoundObject& rCandidate); + +/** support for getting all from a 2d position hit objects in a 3d scene + in a depth sorted array + + @param rPoint + 2D Point in view coordinates + + @param rScene + The 3D Scene for HitTest + + @param o_rResult + Output parameter which contains all hit 3D objects inside rScene. This + vector will be changed in any case. If it's empty, no hit exists. If it's + not empty, the first object is the object closest to the viewer + +*/ +SVXCORE_DLLPUBLIC void getAllHit3DObjectsSortedFrontToBack( + const basegfx::B2DPoint& rPoint, + const E3dScene& rScene, + ::std::vector< const E3dCompoundObject* >& o_rResult); + +/** support for checking if the single given 3d object is hit at position + + @param rPoint + 2D Point in view coordinates + + @param rCandidate + The 3D Object which needs checking + + @return + true if hit, false if not +*/ +bool checkHitSingle3DObject( + const basegfx::B2DPoint& rPoint, + const E3dCompoundObject& rCandidate); + + +#endif // INCLUDED_SVX_HELPERHITTEST3D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/hexcolorcontrol.hxx b/include/svx/hexcolorcontrol.hxx new file mode 100644 index 000000000..3eaaae9ac --- /dev/null +++ b/include/svx/hexcolorcontrol.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_SVX_HEXCOLOR_HXX +#define INCLUDED_SVX_HEXCOLOR_HXX + +#include +#include +#include + +namespace weld { class Entry; } + +struct ImplSVEvent; + +namespace weld { + +class SVXCORE_DLLPUBLIC HexColorControl +{ +private: + std::unique_ptr m_xEntry; + Link m_aModifyHdl; + ImplSVEvent* m_nAsyncModifyEvent; + + DECL_STATIC_LINK(HexColorControl, ImplProcessInputHdl, OUString&, bool); + DECL_LINK(ImplProcessModifyHdl, weld::Entry&, void); + DECL_LINK(OnAsyncModifyHdl, void*, void); +public: + HexColorControl(std::unique_ptr pEdit); + ~HexColorControl(); + + void connect_changed(const Link& rLink) { m_aModifyHdl = rLink; } + + void SetColor( ::Color nColor ); + ::Color GetColor() const; +}; + +} + +#endif // INCLUDED_SVX_HEXCOLOR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/hlnkitem.hxx b/include/svx/hlnkitem.hxx new file mode 100644 index 000000000..08eded81b --- /dev/null +++ b/include/svx/hlnkitem.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_SVX_HLNKITEM_HXX +#define INCLUDED_SVX_HLNKITEM_HXX + +#include +#include +#include +#include +#include +#include +#include + +enum class HyperDialogEvent { + NONE = 0x0000, + MouseOverObject = 0x0001, + MouseClickObject = 0x0002, + MouseOutObject = 0x0004, +}; +namespace o3tl { + template<> struct typed_flags : is_typed_flags {}; +} + +enum SvxLinkInsertMode +{ + HLINK_DEFAULT, + HLINK_FIELD, + HLINK_BUTTON, + HLINK_HTMLMODE = 0x0080 +}; + +class SVX_DLLPUBLIC SvxHyperlinkItem : public SfxPoolItem +{ + OUString sName; + OUString sURL; + OUString sTarget; + SvxLinkInsertMode eType; + + OUString sIntName; + std::unique_ptr pMacroTable; + + HyperDialogEvent nMacroEvents; + +public: + static SfxPoolItem* CreateDefault(); + + SvxHyperlinkItem( sal_uInt16 _nWhich = SID_HYPERLINK_GETLINK ): + SfxPoolItem(_nWhich) { eType = HLINK_DEFAULT; nMacroEvents=HyperDialogEvent::NONE; }; + SvxHyperlinkItem( const SvxHyperlinkItem& rHyperlinkItem ); + SvxHyperlinkItem( sal_uInt16 nWhich, const OUString& rName, const OUString& rURL, + const OUString& rTarget, const OUString& rIntName, + SvxLinkInsertMode eTyp, + HyperDialogEvent nEvents, + SvxMacroTableDtor const *pMacroTbl ); + + virtual bool operator==( const SfxPoolItem& ) const override; + virtual SvxHyperlinkItem* Clone( SfxItemPool *pPool = nullptr ) const override; + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + const OUString& GetName() const { return sName; } + void SetName(const OUString& rName) { sName = rName; } + + const OUString& GetURL() const { return sURL; } + void SetURL(const OUString& rURL) { sURL = rURL; } + + const OUString& GetIntName () const { return sIntName; } + void SetIntName(const OUString& rIntName) { sIntName = rIntName; } + + const OUString& GetTargetFrame() const { return sTarget; } + void SetTargetFrame(const OUString& rTarget) { sTarget = rTarget; } + + SvxLinkInsertMode GetInsertMode() const { return eType; } + void SetInsertMode( SvxLinkInsertMode eNew ) { eType = eNew; } + + void SetMacro( HyperDialogEvent nEvent, const SvxMacro& rMacro ); + + void SetMacroTable( const SvxMacroTableDtor& rTbl ); + const SvxMacroTableDtor* GetMacroTable() const { return pMacroTable.get(); } + + void SetMacroEvents (const HyperDialogEvent nEvents) { nMacroEvents = nEvents; } + HyperDialogEvent GetMacroEvents() const { return nMacroEvents; } + +}; + +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/hyperdlg.hxx b/include/svx/hyperdlg.hxx new file mode 100644 index 000000000..d86a65d22 --- /dev/null +++ b/include/svx/hyperdlg.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_SVX_HYPERDLG_HXX +#define INCLUDED_SVX_HYPERDLG_HXX + +#include +#include + +/************************************************************************* +|* +|* Hyperlink-Dialog +|* +\************************************************************************/ + +class AbstractSvxHpLinkDlg; + +class SVX_DLLPUBLIC SvxHlinkDlgWrapper final : public SfxChildWindow +{ +private: + VclPtr mpDlg; + +public: + SvxHlinkDlgWrapper( vcl::Window*pParent, sal_uInt16 nId, + SfxBindings* pBindings, SfxChildWinInfo* pInfo ); + virtual ~SvxHlinkDlgWrapper() override; + + SFX_DECL_CHILDWINDOW_WITHID(SvxHlinkDlgWrapper); + virtual bool QueryClose() override; +}; + +#endif // INCLUDED_SVX_HYPERDLG_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/ifaceids.hxx b/include/svx/ifaceids.hxx new file mode 100644 index 000000000..f9942e3f1 --- /dev/null +++ b/include/svx/ifaceids.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_SVX_IFACEIDS_HXX +#define INCLUDED_SVX_IFACEIDS_HXX + + +#include + +#define SVX_INTERFACE_BASIDE_DOCSH (SFX_INTERFACE_IDE_START) +#define SVX_INTERFACE_BASIDE_VIEWSH (SFX_INTERFACE_IDE_START + SfxInterfaceId(1)) +#define SVX_INTERFACE_EXTRUSION_BAR (SFX_INTERFACE_IDE_START + SfxInterfaceId(2)) +#define SVX_INTERFACE_FONTWORK_BAR (SFX_INTERFACE_IDE_START + SfxInterfaceId(3)) + + +#define SVX_INTERFACE_FORM_SH (SFX_INTERFACE_IDE_END + SfxInterfaceId(1)) + +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/imapdlg.hxx b/include/svx/imapdlg.hxx new file mode 100644 index 000000000..74b5a69a0 --- /dev/null +++ b/include/svx/imapdlg.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_SVX_IMAPDLG_HXX +#define INCLUDED_SVX_IMAPDLG_HXX + +#include +#include +#include +#include +#include +#include + +namespace vcl { class Window; } +namespace weld { class Button; } +namespace weld { class ComboBox; } +namespace weld { class CustomWeld; } +namespace weld { class Entry; } +namespace weld { class Label; } +namespace weld { class Toolbar; } +namespace weld { class Widget; } +namespace weld { class Window; } + +class ImageMap; +class SvtURLBox; + +/************************************************************************* +|* +|* Derivation from SfxChildWindow as "container" for float +|* +\************************************************************************/ + +class Graphic; +typedef ::std::vector< OUString > TargetList; + +class SVX_DLLPUBLIC SvxIMapDlgChildWindow final : public SfxChildWindow +{ + public: + + SvxIMapDlgChildWindow( vcl::Window*, sal_uInt16, SfxBindings*, SfxChildWinInfo const * ); + + SFX_DECL_CHILDWINDOW_WITHID( SvxIMapDlgChildWindow ); + + static void UpdateIMapDlg( const Graphic& rGraphic, const ImageMap* pImageMap, + const TargetList* pTargetList, void* pEditingObj ); +}; + + +class SvxIMapDlg; + +class SvxIMapDlgItem final : public SfxControllerItem +{ + SvxIMapDlg& rIMap; + + virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, + const SfxPoolItem* pState ) override; + + +public: + + SvxIMapDlgItem( SvxIMapDlg& rIMapDlg, SfxBindings& rBindings ); +}; + +class IMapOwnData; +class IMapWindow; +class GraphCtrl; + +class SVX_DLLPUBLIC SvxIMapDlg : public SfxModelessDialogController +{ + friend class IMapOwnData; + friend class IMapWindow; + + std::unique_ptr pOwnData; + void* pCheckObj; + SvxIMapDlgItem aIMapItem; + + std::unique_ptr m_xIMapWnd; + std::unique_ptr m_xTbxIMapDlg1; + std::unique_ptr m_xFtURL; + std::unique_ptr m_xURLBox; + std::unique_ptr m_xFtText; + std::unique_ptr m_xEdtText; + std::unique_ptr m_xFtTarget; + std::unique_ptr m_xCbbTarget; + std::unique_ptr m_xCancelBtn; + std::unique_ptr m_xStbStatus1; + std::unique_ptr m_xStbStatus2; + std::unique_ptr m_xStbStatus3; + std::unique_ptr m_xIMapWndWeld; + + DECL_LINK( TbxClickHdl, const OString&, void ); + DECL_LINK( InfoHdl, IMapWindow&, void ); + DECL_LINK( MousePosHdl, GraphCtrl*, void ); + DECL_LINK( GraphSizeHdl, GraphCtrl*, void ); + DECL_LINK( URLModifyHdl, weld::ComboBox&, void ); + DECL_LINK( EntryModifyHdl, weld::Entry&, void ); + DECL_LINK( URLLoseFocusHdl, weld::Widget&, void ); + DECL_LINK( UpdateHdl, Timer *, void ); + DECL_LINK( StateHdl, GraphCtrl*, void ); + DECL_LINK( CancelHdl, weld::Button&, void ); + + void URLModify(); + void DoOpen(); + bool DoSave(); + void SetActiveTool(const OString& rId); + +public: + + SvxIMapDlg(SfxBindings *pBindings, SfxChildWindow *pCW, + weld::Window* pParent); + virtual ~SvxIMapDlg() override; + + void SetExecState( bool bEnable ); + + const void* GetEditingObject() const { return pCheckObj; } + + const ImageMap& GetImageMap() const; + + void SetTargetList( const TargetList& rTargetList ); + + void UpdateLink( const Graphic& rGraphic, const ImageMap* pImageMap, + const TargetList* pTargetList, void* pEditingObj ); +}; + +SVX_DLLPUBLIC SvxIMapDlg* GetIMapDlg(); + +#endif // INCLUDED_SVX_IMAPDLG_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/insctrl.hxx b/include/svx/insctrl.hxx new file mode 100644 index 000000000..e25090f66 --- /dev/null +++ b/include/svx/insctrl.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_SVX_INSCTRL_HXX +#define INCLUDED_SVX_INSCTRL_HXX + +#include +#include + +class SVX_DLLPUBLIC SvxInsertStatusBarControl final : public SfxStatusBarControl +{ +public: + virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, + const SfxPoolItem* pState ) override; + virtual void Paint( const UserDrawEvent& rEvt ) override; + + SFX_DECL_STATUSBAR_CONTROL(); + + SvxInsertStatusBarControl( sal_uInt16 nSlotId, sal_uInt16 nId, StatusBar& rStb ); + virtual ~SvxInsertStatusBarControl() override; + +private: + bool bInsert; + + SVX_DLLPRIVATE void DrawItemText_Impl(); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/ipolypolygoneditorcontroller.hxx b/include/svx/ipolypolygoneditorcontroller.hxx new file mode 100644 index 000000000..4e1ef9124 --- /dev/null +++ b/include/svx/ipolypolygoneditorcontroller.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_SVX_IPOLYPOLYGONEDITORCONTROLLER_HXX +#define INCLUDED_SVX_IPOLYPOLYGONEDITORCONTROLLER_HXX + +#include + +#include + + +// Defines + +enum class SdrPathSmoothKind +{ + DontCare, // only for status query + Angular, // angular + Asymmetric, // asymmetric, normal Smooth + Symmetric // symmetric +}; +enum class SdrPathSegmentKind +{ + DontCare, // only for status query + Line, // straight path segment + Curve, // curve path segment (Bezier) + Toggle // only for Set: Toggle +}; +enum class SdrObjClosedKind +{ + DontCare, // only for status query + Open, // non-closed object (line, polyline, ...) + Closed // closed object (polygon, ...) +}; + +class SAL_DLLPUBLIC_RTTI IPolyPolygonEditorController +{ +public: + virtual void DeleteMarkedPoints() = 0; + virtual bool IsDeleteMarkedPointsPossible() const = 0; + + virtual void RipUpAtMarkedPoints() = 0; + virtual bool IsRipUpAtMarkedPointsPossible() const = 0; + + virtual bool IsSetMarkedSegmentsKindPossible() const = 0; + virtual SdrPathSegmentKind GetMarkedSegmentsKind() const = 0; + virtual void SetMarkedSegmentsKind(SdrPathSegmentKind eKind) = 0; + + virtual bool IsSetMarkedPointsSmoothPossible() const = 0; + virtual SdrPathSmoothKind GetMarkedPointsSmooth() const = 0; + virtual void SetMarkedPointsSmooth(SdrPathSmoothKind eKind) = 0; + + virtual bool IsOpenCloseMarkedObjectsPossible() const = 0; + virtual SdrObjClosedKind GetMarkedObjectsClosedState() const = 0; + +protected: + ~IPolyPolygonEditorController() {} +}; + +#endif // INCLUDED_SVX_IPOLYPOLYGONEDITORCONTROLLER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/itemwin.hxx b/include/svx/itemwin.hxx new file mode 100644 index 000000000..a270d25f0 --- /dev/null +++ b/include/svx/itemwin.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_SVX_ITEMWIN_HXX +#define INCLUDED_SVX_ITEMWIN_HXX + +#include +#include +#include +#include + +class SfxObjectShell; +class ValueSet; +class SvxLineStyleToolBoxControl; + +class SvxLineBox final : public WeldToolbarPopup +{ + rtl::Reference mxControl; + std::unique_ptr mxLineStyleSet; + std::unique_ptr mxLineStyleSetWin; + + void FillControl(); + void Fill(const XDashListRef &pList); + + DECL_LINK(SelectHdl, ValueSet*, void); + + virtual void GrabFocus() override; + +public: + SvxLineBox(SvxLineStyleToolBoxControl* pControl, weld::Widget* pParent, int nInitialIndex); + virtual ~SvxLineBox() override; +}; + +namespace SvxFillTypeBox +{ + SVX_DLLPUBLIC void Fill(weld::ComboBox& rListBox); +} + +namespace SvxFillAttrBox +{ + SVX_DLLPUBLIC void Fill(weld::ComboBox&, const XHatchListRef &pList); + SVX_DLLPUBLIC void Fill(weld::ComboBox&, const XGradientListRef &pList); + SVX_DLLPUBLIC void Fill(weld::ComboBox&, const XBitmapListRef &pList); + SVX_DLLPUBLIC void Fill(weld::ComboBox&, const XPatternListRef &pList); +} + +#endif // INCLUDED_SVX_ITEMWIN_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/itextprovider.hxx b/include/svx/itextprovider.hxx new file mode 100644 index 000000000..361b2293e --- /dev/null +++ b/include/svx/itextprovider.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/. + */ + +#ifndef INCLUDED_SVX_ITEXTPROVIDER_HXX +#define INCLUDED_SVX_ITEXTPROVIDER_HXX + +#include + +#include + +class SdrText; + +namespace svx +{ + + /** This interface provides access to text object(s) in an SdrObject. + + */ + class SVXCORE_DLLPUBLIC ITextProvider + { + public: + /** Return the number of texts available for this object. */ + virtual sal_Int32 getTextCount() const = 0; + + /** Return the nth available text. */ + virtual SdrText* getText(sal_Int32 nIndex) const = 0; + + protected: + ~ITextProvider() {} + }; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/labelitemwindow.hxx b/include/svx/labelitemwindow.hxx new file mode 100644 index 000000000..5271482b1 --- /dev/null +++ b/include/svx/labelitemwindow.hxx @@ -0,0 +1,30 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include +#include + +class SVXCORE_DLLPUBLIC LabelItemWindow final : public InterimItemWindow +{ +private: + std::unique_ptr m_xLabel; + +public: + LabelItemWindow(vcl::Window* pParent, const OUString& rLabel); + void set_label(const OUString& rLabel); + OUString get_label() const; + + void SetOptimalSize(); + virtual void dispose() override; + virtual ~LabelItemWindow() override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/svx/langbox.hxx b/include/svx/langbox.hxx new file mode 100644 index 000000000..46956955a --- /dev/null +++ b/include/svx/langbox.hxx @@ -0,0 +1,117 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_LANGBOX_HXX +#define INCLUDED_SVX_LANGBOX_HXX + +#include +#include +#include +#include +#include +#include + +enum class SvxLanguageListFlags +{ + EMPTY = 0x0000, + ALL = 0x0001, + WESTERN = 0x0002, + CTL = 0x0004, + CJK = 0x0008, + FBD_CHARS = 0x0010, + ONLY_KNOWN = 0x0020, // list only locales provided by I18N + SPELL_USED = 0x0040, +}; +namespace o3tl +{ + template<> struct typed_flags : is_typed_flags {}; +} + +// load language strings from resource +SVXCORE_DLLPUBLIC OUString GetDicInfoStr( const OUString& rName, const LanguageType nLang, bool bNeg ); + +class SVXCORE_DLLPUBLIC SvxLanguageBox +{ +public: + enum class EditedAndValid + { + No, + Valid, + Invalid + }; + +private: + std::unique_ptr m_xControl; + Link m_aChangeHdl; + OUString m_aAllString; + std::unique_ptr> m_xSpellUsedLang; + LanguageType m_eSavedLanguage; + EditedAndValid m_eEditedAndValid; + bool m_bHasLangNone; + bool m_bLangNoneIsLangAll; + bool m_bWithCheckmark; + + SVX_DLLPRIVATE weld::ComboBoxEntry BuildEntry(const LanguageType nLangType, sal_Int16 nType = css::i18n::ScriptType::WEAK); + SVX_DLLPRIVATE void AddLanguages(const std::vector< LanguageType >& rLanguageTypes, SvxLanguageListFlags nLangList, + std::vector& rEntries); + SVX_DLLPRIVATE void InsertLanguage(const LanguageType nLangType, sal_Int16 nType); + + SVX_DLLPRIVATE int ImplTypeToPos(LanguageType eType) const; + DECL_LINK(ChangeHdl, weld::ComboBox&, void); +public: + SvxLanguageBox(std::unique_ptr pControl); + void SetLanguageList( SvxLanguageListFlags nLangList, + bool bHasLangNone, bool bLangNoneIsLangAll = false, + bool bCheckSpellAvail = false, bool bDefaultLangExist = false, + LanguageType eDefaultLangType = LANGUAGE_NONE, + sal_Int16 nDefaultType = 0 ); + void InsertLanguage(const LanguageType nLangType); + + EditedAndValid GetEditedAndValid() const { return m_eEditedAndValid;} + sal_Int32 SaveEditedAsEntry(); + + void connect_changed(const Link& rLink) { m_aChangeHdl = rLink; } + void connect_focus_in(const Link& rLink) { m_xControl->connect_focus_in(rLink); } + void grab_focus() { m_xControl->grab_focus(); } + void save_active_id() { m_eSavedLanguage = get_active_id(); } + LanguageType get_saved_active_id() const { return m_eSavedLanguage; } + bool get_active_id_changed_from_saved() const { return m_eSavedLanguage != get_active_id(); } + void show() { m_xControl->show(); } + void hide() { m_xControl->hide(); } + void set_visible(bool bShow) { m_xControl->set_visible(bShow); } + void set_sensitive(bool bSensitive) { m_xControl->set_sensitive(bSensitive); } + void set_active(int nPos) { m_xControl->set_active(nPos); } + int get_active() const { return m_xControl->get_active(); } + void set_active_id(const LanguageType eLangType); + OUString get_active_text() const { return m_xControl->get_active_text(); } + bool get_visible() const { return m_xControl->get_visible(); } + LanguageType get_active_id() const; + int find_id(const LanguageType eLangType) const; + LanguageType get_id(int nPos) const; + void set_id(int nPos, const LanguageType eLangType); + void remove_id(const LanguageType eLangType); + void append(const LanguageType eLangType, const OUString& rStr); + int find_text(const OUString& rStr) const { return m_xControl->find_text(rStr); } + OUString get_text(int nPos) const { return m_xControl->get_text(nPos); } + int get_count() const { return m_xControl->get_count(); } + weld::ComboBox* get_widget() { return m_xControl.get(); } +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/lathe3d.hxx b/include/svx/lathe3d.hxx new file mode 100644 index 000000000..a14ae9a0e --- /dev/null +++ b/include/svx/lathe3d.hxx @@ -0,0 +1,125 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_LATHE3D_HXX +#define INCLUDED_SVX_LATHE3D_HXX + +#include +#include +#include +#include +#include +#include + +class E3dDefaultAttributes; + +/************************************************************************* +|* +|* Create a 3D rotation object from a passed 2D polygon +|* +|* The aPolyPoly3D is rotated around its axis in nHSegments steps. +|* nVSegments contains the number of lines of aPolyPoly3D and therefore +|* is effectively a vertical segmentation. +|* +\************************************************************************/ + +class SVXCORE_DLLPUBLIC E3dLatheObj final : public E3dCompoundObject +{ + basegfx::B2DPolyPolygon maPolyPoly2D; + + virtual std::unique_ptr CreateObjectSpecificViewContact() override; + virtual std::unique_ptr CreateObjectSpecificProperties() override; + void SetDefaultAttributes(const E3dDefaultAttributes& rDefault); + +private: + // protected destructor - due to final, make private + virtual ~E3dLatheObj() override; + +public: + E3dLatheObj( + SdrModel& rSdrModel, + const E3dDefaultAttributes& rDefault, + const basegfx::B2DPolyPolygon& rPoly2D); + E3dLatheObj(SdrModel& rSdrModel); + + // HorizontalSegments: + sal_uInt32 GetHorizontalSegments() const + { return GetObjectItemSet().Get(SDRATTR_3DOBJ_HORZ_SEGS).GetValue(); } + + // VerticalSegments: + sal_uInt32 GetVerticalSegments() const + { return GetObjectItemSet().Get(SDRATTR_3DOBJ_VERT_SEGS).GetValue(); } + + // PercentDiagonal: 0..100, before 0.0..0.5 + sal_uInt16 GetPercentDiagonal() const + { return GetObjectItemSet().Get(SDRATTR_3DOBJ_PERCENT_DIAGONAL).GetValue(); } + + // BackScale: 0..100, before 0.0..1.0 + sal_uInt16 GetBackScale() const + { return GetObjectItemSet().Get(SDRATTR_3DOBJ_BACKSCALE).GetValue(); } + + // EndAngle: 0..10000 + sal_uInt32 GetEndAngle() const + { return GetObjectItemSet().Get(SDRATTR_3DOBJ_END_ANGLE).GetValue(); } + + // #107245# GetSmoothNormals() for bLatheSmoothed + bool GetSmoothNormals() const + { return GetObjectItemSet().Get(SDRATTR_3DOBJ_SMOOTH_NORMALS).GetValue(); } + + // #107245# GetSmoothLids() for bLatheSmoothFrontBack + bool GetSmoothLids() const + { return GetObjectItemSet().Get(SDRATTR_3DOBJ_SMOOTH_LIDS).GetValue(); } + + // #107245# GetCharacterMode() for bLatheCharacterMode + bool GetCharacterMode() const + { return GetObjectItemSet().Get(SDRATTR_3DOBJ_CHARACTER_MODE).GetValue(); } + + // #107245# GetCloseFront() for bLatheCloseFront + bool GetCloseFront() const + { return GetObjectItemSet().Get(SDRATTR_3DOBJ_CLOSE_FRONT).GetValue(); } + + // #107245# GetCloseBack() for bLatheCloseBack + bool GetCloseBack() const + { return GetObjectItemSet().Get(SDRATTR_3DOBJ_CLOSE_BACK).GetValue(); } + + virtual sal_uInt16 GetObjIdentifier() const override; + + virtual E3dLatheObj* CloneSdrObject(SdrModel& rTargetModel) const override; + + // implemented mainly for the purposes of Clone() + E3dLatheObj& operator=(const E3dLatheObj& rObj); + + virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const override; + + // TakeObjName...() is for the display in the UI, for example "3 frames selected". + virtual OUString TakeObjNameSingul() const override; + virtual OUString TakeObjNamePlural() const override; + + // set/get local parameters with geometry recreation + void SetPolyPoly2D(const basegfx::B2DPolyPolygon& rNew); + const basegfx::B2DPolyPolygon& GetPolyPoly2D() const { return maPolyPoly2D; } + + // break up + virtual bool IsBreakObjPossible() override; + virtual std::unique_ptr GetBreakObj() override; +}; + +#endif // INCLUDED_SVX_LATHE3D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/layctrl.hxx b/include/svx/layctrl.hxx new file mode 100644 index 000000000..9b9e5fe13 --- /dev/null +++ b/include/svx/layctrl.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_SVX_LAYCTRL_HXX +#define INCLUDED_SVX_LAYCTRL_HXX + +#include +#include + +class SvxTableToolBoxControl final : public svt::PopupWindowController +{ +public: + SvxTableToolBoxControl(const css::uno::Reference& rContext); + virtual ~SvxTableToolBoxControl() override; + + virtual std::unique_ptr weldPopupWindow() override; + virtual VclPtr createVclPopupWindow( vcl::Window* pParent ) override; + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() override; + virtual css::uno::Sequence SAL_CALL getSupportedServiceNames() override; + + // XInitialization + virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& rArguments ) override; + + void TableDialog(const css::uno::Sequence& rArgs); + void CloseAndShowTableDialog(); +}; + +class SvxColumnsToolBoxControl final : public svt::PopupWindowController +{ +public: + SvxColumnsToolBoxControl(const css::uno::Reference& rContext); + virtual ~SvxColumnsToolBoxControl() override; + + virtual std::unique_ptr weldPopupWindow() override; + virtual VclPtr createVclPopupWindow( vcl::Window* pParent ) override; + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() override; + virtual css::uno::Sequence SAL_CALL getSupportedServiceNames() override; + + // XInitialization + virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& rArguments ) override; + + void InsertColumns(const css::uno::Sequence& rArgs); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/lboxctrl.hxx b/include/svx/lboxctrl.hxx new file mode 100644 index 000000000..25c69f113 --- /dev/null +++ b/include/svx/lboxctrl.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_SVX_LBOXCTRL_HXX +#define INCLUDED_SVX_LBOXCTRL_HXX + +#include +#include +#include +#include + +class ToolBox; +class SvxPopupWindowListBox; + +class SvxUndoRedoControl final : public svt::PopupWindowController +{ + std::vector< OUString > aUndoRedoList; + OUString aDefaultTooltip; + +public: + SvxUndoRedoControl(const css::uno::Reference& rContext); + virtual ~SvxUndoRedoControl() override; + + virtual VclPtr createVclPopupWindow( vcl::Window* pParent ) override; + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() override; + virtual css::uno::Sequence SAL_CALL getSupportedServiceNames() override; + + // XInitialization + virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& rArguments ) override; + + virtual void SAL_CALL statusChanged(const css::frame::FeatureStateEvent& rEvent) override; + + void Do(sal_Int16 nCount); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/legacyitem.hxx b/include/svx/legacyitem.hxx new file mode 100644 index 000000000..4a9661220 --- /dev/null +++ b/include/svx/legacyitem.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_SVX_LEGACYITEM_HXX +#define INCLUDED_SVX_LEGACYITEM_HXX + +#include + +////////////////////////////////////////////////////////////////////////////// +// // svx +// SvxOrientationItem aOrientation( aRotateAngle.GetValue(), aStacked.GetValue(), 0 ); +// SvxMarginItem aMargin; +// SvxRotateModeItem aRotateMode; +////////////////////////////////////////////////////////////////////////////// + +class SvStream; +class SvxOrientationItem; +class SvxMarginItem; +class SvxRotateModeItem; + +namespace legacy +{ + namespace SvxOrientation + { + sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion); + void Create(SvxOrientationItem& rItem, SvStream& rStrm, sal_uInt16 nItemVersion); + SvStream& Store(const SvxOrientationItem& rItem, SvStream& rStrm, sal_uInt16 nItemVersion); + } + namespace SvxMargin + { + sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion); + void Create(SvxMarginItem& rItem, SvStream& rStrm, sal_uInt16 nItemVersion); + SvStream& Store(const SvxMarginItem& rItem, SvStream& rStrm, sal_uInt16 nItemVersion); + } + namespace SvxRotateMode + { + sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion); + void Create(SvxRotateModeItem& rItem, SvStream& rStrm, sal_uInt16 nItemVersion); + SvStream& Store(const SvxRotateModeItem& rItem, SvStream& rStrm, sal_uInt16 nItemVersion); + } +} + +#endif // INCLUDED_SVX_LEGACYITEM_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/linectrl.hxx b/include/svx/linectrl.hxx new file mode 100644 index 000000000..62f428aa5 --- /dev/null +++ b/include/svx/linectrl.hxx @@ -0,0 +1,87 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_LINECTRL_HXX +#define INCLUDED_SVX_LINECTRL_HXX + +#include +#include +#include +#include + +namespace svx { + class ToolboxButtonLineStyleUpdater; +} + +class XLineStyleItem; +class XLineDashItem; + +typedef std::function LineStyleSelectFunction; + +// SvxLineStyleController: +class SVXCORE_DLLPUBLIC SvxLineStyleToolBoxControl final : public svt::PopupWindowController +{ +private: + std::unique_ptr m_xBtnUpdater; + + LineStyleSelectFunction m_aLineStyleSelectFunction; + +public: + SvxLineStyleToolBoxControl( const css::uno::Reference& rContext ); + + // XInitialization + virtual void SAL_CALL initialize( const css::uno::Sequence& rArguments ) override; + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() override; + virtual css::uno::Sequence SAL_CALL getSupportedServiceNames() override; + + virtual void SAL_CALL execute(sal_Int16 nKeyModifier) override; + virtual void SAL_CALL statusChanged(const css::frame::FeatureStateEvent& rEvent) override; + + virtual ~SvxLineStyleToolBoxControl() override; + + void setLineStyleSelectFunction(const LineStyleSelectFunction& aLineStyleSelectFunction); + void dispatchLineStyleCommand(const OUString& rCommand, const css::uno::Sequence& rArgs); + +private: + virtual std::unique_ptr weldPopupWindow() override; + virtual VclPtr createVclPopupWindow( vcl::Window* pParent ) override; + +}; + +// SvxLineWidthController: + +class SVX_DLLPUBLIC SvxLineWidthToolBoxControl final : public SfxToolBoxControl +{ + static MapUnit GetCoreMetric(); + +public: + SFX_DECL_TOOLBOX_CONTROL(); + + SvxLineWidthToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ); + virtual ~SvxLineWidthToolBoxControl() override; + + virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, + const SfxPoolItem* pState ) override; + virtual VclPtr CreateItemWindow( vcl::Window *pParent ) override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/linkwarn.hxx b/include/svx/linkwarn.hxx new file mode 100644 index 000000000..c72f7f85e --- /dev/null +++ b/include/svx/linkwarn.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_SVX_LINKWARN_HXX +#define INCLUDED_SVX_LINKWARN_HXX + +#include +#include + +class SVX_DLLPUBLIC SvxLinkWarningDialog final : public weld::MessageDialogController +{ +private: + std::unique_ptr m_xWarningOnBox; + +public: + SvxLinkWarningDialog(weld::Widget* pParent, const OUString& _rFileName); + virtual ~SvxLinkWarningDialog() override; +}; + +#endif // INCLUDED_SVX_LINKWARN_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/measctrl.hxx b/include/svx/measctrl.hxx new file mode 100644 index 000000000..362ac85ae --- /dev/null +++ b/include/svx/measctrl.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_SVX_MEASCTRL_HXX +#define INCLUDED_SVX_MEASCTRL_HXX + +#include +#include +#include +#include + +class SfxItemSet; +class SdrMeasureObj; +class SdrModel; + +class SVX_DLLPUBLIC SvxXMeasurePreview final : public weld::CustomWidgetController +{ + friend class SvxMeasurePage; + +private: + MapMode m_aMapMode; + std::unique_ptr pModel; + std::unique_ptr pMeasureObj; + + void ResizeImpl(const Size& rSize); +public: + SvxXMeasurePreview(); + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; + virtual ~SvxXMeasurePreview() override; + + virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override; + virtual void Resize() override; + virtual bool MouseButtonDown(const MouseEvent& rMEvt) override; + + void SetAttributes(const SfxItemSet& rInAttrs); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/modctrl.hxx b/include/svx/modctrl.hxx new file mode 100644 index 000000000..6ce84931b --- /dev/null +++ b/include/svx/modctrl.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_SVX_MODCTRL_HXX +#define INCLUDED_SVX_MODCTRL_HXX + +#include +#include +#include + +#include + +class Timer; + +class SVX_DLLPUBLIC SvxModifyControl final : public SfxStatusBarControl +{ +public: + virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, + const SfxPoolItem* pState ) override; + virtual void Paint( const UserDrawEvent& rUsrEvt ) override; + virtual void Click() override; + + SFX_DECL_STATUSBAR_CONTROL(); + + SvxModifyControl( sal_uInt16 nSlotId, sal_uInt16 nId, StatusBar& rStb ); + +private: // Links + DECL_LINK( OnTimer, Timer *, void ); + +private: // Functions + void _repaint(); + +private: + struct ImplData; + std::shared_ptr mxImpl; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/msdffdef.hxx b/include/svx/msdffdef.hxx new file mode 100644 index 000000000..373974e67 --- /dev/null +++ b/include/svx/msdffdef.hxx @@ -0,0 +1,858 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#pragma once + +#include +#include + +#define DFF_COMMON_RECORD_HEADER_SIZE 8 + +const sal_uInt32 nMaxLegalDffRecordLength = + SAL_MAX_UINT32 - DFF_COMMON_RECORD_HEADER_SIZE; + +#define DFF_PSFLAG_CONTAINER 0x0F // If the version field of a record + // header takes on this value, the + // record header marks the start of + // a container. + +#define DFF_PST_TextHeaderAtom 3999 +#define DFF_PST_TextCharsAtom 4000 +#define DFF_PST_TextBytesAtom 4008 +#define DFF_PST_ExOleObjStg 4113 + +// Record Name FBT-Value Instance Contents Wrd Exl Ppt Ver + +#define DFF_msofbtDggContainer 0xF000 // per-document data X X X +#define DFF_msofbtDgg 0xF006 // an FDGG and several FIDCLs X X X 0 +#define DFF_msofbtCLSID 0xF016 // the CLSID of the application that put the data on the clipboard C C C 0 +#define DFF_msofbtOPT 0xF00B // count of properties the document-wide default shape properties X X X 3 +#define DFF_msofbtColorMRU 0xF11A // count of colors the colors in the MRU swatch X X X 0 +#define DFF_msofbtSplitMenuColors 0xF11E // count of colors the colors in the top-level split menus X X X 0 +#define DFF_msofbtBstoreContainer 0xF001 // count of BLIPs all images in the document (JPEGs, metafiles, etc.) X X X +#define DFF_msofbtBSE 0xF007 // BLIP type an FBSE (one per BLIP) X X X 2 +#define DFF_msofbtBlipFirst 0xF018 // range of fbts reserved for various kinds of BLIPs X X X +#define DFF_msofbtBlipLast 0xF117 // range of fbts reserved for various kinds of BLIPs X X X + +#define DFF_msofbtDgContainer 0xF002 // per-sheet/page/slide data X X X +#define DFF_msofbtDg 0xF008 // drawing ID an FDG X X X 0 +#define DFF_msofbtRegroupItems 0xF118 // count of regroup entries several FRITs X X X 0 +#define DFF_msofbtColorScheme 0xF120 // count of colors the colors of the source host's color scheme C C 0 +#define DFF_msofbtSpgrContainer 0xF003 // several SpContainers, the first of which is the group shape itself X X X +#define DFF_msofbtSpContainer 0xF004 // a shape X X X +#define DFF_msofbtSpgr 0xF009 // an FSPGR; only present if the shape is a group shape X X X 1 +#define DFF_msofbtSp 0xF00A // shape type an FSP X X X 2 +#define DFF_msofbtTextbox 0xF00C // RTF text C C C 0 +#define DFF_msofbtClientTextbox 0xF00D // host-defined the text in the textbox, in host-defined format X X X +#define DFF_msofbtAnchor 0xF00E // a RECT, in 100000ths of an inch C C C 0 +#define DFF_msofbtChildAnchor 0xF00F // a RECT, in units relative to the parent group X X X 0 +#define DFF_msofbtClientAnchor 0xF010 // host-defined the location of the shape, in a host-defined format X X X +#define DFF_msofbtClientData 0xF011 // host-defined host-specific data X X X +#define DFF_msofbtOleObject 0xF11F // a serialized IStorage for an OLE object C C C 0 +#define DFF_msofbtDeletedPspl 0xF11D // an FPSPL; only present in top-level deleted shapes X 0 +#define DFF_msofbtUDefProp 0xF122 // range of fbts reserved for various kinds of BLIPs X X X +#define DFF_msofbtSolverContainer 0xF005 // count of rules the rules governing shapes X X X +#define DFF_msofbtConnectorRule 0xF012 // an FConnectorRule X X 1 +#define DFF_msofbtAlignRule 0xF013 // an FAlignRule X X X 0 +#define DFF_msofbtArcRule 0xF014 // an FARCRU X X X 0 +#define DFF_msofbtClientRule 0xF015 // host-defined host-defined +#define DFF_msofbtCalloutRule 0xF017 // an FCORU X X X 0 + + +// Values for the ULONG in DFF_PST_TextHeaderAtom +enum DFF_TextHeader { + DFFTH_TITLE, + DFFTH_BODY, + DFFTH_NOTES, + DFFTH_NOTUSED, + DFFTH_OTHER, // Text in a Shape + DFFTH_CENTERBODY, // Subtitle in Title-Slide + DFFTH_CENTERTITLE, // Title in Title-Slide + DFFTH_HALFBODY, // Body in two-column slide + DFFTH_QUARTERBODY // Body in four-body slide +}; + + +// Shape Properties +// 1pt = 12700 EMU (English Metric Units) +// 1pt = 20 Twip = 20/1440" = 1/72" +// 1twip=635 EMU +// 1" = 12700*72 = 914400 EMU +// 1" = 25.4mm +// 1mm = 36000 EMU + + +// Record Name FBT-Value Instance Contents Wrd Exl Ppt Ver +// Transform +#define DFF_Prop_Rotation 4 // Fixed Point 16.16 degrees +// Protection +#define DFF_Prop_LockAgainstGrouping 127 // sal_Bool Do not group this shape +// Text +#define DFF_Prop_lTxid 128 // LONG id for the text, value determined by the host +#define DFF_Prop_dxTextLeft 129 // LONG margins relative to shape's inscribed text rectangle (in EMUs) +#define DFF_Prop_dyTextTop 130 // LONG +#define DFF_Prop_dxTextRight 131 // LONG +#define DFF_Prop_dyTextBottom 132 // LONG +#define DFF_Prop_WrapText 133 // MSO_WRAPMODE Wrap text at shape margins +#define DFF_Prop_anchorText 135 // MSO_ANCHOR How to anchor the text +#define DFF_Prop_txflTextFlow 136 // MSO_TXFL Text flow +#define DFF_Prop_cdirFont 137 // MSO_CDIR Font rotation +#define DFF_Prop_hspNext 138 // MSO_HSP ID of the next shape (used by Word for linked textboxes) +#define DFF_Prop_AutoTextMargin 188 // sal_Bool use host's margin calculations +#define DFF_Prop_RotateText 189 // sal_Bool Rotate text with shape +#define DFF_Prop_FitTextToShape 191 // sal_Bool Size text to fit shape size +// GeoText +#define DFF_Prop_gtextUNICODE 192 // WCHAR* UNICODE text string +#define DFF_Prop_gtextAlign 194 // MSO_GEOTEXTALIGN alignment on curve +#define DFF_Prop_gtextSize 195 // LONG default point size +#define DFF_Prop_gtextSpacing 196 // LONG fixed point 16.16 +#define DFF_Prop_gtextFont 197 // WCHAR* font family name +#define DFF_Prop_gtextFStretch 245 // sal_Bool 400 Stretch to fit shape +#define DFF_Prop_gtextFBold 250 // sal_Bool 20 Bold font +#define DFF_Prop_gtextFItalic 251 // sal_Bool 10 Italic font +#define DFF_Prop_gtextFStrikethrough 255 // sal_Bool 1 Strike through font +// Blip +#define DFF_Prop_cropFromTop 256 // LONG 16.16 fraction times total image width or height, as appropriate. +#define DFF_Prop_cropFromBottom 257 // LONG +#define DFF_Prop_cropFromLeft 258 // LONG +#define DFF_Prop_cropFromRight 259 // LONG +#define DFF_Prop_pib 260 // IMsoBlip* Blip to display +#define DFF_Prop_pibName 261 // WCHAR* Blip file name +#define DFF_Prop_pibFlags 262 // MSO_BLIPFLAGS Blip flags +#define DFF_Prop_pictureTransparent 263 // LONG transparent color (none if ~0UL) +#define DFF_Prop_pictureContrast 264 // LONG contrast setting +#define DFF_Prop_pictureBrightness 265 // LONG brightness setting +#define DFF_Prop_pictureGamma 266 // LONG 16.16 gamma +#define DFF_Prop_pictureId 267 // LONG Host-defined ID for OLE objects (usually a pointer) +#define DFF_Prop_pictureActive 319 // sal_Bool Server is active (OLE objects only) +// Geometry +#define DFF_Prop_geoLeft 320 // LONG Defines the G (geometry) coordinate space. +#define DFF_Prop_geoTop 321 // LONG +#define DFF_Prop_geoRight 322 // LONG +#define DFF_Prop_geoBottom 323 // LONG +#define DFF_Prop_pVertices 325 // IMsoArray An array of points, in G units. +#define DFF_Prop_pSegmentInfo 326 // IMsoArray +#define DFF_Prop_adjustValue 327 // LONG Adjustment values corresponding to the positions of the +#define DFF_Prop_adjust2Value 328 // LONG adjust handles of the shape. The number of values used +#define DFF_Prop_adjust3Value 329 // LONG and their allowable ranges vary from shape type to shape type. +#define DFF_Prop_adjust4Value 330 // LONG +#define DFF_Prop_adjust5Value 331 // LONG +#define DFF_Prop_adjust6Value 332 // LONG +#define DFF_Prop_adjust7Value 333 // LONG +#define DFF_Prop_adjust8Value 334 // LONG +#define DFF_Prop_adjust9Value 335 // LONG +#define DFF_Prop_adjust10Value 336 // LONG +#define DFF_Prop_connectorPoints 337 // IMsoArray +#define DFF_Prop_stretchPointX 339 // LONG +#define DFF_Prop_stretchPointY 340 // LONG +#define DFF_Prop_Handles 341 // H* +#define DFF_Prop_pFormulas 342 // LONG +#define DFF_Prop_textRectangles 343 // LONG +#define DFF_Prop_connectorType 344 // LONG ->0=none, 1=segments, 2=custom, 3=rect +#define DFF_Prop_f3DOK 379 // sal_Bool 3D may be set +#define DFF_Prop_fGtextOK 381 // sal_Bool Text effect (FontWork) supported +#define DFF_Prop_fFillShadeShapeOK 382 // BOOL +#define DFF_Prop_fFillOK 383 // sal_Bool OK to fill the shape through the UI or VBA? +// FillStyle +#define DFF_Prop_fillType 384 // MSO_FILLTYPE Type of fill +#define DFF_Prop_fillColor 385 // MSO_CLR Foreground color +#define DFF_Prop_fillOpacity 386 // LONG Fixed 16.16 +#define DFF_Prop_fillBackColor 387 // MSO_CLR Background color +#define DFF_Prop_fillBackOpacity 388 // LONG Shades only +#define DFF_Prop_fillBlip 390 // IMsoBlip* Pattern/texture +#define DFF_Prop_fillWidth 393 // LONG How big (A units) to make a metafile texture. +#define DFF_Prop_fillHeight 394 // LONG +#define DFF_Prop_fillAngle 395 // LONG Fade angle - degrees in 16.16 +#define DFF_Prop_fillFocus 396 // LONG Linear shaded fill focus percent +#define DFF_Prop_fillToRight 399 // LONG Fraction 16.16 +#define DFF_Prop_fillToBottom 400 // LONG Fraction 16.16 +#define DFF_Prop_fillShadeColors 407 // IMsoArray a preset array of colors +#define DFF_Prop_fFilled 443 // sal_Bool Is shape filled? +#define DFF_Prop_fNoFillHitTest 447 // sal_Bool Hit test a shape as though filled +// LineStyle +#define DFF_Prop_lineColor 448 // MSO_CLR Color of line +#define DFF_Prop_lineOpacity 449 // LONG Not implemented +#define DFF_Prop_lineBackColor 450 // MSO_CLR Background color +#define DFF_Prop_lineWidth 459 // LONG A units; 1pt == 12700 EMUs +#define DFF_Prop_lineStyle 461 // MSO_LINESTYLE Draw parallel lines? +#define DFF_Prop_lineDashing 462 // MSO_LINEDASHING Can be overridden by: +#define DFF_Prop_lineDashStyle 463 // IMsoArray As Win32 ExtCreatePen +#define DFF_Prop_lineStartArrowhead 464 // MSO_LINEEND Arrow at start +#define DFF_Prop_lineEndArrowhead 465 // MSO_LINEEND Arrow at end +#define DFF_Prop_lineStartArrowWidth 466 // MSO_LINEENDWIDTH Arrow at start +#define DFF_Prop_lineStartArrowLength 467 // MSO_LINEENDLENGTH Arrow at end +#define DFF_Prop_lineEndArrowWidth 468 // MSO_LINEENDWIDTH Arrow at start +#define DFF_Prop_lineEndArrowLength 469 // MSO_LINEENDLENGTH Arrow at end +#define DFF_Prop_lineJoinStyle 470 // MSO_LINEJOIN How to join lines +#define DFF_Prop_lineEndCapStyle 471 // MSO_LINECAP How to end lines +#define DFF_Prop_fLine 508 // sal_Bool Any line? +#define DFF_Prop_fNoLineDrawDash 511 // sal_Bool Draw a dashed line if no line +// ShadowStyle +#define DFF_Prop_shadowType 512 // MSO_SHADOWTYPE Type of effect +#define DFF_Prop_shadowColor 513 // MSO_CLR Foreground color +#define DFF_Prop_shadowOpacity 516 // LONG Fixed 16.16 +#define DFF_Prop_shadowOffsetX 517 // LONG Offset shadow +#define DFF_Prop_shadowOffsetY 518 // LONG Offset shadow +#define DFF_Prop_fshadowObscured 575 // sal_Bool Excel5-style shadow +// PerspectiveStyle +#define DFF_Prop_fPerspective 639 // sal_Bool On/off +// 3D Object +#define DFF_Prop_c3DSpecularAmt 640 // LONG Fixed-point 16.16 +#define DFF_Prop_c3DDiffuseAmt 641 // LONG Fixed-point 16.16 +#define DFF_Prop_c3DShininess 642 // LONG Default gives OK results +#define DFF_Prop_c3DExtrudeForward 644 // LONG Distance of extrusion in EMUs +#define DFF_Prop_c3DExtrudeBackward 645 // LONG +#define DFF_Prop_c3DExtrusionColor 647 // MSO_CLR Basic color of extruded part of shape; the lighting model used will determine the exact shades used when rendering. +#define DFF_Prop_fc3DLightFace 703 // BOOL +// 3D Style +#define DFF_Prop_c3DYRotationAngle 704 // LONG degrees (16.16) about y axis +#define DFF_Prop_c3DXRotationAngle 705 // LONG degrees (16.16) about x axis +#define DFF_Prop_c3DRotationCenterX 710 // LONG rotation center x (16.16 or g-units) +#define DFF_Prop_c3DRotationCenterY 711 // LONG rotation center y (16.16 or g-units) +#define DFF_Prop_c3DRotationCenterZ 712 // LONG rotation center z (absolute (emus)) +#define DFF_Prop_c3DRenderMode 713 // MSO_3DRENDERMODE Full,wireframe, or bcube +#define DFF_Prop_c3DTolerance 714 // LONG pixels (16.16) +#define DFF_Prop_c3DXViewpoint 715 // LONG X view point (emus) +#define DFF_Prop_c3DYViewpoint 716 // LONG Y view point (emus) +#define DFF_Prop_c3DZViewpoint 717 // LONG Z view distance (emus) +#define DFF_Prop_c3DOriginX 718 // LONG +#define DFF_Prop_c3DOriginY 719 // LONG +#define DFF_Prop_c3DSkewAngle 720 // LONG degree (16.16) skew angle +#define DFF_Prop_c3DSkewAmount 721 // LONG Percentage skew amount +#define DFF_Prop_c3DAmbientIntensity 722 // LONG Fixed point intensity +#define DFF_Prop_c3DKeyX 723 // LONG Key light source direc- +#define DFF_Prop_c3DKeyY 724 // LONG tion; only their relative +#define DFF_Prop_c3DKeyZ 725 // LONG magnitudes matter +#define DFF_Prop_c3DKeyIntensity 726 // LONG Fixed point intensity +#define DFF_Prop_c3DFillX 727 // LONG Fill light source direc- +#define DFF_Prop_c3DFillY 728 // LONG tion; only their relative +#define DFF_Prop_c3DFillZ 729 // LONG magnitudes matter +#define DFF_Prop_c3DFillIntensity 730 // LONG Fixed point intensity +#define DFF_Prop_fc3DFillHarsh 767 // sal_Bool Is fill lighting harsh? +// Shape +#define DFF_Prop_hspMaster 769 // MSO_HSP master shape +#define DFF_Prop_cxstyle 771 // MSO_CXSTYLE Type of connector +#define DFF_Prop_fBackground 831 // sal_Bool If sal_True, this is the background shape. + +// Callout +#define DFF_Prop_fCalloutLengthSpecified 895 // sal_Bool if true, we look at dxyCalloutLengthSpecified + +// GroupShape +#define DFF_Prop_wzName 896 // WCHAR* Shape Name (present only if explicitly set) +#define DFF_Prop_wzDescription 897 // WCHAR* alternate text +#define DFF_Prop_pihlShape 898 // IHlink* The hyperlink in the shape. +#define DFF_Prop_pWrapPolygonVertices 899 // IMsoArray The polygon that text will be wrapped around (Word) +#define DFF_Prop_dxWrapDistLeft 900 // LONG Left wrapping distance from text (Word) +#define DFF_Prop_dyWrapDistTop 901 // LONG Top wrapping distance from text (Word) +#define DFF_Prop_dxWrapDistRight 902 // LONG Right wrapping distance from text (Word) +#define DFF_Prop_dyWrapDistBottom 903 // LONG Bottom wrapping distance from text (Word) +#define DFF_Prop_tableProperties 927 // LONG +#define DFF_Prop_tableRowProperties 928 // LONG* +#define DFF_Prop_fHidden 958 // sal_Bool Do not display +#define DFF_Prop_fPrint 959 // sal_Bool Print this shape + +// properties of the second property set +#define DFF_Prop_metroBlob 937 // XML ZipPackage* + +// linchpin: the shape type +enum MSO_SPT: sal_Int32 { + mso_sptMin = 0, + mso_sptNotPrimitive = mso_sptMin, + mso_sptRectangle = 1, + mso_sptRoundRectangle = 2, + mso_sptEllipse = 3, + mso_sptDiamond = 4, + mso_sptIsocelesTriangle = 5, + mso_sptRightTriangle = 6, + mso_sptParallelogram = 7, + mso_sptTrapezoid = 8, + mso_sptHexagon = 9, + mso_sptOctagon = 10, + mso_sptPlus = 11, + mso_sptStar = 12, + mso_sptArrow = 13, + mso_sptThickArrow = 14, + mso_sptHomePlate = 15, + mso_sptCube = 16, + mso_sptBalloon = 17, + mso_sptSeal = 18, + mso_sptArc = 19, + mso_sptLine = 20, + mso_sptPlaque = 21, + mso_sptCan = 22, + mso_sptDonut = 23, + mso_sptTextSimple = 24, + mso_sptTextOctagon = 25, + mso_sptTextHexagon = 26, + mso_sptTextCurve = 27, + mso_sptTextWave = 28, + mso_sptTextRing = 29, + mso_sptTextOnCurve = 30, + mso_sptTextOnRing = 31, + mso_sptStraightConnector1 = 32, + mso_sptBentConnector2 = 33, + mso_sptBentConnector3 = 34, + mso_sptBentConnector4 = 35, + mso_sptBentConnector5 = 36, + mso_sptCurvedConnector2 = 37, + mso_sptCurvedConnector3 = 38, + mso_sptCurvedConnector4 = 39, + mso_sptCurvedConnector5 = 40, + mso_sptCallout1 = 41, + mso_sptCallout2 = 42, + mso_sptCallout3 = 43, + mso_sptAccentCallout1 = 44, + mso_sptAccentCallout2 = 45, + mso_sptAccentCallout3 = 46, + mso_sptBorderCallout1 = 47, + mso_sptBorderCallout2 = 48, + mso_sptBorderCallout3 = 49, + mso_sptAccentBorderCallout1 = 50, + mso_sptAccentBorderCallout2 = 51, + mso_sptAccentBorderCallout3 = 52, + mso_sptRibbon = 53, + mso_sptRibbon2 = 54, + mso_sptChevron = 55, + mso_sptPentagon = 56, + mso_sptNoSmoking = 57, + mso_sptSeal8 = 58, + mso_sptSeal16 = 59, + mso_sptSeal32 = 60, + mso_sptWedgeRectCallout = 61, + mso_sptWedgeRRectCallout = 62, + mso_sptWedgeEllipseCallout = 63, + mso_sptWave = 64, + mso_sptFoldedCorner = 65, + mso_sptLeftArrow = 66, + mso_sptDownArrow = 67, + mso_sptUpArrow = 68, + mso_sptLeftRightArrow = 69, + mso_sptUpDownArrow = 70, + mso_sptIrregularSeal1 = 71, + mso_sptIrregularSeal2 = 72, + mso_sptLightningBolt = 73, + mso_sptHeart = 74, + mso_sptPictureFrame = 75, + mso_sptQuadArrow = 76, + mso_sptLeftArrowCallout = 77, + mso_sptRightArrowCallout = 78, + mso_sptUpArrowCallout = 79, + mso_sptDownArrowCallout = 80, + mso_sptLeftRightArrowCallout = 81, + mso_sptUpDownArrowCallout = 82, + mso_sptQuadArrowCallout = 83, + mso_sptBevel = 84, + mso_sptLeftBracket = 85, + mso_sptRightBracket = 86, + mso_sptLeftBrace = 87, + mso_sptRightBrace = 88, + mso_sptLeftUpArrow = 89, + mso_sptBentUpArrow = 90, + mso_sptBentArrow = 91, + mso_sptSeal24 = 92, + mso_sptStripedRightArrow = 93, + mso_sptNotchedRightArrow = 94, + mso_sptBlockArc = 95, + mso_sptSmileyFace = 96, + mso_sptVerticalScroll = 97, + mso_sptHorizontalScroll = 98, + mso_sptCircularArrow = 99, + mso_sptNotchedCircularArrow = 100, + mso_sptUturnArrow = 101, + mso_sptCurvedRightArrow = 102, + mso_sptCurvedLeftArrow = 103, + mso_sptCurvedUpArrow = 104, + mso_sptCurvedDownArrow = 105, + mso_sptCloudCallout = 106, + mso_sptEllipseRibbon = 107, + mso_sptEllipseRibbon2 = 108, + mso_sptFlowChartProcess = 109, + mso_sptFlowChartDecision = 110, + mso_sptFlowChartInputOutput = 111, + mso_sptFlowChartPredefinedProcess = 112, + mso_sptFlowChartInternalStorage = 113, + mso_sptFlowChartDocument = 114, + mso_sptFlowChartMultidocument = 115, + mso_sptFlowChartTerminator = 116, + mso_sptFlowChartPreparation = 117, + mso_sptFlowChartManualInput = 118, + mso_sptFlowChartManualOperation = 119, + mso_sptFlowChartConnector = 120, + mso_sptFlowChartPunchedCard = 121, + mso_sptFlowChartPunchedTape = 122, + mso_sptFlowChartSummingJunction = 123, + mso_sptFlowChartOr = 124, + mso_sptFlowChartCollate = 125, + mso_sptFlowChartSort = 126, + mso_sptFlowChartExtract = 127, + mso_sptFlowChartMerge = 128, + mso_sptFlowChartOfflineStorage = 129, + mso_sptFlowChartOnlineStorage = 130, + mso_sptFlowChartMagneticTape = 131, + mso_sptFlowChartMagneticDisk = 132, + mso_sptFlowChartMagneticDrum = 133, + mso_sptFlowChartDisplay = 134, + mso_sptFlowChartDelay = 135, + mso_sptTextPlainText = 136, + mso_sptTextStop = 137, + mso_sptTextTriangle = 138, + mso_sptTextTriangleInverted = 139, + mso_sptTextChevron = 140, + mso_sptTextChevronInverted = 141, + mso_sptTextRingInside = 142, + mso_sptTextRingOutside = 143, + mso_sptTextArchUpCurve = 144, + mso_sptTextArchDownCurve = 145, + mso_sptTextCircleCurve = 146, + mso_sptTextButtonCurve = 147, + mso_sptTextArchUpPour = 148, + mso_sptTextArchDownPour = 149, + mso_sptTextCirclePour = 150, + mso_sptTextButtonPour = 151, + mso_sptTextCurveUp = 152, + mso_sptTextCurveDown = 153, + mso_sptTextCascadeUp = 154, + mso_sptTextCascadeDown = 155, + mso_sptTextWave1 = 156, + mso_sptTextWave2 = 157, + mso_sptTextWave3 = 158, + mso_sptTextWave4 = 159, + mso_sptTextInflate = 160, + mso_sptTextDeflate = 161, + mso_sptTextInflateBottom = 162, + mso_sptTextDeflateBottom = 163, + mso_sptTextInflateTop = 164, + mso_sptTextDeflateTop = 165, + mso_sptTextDeflateInflate = 166, + mso_sptTextDeflateInflateDeflate = 167, + mso_sptTextFadeRight = 168, + mso_sptTextFadeLeft = 169, + mso_sptTextFadeUp = 170, + mso_sptTextFadeDown = 171, + mso_sptTextSlantUp = 172, + mso_sptTextSlantDown = 173, + mso_sptTextCanUp = 174, + mso_sptTextCanDown = 175, + mso_sptFlowChartAlternateProcess = 176, + mso_sptFlowChartOffpageConnector = 177, + mso_sptCallout90 = 178, + mso_sptAccentCallout90 = 179, + mso_sptBorderCallout90 = 180, + mso_sptAccentBorderCallout90 = 181, + mso_sptLeftRightUpArrow = 182, + mso_sptSun = 183, + mso_sptMoon = 184, + mso_sptBracketPair = 185, + mso_sptBracePair = 186, + mso_sptSeal4 = 187, + mso_sptDoubleWave = 188, + mso_sptActionButtonBlank = 189, + mso_sptActionButtonHome = 190, + mso_sptActionButtonHelp = 191, + mso_sptActionButtonInformation = 192, + mso_sptActionButtonForwardNext = 193, + mso_sptActionButtonBackPrevious = 194, + mso_sptActionButtonEnd = 195, + mso_sptActionButtonBeginning = 196, + mso_sptActionButtonReturn = 197, + mso_sptActionButtonDocument = 198, + mso_sptActionButtonSound = 199, + mso_sptActionButtonMovie = 200, + mso_sptHostControl = 201, + mso_sptTextBox = 202, + //for pptx shape which doesn't exist in ppt + mso_sptTearDrop = 203, + mso_sptMax = 0x0FFF, + mso_sptNil = mso_sptMax +}; + +// different enums from the OfficeDraw documentation, Appendix D - beginning + +// note: in opposite to the MS documentation, they all +// start with "mso_" instead of "mso" + +enum MSO_ShapePath { + mso_shapeLines, // A line of straight segments + mso_shapeLinesClosed, // A closed polygonal object + mso_shapeCurves, // A line of Bezier curve segments + mso_shapeCurvesClosed, // A closed shape with curved edges + mso_shapeComplex // pSegmentInfo must be non-empty +}; + +enum MSO_WrapMode { + mso_wrapSquare, + mso_wrapByPoints, + mso_wrapNone, + mso_wrapTopBottom, + mso_wrapThrough +}; + +enum MSO_BWMode { + mso_bwColor, // only used for predefined shades + mso_bwAutomatic, // depends on object type + mso_bwGrayScale, // shades of gray only + mso_bwLightGrayScale, // shades of light gray only + mso_bwInverseGray, // dark gray mapped to light gray, etc. + mso_bwGrayOutline, // pure gray and white + mso_bwBlackTextLine, // black text and lines, all else grayscale + mso_bwHighContrast, // pure black and white mode (no grays) + mso_bwBlack, // solid black + mso_bwWhite, // solid white + mso_bwDontShow, // object not drawn + mso_bwNumModes // number of Black and white modes +}; + +enum MSO_Anchor { + mso_anchorTop, + mso_anchorMiddle, + mso_anchorBottom, + mso_anchorTopCentered, + mso_anchorMiddleCentered, + mso_anchorBottomCentered, + mso_anchorTopBaseline, + mso_anchorBottomBaseline, + mso_anchorTopCenteredBaseline, + mso_anchorBottomCenteredBaseline +}; + +enum MSO_CDir { + mso_cdir0, // Right + mso_cdir90, // Down + mso_cdir180, // Left + mso_cdir270 // Up +}; + +// connector style +enum MSO_ConnectorStyle { + mso_cxstyleStraight = 0, + mso_cxstyleBent, + mso_cxstyleCurved, + mso_cxstyleNone +}; + +// MSO_TXFL -- text flow +enum MSO_TextFlow { + mso_txflHorzN, // Horizontal non-@ + mso_txflTtoBA, // Top to Bottom @-font + mso_txflBtoT, // Bottom to Top non-@ + mso_txflTtoBN, // Top to Bottom non-@ + mso_txflHorzA, // Horizontal @-font + mso_txflVertN // Vertical, non-@ +}; + +// MSO_TXDIR - text direction (needed for Bi-Di support) +enum MSO_TextDir { + mso_txdirLTR, // left-to-right text direction + mso_txdirRTL, // right-to-left text direction + mso_txdirContext // context text direction +}; + +// MSO_SPCOT -- Callout Type +enum MSO_SPCalloutType { + mso_spcotRightAngle = 1, + mso_spcotOneSegment = 2, + mso_spcotTwoSegment = 3, + mso_spcotThreeSegment = 4 +}; + +// MSO_SPCOA -- Callout Angle +enum MSO_SPCalloutAngle { + mso_spcoaAny, + mso_spcoa30, + mso_spcoa45, + mso_spcoa60, + mso_spcoa90, + mso_spcoa0 +}; + +// MSO_SPCOD -- Callout Drop +enum MSO_SPCalloutDrop { + mso_spcodTop, + mso_spcodCenter, + mso_spcodBottom, + mso_spcodSpecified +}; + +// MSO_GEOTEXTALIGN - FontWork alignment +enum MSO_GeoTextAlign { + mso_alignTextStretch, /* Stretch each line of text to fit width. */ + mso_alignTextCenter, /* Center text on width. */ + mso_alignTextLeft, /* Left justify. */ + mso_alignTextRight, /* Right justify. */ + mso_alignTextLetterJust, /* Spread letters out to fit width. */ + mso_alignTextWordJust, /* Spread words out to fit width. */ + mso_alignTextInvalid /* Invalid */ +}; + +// MSO_BLIPFLAGS - flags for pictures +enum MSO_BlipFlags { + mso_blipflagDefault = 0, + mso_blipflagComment = 0, // Blip name is a comment + mso_blipflagFile, // Blip name is a file name + mso_blipflagURL, // Blip name is a full URL + mso_blipflagType = 3, // Mask to extract type + /* Or the following flags with any of the above. */ + mso_blipflagDontSave = 4, // A "dont" is the depression in the metal + // body work of an automobile caused when a + // cyclist violently trusts his or her nose + // at it, thus a DontSave is another name for + // a cycle lane. + mso_blipflagDoNotSave = 4, // For those who prefer English + mso_blipflagLinkToFile = 8 +}; + +enum MSO_3DRenderMode { + mso_FullRender, // Generate a full rendering + mso_Wireframe, // Generate a wireframe + mso_BoundingCube // Generate a bounding cube +}; + +enum MSO_XFormType { + mso_xformAbsolute, // Apply transform in absolute space centered on shape + mso_xformShape, // Apply transform to shape geometry + mso_xformDrawing // Apply transform in drawing space +}; + +enum MSO_ShadowType { + mso_shadowOffset, // N pixel offset shadow + mso_shadowDouble, // Use second offset too + mso_shadowRich, // Rich perspective shadow (cast relative to shape) + mso_shadowShape, // Rich perspective shadow (cast in shape space) + mso_shadowDrawing, // Perspective shadow cast in drawing space + mso_shadowEmbossOrEngrave +}; + +// MSO_DZTYPE - the type of a (length) measurement +enum MSO_DZType { + mso_dztypeMin = 0, + mso_dztypeDefault = 0, // Default size, ignore the values + mso_dztypeA = 1, // Values are in EMUs + mso_dztypeV = 2, // Values are in pixels + mso_dztypeShape = 3, // Values are 16.16 fractions of shape size + mso_dztypeFixedAspect = 4, // Aspect ratio is fixed + mso_dztypeAFixed = 5, // EMUs, fixed aspect ratio + mso_dztypeVFixed = 6, // Pixels, fixed aspect ratio + mso_dztypeShapeFixed = 7, // Proportion of shape, fixed aspect ratio + mso_dztypeFixedAspectEnlarge + = 8, // Aspect ratio is fixed, favor larger size + mso_dztypeAFixedBig = 9, // EMUs, fixed aspect ratio + mso_dztypeVFixedBig = 10, // Pixels, fixed aspect ratio + mso_dztypeShapeFixedBig= 11, // Proportion of shape, fixed aspect ratio + mso_dztypeMax = 11 +}; + +enum MSO_FillType { + mso_fillSolid, // Fill with a solid color + mso_fillPattern, // Fill with a pattern (bitmap) + mso_fillTexture, // A texture (pattern with its own color map) + mso_fillPicture, // Center a picture in the shape + mso_fillShade, // Shade from start to end points + mso_fillShadeCenter, // Shade from bounding rectangle to end point + mso_fillShadeShape, // Shade from shape outline to end point + mso_fillShadeScale, // Similar to mso_fillShade, but the fillAngle + // is additionally scaled by the aspect ratio of + // the shape. If shape is square, it is the + // same as mso_fillShade. + mso_fillShadeTitle, // special type - shade to title --- for PP + mso_fillBackground // Use the background fill color/pattern +}; + +// MSOLINESTYLE - compound line style +enum MSO_LineStyle { + mso_lineSimple, // Single line (of width lineWidth) + mso_lineDouble, // Double lines of equal width + mso_lineThickThin, // Double lines, one thick, one thin + mso_lineThinThick, // Double lines, reverse order + mso_lineTriple, // Three lines, thin, thick, thin + MSO_LineStyle_NONE = USHRT_MAX +}; + +// MSO_LINETYPE - how to "fill" the line contour +enum MSO_LineType { + mso_lineSolidType, // Fill with a solid color + mso_linePattern, // Fill with a pattern (bitmap) + mso_lineTexture, // A texture (pattern with its own color map) + mso_linePicture // Center a picture in the shape +}; + +// MSO_LINEDASHING - dashed line style +enum MSO_LineDashing { + mso_lineSolid, // Solid (continuous) pen + mso_lineDashSys, // PS_DASH system dash style + mso_lineDotSys, // PS_DOT system dash style + mso_lineDashDotSys, // PS_DASHDOT system dash style + mso_lineDashDotDotSys, // PS_DASHDOTDOT system dash style + mso_lineDotGEL, // square dot style + mso_lineDashGEL, // dash style + mso_lineLongDashGEL, // long dash style + mso_lineDashDotGEL, // dash short dash + mso_lineLongDashDotGEL, // long dash short dash + mso_lineLongDashDotDotGEL // long dash short dash short dash +}; + +// MSO_LINEEND - line end effect +enum MSO_LineEnd { + mso_lineNoEnd, + mso_lineArrowEnd, + mso_lineArrowStealthEnd, + mso_lineArrowDiamondEnd, + mso_lineArrowOvalEnd, + mso_lineArrowOpenEnd +}; + +// MSO_LINEENDWIDTH - size of arrowhead +enum MSO_LineEndWidth { + mso_lineNarrowArrow, + mso_lineMediumWidthArrow, + mso_lineWideArrow +}; + +// MSO_LINEENDLENGTH - size of arrowhead +enum MSO_LineEndLength { + mso_lineShortArrow, + mso_lineMediumLenArrow, + mso_lineLongArrow +}; + +// MSO_LINEJOIN - line join style. +enum MSO_LineJoin { + mso_lineJoinBevel, // Join edges by a straight line + mso_lineJoinMiter, // Extend edges until they join + mso_lineJoinRound // Draw an arc between the two edges +}; + +// MSO_LINECAP - line cap style (applies to ends of dash segments too). +enum MSO_LineCap { + mso_lineEndCapRound, // Rounded ends - the default + mso_lineEndCapSquare, // Square protrudes by half line width + mso_lineEndCapFlat // Line ends at end point +}; +// Various enums from the OfficeDraw documentation Appendix D - End + +// BStore-Container + + +enum MSO_BLIPUSAGE { + mso_blipUsageDefault, // All non-texture fill blips get this. + mso_blipUsageTexture, + mso_blipUsageMax = 255 // Since this is stored in a byte +}; + +enum MSO_BLIPTYPE { // GEL provided types... + mso_blipERROR = 0, // An error occurred during loading + mso_blipUNKNOWN, // An unknown blip type + mso_blipEMF, // Windows Enhanced Metafile + mso_blipWMF, // Windows Metafile + mso_blipPICT, // Macintosh PICT + mso_blipJPEG, // JFIF + mso_blipPNG, // PNG + mso_blipDIB, // Windows DIB + mso_blipFirstClient = 32, // First client defined blip type + mso_blipLastClient = 255 // Last client defined blip type +}; + +enum MSO_BI { + mso_biUNKNOWN = 0, + mso_biWMF = 0x216, // Metafile header then compressed WMF + mso_biEMF = 0x3D4, // Metafile header then compressed EMF + mso_biPICT = 0x542, // Metafile header then compressed PICT + mso_biPNG = 0x6E0, // One byte tag then PNG data + mso_biJFIF = 0x46A, // One byte tag then JFIF data + mso_biJPEG = mso_biJFIF, + mso_biDIB = 0x7A8, // One byte tag then DIB data + mso_biClient=0x800 // Clients should set this bit +}; // Blip signature as encoded in the MSO_FBH.inst + +enum MSO_BLIPCOMPRESSION { + mso_compressionDeflate = 0, + mso_compressionNone = 254, // Used only if compression fails + mso_compressionTest = 255 // For testing only +}; + +enum MSO_BLIPFILTER { + mso_filterAdaptive = 0, // PNG type - not used/supported for metafile + mso_filterNone = 254, + mso_filterTest = 255 // For testing only +}; + +enum MSO_SYSCOLORINDEX { + mso_syscolorButtonFace, // COLOR_BTNFACE + mso_syscolorWindowText, // COLOR_WINDOWTEXT + mso_syscolorMenu, // COLOR_MENU + mso_syscolorHighlight, // COLOR_HIGHLIGHT + mso_syscolorHighlightText, // COLOR_HIGHLIGHTTEXT + mso_syscolorCaptionText, // COLOR_CAPTIONTEXT + mso_syscolorActiveCaption, // COLOR_ACTIVECAPTION + mso_syscolorButtonHighlight, // COLOR_BTNHIGHLIGHT + mso_syscolorButtonShadow, // COLOR_BTNSHADOW + mso_syscolorButtonText, // COLOR_BTNTEXT + mso_syscolorGrayText, // COLOR_GRAYTEXT + mso_syscolorInactiveCaption, // COLOR_INACTIVECAPTION + mso_syscolorInactiveCaptionText, // COLOR_INACTIVECAPTIONTEXT + mso_syscolorInfoBackground, // COLOR_INFOBK + mso_syscolorInfoText, // COLOR_INFOTEXT + mso_syscolorMenuText, // COLOR_MENUTEXT + mso_syscolorScrollbar, // COLOR_SCROLLBAR + mso_syscolorWindow, // COLOR_WINDOW + mso_syscolorWindowFrame, // COLOR_WINDOWFRAME + mso_syscolor3DLight, // COLOR_3DLIGHT + mso_syscolorMax, // Count of system colors + + mso_colorFillColor = 0xF0, // Use the fillColor property + mso_colorLineOrFillColor, // Use the line color only if there is a line + mso_colorLineColor, // Use the lineColor property + mso_colorShadowColor, // Use the shadow color + mso_colorThis, // Use this color (only valid as described below) + mso_colorFillBackColor, // Use the fillBackColor property + mso_colorLineBackColor, // Use the lineBackColor property + mso_colorFillThenLine, // Use the fillColor unless no fill and line + mso_colorIndexMask = 0xFF, // Extract the color index + + mso_colorProcessMask =0xFFFF00,// All the processing bits + mso_colorModificationMask =0x0F00, // Just the function + mso_colorModFlagMask =0xF000, // Just the additional flags + mso_colorDarken =0x0100, // Darken color by parameter/255 + mso_colorLighten =0x0200, // Lighten color by parameter/255 + mso_colorAdd =0x0300, // Add grey level RGB(param,param,param) + mso_colorSubtract =0x0400, // Subtract grey level RGB(p,p,p) + mso_colorReverseSubtract =0x0500, // Subtract from grey level RGB(p,p,p) + /* In the following "black" means maximum component value, white minimum. + The operation is per component, to guarantee white combine with + mso_colorGray */ + mso_colorBlackWhite =0x0600, // Black if < uParam, else white (>=) + mso_colorInvert =0x2000, // Invert color (at the *end*) + mso_colorInvert128 =0x4000, // Invert by toggling the top bit + mso_colorGray =0x8000, // Make the color gray (before the above!) + mso_colorBParamMask =0xFF0000,// Parameter used as above + mso_colorBParamShift = 16 // To extract the parameter value +}; + +enum MSO_TextGeometryProperties { + use_gtextFBestFit = 0x00000100, + use_gtextFShrinkFit = 0x00000200, + use_gtextFStretch = 0x00000400, + gtextFBestFit = 0x01000000, + gtextFShrinkFit = 0x02000000, + gtextFStretch = 0x04000000 +}; + +//ALT_TXT_MSINTEROP +#define MSPROP_DESCRIPTION_MAX_LEN 4096 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/nbdtmg.hxx b/include/svx/nbdtmg.hxx new file mode 100644 index 000000000..fbecb2719 --- /dev/null +++ b/include/svx/nbdtmg.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_SVX_NBDTMG_HXX +#define INCLUDED_SVX_NBDTMG_HXX +#include +#include +#include +#include +#include + +namespace svx::sidebar { + +#define DEFAULT_BULLET_TYPES 8 +#define DEFAULT_NUM_VALUSET_COUNT 8 +#define DEFAULT_NUMBERING_CACHE_FORMAT_VERSION 0x10 + +enum class NBOType +{ + Bullets = 1, Numbering, Outline +}; + +class SVX_DLLPUBLIC NumSettings_Impl +{ + public: + SvxNumType nNumberType; + short nParentNumbering; + SvxNumberFormat::LabelFollowedBy eLabelFollowedBy; + long nTabValue; + SvxAdjust eNumAlign; + long nNumAlignAt; + long nNumIndentAt; + OUString sPrefix; + OUString sSuffix; + OUString sBulletChar; + OUString sBulletFont; + SvxBrushItem *pBrushItem; + Size aSize; + + public: + NumSettings_Impl() + : nNumberType(SVX_NUM_CHARS_UPPER_LETTER) + , nParentNumbering(0) + , eLabelFollowedBy(SvxNumberFormat::NOTHING) + , nTabValue (0) + , eNumAlign(SvxAdjust::Left) + , nNumAlignAt(0) + , nNumIndentAt(0) + , pBrushItem(nullptr) + , aSize(0,0) + {} +}; + +typedef std::vector< std::shared_ptr > NumSettingsArr_Impl; + +class SVX_DLLPUBLIC BulletsSettings +{ +public: + vcl::Font aFont; + OUString sDescription; + sal_Unicode cBulletChar; + bool bIsCustomized; + BulletsSettings() : cBulletChar(0), bIsCustomized(false) {} +}; + + +class SVX_DLLPUBLIC NumberSettings_Impl +{ + public: + bool bIsCustomized; + OUString sDescription; + NumSettings_Impl* pNumSetting; + public: + NumberSettings_Impl() : + bIsCustomized(false), + pNumSetting(nullptr) + {} +}; + +typedef std::vector< std::shared_ptr > NumberSettingsArr_Impl; + +class SVX_DLLPUBLIC OutlineSettings_Impl +{ + public: + bool bIsCustomized; + OUString sDescription; + NumSettingsArr_Impl *pNumSettingsArr; + public: + OutlineSettings_Impl() : + bIsCustomized(false), + pNumSettingsArr(nullptr) + {} +}; + +class SVX_DLLPUBLIC NBOTypeMgrBase +{ + private: + const SfxItemSet* pSet; + MapUnit eCoreUnit; + // store the attributes passed from pSet + OUString aBulletCharFmtName; + OUString aNumCharFmtName; + bool bIsLoading; + + NBOTypeMgrBase(const NBOTypeMgrBase&) = delete; + + public: + NBOTypeMgrBase() + : pSet(nullptr) + , eCoreUnit(MapUnit::MapTwip) + , bIsLoading(false) + {} + virtual ~NBOTypeMgrBase() {} + virtual void Init()=0; + virtual sal_uInt16 GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 mLevel,sal_uInt16 nFromIndex=0) = 0; + virtual void RelplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt16 mLevel) = 0; + virtual void ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt16 mLevel, bool isDefault=false,bool isResetSize=false) = 0; + virtual OUString GetDescription(sal_uInt16 nIndex, bool isDefault)=0; + virtual bool IsCustomized(sal_uInt16 nIndex)=0; + static sal_uInt16 IsSingleLevel(sal_uInt16 nCurLevel); + // store the attributes passed from pSet + void SetItems(const SfxItemSet* pArg); + protected: + const OUString& GetBulletCharFmtName() const { return aBulletCharFmtName;} + const OUString& GetNumCharFmtName() const { return aNumCharFmtName;} + MapUnit GetMapUnit() const { return eCoreUnit;} + protected: + void ImplLoad(const OUString& filename); + void ImplStore(const OUString& filename); + +}; + + +class BulletsTypeMgr final : public NBOTypeMgrBase +{ + friend class OutlineTypeMgr; + friend class NumberingTypeMgr; + private: + BulletsTypeMgr(const BulletsTypeMgr&) = delete; + public: + static sal_Unicode aDynamicBulletTypes[DEFAULT_BULLET_TYPES]; + static sal_Unicode aDynamicRTLBulletTypes[DEFAULT_BULLET_TYPES]; + static BulletsSettings* pActualBullets[DEFAULT_BULLET_TYPES]; + public: + BulletsTypeMgr(); + virtual void Init() override; + virtual sal_uInt16 GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 mLevel,sal_uInt16 nFromIndex=0) override; + virtual void RelplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt16 mLevel) override; + virtual void ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt16 mLevel, bool isDefault=false,bool isResetSize=false) override; + virtual OUString GetDescription(sal_uInt16 nIndex, bool isDefault) override; + virtual bool IsCustomized(sal_uInt16 nIndex) override; + static BulletsTypeMgr& GetInstance(); +}; + + +class NumberingTypeMgr: public NBOTypeMgrBase +{ + private: + NumberingTypeMgr(const NumberingTypeMgr&) = delete; + public: + NumberSettingsArr_Impl maNumberSettingsArr; + NumberSettingsArr_Impl maDefaultNumberSettingsArr; + public: + NumberingTypeMgr(); + virtual ~NumberingTypeMgr() override; + virtual void Init() override; + virtual sal_uInt16 GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 mLevel,sal_uInt16 nFromIndex=0) override; + virtual void RelplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt16 mLevel) override; + virtual void ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt16 mLevel, bool isDefault=false,bool isResetSize=false) override; + virtual OUString GetDescription(sal_uInt16 nIndex, bool isDefault) override; + virtual bool IsCustomized(sal_uInt16 nIndex) override; + static NumberingTypeMgr& GetInstance(); +}; + +class OutlineTypeMgr: public NBOTypeMgrBase +{ + private: + OutlineTypeMgr(const OutlineTypeMgr&) = delete; + public: + OutlineSettings_Impl* pOutlineSettingsArrs[DEFAULT_NUM_VALUSET_COUNT]; + OutlineSettings_Impl* pDefaultOutlineSettingsArrs[DEFAULT_NUM_VALUSET_COUNT]; + public: + OutlineTypeMgr(); + virtual void Init() override; + virtual sal_uInt16 GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 mLevel,sal_uInt16 nFromIndex=0) override; + virtual void RelplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt16 mLevel) override; + virtual void ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt16 mLevel, bool isDefault=false,bool isResetSize=false) override; + virtual OUString GetDescription(sal_uInt16 nIndex, bool isDefault) override; + virtual bool IsCustomized(sal_uInt16 nIndex) override; + static OutlineTypeMgr& GetInstance(); +}; +} +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/nbdtmgfact.hxx b/include/svx/nbdtmgfact.hxx new file mode 100644 index 000000000..3928be1e6 --- /dev/null +++ b/include/svx/nbdtmgfact.hxx @@ -0,0 +1,30 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_NBDTMGFACT_HXX +#define INCLUDED_SVX_NBDTMGFACT_HXX + +#include + +namespace svx::sidebar::NBOutlineTypeMgrFact { + SVX_DLLPUBLIC NBOTypeMgrBase* CreateInstance(const NBOType aType); +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/numfmtsh.hxx b/include/svx/numfmtsh.hxx new file mode 100644 index 000000000..2e4f8fb27 --- /dev/null +++ b/include/svx/numfmtsh.hxx @@ -0,0 +1,228 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_NUMFMTSH_HXX +#define INCLUDED_SVX_NUMFMTSH_HXX + +#include + +#include + +#include + +#include + +class Color; + +enum class SvxNumberValueType +{ + Undefined, + Number, + String +}; + +// sort order of the category ListBox entries in the TabPage +#define CAT_ALL 0 +#define CAT_USERDEFINED 1 +#define CAT_NUMBER 2 +#define CAT_PERCENT 3 +#define CAT_CURRENCY 4 +#define CAT_DATE 5 +#define CAT_TIME 6 +#define CAT_SCIENTIFIC 7 +#define CAT_FRACTION 8 +#define CAT_BOOLEAN 9 +#define CAT_TEXT 10 + +#define SELPOS_NONE -1 + +#define NUMBERFORMAT_ENTRY_NEW_CURRENCY NUMBERFORMAT_ENTRY_NOT_FOUND-1 + + +class SVX_DLLPUBLIC SvxNumberFormatShell +{ +public: + SvxNumberFormatShell( SvNumberFormatter* pNumFormatter, + sal_uInt32 nFormatKey, + SvxNumberValueType eNumValType, + const OUString& rNumStr ); + + SvxNumberFormatShell( SvNumberFormatter* pNumFormatter, + sal_uInt32 nFormatKey, + SvxNumberValueType eNumValType, + double nNumVal, + const OUString* pNumStr ); + + ~SvxNumberFormatShell(); + + + static SvxNumberFormatShell* Create( SvNumberFormatter* pNumFormatter, + sal_uInt32 nFormatKey, + SvxNumberValueType eNumValType, + const OUString& rNumStr ); + + static SvxNumberFormatShell* Create( SvNumberFormatter* pNumFormatter, + sal_uInt32 nFormatKey, + SvxNumberValueType eNumValType, + double nNumVal, + const OUString* pNumStr ); + + + void GetInitSettings( sal_uInt16& nCatLbPos, + LanguageType& rLangType, + sal_uInt16& nFmtLbSelPos, + std::vector& rFmtEntries, + OUString& rPrevString, + Color*& rpPrevColor ); + + void CategoryChanged( sal_uInt16 nCatLbPos, + short& rFmtSelPos, + std::vector& rFmtEntries ); + + void LanguageChanged( LanguageType eLangType, + short& rFmtSelPos, + std::vector& rFmtEntries ); + + void FormatChanged( sal_uInt16 nFmtLbPos, + OUString& rPreviewStr, + Color*& rpFontColor ); + + bool AddFormat( OUString& rFormat, + sal_Int32& rErrPos, + sal_uInt16& rCatLbSelPos, + short& rFmtSelPos, + std::vector& rFmtEntries ); + + void RemoveFormat( const OUString& rFormat, + sal_uInt16& rCatLbSelPos, + short& rFmtSelPos, + std::vector& rFmtEntries ); + + void MakeFormat( OUString& rFormat, + bool bThousand, + bool bNegRed, + sal_uInt16 nPrecision, + sal_uInt16 nLeadingZeroes, + sal_uInt16 nCurrencyEntryPos); + + void GetOptions( const OUString& rFormat, + bool& rThousand, + bool& rNegRed, + sal_uInt16& rPrecision, + sal_uInt16& rLeadingZeroes, + sal_uInt16& rCatLbPos ); + + sal_uInt16 GetFormatIntegerDigits( const OUString& rFormat ) const; + + void MakePreviewString( const OUString& rFormatStr, + OUString& rPreviewStr, + Color*& rpFontColor ); + + void MakePrevStringFromVal( const OUString& rFormatStr, + OUString& rPreviewStr, + Color*& rpFontColor, + double nValue); + + bool IsUserDefined( const OUString& rFmtString ); + bool IsTmpCurrencyFormat( const OUString& rFmtString ); + bool FindEntry( const OUString& rFmtString, sal_uInt32* pAt = nullptr ); + + void ValidateNewEntries() { bUndoAddList = false; } + std::vector const & GetUpdateData() const; + + void SetCurNumFmtKey( sal_uInt32 nNew ) { nCurFormatKey = nNew; } + sal_uInt32 GetCurNumFmtKey() const { return nCurFormatKey; } + LanguageType GetCurLanguage() const { return eCurLanguage; } + + /** Returns the name of Standard, General, ... for the + current language. */ + OUString GetStandardName() const; + + OUString GetComment4Entry(short nEntry); + short GetCategory4Entry(short nEntry) const; + bool GetUserDefined4Entry(short nEntry); + OUString GetFormat4Entry(short nEntry); + void SetComment4Entry(short nEntry, const OUString& aCommentString); + + void SetCurrencySymbol(sal_uInt32 nPos); + sal_uInt32 GetCurrencySymbol() const { return nCurCurrencyEntryPos;} + sal_uInt16 FindCurrencyFormat( const OUString& rFmtString ); + sal_uInt16 FindCurrencyFormat(const NfCurrencyEntry* pTmpCurrencyEntry,bool bTmpBanking); + void SetCurCurrencyEntry(NfCurrencyEntry*); + short GetListPos4Entry( sal_uInt32 nIdx, const OUString& rFmtString ); + + void GetCurrencySymbols(std::vector& rList, sal_uInt16* pPos ); + + sal_uInt16 FindCurrencyTableEntry( const OUString& rFmtString, bool &bTestBanking ); + bool IsInTable(sal_uInt16 nPos, bool bTmpBanking, + OUString const& rFmtString); + + void SetUseStarFormat( bool bUse ) { bUseStarFormat = bUse; } +private: + SvNumberFormatter* pFormatter; + SvNumberFormatTable* pCurFmtTable; + SvxNumberValueType eValType; + OUString aValStr; + double nValNum; + bool bUndoAddList; + std::vector aAddList; + std::vector aDelList; + std::vector aCurEntryList; + sal_uInt32 nCurFormatKey; + SvNumFormatType nCurCategory; + LanguageType eCurLanguage; + std::vector aCurCurrencyList; + NfCurrencyEntry* pCurCurrencyEntry; + bool bBankingSymbol; + sal_uInt32 nCurCurrencyEntryPos; + std::vector aCurrencyFormatList; + bool bUseStarFormat; + bool bIsDefaultValNum; + + SVX_DLLPRIVATE short FillEntryList_Impl( std::vector& rList ); + SVX_DLLPRIVATE void FillEListWithStd_Impl( std::vector& rList, SvNumFormatType eCategory, short &Pos, + bool bSuppressDuplicates = false ); + SVX_DLLPRIVATE short FillEListWithFormats_Impl( std::vector& rList,short nSelPos, + NfIndexTableOffset eOffsetStart, + NfIndexTableOffset eOffsetEnd, + bool bSuppressDuplicates ); + SVX_DLLPRIVATE short FillEListWithDateTime_Impl( std::vector& rList,short nSelPos, + bool bSuppressDuplicates ); + SVX_DLLPRIVATE void FillEListWithOneFormat_Impl( std::vector& rList, short & nSelPos, + bool bSuppressDuplicates, NfIndexTableOffset nOffset, + bool bSuppressIsoDateTime ); + SVX_DLLPRIVATE short FillEListWithCurrency_Impl( std::vector& rList,short nSelPos); + SVX_DLLPRIVATE short FillEListWithSysCurrencys( std::vector& rList,short nSelPos); + SVX_DLLPRIVATE short FillEListWithUserCurrencys( std::vector& rList,short nSelPos); + SVX_DLLPRIVATE short FillEListWithUsD_Impl( std::vector& rList, SvNumFormatType eCategory, short Pos ); + + SVX_DLLPRIVATE bool IsEssentialFormat_Impl( SvNumFormatType eType, sal_uInt32 nKey ); + + SVX_DLLPRIVATE ::std::vector::iterator GetRemoved_Impl( size_t nKey ); + SVX_DLLPRIVATE bool IsRemoved_Impl( size_t nKey ); + SVX_DLLPRIVATE ::std::vector::iterator GetAdded_Impl( size_t nKey ); + + SVX_DLLPRIVATE void GetPreviewString_Impl( OUString& rString, + Color*& rpColor ); + SVX_DLLPRIVATE static void PosToCategory_Impl(sal_uInt16 nPos, SvNumFormatType& rCategory); + SVX_DLLPRIVATE static void CategoryToPos_Impl(SvNumFormatType nCategory, sal_uInt16& rPos); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/numinf.hxx b/include/svx/numinf.hxx new file mode 100644 index 000000000..2002638d7 --- /dev/null +++ b/include/svx/numinf.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_SVX_NUMINF_HXX +#define INCLUDED_SVX_NUMINF_HXX + +#include +#include +#include + +/** This item is used as a transport medium for a number formatter + */ + +class SVX_DLLPUBLIC SvxNumberInfoItem final : public SfxPoolItem +{ +public: + + SvxNumberInfoItem( const sal_uInt16 nId ); + SvxNumberInfoItem( SvNumberFormatter* pNumFormatter, + const sal_uInt16 nId ); + SvxNumberInfoItem( SvNumberFormatter* pNumFormatter, const OUString& rVal, + const sal_uInt16 nId ); + SvxNumberInfoItem( SvNumberFormatter* pNumFormatter, const double& rVal, + const sal_uInt16 nId ); + // if both double and String are supplied, String is used for text formats + SvxNumberInfoItem( SvNumberFormatter* pNumFormatter, const double& rVal, + const OUString& rValueStr, const sal_uInt16 nId ); + SvxNumberInfoItem( const SvxNumberInfoItem& ); + virtual ~SvxNumberInfoItem() override; + + virtual bool operator==( const SfxPoolItem& ) const override; + virtual SvxNumberInfoItem* Clone( SfxItemPool *pPool = nullptr ) const override; + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + + SvNumberFormatter* GetNumberFormatter() const { return pFormatter; } + const OUString& GetValueString() const { return aStringVal; } + double GetValueDouble() const { return nDoubleVal; } + + const std::vector & GetDelFormats() const { return mvDelFormats; } + void SetDelFormats( std::vector const & ); + + SvxNumberValueType GetValueType() const { return eValueType; } + +private: + SvNumberFormatter* pFormatter; + SvxNumberValueType eValueType; + OUString aStringVal; + double nDoubleVal; + + std::vector mvDelFormats; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/numvset.hxx b/include/svx/numvset.hxx new file mode 100644 index 000000000..2b58fb6dd --- /dev/null +++ b/include/svx/numvset.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_SVX_NUMVSET_HXX +#define INCLUDED_SVX_NUMVSET_HXX + +#include +#include +#include +#include +#include +#include + +namespace com::sun::star { + namespace container{ + class XIndexAccess; + } + namespace beans{ + struct PropertyValue; + } + namespace text{ + class XNumberingFormatter; + } +} + +enum class NumberingPageType +{ + BULLET, + SINGLENUM, + OUTLINE, + BITMAP +}; + +class SVX_DLLPUBLIC SvxNumValueSet : public ValueSet +{ + NumberingPageType ePageType; + tools::Rectangle aOrgRect; + VclPtr pVDev; + + css::uno::Reference xFormatter; + css::lang::Locale aLocale; + + css::uno::Sequence< + css::uno::Sequence< + css::beans::PropertyValue> > aNumSettings; + + css::uno::Sequence< + css::uno::Reference< + css::container::XIndexAccess> > aOutlineSettings; + +public: + SvxNumValueSet(std::unique_ptr pScrolledWindow); + void init(NumberingPageType eType); + virtual ~SvxNumValueSet() override; + + virtual void UserDraw( const UserDrawEvent& rUDEvt ) override; + + void SetNumberingSettings( + const css::uno::Sequence< + css::uno::Sequence >& aNum, + css::uno::Reference const & xFormatter, + const css::lang::Locale& rLocale ); + + void SetOutlineNumberingSettings( + css::uno::Sequence< + css::uno::Reference > const & rOutline, + css::uno::Reference const & xFormatter, + const css::lang::Locale& rLocale); +}; + + +class SVX_DLLPUBLIC SvxBmpNumValueSet final : public SvxNumValueSet +{ + Idle aFormatIdle; + bool bGrfNotFound; + + DECL_LINK(FormatHdl_Impl, Timer *, void); + +public: + SvxBmpNumValueSet(std::unique_ptr pScrolledWindow); + void init(); + virtual ~SvxBmpNumValueSet() override; + + virtual void UserDraw( const UserDrawEvent& rUDEvt ) override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/obj3d.hxx b/include/svx/obj3d.hxx new file mode 100644 index 000000000..c986cd68d --- /dev/null +++ b/include/svx/obj3d.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_SVX_OBJ3D_HXX +#define INCLUDED_SVX_OBJ3D_HXX + +#include +#include +#include +#include +#include +#include + +// Forward declarations +class E3dScene; + +namespace sdr::properties { + class BaseProperties; + class E3dCompoundProperties; + class E3dExtrudeProperties; + class E3dLatheProperties; + class E3dSphereProperties; +} + +/************************************************************************* +|* +|* GeoData relevant for undo actions +|* +\************************************************************************/ + +class E3DObjGeoData : public SdrObjGeoData +{ +public: + basegfx::B3DRange maLocalBoundVol; // surrounding volume of the object + basegfx::B3DHomMatrix maTransformation; // local transformations + + E3DObjGeoData() {} +}; + +/************************************************************************* +|* +|* Base class for 3D objects +|* +\************************************************************************/ + +class SVXCORE_DLLPUBLIC E3dObject : public SdrAttrObj +{ +private: + // Allow everything for E3dObjList and E3dDragMethod + friend class E3dDragMethod; + + protected: + virtual std::unique_ptr CreateObjectSpecificProperties() override; + + basegfx::B3DRange maLocalBoundVol; // surrounding volume of the object (from the geometry generation) + basegfx::B3DHomMatrix maTransformation; // local transformation + basegfx::B3DHomMatrix maFullTransform; // global transformation (including. parents) + + // Flags + bool mbTfHasChanged : 1; + bool mbIsSelected : 1; + +protected: + virtual basegfx::B3DRange RecalcBoundVolume() const; + + // E3dObject is only a helper class (for E3DScene and E3DCompoundObject) + // and no instances should be created from anyone, so i move the constructors + // to protected area + E3dObject(SdrModel& rSdrModel); + + // protected destructor + virtual ~E3dObject() override; + +public: + virtual void StructureChanged(); + virtual void SetTransformChanged(); + virtual void RecalcSnapRect() override; + + virtual SdrInventor GetObjInventor() const override; + virtual sal_uInt16 GetObjIdentifier() const override; + virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; + virtual void NbcMove(const Size& rSize) override; + virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override; + + E3dScene* getParentE3dSceneFromE3dObject() const; + virtual E3dScene* getRootE3dSceneFromE3dObject() const; + + const basegfx::B3DRange& GetBoundVolume() const; + void InvalidateBoundVolume(); + + // calculate complete transformation including all parents + const basegfx::B3DHomMatrix& GetFullTransform() const; + + // get and (re)set transformation matrix + const basegfx::B3DHomMatrix& GetTransform() const { return maTransformation;} + virtual void NbcSetTransform(const basegfx::B3DHomMatrix& rMatrix); + virtual void SetTransform(const basegfx::B3DHomMatrix& rMatrix); + + // 2D rotations, are implemented as a rotation around the Z axis + // which is vertical to the screen, plus a shift of the scene. + // This means that also the scene (E3dScene) must define this + // routine as virtual in its class. + virtual void NbcRotate(const Point& rRef, long nAngle, double sn, double cs) override; + + // get wireframe polygon for local object. No transform is applied. + basegfx::B3DPolyPolygon CreateWireframe() const; + + // TakeObjName...() is for the display in the UI, for example "3 frames selected". + virtual OUString TakeObjNameSingul() const override; + virtual OUString TakeObjNamePlural() const override; + virtual E3dObject* CloneSdrObject(SdrModel& rTargetModel) const override; + E3dObject& operator=( const E3dObject& rObj ); + + virtual SdrObjGeoData *NewGeoData() const override; + virtual void SaveGeoData(SdrObjGeoData& rGeo) const override; + virtual void RestGeoData(const SdrObjGeoData& rGeo) override; + + // get/set the selection + bool GetSelected() const { return mbIsSelected; } + virtual void SetSelected(bool bNew); + + // break up + virtual bool IsBreakObjPossible(); + virtual std::unique_ptr GetBreakObj(); +}; + +/************************************************************************* +|* +|* Class for all compound objects (Cube, Lathe, Scene, Extrude) +|* This class saves some ISA queries and accelerates the behaviour +|* significantly, because all the attributes etc. are kept through this. +|* The polygons may only keep attributes if they are directly +|* subordinated to the scene. +|* +\************************************************************************/ + +class SVXCORE_DLLPUBLIC E3dCompoundObject : public E3dObject +{ +private: + // to allow sdr::properties::E3dCompoundProperties access to SetGeometryValid() + friend class sdr::properties::E3dCompoundProperties; + friend class sdr::properties::E3dExtrudeProperties; + friend class sdr::properties::E3dLatheProperties; + friend class sdr::properties::E3dSphereProperties; + +protected: + virtual std::unique_ptr CreateObjectSpecificProperties() override; + +protected: + // convert given basegfx::B3DPolyPolygon to screen coor + basegfx::B2DPolyPolygon TransformToScreenCoor(const basegfx::B3DPolyPolygon& rCandidate); + + // protected destructor + virtual ~E3dCompoundObject() override; + +public: + E3dCompoundObject(SdrModel& rSdrModel); + + virtual basegfx::B2DPolyPolygon TakeXorPoly() const override; + virtual sal_uInt32 GetHdlCount() const override; + virtual void AddToHdlList(SdrHdlList& rHdlList) const override; + + virtual sal_uInt16 GetObjIdentifier() const override; + virtual void RecalcSnapRect() override; + + virtual E3dCompoundObject* CloneSdrObject(SdrModel& rTargetModel) const override; + + // implemented mainly for the purposes of Clone() + E3dCompoundObject& operator=(const E3dCompoundObject& rObj); +}; + +#endif // INCLUDED_SVX_OBJ3D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/objfac3d.hxx b/include/svx/objfac3d.hxx new file mode 100644 index 000000000..e5defce5d --- /dev/null +++ b/include/svx/objfac3d.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_SVX_OBJFAC3D_HXX +#define INCLUDED_SVX_OBJFAC3D_HXX + +#include +#include + + +/************************************************************************* +|* +|* Factory for chart-specific objects +|* +\************************************************************************/ + +class SdrObject; +struct SdrObjCreatorParams; + +class SVXCORE_DLLPUBLIC E3dObjFactory +{ +public: + E3dObjFactory(); + ~E3dObjFactory(); + + DECL_STATIC_LINK(E3dObjFactory, MakeObject, SdrObjCreatorParams, SdrObject*); +}; + + +#endif // INCLUDED_SVX_OBJFAC3D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/ofaitem.hxx b/include/svx/ofaitem.hxx new file mode 100644 index 000000000..ce86b0653 --- /dev/null +++ b/include/svx/ofaitem.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_SVX_OFAITEM_HXX +#define INCLUDED_SVX_OFAITEM_HXX + +#include +#include +#include + +class SVX_DLLPUBLIC OfaPtrItem final : public SfxPoolItem +{ +private: + void* pPtr; + +public: + OfaPtrItem( sal_uInt16 nWhich, void *pPtr ); + + virtual bool operator==( const SfxPoolItem& ) const override; + virtual OfaPtrItem* Clone( SfxItemPool *pPool = nullptr ) const override; + + void* GetValue() const { return pPtr; } +}; + +template +class OfaRefItem final : public SfxPoolItem +{ + private: + rtl::Reference mxRef; +public: + OfaRefItem( sal_uInt16 _nWhich, const rtl::Reference &xRef ) + : SfxPoolItem( _nWhich ), mxRef( xRef ) + {} + virtual bool operator==( const SfxPoolItem& rItem ) const override + { + return SfxPoolItem::operator==(rItem) + && mxRef == static_cast const &>(rItem).mxRef; + } + virtual OfaRefItem* Clone( SfxItemPool* /*pPool = 0*/ ) const override + { + return new OfaRefItem( *this ); + } +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/optgenrl.hxx b/include/svx/optgenrl.hxx new file mode 100644 index 000000000..2ee463d9d --- /dev/null +++ b/include/svx/optgenrl.hxx @@ -0,0 +1,45 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_OPTGENRL_HXX +#define INCLUDED_SVX_OPTGENRL_HXX + +// Defines for setting the focus of an Edit via a slot from external. +enum class EditPosition +{ + UNKNOWN = 0, + COMPANY = 1, + FIRSTNAME = 2, + LASTNAME = 3, + STREET = 4, + COUNTRY = 5, + PLZ = 6, + CITY = 7, + STATE = 8, + TITLE = 9, + POSITION = 10, + SHORTNAME = 11, + TELPRIV = 12, + TELCOMPANY = 13, + FAX = 14, + EMAIL = 15, +}; + +#endif // INCLUDED_SVX_OPTGENRL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/optgrid.hxx b/include/svx/optgrid.hxx new file mode 100644 index 000000000..33be89ecb --- /dev/null +++ b/include/svx/optgrid.hxx @@ -0,0 +1,136 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_OPTGRID_HXX +#define INCLUDED_SVX_OPTGRID_HXX + +#include +#include + +namespace weld { class CheckButton; } +namespace weld { class MetricSpinButton; } +namespace weld { class SpinButton; } +namespace weld { class ToggleButton; } +namespace weld { class Widget; } + +class SVX_DLLPUBLIC SvxOptionsGrid +{ +protected: + sal_uInt32 nFldDrawX; + sal_uInt32 nFldDivisionX; + sal_uInt32 nFldDrawY; + sal_uInt32 nFldDivisionY; + sal_uInt32 nFldSnapX; + sal_uInt32 nFldSnapY; + bool bUseGridsnap:1; + bool bSynchronize:1; + bool bGridVisible:1; + bool bEqualGrid: 1; + +public: + SvxOptionsGrid(); + + void SetFieldDrawX( sal_uInt32 nSet){nFldDrawX = nSet;} + void SetFieldDivisionX(sal_uInt32 nSet){nFldDivisionX = nSet;} + void SetFieldDrawY ( sal_uInt32 nSet){nFldDrawY = nSet;} + void SetFieldDivisionY(sal_uInt32 nSet){nFldDivisionY = nSet;} + void SetFieldSnapX( sal_uInt32 nSet){nFldSnapX = nSet;} + void SetFieldSnapY ( sal_uInt32 nSet){nFldSnapY = nSet;} + void SetUseGridSnap( bool bSet ) {bUseGridsnap = bSet;} + void SetSynchronize( bool bSet ) {bSynchronize = bSet;} + void SetGridVisible( bool bSet ) {bGridVisible = bSet;} + void SetEqualGrid( bool bSet ) {bEqualGrid = bSet;} + + sal_uInt32 GetFieldDrawX( ) const { return nFldDrawX; } + sal_uInt32 GetFieldDivisionX() const { return nFldDivisionX;} + sal_uInt32 GetFieldDrawY ( ) const { return nFldDrawY; } + sal_uInt32 GetFieldDivisionY() const { return nFldDivisionY;} + sal_uInt32 GetFieldSnapX( ) const { return nFldSnapX; } + sal_uInt32 GetFieldSnapY ( ) const { return nFldSnapY; } + bool GetUseGridSnap( ) const { return bUseGridsnap; } + bool GetSynchronize( ) const { return bSynchronize; } + bool GetGridVisible( ) const { return bGridVisible; } + bool GetEqualGrid() const { return bEqualGrid; } +}; + +class SVX_DLLPUBLIC SvxGridItem : public SvxOptionsGrid, public SfxPoolItem +{ + // #i9076# + friend class SvxGridTabPage; + +public: + SvxGridItem( sal_uInt16 _nWhich) : SfxPoolItem(_nWhich){}; + + virtual SvxGridItem* Clone( SfxItemPool *pPool = nullptr ) const override; + virtual bool operator==( const SfxPoolItem& ) const override; + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + +}; + +class SVX_DLLPUBLIC SvxGridTabPage : public SfxTabPage +{ +public: + SvxGridTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet); + virtual ~SvxGridTabPage() override; + + static std::unique_ptr Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rAttrSet); + + virtual bool FillItemSet( SfxItemSet* rSet ) override; + virtual void Reset( const SfxItemSet* rSet ) override; + + virtual void ActivatePage( const SfxItemSet& rSet ) override; + virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; + +private: + bool bAttrModified; + + std::unique_ptr m_xCbxUseGridsnap; + std::unique_ptr m_xCbxGridVisible; + std::unique_ptr m_xMtrFldDrawX; + std::unique_ptr m_xMtrFldDrawY; + std::unique_ptr m_xNumFldDivisionX; + std::unique_ptr m_xNumFldDivisionY; + std::unique_ptr m_xCbxSynchronize; +protected: + //these controls are used in draw and impress + std::unique_ptr m_xSnapFrames; + std::unique_ptr m_xCbxSnapHelplines; + std::unique_ptr m_xCbxSnapBorder; + std::unique_ptr m_xCbxSnapFrame; + std::unique_ptr m_xCbxSnapPoints; + std::unique_ptr m_xMtrFldSnapArea; + std::unique_ptr m_xCbxOrtho; + std::unique_ptr m_xCbxBigOrtho; + std::unique_ptr m_xCbxRotate; + std::unique_ptr m_xMtrFldAngle; + std::unique_ptr m_xMtrFldBezAngle; + + DECL_LINK(ClickRotateHdl_Impl, weld::ToggleButton&, void); +private: + DECL_LINK(ChangeDrawHdl_Impl, weld::MetricSpinButton&, void); + DECL_LINK(ChangeGridsnapHdl_Impl, weld::ToggleButton&, void); + DECL_LINK(ChangeDivisionHdl_Impl, weld::SpinButton&, void); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/pagectrl.hxx b/include/svx/pagectrl.hxx new file mode 100644 index 000000000..b5abe5c6a --- /dev/null +++ b/include/svx/pagectrl.hxx @@ -0,0 +1,153 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_PAGECTRL_HXX +#define INCLUDED_SVX_PAGECTRL_HXX + +#include +#include +#include + +enum class SvxPageUsage; +enum class SvxFrameDirection; + +class SVX_DLLPUBLIC SvxPageWindow : public weld::CustomWidgetController +{ +private: + Size aWinSize; + Size aSize; + + long nTop; + long nBottom; + long nLeft; + long nRight; + + bool bResetBackground; + bool bFrameDirection; + SvxFrameDirection nFrameDirection; + + long nHdLeft; + long nHdRight; + long nHdDist; + long nHdHeight; + + long nFtLeft; + long nFtRight; + long nFtDist; + long nFtHeight; + + drawinglayer::attribute::SdrAllFillAttributesHelperPtr maHeaderFillAttributes; + drawinglayer::attribute::SdrAllFillAttributesHelperPtr maFooterFillAttributes; + drawinglayer::attribute::SdrAllFillAttributesHelperPtr maPageFillAttributes; + + bool bFooter : 1; + bool bHeader : 1; + bool bTable : 1; + bool bHorz : 1; + bool bVert : 1; + + SvxPageUsage eUsage; + +protected: + virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override; + + virtual void DrawPage(vcl::RenderContext& rRenderContext, const Point& rPoint, + const bool bSecond, const bool bEnabled); + + static void drawFillAttributes(vcl::RenderContext& rRenderContext, + const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& rFillAttributes, + const tools::Rectangle& rPaintRange, const tools::Rectangle& rDefineRange); + +public: + SvxPageWindow(); + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; + virtual ~SvxPageWindow() override; + + void setHeaderFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& rFillAttributes) + { + maHeaderFillAttributes = rFillAttributes; + } + void setFooterFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& rFillAttributes) + { + maFooterFillAttributes = rFillAttributes; + } + void setPageFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& rFillAttributes) + { + maPageFillAttributes = rFillAttributes; + } + const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& getPageFillAttributes() const + { + return maPageFillAttributes; + } + void SetSize(const Size& rSize) + { + aSize = rSize; + } + const Size& GetSize() const + { + return aSize; + } + + void SetTop(long nNew) { nTop = nNew; } + void SetBottom(long nNew) { nBottom = nNew; } + void SetLeft(long nNew) { nLeft = nNew; } + void SetRight(long nNew) { nRight = nNew; } + + long GetTop() const { return nTop; } + long GetBottom() const { return nBottom; } + long GetLeft() const { return nLeft; } + long GetRight() const { return nRight; } + + void SetHdLeft(long nNew) { nHdLeft = nNew; } + void SetHdRight(long nNew) { nHdRight = nNew; } + void SetHdDist(long nNew) { nHdDist = nNew; } + void SetHdHeight(long nNew) { nHdHeight = nNew; } + + long GetHdLeft() const { return nHdLeft; } + long GetHdRight() const { return nHdRight; } + long GetHdDist() const { return nHdDist; } + long GetHdHeight() const { return nHdHeight; } + + void SetFtLeft(long nNew) { nFtLeft = nNew; } + void SetFtRight(long nNew) { nFtRight = nNew; } + void SetFtDist(long nNew) { nFtDist = nNew; } + void SetFtHeight(long nNew) { nFtHeight = nNew; } + + long GetFtLeft() const { return nFtLeft; } + long GetFtRight() const { return nFtRight; } + long GetFtDist() const { return nFtDist; } + long GetFtHeight() const { return nFtHeight; } + + void SetUsage(SvxPageUsage eU) { eUsage = eU; } + SvxPageUsage GetUsage() const { return eUsage; } + + void SetHeader( bool bNew ) { bHeader = bNew; } + void SetFooter( bool bNew ) { bFooter = bNew; } + void SetTable( bool bNew ) { bTable = bNew; } + void SetHorz( bool bNew ) { bHorz = bNew; } + void SetVert( bool bNew ) { bVert = bNew; } + + void EnableFrameDirection(bool bEnable); + void SetFrameDirection(SvxFrameDirection nDirection); + + void ResetBackground(); +}; + +#endif // INCLUDED_SVX_PAGECTRL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/pageitem.hxx b/include/svx/pageitem.hxx new file mode 100644 index 000000000..b22eb15e1 --- /dev/null +++ b/include/svx/pageitem.hxx @@ -0,0 +1,117 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_PAGEITEM_HXX +#define INCLUDED_SVX_PAGEITEM_HXX + +#include + +#include + +#include +#include +#include + +/*-------------------------------------------------------------------- + usage of the page + --------------------------------------------------------------------*/ + +enum class SvxPageUsage +{ + NONE = 0, + Left = 1, + Right = 2, + All = 3, + Mirror = 7 +}; + +/*-------------------------------------------------------------------- + parts of the page description + --------------------------------------------------------------------*/ + +/* +This item describes a page attribute (name of the template, enumeration, +portrait or landscape, layout) +*/ + +class SVX_DLLPUBLIC SvxPageItem final : public SfxPoolItem +{ +private: + OUString aDescName; // name of the template + SvxNumType eNumType; + bool bLandscape; // Portrait / Landscape + SvxPageUsage eUse; // Layout + +public: + + static SfxPoolItem* CreateDefault(); + SvxPageItem( const sal_uInt16 nId ); + SvxPageItem( const SvxPageItem& rItem ); + + virtual ~SvxPageItem() override; + + virtual SvxPageItem* Clone( SfxItemPool *pPool = nullptr ) const override; + virtual bool operator==( const SfxPoolItem& ) const override; + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + // orientation + SvxPageUsage GetPageUsage() const { return eUse; } + void SetPageUsage(SvxPageUsage eU) { eUse= eU; } + + bool IsLandscape() const { return bLandscape; } + void SetLandscape(bool bL) { bLandscape = bL; } + + // enumeration + SvxNumType GetNumType() const { return eNumType; } + void SetNumType(SvxNumType eNum) { eNumType = eNum; } + + // name of the descriptor + void SetDescName(const OUString& rStr) { aDescName = rStr; } +}; + + +/*-------------------------------------------------------------------- + container for header/footer attributes + --------------------------------------------------------------------*/ + +class SVX_DLLPUBLIC SvxSetItem final : public SfxSetItem +{ +public: + SvxSetItem( const sal_uInt16 nId, const SfxItemSet& rSet ); + SvxSetItem( const SvxSetItem& rItem ); + SvxSetItem( const sal_uInt16 nId, std::unique_ptr&& pSet ); + + virtual SvxSetItem* Clone( SfxItemPool *pPool = nullptr ) const override; + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/pagenumberlistbox.hxx b/include/svx/pagenumberlistbox.hxx new file mode 100644 index 000000000..aa2137e66 --- /dev/null +++ b/include/svx/pagenumberlistbox.hxx @@ -0,0 +1,45 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_PAGENUMBERINGHELPER_HXX +#define INCLUDED_SVX_PAGENUMBERINGHELPER_HXX + +#include +#include +#include + +class SVXCORE_DLLPUBLIC SvxPageNumberListBox +{ +private: + std::unique_ptr m_xControl; +public: + SvxPageNumberListBox(std::unique_ptr pControl); + int get_count() const { return m_xControl->get_count(); } + SvxNumType get_active_id() const { return static_cast(m_xControl->get_active_id().toInt32()); } + void set_active_id(SvxNumType eId) const { m_xControl->set_active_id(OUString::number(static_cast(eId))); } + int get_active() const { return m_xControl->get_active(); } + void set_active(int pos) { m_xControl->set_active(pos); } + void save_value() { m_xControl->save_value(); } + bool get_value_changed_from_saved() const { return m_xControl->get_value_changed_from_saved(); } + void connect_changed(const Link& rLink) { m_xControl->connect_changed(rLink); } + weld::ComboBox& get_widget() const { return *m_xControl; } +}; + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/papersizelistbox.hxx b/include/svx/papersizelistbox.hxx new file mode 100644 index 000000000..a80425ba8 --- /dev/null +++ b/include/svx/papersizelistbox.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_SVX_PAGESIZEHELPER_HXX +#define INCLUDED_SVX_PAGESIZEHELPER_HXX + +#include +#include +#include + +enum class PaperSizeApp +{ + Std, + Draw +}; + +class SVXCORE_DLLPUBLIC SvxPaperSizeListBox +{ +private: + std::unique_ptr m_xControl; +public: + SvxPaperSizeListBox(std::unique_ptr pControl); + + void FillPaperSizeEntries(PaperSizeApp eApp); + void set_active_id(Paper eSize); + Paper get_active_id() const; + + void connect_changed(const Link& rLink) { m_xControl->connect_changed(rLink); } + int get_active() const { return m_xControl->get_active(); } + void clear() { m_xControl->clear(); } + void save_value() { return m_xControl->save_value(); } + bool get_value_changed_from_saved() const { return m_xControl->get_value_changed_from_saved(); } + + weld::ComboBox& get_widget() const { return *m_xControl; } +}; + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/paraprev.hxx b/include/svx/paraprev.hxx new file mode 100644 index 000000000..8eb4001a7 --- /dev/null +++ b/include/svx/paraprev.hxx @@ -0,0 +1,103 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_PARAPREV_HXX +#define INCLUDED_SVX_PARAPREV_HXX + +#include +#include +#include + +enum class SvxPrevLineSpace +{ + N1 = 0, + N115, + N15, + N2, + Prop, + Min, + Leading +}; + +class SVX_DLLPUBLIC SvxParaPrevWindow final : public weld::CustomWidgetController +{ + Size aSize; + + // indentation + long nLeftMargin; + long nRightMargin; + short nFirstLineOffset; + // distances + sal_uInt16 nUpper; + sal_uInt16 nLower; + // adjustment + SvxAdjust eAdjust; + // last line in justification + SvxAdjust eLastLine; + // line distance + SvxPrevLineSpace eLine; + + virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override; + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; + void DrawParagraph(vcl::RenderContext& rRenderContext); + +public: + SvxParaPrevWindow(); + + void SetFirstLineOffset( short nNew ) + { + nFirstLineOffset = nNew; + } + void SetLeftMargin( long nNew ) + { + nLeftMargin = nNew; + } + void SetRightMargin( long nNew ) + { + nRightMargin = nNew; + } + void SetUpper( sal_uInt16 nNew ) + { + nUpper = nNew; + } + void SetLower( sal_uInt16 nNew ) + { + nLower = nNew; + } + void SetAdjust( SvxAdjust eNew ) + { + eAdjust = eNew; + } + void SetLastLine( SvxAdjust eNew ) + { + eLastLine = eNew; + } + void SetLineSpace( SvxPrevLineSpace eNew ) + { + eLine = eNew; + } + void SetSize( Size aNew ) + { + aSize = aNew; + } +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/passwd.hxx b/include/svx/passwd.hxx new file mode 100644 index 000000000..acfbd82c1 --- /dev/null +++ b/include/svx/passwd.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_SVX_PASSWD_HXX +#define INCLUDED_SVX_PASSWD_HXX + +#include +#include +#include + +class UNLESS_MERGELIBS(SVX_DLLPUBLIC) SvxPasswordDialog final : public SfxDialogController +{ +private: + OUString m_aOldPasswdErrStr; + OUString m_aRepeatPasswdErrStr; + Link m_aCheckPasswordHdl; + + std::unique_ptr m_xOldFL; + std::unique_ptr m_xOldPasswdFT; + std::unique_ptr m_xOldPasswdED; + std::unique_ptr m_xNewPasswdED; + std::unique_ptr m_xRepeatPasswdED; + std::unique_ptr m_xOKBtn; + + DECL_LINK(ButtonHdl, weld::Button&, void); + DECL_LINK(EditModifyHdl, weld::Entry&, void); + +public: + SvxPasswordDialog(weld::Window* pParent, bool bDisableOldPassword); + virtual ~SvxPasswordDialog() override; + + OUString GetOldPassword() const { return m_xOldPasswdED->get_text(); } + OUString GetNewPassword() const { return m_xNewPasswdED->get_text(); } + + void SetCheckPasswordHdl( const Link& rLink ) { m_aCheckPasswordHdl = rLink; } +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/polypolygoneditor.hxx b/include/svx/polypolygoneditor.hxx new file mode 100644 index 000000000..e8b6138df --- /dev/null +++ b/include/svx/polypolygoneditor.hxx @@ -0,0 +1,67 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_POLYPOLYGONEDITOR_HXX +#define INCLUDED_SVX_POLYPOLYGONEDITOR_HXX + +#include + +#include + +#include +#include + +namespace sdr +{ + +/** this class implements some helper functions to edit a B2DPolyPolygon */ +class SVXCORE_DLLPUBLIC PolyPolygonEditor +{ +public: + PolyPolygonEditor( const basegfx::B2DPolyPolygon& rPolyPolygon); + + const basegfx::B2DPolyPolygon& GetPolyPolygon() const { return maPolyPolygon; } + + /** returns true if the B2DPolyPolygon was changed. + Warning: B2DPolyPolygon can be empty after this operation! + */ + bool DeletePoints( const std::set< sal_uInt16 >& rAbsPoints ); + + /** returns true if the B2DPolyPolygon was changed. + */ + bool SetSegmentsKind(SdrPathSegmentKind eKind, const std::set< sal_uInt16 >& rAbsPoints); + + /** returns true if the B2DPolyPolygon was changed. + */ + bool SetPointsSmooth( basegfx::B2VectorContinuity eFlags, const std::set< sal_uInt16 >& rAbsPoints); + + /** Outputs the relative position ( polygon number and point number in that polygon ) from the absolute point number. + False is returned if the given absolute point is greater not inside this B2DPolyPolygon + */ + static bool GetRelativePolyPoint( const basegfx::B2DPolyPolygon& rPoly, sal_uInt32 nAbsPnt, sal_uInt32& rPolyNum, sal_uInt32& rPointNum ); + +private: + basegfx::B2DPolyPolygon maPolyPolygon; +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/postattr.hxx b/include/svx/postattr.hxx new file mode 100644 index 000000000..2ff44c84b --- /dev/null +++ b/include/svx/postattr.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_SVX_POSTATTR_HXX +#define INCLUDED_SVX_POSTATTR_HXX + +#include +#include + +/** The author shorthand symbol of a note + */ + +class SVX_DLLPUBLIC SvxPostItAuthorItem final : public SfxStringItem +{ +public: + static SfxPoolItem* CreateDefault(); + + SvxPostItAuthorItem( sal_uInt16 nWhich ); + + SvxPostItAuthorItem( const OUString& rAuthor, sal_uInt16 nWhich ); + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + + virtual SvxPostItAuthorItem* Clone( SfxItemPool *pPool = nullptr ) const override; +}; + + +/** The date of a note + */ + +class SVX_DLLPUBLIC SvxPostItDateItem final : public SfxStringItem +{ +public: + static SfxPoolItem* CreateDefault(); + + SvxPostItDateItem( sal_uInt16 nWhich ); + + SvxPostItDateItem( const OUString& rDate, sal_uInt16 nWhich ); + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + + virtual SvxPostItDateItem* Clone( SfxItemPool *pPool = nullptr ) const override; +}; + +/** The text of a note + */ + +class SVX_DLLPUBLIC SvxPostItTextItem final : public SfxStringItem +{ +public: + static SfxPoolItem* CreateDefault(); + + SvxPostItTextItem( sal_uInt16 nWhich ); + + SvxPostItTextItem( const OUString& rText, sal_uInt16 nWhich ); + // "pure virtual methods" from SfxPoolItem + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + + virtual SvxPostItTextItem* Clone( SfxItemPool *pPool = nullptr ) const override; +}; + + +/** The internal id of a note + */ + +class SVX_DLLPUBLIC SvxPostItIdItem final : public SfxStringItem +{ +public: + static SfxPoolItem* CreateDefault(); + + SvxPostItIdItem( sal_uInt16 nWhich ); + + virtual SvxPostItIdItem* Clone( SfxItemPool *pPool = nullptr ) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/pszctrl.hxx b/include/svx/pszctrl.hxx new file mode 100644 index 000000000..b63950292 --- /dev/null +++ b/include/svx/pszctrl.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_SVX_PSZCTRL_HXX +#define INCLUDED_SVX_PSZCTRL_HXX + +#include +#include +#include + +struct SvxPosSizeStatusBarControl_Impl; + +class SVX_DLLPUBLIC SvxPosSizeStatusBarControl final : public SfxStatusBarControl +{ +private: + std::unique_ptr pImpl; + SVX_DLLPRIVATE OUString GetMetricStr_Impl( long nVal ); +public: + SFX_DECL_STATUSBAR_CONTROL(); + + SvxPosSizeStatusBarControl( sal_uInt16 nSlotId, sal_uInt16 nId, StatusBar& rStb ); + virtual ~SvxPosSizeStatusBarControl() override; + + virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) override; + virtual void Paint( const UserDrawEvent& rEvt ) override; + virtual void Command( const CommandEvent& rCEvt ) override; +private: + void ImplUpdateItemText(); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/rectenum.hxx b/include/svx/rectenum.hxx new file mode 100644 index 000000000..59e9c1475 --- /dev/null +++ b/include/svx/rectenum.hxx @@ -0,0 +1,37 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_RECTENUM_HXX +#define INCLUDED_SVX_RECTENUM_HXX + +enum class RectPoint +{ + LT, // top left + MT, // top center + RT, // top right + LM, // left center + MM, // center + RM, // right center + LB, // bottom left + MB, // bottom center + RB // bottom right +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/relfld.hxx b/include/svx/relfld.hxx new file mode 100644 index 000000000..58301c2a4 --- /dev/null +++ b/include/svx/relfld.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_SVX_RELFLD_HXX +#define INCLUDED_SVX_RELFLD_HXX + +#include +#include +#include +#include + +class SVX_DLLPUBLIC SvxRelativeField +{ +private: + std::unique_ptr m_xSpinButton; + + sal_uInt16 nRelMin; + sal_uInt16 nRelMax; + bool bRelativeMode; + bool bRelative; + bool bNegativeEnabled; + + DECL_LINK(ModifyHdl, weld::Entry&, void); + +public: + SvxRelativeField(std::unique_ptr pControl); + + void EnableRelativeMode( sal_uInt16 nMin, sal_uInt16 nMax ); + void SetRelative( bool bRelative ); + bool IsRelative() const { return bRelative; } + void EnableNegativeMode() {bNegativeEnabled = true;} + + void set_sensitive(bool sensitive) { m_xSpinButton->set_sensitive(sensitive); } + void set_value(int nValue, FieldUnit eValueUnit) { m_xSpinButton->set_value(nValue, eValueUnit); } + int get_value(FieldUnit eDestUnit) const { return m_xSpinButton->get_value(eDestUnit); } + int get_min(FieldUnit eValueUnit) const { return m_xSpinButton->get_min(eValueUnit); } + void set_min(int min, FieldUnit eValueUnit) { m_xSpinButton->set_min(min, eValueUnit); } + void set_max(int max, FieldUnit eValueUnit) { m_xSpinButton->set_max(max, eValueUnit); } + int normalize(int nValue) const { return m_xSpinButton->normalize(nValue); } + int denormalize(int nValue) const { return m_xSpinButton->denormalize(nValue); } + void connect_value_changed(const Link& rLink) { m_xSpinButton->connect_value_changed(rLink); } + OUString get_text() const { return m_xSpinButton->get_text(); } + void set_text(const OUString& rText) { m_xSpinButton->set_text(rText); } + void save_value() { m_xSpinButton->save_value(); } + bool get_value_changed_from_saved() const { return m_xSpinButton->get_value_changed_from_saved(); } + void set_size_request(int nWidth, int nHeight) { m_xSpinButton->set_size_request(nWidth, nHeight); } + void grab_focus() { m_xSpinButton->grab_focus(); } + Size get_preferred_size() const { return m_xSpinButton->get_preferred_size(); } + weld::SpinButton& get_widget() { return m_xSpinButton->get_widget(); } + + int GetCoreValue(MapUnit eUnit) const { return ::GetCoreValue(*m_xSpinButton, eUnit); } + void SetFieldUnit(FieldUnit eUnit, bool bAll = false) { ::SetFieldUnit(*m_xSpinButton, eUnit, bAll); } + void SetMetricValue(int lCoreValue, MapUnit eUnit) { ::SetMetricValue(*m_xSpinButton, lCoreValue, eUnit); } +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/rotmodit.hxx b/include/svx/rotmodit.hxx new file mode 100644 index 000000000..0c2e6bfb5 --- /dev/null +++ b/include/svx/rotmodit.hxx @@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_ROTMODIT_HXX +#define INCLUDED_SVX_ROTMODIT_HXX + +#include +#include + + +// Alignment with rotated text + +enum SvxRotateMode +{ + SVX_ROTATE_MODE_STANDARD, + SVX_ROTATE_MODE_TOP, + SVX_ROTATE_MODE_CENTER, + SVX_ROTATE_MODE_BOTTOM +}; + +class SVX_DLLPUBLIC SvxRotateModeItem final : public SfxEnumItem +{ +public: + static SfxPoolItem* CreateDefault(); + + SvxRotateModeItem( SvxRotateMode eMode, sal_uInt16 nWhich); + SvxRotateModeItem( const SvxRotateModeItem& rItem ); + virtual ~SvxRotateModeItem() override; + + virtual sal_uInt16 GetValueCount() const override; + virtual SvxRotateModeItem* Clone( SfxItemPool *pPool = nullptr ) const override; + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString& rText, const IntlWrapper& ) const override; + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; +private: + static OUString GetValueText(SvxRotateMode nVal); +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/rubydialog.hxx b/include/svx/rubydialog.hxx new file mode 100644 index 000000000..1df1f51ae --- /dev/null +++ b/include/svx/rubydialog.hxx @@ -0,0 +1,140 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +#ifndef INCLUDED_SVX_RUBYDIALOG_HXX +#define INCLUDED_SVX_RUBYDIALOG_HXX + +#include +#include +#include +#include +#include + +class SvxRubyDialog; +class RubyPreview final : public weld::CustomWidgetController +{ + virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override; + SvxRubyDialog* m_pParentDlg; + +public: + RubyPreview(); + virtual ~RubyPreview() override; + void setRubyDialog(SvxRubyDialog* pParentDlg) + { + m_pParentDlg = pParentDlg; + } + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; +}; + +class SVX_DLLPUBLIC SvxRubyChildWindow final : public SfxChildWindow +{ +public: + SvxRubyChildWindow( vcl::Window*, sal_uInt16, SfxBindings*, SfxChildWinInfo const * ); + SFX_DECL_CHILDWINDOW( SvxRubyChildWindow ); +}; + +class SvxRubyData_Impl; + +class SvxRubyDialog : public SfxModelessDialogController +{ + friend class RubyPreview; + + + long nLastPos; + long nCurrentEdit; + bool bModified; + SfxBindings* pBindings; + rtl::Reference m_pImpl; + weld::Entry* aEditArr[8]; + + std::unique_ptr m_xLeftFT; + std::unique_ptr m_xRightFT; + std::unique_ptr m_xLeft1ED; + std::unique_ptr m_xRight1ED; + std::unique_ptr m_xLeft2ED; + std::unique_ptr m_xRight2ED; + std::unique_ptr m_xLeft3ED; + std::unique_ptr m_xRight3ED; + std::unique_ptr m_xLeft4ED; + std::unique_ptr m_xRight4ED; + + std::unique_ptr m_xScrolledWindow; + + std::unique_ptr m_xAdjustLB; + + std::unique_ptr m_xPositionLB; + + std::unique_ptr m_xCharStyleFT; + std::unique_ptr m_xCharStyleLB; + std::unique_ptr m_xStylistPB; + + std::unique_ptr m_xApplyPB; + std::unique_ptr m_xClosePB; + + std::unique_ptr m_xContentArea; + std::unique_ptr m_xGrid; + + std::unique_ptr m_xPreviewWin; + std::unique_ptr m_xPreview; + + DECL_LINK(ApplyHdl_Impl, weld::Button&, void); + DECL_LINK(CloseHdl_Impl, weld::Button&, void); + DECL_LINK(StylistHdl_Impl, weld::Button&, void); + DECL_LINK(ScrollHdl_Impl, weld::ScrolledWindow&, void); + DECL_LINK(PositionHdl_Impl, weld::ComboBox&, void); + DECL_LINK(AdjustHdl_Impl, weld::ComboBox&, void); + DECL_LINK(CharStyleHdl_Impl, weld::ComboBox&, void); + DECL_LINK(EditModifyHdl_Impl, weld::Entry&, void); + DECL_LINK(EditFocusHdl_Impl, weld::Widget&, void); + DECL_LINK(KeyUpDownHdl_Impl, const KeyEvent&, bool); + DECL_LINK(KeyUpDownTabHdl_Impl, const KeyEvent&, bool); + + bool EditScrollHdl_Impl(sal_Int32 nParam); + bool EditJumpHdl_Impl(sal_Int32 nParam); + + void SetRubyText(sal_Int32 nPos, weld::Entry& rLeft, weld::Entry& rRight); + void GetRubyText(); + void ClearCharStyleList(); + void AssertOneEntry(); + + void Update(); + virtual void Close() override; + + long GetLastPos() const {return nLastPos;} + void SetLastPos(long nSet) {nLastPos = nSet;} + + bool IsModified() const {return bModified;} + void SetModified(bool bSet) {bModified = bSet;} + + void EnableControls(bool bEnable); + + void GetCurrentText(OUString& rBase, OUString& rRuby); + +public: + SvxRubyDialog(SfxBindings *pBindings, SfxChildWindow *pCW, weld::Window* pParent); + virtual ~SvxRubyDialog() override; + + virtual void Activate() override; +}; + +#endif // INCLUDED_SVX_RUBYDIALOG_HXX + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/ruler.hxx b/include/svx/ruler.hxx new file mode 100644 index 000000000..d0dd4e682 --- /dev/null +++ b/include/svx/ruler.hxx @@ -0,0 +1,285 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_RULER_HXX +#define INCLUDED_SVX_RULER_HXX + +#include +#include +#include +#include + +#include + +class Menu; +class SvxProtectItem; +class SvxRulerItem; +class SfxBindings; +class SvxLongLRSpaceItem; +class SvxLongULSpaceItem; +class SvxTabStopItem; +class SvxLRSpaceItem; +class SvxPagePosSizeItem; +class SvxColumnItem; +class SfxRectangleItem; +class SvxObjectItem; +class SfxBoolItem; +struct SvxRuler_Impl; + +enum class RulerChangeType +{ + MARGIN1, + MARGIN2 +}; + +enum class SvxRulerDragFlags +{ + NONE = 0x00, + OBJECT = 0x01, + // reduce size of the last column, shift + OBJECT_SIZE_LINEAR = 0x02, + OBJECT_SIZE_PROPORTIONAL = 0x04, // proportional, Ctrl + // only current line (table; Shift-Ctrl) + OBJECT_ACTLINE_ONLY = 0x08, + // currently same key assignment + OBJECT_LEFT_INDENT_ONLY = OBJECT_SIZE_PROPORTIONAL, +}; +namespace o3tl +{ + template<> struct typed_flags : is_typed_flags {}; +} + +enum class SvxRulerSupportFlags +{ + TABS = 0x0001, + PARAGRAPH_MARGINS = 0x0002, + BORDERS = 0x0004, + OBJECT = 0x0008, + SET_NULLOFFSET = 0x0010, + NEGATIVE_MARGINS = 0x0020, + PARAGRAPH_MARGINS_VERTICAL = 0x0040, + REDUCED_METRIC = 0x0080, //shorten the context menu to select metric +}; +namespace o3tl +{ + template<> struct typed_flags : is_typed_flags {}; +} + +class SVX_DLLPUBLIC SvxRuler: public Ruler, public SfxListener +{ + friend class SvxRulerItem; + + std::vector > pCtrlItems; + + std::unique_ptr mxLRSpaceItem; // left and right edge + std::unique_ptr mxMinMaxItem; // maxima for dragging + std::unique_ptr mxULSpaceItem; // upper and lower edge + std::unique_ptr mxTabStopItem; // tab stops + std::unique_ptr mxParaItem; // paragraphs + std::unique_ptr mxPagePosItem; // page distance to the rule + std::unique_ptr mxColumnItem; // columns + std::unique_ptr mxObjectItem; // object + + VclPtr pEditWin; + + std::unique_ptr mxRulerImpl; + + bool bAppSetNullOffset :1; + bool bHorz :1; + long lLogicNullOffset; // in logic coordinates + long lAppNullOffset; // in logic coordinates + long lInitialDragPos; + SvxRulerSupportFlags nFlags; + SvxRulerDragFlags nDragType; + sal_uInt16 nDefTabType; + sal_uInt16 nTabCount; + sal_uInt16 nTabBufSize; + long lDefTabDist; + long lTabPos; + + std::vector mpTabs; // tab positions in pixel + std::vector mpIndents; // paragraph margins in pixel + std::vector mpBorders; + std::vector mpObjectBorders; + + SfxBindings* pBindings; + long nDragOffset; + long nMaxLeft; + long nMaxRight; + bool bValid; + bool bListening; + bool bActive; + + bool mbCoarseSnapping; + bool mbSnapping; + + void StartListening_Impl(); + long GetCorrectedDragPos(bool bLeft = true, bool bRight = true ); + void DrawLine_Impl(long &lTabPos, int, bool Horizontal); + sal_uInt16 GetObjectBordersOff(sal_uInt16 nIdx) const; + + // page borders or surrounding frame + void UpdateFrame(const SvxLongLRSpaceItem* pItem); + void UpdateFrame(const SvxLongULSpaceItem* pItem); + void UpdateFrameMinMax(const SfxRectangleItem* pItem); + // paragraph indentations + void UpdatePara(const SvxLRSpaceItem* pItem); + // Border distance + void UpdateParaBorder(); + // Tabs + void Update(const SvxTabStopItem* pItem); + // page position and width + void Update(const SvxPagePosSizeItem* pItem); + // columns + void Update(const SvxColumnItem* pItem, sal_uInt16 nSID); + // object selection + void Update(const SvxObjectItem* pItem); + // protect + void Update(const SvxProtectItem* pItem ); + // left-to-right text + void UpdateTextRTL(const SfxBoolItem* pItem); + // paragraph indentations + void UpdatePara(); + void UpdateTabs(); + void UpdatePage(); + void UpdateFrame(); + void UpdateColumns(); + void UpdateObject(); + + // Convert position to stick to ruler ticks + long MakePositionSticky(long rValue, long aPointOfReference, bool aSnapToFrameMargin = true) const; + + long PixelHAdjust(long lPos, long lPos2) const; + long PixelVAdjust(long lPos, long lPos2) const; + long PixelAdjust(long lPos, long lPos2) const; + + long ConvertHPosPixel(long lPos) const; + long ConvertVPosPixel(long lPos) const; + long ConvertHSizePixel(long lSize) const; + long ConvertVSizePixel(long lSize) const; + + long ConvertPosPixel(long lPos) const; + long ConvertSizePixel(long lSize) const; + + long ConvertHPosLogic(long lPos) const; + long ConvertVPosLogic(long lPos) const; + long ConvertHSizeLogic(long lSize) const; + long ConvertVSizeLogic(long lSize) const; + + long ConvertPosLogic(long lPos) const; + long ConvertSizeLogic(long lSize) const; + + long RoundToCurrentMapMode(long lValue) const; + + long GetFirstLineIndent() const; + long GetLeftIndent() const; + long GetRightIndent() const; + long GetLogicRightIndent() const; + + long GetLeftFrameMargin() const; + long GetRightFrameMargin() const; + + void CalcMinMax(); + + void EvalModifier(); + void DragMargin1(); + //adjust the left margin either after DragMargin1() or after DragBorders() + void AdjustMargin1(long lDiff); + void DragMargin2(); + void DragIndents(); + void DragTabs(); + void DragBorders(); + void DragObjectBorder(); + + void ApplyMargins(); + void ApplyIndents(); + void ApplyTabs(); + void ApplyBorders(); + void ApplyObject(); + + long GetFrameLeft() const; + + long GetLeftMin() const; + long GetRightMax() const; + + DECL_LINK( TabMenuSelect, Menu *, bool ); + DECL_LINK( MenuSelect, Menu *, bool ); + void PrepareProportional_Impl(RulerType); + + enum class UpdateType + { + MoveLeft, + MoveRight + }; + void UpdateParaContents_Impl(long lDiff, UpdateType); + +protected: + virtual void Command( const CommandEvent& rCEvt ) override; + virtual void Click() override; + virtual bool StartDrag() override; + virtual void Drag() override; + virtual void EndDrag() override; + virtual void ExtraDown() override; + virtual void MouseMove( const MouseEvent& rMEvt ) override; + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override; + + virtual void Update(); + + bool IsActLastColumn( + bool bForceDontConsiderHidden = false, + sal_uInt16 nAct=USHRT_MAX) const; + bool IsActFirstColumn( + bool bForceDontConsiderHidden = false, + sal_uInt16 nAct=USHRT_MAX) const; + sal_uInt16 GetActLeftColumn( + bool bForceDontConsiderHidden = false, + sal_uInt16 nAct=USHRT_MAX ) const; + sal_uInt16 GetActRightColumn ( + bool bForceDontConsiderHidden = false, + sal_uInt16 nAct=USHRT_MAX ) const; + long CalcPropMaxRight(sal_uInt16 nCol = USHRT_MAX) const; + +public: + + SvxRuler(vcl::Window* pParent, vcl::Window *pEditWin, SvxRulerSupportFlags nRulerFlags, + SfxBindings &rBindings, WinBits nWinStyle); + virtual ~SvxRuler() override; + virtual void dispose() override; + + void SetDefTabDist(long); + + // set/get NullOffset in logic units + void SetNullOffsetLogic(long lOff); + + void SetActive(bool bOn = true); + + void ForceUpdate() + { + Update(); + } + + //#i24363# tab stops relative to indent + void SetTabsRelativeToIndent( bool bRel ); + void SetValues(RulerChangeType type, long value); + long GetPageWidth() const; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/rulritem.hxx b/include/svx/rulritem.hxx new file mode 100644 index 000000000..2f0df198f --- /dev/null +++ b/include/svx/rulritem.hxx @@ -0,0 +1,232 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_RULRITEM_HXX +#define INCLUDED_SVX_RULRITEM_HXX + +#include +#include +#include +#include + +class SVX_DLLPUBLIC SvxLongLRSpaceItem final : public SfxPoolItem +{ + long mlLeft; // nLeft or the negative first-line indentation + long mlRight; // the unproblematic right edge + + virtual bool operator==( const SfxPoolItem& ) const override; + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + + virtual SvxLongLRSpaceItem* Clone( SfxItemPool *pPool = nullptr ) const override; + + const SvxLongLRSpaceItem& operator=(const SvxLongLRSpaceItem &) = delete; + +public: + static SfxPoolItem* CreateDefault(); + SvxLongLRSpaceItem(long lLeft, long lRight, sal_uInt16 nId); + SvxLongLRSpaceItem(); + + long GetLeft() const { return mlLeft;} + long GetRight() const { return mlRight;} + void SetLeft(long lArgLeft); + void SetRight(long lArgRight); +}; + +class SVX_DLLPUBLIC SvxLongULSpaceItem final : public SfxPoolItem +{ + long mlLeft; // nLeft or the negative first-line indentation + long mlRight; // the unproblematic right edge + + virtual bool operator==( const SfxPoolItem& ) const override; + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + + virtual SvxLongULSpaceItem* Clone( SfxItemPool *pPool = nullptr ) const override; + + const SvxLongULSpaceItem& operator=(const SvxLongULSpaceItem &) = delete; + +public: + static SfxPoolItem* CreateDefault(); + SvxLongULSpaceItem(long lUpper, long lLower, sal_uInt16 nId); + SvxLongULSpaceItem(); + + long GetUpper() const { return mlLeft;} + long GetLower() const { return mlRight;} + void SetUpper(long lArgLeft); + void SetLower(long lArgRight); +}; + +class SVX_DLLPUBLIC SvxPagePosSizeItem final : public SfxPoolItem +{ + Point aPos; + long lWidth; + long lHeight; + + virtual bool operator==( const SfxPoolItem& ) const override; + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + + virtual SvxPagePosSizeItem* Clone( SfxItemPool *pPool = nullptr ) const override; + +private: + const SvxPagePosSizeItem& operator=(const SvxPagePosSizeItem &) = delete; +public: + static SfxPoolItem* CreateDefault(); + SvxPagePosSizeItem(const Point &rPos, long lWidth, long lHeight); + SvxPagePosSizeItem(); + + const Point &GetPos() const { return aPos; } + long GetWidth() const { return lWidth; } + long GetHeight() const { return lHeight; } +}; + +struct SVX_DLLPUBLIC SvxColumnDescription +{ + long nStart; /* Start of the column */ + long nEnd; /* End of the column */ + bool bVisible; /* Visibility */ + + long nEndMin; //min. possible position of end + long nEndMax; //max. possible position of end + + SvxColumnDescription(long start, long end, bool bVis); + + SvxColumnDescription(long start, long end, + long endMin, long endMax, bool bVis); + + bool operator==(const SvxColumnDescription &rCmp) const; + bool operator!=(const SvxColumnDescription &rCmp) const; + long GetWidth() const; +}; + +template +inline std::basic_ostream & operator <<( + std::basic_ostream & stream, SvxColumnDescription const& dsc) +{ + return stream << "{ nStart " << dsc.nStart << " nEnd " << dsc.nEnd + << " bVisible " << dsc.bVisible << " nEndMin " << dsc.nEndMin + << " nEndMax " << dsc.nEndMax << " }"; +} + + +class SVX_DLLPUBLIC SvxColumnItem final : public SfxPoolItem +{ + std::vector aColumns; // Column array + + long nLeft; // Left edge for the table + long nRight; // Right edge for the table; for columns always + // equal to the surrounding frame + sal_uInt16 nActColumn; // the current column + bool bTable; // table? + bool bOrtho; // evenly spread columns + + virtual bool operator==( const SfxPoolItem& ) const override; + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, + const IntlWrapper& ) const override; + + virtual SvxColumnItem* Clone( SfxItemPool *pPool = nullptr ) const override; + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + +public: + static SfxPoolItem* CreateDefault(); + // right edge of the surrounding frame + // nLeft, nRight each the distance to the surrounding frame + SvxColumnItem(sal_uInt16 nAct = 0); + SvxColumnItem(sal_uInt16 nActCol, sal_uInt16 nLeft, sal_uInt16 nRight); // Table with borders + + SvxColumnDescription& operator[](sal_uInt16 index); + const SvxColumnDescription& operator[](sal_uInt16 index) const; + SvxColumnDescription& At(sal_uInt16 index); + SvxColumnDescription& GetActiveColumnDescription(); + + sal_uInt16 Count() const; + void Append(const SvxColumnDescription& rDesc); + void SetLeft(long aLeft); + void SetRight(long aRight); + sal_uInt16 GetActColumn() const { return nActColumn;} + bool IsFirstAct() const; + bool IsLastAct() const; + long GetLeft() const { return nLeft;} + long GetRight() const { return nRight;} + bool IsTable() const { return bTable;} + bool CalcOrtho() const; + void SetOrtho(bool bVal); + bool IsConsistent() const; +}; + +class SVX_DLLPUBLIC SvxObjectItem final : public SfxPoolItem +{ + long nStartX; /* Start in x direction */ + long nEndX; /* End in x direction */ + long nStartY; /* Start in y direction */ + long nEndY; /* End in y direction */ + bool bLimits; /* boundary limit control by the application */ + + virtual bool operator==( const SfxPoolItem& ) const override; + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + + virtual SvxObjectItem* Clone( SfxItemPool *pPool = nullptr ) const override; + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + const SvxObjectItem &operator=(const SvxObjectItem &) = delete; + +public: + static SfxPoolItem* CreateDefault(); + SvxObjectItem(long nStartX, long nEndX, + long nStartY, long nEndY); + + long GetStartX() const { return nStartX;} + long GetEndX() const { return nEndX;} + long GetStartY() const { return nStartY;} + long GetEndY() const { return nEndY;} + + void SetStartX(long lValue); + void SetEndX(long lValue); + void SetStartY(long lValue); + void SetEndY(long lValue); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/samecontentlistbox.hxx b/include/svx/samecontentlistbox.hxx new file mode 100644 index 000000000..1f5a503e9 --- /dev/null +++ b/include/svx/samecontentlistbox.hxx @@ -0,0 +1,32 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SAMECONTENTLISTBOXHELPER_HXX +#define INCLUDED_SVX_SAMECONTENTLISTBOXHELPER_HXX + +#include +#include + +namespace SameContentListBox +{ + void SVXCORE_DLLPUBLIC Fill(weld::ComboBox& rComboBox); +}; + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/scene3d.hxx b/include/svx/scene3d.hxx new file mode 100644 index 000000000..837c2da43 --- /dev/null +++ b/include/svx/scene3d.hxx @@ -0,0 +1,193 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SCENE3D_HXX +#define INCLUDED_SVX_SCENE3D_HXX + +#include +#include +#include +#include +#include +#include +#include + +namespace sdr::properties { + class BaseProperties; +} + +/************************************************************************* +|* +|* GeoData relevant for undo actions +|* +\************************************************************************/ + +class E3DSceneGeoData final : public E3DObjGeoData +{ +public: + Camera3D aCamera; + + E3DSceneGeoData() {} +}; + +class Imp3DDepthRemapper; + +/************************************************************************* +|* +|* base class for 3D scenes +|* +\************************************************************************/ + +class SVXCORE_DLLPUBLIC E3dScene : public E3dObject, public SdrObjList +{ +protected: + virtual std::unique_ptr CreateObjectSpecificProperties() override; + virtual std::unique_ptr CreateObjectSpecificViewContact() override; + + // transformations + B3dCamera aCameraSet; + Camera3D aCamera; + + mutable std::unique_ptr mp3DDepthRemapper; + + // Flag to determine if only selected objects should be drawn + bool bDrawOnlySelected : 1; + + bool mbSkipSettingDirty : 1; + + void RebuildLists(); + + virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override; + + void SetDefaultAttributes(); + void ImpCleanup3DDepthMapper(); + + // protected destructor + virtual ~E3dScene() override; + +public: + E3dScene(SdrModel& rSdrModel); + + virtual void StructureChanged() override; + + // derived from SdrObjList + virtual SdrPage* getSdrPageFromSdrObjList() const override; + virtual SdrObject* getSdrObjectFromSdrObjList() const override; + + // derived from SdrObject + virtual SdrObjList* getChildrenOfSdrObject() const override; + + virtual void SetBoundRectDirty() override; + + virtual basegfx::B2DPolyPolygon TakeXorPoly() const override; + + sal_uInt32 RemapOrdNum(sal_uInt32 nOrdNum) const; + + // Perspective: enum ProjectionType { ProjectionType::Parallel, ProjectionType::Perspective } + ProjectionType GetPerspective() const + { return static_cast(GetObjectItemSet().Get(SDRATTR_3DSCENE_PERSPECTIVE).GetValue()); } + + // Distance: + double GetDistance() const + { return static_cast(GetObjectItemSet().Get(SDRATTR_3DSCENE_DISTANCE).GetValue()); } + + // Focal length: before cm, now 1/10th mm (*100) + double GetFocalLength() const + { return GetObjectItemSet().Get(SDRATTR_3DSCENE_FOCAL_LENGTH).GetValue(); } + + // set flag to draw only selected + void SetDrawOnlySelected(bool bNew) { bDrawOnlySelected = bNew; } + bool GetDrawOnlySelected() const { return bDrawOnlySelected; } + virtual sal_uInt16 GetObjIdentifier() const override; + + virtual void NbcSetSnapRect(const tools::Rectangle& rRect) override; + virtual void NbcMove(const Size& rSize) override; + virtual void NbcResize(const Point& rRef, const Fraction& rXFact, + const Fraction& rYFact) override; + virtual void RecalcSnapRect() override; + + virtual E3dScene* getRootE3dSceneFromE3dObject() const override; + void SetCamera(const Camera3D& rNewCamera); + const Camera3D& GetCamera() const { return aCamera; } + void removeAllNonSelectedObjects(); + + virtual E3dScene* CloneSdrObject(SdrModel& rTargetModel) const override; + E3dScene& operator=(const E3dScene&); + + virtual SdrObjGeoData *NewGeoData() const override; + virtual void SaveGeoData(SdrObjGeoData& rGeo) const override; + virtual void RestGeoData(const SdrObjGeoData& rGeo) override; + + virtual void NbcSetTransform(const basegfx::B3DHomMatrix& rMatrix) override; + virtual void SetTransform(const basegfx::B3DHomMatrix& rMatrix) override; + + virtual void NbcRotate(const Point& rRef, long nAngle, double sn, double cs) override; + void RotateScene(const Point& rRef, double sn, double cs); + + // TakeObjName...() is for the display in the UI, for example "3 frames selected". + virtual OUString TakeObjNameSingul() const override; + virtual OUString TakeObjNamePlural() const override; + + // get transformations + B3dCamera& GetCameraSet() { return aCameraSet; } + const B3dCamera& GetCameraSet() const { return aCameraSet; } + + // break up + virtual bool IsBreakObjPossible() override; + + // polygon which is built during creation + virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const override; + + // create moves + virtual bool BegCreate(SdrDragStat& rStat) override; + virtual bool MovCreate(SdrDragStat& rStat) override; // true=Xor must be repainted + virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) override; + virtual bool BckCreate(SdrDragStat& rStat) override; + virtual void BrkCreate(SdrDragStat& rStat) override; + + void SuspendReportingDirtyRects(); + void ResumeReportingDirtyRects(); + void SetAllSceneRectsDirty(); + + // set selection from E3dObject (temporary flag for 3D actions) + virtual void SetSelected(bool bNew) override; + + // derived from SdrObjList + virtual void NbcInsertObject(SdrObject* pObj, size_t nPos=SAL_MAX_SIZE) override; + virtual void InsertObject(SdrObject* pObj, size_t nPos=SAL_MAX_SIZE) override; + virtual SdrObject* NbcRemoveObject(size_t nObjNum) override; + virtual SdrObject* RemoveObject(size_t nObjNum) override; + + // needed for group functionality + virtual void SetRectsDirty(bool bNotMyself = false, bool bRecursive = true) override; + virtual void NbcSetLayer(SdrLayerID nLayer) override; + + // react on model/page change + virtual void handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage) override; + + virtual SdrObjList* GetSubList() const override; + virtual void SetTransformChanged() override; + +protected: + virtual basegfx::B3DRange RecalcBoundVolume() const override; +}; + +#endif // INCLUDED_SVX_SCENE3D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdangitm.hxx b/include/svx/sdangitm.hxx new file mode 100644 index 000000000..81897d43c --- /dev/null +++ b/include/svx/sdangitm.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_SVX_SDANGITM_HXX +#define INCLUDED_SVX_SDANGITM_HXX + +#include +#include + + + +class SVXCORE_DLLPUBLIC SdrAngleItem: public SfxInt32Item { +public: + SdrAngleItem(sal_uInt16 nId, sal_Int32 nAngle): SfxInt32Item(nId,nAngle) {} + virtual SdrAngleItem* Clone(SfxItemPool* pPool=nullptr) const override; + + virtual bool GetPresentation(SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString& rText, + const IntlWrapper& rIntlWrapper) const override; +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdasitm.hxx b/include/svx/sdasitm.hxx new file mode 100644 index 000000000..e8db1996a --- /dev/null +++ b/include/svx/sdasitm.hxx @@ -0,0 +1,99 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SDASITM_HXX +#define INCLUDED_SVX_SDASITM_HXX + +#include +#include +#include +#include +#include +#include +#include + +namespace com::sun::star::uno { class Any; } + +class SVXCORE_DLLPUBLIC SdrCustomShapeGeometryItem : public SfxPoolItem +{ +public: + typedef std::pair < const OUString, const OUString > PropertyPair; + +private: + struct PropertyPairHash + { + inline size_t operator()( const SdrCustomShapeGeometryItem::PropertyPair& ) const; + }; + typedef std::unordered_map PropertyPairHashMap; + typedef std::unordered_map PropertyHashMap; + + PropertyHashMap aPropHashMap; + PropertyPairHashMap aPropPairHashMap; + + css::uno::Sequence< css::beans::PropertyValue > aPropSeq; + + public: + + SdrCustomShapeGeometryItem(); + SdrCustomShapeGeometryItem( const css::uno::Sequence< css::beans::PropertyValue >& ); + virtual ~SdrCustomShapeGeometryItem() override; + + SdrCustomShapeGeometryItem(SdrCustomShapeGeometryItem const &) = default; + SdrCustomShapeGeometryItem(SdrCustomShapeGeometryItem &&) = default; + SdrCustomShapeGeometryItem & operator =(SdrCustomShapeGeometryItem const &) = delete; // due to SfxPoolItem + SdrCustomShapeGeometryItem & operator =(SdrCustomShapeGeometryItem &&) = delete; // due to SfxPoolItem + + virtual bool operator==( const SfxPoolItem& ) const override; + virtual bool GetPresentation(SfxItemPresentation ePresentation, + MapUnit eCoreMetric, MapUnit ePresentationMetric, + OUString &rText, const IntlWrapper&) const override; + + virtual SdrCustomShapeGeometryItem* Clone( SfxItemPool* pPool = nullptr ) const override; + + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + css::uno::Any* GetPropertyValueByName( const OUString& rPropName ); + const css::uno::Any* GetPropertyValueByName( const OUString& rPropName ) const; + css::uno::Any* GetPropertyValueByName( const OUString& rPropName, const OUString& rPropName2 ); + const css::uno::Any* GetPropertyValueByName( const OUString& rPropName, const OUString& rPropName2 ) const; + + void SetPropertyValue( const css::beans::PropertyValue& rPropVal ); + void SetPropertyValue( const OUString& rSequenceName, const css::beans::PropertyValue& rPropVal ); + + void ClearPropertyValue( const OUString& rPropertyName ); +}; + +inline SdrOnOffItem makeSdrTextWordWrapItem( bool bAuto ) { + return SdrOnOffItem( SDRATTR_TEXT_WORDWRAP, bAuto ); +} + +// some useful inline methods + +size_t SdrCustomShapeGeometryItem::PropertyPairHash::operator()( const SdrCustomShapeGeometryItem::PropertyPair &r1 ) const +{ + size_t hash = 17; + hash = hash * 37 + r1.first.hashCode(); + hash = hash * 37 + r1.second.hashCode(); + return hash; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sderitm.hxx b/include/svx/sderitm.hxx new file mode 100644 index 000000000..ad03621c5 --- /dev/null +++ b/include/svx/sderitm.hxx @@ -0,0 +1,31 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_SDERITM_HXX +#define INCLUDED_SVX_SDERITM_HXX + +#include +#include + +inline SdrMetricItem makeSdrEckenradiusItem(long nRadius) { + return SdrMetricItem(SDRATTR_ECKENRADIUS, nRadius); +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdgcpitm.hxx b/include/svx/sdgcpitm.hxx new file mode 100644 index 000000000..1f309ea72 --- /dev/null +++ b/include/svx/sdgcpitm.hxx @@ -0,0 +1,45 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SDGCPITM_HXX +#define INCLUDED_SVX_SDGCPITM_HXX + +#include +#include +#include + + +// SdrGrafCropItem - + + +class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) SdrGrafCropItem : public SvxGrfCrop +{ +public: + + + SdrGrafCropItem( sal_Int32 nLeftCrop = 0, sal_Int32 nTopCrop = 0, + sal_Int32 nRightCrop = 0, sal_Int32 nBottomCrop = 0 ) : + SvxGrfCrop( nLeftCrop, nRightCrop, nTopCrop, nBottomCrop, SDRATTR_GRAFCROP ) {} + + virtual SdrGrafCropItem* Clone( SfxItemPool* pPool = nullptr ) const override; +}; + +#endif // INCLUDED_SVX_SDGCPITM_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdggaitm.hxx b/include/svx/sdggaitm.hxx new file mode 100644 index 000000000..5a81962e8 --- /dev/null +++ b/include/svx/sdggaitm.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_SVX_SDGGAITM_HXX +#define INCLUDED_SVX_SDGGAITM_HXX + +#include +#include +#include + + +// SdrGrafGamma100Item - + + +class SVXCORE_DLLPUBLIC SdrGrafGamma100Item : public SfxUInt32Item +{ +public: + + + SdrGrafGamma100Item( sal_uInt32 nGamma100 = 100 ) : SfxUInt32Item( SDRATTR_GRAFGAMMA, nGamma100 ) {} + + virtual SdrGrafGamma100Item* Clone( SfxItemPool* pPool = nullptr ) const override; + + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; +}; + +#endif // INCLUDED_SVX_SDGGAITM_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdgluitm.hxx b/include/svx/sdgluitm.hxx new file mode 100644 index 000000000..886b3cf22 --- /dev/null +++ b/include/svx/sdgluitm.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_SVX_SDGLUITM_HXX +#define INCLUDED_SVX_SDGLUITM_HXX + +#include +#include +#include + + +// SdrGrafLuminanceItem - + + +class SVXCORE_DLLPUBLIC SdrGrafLuminanceItem : public SdrSignedPercentItem +{ +public: + + + SdrGrafLuminanceItem( short nLuminancePercent = 0 ) : SdrSignedPercentItem( + SDRATTR_GRAFLUMINANCE, nLuminancePercent ) {} + + virtual SdrGrafLuminanceItem* Clone( SfxItemPool* pPool = nullptr ) const override; +}; + + +// SdrGrafContrastItem - + + +class SVXCORE_DLLPUBLIC SdrGrafContrastItem : public SdrSignedPercentItem +{ +public: + + + SdrGrafContrastItem( short nContrastPercent = 0 ) : SdrSignedPercentItem( SDRATTR_GRAFCONTRAST, nContrastPercent ) {} + + virtual SdrGrafContrastItem* Clone( SfxItemPool* pPool = nullptr ) const override; +}; + +#endif // INCLUDED_SVX_SDGLUITM_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdgmoitm.hxx b/include/svx/sdgmoitm.hxx new file mode 100644 index 000000000..e04872ff9 --- /dev/null +++ b/include/svx/sdgmoitm.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_SVX_SDGMOITM_HXX +#define INCLUDED_SVX_SDGMOITM_HXX + +#include +#include +#include +#include + +// MSVC hack: +class SAL_DLLPUBLIC_RTTI SdrGrafModeItem_Base: public SfxEnumItem { +protected: + SdrGrafModeItem_Base(GraphicDrawMode eMode): + SfxEnumItem(SDRATTR_GRAFMODE, eMode) {} +}; + +class SVXCORE_DLLPUBLIC SdrGrafModeItem : public SdrGrafModeItem_Base +{ +public: + SdrGrafModeItem( GraphicDrawMode eMode = GraphicDrawMode::Standard ) : SdrGrafModeItem_Base( eMode ) {} + + virtual SdrGrafModeItem* Clone( SfxItemPool* pPool = nullptr ) const override; + virtual sal_uInt16 GetValueCount() const override; + + static OUString GetValueTextByPos( sal_uInt16 nPos ); + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString& rText, const IntlWrapper& ) const override; +}; + +#endif // INCLUDED_SVX_SDGMOITM_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdmetitm.hxx b/include/svx/sdmetitm.hxx new file mode 100644 index 000000000..8abecbad3 --- /dev/null +++ b/include/svx/sdmetitm.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_SVX_SDMETITM_HXX +#define INCLUDED_SVX_SDMETITM_HXX + +#include +#include + + +// class SdrAngleItem +// For all metrics. GetPresentation returns for example for +// Value=2500 a "25mm". + +class SVXCORE_DLLPUBLIC SdrMetricItem: public SfxInt32Item { +public: + SdrMetricItem(sal_uInt16 nId, sal_Int32 nVal): SfxInt32Item(nId,nVal) {} + virtual SdrMetricItem* Clone(SfxItemPool* pPool=nullptr) const override; + virtual bool HasMetrics() const override; + virtual void ScaleMetrics(long nMul, long nDiv) override; + + virtual bool GetPresentation(SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString& rText, const IntlWrapper&) const override; +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdooitm.hxx b/include/svx/sdooitm.hxx new file mode 100644 index 000000000..a0e7cfe57 --- /dev/null +++ b/include/svx/sdooitm.hxx @@ -0,0 +1,43 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_SDOOITM_HXX +#define INCLUDED_SVX_SDOOITM_HXX + +#include +#include + + +// class SdrOnOffItem +// here GetValueTextByVal() returns "on" or "off" instead +// of "TRUE" or "FALSE" + +class SVXCORE_DLLPUBLIC SdrOnOffItem: public SfxBoolItem { +public: + SdrOnOffItem(sal_uInt16 nId, bool bOn): SfxBoolItem(nId,bOn) {} + virtual SdrOnOffItem* Clone(SfxItemPool* pPool=nullptr) const override; + + virtual OUString GetValueTextByVal(bool bVal) const override; + + virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString& rText, const IntlWrapper&) const override; +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdprcitm.hxx b/include/svx/sdprcitm.hxx new file mode 100644 index 000000000..af5cb65d8 --- /dev/null +++ b/include/svx/sdprcitm.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_SVX_SDPRCITM_HXX +#define INCLUDED_SVX_SDPRCITM_HXX + +#include +#include +#include + + +// class SdrPercentItem +// Integer percents of 0 + + +class SVXCORE_DLLPUBLIC SdrPercentItem : public SfxUInt16Item +{ +public: + SdrPercentItem(sal_uInt16 nId, sal_uInt16 nVal): SfxUInt16Item(nId,nVal) {} + virtual SdrPercentItem* Clone(SfxItemPool* pPool=nullptr) const override; + + virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString& rText, const IntlWrapper&) const override; +}; + + +// class SdrSignedPercentItem +// Integer percents of +/- + + +class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) SdrSignedPercentItem : public SfxInt16Item +{ +public: + SdrSignedPercentItem( sal_uInt16 nId, sal_Int16 nVal ) : SfxInt16Item( nId,nVal ) {} + virtual SdrSignedPercentItem* Clone( SfxItemPool* pPool = nullptr ) const override; + + virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString& rText, const IntlWrapper&) const override; +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/animation/animationstate.hxx b/include/svx/sdr/animation/animationstate.hxx new file mode 100644 index 000000000..fb1974064 --- /dev/null +++ b/include/svx/sdr/animation/animationstate.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_SVX_SDR_ANIMATION_ANIMATIONSTATE_HXX +#define INCLUDED_SVX_SDR_ANIMATION_ANIMATIONSTATE_HXX + +#include +#include +#include + +namespace sdr +{ + namespace contact + { + class ViewObjectContact; + } // end of namespace contact +} + +namespace sdr +{ + namespace animation + { + class PrimitiveAnimation final : public Event + { + // the animated VOC + sdr::contact::ViewObjectContact& mrVOContact; + + // the vetor of animated primitives + drawinglayer::primitive2d::Primitive2DContainer maAnimatedPrimitives; + + // local helpers + double getSmallestNextTime(double fCurrentTime); + void prepareNextEvent(); + + public: + // basic constructor. + PrimitiveAnimation(sdr::contact::ViewObjectContact& rVOContact, const drawinglayer::primitive2d::Primitive2DContainer& rAnimatedPrimitives); + + // destructor + virtual ~PrimitiveAnimation() override; + + // execute event, from base class Event + virtual void Trigger(sal_uInt32 nTime) override; + }; + } // end of namespace animation +} // end of namespace sdr + +#endif // INCLUDED_SVX_SDR_ANIMATION_ANIMATIONSTATE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/animation/objectanimator.hxx b/include/svx/sdr/animation/objectanimator.hxx new file mode 100644 index 000000000..fca03a854 --- /dev/null +++ b/include/svx/sdr/animation/objectanimator.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_SVX_SDR_ANIMATION_OBJECTANIMATOR_HXX +#define INCLUDED_SVX_SDR_ANIMATION_OBJECTANIMATOR_HXX + +#include +#include + + +namespace sdr +{ + namespace animation + { + class primitiveAnimator final : public Scheduler + { + public: + // basic constructor and destructor + primitiveAnimator(); + UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) virtual ~primitiveAnimator() override; + }; + } // end of namespace animation +} // end of namespace sdr + + +#endif // INCLUDED_SVX_SDR_ANIMATION_OBJECTANIMATOR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/animation/scheduler.hxx b/include/svx/sdr/animation/scheduler.hxx new file mode 100644 index 000000000..43666f398 --- /dev/null +++ b/include/svx/sdr/animation/scheduler.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_SVX_SDR_ANIMATION_SCHEDULER_HXX +#define INCLUDED_SVX_SDR_ANIMATION_SCHEDULER_HXX + +#include +#include +#include +#include + + +namespace sdr +{ + namespace animation + { + + class SVXCORE_DLLPUBLIC Event + { + // time of event in ms + sal_uInt32 mnTime; + + public: + // constructor/destructor + SAL_DLLPRIVATE explicit Event(); + virtual ~Event(); + + // get/set time + SAL_DLLPRIVATE sal_uInt32 GetTime() const { return mnTime; } + void SetTime(sal_uInt32 nNew); + + // execute event + virtual void Trigger(sal_uInt32 nTime) = 0; + }; + + class SVXCORE_DLLPUBLIC Scheduler : public Timer + { + // time in ms + sal_uInt32 mnTime; + + // next delta time + sal_uInt32 mnDeltaTime; + + // list of events, sorted by time + std::vector mvEvents; + + // Flag which remembers if this timer is paused. Default + // is false. + bool mbIsPaused; + + public: + // constructor/destructor + SAL_DLLPRIVATE Scheduler(); + virtual ~Scheduler() override; + + // From baseclass Timer, the timeout call + virtual void Invoke() override; + + // get time + SAL_DLLPRIVATE sal_uInt32 GetTime() const { return mnTime; } + + // #i38135# + SAL_DLLPRIVATE void SetTime(sal_uInt32 nTime); + + // execute all ripe events, removes executed ones from the scheduler + SAL_DLLPRIVATE void triggerEvents(); + + // re-start or stop timer according to event list + SAL_DLLPRIVATE void checkTimeout(); + + // insert/remove events, wrapper to EventList methods + void InsertEvent(Event& rNew); + SAL_DLLPRIVATE void RemoveEvent(Event* pOld); + + // get/set pause + SAL_DLLPRIVATE bool IsPaused() const { return mbIsPaused; } + SAL_DLLPRIVATE void SetPaused(bool bNew); + }; + + } // end of namespace animation +} // end of namespace sdr + + +#endif // INCLUDED_SVX_SDR_ANIMATION_SCHEDULER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/attribute/sdrallfillattributeshelper.hxx b/include/svx/sdr/attribute/sdrallfillattributeshelper.hxx new file mode 100644 index 000000000..01d9a37c1 --- /dev/null +++ b/include/svx/sdr/attribute/sdrallfillattributeshelper.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_SVX_SDR_ATTRIBUTE_SDRALLFILLATTRIBUTESHELPER_HXX +#define INCLUDED_SVX_SDR_ATTRIBUTE_SDRALLFILLATTRIBUTESHELPER_HXX + +#include +#include +#include +#include +#include +#include + +////////////////////////////////////////////////////////////////////////////// + +class Color; + +namespace drawinglayer +{ + namespace attribute + { + class SVXCORE_DLLPUBLIC SdrAllFillAttributesHelper + { + private: + basegfx::B2DRange maLastPaintRange; + basegfx::B2DRange maLastDefineRange; + std::shared_ptr< drawinglayer::attribute::SdrFillAttribute > maFillAttribute; + std::shared_ptr< drawinglayer::attribute::FillGradientAttribute > maFillGradientAttribute; + drawinglayer::primitive2d::Primitive2DContainer maPrimitives; + + void createPrimitive2DSequence( + const basegfx::B2DRange& rPaintRange, + const basegfx::B2DRange& rDefineRange); + + public: + SdrAllFillAttributesHelper(const Color& rColor); + SdrAllFillAttributesHelper(const SfxItemSet& rSet); + ~SdrAllFillAttributesHelper(); + + bool isUsed() const; + bool hasSdrFillAttribute() const { return bool(maFillAttribute); } + bool isTransparent() const; + + const drawinglayer::attribute::SdrFillAttribute& getFillAttribute() const; + const drawinglayer::attribute::FillGradientAttribute& getFillGradientAttribute() const; + const drawinglayer::primitive2d::Primitive2DContainer& getPrimitive2DSequence( + const basegfx::B2DRange& rPaintRange, + const basegfx::B2DRange& rDefineRange) const; + + // get average fill color; tries to calculate a 'medium' color + // which e.g. may be used as comparison to decide if other + // colors are visible + basegfx::BColor getAverageColor(const basegfx::BColor& rFallback) const; + + // return if a repaint of this content needs a complete repaint. This + // is e.g. not needed for no fill or color fill (a partial repaint + // will do the trick), but necessary for everything that is not top-left + // oriented + bool needCompleteRepaint() const; + }; + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace attribute + { + typedef std::shared_ptr< SdrAllFillAttributesHelper > SdrAllFillAttributesHelperPtr; + } // end of namespace attribute +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/displayinfo.hxx b/include/svx/sdr/contact/displayinfo.hxx new file mode 100644 index 000000000..4c5842b45 --- /dev/null +++ b/include/svx/sdr/contact/displayinfo.hxx @@ -0,0 +1,107 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SDR_CONTACT_DISPLAYINFO_HXX +#define INCLUDED_SVX_SDR_CONTACT_DISPLAYINFO_HXX + +#include +#include +#include +#include + +namespace sdr +{ + namespace contact + { + class SVXCORE_DLLPUBLIC DisplayInfo final + { + // The Layers which shall be processed (visible) + SdrLayerIDSet maProcessLayers; + + // The redraw area, in logical coordinates of OutputDevice. If Region + // is empty, everything needs to be redrawn + vcl::Region maRedrawArea; + + /// only for Writer: current page being painted + basegfx::B2IRectangle m_WriterPageFrame; + + // Internal flag to know when the control layer is painted. Default is + // false. If set to true, painting of the page, page borders and + // the rasters will be suppressed as if mbPageProcessingActive is set (see there). + // This flag is set internally from the processing mechanism to avoid double page + // painting when the control layer needs to be painted as last layer + bool mbControlLayerProcessingActive : 1; + + // Internal flag to decide if page stuff (background, border, MasterPage, grid, etc...) + // will be processed at all. This flag is user-defined and will not be changed from the + // processing mechanism. Default is true, thus set to false if PagePainting should be suppressed. + // For more granular switching page stuff painting on and off, use the according flags at the + // view (->Is*Visible()) + bool mbPageProcessingActive : 1; + + // Internal flag to remember if EnteredGroupDrawMode is active. Default is true + // since this mode starts activated and gets switched off when reaching + // the current group level. Should only be changed by instances which do + // primitive processing + bool mbGhostedDrawModeActive : 1; + + // Internal flag to know if a MasterPage is processed as SubContent of another + // page. Initialized to false, this should only be changed from the instance which + // is processing the MasterPage asSubContent and knows what it does + bool mbSubContentActive : 1; + + public: + // basic constructor. + DisplayInfo(); + + // access to ProcessLayers + void SetProcessLayers(const SdrLayerIDSet& rSet); + const SdrLayerIDSet& GetProcessLayers() const { return maProcessLayers; } + + // access to RedrawArea + void SetRedrawArea(const vcl::Region& rRegion); + const vcl::Region& GetRedrawArea() const { return maRedrawArea; } + + void SetWriterPageFrame(basegfx::B2IRectangle const& rPageFrame); + basegfx::B2IRectangle const& GetWriterPageFrame() const { return m_WriterPageFrame; } + + // Access to ControlLayerProcessingActive flag + void SetControlLayerProcessingActive(bool bDoPaint); + bool GetControlLayerProcessingActive() const { return mbControlLayerProcessingActive; } + + // Access to PageProcessingActive flag + void SetPageProcessingActive(bool bDoPaint); + bool GetPageProcessingActive() const { return mbPageProcessingActive; } + + // Save the original DrawMode from outdev + void ClearGhostedDrawMode(); + void SetGhostedDrawMode(); + bool IsGhostedDrawModeActive() const { return mbGhostedDrawModeActive; } + + // access to master page painting flag + bool GetSubContentActive() const { return mbSubContentActive; } + void SetSubContentActive(bool bNew); + }; + } // end of namespace contact +} // end of namespace sdr + + +#endif // INCLUDED_SVX_SDR_CONTACT_DISPLAYINFO_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/objectcontact.hxx b/include/svx/sdr/contact/objectcontact.hxx new file mode 100644 index 000000000..6d5d63a27 --- /dev/null +++ b/include/svx/sdr/contact/objectcontact.hxx @@ -0,0 +1,175 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SDR_CONTACT_OBJECTCONTACT_HXX +#define INCLUDED_SVX_SDR_CONTACT_OBJECTCONTACT_HXX + +#include +#include +#include +#include + +class SdrLayerIDSet; +namespace tools { class Rectangle; } +class SdrPageView; +class OutputDevice; + +namespace basegfx { + class B2DRange; + class B2DHomMatrix; +} + +namespace sdr::contact { + +class DisplayInfo; +class ViewContact; +class ViewObjectContactRedirector; + +class SVXCORE_DLLPUBLIC ObjectContact +{ +private: + // make ViewObjectContact a friend to exclusively allow it to use + // AddViewObjectContact/RemoveViewObjectContact + friend class ViewObjectContact; + + // All VOCs which are created using this OC, thus remembering this OC + // as a reference. All those VOCs need to be deleted when the OC goes down. + // Registering and de-registering is done in the VOC constructors/destructors. + std::vector< ViewObjectContact* > maViewObjectContactVector; + + // A new ViewObjectContact was created and shall be remembered. + void AddViewObjectContact(ViewObjectContact& rVOContact); + + // A ViewObjectContact was deleted and shall be forgotten. + void RemoveViewObjectContact(ViewObjectContact& rVOContact); + + // the primitiveAnimator which is used if this View and/or the contained primitives + // support animatedSwitchPrimitives + sdr::animation::primitiveAnimator maPrimitiveAnimator; + + // The redirector. If set it is used to pipe all supported calls + // to the redirector + ViewObjectContactRedirector* mpViewObjectContactRedirector; + + // the Primitive2DParameters containing view information + drawinglayer::geometry::ViewInformation2D maViewInformation2D; + + // flag for preview renderer + bool mbIsPreviewRenderer : 1; + +protected: + // Interface to allow derivates to travel over the registered VOC's + sal_uInt32 getViewObjectContactCount() const { return maViewObjectContactVector.size(); } + ViewObjectContact* getViewObjectContact(sal_uInt32 a) const { return maViewObjectContactVector[a]; } + + // interface to allow derivates to set PreviewRenderer flag + void setPreviewRenderer(bool bNew) { mbIsPreviewRenderer = bNew; } + + // interface to allow derivates to set ViewInformation2D + void updateViewInformation2D(const drawinglayer::geometry::ViewInformation2D& rViewInformation2D) { maViewInformation2D = rViewInformation2D; } + +public: + // basic constructor + ObjectContact(); + virtual ~ObjectContact() COVERITY_NOEXCEPT_FALSE; + + // LazyInvalidate request. This is used from the VOCs to mark that they + // got invalidated by an ActionChanged() call. An active view needs to remember + // this and take action on it. Default implementation directly calls back + // triggerLazyInvalidate() which promptly handles the request + virtual void setLazyInvalidate(ViewObjectContact& rVOC); + + // call this to support evtl. preparations for repaint. Default does nothing + virtual void PrepareProcessDisplay(); + + // Process the whole displaying + virtual void ProcessDisplay(DisplayInfo& rDisplayInfo); + + // test if visualizing of entered groups is switched on at all. Default + // implementation returns sal_False. + virtual bool DoVisualizeEnteredGroup() const; + + // get active group's (the entered group) ViewContact + virtual const ViewContact* getActiveViewContact() const; + + // Invalidate given rectangle at the window/output which is represented by + // this ObjectContact. Default does nothing. + virtual void InvalidatePartOfView(const basegfx::B2DRange& rRange) const; + + // Get info about the need to visualize GluePoints. The default + // is that it is not necessary. + virtual bool AreGluePointsVisible() const; + + // method to get the primitiveAnimator + sdr::animation::primitiveAnimator& getPrimitiveAnimator() { return maPrimitiveAnimator; } + + // check if text animation is allowed. Default is sal_true. + virtual bool IsTextAnimationAllowed() const; + + // check if graphic animation is allowed. Default is sal_true. + virtual bool IsGraphicAnimationAllowed() const; + + // access to ViewObjectContactRedirector + ViewObjectContactRedirector* GetViewObjectContactRedirector() const { return mpViewObjectContactRedirector; } + void SetViewObjectContactRedirector(ViewObjectContactRedirector* pNew); + + // print? Default is false + virtual bool isOutputToPrinter() const; + + // recording MetaFile? Default is false + virtual bool isOutputToRecordingMetaFile() const; + + // pdf export? Default is false + virtual bool isOutputToPDFFile() const; + + // gray display mode + virtual bool isDrawModeGray() const; + + // high contrast display mode + virtual bool isDrawModeHighContrast() const; + + // check if this is a preview renderer. Default is sal_False. + bool IsPreviewRenderer() const { return mbIsPreviewRenderer; } + + // get Primitive2DParameters for this view + const drawinglayer::geometry::ViewInformation2D& getViewInformation2D() const { return maViewInformation2D; } + + /// access to SdrPageView. May return 0L like the default implementations do. Override as needed. + virtual SdrPageView* TryToGetSdrPageView() const; + + /// access to OutputDevice. May return 0L like the default implementations do. Override as needed. + virtual OutputDevice* TryToGetOutputDevice() const; + + // interface to support GridOffset for non-linear ViewToDevice transformation (calc) + virtual bool supportsGridOffsets() const; + virtual void calculateGridOffsetForViewOjectContact( + basegfx::B2DVector& rTarget, + const ViewObjectContact& rClient) const; + virtual void calculateGridOffsetForB2DRange( + basegfx::B2DVector& rTarget, + const basegfx::B2DRange& rB2DRange) const; + void resetAllGridOffsets(); +}; + +} + + +#endif // INCLUDED_SVX_SDR_CONTACT_OBJECTCONTACT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/objectcontactofpageview.hxx b/include/svx/sdr/contact/objectcontactofpageview.hxx new file mode 100644 index 000000000..c3f4ef9d3 --- /dev/null +++ b/include/svx/sdr/contact/objectcontactofpageview.hxx @@ -0,0 +1,120 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_INC_SDR_CONTACT_OBJECTCONTACTOFPAGEVIEW_HXX +#define INCLUDED_SVX_INC_SDR_CONTACT_OBJECTCONTACTOFPAGEVIEW_HXX + +#include +#include + +class SdrPageWindow; +class SdrPage; + +namespace sdr +{ + namespace contact + { + class SVXCORE_DLLPUBLIC ObjectContactOfPageView : public ObjectContact, public Idle + { + // the owner of this ObjectContactOfPageView. Set from constructor and not + // to be changed in any way. + SdrPageWindow& mrPageWindow; + + // Process the whole displaying, the real version + void DoProcessDisplay(DisplayInfo& rDisplayInfo); + + public: + // access to SdrPageWindow + SdrPageWindow& GetPageWindow() const { return mrPageWindow; } + + // access to SdrPage of PageView + SdrPage* GetSdrPage() const; + + // basic constructor, used from SdrPageView. + explicit ObjectContactOfPageView(SdrPageWindow& rPageWindow, + const char *pDebugName); + virtual ~ObjectContactOfPageView() override; + + // LazyInvalidate request. This is used from the VOCs to mark that they + // got invalidated by an ActionChanged() call. An active view needs to remember + // this and take action on it. Default implementation directly calls back + // triggerLazyInvalidate() which promptly handles the request + virtual void setLazyInvalidate(ViewObjectContact& rVOC) override; + + // call this to support evtl. preparations for repaint + virtual void PrepareProcessDisplay() override; + + // From baseclass Timer, the timeout call triggered by the LazyInvalidate mechanism + virtual void Invoke() final override; + + // Process the whole displaying + virtual void ProcessDisplay(DisplayInfo& rDisplayInfo) override; + + // test if visualizing of entered groups is switched on at all + virtual bool DoVisualizeEnteredGroup() const override; + + // get active group's (the entered group) ViewContact + virtual const ViewContact* getActiveViewContact() const override; + + // Invalidate given rectangle at the window/output which is represented by + // this ObjectContact. + virtual void InvalidatePartOfView(const basegfx::B2DRange& rRange) const override; + + // Get info about the need to visualize GluePoints. The default + // is that it is not necessary. + virtual bool AreGluePointsVisible() const override; + + // check if text animation is allowed. + virtual bool IsTextAnimationAllowed() const override; + + // check if graphic animation is allowed. + virtual bool IsGraphicAnimationAllowed() const override; + + // print? Default is false + virtual bool isOutputToPrinter() const override; + + // recording MetaFile? Default is false + virtual bool isOutputToRecordingMetaFile() const override; + + // pdf export? Default is false + virtual bool isOutputToPDFFile() const override; + + // gray display mode + virtual bool isDrawModeGray() const override; + + // high contrast display mode + virtual bool isDrawModeHighContrast() const override; + + // override access to SdrPageView + virtual SdrPageView* TryToGetSdrPageView() const override; + + // access to OutputDevice. May return 0L like the default implementations do. Override as needed. + virtual OutputDevice* TryToGetOutputDevice() const override; + + /** sets all UNO controls which are associated with this ObjectContact to + design or alive mode. + */ + void SetUNOControlsDesignMode( bool _bDesignMode ) const; + }; + } // end of namespace contact +} // end of namespace sdr + +#endif // INCLUDED_SVX_INC_SDR_CONTACT_OBJECTCONTACTOFPAGEVIEW_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewcontact.hxx b/include/svx/sdr/contact/viewcontact.hxx new file mode 100644 index 000000000..c3e9328d9 --- /dev/null +++ b/include/svx/sdr/contact/viewcontact.hxx @@ -0,0 +1,148 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SDR_CONTACT_VIEWCONTACT_HXX +#define INCLUDED_SVX_SDR_CONTACT_VIEWCONTACT_HXX + +#include +#include +#include + +class SdrLayerIDSet; +class SdrPage; +class SdrObject; + +namespace sdr::contact { + +class ObjectContact; +class ViewObjectContact; + +class SVXCORE_DLLPUBLIC ViewContact +{ +private: + // make ViewObjectContact a friend to exclusively allow it to use + // AddViewObjectContact/RemoveViewObjectContact + friend class ViewObjectContact; + + // List of ViewObjectContacts. This contains all VOCs which were constructed + // with this VC. Since the VOCs remember a reference to this VC, this list needs + // to be kept and is used e.g. at destructor to destroy all VOCs. + // Registering and de-registering is done in the VOC constructors/destructors. + std::vector< ViewObjectContact* > maViewObjectContactVector; + + // Primitive2DContainer of the ViewContact. This contains all necessary information + // for the graphical visualisation and needs to be supported by all VCs which + // can be visualized. + drawinglayer::primitive2d::Primitive2DContainer mxViewIndependentPrimitive2DSequence; + + // A new ViewObjectContact was created and shall be remembered. + void AddViewObjectContact(ViewObjectContact& rVOContact); + + // A ViewObjectContact was deleted and shall be forgotten. + void RemoveViewObjectContact(ViewObjectContact& rVOContact); + + // internal tooling to delete VOCs + void deleteAllVOCs(); + +protected: + // Interface to allow derivates to travel over the registered VOC's + sal_uInt32 getViewObjectContactCount() const { return maViewObjectContactVector.size(); } + ViewObjectContact* getViewObjectContact(sal_uInt32 a) const { return maViewObjectContactVector[a]; } + + // Create an Object-Specific ViewObjectContact, set ViewContact and + // ObjectContact. Always needs to return something. Default is to create + // a standard ViewObjectContact containing the given ObjectContact and *this + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact); + + // This method is responsible for creating the graphical visualisation data derived ONLY from + // the model data. It will be stored/buffered in mxViewIndependentPrimitive2DSequence. The default implementation + // creates a yellow replacement rectangle (1000, 1000, 5000, 3000) to visualize missing + // implementations. All implementations have to provide basic geometry here, this is the central + // visualisation method and will also be used for BoundRect computations in the long run. + // This means it's always an error when the default implementation is called and thus gets + // asserted there + virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const; + + // basic constructor. Since this is a base class only, it shall + // never be called directly + ViewContact(); + +public: + // basic destructor with needed cleanups + virtual ~ViewContact(); + + // get an Object-specific ViewObjectContact for a specific + // ObjectContact (->View). Always needs to return something. + ViewObjectContact& GetViewObjectContact(ObjectContact& rObjectContact); + + // Test if this ViewContact has ViewObjectContacts(excluding previews) at all. This can + // be used to test if this ViewContact is visualized ATM or not + bool HasViewObjectContacts() const; + + // Check if this primitive is animated in any OC (View) which means it has + // generated a PrimitiveAnimation in its VOC + bool isAnimatedInAnyViewObjectContact() const; + + // Access to possible sub-hierarchy and parent. GetObjectCount() default is 0L + // and GetViewContact default pops up an assert since it's an error if + // GetObjectCount has a result != 0 and it's not overridden. + virtual sal_uInt32 GetObjectCount() const; + virtual ViewContact& GetViewContact(sal_uInt32 nIndex) const; + virtual ViewContact* GetParentContact() const; + + // React on insertion of a child into DRawHierarchy starting + // from this object + void ActionChildInserted(ViewContact& rChild); + + // access to SdrObject. May return 0L like the default + // implementations do. Override as needed. + virtual SdrObject* TryToGetSdrObject() const; + + // React on changes of the object of this ViewContact + virtual void ActionChanged(); + + // access to the local primitive. This will ensure that the primitive is + // current in comparing the local one with a fresh created incarnation + drawinglayer::primitive2d::Primitive2DContainer const & getViewIndependentPrimitive2DContainer() const; + + // add Gluepoints (if available) + virtual drawinglayer::primitive2d::Primitive2DContainer createGluePointPrimitive2DSequence() const; + + // Allow embedding if needed (e.g. for SdrObjects, evtl. Name, Title and description get added). This + // is a helper normally used from getViewIndependentPrimitive2DContainer(), but there is one exception + // for 3D scenes. + // We take the param by value, since, for the common case, we can just std::move into the param, and + // std::move the result out, avoiding copying. + virtual drawinglayer::primitive2d::Primitive2DContainer embedToObjectSpecificInformation(drawinglayer::primitive2d::Primitive2DContainer rSource) const; + + virtual basegfx::B2DRange getRange( const drawinglayer::geometry::ViewInformation2D& rViewInfo2D ) const; + + // delete all existing VOCs including DrawHierarchy which will invalidate all + // visualisations, too. Used mostly at object removal from DrawHierarchy to + // delete all existing VOCs by purpose, but can also be used for other purposes. + // It is always possible to delete the VOCs, these are re-created on demand + void flushViewObjectContacts(bool bWithHierarchy = true); +}; + +} + + +#endif // INCLUDED_SVX_SDR_CONTACT_VIEWCONTACT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewcontactofe3dscene.hxx b/include/svx/sdr/contact/viewcontactofe3dscene.hxx new file mode 100644 index 000000000..b26e272f9 --- /dev/null +++ b/include/svx/sdr/contact/viewcontactofe3dscene.hxx @@ -0,0 +1,103 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SDR_CONTACT_VIEWCONTACTOFE3DSCENE_HXX +#define INCLUDED_SVX_SDR_CONTACT_VIEWCONTACTOFE3DSCENE_HXX + +#include +#include +#include +#include +#include +#include +#include + +namespace basegfx { + class B3DRange; +} + +namespace sdr::contact { + +class SVXCORE_DLLPUBLIC ViewContactOfE3dScene final : public ViewContactOfSdrObj +{ +public: + // basic constructor, used from SdrObject. + explicit ViewContactOfE3dScene(E3dScene& rScene); + + // access to SdrObject + const E3dScene& GetE3dScene() const + { + return static_cast(GetSdrObject()); + } + + // React on changes of the object of this ViewContact + virtual void ActionChanged() override; + + // access to ViewInformation3D and ObjectTransformation + const drawinglayer::geometry::ViewInformation3D& getViewInformation3D(const ::basegfx::B3DRange& rContentRange) const; + const drawinglayer::geometry::ViewInformation3D& getViewInformation3D() const; + const basegfx::B2DHomMatrix& getObjectTransformation() const; + + // attribute providers + const drawinglayer::attribute::SdrSceneAttribute& getSdrSceneAttribute() const; + const drawinglayer::attribute::SdrLightingAttribute& getSdrLightingAttribute() const; + + // scene primitive creators. If pLayerVisibility is given, a visibility test with the LayerID and the + // given SdrLayerIDSet is done. + drawinglayer::primitive2d::Primitive2DContainer createScenePrimitive2DSequence(const SdrLayerIDSet* pLayerVisibility) const; + + // helpers to get the sequence of all contained 3D primitives and its range, + // regardless of layer or visibility constraints and using a neutral ViewInformation3D + drawinglayer::primitive3d::Primitive3DContainer getAllPrimitive3DContainer() const; + basegfx::B3DRange getAllContentRange3D() const; + +private: + // Create an Object-Specific ViewObjectContact, set ViewContact and + // ObjectContact. Always needs to return something. Default is to create + // a standard ViewObjectContact containing the given ObjectContact and *this + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override; + + // create methods for ViewInformation3D and ObjectTransformation + void createViewInformation3D(const ::basegfx::B3DRange& rContentRange); + void createObjectTransformation(); + + // attribute creators + void createSdrSceneAttribute(); + void createSdrLightingAttribute(); + + // This method is responsible for creating the graphical visualisation data + // ONLY based on model data + virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override; + + // the 3d transformation stack + drawinglayer::geometry::ViewInformation3D maViewInformation3D; + + // the object transformation + basegfx::B2DHomMatrix maObjectTransformation; + + // attributes + drawinglayer::attribute::SdrSceneAttribute maSdrSceneAttribute; + drawinglayer::attribute::SdrLightingAttribute maSdrLightingAttribute; +}; + +} + +#endif // INCLUDED_SVX_SDR_CONTACT_VIEWCONTACTOFE3DSCENE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewcontactofsdrmediaobj.hxx b/include/svx/sdr/contact/viewcontactofsdrmediaobj.hxx new file mode 100644 index 000000000..cb2953200 --- /dev/null +++ b/include/svx/sdr/contact/viewcontactofsdrmediaobj.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_SVX_SDR_CONTACT_VIEWCONTACTOFSDRMEDIAOBJ_HXX +#define INCLUDED_SVX_SDR_CONTACT_VIEWCONTACTOFSDRMEDIAOBJ_HXX + +#include +#include +#include +#include + +namespace avmedia { class MediaItem; } + +namespace sdr::contact { + +class SVXCORE_DLLPUBLIC ViewContactOfSdrMediaObj : public ViewContactOfSdrObj +{ + friend class ViewObjectContactOfSdrMediaObj; + +public: + + // basic constructor, used from SdrObject. + explicit ViewContactOfSdrMediaObj( SdrMediaObj& rMediaObj ); + virtual ~ViewContactOfSdrMediaObj() override; + +public: + + // access to SdrMediaObj + const SdrMediaObj& GetSdrMediaObj() const + { + return static_cast(GetSdrObject()); + } + + Size getPreferredSize() const; + + void updateMediaItem( ::avmedia::MediaItem& rItem ) const; + void executeMediaItem( const ::avmedia::MediaItem& rItem ); + +protected: + + // Create an Object-Specific ViewObjectContact, set ViewContact and + // ObjectContact. Always needs to return something. + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override; + + // get notified if some properties have changed + void mediaPropertiesChanged( const ::avmedia::MediaItem& rNewState ); + +protected: + // This method is responsible for creating the graphical visualisation data + // ONLY based on model data + virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override; +}; + +} + + +#endif // INCLUDED_SVX_SDR_CONTACT_VIEWCONTACTOFSDRMEDIAOBJ_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewcontactofsdrobj.hxx b/include/svx/sdr/contact/viewcontactofsdrobj.hxx new file mode 100644 index 000000000..a20dde7bb --- /dev/null +++ b/include/svx/sdr/contact/viewcontactofsdrobj.hxx @@ -0,0 +1,87 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SDR_CONTACT_VIEWCONTACTOFSDROBJ_HXX +#define INCLUDED_SVX_SDR_CONTACT_VIEWCONTACTOFSDROBJ_HXX + +#include +#include +#include +#include + +class SdrObject; +class GeoStat; +class Bitmap; + +namespace sdr::contact { + +class SVXCORE_DLLPUBLIC ViewContactOfSdrObj : public ViewContact +{ +protected: + // the owner of this ViewContact. Set from constructor and not + // to be changed in any way. + SdrObject& mrObject; + + // Remember AnimationKind of object. Used to find out if that kind + // has changed in ActionChanged() + SdrTextAniKind meRememberedAnimationKind; + + // Create an Object-Specific ViewObjectContact, set ViewContact and + // ObjectContact. Always needs to return something. + virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override; + +public: + // access to SdrObject + SdrObject& GetSdrObject() const + { + return mrObject; + } + + // basic constructor, used from SdrObject. + explicit ViewContactOfSdrObj(SdrObject& rObj); + virtual ~ViewContactOfSdrObj() override; + + // Access to possible sub-hierarchy + virtual sal_uInt32 GetObjectCount() const override; + virtual ViewContact& GetViewContact(sal_uInt32 nIndex) const override; + virtual ViewContact* GetParentContact() const override; + + // React on changes of the object of this ViewContact + virtual void ActionChanged() override; + + /// override for accessing the SdrObject + virtual SdrObject* TryToGetSdrObject() const override; + + + // primitive stuff + + // add Gluepoints (if available) + virtual drawinglayer::primitive2d::Primitive2DContainer createGluePointPrimitive2DSequence() const override; + + // allow embedding if needed (e.g. for SdrObjects, evtl. Name, Title and description get added). This + // is a helper normally used from getViewIndependentPrimitive2DContainer(), but there is one exception + // for 3D scenes + virtual drawinglayer::primitive2d::Primitive2DContainer embedToObjectSpecificInformation(drawinglayer::primitive2d::Primitive2DContainer aSource) const override; +}; + +} + +#endif // INCLUDED_SVX_SDR_CONTACT_VIEWCONTACTOFSDROBJ_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewcontactofvirtobj.hxx b/include/svx/sdr/contact/viewcontactofvirtobj.hxx new file mode 100644 index 000000000..f1374c7fb --- /dev/null +++ b/include/svx/sdr/contact/viewcontactofvirtobj.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_SVX_SDR_CONTACT_VIEWCONTACTOFVIRTOBJ_HXX +#define INCLUDED_SVX_SDR_CONTACT_VIEWCONTACTOFVIRTOBJ_HXX + +#include + +class SdrVirtObj; + +namespace sdr::contact { + +class SVXCORE_DLLPUBLIC ViewContactOfVirtObj : public ViewContactOfSdrObj +{ +protected: + // internal access to SdrObject. Implementation in *.cxx to avoid + // including SdrVirtObj here. + SdrVirtObj& GetVirtObj() const; + +public: + // basic constructor, used from SdrObject. + explicit ViewContactOfVirtObj(SdrVirtObj& rObj); + virtual ~ViewContactOfVirtObj() override; + + // Access to possible sub-hierarchy + virtual sal_uInt32 GetObjectCount() const override; + +protected: + // This method is responsible for creating the graphical visualisation data + // ONLY based on model data + virtual drawinglayer::primitive2d::Primitive2DContainer createViewIndependentPrimitive2DSequence() const override; +}; + +} + +#endif // INCLUDED_SVX_SDR_CONTACT_VIEWCONTACTOFVIRTOBJ_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewobjectcontact.hxx b/include/svx/sdr/contact/viewobjectcontact.hxx new file mode 100644 index 000000000..9c806aa08 --- /dev/null +++ b/include/svx/sdr/contact/viewobjectcontact.hxx @@ -0,0 +1,138 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SDR_CONTACT_VIEWOBJECTCONTACT_HXX +#define INCLUDED_SVX_SDR_CONTACT_VIEWOBJECTCONTACT_HXX + +#include +#include +#include + +namespace vcl { class Region; } + +namespace sdr::animation { + class PrimitiveAnimation; +} + +namespace sdr::contact { + +class DisplayInfo; +class ObjectContact; +class ViewContact; +class ViewObjectContactRedirector; + +class SVXCORE_DLLPUBLIC ViewObjectContact +{ +private: + // must-exist and constant contacts + ObjectContact& mrObjectContact; + ViewContact& mrViewContact; + + // This range defines the object's BoundRect + basegfx::B2DRange maObjectRange; + + // PrimitiveSequence of the ViewContact. This contains all necessary information + // for the graphical visualisation and needs to be supported by all VCs which + // can be visualized. + drawinglayer::primitive2d::Primitive2DContainer mxPrimitive2DSequence; + + // the PrimitiveAnimation if Primitive2DContainer contains animations + std::unique_ptr mpPrimitiveAnimation; + + // possible on-demand calculated GridOffset for non-linear ViewToDevice transformation (calc) + basegfx::B2DVector maGridOffset; + + // This bool gets set when the object gets invalidated by ActionChanged() and + // can be used from the OC to late-invalidates + bool mbLazyInvalidate : 1; + +protected: + // make redirector a protected friend, it needs to call createPrimitives as default action + friend class ViewObjectContactRedirector; + + // Called from getPrimitive2DSequence() when vector has changed. Evaluate object animation + // and setup accordingly + void checkForPrimitive2DAnimations(); + + // This method is responsible for creating the graphical visualisation data which is + // stored/cached in the local primitive. Default gets view-independent Primitive + // from the ViewContact using ViewContact::getViewIndependentPrimitive2DContainer(), takes care of + // visibility, handles glue and ghosted. + // This method will not handle included hierarchies and not check geometric visibility. + virtual drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const; + + // method for flushing Primitive2DContainer for VOC implementations + void flushPrimitive2DSequence() { mxPrimitive2DSequence.clear(); } + +public: + // basic constructor. + ViewObjectContact(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContact(); + + // access to ObjectContact + ObjectContact& GetObjectContact() const { return mrObjectContact; } + + // access to ViewContact + ViewContact& GetViewContact() const { return mrViewContact; } + + // get the object size range + const basegfx::B2DRange& getObjectRange() const; + + // React on changes of the object of this ViewContact + virtual void ActionChanged(); + + // LazyInvalidate handling + void triggerLazyInvalidate(); + + // Check if this primitive is animated in any OC (View) which means it has + // generated a PrimitiveAnimation + bool isAnimated() const { return (nullptr != mpPrimitiveAnimation); } + + // Take some action when new objects are inserted + void ActionChildInserted(ViewContact& rChild); + + // access to the local primitive. This will ensure that the local primitive is + // current in comparing the local one with a fresh created incarnation + // This method will not handle included hierarchies and not check visibility. + drawinglayer::primitive2d::Primitive2DContainer const & getPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const; + + // test this VOC for visibility concerning model-view stuff like e.g. Layer + virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const; + + // test this VOC for ghosted mode + virtual bool isPrimitiveGhosted(const DisplayInfo& rDisplayInfo) const; + + // process this primitive: Eventually also recursively travel an existing hierarchy, + // e.g. for group objects, scenes or pages. This method will test geometrical visibility. + virtual drawinglayer::primitive2d::Primitive2DContainer getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const; + + // just process the sub-hierarchy, used as tooling from getPrimitive2DSequenceHierarchy + drawinglayer::primitive2d::Primitive2DContainer getPrimitive2DSequenceSubHierarchy(DisplayInfo& rDisplayInfo) const; + + // interface to support GridOffset for non-linear ViewToDevice transformation (calc) + const basegfx::B2DVector& getGridOffset() const; + void resetGridOffset(); +}; + +} + + +#endif // INCLUDED_SVX_SDR_CONTACT_VIEWOBJECTCONTACT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewobjectcontactofsdrobj.hxx b/include/svx/sdr/contact/viewobjectcontactofsdrobj.hxx new file mode 100644 index 000000000..07e748651 --- /dev/null +++ b/include/svx/sdr/contact/viewobjectcontactofsdrobj.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_SVX_SDR_CONTACT_VIEWOBJECTCONTACTOFSDROBJ_HXX +#define INCLUDED_SVX_SDR_CONTACT_VIEWOBJECTCONTACTOFSDROBJ_HXX + +#include + +class SdrObject; +class SdrLayerIDSet; +class OutputDevice; + +namespace sdr::contact { + +class SVXCORE_DLLPUBLIC ViewObjectContactOfSdrObj : public ViewObjectContact +{ + /** Test whether the primitive is visible on any layer from @c aLayers + + This should be overridden by ViewObjectContacts of SDR classes + that have subparts which can be on different layers (that is, + SdrObjGroup .-) + */ + virtual bool isPrimitiveVisibleOnAnyLayer(const SdrLayerIDSet& aLayers) const; + +protected: + const SdrObject& getSdrObject() const; + +public: + ViewObjectContactOfSdrObj(ObjectContact& rObjectContact, ViewContact& rViewContact); + virtual ~ViewObjectContactOfSdrObj() override; + + virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const override; + + /** retrieves the device which a PageView belongs to, starting from its ObjectContactOfPageView + + Since #i72752#, the PaintWindow (and thus the OutputDevice) associated with a PageView is not + constant over its lifetime. Instead, during some paint operations, the PaintWindow/OutputDevice + might be temporarily patched. + + This method cares for this, by retrieving the very original OutputDevice. + */ + const OutputDevice* getPageViewOutputDevice() const; +}; + +} + +#endif // INCLUDED_SVX_SDR_CONTACT_VIEWOBJECTCONTACTOFSDROBJ_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/contact/viewobjectcontactredirector.hxx b/include/svx/sdr/contact/viewobjectcontactredirector.hxx new file mode 100644 index 000000000..1dc69d238 --- /dev/null +++ b/include/svx/sdr/contact/viewobjectcontactredirector.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_SVX_SDR_CONTACT_VIEWOBJECTCONTACTREDIRECTOR_HXX +#define INCLUDED_SVX_SDR_CONTACT_VIEWOBJECTCONTACTREDIRECTOR_HXX + +#include +#include + +namespace sdr::contact { + +class DisplayInfo; +class ViewObjectContact; + +// This class provides a mechanism to redirect the paint mechanism for all or +// single ViewObjectContacts. An own derivation may be set at single ViewContacts +// or at the ObjectContact for redirecting all. If both is used, the one at single +// objects will have priority. +class SVXCORE_DLLPUBLIC ViewObjectContactRedirector +{ +public: + // basic constructor. + ViewObjectContactRedirector(); + + // The destructor. + virtual ~ViewObjectContactRedirector(); + + // all default implementations just call the same methods at the original. To do something + // different, override the method and at least do what the method does. + virtual drawinglayer::primitive2d::Primitive2DContainer createRedirectedPrimitive2DSequence( + const sdr::contact::ViewObjectContact& rOriginal, + const sdr::contact::DisplayInfo& rDisplayInfo); +}; + +} + +#endif // INCLUDED_SVX_SDR_CONTACT_VIEWOBJECTCONTACTREDIRECTOR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/overlay/overlayanimatedbitmapex.hxx b/include/svx/sdr/overlay/overlayanimatedbitmapex.hxx new file mode 100644 index 000000000..80059b791 --- /dev/null +++ b/include/svx/sdr/overlay/overlayanimatedbitmapex.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_SVX_SDR_OVERLAY_OVERLAYANIMATEDBITMAPEX_HXX +#define INCLUDED_SVX_SDR_OVERLAY_OVERLAYANIMATEDBITMAPEX_HXX + +#include +#include + + +namespace sdr +{ + namespace overlay + { + class SVXCORE_DLLPUBLIC OverlayAnimatedBitmapEx final : public OverlayObjectWithBasePosition + { + // the Bitmaps + BitmapEx maBitmapEx1; + BitmapEx maBitmapEx2; + + // position of the basePosition inside the Bitmaps, in pixels + sal_uInt16 mnCenterX1; + sal_uInt16 mnCenterY1; + sal_uInt16 mnCenterX2; + sal_uInt16 mnCenterY2; + + // #i53216# added CursorBlinkTime (in ms) + sal_uInt32 mnBlinkTime; + + // optional shear and rotation + double mfShearX; + double mfRotation; + + // Flag to remember which state to draw. Inited with false (0) + bool mbOverlayState : 1; + + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DContainer createOverlayObjectPrimitive2DSequence() override; + + public: + OverlayAnimatedBitmapEx( + const basegfx::B2DPoint& rBasePos, + const BitmapEx& rBitmapEx1, + const BitmapEx& rBitmapEx2, + sal_uInt64 nBlinkTime, + sal_uInt16 nCenX1 = 0, + sal_uInt16 nCenY1 = 0, + sal_uInt16 nCenX2 = 0, + sal_uInt16 nCenY2 = 0, + double fShearX = 0.0, + double fRotation = 0.0); + virtual ~OverlayAnimatedBitmapEx() override; + + // execute event from base class sdr::animation::Event. Default + // implementation does nothing and does not create a new event. + virtual void Trigger(sal_uInt32 nTime) override; + + // get shearX and rotation + double getShearX() const { return mfShearX; } + double getRotation() const { return mfRotation; } + }; + } // end of namespace overlay +} // end of namespace sdr + + +#endif // INCLUDED_SVX_SDR_OVERLAY_OVERLAYANIMATEDBITMAPEX_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/overlay/overlaybitmapex.hxx b/include/svx/sdr/overlay/overlaybitmapex.hxx new file mode 100644 index 000000000..fbfce1ee3 --- /dev/null +++ b/include/svx/sdr/overlay/overlaybitmapex.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_SVX_SDR_OVERLAY_OVERLAYBITMAPEX_HXX +#define INCLUDED_SVX_SDR_OVERLAY_OVERLAYBITMAPEX_HXX + +#include +#include + + +namespace sdr +{ + namespace overlay + { + class SVXCORE_DLLPUBLIC OverlayBitmapEx final : public OverlayObjectWithBasePosition + { + // the Bitmap itself + BitmapEx maBitmapEx; + + // position of the basePosition inside the Bitmap, in pixels + sal_uInt16 mnCenterX; + sal_uInt16 mnCenterY; + + // optional transparency, shear and rotation + double mfAlpha; + double mfShearX; + double mfRotation; + + virtual drawinglayer::primitive2d::Primitive2DContainer createOverlayObjectPrimitive2DSequence() override; + + public: + OverlayBitmapEx( + const basegfx::B2DPoint& rBasePos, + const BitmapEx& rBitmapEx, + sal_uInt16 nCenX = 0, + sal_uInt16 nCenY = 0, + double fAlpha = 0.0, + double fShearX = 0.0, + double fRotation = 0.0); + virtual ~OverlayBitmapEx() override; + }; + } // end of namespace overlay +} // end of namespace sdr + + +#endif // INCLUDED_SVX_SDR_OVERLAY_OVERLAYBITMAPEX_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/overlay/overlaymanager.hxx b/include/svx/sdr/overlay/overlaymanager.hxx new file mode 100644 index 000000000..412d45aa3 --- /dev/null +++ b/include/svx/sdr/overlay/overlaymanager.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_SVX_SDR_OVERLAY_OVERLAYMANAGER_HXX +#define INCLUDED_SVX_SDR_OVERLAY_OVERLAYMANAGER_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class OutputDevice; +class SdrModel; +namespace vcl { class Region; } + +namespace sdr::overlay { + class OverlayObject; +} + +namespace basegfx { + class B2DRange; +} + +namespace sdr +{ + namespace overlay + { + class SVXCORE_DLLPUBLIC OverlayManager + : protected sdr::animation::Scheduler + , public salhelper::SimpleReferenceObject + { + private: + OverlayManager(const OverlayManager&) = delete; + OverlayManager& operator=(const OverlayManager&) = delete; + + protected: + // the OutputDevice to work on, set on construction and not to be changed + OutputDevice& mrOutputDevice; + + // the vector of registered OverlayObjects + OverlayObjectVector maOverlayObjects; + + // Stripe support. All striped OverlayObjects use these stripe + // values. Changes change all those objects. + Color maStripeColorA; // defaults to COL_BLACK + Color maStripeColorB; // defaults to COL_WHITE + sal_uInt32 mnStripeLengthPixel; // defaults to 4L + + // hold an incarnation of Drawinglayer configuration options + SvtOptionsDrawinglayer maDrawinglayerOpt; + + // hold buffered the logic length of discrete vector (1.0, 0.0) and the + // view transformation belonging to it. Update happens in getDiscreteOne() + basegfx::B2DHomMatrix maViewTransformation; + drawinglayer::geometry::ViewInformation2D maViewInformation2D; + double mfDiscreteOne; + + // internal + void ImpDrawMembers(const basegfx::B2DRange& rRange, OutputDevice& rDestinationDevice) const; + void ImpStripeDefinitionChanged(); + void impApplyRemoveActions(OverlayObject& rTarget); + void impApplyAddActions(OverlayObject& rTarget); + + // return mfDiscreteOne to derivations, but also check for buffered local + // ViewTransformation and evtl. correct mfDiscreteOne + double getDiscreteOne() const; + + tools::Rectangle RangeToInvalidateRectangle(const basegfx::B2DRange& rRange) const; + + OverlayManager(OutputDevice& rOutputDevice); + virtual ~OverlayManager() override; + + public: + static rtl::Reference create(OutputDevice& rOutputDevice); + + // access to current ViewInformation2D; this call checks and evtl. updates ViewInformation2D + drawinglayer::geometry::ViewInformation2D const & getCurrentViewInformation2D() const; + + // complete redraw + virtual void completeRedraw(const vcl::Region& rRegion, OutputDevice* pPreRenderDevice = nullptr) const; + + // flush. Do buffered updates. + virtual void flush(); + + // get the OutputDevice + OutputDevice& getOutputDevice() const { return mrOutputDevice; } + + // add and remove OverlayObjects + void add(OverlayObject& rOverlayObject); + void remove(OverlayObject& rOverlayObject); + + // invalidate the given range at local OutputDevice + virtual void invalidateRange(const basegfx::B2DRange& rRange); + + // stripe support ColA + const Color& getStripeColorA() const { return maStripeColorA; } + void setStripeColorA(Color aNew); + + // stripe support ColB + const Color& getStripeColorB() const { return maStripeColorB; } + void setStripeColorB(Color aNew); + + // stripe support StripeLengthPixel + sal_uInt32 getStripeLengthPixel() const { return mnStripeLengthPixel; } + void setStripeLengthPixel(sal_uInt32 nNew); + + // access to maDrawinglayerOpt + const SvtOptionsDrawinglayer& getDrawinglayerOpt() const { return maDrawinglayerOpt; } + + void InsertEvent(sdr::animation::Event& rNew) { Scheduler::InsertEvent(rNew); } + }; + } // end of namespace overlay +} // end of namespace sdr + +#endif // INCLUDED_SVX_SDR_OVERLAY_OVERLAYMANAGER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/overlay/overlayobject.hxx b/include/svx/sdr/overlay/overlayobject.hxx new file mode 100644 index 000000000..569d93a25 --- /dev/null +++ b/include/svx/sdr/overlay/overlayobject.hxx @@ -0,0 +1,206 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SDR_OVERLAY_OVERLAYOBJECT_HXX +#define INCLUDED_SVX_SDR_OVERLAY_OVERLAYOBJECT_HXX + +#include +#include +#include +#include +#include +#include + +#include + +class OutputDevice; + +namespace sdr +{ + namespace overlay + { + class OverlayManager; + } // end of namespace overlay +} + +namespace basegfx +{ + class B2DPolygon; + class B2DPolyPolygon; + class B2DRange; +} + +namespace sdr +{ + namespace overlay + { + class SVXCORE_DLLPUBLIC OverlayObject : public sdr::animation::Event + { + private: + OverlayObject(const OverlayObject&) = delete; + OverlayObject& operator=(const OverlayObject&) = delete; + + // Manager is allowed access to private Member mpOverlayManager + friend class OverlayManager; + + // pointer to OverlayManager, if object is added. Changed by + // OverlayManager, do not change Yourself. + OverlayManager* mpOverlayManager; + + // Primitive2DContainer of the OverlayObject + drawinglayer::primitive2d::Primitive2DContainer maPrimitive2DSequence; + + // Possible Offset added to the geometry (automatically in + // createOverlayObjectPrimitive2DSequence()). Usually zero, may + // be used e.g. from calc when GridOffset is needed + basegfx::B2DVector maOffset; + + protected: + // access methods to maPrimitive2DSequence. The usage of this methods may allow + // later thread-safe stuff to be added if needed. Only to be used by getPrimitive2DSequence() + // implementations for buffering the last decomposition. + // Resetting is allowed e.g. in ::getOverlayObjectPrimitive2DSequence() implementations + // if the conditions have changed to force a re-creation in calling the base implementation. + // The only allowed setter of maPrimitive2DSequence is + // OverlayObject::getOverlayObjectPrimitive2DSequence() which should be called by calling + // the base implementation in derived functions. That one will use the result of + // createOverlayObjectPrimitive2DSequence() to provide the geometry. + const drawinglayer::primitive2d::Primitive2DContainer& getPrimitive2DSequence() const { return maPrimitive2DSequence; } + void resetPrimitive2DSequence() { maPrimitive2DSequence.clear(); } + + // the creation method for Primitive2DContainer. Called when getPrimitive2DSequence() + // sees that maPrimitive2DSequence is empty. Needs to be supported by all + // OverlayObject implementations. Default implementation will assert + // a missing implementation + virtual drawinglayer::primitive2d::Primitive2DContainer createOverlayObjectPrimitive2DSequence(); + + // #i53216# check blink time value range (currently 25 < mnBlinkTime < 10000) + static sal_uInt32 impCheckBlinkTimeValueRange(sal_uInt64 nBlinkTime); + + // region in logical coordinates + basegfx::B2DRange maBaseRange; + + // base color of this OverlayObject + Color maBaseColor; + + // Flag for visibility + bool mbIsVisible : 1; + + // Flag to control hittability + bool mbIsHittable : 1; + + // Flag to hold info if this objects supports animation. Default is + // false. If true, the Trigger() method should be overridden + // to implement the animation effect and to re-initiate the event. + bool mbAllowsAnimation : 1; + + // Flag to control if this OverlayObject allows AntiAliased visualisation. + // Default is true, but e.g. for selection visualisation in SC and SW, + // it is switched to false + bool mbAllowsAntiAliase : 1; + + // set changed flag. Call after change, since the old range is invalidated + // and then the new one is calculated and invalidated, too. This will only + // work after the change. + void objectChange(); + + // write access to AntiAliase flag. This is protected since + // only implementations are allowed to change this, preferably in their + // constructor + void allowAntiAliase(bool bNew); + + public: + explicit OverlayObject(Color aBaseColor); + virtual ~OverlayObject() override; + + // get OverlayManager + OverlayManager* getOverlayManager() const { return mpOverlayManager; } + + // the access method for Primitive2DContainer. Will use createPrimitive2DSequence and + // setPrimitive2DSequence if needed. Overriding may be used to allow disposal of last + // created primitives to react on changed circumstances and to re-create primitives + virtual drawinglayer::primitive2d::Primitive2DContainer getOverlayObjectPrimitive2DSequence() const; + + // access to visibility state + bool isVisible() const { return mbIsVisible; } + void setVisible(bool bNew); + + // access to hittable flag + bool isHittable() const { return mbIsHittable; } + void setHittable(bool bNew); + + // read access to AntiAliase flag + bool allowsAntiAliase() const { return mbAllowsAntiAliase; } + + // read access to baseRange. This may trigger createBaseRange() if + // object is changed. + const basegfx::B2DRange& getBaseRange() const; + + // access to baseColor + const Color& getBaseColor() const { return maBaseColor; } + void setBaseColor(Color aNew); + + // access to Offset + const basegfx::B2DVector& getOffset() const { return maOffset; } + void setOffset(const basegfx::B2DVector& rOffset); + + // execute event from base class sdr::animation::Event. Default + // implementation does nothing and does not create a new event. + virtual void Trigger(sal_uInt32 nTime) override; + + // access to AllowsAnimation flag + bool allowsAnimation() const { return mbAllowsAnimation; } + + // stripe definition has changed. The OverlayManager does have + // support data to draw graphics in two colors striped. This + // method notifies the OverlayObject if that change takes place. + // Default implementation does nothing. + virtual void stripeDefinitionHasChanged(); + }; + + // typedefs for a vector of OverlayObjects + typedef ::std::vector< OverlayObject* > OverlayObjectVector; + + } // end of namespace overlay +} // end of namespace sdr + +namespace sdr +{ + namespace overlay + { + class SVXCORE_DLLPUBLIC OverlayObjectWithBasePosition : public OverlayObject + { + protected: + // base position in logical coordinates + basegfx::B2DPoint maBasePosition; + + public: + OverlayObjectWithBasePosition(const basegfx::B2DPoint& rBasePos, Color aBaseColor); + virtual ~OverlayObjectWithBasePosition() override; + + // access to basePosition + const basegfx::B2DPoint& getBasePosition() const { return maBasePosition; } + void setBasePosition(const basegfx::B2DPoint& rNew); + }; + } // end of namespace overlay +} // end of namespace sdr + +#endif // INCLUDED_SVX_SDR_OVERLAY_OVERLAYOBJECT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/overlay/overlayobjectlist.hxx b/include/svx/sdr/overlay/overlayobjectlist.hxx new file mode 100644 index 000000000..4859db33e --- /dev/null +++ b/include/svx/sdr/overlay/overlayobjectlist.hxx @@ -0,0 +1,72 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SDR_OVERLAY_OVERLAYOBJECTLIST_HXX +#define INCLUDED_SVX_SDR_OVERLAY_OVERLAYOBJECTLIST_HXX + +#include +#include +#include +#include +#include + + +class Point; + +namespace sdr +{ + namespace overlay + { + class SVXCORE_DLLPUBLIC OverlayObjectList final + { + // the vector of OverlayObjects + ::std::vector< std::unique_ptr > maVector; + + public: + OverlayObjectList() {} + OverlayObjectList(const OverlayObjectList&) = delete; + OverlayObjectList& operator=(const OverlayObjectList&) = delete; + ~OverlayObjectList(); + + // clear list, this includes deletion of all contained objects + void clear(); + + // append objects (takes ownership) + void append(std::unique_ptr pOverlayObject); + + // access to objects + sal_uInt32 count() const { return maVector.size(); } + OverlayObject& getOverlayObject(sal_uInt32 nIndex) const { return *(maVector[nIndex]); } + + // Hittest with logical coordinates + bool isHitLogic(const basegfx::B2DPoint& rLogicPosition, double fLogicTolerance = 0.0) const; + + // Hittest with pixel coordinates + bool isHitPixel(const Point& rDiscretePosition) const; + + // calculate BaseRange of all included OverlayObjects and return + basegfx::B2DRange getBaseRange() const; + }; + } // end of namespace overlay +} // end of namespace sdr + + +#endif // INCLUDED_SVX_SDR_OVERLAY_OVERLAYOBJECTLIST_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/overlay/overlaypolypolygon.hxx b/include/svx/sdr/overlay/overlaypolypolygon.hxx new file mode 100644 index 000000000..88c7404e6 --- /dev/null +++ b/include/svx/sdr/overlay/overlaypolypolygon.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_SVX_SDR_OVERLAY_OVERLAYPOLYPOLYGON_HXX +#define INCLUDED_SVX_SDR_OVERLAY_OVERLAYPOLYPOLYGON_HXX + +#include +#include + + +namespace sdr +{ + namespace overlay + { + class SVXCORE_DLLPUBLIC OverlayPolyPolygonStripedAndFilled final : public OverlayObject + { + // geometry + basegfx::B2DPolyPolygon maLinePolyPolygon; + + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DContainer createOverlayObjectPrimitive2DSequence() override; + + public: + explicit OverlayPolyPolygonStripedAndFilled( + const basegfx::B2DPolyPolygon& rLinePolyPolygon); + virtual ~OverlayPolyPolygonStripedAndFilled() override; + + // change geometry + const basegfx::B2DPolyPolygon& getLinePolyPolygon() const { return maLinePolyPolygon; } + + // react on stripe definition change + virtual void stripeDefinitionHasChanged() override; + }; + } // end of namespace overlay +} // end of namespace sdr + + +#endif // INCLUDED_SVX_SDR_OVERLAY_OVERLAYPOLYPOLYGON_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx b/include/svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx new file mode 100644 index 000000000..84cf195f4 --- /dev/null +++ b/include/svx/sdr/overlay/overlayprimitive2dsequenceobject.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_SVX_SDR_OVERLAY_OVERLAYPRIMITIVE2DSEQUENCEOBJECT_HXX +#define INCLUDED_SVX_SDR_OVERLAY_OVERLAYPRIMITIVE2DSEQUENCEOBJECT_HXX + +#include +#include + + +namespace sdr +{ + namespace overlay + { + class SVXCORE_DLLPUBLIC OverlayPrimitive2DSequenceObject final : public OverlayObjectWithBasePosition + { + // the sequence of primitives to show + const drawinglayer::primitive2d::Primitive2DContainer maSequence; + + // geometry creation for OverlayObject + virtual drawinglayer::primitive2d::Primitive2DContainer createOverlayObjectPrimitive2DSequence() override; + + public: + explicit OverlayPrimitive2DSequenceObject(const drawinglayer::primitive2d::Primitive2DContainer& rSequence); + + virtual ~OverlayPrimitive2DSequenceObject() override; + }; + } // end of namespace overlay +} // end of namespace sdr + + +#endif // INCLUDED_SVX_SDR_OVERLAY_OVERLAYPRIMITIVE2DSEQUENCEOBJECT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/overlay/overlayselection.hxx b/include/svx/sdr/overlay/overlayselection.hxx new file mode 100644 index 000000000..dc40a8759 --- /dev/null +++ b/include/svx/sdr/overlay/overlayselection.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_SVX_SDR_OVERLAY_OVERLAYSELECTION_HXX +#define INCLUDED_SVX_SDR_OVERLAY_OVERLAYSELECTION_HXX + +#include + + +namespace sdr +{ + namespace overlay + { + // overlay type definition + enum class OverlayType + { + Invert, + Solid, + Transparent + }; + + class SVXCORE_DLLPUBLIC OverlaySelection final : public OverlayObject + { + // type of overlay + OverlayType meOverlayType; + + // geometry of overlay + std::vector< basegfx::B2DRange > maRanges; + + // Values of last primitive creation. These are checked in getOverlayObjectPrimitive2DSequence + // to evtl. get rid of last Primitive2DContainer. This ensures that these values are up-to-date + // and are usable when creating primitives + OverlayType maLastOverlayType; + sal_uInt16 mnLastTransparence; + + bool mbBorder : 1; + + // geometry creation for OverlayObject, can use local *Last* values + virtual drawinglayer::primitive2d::Primitive2DContainer createOverlayObjectPrimitive2DSequence() override; + + public: + OverlaySelection( + OverlayType eType, + const Color& rColor, + const std::vector< basegfx::B2DRange >& rRanges, + bool bBorder); + virtual ~OverlaySelection() override; + + // data read access + const std::vector< basegfx::B2DRange >& getRanges() const { return maRanges; } + + /// override to check conditions for last createOverlayObjectPrimitive2DSequence + virtual drawinglayer::primitive2d::Primitive2DContainer getOverlayObjectPrimitive2DSequence() const override; + + // data write access + void setRanges(const std::vector< basegfx::B2DRange >& rNew); + }; + } // end of namespace overlay +} // end of namespace sdr + + +#endif // INCLUDED_SVX_SDR_OVERLAY_OVERLAYSELECTION_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/primitive2d/sdrframeborderprimitive2d.hxx b/include/svx/sdr/primitive2d/sdrframeborderprimitive2d.hxx new file mode 100644 index 000000000..820726698 --- /dev/null +++ b/include/svx/sdr/primitive2d/sdrframeborderprimitive2d.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_SVX_INC_SDR_PRIMITIVE2D_SDRFRAMEBORDERPRIMITIVE2D_HXX +#define INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRFRAMEBORDERPRIMITIVE2D_HXX + +#include +#include + +// predefines + +namespace drawinglayer +{ + namespace primitive2d + { + class SVXCORE_DLLPUBLIC SdrFrameBorderData + { + private: + basegfx::B2DPoint maOrigin; /// start point of borderline + basegfx::B2DVector maX; /// X-Axis of borderline with length + svx::frame::Style maStyle; /// Style of borderline + Color maColor; + bool mbForceColor; + + class SdrConnectStyleData + { + private: + svx::frame::Style maStyle; + basegfx::B2DVector maNormalizedPerpendicular; + bool mbStyleMirrored; + + public: + SdrConnectStyleData( + const svx::frame::Style& rStyle, + const basegfx::B2DVector& rNormalizedPerpendicular, + bool bStyleMirrored); + + const svx::frame::Style& getStyle() const { return maStyle; } + const basegfx::B2DVector& getNormalizedPerpendicular() const { return maNormalizedPerpendicular; } + bool getStyleMirrored() const { return mbStyleMirrored; } + bool operator==(const SdrConnectStyleData& rCompare) const; + }; + + std::vector maStart; + std::vector maEnd; + + public: + SdrFrameBorderData( + const basegfx::B2DPoint& rOrigin, + const basegfx::B2DVector& rX, + const svx::frame::Style& rStyle, + const Color* pForceColor); + + void addSdrConnectStyleData( + bool bStart, + const svx::frame::Style& rStyle, + const basegfx::B2DVector& rNormalizedPerpendicular, + bool bStyleMirrored); + + void create2DDecomposition( + Primitive2DContainer& rContainer, + double fMinDiscreteUnit) const; + + double getMinimalNonZeroBorderWidth() const; + bool operator==(const SdrFrameBorderData& rCompare) const; + }; + + typedef std::vector SdrFrameBorderDataVector; + + } // end of namespace primitive2d +} // end of namespace drawinglayer + +namespace drawinglayer +{ + namespace primitive2d + { + class SVXCORE_DLLPUBLIC SdrFrameBorderPrimitive2D final : public BufferedDecompositionPrimitive2D + { + private: + std::shared_ptr maFrameBorders; + double mfMinimalNonZeroBorderWidth; + double mfMinimalNonZeroBorderWidthUsedForDecompose; + bool mbForceToSingleDiscreteUnit; + + // local decomposition. + virtual void create2DDecomposition( + Primitive2DContainer& rContainer, + const geometry::ViewInformation2D& aViewInformation) const override; + + public: + SdrFrameBorderPrimitive2D( + std::shared_ptr& rFrameBorders, + bool bForceToSingleDiscreteUnit); + + // compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const override; + + // override to get view-dependent + virtual void get2DDecomposition( + Primitive2DDecompositionVisitor& rVisitor, + const geometry::ViewInformation2D& rViewInformation) const override; + + // data access + const std::shared_ptr& getFrameBorders() const { return maFrameBorders; } + bool doForceToSingleDiscreteUnit() const { return mbForceToSingleDiscreteUnit; } + + // provide unique ID + virtual sal_uInt32 getPrimitive2DID() const override; + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + + +#endif // INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRFRAMEBORDERPRIMITIVE2D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/primitive2d/svx_primitivetypes2d.hxx b/include/svx/sdr/primitive2d/svx_primitivetypes2d.hxx new file mode 100644 index 000000000..d6cb948a6 --- /dev/null +++ b/include/svx/sdr/primitive2d/svx_primitivetypes2d.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_SVX_SDR_PRIMITIVE2D_SVX_PRIMITIVETYPES2D_HXX +#define INCLUDED_SVX_SDR_PRIMITIVE2D_SVX_PRIMITIVETYPES2D_HXX + +#include + + +#define PRIMITIVE2D_ID_SDRCAPTIONPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 0) +#define PRIMITIVE2D_ID_SDRCONNECTORPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 1) +#define PRIMITIVE2D_ID_SDRCUSTOMSHAPEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 2) +#define PRIMITIVE2D_ID_SDRELLIPSEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 3) +#define PRIMITIVE2D_ID_SDRELLIPSESEGMENTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 4) +#define PRIMITIVE2D_ID_SDRGRAFPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 5) +#define PRIMITIVE2D_ID_SDRMEASUREPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 6) +#define PRIMITIVE2D_ID_SDROLE2PRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 7) +#define PRIMITIVE2D_ID_SDRPATHPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 8) +#define PRIMITIVE2D_ID_SDRRECTANGLEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 9) +#define PRIMITIVE2D_ID_SDRCONTOURTEXTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 10) +#define PRIMITIVE2D_ID_SDRPATHTEXTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 11) +#define PRIMITIVE2D_ID_SDRBLOCKTEXTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 12) +#define PRIMITIVE2D_ID_SDRSTRETCHTEXTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 13) +#define PRIMITIVE2D_ID_SDRCELLPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 14) +#define PRIMITIVE2D_ID_OVERLAYBITMAPEXPRIMITIVE (PRIMITIVE2D_ID_RANGE_SVX| 15) +#define PRIMITIVE2D_ID_OVERLAYCROSSHAIRPRIMITIVE (PRIMITIVE2D_ID_RANGE_SVX| 16) +#define PRIMITIVE2D_ID_OVERLAYRECTANGLEPRIMITIVE (PRIMITIVE2D_ID_RANGE_SVX| 17) +#define PRIMITIVE2D_ID_OVERLAYHELPLINESTRIPEDPRIMITIVE (PRIMITIVE2D_ID_RANGE_SVX| 18) +#define PRIMITIVE2D_ID_OVERLAYROLLINGRECTANGLEPRIMITIVE (PRIMITIVE2D_ID_RANGE_SVX| 19) +#define PRIMITIVE2D_ID_SDRCONTROLPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 20) +#define PRIMITIVE2D_ID_SDROLECONTENTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 21) +#define PRIMITIVE2D_ID_SDRAUTOFITTEXTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 22) +#define PRIMITIVE2D_ID_SDRCHAINEDTEXTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 23) +#define PRIMITIVE2D_ID_SDRFRAMEBORDERTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 24) + + +#endif // INCLUDED_SVX_SDR_PRIMITIVE2D_SVX_PRIMITIVETYPES2D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/properties/defaultproperties.hxx b/include/svx/sdr/properties/defaultproperties.hxx new file mode 100644 index 000000000..852b5e881 --- /dev/null +++ b/include/svx/sdr/properties/defaultproperties.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_SVX_SDR_PROPERTIES_DEFAULTPROPERTIES_HXX +#define INCLUDED_SVX_SDR_PROPERTIES_DEFAULTPROPERTIES_HXX + +#include + +#include + +#include +#include + +struct _xmlTextWriter; +typedef struct _xmlTextWriter* xmlTextWriterPtr; + +namespace sdr +{ + namespace properties + { + class SVXCORE_DLLPUBLIC DefaultProperties : public BaseProperties + { + protected: + // the to be used ItemSet + std::unique_ptr mpItemSet; + + // create a new itemset + virtual std::unique_ptr CreateObjectSpecificItemSet(SfxItemPool& rPool) override; + + // test changeability for a single item + virtual bool AllowItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = nullptr) const override; + + // Do the ItemChange, may do special handling + virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = nullptr) override; + + // Called after ItemChange() is done for all items. + virtual void PostItemChange(const sal_uInt16 nWhich) override; + + // react on ItemSet changes + virtual void ItemSetChanged(const SfxItemSet& rSet) override; + + // check if SfxItemSet exists + bool HasSfxItemSet() const { return bool(mpItemSet); } + + public: + // basic constructor + explicit DefaultProperties(SdrObject& rObj); + + // constructor for copying, but using new object + DefaultProperties(const DefaultProperties& rProps, SdrObject& rObj); + + // destructor + virtual ~DefaultProperties() override; + + void dumpAsXml(xmlTextWriterPtr pWriter) const override; + + // Clone() operator, normally just calls the local copy constructor + virtual std::unique_ptr Clone(SdrObject& rObj) const override; + + // get itemset + virtual const SfxItemSet& GetObjectItemSet() const override; + + // set single item + virtual void SetObjectItem(const SfxPoolItem& rItem) override; + + // set single item direct, do not do any notifies or things like that + virtual void SetObjectItemDirect(const SfxPoolItem& rItem) override; + + // clear single item + virtual void ClearObjectItem(const sal_uInt16 nWhich = 0) override; + + // clear single item direct, do not do any notifies or things like that. + // Also supports complete deletion of items when default parameter 0 is used. + virtual void ClearObjectItemDirect(const sal_uInt16 nWhich) override; + + // set complete item set + virtual void SetObjectItemSet(const SfxItemSet& rSet) override; + + // set a new StyleSheet and broadcast + virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr) override; + + // get the installed StyleSheet + virtual SfxStyleSheet* GetStyleSheet() const override; + + // force default attributes for a specific object type, called from + // DefaultProperties::GetObjectItemSet() if a new ItemSet is created. + // Default implementation does nothing. + virtual void ForceDefaultAttributes(); + }; + } // end of namespace properties +} // end of namespace sdr + +#endif // INCLUDED_SVX_SDR_PROPERTIES_DEFAULTPROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/properties/properties.hxx b/include/svx/sdr/properties/properties.hxx new file mode 100644 index 000000000..22d9bf2f7 --- /dev/null +++ b/include/svx/sdr/properties/properties.hxx @@ -0,0 +1,213 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SDR_PROPERTIES_PROPERTIES_HXX +#define INCLUDED_SVX_SDR_PROPERTIES_PROPERTIES_HXX + +#include + +#include + +#include +#include +#include + +struct _xmlTextWriter; +typedef struct _xmlTextWriter* xmlTextWriterPtr; +class SdrObject; +class SfxItemSet; +class SfxPoolItem; +class SfxStyleSheet; +class Fraction; +class SfxItemPool; +class SdrModel; + +namespace sdr +{ + namespace properties + { + class ItemChangeBroadcaster; + } +} + +//////////////////////////////////////////////////////////////////////////////////////////////////// +// +// BaseProperties +// DefaultProperties ->SfxItemSet +// AttributeProperties ->SfxStyleSheet +// E3dProperties +// E3dCompoundProperties +// E3dExtrudeProperties +// E3dLatheProperties +// E3dSphereProperties +// E3dSceneProperties +// TextProperties ->maVersion +// ConnectorProperties +// CustomShapeProperties +// MeasureProperties +// RectangleProperties +// CaptionProperties +// CircleProperties +// GraphicProperties +// OleProperties +// CellProperties +// TableProperties +// GroupProperties +// EmptyProperties +// PageProperties + +namespace sdr +{ + namespace properties + { + class SVXCORE_DLLPUBLIC BaseProperties + { + private: + // the owner of this Properties. Set from constructor and not + // to be changed in any way. + SdrObject& mrObject; + + protected: + // apply the correct SfyStyleSheet from SdrObject's SdrModel + virtual void applyDefaultStyleSheetFromSdrModel(); + + // create a new object specific itemset with object specific ranges. + virtual std::unique_ptr CreateObjectSpecificItemSet(SfxItemPool& pPool) = 0; + + // internal access to SdrObject + const SdrObject& GetSdrObject() const; + + SdrObject& GetSdrObject(); + + // Test changeability for a single item. If an implementation wants to prevent + // changing an item it should override this method. + virtual bool AllowItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = nullptr) const = 0; + + // Do the internal ItemChange. If only nWhich is given, the item needs to be cleared. + // Also needs to handle if nWhich and pNewItem is 0, which means to clear all items. + virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = nullptr) = 0; + + // Called after ItemChange() is done for all items. Allows local reactions on + // specific item changes + virtual void PostItemChange(const sal_uInt16 nWhich) = 0; + + // Internally react on ItemSet changes. The given ItemSet contains all changed items, the new ones. + virtual void ItemSetChanged(const SfxItemSet& rSet) = 0; + + public: + // basic constructor, used from SdrObject. + explicit BaseProperties(SdrObject& rObj); + + // destructor + virtual ~BaseProperties(); + + // Clone() operator, normally just calls the local copy constructor, + // see above. + virtual std::unique_ptr Clone(SdrObject& rObj) const = 0; + + // Get the local ItemSet. This directly returns the local ItemSet of the object. No + // merging of ItemSets is done for e.g. Group objects. + virtual const SfxItemSet& GetObjectItemSet() const = 0; + + // get merged ItemSet. Normally, this maps directly to GetObjectItemSet(), but may + // be overridden e.g for group objects to return a merged ItemSet of the object. + // When using this method the returned ItemSet may contain items in the state + // SfxItemState::DONTCARE which means there were several such items with different + // values. + virtual const SfxItemSet& GetMergedItemSet() const; + + // Sets all items which are on state SfxItemState::SET in rSet at the local ItemSet. + // Uses AllowItemChange(), ItemChange(), PostItemChange() and ItemSetChanged() calls. + virtual void SetObjectItemSet(const SfxItemSet& rSet) = 0; + + // Set merged ItemSet. Normally, this maps to SetObjectItemSet(). + virtual void SetMergedItemSet(const SfxItemSet& rSet, bool bClearAllItems = false); + + // Set single item at the local ItemSet. Uses AllowItemChange(), + // ItemChange(), PostItemChange() and ItemSetChanged() calls. + virtual void SetObjectItem(const SfxPoolItem& rItem) = 0; + + // Set a single item direct. Only uses AllowItemChange() and ItemChange(), + // but not PostItemChange() and ItemSetChanged() calls. + virtual void SetObjectItemDirect(const SfxPoolItem& rItem) = 0; + + // Clear a single local item. Uses AllowItemChange(), + // ItemChange(), PostItemChange() and ItemSetChanged() calls. + virtual void ClearObjectItem(const sal_uInt16 nWhich = 0) = 0; + + // Set a single item, iterate over hierarchies if necessary. Default + // Implementation falls back to ClearObjectItem(). + virtual void SetMergedItem(const SfxPoolItem& rItem); + + // Clear a single item, iterate over hierarchies if necessary. Default + // Implementation falls back to ClearObjectItem(). + virtual void ClearMergedItem(const sal_uInt16 nWhich); + + // Clear single item direct. Only uses AllowItemChange() and ItemChange(), + // but not PostItemChange() and ItemSetChanged() calls. + // Also supports complete deletion of items when default parameter 0 is used. + virtual void ClearObjectItemDirect(const sal_uInt16 nWhich) = 0; + + // Set a new StyleSheet. Registers as listener at the StyleSheet to get knowledge + // of StyleSheet changes. + virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr) = 0; + + // Get the installed StyleSheet. + virtual SfxStyleSheet* GetStyleSheet() const = 0; + + // force all attributes which come from styles to hard attributes + // to be able to live without the style. + virtual void ForceStyleToHardAttributes(); + + // syntactical sugar for ItemSet accesses. Broadcasts before and after the changes + // to invalidate views in old and new BoundRects. As soon as the repaint mechanism + // will be changed these broadcasts will no longer be needed. + //void SetItemAndBroadcast(const SfxPoolItem& rItem); + //void ClearItemAndBroadcast(const sal_uInt16 nWhich = 0); + void SetMergedItemSetAndBroadcast(const SfxItemSet& rSet, bool bClearAllItems = false); + + // Just a convenient shortcut for GetObjectItemSet().Get(nWhich). + const SfxPoolItem& GetItem(const sal_uInt16 nWhich) const; + template const T& GetItem(TypedWhichId nWhich) const + { + return static_cast(GetItem(sal_uInt16(nWhich))); + } + + // support for convenient broadcasting. Used from SetMergedItemAndBroadcast(), + // ClearItemAndBroadcast() and SetItemSetAndBroadcast(), see above. + // But also from inside SdrObjects. + void BroadcastItemChange(const ItemChangeBroadcaster& rChange); + + // #i101556# add versioning mechanism; used from e.g. text attribute set to + // allow detection of e.g. style sheet or single text attribute changes. The + // default implementation returns 0 (zero) + virtual sal_uInt32 getVersion() const; + + virtual void dumpAsXml(xmlTextWriterPtr pWriter) const; + }; + + // checks the FillStyle item and removes unneeded Gradient, FillBitmap and Hatch items + void SVXCORE_DLLPUBLIC CleanupFillProperties( SfxItemSet& rItemSet ); + + } // end of namespace properties +} // end of namespace sdr + +#endif // INCLUDED_SVX_SDR_PROPERTIES_PROPERTIES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/table/tablecontroller.hxx b/include/svx/sdr/table/tablecontroller.hxx new file mode 100644 index 000000000..f34499a05 --- /dev/null +++ b/include/svx/sdr/table/tablecontroller.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_SVX_SDR_TABLE_TABLECONTROLLER_HXX +#define INCLUDED_SVX_SDR_TABLE_TABLECONTROLLER_HXX + +#include +#include + +#include +#include +#include +#include +#include + +class SdrView; +class SdrObject; +class SfxItemSet; +class SvxBoxInfoItem; +class SvxBoxItem; + +namespace sdr::table { + +class TableModel; + +class SVXCORE_DLLPUBLIC SvxTableController final : public sdr::SelectionController +{ +public: + SVX_DLLPRIVATE SvxTableController( + SdrView& rView, + const SdrTableObj& rObj); + SVX_DLLPRIVATE virtual ~SvxTableController() override; + + // from sdr::SelectionController + SVX_DLLPRIVATE virtual bool onKeyInput(const KeyEvent& rKEvt, vcl::Window* pWin) override; + SVX_DLLPRIVATE virtual bool onMouseButtonDown(const MouseEvent& rMEvt, vcl::Window* pWin) override; + SVX_DLLPRIVATE virtual bool onMouseButtonUp(const MouseEvent& rMEvt, vcl::Window* pWin) override; + SVX_DLLPRIVATE virtual bool onMouseMove(const MouseEvent& rMEvt, vcl::Window* pWin) override; + + SVX_DLLPRIVATE bool HasMarked() const; + SVX_DLLPRIVATE virtual bool DeleteMarked() override; + + SVX_DLLPRIVATE virtual void onSelectionHasChanged() override; + + SVX_DLLPRIVATE virtual void GetState( SfxItemSet& rSet ) override; + virtual void Execute( SfxRequest& rReq ) override; + + SVX_DLLPRIVATE virtual bool GetStyleSheet( SfxStyleSheet* &rpStyleSheet ) const override; + SVX_DLLPRIVATE virtual bool SetStyleSheet( SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr ) override; + + SVX_DLLPRIVATE virtual bool ApplyFormatPaintBrush( SfxItemSet& rFormatSet, bool bNoCharacterFormats, bool bNoParagraphFormats ) override; + + // slots + SVX_DLLPRIVATE void onInsert( sal_uInt16 nSId, const SfxItemSet* pArgs = nullptr ); + SVX_DLLPRIVATE void onDelete( sal_uInt16 nSId ); + SVX_DLLPRIVATE void onSelect( sal_uInt16 nSId ); + SVX_DLLPRIVATE void onFormatTable(const SfxRequest& rReq); + SVX_DLLPRIVATE void MergeMarkedCells(); + SVX_DLLPRIVATE void SplitMarkedCells(const SfxRequest& rReq); + SVX_DLLPRIVATE void DistributeColumns( const bool bOptimize, const bool bMinimize ); + SVX_DLLPRIVATE void DistributeRows( const bool bOptimize, const bool bMinimize ); + SVX_DLLPRIVATE void SetVertical( sal_uInt16 nSId ); + SVX_DLLPRIVATE void changeTableEdge(const SfxRequest& rReq); + + SVX_DLLPRIVATE static rtl::Reference< sdr::SelectionController > create( + SdrView& rView, + const SdrTableObj& rObj, + const rtl::Reference< sdr::SelectionController >& xRefController); + + SVX_DLLPRIVATE void MergeAttrFromSelectedCells(SfxItemSet& rAttr, bool bOnlyHardAttr) const; + SVX_DLLPRIVATE void SetAttrToSelectedCells(const SfxItemSet& rAttr, bool bReplaceAll); + /** Fill the values that are common for all selected cells. + * + * This lets the Borders dialog to display the line arrangement + * properly. + */ + SVX_DLLPRIVATE void FillCommonBorderAttrFromSelectedCells(SvxBoxItem& rBox, SvxBoxInfoItem& rBoxInfo) const; + + SVX_DLLPRIVATE virtual bool GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr) const override; + SVX_DLLPRIVATE virtual bool SetAttributes(const SfxItemSet& rSet, bool bReplaceAll) override; + + SVX_DLLPRIVATE virtual SdrObject* GetMarkedSdrObjClone( SdrModel& rTargetModel ) override; + SVX_DLLPRIVATE virtual bool PasteObjModel( const SdrModel& rModel ) override; + + SVX_DLLPRIVATE virtual bool hasSelectedCells() const override { return mbCellSelectionMode || mrView.IsTextEdit(); } + /// @see sdr::SelectionController::setCursorLogicPosition(). + SVX_DLLPRIVATE virtual bool setCursorLogicPosition(const Point& rPosition, bool bPoint) override; + + /// @see sdr::SelectionController::getSelectedCells(). + void getSelectedCells( CellPos& rFirstPos, CellPos& rLastPos ) override; + void setSelectedCells( const CellPos& rFirstPos, const CellPos& rLastPos ); + + virtual bool ChangeFontSize(bool bGrow, const FontList* pFontList) override; + + void clearSelection(); + void selectAll(); + + SVX_DLLPRIVATE void onTableModified(); + + bool selectRow( sal_Int32 row ); + bool selectColumn( sal_Int32 column ); + bool deselectRow( sal_Int32 row ); + bool deselectColumn( sal_Int32 column ); + bool isRowSelected( sal_Int32 nRow ); + bool isColumnSelected( sal_Int32 nColumn ); + bool isRowHeader(); + bool isColumnHeader(); + sdr::table::SdrTableObj* GetTableObj() { return mxTableObj.get(); } +private: + SvxTableController(SvxTableController const &) = delete; + SvxTableController& operator =(SvxTableController const &) = delete; + + // internals + enum class TblAction + { + NONE, + GotoFirstCell, GotoFirstColumn, GotoFirstRow, + GotoLeftCell, GotoUpCell, GotoRightCell, GotoDownCell, + GotoLastCell, GotoLastColumn, GotoLastRow, + EditCell, StopTextEdit, + RemoveSelection, + HandledByView, Tab + }; + SVX_DLLPRIVATE void ApplyBorderAttr( const SfxItemSet& rAttr ); + SVX_DLLPRIVATE void UpdateTableShape(); + + SVX_DLLPRIVATE void SetTableStyle( const SfxItemSet* pArgs ); + SVX_DLLPRIVATE void SetTableStyleSettings( const SfxItemSet* pArgs ); + + SVX_DLLPRIVATE bool PasteObject( SdrTableObj const * pPasteTableObj ); + + SVX_DLLPRIVATE bool checkTableObject(); + SVX_DLLPRIVATE const CellPos& getSelectionStart(); + SVX_DLLPRIVATE void setSelectionStart( const CellPos& rPos ); + SVX_DLLPRIVATE const CellPos& getSelectionEnd(); + SVX_DLLPRIVATE void checkCell( CellPos& rPos ); + + SVX_DLLPRIVATE void MergeRange( sal_Int32 nFirstCol, sal_Int32 nFirstRow, sal_Int32 nLastCol, sal_Int32 nLastRow ); + + SVX_DLLPRIVATE void EditCell(const CellPos& rPos, vcl::Window* pWindow, TblAction nAction); + SVX_DLLPRIVATE void StopTextEdit(); + + SVX_DLLPRIVATE TblAction getKeyboardAction(const KeyEvent& rKEvt); + SVX_DLLPRIVATE bool executeAction(TblAction nAction, bool bSelect, vcl::Window* pWindow); + SVX_DLLPRIVATE void gotoCell(const CellPos& rCell, bool bSelect, vcl::Window* pWindow, TblAction nAction = TblAction::NONE); + + SVX_DLLPRIVATE void StartSelection( const CellPos& rPos ); + SVX_DLLPRIVATE void UpdateSelection( const CellPos& rPos ); + SVX_DLLPRIVATE void RemoveSelection(); + SVX_DLLPRIVATE void updateSelectionOverlay(); + SVX_DLLPRIVATE void destroySelectionOverlay(); + + SVX_DLLPRIVATE void findMergeOrigin( CellPos& rPos ); + + DECL_LINK( UpdateHdl, void *, void ); + + //TableModelRef mxTable; + rtl::Reference< TableModel > mxTable; + + CellPos maCursorFirstPos; + CellPos maCursorLastPos; + bool mbCellSelectionMode; + bool mbHasJustMerged; + CellPos maMouseDownPos; + bool mbLeftButtonDown; + std::unique_ptr mpSelectionOverlay; + SdrView& mrView; + tools::WeakReference mxTableObj; + css::uno::Reference< css::util::XModifyListener > mxModifyListener; + ImplSVEvent * mnUpdateEvent; +}; + +rtl::Reference< sdr::SelectionController > CreateTableController( + SdrView& rView, + const SdrTableObj& rObj, + const rtl::Reference< sdr::SelectionController >& xRefController ); + +} + +#endif // INCLUDED_SVX_SDR_TABLE_TABLECONTROLLER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdr/table/tabledesign.hxx b/include/svx/sdr/table/tabledesign.hxx new file mode 100644 index 000000000..8c03ee67b --- /dev/null +++ b/include/svx/sdr/table/tabledesign.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_SVX_SDR_TABLE_TABLEDESIGN_HXX +#define INCLUDED_SVX_SDR_TABLE_TABLEDESIGN_HXX + +#include + +#include + +namespace sdr::table { + +const sal_Int32 first_row_style = 0; +const sal_Int32 last_row_style = 1; +const sal_Int32 first_column_style = 2; +const sal_Int32 last_column_style = 3; +const sal_Int32 even_rows_style = 4; +const sal_Int32 odd_rows_style = 5; +const sal_Int32 even_columns_style = 6; +const sal_Int32 odd_columns_style = 7; +const sal_Int32 body_style = 8; +const sal_Int32 background_style = 9; +const sal_Int32 style_count = 10; + +extern SVX_DLLPUBLIC css::uno::Reference< css::container::XNameAccess > CreateTableDesignFamily(); + +} + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdrhittesthelper.hxx b/include/svx/sdrhittesthelper.hxx new file mode 100644 index 000000000..87cf1afbe --- /dev/null +++ b/include/svx/sdrhittesthelper.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_SVX_SDRHITTESTHELPER_HXX +#define INCLUDED_SVX_SDRHITTESTHELPER_HXX + +#include + + +// #i101872# new Object HitTest as View-tooling + + +class Point; +class SdrObject; +class SdrPageView; +class SdrLayerIDSet; +class SdrObjList; +namespace sdr::contact { class ViewObjectContact; } +namespace basegfx { class B2DPoint; } +namespace drawinglayer::primitive2d { class Primitive2DContainer; } + + +// Wrappers for classic Sdr* Mode/View classes + +SVXCORE_DLLPUBLIC SdrObject* SdrObjectPrimitiveHit( + const SdrObject& rObject, + const Point& rPnt, + sal_uInt16 nTol, + const SdrPageView& rSdrPageView, + const SdrLayerIDSet* pVisiLayer, + bool bTextOnly, + /// allow getting back an evtl. resulting primitive stack which lead to a hit + drawinglayer::primitive2d::Primitive2DContainer* pHitContainer = nullptr); + +SVXCORE_DLLPUBLIC SdrObject* SdrObjListPrimitiveHit( + const SdrObjList& rList, + const Point& rPnt, + sal_uInt16 nTol, + const SdrPageView& rSdrPageView, + const SdrLayerIDSet* pVisiLayer, + bool bTextOnly); + + +// the pure HitTest based on a VOC + +bool ViewObjectContactPrimitiveHit( + const sdr::contact::ViewObjectContact& rVOC, + const basegfx::B2DPoint& rHitPosition, + double fLogicHitTolerance, + bool bTextOnly, + /// allow to get back the stack of primitives that lead to the hit + drawinglayer::primitive2d::Primitive2DContainer* pHitContainer); + + +#endif // INCLUDED_SVX_SDRHITTESTHELPER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdrmasterpagedescriptor.hxx b/include/svx/sdrmasterpagedescriptor.hxx new file mode 100644 index 000000000..3b5375871 --- /dev/null +++ b/include/svx/sdrmasterpagedescriptor.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_SVX_SDRMASTERPAGEDESCRIPTOR_HXX +#define INCLUDED_SVX_SDRMASTERPAGEDESCRIPTOR_HXX + +#include +#include +#include + +class SdrPageProperties; + +namespace sdr +{ + namespace contact + { + class ViewContact; + } // end of namespace contact +} + +namespace sdr +{ + class MasterPageDescriptor final : public sdr::PageUser + { + private: + SdrPage& maOwnerPage; + SdrPage& maUsedPage; + SdrLayerIDSet maVisibleLayers; + + // ViewContact part + mutable std::unique_ptr mpViewContact; + + void operator=(const MasterPageDescriptor& rCandidate) = delete; + + public: + MasterPageDescriptor(SdrPage& aOwnerPage, SdrPage& aUsedPage); + virtual ~MasterPageDescriptor(); + + // ViewContact part + sdr::contact::ViewContact& GetViewContact() const; + + // this method is called from the destructor of the referenced page. + // do all necessary action to forget the page. It is not necessary to call + // RemovePageUser(), that is done from the destructor. + virtual void PageInDestruction(const SdrPage& rPage) override; + + // member access to UsedPage + SdrPage& GetUsedPage() const { return maUsedPage; } + + // member access to OwnerPage + SdrPage& GetOwnerPage() const { return maOwnerPage; } + + // member access to VisibleLayers + const SdrLayerIDSet& GetVisibleLayers() const { return maVisibleLayers; } + void SetVisibleLayers(const SdrLayerIDSet& rNew); + + const SdrPageProperties* getCorrectSdrPageProperties() const; + }; +} // end of namespace sdr + +#endif // INCLUDED_SVX_SDRMASTERPAGEDESCRIPTOR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdrobjectfilter.hxx b/include/svx/sdrobjectfilter.hxx new file mode 100644 index 000000000..497bf51a2 --- /dev/null +++ b/include/svx/sdrobjectfilter.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_SVX_SDROBJECTFILTER_HXX +#define INCLUDED_SVX_SDROBJECTFILTER_HXX + +#include + +class SdrObject; + + +namespace svx +{ + + + //= SdrObjectFilter + + /** specifies a boolean predicate on the set of all SdrObjects - vulgo a filter. + */ + class SVXCORE_DLLPUBLIC SAL_NO_VTABLE ISdrObjectFilter + { + public: + virtual bool includeObject( const SdrObject& i_rObject ) const = 0; + + virtual ~ISdrObjectFilter() = 0; + }; + + +} + + +#endif // INCLUDED_SVX_SDROBJECTFILTER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdrobjectuser.hxx b/include/svx/sdrobjectuser.hxx new file mode 100644 index 000000000..f13beeb42 --- /dev/null +++ b/include/svx/sdrobjectuser.hxx @@ -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 INCLUDED_SVX_SDROBJECTUSER_HXX +#define INCLUDED_SVX_SDROBJECTUSER_HXX + +#include + +class SdrObject; + +// To make things more safe, allow users of an object to register at it. The users need to be derived +// from sdr::ObjectUser to get a call. The users do not need to call RemoveObjectUser() at the page +// when they get called from ObjectInDestruction(). + +namespace sdr +{ + class ObjectUser + { + public: + // this method is called from the destructor of the referenced page. + // do all necessary action to forget the page. It is not necessary to call + // RemovePageUser(), that is done from the destructor. + virtual void ObjectInDestruction(const SdrObject& rObject) = 0; + + protected: + ~ObjectUser() {} + }; + + // typedef for ObjectUserVector + typedef ::std::vector< ObjectUser* > ObjectUserVector; +} // end of namespace sdr + +#endif // INCLUDED_SVX_SDROBJECTUSER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdrpageuser.hxx b/include/svx/sdrpageuser.hxx new file mode 100644 index 000000000..8c31a2936 --- /dev/null +++ b/include/svx/sdrpageuser.hxx @@ -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 INCLUDED_SVX_SDRPAGEUSER_HXX +#define INCLUDED_SVX_SDRPAGEUSER_HXX + +#include + +class SdrPage; + +// To make things more safe, allow users of the page to register at it. The users need to be derived +// from sdr::PageUser to get a call. The users do not need to call RemovePageUser() at the page +// when they get called from PageInDestruction(). + +namespace sdr +{ + class PageUser + { + public: + // this method is called from the destructor of the referenced page. + // do all necessary action to forget the page. It is not necessary to call + // RemovePageUser(), that is done from the destructor. + virtual void PageInDestruction(const SdrPage& rPage) = 0; + + protected: + ~PageUser() {} + }; + + // typedef for PageUserVector + typedef ::std::vector< PageUser* > PageUserVector; +} // end of namespace sdr + +#endif // INCLUDED_SVX_SDRPAGEUSER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdrpagewindow.hxx b/include/svx/sdrpagewindow.hxx new file mode 100644 index 000000000..f5cb98c29 --- /dev/null +++ b/include/svx/sdrpagewindow.hxx @@ -0,0 +1,99 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SDRPAGEWINDOW_HXX +#define INCLUDED_SVX_SDRPAGEWINDOW_HXX + +#include +#include +#include +#include + +namespace com::sun::star::awt { class XControlContainer; } +namespace com::sun::star::uno { template class Reference; } +namespace rtl { template class Reference; } +namespace sdr::overlay { class OverlayManager; } +namespace vcl { class Region; } + +namespace sdr +{ + namespace contact + { + class ObjectContact; + class ViewObjectContactRedirector; + } +} + +namespace basegfx { class B2DRange; } + +class SdrPaintWindow; +class SdrPageView; + +class SVXCORE_DLLPUBLIC SdrPageWindow +{ + struct Impl; + + std::unique_ptr mpImpl; + + SdrPageWindow( const SdrPageWindow& ) = delete; + SdrPageWindow& operator= ( const SdrPageWindow& ) = delete; + +public: + SdrPageWindow(SdrPageView& rNewPageView, SdrPaintWindow& rPaintWindow); + ~SdrPageWindow(); + + // data read accesses + SdrPageView& GetPageView() const; + SdrPaintWindow& GetPaintWindow() const; + const SdrPaintWindow* GetOriginalPaintWindow() const; + css::uno::Reference const & GetControlContainer( bool _bCreateIfNecessary = true ) const; + + // OVERLAYMANAGER + rtl::Reference< sdr::overlay::OverlayManager > const & GetOverlayManager() const; + + // #i72752# allow patcing SdrPaintWindow from SdrPageView::DrawLayer if needed + [[nodiscard]] SdrPaintWindow* patchPaintWindow(SdrPaintWindow& rPaintWindow); + void unpatchPaintWindow(SdrPaintWindow* pPreviousPaintWindow); + + // the repaint method. For migration from pPaintProc, use one more parameter + void PrePaint(); + void PrepareRedraw(const vcl::Region& rReg); + void RedrawAll( sdr::contact::ViewObjectContactRedirector* pRedirector ); + void RedrawLayer( const SdrLayerID* pId, sdr::contact::ViewObjectContactRedirector* pRedirector, basegfx::B2IRectangle const*); + + // Invalidate call, used from ObjectContact(OfPageView) in InvalidatePartOfView(...) + void InvalidatePageWindow(const basegfx::B2DRange& rRange); + + // #110094# ObjectContact section + const sdr::contact::ObjectContact& GetObjectContact() const; + sdr::contact::ObjectContact& GetObjectContact(); + /// determines whether there already exists an ObjectContact + bool HasObjectContact() const; + + // #i26631# + void ResetObjectContact(); + + /** sets all elements in the view which support a design and an alive mode into the given mode + */ + void SetDesignMode( bool _bDesignMode ) const; +}; + +#endif // INCLUDED_SVX_SDRPAGEWINDOW_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdrpaintwindow.hxx b/include/svx/sdrpaintwindow.hxx new file mode 100644 index 000000000..91183258a --- /dev/null +++ b/include/svx/sdrpaintwindow.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_SVX_SDRPAINTWINDOW_HXX +#define INCLUDED_SVX_SDRPAINTWINDOW_HXX + +#include +#include +#include +#include + +class SdrPaintView; + +namespace sdr +{ + namespace overlay + { + class OverlayManager; + } +} + +#ifdef _MSC_VER // broken msvc template instantiation +#include +#endif + +/// paint the transparent children of rWin that overlap rPixelRect +/// (for example, transparent form controls like check boxes) +void SVXCORE_DLLPUBLIC +PaintTransparentChildren(vcl::Window const & rWindow, tools::Rectangle const& rPixelRect); + +class SdrPreRenderDevice +{ + // The original OutputDevice + VclPtr mpOutputDevice; + + // The VirtualDevice for PreRendering + VclPtr mpPreRenderDevice; + +public: + explicit SdrPreRenderDevice(OutputDevice& rOriginal); + ~SdrPreRenderDevice(); + + void PreparePreRenderDevice(); + void OutputPreRenderDevice(const vcl::Region& rExpandedRegion); + + OutputDevice& GetPreRenderDevice() { return *mpPreRenderDevice; } +}; + +class SVXCORE_DLLPUBLIC SdrPaintWindow +{ +private: + // the OutputDevice this window represents + VclPtr mpOutputDevice; + + /// In case mrOutputDevice is a buffer for a vcl::Window, this is the window. + VclPtr mpWindow; + + // the SdrPaintView this window belongs to + SdrPaintView& mrPaintView; + + // the new OverlayManager for the new OverlayObjects. Test add here, will + // replace the IAOManager as soon as it works. + rtl::Reference< sdr::overlay::OverlayManager > mxOverlayManager; + + // The PreRenderDevice for PreRendering + std::unique_ptr mpPreRenderDevice; + + // The RedrawRegion used for rendering + vcl::Region maRedrawRegion; + + // #i72889# flag if this is only a temporary target for repaint, default is false + bool mbTemporaryTarget : 1; + + bool mbOutputToWindow : 1; + + // ref to patched + SdrPaintWindow* mpPatched; + + // helpers + void impCreateOverlayManager(); + +public: + SdrPaintWindow(SdrPaintView& rNewPaintView, OutputDevice& rOut, vcl::Window* pWindow = nullptr); + ~SdrPaintWindow(); + + // allow reference to patched, see patchPaintWindow/unpatchPaintWindow + void setPatched(SdrPaintWindow* pPaintWindow) { mpPatched = pPaintWindow; } + SdrPaintWindow* getPatched() const { return mpPatched; } + + // data read accesses + OutputDevice& GetOutputDevice() const { return *mpOutputDevice; } + vcl::Window* GetWindow() const { return mpWindow; } + + // OVERLAYMANAGER + rtl::Reference< sdr::overlay::OverlayManager > const & GetOverlayManager() const; + + // #i73602# add flag if buffer shall be used + void DrawOverlay(const vcl::Region& rRegion); + + // calculate visible area and return + tools::Rectangle GetVisibleArea() const; + + // Is OutDev a printer? + bool OutputToPrinter() const { return (OUTDEV_PRINTER == mpOutputDevice->GetOutDevType()); } + + // Is OutDev a window? + bool OutputToWindow() const { return mbOutputToWindow; } + + void SetOutputToWindow(bool bOutputToWindow) { mbOutputToWindow = bOutputToWindow; } + + // Is OutDev a recording MetaFile? + bool OutputToRecordingMetaFile() const; + + // prepare PreRendering (evtl.) + void PreparePreRenderDevice(); + void DestroyPreRenderDevice(); + void OutputPreRenderDevice(const vcl::Region& rExpandedRegion); + SdrPreRenderDevice* GetPreRenderDevice() const { return mpPreRenderDevice.get(); } + + // RedrawRegion + const vcl::Region& GetRedrawRegion() const { return maRedrawRegion;} + void SetRedrawRegion(const vcl::Region& rNew); + + // #i72889# read/write access to TemporaryTarget + bool getTemporaryTarget() const { return mbTemporaryTarget; } + void setTemporaryTarget(bool bNew) { mbTemporaryTarget = bNew; } + + // #i72889# get target output device, take into account output buffering + OutputDevice& GetTargetOutputDevice() { if(mpPreRenderDevice) return mpPreRenderDevice->GetPreRenderDevice(); else return *mpOutputDevice; } +}; + +#endif // INCLUDED_SVX_SDRPAINTWINDOW_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdrundomanager.hxx b/include/svx/sdrundomanager.hxx new file mode 100644 index 000000000..ab92c931c --- /dev/null +++ b/include/svx/sdrundomanager.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_SVX_SDRUNDOMANAGER_HXX +#define INCLUDED_SVX_SDRUNDOMANAGER_HXX + +#include +#include +#include + +class SfxObjectShell; + +class SVXCORE_DLLPUBLIC SdrUndoManager : public EditUndoManager +{ +private: + using EditUndoManager::Undo; + using EditUndoManager::Redo; + + Link maEndTextEditHdl; + SfxUndoAction* mpLastUndoActionBeforeTextEdit; + bool mbEndTextEditTriggeredFromUndo; + + SfxObjectShell* m_pDocSh; +protected: + // call to check for TextEdit active + bool isTextEditActive() const; + virtual void EmptyActionsChanged() override; + +public: + SdrUndoManager(); + virtual ~SdrUndoManager() override; + + /// react depending on edit mode and if no more undo is possible + virtual bool Undo() override; + virtual bool Redo() override; + + // #i123350# + virtual void Clear() override; + + // Call for the view which starts the interactive text edit. Use link to + // activate (start text edit) and empty link to reset (end text edit). On + // reset all text edit actions will be removed from this undo manager to + // restore the state before activation + void SetEndTextEditHdl(const Link& rLink); + + // check from outside if we are inside a callback for ending text edit. This + // is needed to detect inside end text edit if it is a regular one or triggered + // by a last undo during text edit + bool isEndTextEditTriggeredFromUndo() const { return mbEndTextEditTriggeredFromUndo; } + void SetDocShell(SfxObjectShell* pDocShell); +}; + +#endif // INCLUDED_SVX_SDRUNDOMANAGER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdshcitm.hxx b/include/svx/sdshcitm.hxx new file mode 100644 index 000000000..01c474127 --- /dev/null +++ b/include/svx/sdshcitm.hxx @@ -0,0 +1,31 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_SDSHCITM_HXX +#define INCLUDED_SVX_SDSHCITM_HXX + +#include +#include + +inline XColorItem makeSdrShadowColorItem(const Color& rTheColor) { + return XColorItem(SDRATTR_SHADOWCOLOR, rTheColor); +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdshitm.hxx b/include/svx/sdshitm.hxx new file mode 100644 index 000000000..ab8a2b868 --- /dev/null +++ b/include/svx/sdshitm.hxx @@ -0,0 +1,31 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_SDSHITM_HXX +#define INCLUDED_SVX_SDSHITM_HXX + +#include +#include + +inline SdrOnOffItem makeSdrShadowItem(bool bShadow) { + return SdrOnOffItem(SDRATTR_SHADOW, bShadow); +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdshtitm.hxx b/include/svx/sdshtitm.hxx new file mode 100644 index 000000000..e1035077b --- /dev/null +++ b/include/svx/sdshtitm.hxx @@ -0,0 +1,31 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_SDSHTITM_HXX +#define INCLUDED_SVX_SDSHTITM_HXX + +#include +#include + +inline SdrPercentItem makeSdrShadowTransparenceItem(sal_uInt16 nTransp) { + return SdrPercentItem(SDRATTR_SHADOWTRANSPARENCE, nTransp); +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdsxyitm.hxx b/include/svx/sdsxyitm.hxx new file mode 100644 index 000000000..e2686a568 --- /dev/null +++ b/include/svx/sdsxyitm.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_SVX_SDSXYITM_HXX +#define INCLUDED_SVX_SDSXYITM_HXX + +#include +#include + +inline SdrMetricItem makeSdrShadowXDistItem(long nDist) { + return SdrMetricItem(SDRATTR_SHADOWXDIST, nDist); +} + +inline SdrMetricItem makeSdrShadowYDistItem(long nDist) { + return SdrMetricItem(SDRATTR_SHADOWYDIST, nDist); +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdtaaitm.hxx b/include/svx/sdtaaitm.hxx new file mode 100644 index 000000000..71764b296 --- /dev/null +++ b/include/svx/sdtaaitm.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_SVX_SDTAAITM_HXX +#define INCLUDED_SVX_SDTAAITM_HXX + +#include +#include +#include + +class SVXCORE_DLLPUBLIC SdrTextAniAmountItem final : public SfxInt16Item { +public: + SdrTextAniAmountItem(sal_Int16 nVal=0): SfxInt16Item(SDRATTR_TEXT_ANIAMOUNT,nVal) {} + virtual SdrTextAniAmountItem* Clone(SfxItemPool* pPool=nullptr) const override; + virtual bool HasMetrics() const override; + virtual void ScaleMetrics(long nMul, long nDiv) override; + + virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString& rText, const IntlWrapper&) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdtacitm.hxx b/include/svx/sdtacitm.hxx new file mode 100644 index 000000000..820aee926 --- /dev/null +++ b/include/svx/sdtacitm.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_SVX_SDTACITM_HXX +#define INCLUDED_SVX_SDTACITM_HXX + +#include +#include + +// Number of loops. 0=infinite. +class SAL_DLLPUBLIC_RTTI SdrTextAniCountItem final : public SfxUInt16Item { +public: + SdrTextAniCountItem(sal_uInt16 nVal=0): SfxUInt16Item(SDRATTR_TEXT_ANICOUNT,nVal) {} + + virtual SdrTextAniCountItem* Clone(SfxItemPool * = nullptr) const override + { return new SdrTextAniCountItem(*this); } +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdtaditm.hxx b/include/svx/sdtaditm.hxx new file mode 100644 index 000000000..1208dd772 --- /dev/null +++ b/include/svx/sdtaditm.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_SVX_SDTADITM_HXX +#define INCLUDED_SVX_SDTADITM_HXX + +#include +#include +#include + + + + +enum class SdrTextAniDirection +{ + Left, Right, Up, Down +}; + +class SVXCORE_DLLPUBLIC SdrTextAniDirectionItem: public SfxEnumItem { +public: + SdrTextAniDirectionItem(SdrTextAniDirection eDir=SdrTextAniDirection::Left): SfxEnumItem(SDRATTR_TEXT_ANIDIRECTION, eDir) {} + virtual SdrTextAniDirectionItem* Clone(SfxItemPool* pPool=nullptr) const override; + virtual sal_uInt16 GetValueCount() const override; + + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + static OUString GetValueTextByPos(sal_uInt16 nPos); + + virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString& rText, const IntlWrapper&) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdtagitm.hxx b/include/svx/sdtagitm.hxx new file mode 100644 index 000000000..df186107f --- /dev/null +++ b/include/svx/sdtagitm.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_SVX_SDTAGITM_HXX +#define INCLUDED_SVX_SDTAGITM_HXX + +#include +#include + +inline SdrOnOffItem makeSdrTextAutoGrowHeightItem(bool bAuto) { + return SdrOnOffItem(SDRATTR_TEXT_AUTOGROWHEIGHT, bAuto); +} + +inline SdrOnOffItem makeSdrTextAutoGrowWidthItem(bool bAuto) { + return SdrOnOffItem(SDRATTR_TEXT_AUTOGROWWIDTH, bAuto); +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdtaiitm.hxx b/include/svx/sdtaiitm.hxx new file mode 100644 index 000000000..d847208a6 --- /dev/null +++ b/include/svx/sdtaiitm.hxx @@ -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 INCLUDED_SVX_SDTAIITM_HXX +#define INCLUDED_SVX_SDTAIITM_HXX + +#include +#include + +class SVXCORE_DLLPUBLIC SdrTextAniStartInsideItem final : public SdrYesNoItem { +public: + SdrTextAniStartInsideItem(bool bOn=false): SdrYesNoItem(SDRATTR_TEXT_ANISTARTINSIDE,bOn) {} + virtual ~SdrTextAniStartInsideItem() override; + virtual SdrTextAniStartInsideItem* Clone(SfxItemPool* pPool=nullptr) const override; + + SdrTextAniStartInsideItem(SdrTextAniStartInsideItem const &) = default; + SdrTextAniStartInsideItem(SdrTextAniStartInsideItem &&) = default; + SdrTextAniStartInsideItem & operator =(SdrTextAniStartInsideItem const &) = delete; // due to SdrYesNoItem + SdrTextAniStartInsideItem & operator =(SdrTextAniStartInsideItem &&) = delete; // due to SdrYesNoItem +}; + +class SVXCORE_DLLPUBLIC SdrTextAniStopInsideItem final : public SdrYesNoItem { +public: + SdrTextAniStopInsideItem(bool bOn=false): SdrYesNoItem(SDRATTR_TEXT_ANISTOPINSIDE,bOn) {} + virtual ~SdrTextAniStopInsideItem() override; + virtual SdrTextAniStopInsideItem* Clone(SfxItemPool* pPool=nullptr) const override; + + SdrTextAniStopInsideItem(SdrTextAniStopInsideItem const &) = default; + SdrTextAniStopInsideItem(SdrTextAniStopInsideItem &&) = default; + SdrTextAniStopInsideItem & operator =(SdrTextAniStopInsideItem const &) = delete; // due to SdrYesNoItem + SdrTextAniStopInsideItem & operator =(SdrTextAniStopInsideItem &&) = delete; // due to SdrYesNoItem +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdtaitm.hxx b/include/svx/sdtaitm.hxx new file mode 100644 index 000000000..d977f83be --- /dev/null +++ b/include/svx/sdtaitm.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_SVX_SDTAITM_HXX +#define INCLUDED_SVX_SDTAITM_HXX + +#include +#include +#include + + + + +enum SdrTextVertAdjust {SDRTEXTVERTADJUST_TOP, // aligned to top (normally used) + SDRTEXTVERTADJUST_CENTER, // centered (for example for the title texts in Draw) + SDRTEXTVERTADJUST_BOTTOM, // aligned to bottom + SDRTEXTVERTADJUST_BLOCK // support vertical full with supported now + /*,SDRTEXTVERTADJUST_STRETCH*/}; // also stretch letters in their height (ni) + +class SVXCORE_DLLPUBLIC SdrTextVertAdjustItem: public SfxEnumItem { +public: + SdrTextVertAdjustItem(SdrTextVertAdjust eAdj=SDRTEXTVERTADJUST_TOP): SfxEnumItem(SDRATTR_TEXT_VERTADJUST, eAdj) {} + SdrTextVertAdjustItem(SdrTextVertAdjust eAdj, sal_uInt16 nWhich): SfxEnumItem(nWhich, eAdj) {} + virtual SdrTextVertAdjustItem* Clone(SfxItemPool* pPool=nullptr) const override; + virtual sal_uInt16 GetValueCount() const override; // { return 5; } + + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + static OUString GetValueTextByPos(sal_uInt16 nPos); + virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString& rText, const IntlWrapper&) const override; + virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override; +}; + + + + +enum SdrTextHorzAdjust {SDRTEXTHORZADJUST_LEFT, // left adjusted + SDRTEXTHORZADJUST_CENTER, // centered (for example for title texts in Draw) + SDRTEXTHORZADJUST_RIGHT, // right adjusted + SDRTEXTHORZADJUST_BLOCK // use the whole text frame width + /*,SDRTEXTHORZADJUST_STRETCH*/}; // FitToSize in X direction (ni). + +class SVXCORE_DLLPUBLIC SdrTextHorzAdjustItem: public SfxEnumItem { +public: + SdrTextHorzAdjustItem(SdrTextHorzAdjust eAdj=SDRTEXTHORZADJUST_BLOCK): SfxEnumItem(SDRATTR_TEXT_HORZADJUST, eAdj) {} + virtual SdrTextHorzAdjustItem* Clone(SfxItemPool* pPool=nullptr) const override; + virtual sal_uInt16 GetValueCount() const override; + + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + static OUString GetValueTextByPos(sal_uInt16 nPos); + virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString& rText, const IntlWrapper&) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdtakitm.hxx b/include/svx/sdtakitm.hxx new file mode 100644 index 000000000..f2dca7833 --- /dev/null +++ b/include/svx/sdtakitm.hxx @@ -0,0 +1,94 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_SDTAKITM_HXX +#define INCLUDED_SVX_SDTAKITM_HXX + +#include +#include +#include + +/** + * Animation type for text frame. + */ +enum class SdrTextAniKind { + NONE, /// no animation + Blink, /// blinking + Scroll, /// scroll through + Alternate, /// scroll back and forth + Slide /// scroll in +}; + +// - SdrTextAniKind::Blink: +// Just blink. Direction and Amount don't effect things. +// Frequency delay: 0 = 0.5Hz (Delay = 250). +// Count = number of blinks. (0 = forever) +// start inside: sal_False = begin with the blinker off, sal_True = begin with the blinker on +// stop inside: sal_False = end with the blinker off, sal_True = end with the blinker on +// (Only if count! = 0) +// - SdrTextAniKind::Scroll: +// Text just scrolls all the way through, and starts over when it is done. + +// Delay in ms: (except delay = 0 means 50ms (20Hz) default) +// Count = number of passes (0 = go forever) +// Direction: the direction to scroll +// StartInside: sal_False = on the first pass, scroll the text in (not initially visible) +// sal_True = on the first pass, the left part of the text is already visible +// in the scroll area before starting. +// StopInside: sal_False = on the last pass, scroll the text all the way out. +// sal_True = on the last pass, keep the right part of the text visible. +// (Only if count! = 0) +// Amount: Step size in logical units. Negative values = use Pixels instead +// of logical units. If Amount = 0, then default to 1 Pixel. +// - SdrTextAniKind::Alternate: +// Like SdrTextAniKind::Scroll, except don't scroll until all of the text is out, +// but just until the last part is visible. Then, change direction and +// scroll the text the other way. +// Count = number of passes (number of direction changes minus 1) +// If count = 1, this is the same as SdrTextAniKind::Scroll +// Direction = the starting direction. +// All Other Parameters: just like SdrTextAniKind::Scroll +// - SdrTextAniKind::Slide: +// Text will slide into the original position. +// -> same as SCROLL with StartInside = sal_False, StopInside = sal_True +// and Count = 1 (Count = 0 is interpreted as count = 1). +// For each count > 1, the text, will be slid out backwards +// (much like ALTERNATE) and then slid back in again. +// StopInside is not evaluated, because inside is always stopped. +// StartInside is not evaluated, because outside is always started. +// All other parameters are like SdrTextAniKind::Scroll +// StartInside, StopInside: When sal_True, the starting / final position +// of the text depends on the anchor of the drawing object. This +// corresponds to the position of the text in normal Paint (without scrolling). + +class SVXCORE_DLLPUBLIC SdrTextAniKindItem: public SfxEnumItem { +public: + SdrTextAniKindItem(SdrTextAniKind eKind=SdrTextAniKind::NONE): SfxEnumItem(SDRATTR_TEXT_ANIKIND, eKind) {} + virtual SdrTextAniKindItem* Clone(SfxItemPool* pPool=nullptr) const override; + virtual sal_uInt16 GetValueCount() const override; // { return 5; } + + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + static OUString GetValueTextByPos(sal_uInt16 nPos); + virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString& rText, const IntlWrapper&) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdtayitm.hxx b/include/svx/sdtayitm.hxx new file mode 100644 index 000000000..7308991d0 --- /dev/null +++ b/include/svx/sdtayitm.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_SVX_SDTAYITM_HXX +#define INCLUDED_SVX_SDTAYITM_HXX + +#include +#include +#include + +class SVXCORE_DLLPUBLIC SdrTextAniDelayItem final : public SfxUInt16Item { +public: + SdrTextAniDelayItem(sal_uInt16 nVal=0): SfxUInt16Item(SDRATTR_TEXT_ANIDELAY,nVal) {} + virtual SdrTextAniDelayItem* Clone(SfxItemPool* pPool=nullptr) const override; + virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString& rText, const IntlWrapper&) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdtcfitm.hxx b/include/svx/sdtcfitm.hxx new file mode 100644 index 000000000..aca6298d8 --- /dev/null +++ b/include/svx/sdtcfitm.hxx @@ -0,0 +1,31 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_SDTCFITM_HXX +#define INCLUDED_SVX_SDTCFITM_HXX + +#include +#include + +inline SdrOnOffItem makeSdrTextContourFrameItem(bool bOn) { + return SdrOnOffItem(SDRATTR_TEXT_CONTOURFRAME, bOn); +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdtditm.hxx b/include/svx/sdtditm.hxx new file mode 100644 index 000000000..9e363c762 --- /dev/null +++ b/include/svx/sdtditm.hxx @@ -0,0 +1,43 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_SDTDITM_HXX +#define INCLUDED_SVX_SDTDITM_HXX + +#include +#include + +inline SdrMetricItem makeSdrTextLeftDistItem(long mnHeight) { + return SdrMetricItem(SDRATTR_TEXT_LEFTDIST, mnHeight); +} + +inline SdrMetricItem makeSdrTextRightDistItem(long mnHeight) { + return SdrMetricItem(SDRATTR_TEXT_RIGHTDIST, mnHeight); +} + +inline SdrMetricItem makeSdrTextUpperDistItem(long mnHeight) { + return SdrMetricItem(SDRATTR_TEXT_UPPERDIST, mnHeight); +} + +inline SdrMetricItem makeSdrTextLowerDistItem(long mnHeight) { + return SdrMetricItem(SDRATTR_TEXT_LOWERDIST, mnHeight); +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdtfchim.hxx b/include/svx/sdtfchim.hxx new file mode 100644 index 000000000..2fe5427c5 --- /dev/null +++ b/include/svx/sdtfchim.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_SVX_SDTFCHIM_HXX +#define INCLUDED_SVX_SDTFCHIM_HXX + +#include +#include +#include + +class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) SdrTextFixedCellHeightItem final : public SfxBoolItem +{ +public: + + SdrTextFixedCellHeightItem( bool bUseFixedCellHeight = false ); + + SVX_DLLPRIVATE virtual bool GetPresentation(SfxItemPresentation ePresentation, + MapUnit eCoreMetric, MapUnit ePresentationMetric, + OUString &rText, const IntlWrapper&) const override; + + SVX_DLLPRIVATE virtual SdrTextFixedCellHeightItem* Clone( SfxItemPool* pPool = nullptr ) const override; + + SVX_DLLPRIVATE virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + SVX_DLLPRIVATE virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdtfsitm.hxx b/include/svx/sdtfsitm.hxx new file mode 100644 index 000000000..c446bc1fb --- /dev/null +++ b/include/svx/sdtfsitm.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_SVX_SDTFSITM_HXX +#define INCLUDED_SVX_SDTFSITM_HXX + +#include + +#include +#include +#include + + +// No automatic line breaks for AutoGrowingWidth as well (only if +// TextMaxFrameWidth is reached). + + +class SVXCORE_DLLPUBLIC SdrTextFitToSizeTypeItem + : public SfxEnumItem +{ +public: + static SfxPoolItem* CreateDefault(); + SdrTextFitToSizeTypeItem( + css::drawing::TextFitToSizeType const eFit = css::drawing::TextFitToSizeType_NONE) + : SfxEnumItem(SDRATTR_TEXT_FITTOSIZE, eFit) {} + SdrTextFitToSizeTypeItem(const SdrTextFitToSizeTypeItem& rItem) + : SfxEnumItem(rItem), + m_nMaxScale(rItem.GetMaxScale()) + { + } + virtual SdrTextFitToSizeTypeItem* Clone(SfxItemPool* pPool=nullptr) const override; + bool operator==(const SfxPoolItem& rItem) const override; + virtual sal_uInt16 GetValueCount() const override; + + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + static OUString GetValueTextByPos(sal_uInt16 nPos); + virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString& rText, const IntlWrapper&) const override; + virtual bool HasBoolValue() const override; + virtual bool GetBoolValue() const override; + virtual void SetBoolValue(bool bVal) override; + void SetMaxScale(sal_Int16 nMaxScale) { m_nMaxScale = nMaxScale; } + sal_Int16 GetMaxScale() const { return m_nMaxScale; } +private: + sal_Int16 m_nMaxScale = 0; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdtmfitm.hxx b/include/svx/sdtmfitm.hxx new file mode 100644 index 000000000..838d938c3 --- /dev/null +++ b/include/svx/sdtmfitm.hxx @@ -0,0 +1,43 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_SDTMFITM_HXX +#define INCLUDED_SVX_SDTMFITM_HXX + +#include +#include + +inline SdrMetricItem makeSdrTextMinFrameHeightItem(long mnHeight) { + return SdrMetricItem(SDRATTR_TEXT_MINFRAMEHEIGHT, mnHeight); +} + +inline SdrMetricItem makeSdrTextMaxFrameHeightItem(long mnHeight) { + return SdrMetricItem(SDRATTR_TEXT_MAXFRAMEHEIGHT, mnHeight); +} + +inline SdrMetricItem makeSdrTextMinFrameWidthItem(long mnWidth) { + return SdrMetricItem(SDRATTR_TEXT_MINFRAMEWIDTH, mnWidth); +}; + +inline SdrMetricItem makeSdrTextMaxFrameWidthItem(long mnWidth) { + return SdrMetricItem(SDRATTR_TEXT_MAXFRAMEWIDTH, mnWidth); +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sdynitm.hxx b/include/svx/sdynitm.hxx new file mode 100644 index 000000000..a67f3f41f --- /dev/null +++ b/include/svx/sdynitm.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_SVX_SDYNITM_HXX +#define INCLUDED_SVX_SDYNITM_HXX + +#include +#include + + +// class SdrYesNoItem +// GetValueTextByVal() returns "yes" or "no" +// instead of "TRUE" and "FALSE" +//-------------------------------------------------- ---------- +class SVXCORE_DLLPUBLIC SdrYesNoItem: public SfxBoolItem { +public: + SdrYesNoItem(sal_uInt16 nId, bool bOn): SfxBoolItem(nId,bOn) {} + virtual SdrYesNoItem* Clone(SfxItemPool* pPool=nullptr) const override; + virtual OUString GetValueTextByVal(bool bVal) const override; + virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString& rText, const IntlWrapper&) const override; +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/searchcharmap.hxx b/include/svx/searchcharmap.hxx new file mode 100644 index 000000000..33d743209 --- /dev/null +++ b/include/svx/searchcharmap.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_SVX_SEARCHCHARMAP_HXX +#define INCLUDED_SVX_SEARCHCHARMAP_HXX + +#include + +#include +#include +#include +#include +#include +#include + +namespace svx { struct SvxShowCharSetItem; } +namespace tools { class Rectangle; } +namespace weld { class ScrolledWindow; } + +class Subset; + +class SVX_DLLPUBLIC SvxSearchCharSet final : public SvxShowCharSet +{ +public: + SvxSearchCharSet(std::unique_ptr pScrolledWindow, const VclPtr &rDevice); + virtual ~SvxSearchCharSet() override; + + virtual void RecalculateFont(vcl::RenderContext& rRenderContext) override; + + void SelectCharacter( const Subset* sub); + virtual sal_UCS4 GetSelectCharacter() const override; + + virtual svx::SvxShowCharSetItem* ImplGetItem( int _nPos ) override; + virtual int LastInView() const override; + virtual void SelectIndex( int index, bool bFocus = false ) override; + void AppendCharToList(sal_UCS4 cChar); + void ClearPreviousData(); + + virtual sal_Int32 getMaxCharCount() const override; + +private: + sal_Int32 nCount; + + //index to char code mapping for the search + //to uniquely identify each appended element + std::unordered_map m_aItemList; +private: + virtual void DrawChars_Impl(vcl::RenderContext& rRenderContext, int n1, int n2) override; + virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override; + virtual bool KeyInput(const KeyEvent& rKEvt) override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/selctrl.hxx b/include/svx/selctrl.hxx new file mode 100644 index 000000000..1767c918f --- /dev/null +++ b/include/svx/selctrl.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_SVX_SELCTRL_HXX +#define INCLUDED_SVX_SELCTRL_HXX + +#include +#include +#include + +/// Status bar control that indicates or changes the selection mode (standard / block / etc.) +class SVX_DLLPUBLIC SvxSelectionModeControl final : public SfxStatusBarControl +{ +public: + SFX_DECL_STATUSBAR_CONTROL(); + + SvxSelectionModeControl( sal_uInt16 nSlotId, sal_uInt16 nId, StatusBar& rStb ); + + virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, + const SfxPoolItem* pState ) override; + virtual bool MouseButtonDown( const MouseEvent& rEvt ) override; + virtual void Paint( const UserDrawEvent& rEvt ) override; + +private: + sal_uInt16 mnState; + Image maImage; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/selectioncontroller.hxx b/include/svx/selectioncontroller.hxx new file mode 100644 index 000000000..ded8adf06 --- /dev/null +++ b/include/svx/selectioncontroller.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_SVX_SELECTIONCONTROLLER_HXX +#define INCLUDED_SVX_SELECTIONCONTROLLER_HXX + +#include +#include +#include + +class KeyEvent; +class MouseEvent; +namespace vcl { class Window; } +class SfxItemSet; +class SfxRequest; +class SfxStyleSheet; +class SdrModel; +class Point; +class FontList; +class SdrObject; + +namespace sdr +{ + +namespace table { struct CellPos; } + +class SVXCORE_DLLPUBLIC SelectionController: public cppu::OWeakObject +{ +public: + virtual bool onKeyInput(const KeyEvent& rKEvt, vcl::Window* pWin); + virtual bool onMouseButtonDown(const MouseEvent& rMEvt, vcl::Window* pWin); + virtual bool onMouseButtonUp(const MouseEvent& rMEvt, vcl::Window* pWin); + virtual bool onMouseMove(const MouseEvent& rMEvt, vcl::Window* pWin); + + virtual void onSelectionHasChanged(); + + virtual void GetState( SfxItemSet& rSet ); + virtual void Execute( SfxRequest& rReq ); + + virtual bool DeleteMarked(); + + virtual bool GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr) const; + virtual bool SetAttributes(const SfxItemSet& rSet, bool bReplaceAll); + + virtual bool GetStyleSheet( SfxStyleSheet* &rpStyleSheet ) const; + virtual bool SetStyleSheet( SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr ); + + virtual SdrObject* GetMarkedSdrObjClone( SdrModel& rTargetModel ); + virtual bool PasteObjModel( const SdrModel& rModel ); + + /** applies a format paint brush set from the current selection. + if bNoCharacterFormats is true, no character attributes are changed. + if bNoParagraphFormats is true, no paragraph attributes are changed. + */ + virtual bool ApplyFormatPaintBrush( SfxItemSet& rFormatSet, bool bNoCharacterFormats, bool bNoParagraphFormats ); + /// This is a table object, and one or more of its cells are selected. + virtual bool hasSelectedCells() const; + /// Allows adjusting the point or mark of the selection to a document coordinate. + virtual bool setCursorLogicPosition(const Point& rPosition, bool bPoint); + /// Get the position of the first and the last selected cell. + virtual void getSelectedCells(table::CellPos& rFirstPos, table::CellPos& rLastPos); + /// Changes the font (grow/shrink) according to the input parameters. + virtual bool ChangeFontSize(bool bGrow, const FontList* pFontList); +}; + +} + +#endif // INCLUDED_SVX_SELECTIONCONTROLLER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/shapeproperty.hxx b/include/svx/shapeproperty.hxx new file mode 100644 index 000000000..bb0011199 --- /dev/null +++ b/include/svx/shapeproperty.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_SVX_SHAPEPROPERTY_HXX +#define INCLUDED_SVX_SHAPEPROPERTY_HXX + + +namespace svx +{ + + //= ShapeProperty + + enum class ShapeProperty + { + // generic (UNO) shape properties + Position, + Size, + // text doc shape properties + TextDocAnchor + }; + +} + +#endif // INCLUDED_SVX_SHAPEPROPERTY_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/shapepropertynotifier.hxx b/include/svx/shapepropertynotifier.hxx new file mode 100644 index 000000000..455acddee --- /dev/null +++ b/include/svx/shapepropertynotifier.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_SVX_SHAPEPROPERTYNOTIFIER_HXX +#define INCLUDED_SVX_SHAPEPROPERTYNOTIFIER_HXX + +#include +#include +#include +#include + +#include + +namespace com::sun::star::beans { class XPropertyChangeListener; } +namespace com::sun::star::uno { class Any; } +namespace com::sun::star::uno { template class Reference; } +namespace osl { class Mutex; } + +namespace cppu +{ + class OWeakObject; +} + + +namespace svx +{ + + + //= IPropertyValueProvider + + /** a provider for a property value + */ + class SVXCORE_DLLPUBLIC IPropertyValueProvider + { + public: + /** returns the name of the property which this provider is responsible for + */ + virtual OUString getPropertyName() const = 0; + + /** returns the current value of the property which the provider is responsible for + */ + virtual void getCurrentValue( css::uno::Any& _out_rValue ) const = 0; + + virtual ~IPropertyValueProvider(); + }; + + //= PropertyValueProvider + + /** default implementation of an IPropertyValueProvider + + This default implementation queries the object which it is constructed with for the XPropertySet interface, + and calls the getPropertyValue method. + */ + class SVXCORE_DLLPUBLIC PropertyValueProvider :public IPropertyValueProvider + { + public: + PropertyValueProvider( ::cppu::OWeakObject& _rContext, const char* _pAsciiPropertyName ) + :m_rContext( _rContext ) + ,m_sPropertyName( OUString::createFromAscii( _pAsciiPropertyName ) ) + { + } + + virtual OUString getPropertyName() const override; + virtual void getCurrentValue( css::uno::Any& _out_rValue ) const override; + + protected: + ::cppu::OWeakObject& getContext() const { return m_rContext; } + PropertyValueProvider(const PropertyValueProvider&) = delete; + PropertyValueProvider& operator=(const PropertyValueProvider&) = delete; + + private: + ::cppu::OWeakObject& m_rContext; + const OUString m_sPropertyName; + }; + + + //= PropertyChangeNotifier + + struct PropertyChangeNotifier_Data; + + /** helper class for notifying XPropertyChangeListeners + + The class is intended to be held as member of the class which does the property change broadcasting. + */ + class SVXCORE_DLLPUBLIC PropertyChangeNotifier + { + public: + /** constructs a notifier instance + + @param _rOwner + the owner instance of the notifier. Will be used as css.lang.EventObject.Source when + notifying events. + */ + PropertyChangeNotifier( ::cppu::OWeakObject& _rOwner, ::osl::Mutex& _rMutex ); + ~PropertyChangeNotifier(); + + // listener maintenance + void addPropertyChangeListener( const OUString& _rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& _rxListener ); + void removePropertyChangeListener( const OUString& _rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& _rxListener ); + + /** registers an IPropertyValueProvider + */ + void registerProvider( const ShapeProperty _eProperty, const std::shared_ptr& _rProvider ); + + /** notifies changes in the given property to all registered listeners + + If no property value provider for the given property ID is registered, this is worth an assertion in a + non-product build, and otherwise ignored. + */ + void notifyPropertyChange( const ShapeProperty _eProperty ) const; + + /** is called to dispose the instance + */ + void disposing(); + + private: + PropertyChangeNotifier(const PropertyChangeNotifier&) = delete; + PropertyChangeNotifier& operator=(const PropertyChangeNotifier&) = delete; + + std::unique_ptr< PropertyChangeNotifier_Data > m_xData; + }; + + +} + + +#endif // INCLUDED_SVX_SHAPEPROPERTYNOTIFIER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sidebar/AreaPropertyPanelBase.hxx b/include/svx/sidebar/AreaPropertyPanelBase.hxx new file mode 100644 index 000000000..2ea0356db --- /dev/null +++ b/include/svx/sidebar/AreaPropertyPanelBase.hxx @@ -0,0 +1,178 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_SOURCE_SIDEBAR_AREA_AREAPROPERTYPANELBASE_HXX +#define INCLUDED_SVX_SOURCE_SIDEBAR_AREA_AREAPROPERTYPANELBASE_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class ToolbarUnoDispatcher; +class XFillFloatTransparenceItem; +class XFillTransparenceItem; +class XFillStyleItem; +class XFillGradientItem; +class XFillColorItem; +class XFillHatchItem; +class XFillBitmapItem; + +namespace svx::sidebar { + +class SVX_DLLPUBLIC AreaPropertyPanelBase +: public PanelLayout, + public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface +{ +public: + + virtual void dispose() override; + + virtual void DataChanged( + const DataChangedEvent& rEvent) override; + + virtual void NotifyItemUpdate( + const sal_uInt16 nSId, + const SfxItemState eState, + const SfxPoolItem* pState) override; + + virtual void GetControlState( + const sal_uInt16 /*nSId*/, + boost::property_tree::ptree& /*rState*/) override {}; + + const static sal_Int32 DEFAULT_CENTERX; + const static sal_Int32 DEFAULT_CENTERY; + const static sal_Int32 DEFAULT_ANGLE; + const static sal_Int32 DEFAULT_STARTVALUE; + const static sal_Int32 DEFAULT_ENDVALUE; + const static sal_Int32 DEFAULT_BORDER; + + const XGradient& GetGradient (const css::awt::GradientStyle eStyle) const; + void SetGradient (const XGradient& rGradient); + sal_Int32 GetSelectedTransparencyTypeIndex() const; + + // constructor/destructor + AreaPropertyPanelBase( + vcl::Window* pParent, + const css::uno::Reference& rxFrame); + + virtual ~AreaPropertyPanelBase() override; + + virtual void setFillTransparence(const XFillTransparenceItem& rItem) = 0; + virtual void setFillFloatTransparence(const XFillFloatTransparenceItem& rItem) = 0; + virtual void setFillStyle(const XFillStyleItem& rItem) = 0; + virtual void setFillStyleAndColor(const XFillStyleItem* pStyleItem, const XFillColorItem& aColorItem) = 0; + virtual void setFillStyleAndGradient(const XFillStyleItem* pStyleItem, const XFillGradientItem& aGradientItem) = 0; + virtual void setFillStyleAndHatch(const XFillStyleItem* pStyleItem, const XFillHatchItem& aHatchItem) = 0; + virtual void setFillStyleAndBitmap(const XFillStyleItem* pStyleItem, const XFillBitmapItem& aHatchItem) = 0; + + void updateFillTransparence(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem* pState); + void updateFillFloatTransparence(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem* pState); + void updateFillStyle(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem* pState); + void updateFillGradient(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem* pState); + void updateFillHatch(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem* pState); + void updateFillColor(bool bDefaultOrSet, const SfxPoolItem* pState); + void updateFillBitmap(bool BDisabled, bool bDefaultOrSet, const SfxPoolItem* pState); + +private: + void Initialize(); + +protected: + sal_uInt16 meLastXFS; + + sal_Int32 mnLastPosHatch; + sal_Int32 mnLastPosBitmap; + sal_Int32 mnLastPosPattern; + sal_uInt16 mnLastTransSolid; + + XGradient maGradientLinear; + XGradient maGradientAxial; + XGradient maGradientRadial; + XGradient maGradientElliptical; + XGradient maGradientSquare; + XGradient maGradientRect; + + //ui controls + std::unique_ptr mxColorTextFT; + std::unique_ptr mxLbFillType; + std::unique_ptr mxLbFillAttr; + std::unique_ptr mxLbFillGradFrom; + std::unique_ptr mxLbFillGradTo; + std::unique_ptr mxToolBoxColor; // for new color picker + std::unique_ptr mxColorDispatch; + std::unique_ptr mxTrspTextFT; + std::unique_ptr mxLBTransType; + std::unique_ptr mxMTRTransparent; + std::unique_ptr mxSldTransparent; + std::unique_ptr mxBTNGradient; + std::unique_ptr mxMTRAngle; + std::unique_ptr mxGradientStyle; + std::unique_ptr mxBmpImport; + std::unique_ptr mxTrGrPopup; + + std::unique_ptr< XFillStyleItem > mpStyleItem; + std::unique_ptr< XFillColorItem > mpColorItem; + std::unique_ptr< XFillGradientItem > mpFillGradientItem; + std::unique_ptr< XFillHatchItem > mpHatchItem; + std::unique_ptr< XFillBitmapItem > mpBitmapItem; + + OUString maImgAxial; + OUString maImgElli; + OUString maImgQuad; + OUString maImgRadial; + OUString maImgSquare; + OUString maImgLinear; + + VclPtr mpPanel; + + std::unique_ptr< XFillFloatTransparenceItem > mpFloatTransparenceItem; + std::unique_ptr< SfxUInt16Item > mpTransparanceItem; + + DECL_LINK(SelectFillTypeHdl, weld::ComboBox&, void ); + DECL_LINK(SelectFillAttrHdl, weld::ComboBox&, void ); + DECL_LINK(SelectFillColorHdl, ColorListBox&, void); + DECL_LINK(ChangeGradientAngle, weld::MetricSpinButton&, void); + DECL_LINK(ChangeTrgrTypeHdl_Impl, weld::ComboBox&, void); + DECL_LINK(ModifyTransparentHdl_Impl, weld::MetricSpinButton&, void); + DECL_LINK(ModifyTransSliderHdl, weld::Scale&, void); + DECL_LINK(ClickImportBitmapHdl, weld::Button&, void); + DECL_LINK(ToolbarHdl_Impl, const OString&, void); + + void Update(); + void ImpUpdateTransparencies(); + void SetTransparency(sal_uInt16 nVal); + void SelectFillAttrHdl_Impl(); +}; + +} // end of namespace svx::sidebar + +#endif // INCLUDED_SVX_SOURCE_SIDEBAR_AREA_AREAPROPERTYPANEL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sidebar/AreaTransparencyGradientPopup.hxx b/include/svx/sidebar/AreaTransparencyGradientPopup.hxx new file mode 100644 index 000000000..29e6b4f84 --- /dev/null +++ b/include/svx/sidebar/AreaTransparencyGradientPopup.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_SVX_SOURCE_SIDEBAR_AREA_AREATRANSPARENCYGRADIENTPOPUP_HXX +#define INCLUDED_SVX_SOURCE_SIDEBAR_AREA_AREATRANSPARENCYGRADIENTPOPUP_HXX + +#include + +class XFillFloatTransparenceItem; + +namespace svx::sidebar { + +class AreaTransparencyGradientControl; +class AreaPropertyPanelBase; + +class AreaTransparencyGradientPopup final +{ +private: + AreaPropertyPanelBase& mrAreaPropertyPanel; + std::unique_ptr mxBuilder; + std::unique_ptr mxTopLevel; + std::unique_ptr mxCenterGrid; + std::unique_ptr mxAngleGrid; + std::unique_ptr mxMtrTrgrCenterX; + std::unique_ptr mxMtrTrgrCenterY; + std::unique_ptr mxMtrTrgrAngle; + std::unique_ptr mxBtnLeft45; + std::unique_ptr mxBtnRight45; + std::unique_ptr mxMtrTrgrStartValue; + std::unique_ptr mxMtrTrgrEndValue; + std::unique_ptr mxMtrTrgrBorder; + + void InitStatus(XFillFloatTransparenceItem const * pGradientItem); + void ExecuteValueModify(sal_uInt8 nStartCol, sal_uInt8 nEndCol); + DECL_LINK(ModifiedTrgrHdl_Impl, weld::MetricSpinButton&, void); + DECL_LINK(Left_Click45_Impl, const OString&, void); + DECL_LINK(Right_Click45_Impl, const OString&, void); + DECL_LINK(FocusHdl, weld::Widget&, void); + +public: + AreaTransparencyGradientPopup(AreaPropertyPanelBase& rPanel, weld::Widget* pParent); + ~AreaTransparencyGradientPopup(); + + weld::Container* getTopLevel() const { return mxTopLevel.get(); } + + void Rearrange(XFillFloatTransparenceItem const * pItem); +}; + +} // end of namespace svx::sidebar + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sidebar/ContextChangeEventMultiplexer.hxx b/include/svx/sidebar/ContextChangeEventMultiplexer.hxx new file mode 100644 index 000000000..1c8f58d1c --- /dev/null +++ b/include/svx/sidebar/ContextChangeEventMultiplexer.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_SVX_SIDEBAR_CONTEXTCHANGEEVENTMULTIPLEXER_HXX +#define INCLUDED_SVX_SIDEBAR_CONTEXTCHANGEEVENTMULTIPLEXER_HXX + +#include +#include +#include +#include + + +class SfxViewShell; + +/** Convenience frontend for css::ui::ContextChangeEventMultiplexer +*/ +class SVX_DLLPUBLIC ContextChangeEventMultiplexer +{ +public: + /** Notify the activation of a context. + @param rxController + This controller is used to determine the module (ie + application like Writer or Calc). + @param eContext + The activated context. + */ + static void NotifyContextChange ( + const css::uno::Reference& rxController, + const vcl::EnumContext::Context eContext); + + /** Notify the activation of a context. + @param pViewShell + This view shell is used to determine the module (ie + application like Writer or Calc). When then no + notification is made. + @param eContext + The activated context. + */ + static void NotifyContextChange ( + const SfxViewShell* pViewShell, + const vcl::EnumContext::Context eContext); + +private: + static OUString GetModuleName ( + const css::uno::Reference& rxFrame); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sidebar/LinePropertyPanelBase.hxx b/include/svx/sidebar/LinePropertyPanelBase.hxx new file mode 100644 index 000000000..40b4cc6f4 --- /dev/null +++ b/include/svx/sidebar/LinePropertyPanelBase.hxx @@ -0,0 +1,147 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_SOURCE_SIDEBAR_LINE_LINEPROPERTYPANELBASE_HXX +#define INCLUDED_SVX_SOURCE_SIDEBAR_LINE_LINEPROPERTYPANELBASE_HXX + +#include +#include +#include +#include +#include +#include +#include +#include + +class ToolbarUnoDispatcher; +class XLineStyleItem; +class XLineDashItem; +class XLineStartItem; +class XLineWidthItem; +class XLineEndItem; +class XLineEndList; +class XLineJointItem; +class XLineCapItem; +class XLineTransparenceItem; +class XDashList; + +namespace svx +{ +namespace sidebar +{ + +class DisableArrowsWrapper; + +class SVX_DLLPUBLIC LinePropertyPanelBase : public PanelLayout +{ +public: + virtual ~LinePropertyPanelBase() override; + virtual void dispose() override; + + void SetWidth(long nWidth); + void SetWidthIcon(int n); + void SetWidthIcon(); + + void EndLineWidthPopup(); + + // constructor/destructor + LinePropertyPanelBase( + vcl::Window* pParent, + const css::uno::Reference& rxFrame); + + virtual void setLineWidth(const XLineWidthItem& rItem) = 0; + + void SetNoneLineStyle(bool bNoneLineStyle) + { + if (bNoneLineStyle != mbNoneLineStyle) + { + mbNoneLineStyle = bNoneLineStyle; + ActivateControls(); + } + } + +protected: + + void ActivateControls(); + + virtual void setLineTransparency(const XLineTransparenceItem& rItem) = 0; + virtual void setLineJoint(const XLineJointItem* pItem) = 0; + virtual void setLineCap(const XLineCapItem* pItem) = 0; + + void updateLineTransparence(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem); + void updateLineWidth(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem); + void updateLineJoint(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem); + void updateLineCap(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem); + + void setMapUnit(MapUnit eMapUnit); + + void enableArrowHead(); + void disableArrowHead(); + +protected: + + std::unique_ptr mxTBColor; + std::unique_ptr mxColorDispatch; + + std::unique_ptr mxLineStyleTB; + std::unique_ptr mxLineStyleDispatch; + +private: + //ui controls + std::unique_ptr mxFTWidth; + std::unique_ptr mxTBWidth; + std::unique_ptr mxFTTransparency; + std::unique_ptr mxMFTransparent; + std::unique_ptr mxFTEdgeStyle; + std::unique_ptr mxLBEdgeStyle; + std::unique_ptr mxFTCapStyle; + std::unique_ptr mxLBCapStyle; + std::unique_ptr mxGridLineProps; + std::unique_ptr mxBoxArrowProps; + //popup windows + std::unique_ptr mxLineWidthPopup; + + std::unique_ptr mxDisableArrowsWrapper; + + sal_uInt16 mnTrans; + MapUnit meMapUnit; + sal_Int32 mnWidthCoreValue; + + // images from resource + OUString maIMGNone; + + // multi-images + OUString maIMGWidthIcon[8]; + + bool mbWidthValuable : 1; + bool mbArrowSupported; + bool mbNoneLineStyle; + + void Initialize(); + + DECL_LINK(ToolboxWidthSelectHdl, const OString&, void); + DECL_LINK(ChangeTransparentHdl, weld::MetricSpinButton&, void ); + DECL_LINK(ChangeEdgeStyleHdl, weld::ComboBox&, void); + DECL_LINK(ChangeCapStyleHdl, weld::ComboBox&, void); +}; + +} } // end of namespace svx::sidebar + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sidebar/LineWidthPopup.hxx b/include/svx/sidebar/LineWidthPopup.hxx new file mode 100644 index 000000000..c16924d0c --- /dev/null +++ b/include/svx/sidebar/LineWidthPopup.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_SVX_SOURCE_SIDEBAR_LINE_LINEWIDTHPOPUP_HXX +#define INCLUDED_SVX_SOURCE_SIDEBAR_LINE_LINEWIDTHPOPUP_HXX + +#include +#include +#include +#include +#include + +class ValueSet; + +namespace svx::sidebar { + +class LinePropertyPanelBase; +class LineWidthValueSet; + +class LineWidthPopup final +{ +public: + LineWidthPopup(weld::Widget* pParent, LinePropertyPanelBase& rParent); + ~LineWidthPopup(); + + void SetWidthSelect (long lValue, bool bValuable, MapUnit eMapUnit); + + weld::Container* getTopLevel() const { return m_xTopLevel.get(); } + +private: + LinePropertyPanelBase& m_rParent; + std::array maStrUnits; + OUString m_sPt; + MapUnit m_eMapUnit; + bool m_bVSFocus; + bool m_bCustom; + long m_nCustomWidth; + Image m_aIMGCus; + Image m_aIMGCusGray; + + std::unique_ptr m_xBuilder; + std::unique_ptr m_xTopLevel; + std::unique_ptr m_xMFWidth; + std::unique_ptr m_xVSWidth; + std::unique_ptr m_xVSWidthWin; + + DECL_LINK(VSSelectHdl, ValueSet*, void); + DECL_LINK(MFModifyHdl, weld::MetricSpinButton&, void); + DECL_LINK(FocusHdl, weld::Widget&, void); +}; + +} // end of namespace svx::sidebar + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sidebar/SelectionAnalyzer.hxx b/include/svx/sidebar/SelectionAnalyzer.hxx new file mode 100644 index 000000000..a7b8cba99 --- /dev/null +++ b/include/svx/sidebar/SelectionAnalyzer.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_SVX_SIDEBAR_SELECTIONANALYZER_HXX +#define INCLUDED_SVX_SIDEBAR_SELECTIONANALYZER_HXX + +#include +#include + +class SdrMarkList; +class SdrObject; +enum class SdrInventor : sal_uInt32; + +namespace svx::sidebar { + +/** Analyze the current selection of Calc or Draw/Impress documents + and return the associated sidebar context. + + The decision is based on heuristics. Do not expect pretty code. +*/ +class SVX_DLLPUBLIC SelectionAnalyzer +{ +public: + static vcl::EnumContext::Context GetContextForSelection_SC ( + const SdrMarkList& rMarkList); + + enum class ViewType + { + Standard, + Master, + Handout, + Notes, + }; + static vcl::EnumContext::Context GetContextForSelection_SD ( + const SdrMarkList& rMarkList, + const ViewType eViewType); + +private: + static vcl::EnumContext::Context GetContextForObjectId_SC ( + const sal_uInt16 nObjectId); + static vcl::EnumContext::Context GetContextForObjectId_SD ( + const sal_uInt16 nObjectId, + const ViewType eViewType); + static SdrInventor GetInventorTypeFromMark ( + const SdrMarkList& rMarkList); + static sal_uInt16 GetObjectTypeFromMark ( + const SdrMarkList& rMarkList); + static sal_uInt16 GetObjectTypeFromGroup ( + const SdrObject* pObj); + static bool IsShapeType ( + const sal_uInt16 nType); + static bool IsTextObjType ( + const sal_uInt16 nType); +}; + +} // end of namespace svx::sidebar + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sidebar/SelectionChangeHandler.hxx b/include/svx/sidebar/SelectionChangeHandler.hxx new file mode 100644 index 000000000..4f5c5b818 --- /dev/null +++ b/include/svx/sidebar/SelectionChangeHandler.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_SVX_SIDEBAR_SELECTIONCHANGEHANDLER_HXX +#define INCLUDED_SVX_SIDEBAR_SELECTIONCHANGEHANDLER_HXX + +#include +#include +#include +#include + +#include +#include + +#include + +class SdrMarkView; + + +namespace svx::sidebar { + +typedef cppu::WeakComponentImplHelper< + css::view::XSelectionChangeListener + > SelectionChangeHandlerInterfaceBase; + +class SVX_DLLPUBLIC SelectionChangeHandler final + : private ::cppu::BaseMutex, + public SelectionChangeHandlerInterfaceBase +{ +public: + SelectionChangeHandler ( + const std::function& rSelectionChangeCallback, + const css::uno::Reference& rxController, + const vcl::EnumContext::Context eDefaultContext); + virtual ~SelectionChangeHandler() override; + + virtual void SAL_CALL selectionChanged (const css::lang::EventObject& rEvent) override; + + virtual void SAL_CALL disposing (const css::lang::EventObject& rEvent) override; + + virtual void SAL_CALL disposing() override; + + void Connect(); + void Disconnect(); + +private: + SelectionChangeHandler(const SelectionChangeHandler&) = delete; + SelectionChangeHandler& operator=(const SelectionChangeHandler&) = delete; + + const std::function maSelectionChangeCallback; + css::uno::Reference mxController; + const vcl::EnumContext::Context meDefaultContext; + bool mbIsConnected; +}; + + +} // end of namespace svx::sidebar + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sidebar/ValueSetWithTextControl.hxx b/include/svx/sidebar/ValueSetWithTextControl.hxx new file mode 100644 index 000000000..5dd075a28 --- /dev/null +++ b/include/svx/sidebar/ValueSetWithTextControl.hxx @@ -0,0 +1,63 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_SIDEBAR_VALUESETWITHTEXTCONTROL_HXX +#define INCLUDED_SVX_SIDEBAR_VALUESETWITHTEXTCONTROL_HXX + +#include + +#include + +#include + +namespace svx::sidebar { + +/** Specialization of class . + This specialization allows is a one-columned ValueSet which allow + items containing an image and a text or a text and a second text. + + Especially, used for sidebar related controls. +*/ +class SVX_DLLPUBLIC ValueSetWithTextControl final : public ValueSet +{ +public: + ValueSetWithTextControl(); + + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; + + void AddItem( + const OUString& rItemText, + const OUString& rItemText2 ); + + virtual void UserDraw( const UserDrawEvent& rUDEvt ) override; + +private: + struct ValueSetWithTextItem + { + OUString maItemText; + OUString maItemText2; + }; + + ::std::vector< ValueSetWithTextItem > maItems; +}; + +} // end of namespace svx::sidebar + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/spacinglistbox.hxx b/include/svx/spacinglistbox.hxx new file mode 100644 index 000000000..455a5729c --- /dev/null +++ b/include/svx/spacinglistbox.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_SVX_SPACINGLISTBOXHELPER_HXX +#define INCLUDED_SVX_SPACINGLISTBOXHELPER_HXX + +#include +#include + +enum class SpacingType { SPACING_INCH, MARGINS_INCH, SPACING_CM, MARGINS_CM }; + +/// Custom Widget ListBox to hold entries for Spacing & Margin settings of Header/Footer +namespace SpacingListBox +{ + void SVXCORE_DLLPUBLIC Fill(SpacingType eType, weld::ComboBox&); +} + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sphere3d.hxx b/include/svx/sphere3d.hxx new file mode 100644 index 000000000..3bc2ab2f1 --- /dev/null +++ b/include/svx/sphere3d.hxx @@ -0,0 +1,91 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SPHERE3D_HXX +#define INCLUDED_SVX_SPHERE3D_HXX + +#include +#include +#include +#include +#include + +class E3dDefaultAttributes; + +/** + * SphereObject with diameter r3DSize. + * The count of planes depends on the horizontal and vertical segment count. + */ +class SVXCORE_DLLPUBLIC E3dSphereObj final : public E3dCompoundObject +{ +private: + basegfx::B3DPoint aCenter; + basegfx::B3DVector aSize; + + virtual std::unique_ptr CreateObjectSpecificViewContact() override; + virtual std::unique_ptr CreateObjectSpecificProperties() override; + void SetDefaultAttributes(const E3dDefaultAttributes& rDefault); + +private: + // protected destructor - due to final, make private + virtual ~E3dSphereObj() override; + +public: + E3dSphereObj( + SdrModel& rSdrModel, + const E3dDefaultAttributes& rDefault, + const basegfx::B3DPoint& rCenter, + const basegfx::B3DVector& r3DSize); + + // FG: This constructor is only called from MakeObject from the 3d-Objectfactory + // when a document with a sphere is loaded. This constructor does not call + // CreateSphere, or create any spheres. + E3dSphereObj(SdrModel& rSdrModel); + + // horizontal segments: + sal_uInt32 GetHorizontalSegments() const + { return GetObjectItemSet().Get(SDRATTR_3DOBJ_HORZ_SEGS).GetValue(); } + + // VerticalSegments: + sal_uInt32 GetVerticalSegments() const + { return GetObjectItemSet().Get(SDRATTR_3DOBJ_VERT_SEGS).GetValue(); } + + virtual sal_uInt16 GetObjIdentifier() const override; + virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const override; + + virtual E3dSphereObj* CloneSdrObject(SdrModel& rTargetModel) const override; + + // implemented mainly for the purposes of Clone() + E3dSphereObj& operator=(const E3dSphereObj& rObj); + + const basegfx::B3DPoint& Center() const { return aCenter; } + const basegfx::B3DVector& Size() const { return aSize; } + + // set local parameters when the geometry is recreated + void SetCenter(const basegfx::B3DPoint& rNew); + void SetSize(const basegfx::B3DVector& rNew); + + // TakeObjName...() is for displaying in the UI, eg "3 selected frames." + virtual OUString TakeObjNameSingul() const override; + virtual OUString TakeObjNamePlural() const override; +}; + +#endif // INCLUDED_SVX_SPHERE3D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/srchdlg.hxx b/include/svx/srchdlg.hxx new file mode 100644 index 000000000..8982e4d37 --- /dev/null +++ b/include/svx/srchdlg.hxx @@ -0,0 +1,269 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_SRCHDLG_HXX +#define INCLUDED_SVX_SRCHDLG_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class SvxSearchItem; +class SfxStyleSheetBasePool; +class SvxJSearchOptionsPage; +class SvxSearchController; +class VclAbstractDialog; +struct SearchDlg_Impl; +enum class ModifyFlags; +enum class TransliterationFlags; + +struct SearchAttrItem +{ + sal_uInt16 nSlot; + SfxPoolItem* pItem; +}; + +typedef std::vector SrchAttrItemList; + +class SVX_DLLPUBLIC SearchAttrItemList : private SrchAttrItemList +{ +public: + SearchAttrItemList() {} + SearchAttrItemList( const SearchAttrItemList& rList ); + ~SearchAttrItemList(); + + void Put( const SfxItemSet& rSet ); + SfxItemSet& Get( SfxItemSet& rSet ); + void Clear(); + sal_uInt16 Count() const { return SrchAttrItemList::size(); } + SearchAttrItem& operator[](sal_uInt16 nPos) + { return SrchAttrItemList::operator[]( nPos ); } + SearchAttrItem& GetObject( sal_uInt16 nPos ) + { return SrchAttrItemList::operator[]( nPos ); } + + // the pointer to the item is not being copied, so don't delete + void Insert( const SearchAttrItem& rItem ) + { SrchAttrItemList::push_back( rItem ); } + // deletes the pointer to the items + void Remove(size_t nPos); +}; + +enum class SearchLabel +{ + Empty, + End, + Start, + EndSheet, + NotFound, + StartWrapped, + EndWrapped, + NavElementNotFound, + ReminderStartWrapped, + ReminderEndWrapped +}; + +class SvxSearchDialog; +class SVX_DLLPUBLIC SvxSearchDialogWrapper final : public SfxChildWindow +{ + std::shared_ptr dialog; +public: + SvxSearchDialogWrapper( vcl::Window*pParent, sal_uInt16 nId, + SfxBindings* pBindings, SfxChildWinInfo const * pInfo ); + + virtual ~SvxSearchDialogWrapper () override; + SvxSearchDialog *getDialog () { return dialog.get();} + static void SetSearchLabel(const SearchLabel& rSL); + static void SetSearchLabel(const OUString& sStr); + static OUString GetSearchLabel(); + SFX_DECL_CHILDWINDOW_WITHID(SvxSearchDialogWrapper); +}; + +/** + In this modeless dialog the attributes for a search are configured + and a search is started from it. Several search types + (search, search all, replace, replace all) are possible. + + */ + +class SVX_DLLPUBLIC SvxSearchDialog : public SfxModelessDialogController +{ +friend class SvxSearchController; +friend class SvxSearchDialogWrapper; +friend class SvxJSearchOptionsDialog; + +public: + SvxSearchDialog(weld::Window* pParent, SfxChildWindow* pChildWin, SfxBindings& rBind ); + virtual ~SvxSearchDialog() override; + + virtual void ChildWinDispose() override; + virtual void Close() override; + + // Window + virtual void Activate() override; + + const SearchAttrItemList* GetSearchItemList() const + { return pSearchList.get(); } + const SearchAttrItemList* GetReplaceItemList() const + { return pReplaceList.get(); } + + TransliterationFlags GetTransliterationFlags() const; + + void SetSaveToModule(bool b); + + void SetSearchLabel(const OUString& rStr); + + // bring this window back to the foreground + void Present(); + +private: + SfxBindings& rBindings; + Timer m_aPresentIdle; + bool bWriter; + bool bSearch; + bool bFormat; + bool bReplaceBackwards; + SearchOptionFlags nOptions; + bool bSet; + bool bConstruct; + ModifyFlags nModifyFlag; + OUString aStylesStr; + OUString aLayoutStr; + OUString aLayoutWriterStr; + OUString aLayoutCalcStr; + OUString aCalcStr; + sal_uInt16 nRememberSize; + + std::vector aSearchStrings; + std::vector aReplaceStrings; + + std::unique_ptr pImpl; + std::unique_ptr pSearchList; + std::unique_ptr pReplaceList; + std::unique_ptr pSearchItem; + + std::unique_ptr pSearchController; + std::unique_ptr pOptionsController; + std::unique_ptr pFamilyController; + + mutable TransliterationFlags + nTransliterationFlags; + + bool m_executingSubDialog = false; + + std::unique_ptr m_xSearchFrame; + std::unique_ptr m_xSearchLB; + std::unique_ptr m_xSearchTmplLB; + std::unique_ptr m_xSearchAttrText; + std::unique_ptr m_xSearchLabel; + + std::unique_ptr m_xReplaceFrame; + std::unique_ptr m_xReplaceLB; + std::unique_ptr m_xReplaceTmplLB; + std::unique_ptr m_xReplaceAttrText; + + std::unique_ptr m_xSearchBtn; + std::unique_ptr m_xBackSearchBtn; + std::unique_ptr m_xSearchAllBtn; + std::unique_ptr m_xReplaceBtn; + std::unique_ptr m_xReplaceAllBtn; + + std::unique_ptr m_xComponentFrame; + std::unique_ptr m_xSearchComponent1PB; + std::unique_ptr m_xSearchComponent2PB; + + std::unique_ptr m_xMatchCaseCB; + std::unique_ptr m_xSearchFormattedCB; + std::unique_ptr m_xWordBtn; + + std::unique_ptr m_xCloseBtn; + std::unique_ptr m_xIncludeDiacritics; + std::unique_ptr m_xIncludeKashida; + std::unique_ptr m_xOtherOptionsExpander; + std::unique_ptr m_xSelectionBtn; + std::unique_ptr m_xRegExpBtn; + std::unique_ptr m_xWildcardBtn; + std::unique_ptr m_xSimilarityBox; + std::unique_ptr m_xSimilarityBtn; + std::unique_ptr m_xLayoutBtn; + std::unique_ptr m_xNotesBtn; + std::unique_ptr m_xJapMatchFullHalfWidthCB; + std::unique_ptr m_xJapOptionsCB; + std::unique_ptr m_xReplaceBackwardsCB; + std::unique_ptr m_xJapOptionsBtn; + + std::unique_ptr m_xAttributeBtn; + std::unique_ptr m_xFormatBtn; + std::unique_ptr m_xNoFormatBtn; + + std::unique_ptr m_xCalcGrid; + std::unique_ptr m_xCalcSearchInFT; + std::unique_ptr m_xCalcSearchInLB; + std::unique_ptr m_xCalcSearchDirFT; + std::unique_ptr m_xRowsBtn; + std::unique_ptr m_xColumnsBtn; + std::unique_ptr m_xAllSheetsCB; + std::unique_ptr m_xCalcStrFT; + + DECL_DLLPRIVATE_LINK( ModifyHdl_Impl, weld::ComboBox&, void ); + DECL_DLLPRIVATE_LINK( FlagHdl_Impl, weld::Button&, void ); + DECL_DLLPRIVATE_LINK( CommandHdl_Impl, weld::Button&, void ); + DECL_DLLPRIVATE_LINK(TemplateHdl_Impl, weld::Button&, void); + DECL_DLLPRIVATE_LINK( FocusHdl_Impl, weld::Widget&, void ); + DECL_DLLPRIVATE_LINK( LBSelectHdl_Impl, weld::ComboBox&, void ); + DECL_DLLPRIVATE_LINK(LoseFocusHdl_Impl, weld::Widget&, void); + DECL_DLLPRIVATE_LINK(FormatHdl_Impl, weld::Button&, void); + DECL_DLLPRIVATE_LINK(NoFormatHdl_Impl, weld::Button&, void); + DECL_DLLPRIVATE_LINK(AttributeHdl_Impl, weld::Button&, void); + DECL_DLLPRIVATE_LINK( TimeoutHdl_Impl, Timer*, void ); + SVX_DLLPRIVATE void ClickHdl_Impl(const weld::Widget* pCtrl); + + SVX_DLLPRIVATE void Construct_Impl(); + SVX_DLLPRIVATE void InitControls_Impl(); + SVX_DLLPRIVATE void ShowOptionalControls_Impl(); + SVX_DLLPRIVATE void Init_Impl( bool bHasItemSet ); + SVX_DLLPRIVATE void InitAttrList_Impl( const SfxItemSet* pSSet, + const SfxItemSet* pRSet ); + SVX_DLLPRIVATE void Remember_Impl( const OUString &rStr, bool bSearch ); + SVX_DLLPRIVATE void PaintAttrText_Impl(); + SVX_DLLPRIVATE OUString& BuildAttrText_Impl( OUString& rStr, bool bSrchFlag ) const; + + SVX_DLLPRIVATE void TemplatesChanged_Impl( SfxStyleSheetBasePool& rPool ); + SVX_DLLPRIVATE void EnableControls_Impl( const SearchOptionFlags nFlags ); + SVX_DLLPRIVATE void EnableControl_Impl(const weld::Widget& rCtrl); + SVX_DLLPRIVATE void SetItem_Impl( const SvxSearchItem* pItem ); + + SVX_DLLPRIVATE void SetModifyFlag_Impl(const weld::Widget* pCtrl); + SVX_DLLPRIVATE void SaveToModule_Impl(); + + SVX_DLLPRIVATE void ApplyTransliterationFlags_Impl( TransliterationFlags nSettings ); + SVX_DLLPRIVATE bool IsOtherOptionsExpanded() const; + + SVX_DLLPRIVATE short executeSubDialog(VclAbstractDialog * dialog); + + DECL_DLLPRIVATE_LINK(PresentTimeoutHdl_Impl, Timer*, void); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/strarray.hxx b/include/svx/strarray.hxx new file mode 100644 index 000000000..f0cc28a38 --- /dev/null +++ b/include/svx/strarray.hxx @@ -0,0 +1,53 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_STRARRAY_HXX +#define INCLUDED_SVX_STRARRAY_HXX + +#include +#include +#include + +class SVX_DLLPUBLIC SvxFieldUnitTable +{ +public: + static OUString GetString(sal_uInt32 i); + static sal_uInt32 Count(); + static FieldUnit GetValue(sal_uInt32 i); +}; + +class SVX_DLLPUBLIC SvxNumberingTypeTable +{ +public: + static OUString GetString(sal_uInt32 i); + static sal_uInt32 Count(); + static int GetValue(sal_uInt32 i); + static sal_uInt32 FindIndex(int nValue); +}; + +class SVX_DLLPUBLIC SvxAttrNameTable +{ +public: + static OUString GetString(sal_uInt32 i); + static sal_uInt32 Count(); + static sal_uInt32 FindIndex(int nValue); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc new file mode 100644 index 000000000..86047b4b7 --- /dev/null +++ b/include/svx/strings.hrc @@ -0,0 +1,1717 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_INC_STRINGS_HRC +#define INCLUDED_SVX_INC_STRINGS_HRC + +#define NC_(Context, String) reinterpret_cast(Context "\004" u8##String) + +#define STR_ObjNameSingulNONE NC_("STR_ObjNameSingulNONE", "Drawing object") +#define STR_ObjNamePluralNONE NC_("STR_ObjNamePluralNONE", "Drawing objects") +#define STR_ObjNameSingulGRUP NC_("STR_ObjNameSingulGRUP", "Group object") +#define STR_ObjNamePluralGRUP NC_("STR_ObjNamePluralGRUP", "Group objects") +#define STR_ObjNameSingulGRUPEMPTY NC_("STR_ObjNameSingulGRUPEMPTY", "Blank group object") +#define STR_ObjNamePluralGRUPEMPTY NC_("STR_ObjNamePluralGRUPEMPTY", "Blank group objects") +#define STR_ObjNameSingulLINE NC_("STR_ObjNameSingulLINE", "Line") +#define STR_ObjNameSingulLINE_Hori NC_("STR_ObjNameSingulLINE_Hori", "Horizontal line") +#define STR_ObjNameSingulLINE_Vert NC_("STR_ObjNameSingulLINE_Vert", "Vertical line") +#define STR_ObjNameSingulLINE_Diag NC_("STR_ObjNameSingulLINE_Diag", "Diagonal line") +#define STR_ObjNamePluralLINE NC_("STR_ObjNamePluralLINE", "Lines") +#define STR_ObjNameSingulRECT NC_("STR_ObjNameSingulRECT", "Rectangle") +#define STR_ObjNamePluralRECT NC_("STR_ObjNamePluralRECT", "Rectangles") +#define STR_ObjNameSingulQUAD NC_("STR_ObjNameSingulQUAD", "Square") +#define STR_ObjNamePluralQUAD NC_("STR_ObjNamePluralQUAD", "Squares") +#define STR_ObjNameSingulPARAL NC_("STR_ObjNameSingulPARAL", "Parallelogram") +#define STR_ObjNamePluralPARAL NC_("STR_ObjNamePluralPARAL", "Parallelograms") +#define STR_ObjNameSingulRECTRND NC_("STR_ObjNameSingulRECTRND", "Rounded rectangle") +#define STR_ObjNamePluralRECTRND NC_("STR_ObjNamePluralRECTRND", "Rounded Rectangles") +#define STR_ObjNameSingulQUADRND NC_("STR_ObjNameSingulQUADRND", "rounded square") +#define STR_ObjNamePluralQUADRND NC_("STR_ObjNamePluralQUADRND", "Rounded Squares") +#define STR_ObjNameSingulPARALRND NC_("STR_ObjNameSingulPARALRND", "Rounded Parallelogram") +#define STR_ObjNamePluralPARALRND NC_("STR_ObjNamePluralPARALRND", "Rounded parallelograms") +#define STR_ObjNameSingulCIRC NC_("STR_ObjNameSingulCIRC", "Circle") +#define STR_ObjNamePluralCIRC NC_("STR_ObjNamePluralCIRC", "Circles") +#define STR_ObjNameSingulSECT NC_("STR_ObjNameSingulSECT", "Circle sector") +#define STR_ObjNamePluralSECT NC_("STR_ObjNamePluralSECT", "Circle sectors") +#define STR_ObjNameSingulCARC NC_("STR_ObjNameSingulCARC", "Arc") +#define STR_ObjNamePluralCARC NC_("STR_ObjNamePluralCARC", "Arcs") +#define STR_ObjNameSingulCCUT NC_("STR_ObjNameSingulCCUT", "Circle segment") +#define STR_ObjNamePluralCCUT NC_("STR_ObjNamePluralCCUT", "Circle segments") +#define STR_ObjNameSingulCIRCE NC_("STR_ObjNameSingulCIRCE", "Ellipse") +#define STR_ObjNamePluralCIRCE NC_("STR_ObjNamePluralCIRCE", "Ellipses") +#define STR_ObjNameSingulSECTE NC_("STR_ObjNameSingulSECTE", "Ellipse Pie") +#define STR_ObjNamePluralSECTE NC_("STR_ObjNamePluralSECTE", "Ellipse Pies") +#define STR_ObjNameSingulCARCE NC_("STR_ObjNameSingulCARCE", "Elliptical arc") +#define STR_ObjNamePluralCARCE NC_("STR_ObjNamePluralCARCE", "Elliptical arcs") +#define STR_ObjNameSingulCCUTE NC_("STR_ObjNameSingulCCUTE", "Ellipse Segment") +#define STR_ObjNamePluralCCUTE NC_("STR_ObjNamePluralCCUTE", "Ellipse Segments") +#define STR_ObjNameSingulPOLY NC_("STR_ObjNameSingulPOLY", "Polygon") +#define STR_ObjNameSingulPOLY_PointCount NC_("STR_ObjNameSingulPOLY_PointCount", "Polygon %2 corners") +#define STR_ObjNamePluralPOLY NC_("STR_ObjNamePluralPOLY", "Polygons") +#define STR_ObjNameSingulPLIN NC_("STR_ObjNameSingulPLIN", "Polyline") +#define STR_ObjNameSingulPLIN_PointCount NC_("STR_ObjNameSingulPLIN_PointCount", "Polyline with %2 corners") +#define STR_ObjNamePluralPLIN NC_("STR_ObjNamePluralPLIN", "Polylines") +#define STR_ObjNameSingulPATHLINE NC_("STR_ObjNameSingulPATHLINE", "Bézier curve") +#define STR_ObjNamePluralPATHLINE NC_("STR_ObjNamePluralPATHLINE", "Bézier curves") +#define STR_ObjNameSingulPATHFILL NC_("STR_ObjNameSingulPATHFILL", "Bézier curve") +#define STR_ObjNamePluralPATHFILL NC_("STR_ObjNamePluralPATHFILL", "Bézier curves") +#define STR_ObjNameSingulFREELINE NC_("STR_ObjNameSingulFREELINE", "Freeform Line") +#define STR_ObjNamePluralFREELINE NC_("STR_ObjNamePluralFREELINE", "Freeform Lines") +#define STR_ObjNameSingulFREEFILL NC_("STR_ObjNameSingulFREEFILL", "Freeform Line") +#define STR_ObjNamePluralFREEFILL NC_("STR_ObjNamePluralFREEFILL", "Freeform Lines") +#define STR_ObjNameSingulCOMBLINE NC_("STR_ObjNameSingulCOMBLINE", "Curve") +#define STR_ObjNameSingulNATSPLN NC_("STR_ObjNameSingulNATSPLN", "Natural Spline") +#define STR_ObjNamePluralNATSPLN NC_("STR_ObjNamePluralNATSPLN", "Natural Splines") +#define STR_ObjNameSingulPERSPLN NC_("STR_ObjNameSingulPERSPLN", "Periodic Spline") +#define STR_ObjNamePluralPERSPLN NC_("STR_ObjNamePluralPERSPLN", "Periodic Splines") +#define STR_ObjNameSingulTEXT NC_("STR_ObjNameSingulTEXT", "Text Frame") +#define STR_ObjNamePluralTEXT NC_("STR_ObjNamePluralTEXT", "Text Frame") +#define STR_ObjNameSingulTEXTLNK NC_("STR_ObjNameSingulTEXTLNK", "Linked text frame") +#define STR_ObjNamePluralTEXTLNK NC_("STR_ObjNamePluralTEXTLNK", "Linked text frames") +#define STR_ObjNameSingulTITLETEXT NC_("STR_ObjNameSingulTITLETEXT", "Title text") +#define STR_ObjNamePluralTITLETEXT NC_("STR_ObjNamePluralTITLETEXT", "Title texts") +#define STR_ObjNameSingulOUTLINETEXT NC_("STR_ObjNameSingulOUTLINETEXT", "Outline Text") +#define STR_ObjNamePluralOUTLINETEXT NC_("STR_ObjNamePluralOUTLINETEXT", "Outline Texts") +#define STR_ObjNameSingulGRAF NC_("STR_ObjNameSingulGRAF", "Image") +#define STR_ObjNamePluralGRAF NC_("STR_ObjNamePluralGRAF", "Images") +#define STR_ObjNameSingulGRAFLNK NC_("STR_ObjNameSingulGRAFLNK", "Linked image") +#define STR_ObjNamePluralGRAFLNK NC_("STR_ObjNamePluralGRAFLNK", "Linked images") +#define STR_ObjNameSingulGRAFNONE NC_("STR_ObjNameSingulGRAFNONE", "Blank image object") +#define STR_ObjNamePluralGRAFNONE NC_("STR_ObjNamePluralGRAFNONE", "Blank image objects") +#define STR_ObjNameSingulGRAFNONELNK NC_("STR_ObjNameSingulGRAFNONELNK", "Blank linked image") +#define STR_ObjNamePluralGRAFNONELNK NC_("STR_ObjNamePluralGRAFNONELNK", "Blank linked images") +#define STR_ObjNameSingulGRAFMTF NC_("STR_ObjNameSingulGRAFMTF", "Metafile") +#define STR_ObjNamePluralGRAFMTF NC_("STR_ObjNamePluralGRAFMTF", "Metafiles") +#define STR_ObjNameSingulGRAFMTFLNK NC_("STR_ObjNameSingulGRAFMTFLNK", "Linked Metafile") +#define STR_ObjNamePluralGRAFMTFLNK NC_("STR_ObjNamePluralGRAFMTFLNK", "Linked Metafiles") +#define STR_ObjNameSingulGRAFBMP NC_("STR_ObjNameSingulGRAFBMP", "Image") +#define STR_ObjNameSingulGRAFBMPTRANS NC_("STR_ObjNameSingulGRAFBMPTRANS", "Image with transparency") +#define STR_ObjNameSingulGRAFBMPLNK NC_("STR_ObjNameSingulGRAFBMPLNK", "Linked Image") +#define STR_ObjNameSingulGRAFBMPTRANSLNK NC_("STR_ObjNameSingulGRAFBMPTRANSLNK", "Linked image with transparency") +#define STR_ObjNamePluralGRAFBMP NC_("STR_ObjNamePluralGRAFBMP", "Images") +#define STR_ObjNamePluralGRAFBMPTRANS NC_("STR_ObjNamePluralGRAFBMPTRANS", "Images with transparency") +#define STR_ObjNamePluralGRAFBMPLNK NC_("STR_ObjNamePluralGRAFBMPLNK", "Linked images") +#define STR_ObjNamePluralGRAFBMPTRANSLNK NC_("STR_ObjNamePluralGRAFBMPTRANSLNK", "Linked images with transparency") +#define STR_ObjNameSingulCUSTOMSHAPE NC_("STR_ObjNameSingulCUSTOMSHAPE", "Shape") +#define STR_ObjNamePluralCUSTOMSHAPE NC_("STR_ObjNamePluralCUSTOMSHAPE", "Shapes") +#define STR_ObjNameSingulGRAFSVG NC_("STR_ObjNameSingulGRAFSVG", "SVG") +#define STR_ObjNamePluralGRAFSVG NC_("STR_ObjNamePluralGRAFSVG", "SVGs") +#define STR_ObjNameSingulGRAFWMF NC_("STR_ObjNameSingulGRAFWMF", "WMF") +#define STR_ObjNamePluralGRAFWMF NC_("STR_ObjNamePluralGRAFWMF", "WMFs") +#define STR_ObjNameSingulGRAFEMF NC_("STR_ObjNameSingulGRAFEMF", "EMF") +#define STR_ObjNamePluralGRAFEMF NC_("STR_ObjNamePluralGRAFEMF", "EMFs") +#define STR_ObjNameSingulOLE2 NC_("STR_ObjNameSingulOLE2", "embedded object (OLE)") +#define STR_ObjNamePluralOLE2 NC_("STR_ObjNamePluralOLE2", "Embedded objects (OLE)") +#define STR_ObjNameSingulUno NC_("STR_ObjNameSingulUno", "Control") +#define STR_ObjNamePluralUno NC_("STR_ObjNamePluralUno", "Controls") +#define STR_ObjNameSingulFrame NC_("STR_ObjNameSingulFrame", "Frame") +#define STR_ObjNamePluralFrame NC_("STR_ObjNamePluralFrame", "Frames") +#define STR_ObjNameSingulEDGE NC_("STR_ObjNameSingulEDGE", "Object Connectors") +#define STR_ObjNamePluralEDGE NC_("STR_ObjNamePluralEDGE", "Object Connectors") +#define STR_ObjNameSingulCAPTION NC_("STR_ObjNameSingulCAPTION", "Callout") +#define STR_ObjNamePluralCAPTION NC_("STR_ObjNamePluralCAPTION", "Callouts") +#define STR_ObjNameSingulPAGE NC_("STR_ObjNameSingulPAGE", "Preview object") +#define STR_ObjNamePluralPAGE NC_("STR_ObjNamePluralPAGE", "Preview objects") +#define STR_ObjNameSingulMEASURE NC_("STR_ObjNameSingulMEASURE", "Dimension line") +#define STR_ObjNamePluralMEASURE NC_("STR_ObjNamePluralMEASURE", "Dimensioning objects") +#define STR_ObjNamePlural NC_("STR_ObjNamePlural", "Drawing objects") +#define STR_ObjNameNoObj NC_("STR_ObjNameNoObj", "No draw object") +#define STR_ObjNameSingulPlural NC_("STR_ObjNameSingulPlural", "Draw object(s)") +#define STR_ObjNameSingulCube3d NC_("STR_ObjNameSingulCube3d", "3D cube") +#define STR_ObjNamePluralCube3d NC_("STR_ObjNamePluralCube3d", "3D cubes") +#define STR_ObjNameSingulExtrude3d NC_("STR_ObjNameSingulExtrude3d", "Extrusion object") +#define STR_ObjNamePluralExtrude3d NC_("STR_ObjNamePluralExtrude3d", "Extrusion objects") +#define STR_ObjNameSingulLathe3d NC_("STR_ObjNameSingulLathe3d", "Rotation object") +#define STR_ObjNamePluralLathe3d NC_("STR_ObjNamePluralLathe3d", "Rotation objects") +#define STR_ObjNameSingulObj3d NC_("STR_ObjNameSingulObj3d", "3D object") +#define STR_ObjNamePluralObj3d NC_("STR_ObjNamePluralObj3d", "3D objects") +#define STR_ObjNameSingulScene3d NC_("STR_ObjNameSingulScene3d", "3D scene") +#define STR_ObjNamePluralScene3d NC_("STR_ObjNamePluralScene3d", "3D scenes") +#define STR_ObjNameSingulSphere3d NC_("STR_ObjNameSingulSphere3d", "Sphere") +#define STR_ObjNamePluralSphere3d NC_("STR_ObjNamePluralSphere3d", "Spheres") +#define STR_EditWithCopy NC_("STR_EditWithCopy", "with copy") +#define STR_EditPosSize NC_("STR_EditPosSize", "Set position and size for %1") +#define STR_EditDelete NC_("STR_EditDelete", "Delete %1") +#define STR_EditMovToTop NC_("STR_EditMovToTop", "Move %1 forward") +#define STR_EditMovToBtm NC_("STR_EditMovToBtm", "Move %1 further back") +#define STR_EditPutToTop NC_("STR_EditPutToTop", "Move %1 to front") +#define STR_EditPutToBtm NC_("STR_EditPutToBtm", "Move %1 to back") +#define STR_EditRevOrder NC_("STR_EditRevOrder", "Reverse order of %1") +#define STR_EditMove NC_("STR_EditMove", "Move %1") +#define STR_EditResize NC_("STR_EditResize", "Resize %1") +#define STR_EditRotate NC_("STR_EditRotate", "Rotate %1") +#define STR_EditMirrorHori NC_("STR_EditMirrorHori", "Flip %1 horizontal") +#define STR_EditMirrorVert NC_("STR_EditMirrorVert", "Flip %1 vertical") +#define STR_EditMirrorDiag NC_("STR_EditMirrorDiag", "Flip %1 diagonal") +#define STR_EditMirrorFree NC_("STR_EditMirrorFree", "Flip %1 freehand") +#define STR_EditShear NC_("STR_EditShear", "Distort %1 (slant)") +#define STR_EditCrook NC_("STR_EditCrook", "Arrange %1 in circle") +#define STR_EditCrookContortion NC_("STR_EditCrookContortion", "Curve %1 in circle") +#define STR_EditDistort NC_("STR_EditDistort", "Distort %1") +#define STR_EditRipUp NC_("STR_EditRipUp", "Undo %1") +#define STR_EditSetPointsSmooth NC_("STR_EditSetPointsSmooth", "Modify bézier properties of %1") +#define STR_EditSetSegmentsKind NC_("STR_EditSetSegmentsKind", "Modify bézier properties of %1") +#define STR_EditSetGlueEscDir NC_("STR_EditSetGlueEscDir", "Set exit direction for %1") +#define STR_EditSetGluePercent NC_("STR_EditSetGluePercent", "Set relative attribute at %1") +#define STR_EditSetGlueAlign NC_("STR_EditSetGlueAlign", "Set reference point for %1") +#define STR_EditGroup NC_("STR_EditGroup", "Group %1") +#define STR_EditUngroup NC_("STR_EditUngroup", "Ungroup %1") +#define STR_EditSetAttributes NC_("STR_EditSetAttributes", "Apply attributes to %1") +#define STR_EditSetStylesheet NC_("STR_EditSetStylesheet", "Apply Styles to %1") +#define STR_EditDelStylesheet NC_("STR_EditDelStylesheet", "Remove Style from %1") +#define STR_EditConvToPoly NC_("STR_EditConvToPoly", "Convert %1 to polygon") +#define STR_EditConvToPolys NC_("STR_EditConvToPolys", "Convert %1 to polygons") +#define STR_EditConvToCurve NC_("STR_EditConvToCurve", "Convert %1 to curve") +#define STR_EditConvToCurves NC_("STR_EditConvToCurves", "Convert %1 to curves") +#define STR_EditConvToContour NC_("STR_EditConvToContour", "Convert %1 to contour") +#define STR_EditConvToContours NC_("STR_EditConvToContours", "Convert %1 to contours") +#define STR_EditAlign NC_("STR_EditAlign", "Align %1") +#define STR_EditAlignVTop NC_("STR_EditAlignVTop", "Align %1 to top") +#define STR_EditAlignVBottom NC_("STR_EditAlignVBottom", "Align %1 to bottom") +#define STR_EditAlignVCenter NC_("STR_EditAlignVCenter", "Horizontally center %1") +#define STR_EditAlignHLeft NC_("STR_EditAlignHLeft", "Align %1 to left") +#define STR_EditAlignHRight NC_("STR_EditAlignHRight", "Align %1 to right") +#define STR_EditAlignHCenter NC_("STR_EditAlignHCenter", "Vertically center %1") +#define STR_EditAlignCenter NC_("STR_EditAlignCenter", "Center %1") +#define STR_EditTransform NC_("STR_EditTransform", "Transform %1") +#define STR_EditCombine_PolyPoly NC_("STR_EditCombine_PolyPoly", "Combine %1") +#define STR_EditMergeMergePoly NC_("STR_EditMergeMergePoly", "Merge %1") +#define STR_EditMergeSubstractPoly NC_("STR_EditMergeSubstractPoly", "Subtract %1") +#define STR_EditMergeIntersectPoly NC_("STR_EditMergeIntersectPoly", "Intersect %1") +#define STR_DistributeMarkedObjects NC_("STR_DistributeMarkedObjects", "Distribute selected objects") +#define STR_EqualizeWidthMarkedObjects NC_("STR_EqualizeWidthMarkedObjects", "Equalize Width %1") +#define STR_EqualizeHeightMarkedObjects NC_("STR_EqualizeHeightMarkedObjects", "Equalize Height %1") +#define STR_EditCombine_OnePoly NC_("STR_EditCombine_OnePoly", "Combine %1") +#define STR_EditDismantle_Polys NC_("STR_EditDismantle_Polys", "Split %1") +#define STR_EditDismantle_Lines NC_("STR_EditDismantle_Lines", "Split %1") +#define STR_EditImportMtf NC_("STR_EditImportMtf", "Split %1") +#define STR_ExchangePaste NC_("STR_ExchangePaste", "Insert object(s)") +#define STR_DragInsertPoint NC_("STR_DragInsertPoint", "Insert point to %1") +#define STR_DragInsertGluePoint NC_("STR_DragInsertGluePoint", "Insert glue point to %1") +#define STR_DragMethMovHdl NC_("STR_DragMethMovHdl", "Move reference-point") +#define STR_DragMethObjOwn NC_("STR_DragMethObjOwn", "Geometrically change %1") +#define STR_DragMethMove NC_("STR_DragMethMove", "Move %1") +#define STR_DragMethResize NC_("STR_DragMethResize", "Resize %1") +#define STR_DragMethRotate NC_("STR_DragMethRotate", "Rotate %1") +#define STR_DragMethMirrorHori NC_("STR_DragMethMirrorHori", "Flip %1 horizontal") +#define STR_DragMethMirrorVert NC_("STR_DragMethMirrorVert", "Flip %1 vertical") +#define STR_DragMethMirrorDiag NC_("STR_DragMethMirrorDiag", "Flip %1 diagonal") +#define STR_DragMethMirrorFree NC_("STR_DragMethMirrorFree", "Flip %1 freehand") +#define STR_DragMethGradient NC_("STR_DragMethGradient", "Interactive gradient for %1") +#define STR_DragMethTransparence NC_("STR_DragMethTransparence", "Interactive transparency for %1") +#define STR_DragMethShear NC_("STR_DragMethShear", "Distort %1 (slant)") +#define STR_DragMethCrook NC_("STR_DragMethCrook", "Arrange %1 in circle") +#define STR_DragMethCrookContortion NC_("STR_DragMethCrookContortion", "Curve %1 in circle") +#define STR_DragMethDistort NC_("STR_DragMethDistort", "Distort %1") +#define STR_DragMethCrop NC_("STR_DragMethCrop", "Crop %1") +#define STR_DragRectEckRad NC_("STR_DragRectEckRad", "Alter radius by %1") +#define STR_DragPathObj NC_("STR_DragPathObj", "Change %1") +#define STR_DragRectResize NC_("STR_DragRectResize", "Resize %1") +#define STR_DragCaptFram NC_("STR_DragCaptFram", "Move %1") +#define STR_DragCaptTail NC_("STR_DragCaptTail", "Move end point of %1") +#define STR_DragCircAngle NC_("STR_DragCircAngle", "Adjust angle by %1") +#define STR_DragEdgeTail NC_("STR_DragEdgeTail", "Change %1") +#define STR_ViewTextEdit NC_("STR_ViewTextEdit", "TextEdit: Paragraph %1, Row %2, Column %3") +#define STR_ViewMarked NC_("STR_ViewMarked", "%1 selected") +#define STR_ViewMarkedPoint NC_("STR_ViewMarkedPoint", "Point from %1") +#define STR_ViewMarkedPoints NC_("STR_ViewMarkedPoints", "%2 points from %1") +#define STR_ViewMarkedGluePoint NC_("STR_ViewMarkedGluePoint", "Glue point from %1") +#define STR_ViewMarkedGluePoints NC_("STR_ViewMarkedGluePoints", "%2 glue points from %1") +#define STR_ViewMarkObjs NC_("STR_ViewMarkObjs", "Mark objects") +#define STR_ViewMarkMoreObjs NC_("STR_ViewMarkMoreObjs", "Mark additional objects") +#define STR_ViewMarkPoints NC_("STR_ViewMarkPoints", "Mark points") +#define STR_ViewMarkMorePoints NC_("STR_ViewMarkMorePoints", "Mark additional points") +#define STR_ViewMarkGluePoints NC_("STR_ViewMarkGluePoints", "Mark glue points") +#define STR_ViewMarkMoreGluePoints NC_("STR_ViewMarkMoreGluePoints", "Mark additional glue points") +#define STR_ViewCreateObj NC_("STR_ViewCreateObj", "Create %1") +#define STR_UndoInsertObj NC_("STR_UndoInsertObj", "Insert %1") +#define STR_UndoCopyObj NC_("STR_UndoCopyObj", "Copy %1") +#define STR_UndoObjOrdNum NC_("STR_UndoObjOrdNum", "Change object order of %1") +#define STR_UndoObjSetText NC_("STR_UndoObjSetText", "Edit text of %1") +#define STR_UndoNewPage NC_("STR_UndoNewPage", "Insert page") +#define STR_UndoDelPage NC_("STR_UndoDelPage", "Delete page") +#define STR_UndoCopPage NC_("STR_UndoCopPage", "Copy page") +#define STR_UndoMovPage NC_("STR_UndoMovPage", "Change order of pages") +#define STR_UndoDelPageMasterDscr NC_("STR_UndoDelPageMasterDscr", "Clear background page assignment") +#define STR_UndoChgPageMasterDscr NC_("STR_UndoChgPageMasterDscr", "Change background page assignment") +#define STR_UndoMergeModel NC_("STR_UndoMergeModel", "Insert document") +#define STR_UndoNewLayer NC_("STR_UndoNewLayer", "Insert Layer") +#define STR_UndoDelLayer NC_("STR_UndoDelLayer", "Delete layer") +// Undo/Redo for setting object's name (#i73249#) +#define STR_UndoObjName NC_("STR_UndoObjName", "Change object name of %1 to") +#define STR_UndoObjTitle NC_("STR_UndoObjTitle", "Change object title of %1") +#define STR_UndoObjDescription NC_("STR_UndoObjDescription", "Change object description of %1") +#define STR_ItemValON NC_("STR_ItemValON", "on") +#define STR_ItemValOFF NC_("STR_ItemValOFF", "off") +#define STR_ItemValYES NC_("STR_ItemValYES", "yes") +#define STR_ItemValNO NC_("STR_ItemValNO", "No") +#define STR_ItemValCAPTIONTYPE1 NC_("STR_ItemValCAPTIONTYPE1", "Type 1") +#define STR_ItemValCAPTIONTYPE2 NC_("STR_ItemValCAPTIONTYPE2", "Type 2") +#define STR_ItemValCAPTIONTYPE3 NC_("STR_ItemValCAPTIONTYPE3", "Type 3") +#define STR_ItemValCAPTIONTYPE4 NC_("STR_ItemValCAPTIONTYPE4", "Type 4") +#define STR_ItemValCAPTIONESCHORI NC_("STR_ItemValCAPTIONESCHORI", "Horizontal") +#define STR_ItemValCAPTIONESCVERT NC_("STR_ItemValCAPTIONESCVERT", "Vertical") +#define STR_ItemValCAPTIONESCBESTFIT NC_("STR_ItemValCAPTIONESCBESTFIT", "Automatic") +#define STR_ItemValFITTOSIZENONE NC_("STR_ItemValFITTOSIZENONE", "Off") +#define STR_ItemValFITTOSIZEPROP NC_("STR_ItemValFITTOSIZEPROP", "Proportional") +#define STR_ItemValFITTOSIZEALLLINES NC_("STR_ItemValFITTOSIZEALLLINES", "Fit to size (all rows separately) ") +#define STR_ItemValFITTOSIZERESIZEAT NC_("STR_ItemValFITTOSIZERESIZEAT", "Use hard attributes") +#define STR_ItemValTEXTVADJTOP NC_("STR_ItemValTEXTVADJTOP", "Top") +#define STR_ItemValTEXTVADJCENTER NC_("STR_ItemValTEXTVADJCENTER", "Center") +#define STR_ItemValTEXTVADJBOTTOM NC_("STR_ItemValTEXTVADJBOTTOM", "Bottom") +#define STR_ItemValTEXTVADJBLOCK NC_("STR_ItemValTEXTVADJBLOCK", "Use entire height") +#define STR_ItemValTEXTVADJSTRETCH NC_("STR_ItemValTEXTVADJSTRETCH", "Stretched") +#define STR_ItemValTEXTHADJLEFT NC_("STR_ItemValTEXTHADJLEFT", "Left") +#define STR_ItemValTEXTHADJCENTER NC_("STR_ItemValTEXTHADJCENTER", "Center") +#define STR_ItemValTEXTHADJRIGHT NC_("STR_ItemValTEXTHADJRIGHT", "Right") +#define STR_ItemValTEXTHADJBLOCK NC_("STR_ItemValTEXTHADJBLOCK", "Use entire width") +#define STR_ItemValTEXTHADJSTRETCH NC_("STR_ItemValTEXTHADJSTRETCH", "Stretched") +#define STR_ItemValTEXTANI_NONE NC_("STR_ItemValTEXTANI_NONE", "off") +#define STR_ItemValTEXTANI_BLINK NC_("STR_ItemValTEXTANI_BLINK", "flash") +#define STR_ItemValTEXTANI_SCROLL NC_("STR_ItemValTEXTANI_SCROLL", "Scroll Through") +#define STR_ItemValTEXTANI_ALTERNATE NC_("STR_ItemValTEXTANI_ALTERNATE", "alternating") +#define STR_ItemValTEXTANI_SLIDE NC_("STR_ItemValTEXTANI_SLIDE", "Scroll In") +#define STR_ItemValTEXTANI_LEFT NC_("STR_ItemValTEXTANI_LEFT", "left") +#define STR_ItemValTEXTANI_UP NC_("STR_ItemValTEXTANI_UP", "up") +#define STR_ItemValTEXTANI_RIGHT NC_("STR_ItemValTEXTANI_RIGHT", "right") +#define STR_ItemValTEXTANI_DOWN NC_("STR_ItemValTEXTANI_DOWN", "down") +#define STR_ItemValEDGE_ORTHOLINES NC_("STR_ItemValEDGE_ORTHOLINES", "Standard Connector") +#define STR_ItemValEDGE_THREELINES NC_("STR_ItemValEDGE_THREELINES", "Line Connector") +#define STR_ItemValEDGE_ONELINE NC_("STR_ItemValEDGE_ONELINE", "Straight Connector") +#define STR_ItemValEDGE_BEZIER NC_("STR_ItemValEDGE_BEZIER", "Curved Connector") +#define STR_ItemValMEASURE_STD NC_("STR_ItemValMEASURE_STD", "Standard") +#define STR_ItemValMEASURE_RADIUS NC_("STR_ItemValMEASURE_RADIUS", "Radius") +#define STR_ItemValMEASURE_TEXTHAUTO NC_("STR_ItemValMEASURE_TEXTHAUTO", "automatic") +#define STR_ItemValMEASURE_TEXTLEFTOUTSIDE NC_("STR_ItemValMEASURE_TEXTLEFTOUTSIDE", "left outside") +#define STR_ItemValMEASURE_TEXTINSIDE NC_("STR_ItemValMEASURE_TEXTINSIDE", "inside (centered)") +#define STR_ItemValMEASURE_TEXTRIGHTOUTSID NC_("STR_ItemValMEASURE_TEXTRIGHTOUTSID", "right outside") +#define STR_ItemValMEASURE_TEXTVAUTO NC_("STR_ItemValMEASURE_TEXTVAUTO", "automatic") +#define STR_ItemValMEASURE_ABOVE NC_("STR_ItemValMEASURE_ABOVE", "on the line") +#define STR_ItemValMEASURETEXT_BREAKEDLINE NC_("STR_ItemValMEASURETEXT_BREAKEDLINE", "broken line") +#define STR_ItemValMEASURE_BELOW NC_("STR_ItemValMEASURE_BELOW", "below the line") +#define STR_ItemValMEASURETEXT_VERTICALCEN NC_("STR_ItemValMEASURETEXT_VERTICALCEN", "centered") +#define STR_ItemValCIRC_FULL NC_("STR_ItemValCIRC_FULL", "full circle") +#define STR_ItemValCIRC_SECT NC_("STR_ItemValCIRC_SECT", "Circle Pie") +#define STR_ItemValCIRC_CUT NC_("STR_ItemValCIRC_CUT", "Circle segment") +#define STR_ItemValCIRC_ARC NC_("STR_ItemValCIRC_ARC", "Arc") +// Strings for the templates dialog +#define SIP_UNKNOWN_ATTR NC_("SIP_UNKNOWN_ATTR", "Unknown attribute") +// Strings for the templates dialog +#define SIP_XA_LINESTYLE NC_("SIP_XA_LINESTYLE", "Line style") +#define SIP_XA_LINEDASH NC_("SIP_XA_LINEDASH", "Line pattern") +#define SIP_XA_LINEWIDTH NC_("SIP_XA_LINEWIDTH", "Line width") +#define SIP_XA_LINECOLOR NC_("SIP_XA_LINECOLOR", "Line color") +#define SIP_XA_LINESTART NC_("SIP_XA_LINESTART", "Line head") +#define SIP_XA_LINEEND NC_("SIP_XA_LINEEND", "Line end") +#define SIP_XA_LINESTARTWIDTH NC_("SIP_XA_LINESTARTWIDTH", "Line head width") +#define SIP_XA_LINEENDWIDTH NC_("SIP_XA_LINEENDWIDTH", "Line end width") +#define SIP_XA_LINESTARTCENTER NC_("SIP_XA_LINESTARTCENTER", "Center arrowhead") +#define SIP_XA_LINEENDCENTER NC_("SIP_XA_LINEENDCENTER", "Center arrowend") +#define SIP_XA_LINETRANSPARENCE NC_("SIP_XA_LINETRANSPARENCE", "Line transparency") +#define SIP_XA_LINEJOINT NC_("SIP_XA_LINEJOINT", "Line joint") +#define SIP_XATTRSET_LINE NC_("SIP_XATTRSET_LINE", "Line attributes") +#define SIP_XA_FILLSTYLE NC_("SIP_XA_FILLSTYLE", "Fill style") +#define SIP_XA_FILLCOLOR NC_("SIP_XA_FILLCOLOR", "Fillcolor") +#define SIP_XA_FILLGRADIENT NC_("SIP_XA_FILLGRADIENT", "Gradient") +#define SIP_XA_FILLHATCH NC_("SIP_XA_FILLHATCH", "Hatching") +#define SIP_XA_FILLBITMAP NC_("SIP_XA_FILLBITMAP", "Fillbitmap") +#define SIP_XA_FILLTRANSPARENCE NC_("SIP_XA_FILLTRANSPARENCE", "Transparency") +#define SIP_XA_GRADIENTSTEPCOUNT NC_("SIP_XA_GRADIENTSTEPCOUNT", "Number of gradient steps") +#define SIP_XA_FILLBMP_TILE NC_("SIP_XA_FILLBMP_TILE", "Tile fill") +#define SIP_XA_FILLBMP_POS NC_("SIP_XA_FILLBMP_POS", "Fillbitmap position") +#define SIP_XA_FILLBMP_SIZEX NC_("SIP_XA_FILLBMP_SIZEX", "Fillbitmap width") +#define SIP_XA_FILLBMP_SIZEY NC_("SIP_XA_FILLBMP_SIZEY", "Height of fillbitmap") +#define SIP_XA_FILLFLOATTRANSPARENCE NC_("SIP_XA_FILLFLOATTRANSPARENCE", "Transparent gradient") +#define SIP_XA_SECONDARYFILLCOLOR NC_("SIP_XA_SECONDARYFILLCOLOR", "Fill reserved for 2") +#define SIP_XA_FILLBMP_SIZELOG NC_("SIP_XA_FILLBMP_SIZELOG", "Tile size not in %") +#define SIP_XA_FILLBMP_TILEOFFSETX NC_("SIP_XA_FILLBMP_TILEOFFSETX", "Tile offset X in %") +#define SIP_XA_FILLBMP_TILEOFFSETY NC_("SIP_XA_FILLBMP_TILEOFFSETY", "Tile offset Y in %") +#define SIP_XA_FILLBMP_STRETCH NC_("SIP_XA_FILLBMP_STRETCH", "Bitmap scaling") +#define SIP_XA_FILLBMP_POSOFFSETX NC_("SIP_XA_FILLBMP_POSOFFSETX", "Tile position X in %") +#define SIP_XA_FILLBMP_POSOFFSETY NC_("SIP_XA_FILLBMP_POSOFFSETY", "Tile position Y in %") +#define SIP_XA_FILLBACKGROUND NC_("SIP_XA_FILLBACKGROUND", "Background fill") +#define SIP_XATTRSET_FILL NC_("SIP_XATTRSET_FILL", "Area attributes") +#define SIP_XA_FORMTXTSTYLE NC_("SIP_XA_FORMTXTSTYLE", "Fontwork style") +#define SIP_XA_FORMTXTADJUST NC_("SIP_XA_FORMTXTADJUST", "Fontwork alignment") +#define SIP_XA_FORMTXTDISTANCE NC_("SIP_XA_FORMTXTDISTANCE", "Fontwork spacing") +#define SIP_XA_FORMTXTSTART NC_("SIP_XA_FORMTXTSTART", "Fontwork font begin") +#define SIP_XA_FORMTXTMIRROR NC_("SIP_XA_FORMTXTMIRROR", "Fontwork mirror") +#define SIP_XA_FORMTXTOUTLINE NC_("SIP_XA_FORMTXTOUTLINE", "Fontwork outline") +#define SIP_XA_FORMTXTSHADOW NC_("SIP_XA_FORMTXTSHADOW", "Fontwork shadow") +#define SIP_XA_FORMTXTSHDWCOLOR NC_("SIP_XA_FORMTXTSHDWCOLOR", "Fontwork shadow color") +#define SIP_XA_FORMTXTSHDWXVAL NC_("SIP_XA_FORMTXTSHDWXVAL", "Fontwork shadow offset X") +#define SIP_XA_FORMTXTSHDWYVAL NC_("SIP_XA_FORMTXTSHDWYVAL", "Fontwork shadow offset Y") +#define SIP_XA_FORMTXTHIDEFORM NC_("SIP_XA_FORMTXTHIDEFORM", "Hide fontwork outline") +#define SIP_XA_FORMTXTSHDWTRANSP NC_("SIP_XA_FORMTXTSHDWTRANSP", "Fontwork shadow transparency") +#define SIP_SA_SHADOW NC_("SIP_SA_SHADOW", "Shadow") +#define SIP_SA_SHADOWCOLOR NC_("SIP_SA_SHADOWCOLOR", "Shadow color") +#define SIP_SA_SHADOWXDIST NC_("SIP_SA_SHADOWXDIST", "Shadow spacing X") +#define SIP_SA_SHADOWYDIST NC_("SIP_SA_SHADOWYDIST", "Shadow spacing Y") +#define SIP_SA_SHADOWTRANSPARENCE NC_("SIP_SA_SHADOWTRANSPARENCE", "Shadow transparency") +#define SIP_SA_SHADOW3D NC_("SIP_SA_SHADOW3D", "3D shadow") +#define SIP_SA_SHADOWPERSP NC_("SIP_SA_SHADOWPERSP", "Perspective shadow") +#define SIP_SA_CAPTIONTYPE NC_("SIP_SA_CAPTIONTYPE", "Type of legend") +#define SIP_SA_CAPTIONFIXEDANGLE NC_("SIP_SA_CAPTIONFIXEDANGLE", "Fixed legend angle") +#define SIP_SA_CAPTIONANGLE NC_("SIP_SA_CAPTIONANGLE", "Legend angle") +#define SIP_SA_CAPTIONGAP NC_("SIP_SA_CAPTIONGAP", "Legend lines spacing") +#define SIP_SA_CAPTIONESCDIR NC_("SIP_SA_CAPTIONESCDIR", "Legend exit alignment") +#define SIP_SA_CAPTIONESCISREL NC_("SIP_SA_CAPTIONESCISREL", "Relative exit legend") +#define SIP_SA_CAPTIONESCREL NC_("SIP_SA_CAPTIONESCREL", "Relative exit legend") +#define SIP_SA_CAPTIONESCABS NC_("SIP_SA_CAPTIONESCABS", "Absolute exit of legend") +#define SIP_SA_CAPTIONLINELEN NC_("SIP_SA_CAPTIONLINELEN", "Legend line length") +#define SIP_SA_CAPTIONFITLINELEN NC_("SIP_SA_CAPTIONFITLINELEN", "AutoLength of legend lines") +#define SIP_SA_ECKENRADIUS NC_("SIP_SA_ECKENRADIUS", "Corner radius") +#define SIP_SA_TEXT_MINFRAMEHEIGHT NC_("SIP_SA_TEXT_MINFRAMEHEIGHT", "Minimal frame height") +#define SIP_SA_TEXT_AUTOGROWHEIGHT NC_("SIP_SA_TEXT_AUTOGROWHEIGHT", "AutoFit height") +#define SIP_SA_TEXT_FITTOSIZE NC_("SIP_SA_TEXT_FITTOSIZE", "Fit text to frame") +#define SIP_SA_TEXT_LEFTDIST NC_("SIP_SA_TEXT_LEFTDIST", "Left text frame spacing") +#define SIP_SA_TEXT_RIGHTDIST NC_("SIP_SA_TEXT_RIGHTDIST", "Right text frame spacing") +#define SIP_SA_TEXT_UPPERDIST NC_("SIP_SA_TEXT_UPPERDIST", "Upper text frame spacing") +#define SIP_SA_TEXT_LOWERDIST NC_("SIP_SA_TEXT_LOWERDIST", "Lower text frame spacing") +#define SIP_SA_TEXT_VERTADJUST NC_("SIP_SA_TEXT_VERTADJUST", "Vertical text anchor") +#define SIP_SA_TEXT_MAXFRAMEHEIGHT NC_("SIP_SA_TEXT_MAXFRAMEHEIGHT", "Maximal frame height") +#define SIP_SA_TEXT_MINFRAMEWIDTH NC_("SIP_SA_TEXT_MINFRAMEWIDTH", "Minimal frame width") +#define SIP_SA_TEXT_MAXFRAMEWIDTH NC_("SIP_SA_TEXT_MAXFRAMEWIDTH", "Maximal frame width") +#define SIP_SA_TEXT_AUTOGROWWIDTH NC_("SIP_SA_TEXT_AUTOGROWWIDTH", "AutoFit width") +#define SIP_SA_TEXT_HORZADJUST NC_("SIP_SA_TEXT_HORZADJUST", "Horizontal text anchor") +#define SIP_SA_TEXT_ANIKIND NC_("SIP_SA_TEXT_ANIKIND", "Ticker") +#define SIP_SA_TEXT_ANIDIRECTION NC_("SIP_SA_TEXT_ANIDIRECTION", "Ticker direction") +#define SIP_SA_TEXT_ANISTARTINSIDE NC_("SIP_SA_TEXT_ANISTARTINSIDE", "Ticker start inside") +#define SIP_SA_TEXT_ANISTOPINSIDE NC_("SIP_SA_TEXT_ANISTOPINSIDE", "Ticker stop inside") +#define SIP_SA_TEXT_ANICOUNT NC_("SIP_SA_TEXT_ANICOUNT", "Number of ticker runs") +#define SIP_SA_TEXT_ANIDELAY NC_("SIP_SA_TEXT_ANIDELAY", "Speed of ticker") +#define SIP_SA_TEXT_ANIAMOUNT NC_("SIP_SA_TEXT_ANIAMOUNT", "Ticker step size") +#define SIP_SA_TEXT_CONTOURFRAME NC_("SIP_SA_TEXT_CONTOURFRAME", "Outline text flow") +#define SIP_SA_XMLATTRIBUTES NC_("SIP_SA_XMLATTRIBUTES", "User-defined attributes") +#define SIP_SA_TEXT_USEFIXEDCELLHEIGHT NC_("SIP_SA_TEXT_USEFIXEDCELLHEIGHT", "Use font-independent line spacing") +#define SIP_SA_WORDWRAP NC_("SIP_SA_WORDWRAP", "Word wrap text in shape") +#define SIP_SA_CHAINNEXTNAME NC_("SIP_SA_CHAINNEXTNAME", "Next link in text chain") +#define SIP_SA_EDGEKIND NC_("SIP_SA_EDGEKIND", "Type of connector") +#define SIP_SA_EDGENODE1HORZDIST NC_("SIP_SA_EDGENODE1HORZDIST", "Horz. spacing object 1") +#define SIP_SA_EDGENODE1VERTDIST NC_("SIP_SA_EDGENODE1VERTDIST", "Vert. spacing object 1") +#define SIP_SA_EDGENODE2HORZDIST NC_("SIP_SA_EDGENODE2HORZDIST", "Horz. spacing object 2") +#define SIP_SA_EDGENODE2VERTDIST NC_("SIP_SA_EDGENODE2VERTDIST", "Vert. spacing object 2") +#define SIP_SA_EDGENODE1GLUEDIST NC_("SIP_SA_EDGENODE1GLUEDIST", "Glue spacing object 1") +#define SIP_SA_EDGENODE2GLUEDIST NC_("SIP_SA_EDGENODE2GLUEDIST", "Glue spacing object 2") +#define SIP_SA_EDGELINEDELTACOUNT NC_("SIP_SA_EDGELINEDELTACOUNT", "Number of movable lines") +#define SIP_SA_EDGELINE1DELTA NC_("SIP_SA_EDGELINE1DELTA", "Offset line 1") +#define SIP_SA_EDGELINE2DELTA NC_("SIP_SA_EDGELINE2DELTA", "Offset line 2") +#define SIP_SA_EDGELINE3DELTA NC_("SIP_SA_EDGELINE3DELTA", "Offset line 3") +#define SIP_SA_MEASUREKIND NC_("SIP_SA_MEASUREKIND", "Type of dimensioning") +#define SIP_SA_MEASURETEXTHPOS NC_("SIP_SA_MEASURETEXTHPOS", "Dimension value - horizontal position") +#define SIP_SA_MEASURETEXTVPOS NC_("SIP_SA_MEASURETEXTVPOS", "Dimension value - vertical position") +#define SIP_SA_MEASURELINEDIST NC_("SIP_SA_MEASURELINEDIST", "Dimension line space") +#define SIP_SA_MEASUREHELPLINEOVERHANG NC_("SIP_SA_MEASUREHELPLINEOVERHANG", "Dimension help line overhang") +#define SIP_SA_MEASUREHELPLINEDIST NC_("SIP_SA_MEASUREHELPLINEDIST", "Dimension help line spacing") +#define SIP_SA_MEASUREHELPLINE1LEN NC_("SIP_SA_MEASUREHELPLINE1LEN", "Backlog of dimension help line 1") +#define SIP_SA_MEASUREHELPLINE2LEN NC_("SIP_SA_MEASUREHELPLINE2LEN", "Backlog of dimension help line 2") +#define SIP_SA_MEASUREBELOWREFEDGE NC_("SIP_SA_MEASUREBELOWREFEDGE", "Lower edge dimensioning") +#define SIP_SA_MEASURETEXTROTA90 NC_("SIP_SA_MEASURETEXTROTA90", "Dimension value across dimension line") +#define SIP_SA_MEASURETEXTUPSIDEDOWN NC_("SIP_SA_MEASURETEXTUPSIDEDOWN", "Rotate dimension value by 180 degree") +#define SIP_SA_MEASUREOVERHANG NC_("SIP_SA_MEASUREOVERHANG", "Dimension line overhang") +#define SIP_SA_MEASUREUNIT NC_("SIP_SA_MEASUREUNIT", "Measure unit") +#define SIP_SA_MEASURESCALE NC_("SIP_SA_MEASURESCALE", "Additional scale factor") +#define SIP_SA_MEASURESHOWUNIT NC_("SIP_SA_MEASURESHOWUNIT", "Measure unit display") +#define SIP_SA_MEASUREFORMATSTRING NC_("SIP_SA_MEASUREFORMATSTRING", "Dimension value format") +#define SIP_SA_MEASURETEXTAUTOANGLE NC_("SIP_SA_MEASURETEXTAUTOANGLE", "AutoPositioning of the dimension value") +#define SIP_SA_MEASURETEXTAUTOANGLEVIEW NC_("SIP_SA_MEASURETEXTAUTOANGLEVIEW", "Angle for the automatic positioning of the dimension value") +#define SIP_SA_MEASURETEXTISFIXEDANGLE NC_("SIP_SA_MEASURETEXTISFIXEDANGLE", "Determination of the dimension value angle") +#define SIP_SA_MEASURETEXTFIXEDANGLE NC_("SIP_SA_MEASURETEXTFIXEDANGLE", "Angle of the dimension value") +#define SIP_SA_MEASUREDECIMALPLACES NC_("SIP_SA_MEASUREDECIMALPLACES", "Decimal places") +#define SIP_SA_CIRCKIND NC_("SIP_SA_CIRCKIND", "Type of circle") +#define SIP_SA_CIRCSTARTANGLE NC_("SIP_SA_CIRCSTARTANGLE", "Start angle") +#define SIP_SA_CIRCENDANGLE NC_("SIP_SA_CIRCENDANGLE", "End angle") +#define SIP_SA_OBJMOVEPROTECT NC_("SIP_SA_OBJMOVEPROTECT", "Protected object position") +#define SIP_SA_OBJSIZEPROTECT NC_("SIP_SA_OBJSIZEPROTECT", "Protected object size") +#define SIP_SA_OBJPRINTABLE NC_("SIP_SA_OBJPRINTABLE", "Object, printable") +#define SIP_SA_OBJVISIBLE NC_("SIP_SA_OBJVISIBLE", "Object, visible") +#define SIP_SA_LAYERID NC_("SIP_SA_LAYERID", "Level ID") +#define SIP_SA_LAYERNAME NC_("SIP_SA_LAYERNAME", "Layer") +#define SIP_SA_OBJECTNAME NC_("SIP_SA_OBJECTNAME", "Object name") +#define SIP_SA_ALLPOSITIONX NC_("SIP_SA_ALLPOSITIONX", "Position X, complete") +#define SIP_SA_ALLPOSITIONY NC_("SIP_SA_ALLPOSITIONY", "Position Y, complete") +#define SIP_SA_ALLSIZEWIDTH NC_("SIP_SA_ALLSIZEWIDTH", "Total Width") +#define SIP_SA_ALLSIZEHEIGHT NC_("SIP_SA_ALLSIZEHEIGHT", "Height, complete") +#define SIP_SA_ONEPOSITIONX NC_("SIP_SA_ONEPOSITIONX", "Single position X") +#define SIP_SA_ONEPOSITIONY NC_("SIP_SA_ONEPOSITIONY", "Single position Y") +#define SIP_SA_ONESIZEWIDTH NC_("SIP_SA_ONESIZEWIDTH", "Single width") +#define SIP_SA_ONESIZEHEIGHT NC_("SIP_SA_ONESIZEHEIGHT", "Single height") +#define SIP_SA_LOGICSIZEWIDTH NC_("SIP_SA_LOGICSIZEWIDTH", "Logical width") +#define SIP_SA_LOGICSIZEHEIGHT NC_("SIP_SA_LOGICSIZEHEIGHT", "Logical height") +#define SIP_SA_ROTATEANGLE NC_("SIP_SA_ROTATEANGLE", "Single rotation angle") +#define SIP_SA_SHEARANGLE NC_("SIP_SA_SHEARANGLE", "Single shear angle") +#define SIP_SA_MOVEX NC_("SIP_SA_MOVEX", "Move horizontally") +#define SIP_SA_MOVEY NC_("SIP_SA_MOVEY", "Move vertically") +#define SIP_SA_RESIZEXONE NC_("SIP_SA_RESIZEXONE", "Resize X, single") +#define SIP_SA_RESIZEYONE NC_("SIP_SA_RESIZEYONE", "Resize Y, single") +#define SIP_SA_ROTATEONE NC_("SIP_SA_ROTATEONE", "Single rotation") +#define SIP_SA_HORZSHEARONE NC_("SIP_SA_HORZSHEARONE", "Single horizontal shear") +#define SIP_SA_VERTSHEARONE NC_("SIP_SA_VERTSHEARONE", "Single vertical shear") +#define SIP_SA_RESIZEXALL NC_("SIP_SA_RESIZEXALL", "Resize X, complete") +#define SIP_SA_RESIZEYALL NC_("SIP_SA_RESIZEYALL", "Resize Y, complete") +#define SIP_SA_ROTATEALL NC_("SIP_SA_ROTATEALL", "Rotate all") +#define SIP_SA_HORZSHEARALL NC_("SIP_SA_HORZSHEARALL", "Shear horizontal, complete") +#define SIP_SA_VERTSHEARALL NC_("SIP_SA_VERTSHEARALL", "Shear vertical, complete") +#define SIP_SA_TRANSFORMREF1X NC_("SIP_SA_TRANSFORMREF1X", "Reference point 1 X") +#define SIP_SA_TRANSFORMREF1Y NC_("SIP_SA_TRANSFORMREF1Y", "Reference point 1 Y") +#define SIP_SA_TRANSFORMREF2X NC_("SIP_SA_TRANSFORMREF2X", "Reference point 2 X") +#define SIP_SA_TRANSFORMREF2Y NC_("SIP_SA_TRANSFORMREF2Y", "Reference point 2 Y") +#define SIP_EE_PARA_HYPHENATE NC_("SIP_EE_PARA_HYPHENATE", "Hyphenation") +#define SIP_EE_PARA_BULLETSTATE NC_("SIP_EE_PARA_BULLETSTATE", "Display bullets") +#define SIP_EE_PARA_OUTLLRSPACE NC_("SIP_EE_PARA_OUTLLRSPACE", "Numbering indents") +#define SIP_EE_PARA_OUTLLEVEL NC_("SIP_EE_PARA_OUTLLEVEL", "Numbering level") +#define SIP_EE_PARA_BULLET NC_("SIP_EE_PARA_BULLET", "Bullets and Numberings") +#define SIP_EE_PARA_LRSPACE NC_("SIP_EE_PARA_LRSPACE", "Indents") +#define SIP_EE_PARA_ULSPACE NC_("SIP_EE_PARA_ULSPACE", "Paragraph spacing") +#define SIP_EE_PARA_SBL NC_("SIP_EE_PARA_SBL", "Line spacing") +#define SIP_EE_PARA_JUST NC_("SIP_EE_PARA_JUST", "Paragraph alignment") +#define SIP_EE_PARA_TABS NC_("SIP_EE_PARA_TABS", "Tabulators") +#define SIP_EE_CHAR_COLOR NC_("SIP_EE_CHAR_COLOR", "Font color") +#define SIP_EE_CHAR_FONTINFO NC_("SIP_EE_CHAR_FONTINFO", "Character set") +#define SIP_EE_CHAR_FONTHEIGHT NC_("SIP_EE_CHAR_FONTHEIGHT", "Font size") +#define SIP_EE_CHAR_FONTWIDTH NC_("SIP_EE_CHAR_FONTWIDTH", "Font width") +#define SIP_EE_CHAR_WEIGHT NC_("SIP_EE_CHAR_WEIGHT", "Bold (thickness)") +#define SIP_EE_CHAR_UNDERLINE NC_("SIP_EE_CHAR_UNDERLINE", "Underline") +#define SIP_EE_CHAR_OVERLINE NC_("SIP_EE_CHAR_OVERLINE", "Overline") +#define SIP_EE_CHAR_STRIKEOUT NC_("SIP_EE_CHAR_STRIKEOUT", "Strikethrough") +#define SIP_EE_CHAR_ITALIC NC_("SIP_EE_CHAR_ITALIC", "Italic") +#define SIP_EE_CHAR_OUTLINE NC_("SIP_EE_CHAR_OUTLINE", "Outline") +#define SIP_EE_CHAR_SHADOW NC_("SIP_EE_CHAR_SHADOW", "Font shadow") +#define SIP_EE_CHAR_ESCAPEMENT NC_("SIP_EE_CHAR_ESCAPEMENT", "Superscript/subscript") +#define SIP_EE_CHAR_PAIRKERNING NC_("SIP_EE_CHAR_PAIRKERNING", "Kerning") +#define SIP_EE_CHAR_KERNING NC_("SIP_EE_CHAR_KERNING", "Manual kerning") +#define SIP_EE_CHAR_WLM NC_("SIP_EE_CHAR_WLM", "No underline for spaces") +#define SIP_EE_FEATURE_TAB NC_("SIP_EE_FEATURE_TAB", "Tabulator") +#define SIP_EE_FEATURE_LINEBR NC_("SIP_EE_FEATURE_LINEBR", "Optional line break") +#define SIP_EE_FEATURE_NOTCONV NC_("SIP_EE_FEATURE_NOTCONV", "Non-convertible character") +#define SIP_EE_FEATURE_FIELD NC_("SIP_EE_FEATURE_FIELD", "Fields") +#define SIP_SA_GRAFRED NC_("SIP_SA_GRAFRED", "Red") +#define SIP_SA_GRAFGREEN NC_("SIP_SA_GRAFGREEN", "Green") +#define SIP_SA_GRAFBLUE NC_("SIP_SA_GRAFBLUE", "Blue") +#define SIP_SA_GRAFLUMINANCE NC_("SIP_SA_GRAFLUMINANCE", "Brightness") +#define SIP_SA_GRAFCONTRAST NC_("SIP_SA_GRAFCONTRAST", "Contrast") +#define SIP_SA_GRAFGAMMA NC_("SIP_SA_GRAFGAMMA", "Gamma") +#define SIP_SA_GRAFTRANSPARENCE NC_("SIP_SA_GRAFTRANSPARENCE", "Transparency") +#define SIP_SA_GRAFINVERT NC_("SIP_SA_GRAFINVERT", "Invert") +#define SIP_SA_GRAFMODE NC_("SIP_SA_GRAFMODE", "Image mode") +#define SIP_SA_GRAFCROP NC_("SIP_SA_GRAFCROP", "Crop") +#define SIP_SA_GLOW_RADIUS NC_("SIP_SA_GLOW_RADIUS", "Radius of glow effect") +#define SIP_SA_GLOW_COLOR NC_("SIP_SA_GLOW_COLOR", "Color of glow effect") +#define SIP_SA_GLOW_TRANSPARENCY NC_("SIP_SA_GLOW_TRANSPARENCY", "Transparency of glow effect") +#define SIP_SA_SOFTEDGE_RADIUS NC_("SIP_SA_SOFTEDGE_RADIUS", "Radius of soft edge effect") +#define STR_ObjNameSingulMEDIA NC_("STR_ObjNameSingulMEDIA", "Media object") +#define STR_ObjNamePluralMEDIA NC_("STR_ObjNamePluralMEDIA", "Media objects") +// drawing layer table strings +#define STR_TABLE_INSCOL NC_("STR_TABLE_INSCOL", "Insert column") +#define STR_TABLE_INSROW NC_("STR_TABLE_INSROW", "Insert row") +#define STR_UNDO_COL_DELETE NC_("STR_UNDO_COL_DELETE", "Delete column") +#define STR_UNDO_ROW_DELETE NC_("STR_UNDO_ROW_DELETE", "Delete row") +#define STR_TABLE_SPLIT NC_("STR_TABLE_SPLIT", "Split cells") +#define STR_TABLE_MERGE NC_("STR_TABLE_MERGE", "Merge cells") +#define STR_TABLE_NUMFORMAT NC_("STR_TABLE_NUMFORMAT", "Format cell") +#define STR_TABLE_DISTRIBUTE_ROWS NC_("STR_TABLE_DISTRIBUTE_ROWS", "Distribute rows") +#define STR_TABLE_DISTRIBUTE_COLUMNS NC_("STR_TABLE_DISTRIBUTE_COLUMNS", "Distribute columns") +#define STR_TABLE_DELETE_CELL_CONTENTS NC_("STR_TABLE_DELETE_CELL_CONTENTS", "Delete cell contents") +#define STR_TABLE_STYLE NC_("STR_TABLE_STYLE", "Table style") +#define STR_TABLE_STYLE_SETTINGS NC_("STR_TABLE_STYLE_SETTINGS", "Table style settings") +#define STR_ObjNameSingulTable NC_("STR_ObjNameSingulTable", "Table") +#define STR_ObjNamePluralTable NC_("STR_ObjNamePluralTable", "Tables") +#define STR_ObjNameSingulFONTWORK NC_("STR_ObjNameSingulFONTWORK", "Font work") +// Strings for the Draw-Dialog -------------------------------------------- +#define RID_SVXSTR_SOLID NC_("RID_SVXSTR_SOLID", "Continuous") +#define RID_SVXSTR_GRADIENT NC_("RID_SVXSTR_GRADIENT", "Gradient") +#define RID_SVXSTR_BITMAP NC_("RID_SVXSTR_BITMAP", "Bitmap") +#define RID_SVXSTR_PATTERN NC_("RID_SVXSTR_PATTERN", "Pattern") +#define RID_SVXSTR_PATTERN_UNTITLED NC_("RID_SVXSTR_PATTERN_UNTITLED", "Untitled Pattern") +#define RID_SVXSTR_LINESTYLE NC_("RID_SVXSTR_LINESTYLE", "Line Style") +#define RID_SVXSTR_INVISIBLE NC_("RID_SVXSTR_INVISIBLE", "None") +#define RID_SVXSTR_COLOR NC_("RID_SVXSTR_COLOR", "Color") +#define RID_SVXSTR_HATCH NC_("RID_SVXSTR_HATCH", "Hatching") +#define RID_SVXSTR_LINEEND NC_("RID_SVXSTR_LINEEND", "Arrowheads") +#define RID_SVXSTR_ARROW NC_("RID_SVXSTR_ARROW", "Arrow") +#define RID_SVXSTR_SQUARE NC_("RID_SVXSTR_SQUARE", "Square") +#define RID_SVXSTR_CIRCLE NC_("RID_SVXSTR_CIRCLE", "Circle") +#define RID_SVXSTR_NONE NC_("RID_SVXSTR_NONE", "- none -") +#define RID_SVXSTR_TRANSPARENCE NC_("RID_SVXSTR_TRANSPARENCE", "Transparency") +#define RID_SVXSTR_CENTERED NC_("RID_SVXSTR_CENTERED", "Centered") +#define RID_SVXSTR_NOTCENTERED NC_("RID_SVXSTR_NOTCENTERED", "Not centered") +#define RID_SVXSTR_GRAFMODE_STANDARD NC_("RID_SVXSTR_GRAFMODE_STANDARD", "Default") +#define RID_SVXSTR_GRAFMODE_GREYS NC_("RID_SVXSTR_GRAFMODE_GREYS", "Grayscale") +#define RID_SVXSTR_GRAFMODE_MONO NC_("RID_SVXSTR_GRAFMODE_MONO", "Black/White") +#define RID_SVXSTR_GRAFMODE_WATERMARK NC_("RID_SVXSTR_GRAFMODE_WATERMARK", "Watermark") +#define RID_SVXSTR_COLORBAR NC_("RID_SVXSTR_COLORBAR", "Left click to apply as background color, right click to set line color") +// Default colors +#define RID_SVXSTR_COLOR_DEFAULT_FONT NC_("RID_SVXSTR_COLOR_DEFAULT_FONTCOLOR", "Dark Red 2") +#define RID_SVXSTR_COLOR_DEFAULT_FRAMELINE NC_("RID_SVXSTR_COLOR_DEFAULT_FRAMELINE", "Blue") +#define RID_SVXSTR_COLOR_DEFAULT_HIGHLIGHT NC_("RID_SVXSTR_COLOR_DEFAULT_HIGHLIGHT", "Yellow") +#define RID_SVXSTR_COLOR_DEFAULT_SHAPE_STROKE NC_("RID_SVXSTR_COLOR_DEFAULT_SHAPE_STROKE", "Dark Blue 1") +#define RID_SVXSTR_COLOR_DEFAULT_SHAPE_FILLING NC_("RID_SVXSTR_COLOR_DEFAULT_SHAPE_FILLING", "Light Blue 2") +// Elements of the standard color palette +#define RID_SVXSTR_COLOR_BLACK NC_("RID_SVXSTR_COLOR_BLACK", "Black") +#define RID_SVXSTR_COLOR_GREY NC_("RID_SVXSTR_COLOR_GREY", "Gray") +#define RID_SVXSTR_COLOR_WHITE NC_("RID_SVXSTR_COLOR_WHITE", "White") +#define RID_SVXSTR_COLOR_YELLOW NC_("RID_SVXSTR_COLOR_YELLOW", "Yellow") +#define RID_SVXSTR_COLOR_GOLD NC_("RID_SVXSTR_COLOR_GOLD", "Gold") +#define RID_SVXSTR_COLOR_ORANGE NC_("RID_SVXSTR_COLOR_ORANGE", "Orange") +#define RID_SVXSTR_COLOR_BRICK NC_("RID_SVXSTR_COLOR_BRICK", "Brick") +#define RID_SVXSTR_COLOR_RED NC_("RID_SVXSTR_COLOR_RED", "Red") +#define RID_SVXSTR_COLOR_MAGENTA NC_("RID_SVXSTR_COLOR_MAGENTA", "Magenta") +#define RID_SVXSTR_COLOR_PURPLE NC_("RID_SVXSTR_COLOR_PURPLE", "Purple") +#define RID_SVXSTR_COLOR_INDIGO NC_("RID_SVXSTR_COLOR_INDIGO", "Indigo") +#define RID_SVXSTR_COLOR_BLUE NC_("RID_SVXSTR_COLOR_BLUE", "Blue") +#define RID_SVXSTR_COLOR_TEAL NC_("RID_SVXSTR_COLOR_TEAL", "Teal") +#define RID_SVXSTR_COLOR_GREEN NC_("RID_SVXSTR_COLOR_GREEN", "Green") +#define RID_SVXSTR_COLOR_LIME NC_("RID_SVXSTR_COLOR_LIME", "Lime") +// Light variants of the standard color palette +#define RID_SVXSTR_COLOR_LIGHTGRAY NC_("RID_SVXSTR_COLOR_LIGHTGRAY", "Light Gray") +#define RID_SVXSTR_COLOR_LIGHTYELLOW NC_("RID_SVXSTR_COLOR_LIGHTYELLOW", "Light Yellow") +#define RID_SVXSTR_COLOR_LIGHTGOLD NC_("RID_SVXSTR_COLOR_LIGHTGOLD", "Light Gold") +#define RID_SVXSTR_COLOR_LIGHTORANGE NC_("RID_SVXSTR_COLOR_LIGHTORANGE", "Light Orange") +#define RID_SVXSTR_COLOR_LIGHTBRICK NC_("RID_SVXSTR_COLOR_LIGHTBRICK", "Light Brick") +#define RID_SVXSTR_COLOR_LIGHTRED NC_("RID_SVXSTR_COLOR_LIGHTRED", "Light Red") +#define RID_SVXSTR_COLOR_LIGHTMAGENTA NC_("RID_SVXSTR_COLOR_LIGHTMAGENTA", "Light Magenta") +#define RID_SVXSTR_COLOR_LIGHTPURPLE NC_("RID_SVXSTR_COLOR_LIGHTPURPLE", "Light Purple") +#define RID_SVXSTR_COLOR_LIGHTINDIGO NC_("RID_SVXSTR_COLOR_LIGHTINDIGO", "Light Indigo") +#define RID_SVXSTR_COLOR_LIGHTBLUE NC_("RID_SVXSTR_COLOR_LIGHTBLUE", "Light Blue") +#define RID_SVXSTR_COLOR_LIGHTTEAL NC_("RID_SVXSTR_COLOR_LIGHTTEAL", "Light Teal") +#define RID_SVXSTR_COLOR_LIGHTGREEN NC_("RID_SVXSTR_COLOR_LIGHTGREEN", "Light Green") +#define RID_SVXSTR_COLOR_LIGHTLIME NC_("RID_SVXSTR_COLOR_LIGHTLIME", "Light Lime") +// Dark variants of the standard color palette +#define RID_SVXSTR_COLOR_DARKGRAY NC_("RID_SVXSTR_COLOR_DARKGRAY", "Dark Gray") +#define RID_SVXSTR_COLOR_DARKYELLOW NC_("RID_SVXSTR_COLOR_DARKYELLOW", "Dark Yellow") +#define RID_SVXSTR_COLOR_DARKGOLD NC_("RID_SVXSTR_COLOR_DARKGOLD", "Dark Gold") +#define RID_SVXSTR_COLOR_DARKORANGE NC_("RID_SVXSTR_COLOR_DARKORANGE", "Dark Orange") +#define RID_SVXSTR_COLOR_DARKBRICK NC_("RID_SVXSTR_COLOR_DARKBRICK", "Dark Brick") +#define RID_SVXSTR_COLOR_DARKRED NC_("RID_SVXSTR_COLOR_DARKRED", "Dark Red") +#define RID_SVXSTR_COLOR_DARKMAGENTA NC_("RID_SVXSTR_COLOR_DARKMAGENTA", "Dark Magenta") +#define RID_SVXSTR_COLOR_DARKPURPLE NC_("RID_SVXSTR_COLOR_DARKPURPLE", "Dark Purple") +#define RID_SVXSTR_COLOR_DARKINDIGO NC_("RID_SVXSTR_COLOR_DARKINDIGO", "Dark Indigo") +#define RID_SVXSTR_COLOR_DARKBLUE NC_("RID_SVXSTR_COLOR_DARKBLUE", "Dark Blue") +#define RID_SVXSTR_COLOR_DARKTEAL NC_("RID_SVXSTR_COLOR_DARKTEAL", "Dark Teal") +#define RID_SVXSTR_COLOR_DARKGREEN NC_("RID_SVXSTR_COLOR_DARKGREEN", "Dark Green") +#define RID_SVXSTR_COLOR_DARKLIME NC_("RID_SVXSTR_COLOR_DARKLIME", "Dark Lime") +// Elements of the Tonal color palette +#define RID_SVXSTR_COLOR_VIOLET NC_("RID_SVXSTR_COLOR_VIOLET", "Violet") +#define RID_SVXSTR_COLOR_VIOLET_OUG NC_("RID_SVXSTR_COLOR_VIOLET_OUG", "Violet (Out of Gamut)") +#define RID_SVXSTR_COLOR_BLUE_OUG NC_("RID_SVXSTR_COLOR_BLUE_OUG", "Blue (Out of Gamut)") +#define RID_SVXSTR_COLOR_AZURE_OUG NC_("RID_SVXSTR_COLOR_AZURE_OUG", "Azure (Out of Gamut)") +#define RID_SVXSTR_COLOR_SPRINGGREEN_OUG NC_("RID_SVXSTR_COLOR_SPRINGGREEN_OUG", "Spring Green (Out of Gamut)") +#define RID_SVXSTR_COLOR_GREEN_OUG NC_("RID_SVXSTR_COLOR_GREEN_OUG", "Green (Out of Gamut)") +#define RID_SVXSTR_COLOR_CHARTREUSEGREEN_OUG NC_("RID_SVXSTR_COLOR_CHARTREUSEGREEN_OUG", "Chartreuse Green (Out of Gamut)") +#define RID_SVXSTR_COLOR_ORANGE_OUG NC_("RID_SVXSTR_COLOR_ORANGE_OUG", "Orange (Out of Gamut)") +#define RID_SVXSTR_COLOR_RED_OUG NC_("RID_SVXSTR_COLOR_RED_OUG", "Red (Out of Gamut)") +#define RID_SVXSTR_COLOR_ROSE_OUG NC_("RID_SVXSTR_COLOR_ROSE_OUG", "Rose (Out of Gamut)") +#define RID_SVXSTR_COLOR_AZURE NC_("RID_SVXSTR_COLOR_AZURE", "Azure") +#define RID_SVXSTR_COLOR_CYAN NC_("RID_SVXSTR_COLOR_CYAN", "Cyan") +#define RID_SVXSTR_COLOR_SPRINGGREEN NC_("RID_SVXSTR_COLOR_SPRINGGREEN", "Spring Green") +#define RID_SVXSTR_COLOR_CHARTREUSEGREEN NC_("RID_SVXSTR_COLOR_CHARTREUSEGREEN", "Chartreuse Green") +#define RID_SVXSTR_COLOR_ROSE NC_("RID_SVXSTR_COLOR_ROSE", "Rose") +//Elements of the Material color palette +#define RID_SVXSTR_COLOR_MATERIAL_GRAY_A NC_("RID_SVXSTR_COLOR_MATERIAL_GRAY_A", "Gray A") +#define RID_SVXSTR_COLOR_MATERIAL_YELLOW_A NC_("RID_SVXSTR_COLOR_MATERIAL_YELLOW_A", "Yellow A") +#define RID_SVXSTR_COLOR_MATERIAL_AMBER_A NC_("RID_SVXSTR_COLOR_MATERIAL_AMBER_A", "Amber A") +#define RID_SVXSTR_COLOR_MATERIAL_AMBER NC_("RID_SVXSTR_COLOR_MATERIAL_AMBER", "Amber") +#define RID_SVXSTR_COLOR_MATERIAL_ORANGE_A NC_("RID_SVXSTR_COLOR_MATERIAL_ORANGE_A", "Orange A") +#define RID_SVXSTR_COLOR_MATERIAL_DEEP_ORANGE_A NC_("RID_SVXSTR_COLOR_MATERIAL_DEEP_ORANGE_A", "Deep Orange A") +#define RID_SVXSTR_COLOR_MATERIAL_DEEP_ORANGE NC_("RID_SVXSTR_COLOR_MATERIAL_DEEP_ORANGE", "Deep Orange") +#define RID_SVXSTR_COLOR_MATERIAL_RED_A NC_("RID_SVXSTR_COLOR_MATERIAL_RED_A", "Red A") +#define RID_SVXSTR_COLOR_MATERIAL_PINK_A NC_("RID_SVXSTR_COLOR_MATERIAL_PINK_A", "Pink A") +#define RID_SVXSTR_COLOR_MATERIAL_PURPLE_A NC_("RID_SVXSTR_COLOR_MATERIAL_PURPLE_A", "Purple A") +#define RID_SVXSTR_COLOR_MATERIAL_DEEP_PURPLE_A NC_("RID_SVXSTR_COLOR_MATERIAL_DEEP_PURPLE_A", "Deep Purple A") +#define RID_SVXSTR_COLOR_MATERIAL_DEEP_PURPLE NC_("RID_SVXSTR_COLOR_MATERIAL_DEEP_PURPLE", "Deep Purple") +#define RID_SVXSTR_COLOR_MATERIAL_INDIGO_A NC_("RID_SVXSTR_COLOR_MATERIAL_INDIGO_A", "Indigo A") +#define RID_SVXSTR_COLOR_MATERIAL_BLUE_A NC_("RID_SVXSTR_COLOR_MATERIAL_BLUE_A", "Blue A") +#define RID_SVXSTR_COLOR_MATERIAL_LIGHT_BLUE_A NC_("RID_SVXSTR_COLOR_MATERIAL_LIGHT_BLUE_A", "Light Blue A") +#define RID_SVXSTR_COLOR_MATERIAL_CYAN_A NC_("RID_SVXSTR_COLOR_MATERIAL_CYAN_A", "Cyan A") +#define RID_SVXSTR_COLOR_MATERIAL_TEAL_A NC_("RID_SVXSTR_COLOR_MATERIAL_TEAL_A", "Teal A") +#define RID_SVXSTR_COLOR_MATERIAL_GREEN_A NC_("RID_SVXSTR_COLOR_MATERIAL_GREEN_A", "Green A") +#define RID_SVXSTR_COLOR_MATERIAL_LIGHT_GREEN_A NC_("RID_SVXSTR_COLOR_MATERIAL_LIGHT_GREEN_A", "Light Green A") +#define RID_SVXSTR_COLOR_MATERIAL_LIME_A NC_("RID_SVXSTR_COLOR_MATERIAL_LIME_A", "Lime A") +#define RID_SVXSTR_COLOR_MATERIAL_BROWN_A NC_("RID_SVXSTR_COLOR_MATERIAL_BROWN_A", "Brown A") +#define RID_SVXSTR_COLOR_MATERIAL_BROWN NC_("RID_SVXSTR_COLOR_MATERIAL_BROWN", "Brown") +#define RID_SVXSTR_COLOR_MATERIAL_BLUE_GRAY_A NC_("RID_SVXSTR_COLOR_MATERIAL_BLUE_GRAY_A", "Blue Gray A") +#define RID_SVXSTR_COLOR_MATERIAL_BLUE_GRAY NC_("RID_SVXSTR_COLOR_MATERIAL_BLUE_GRAY", "Blue Gray") +/* Old default color names, probably often used in saved files */ +#define RID_SVXSTR_COLOR_BLUE_CLASSIC NC_("RID_SVXSTR_COLOR_BLUE_CLASSIC", "Blue classic") +#define RID_SVXSTR_COLOR_BLUEGREY NC_("RID_SVXSTR_COLOR_BLUEGREY", "Blue gray") +#define RID_SVXSTR_COLOR_BORDEAUX NC_("RID_SVXSTR_COLOR_BORDEAUX", "Bordeaux") +#define RID_SVXSTR_COLOR_PALE_YELLOW NC_("RID_SVXSTR_COLOR_PALE_YELLOW", "Pale yellow") +#define RID_SVXSTR_COLOR_PALE_GREEN NC_("RID_SVXSTR_COLOR_PALE_GREEN", "Pale green") +#define RID_SVXSTR_COLOR_DARKVIOLET NC_("RID_SVXSTR_COLOR_DARKVIOLET", "Dark violet") +#define RID_SVXSTR_COLOR_SALMON NC_("RID_SVXSTR_COLOR_SALMON", "Salmon") +#define RID_SVXSTR_COLOR_SEABLUE NC_("RID_SVXSTR_COLOR_SEABLUE", "Sea blue") +#define RID_SVXSTR_COLOR_CHART NC_("RID_SVXSTR_COLOR_CHART", "Chart") +#define RID_SVXSTR_COLOR_SKYBLUE NC_("RID_SVXSTR_COLOR_SKYBLUE", "Sky blue") +#define RID_SVXSTR_COLOR_YELLOWGREEN NC_("RID_SVXSTR_COLOR_YELLOWGREEN", "Yellow green") +#define RID_SVXSTR_COLOR_PINK NC_("RID_SVXSTR_COLOR_PINK", "Pink") +#define RID_SVXSTR_COLOR_TURQUOISE NC_("RID_SVXSTR_COLOR_TURQUOISE", "Turquoise") +/* 16 old AutoFormat Table Styles */ +#define RID_SVXSTR_TBLAFMT_3D NC_("RID_SVXSTR_TBLAFMT_3D", "3D") +#define RID_SVXSTR_TBLAFMT_BLACK1 NC_("RID_SVXSTR_TBLAFMT_BLACK1", "Black 1") +#define RID_SVXSTR_TBLAFMT_BLACK2 NC_("RID_SVXSTR_TBLAFMT_BLACK2", "Black 2") +#define RID_SVXSTR_TBLAFMT_BLUE NC_("RID_SVXSTR_TBLAFMT_BLUE", "Blue") +#define RID_SVXSTR_TBLAFMT_BROWN NC_("RID_SVXSTR_TBLAFMT_BROWN", "Brown") +#define RID_SVXSTR_TBLAFMT_CURRENCY NC_("RID_SVXSTR_TBLAFMT_CURRENCY", "Currency") +#define RID_SVXSTR_TBLAFMT_CURRENCY_3D NC_("RID_SVXSTR_TBLAFMT_CURRENCY_3D", "Currency 3D") +#define RID_SVXSTR_TBLAFMT_CURRENCY_GRAY NC_("RID_SVXSTR_TBLAFMT_CURRENCY_GRAY", "Currency Gray") +#define RID_SVXSTR_TBLAFMT_CURRENCY_LAVENDER NC_("RID_SVXSTR_TBLAFMT_CURRENCY_LAVENDER", "Currency Lavender") +#define RID_SVXSTR_TBLAFMT_CURRENCY_TURQUOISE NC_("RID_SVXSTR_TBLAFMT_CURRENCY_TURQUOISE", "Currency Turquoise") +#define RID_SVXSTR_TBLAFMT_GRAY NC_("RID_SVXSTR_TBLAFMT_GRAY", "Gray") +#define RID_SVXSTR_TBLAFMT_GREEN NC_("RID_SVXSTR_TBLAFMT_GREEN", "Green") +#define RID_SVXSTR_TBLAFMT_LAVENDER NC_("RID_SVXSTR_TBLAFMT_LAVENDER", "Lavender") +#define RID_SVXSTR_TBLAFMT_RED NC_("RID_SVXSTR_TBLAFMT_RED", "Red") +#define RID_SVXSTR_TBLAFMT_TURQUOISE NC_("RID_SVXSTR_TBLAFMT_TURQUOISE", "Turquoise") +#define RID_SVXSTR_TBLAFMT_YELLOW NC_("RID_SVXSTR_TBLAFMT_YELLOW", "Yellow") +/* 10 new AutoFormat Table Styles since LibreOffice 6.0 */ +#define RID_SVXSTR_TBLAFMT_LO6_ACADEMIC NC_("RID_SVXSTR_TBLAFMT_LO6_ACADEMIC", "Academic") +#define RID_SVXSTR_TBLAFMT_LO6_BOX_LIST_BLUE NC_("RID_SVXSTR_TBLAFMT_LO6_BOX_LIST_BLUE", "Box List Blue") +#define RID_SVXSTR_TBLAFMT_LO6_BOX_LIST_GREEN NC_("RID_SVXSTR_TBLAFMT_LO6_BOX_LIST_GREEN", "Box List Green") +#define RID_SVXSTR_TBLAFMT_LO6_BOX_LIST_RED NC_("RID_SVXSTR_TBLAFMT_LO6_BOX_LIST_RED", "Box List Red") +#define RID_SVXSTR_TBLAFMT_LO6_BOX_LIST_YELLOW NC_("RID_SVXSTR_TBLAFMT_LO6_BOX_LIST_YELLOW", "Box List Yellow") +#define RID_SVXSTR_TBLAFMT_LO6_ELEGANT NC_("RID_SVXSTR_TBLAFMT_LO6_ELEGANT", "Elegant") +#define RID_SVXSTR_TBLAFMT_LO6_FINANCIAL NC_("RID_SVXSTR_TBLAFMT_LO6_FINANCIAL", "Financial") +#define RID_SVXSTR_TBLAFMT_LO6_SIMPLE_GRID_COLUMNS NC_("RID_SVXSTR_TBLAFMT_LO6_SIMPLE_GRID_COLUMNS", "Simple Grid Columns") +#define RID_SVXSTR_TBLAFMT_LO6_SIMPLE_GRID_ROWS NC_("RID_SVXSTR_TBLAFMT_LO6_SIMPLE_GRID_ROWS", "Simple Grid Rows") +#define RID_SVXSTR_TBLAFMT_LO6_SIMPLE_LIST_SHADED NC_("RID_SVXSTR_TBLAFMT_LO6_SIMPLE_LIST_SHADED", "Simple List Shaded") +#define RID_SVXSTR_LINEJOINT_MIDDLE NC_("RID_SVXSTR_LINEJOINT_MIDDLE", "Line joint averaged") +#define RID_SVXSTR_LINEJOINT_BEVEL NC_("RID_SVXSTR_LINEJOINT_BEVEL", "Line joint bevel") +#define RID_SVXSTR_LINEJOINT_MITER NC_("RID_SVXSTR_LINEJOINT_MITER", "Line joint miter") +#define RID_SVXSTR_LINEJOINT_ROUND NC_("RID_SVXSTR_LINEJOINT_ROUND", "Line joint round") +// the familiar name for it +#define RID_SVXSTR_LINECAP_BUTT NC_("RID_SVXSTR_LINECAP_BUTT", "Line cap flat") +#define RID_SVXSTR_LINECAP_ROUND NC_("RID_SVXSTR_LINECAP_ROUND", "Line cap round") +#define RID_SVXSTR_LINECAP_SQUARE NC_("RID_SVXSTR_LINECAP_SQUARE", "Line cap square") +#define RID_SVXSTR_GRDT0 NC_("RID_SVXSTR_GRDT0", "Gradient") +#define RID_SVXSTR_GRDT1 NC_("RID_SVXSTR_GRDT1", "Linear blue/white") +#define RID_SVXSTR_GRDT2 NC_("RID_SVXSTR_GRDT2", "Linear magenta/green") +#define RID_SVXSTR_GRDT3 NC_("RID_SVXSTR_GRDT3", "Linear yellow/brown") +#define RID_SVXSTR_GRDT4 NC_("RID_SVXSTR_GRDT4", "Radial green/black") +#define RID_SVXSTR_GRDT5 NC_("RID_SVXSTR_GRDT5", "Radial red/yellow") +#define RID_SVXSTR_GRDT6 NC_("RID_SVXSTR_GRDT6", "Rectangular red/white") +#define RID_SVXSTR_GRDT7 NC_("RID_SVXSTR_GRDT7", "Square yellow/white") +#define RID_SVXSTR_GRDT8 NC_("RID_SVXSTR_GRDT8", "Ellipsoid blue gray/light blue") +#define RID_SVXSTR_GRDT9 NC_("RID_SVXSTR_GRDT9", "Axial light red/white") +// l means left +#define RID_SVXSTR_GRDT10 NC_("RID_SVXSTR_GRDT10", "Diagonal 1l") +// r means right +#define RID_SVXSTR_GRDT11 NC_("RID_SVXSTR_GRDT11", "Diagonal 1r") +// l means left +#define RID_SVXSTR_GRDT12 NC_("RID_SVXSTR_GRDT12", "Diagonal 2l") +// r means right +#define RID_SVXSTR_GRDT13 NC_("RID_SVXSTR_GRDT13", "Diagonal 2r") +// l means left +#define RID_SVXSTR_GRDT14 NC_("RID_SVXSTR_GRDT14", "Diagonal 3l") +// r means right +#define RID_SVXSTR_GRDT15 NC_("RID_SVXSTR_GRDT15", "Diagonal 3r") +// l means left +#define RID_SVXSTR_GRDT16 NC_("RID_SVXSTR_GRDT16", "Diagonal 4l") +// r means right +#define RID_SVXSTR_GRDT17 NC_("RID_SVXSTR_GRDT17", "Diagonal 4r") +#define RID_SVXSTR_GRDT18 NC_("RID_SVXSTR_GRDT18", "Diagonal Blue") +#define RID_SVXSTR_GRDT19 NC_("RID_SVXSTR_GRDT19", "Diagonal Green") +#define RID_SVXSTR_GRDT20 NC_("RID_SVXSTR_GRDT20", "Diagonal Orange") +#define RID_SVXSTR_GRDT21 NC_("RID_SVXSTR_GRDT21", "Diagonal Red") +#define RID_SVXSTR_GRDT22 NC_("RID_SVXSTR_GRDT22", "Diagonal Turquoise") +#define RID_SVXSTR_GRDT23 NC_("RID_SVXSTR_GRDT23", "Diagonal Violet") +#define RID_SVXSTR_GRDT24 NC_("RID_SVXSTR_GRDT24", "From a Corner") +#define RID_SVXSTR_GRDT25 NC_("RID_SVXSTR_GRDT25", "From a Corner, Blue") +#define RID_SVXSTR_GRDT26 NC_("RID_SVXSTR_GRDT26", "From a Corner, Green") +#define RID_SVXSTR_GRDT27 NC_("RID_SVXSTR_GRDT27", "From a Corner, Orange") +#define RID_SVXSTR_GRDT28 NC_("RID_SVXSTR_GRDT28", "From a Corner, Red") +#define RID_SVXSTR_GRDT29 NC_("RID_SVXSTR_GRDT29", "From a Corner, Turquoise") +#define RID_SVXSTR_GRDT30 NC_("RID_SVXSTR_GRDT30", "From a Corner, Violet") +#define RID_SVXSTR_GRDT31 NC_("RID_SVXSTR_GRDT31", "From the Middle") +#define RID_SVXSTR_GRDT32 NC_("RID_SVXSTR_GRDT32", "From the Middle, Blue") +#define RID_SVXSTR_GRDT33 NC_("RID_SVXSTR_GRDT33", "From the Middle, Green") +#define RID_SVXSTR_GRDT34 NC_("RID_SVXSTR_GRDT34", "From the Middle, Orange") +#define RID_SVXSTR_GRDT35 NC_("RID_SVXSTR_GRDT35", "From the Middle, Red") +#define RID_SVXSTR_GRDT36 NC_("RID_SVXSTR_GRDT36", "From the Middle, Turquoise") +#define RID_SVXSTR_GRDT37 NC_("RID_SVXSTR_GRDT37", "From the Middle, Violet") +#define RID_SVXSTR_GRDT38 NC_("RID_SVXSTR_GRDT38", "Horizontal") +#define RID_SVXSTR_GRDT39 NC_("RID_SVXSTR_GRDT39", "Horizontal Blue") +#define RID_SVXSTR_GRDT40 NC_("RID_SVXSTR_GRDT40", "Horizontal Green") +#define RID_SVXSTR_GRDT41 NC_("RID_SVXSTR_GRDT41", "Horizontal Orange") +#define RID_SVXSTR_GRDT42 NC_("RID_SVXSTR_GRDT42", "Horizontal Red") +#define RID_SVXSTR_GRDT43 NC_("RID_SVXSTR_GRDT43", "Horizontal Turquoise") +#define RID_SVXSTR_GRDT44 NC_("RID_SVXSTR_GRDT44", "Horizontal Violet") +#define RID_SVXSTR_GRDT45 NC_("RID_SVXSTR_GRDT45", "Radial") +#define RID_SVXSTR_GRDT46 NC_("RID_SVXSTR_GRDT46", "Radial Blue") +#define RID_SVXSTR_GRDT47 NC_("RID_SVXSTR_GRDT47", "Radial Green") +#define RID_SVXSTR_GRDT48 NC_("RID_SVXSTR_GRDT48", "Radial Orange") +#define RID_SVXSTR_GRDT49 NC_("RID_SVXSTR_GRDT49", "Radial Red") +#define RID_SVXSTR_GRDT50 NC_("RID_SVXSTR_GRDT50", "Radial Turquoise") +#define RID_SVXSTR_GRDT51 NC_("RID_SVXSTR_GRDT51", "Radial Violet") +#define RID_SVXSTR_GRDT52 NC_("RID_SVXSTR_GRDT52", "Vertical") +#define RID_SVXSTR_GRDT53 NC_("RID_SVXSTR_GRDT53", "Vertical Blue") +#define RID_SVXSTR_GRDT54 NC_("RID_SVXSTR_GRDT54", "Vertical Green") +#define RID_SVXSTR_GRDT55 NC_("RID_SVXSTR_GRDT55", "Vertical Orange") +#define RID_SVXSTR_GRDT56 NC_("RID_SVXSTR_GRDT56", "Vertical Red") +#define RID_SVXSTR_GRDT57 NC_("RID_SVXSTR_GRDT57", "Vertical Turquoise") +#define RID_SVXSTR_GRDT58 NC_("RID_SVXSTR_GRDT58", "Vertical Violet") +//gradients of unknown provenience +#define RID_SVXSTR_GRDT59 NC_("RID_SVXSTR_GRDT59", "Gray Gradient") +#define RID_SVXSTR_GRDT60 NC_("RID_SVXSTR_GRDT60", "Yellow Gradient") +#define RID_SVXSTR_GRDT61 NC_("RID_SVXSTR_GRDT61", "Orange Gradient") +#define RID_SVXSTR_GRDT62 NC_("RID_SVXSTR_GRDT62", "Red Gradient") +#define RID_SVXSTR_GRDT63 NC_("RID_SVXSTR_GRDT63", "Pink Gradient") +#define RID_SVXSTR_GRDT64 NC_("RID_SVXSTR_GRDT64", "Sky") +#define RID_SVXSTR_GRDT65 NC_("RID_SVXSTR_GRDT65", "Cyan Gradient") +#define RID_SVXSTR_GRDT66 NC_("RID_SVXSTR_GRDT66", "Blue Gradient") +#define RID_SVXSTR_GRDT67 NC_("RID_SVXSTR_GRDT67", "Purple Pipe") +#define RID_SVXSTR_GRDT68 NC_("RID_SVXSTR_GRDT68", "Night") +#define RID_SVXSTR_GRDT69 NC_("RID_SVXSTR_GRDT69", "Green Gradient") +//actual gradients defined for 6.1 +#define RID_SVXSTR_GRDT70 NC_("RID_SVXSTR_GRDT70", "Pastel Bouquet") +#define RID_SVXSTR_GRDT71 NC_("RID_SVXSTR_GRDT71", "Pastel Dream") +#define RID_SVXSTR_GRDT72 NC_("RID_SVXSTR_GRDT72", "Blue Touch") +#define RID_SVXSTR_GRDT73 NC_("RID_SVXSTR_GRDT73", "Blank with Gray") +#define RID_SVXSTR_GRDT74 NC_("RID_SVXSTR_GRDT74", "Spotted Gray") +#define RID_SVXSTR_GRDT75 NC_("RID_SVXSTR_GRDT75", "London Mist") +#define RID_SVXSTR_GRDT76 NC_("RID_SVXSTR_GRDT76", "Teal to Blue") +#define RID_SVXSTR_GRDT77 NC_("RID_SVXSTR_GRDT77", "Midnight") +#define RID_SVXSTR_GRDT78 NC_("RID_SVXSTR_GRDT78", "Deep Ocean") +#define RID_SVXSTR_GRDT79 NC_("RID_SVXSTR_GRDT79", "Submarine") +#define RID_SVXSTR_GRDT80 NC_("RID_SVXSTR_GRDT80", "Green Grass") +#define RID_SVXSTR_GRDT81 NC_("RID_SVXSTR_GRDT81", "Neon Light") +#define RID_SVXSTR_GRDT82 NC_("RID_SVXSTR_GRDT82", "Sunshine") +#define RID_SVXSTR_GRDT83 NC_("RID_SVXSTR_GRDT83", "Present") +#define RID_SVXSTR_GRDT84 NC_("RID_SVXSTR_GRDT84", "Mahogany") +// /gradients +#define RID_SVXSTR_HATCH0 NC_("RID_SVXSTR_HATCH0", "Black 0 Degrees") +#define RID_SVXSTR_HATCH1 NC_("RID_SVXSTR_HATCH1", "Black 90 Degrees") +#define RID_SVXSTR_HATCH2 NC_("RID_SVXSTR_HATCH2", "Black 180 Degrees Crossed") +#define RID_SVXSTR_HATCH3 NC_("RID_SVXSTR_HATCH3", "Blue 45 Degrees") +#define RID_SVXSTR_HATCH4 NC_("RID_SVXSTR_HATCH4", "Blue -45 Degrees") +#define RID_SVXSTR_HATCH5 NC_("RID_SVXSTR_HATCH5", "Blue 45 Degrees Crossed") +#define RID_SVXSTR_HATCH6 NC_("RID_SVXSTR_HATCH6", "Green 30 Degrees") +#define RID_SVXSTR_HATCH7 NC_("RID_SVXSTR_HATCH7", "Green 60 Degrees") +#define RID_SVXSTR_HATCH8 NC_("RID_SVXSTR_HATCH8", "Green 90 Degrees Triple") +#define RID_SVXSTR_HATCH9 NC_("RID_SVXSTR_HATCH9", "Red 45 Degrees") +#define RID_SVXSTR_HATCH10 NC_("RID_SVXSTR_HATCH10", "Red 90 Degrees Crossed") +#define RID_SVXSTR_HATCH11 NC_("RID_SVXSTR_HATCH11", "Red -45 Degrees Triple") +#define RID_SVXSTR_HATCH12 NC_("RID_SVXSTR_HATCH12", "Yellow 45 Degrees") +#define RID_SVXSTR_HATCH13 NC_("RID_SVXSTR_HATCH13", "Yellow 45 Degrees Crossed") +#define RID_SVXSTR_HATCH14 NC_("RID_SVXSTR_HATCH14", "Yellow 45 Degrees Triple") +#define RID_SVXSTR_HATCH15 NC_("RID_SVXSTR_HATCH15", "Hatching") +#define RID_SVXSTR_BMP0 NC_("RID_SVXSTR_BMP0", "Empty") +#define RID_SVXSTR_BMP1 NC_("RID_SVXSTR_BMP1", "Painted White") +#define RID_SVXSTR_BMP2 NC_("RID_SVXSTR_BMP2", "Paper Texture") +#define RID_SVXSTR_BMP3 NC_("RID_SVXSTR_BMP3", "Paper Crumpled") +#define RID_SVXSTR_BMP4 NC_("RID_SVXSTR_BMP4", "Paper Graph") +#define RID_SVXSTR_BMP5 NC_("RID_SVXSTR_BMP5", "Parchment Paper") +#define RID_SVXSTR_BMP6 NC_("RID_SVXSTR_BMP6", "Fence") +#define RID_SVXSTR_BMP7 NC_("RID_SVXSTR_BMP7", "Wooden Board") +#define RID_SVXSTR_BMP8 NC_("RID_SVXSTR_BMP8", "Maple Leaves") +#define RID_SVXSTR_BMP9 NC_("RID_SVXSTR_BMP9", "Lawn") +#define RID_SVXSTR_BMP10 NC_("RID_SVXSTR_BMP10", "Colorful Pebbles") +#define RID_SVXSTR_BMP11 NC_("RID_SVXSTR_BMP11", "Coffee Beans") +#define RID_SVXSTR_BMP12 NC_("RID_SVXSTR_BMP12", "Little Clouds") +#define RID_SVXSTR_BMP13 NC_("RID_SVXSTR_BMP13", "Bathroom Tiles") +#define RID_SVXSTR_BMP14 NC_("RID_SVXSTR_BMP14", "Wall of Rock") +#define RID_SVXSTR_BMP15 NC_("RID_SVXSTR_BMP15", "Zebra") +#define RID_SVXSTR_BMP16 NC_("RID_SVXSTR_BMP16", "Color Stripes") +#define RID_SVXSTR_BMP17 NC_("RID_SVXSTR_BMP17", "Gravel") +#define RID_SVXSTR_BMP18 NC_("RID_SVXSTR_BMP18", "Parchment Studio") +#define RID_SVXSTR_BMP19 NC_("RID_SVXSTR_BMP19", "Night Sky") +#define RID_SVXSTR_BMP20 NC_("RID_SVXSTR_BMP20", "Pool") +#define RID_SVXSTR_BMP21 NC_("RID_SVXSTR_BMP21", "Bitmap") +#define RID_SVXSTR_BMP79 NC_("RID_SVXSTR_BMP79", "Invoice Paper") +#define RID_SVXSTR_BMP80 NC_("RID_SVXSTR_BMP80", "Concrete") +#define RID_SVXSTR_BMP81 NC_("RID_SVXSTR_BMP81", "Brick Wall") +#define RID_SVXSTR_BMP82 NC_("RID_SVXSTR_BMP82", "Stone Wall") +#define RID_SVXSTR_BMP83 NC_("RID_SVXSTR_BMP83", "Floral") +#define RID_SVXSTR_BMP84 NC_("RID_SVXSTR_BMP84", "Space") +#define RID_SVXSTR_BMP85 NC_("RID_SVXSTR_BMP85", "Ice light") +#define RID_SVXSTR_BMP86 NC_("RID_SVXSTR_BMP86", "Marble") +#define RID_SVXSTR_BMP87 NC_("RID_SVXSTR_BMP87", "Sand light") +#define RID_SVXSTR_BMP88 NC_("RID_SVXSTR_BMP88", "Stone") +#define RID_SVXSTR_BMP89 NC_("RID_SVXSTR_BMP89", "White Diffusion") +#define RID_SVXSTR_BMP90 NC_("RID_SVXSTR_BMP90", "Surface") +#define RID_SVXSTR_BMP91 NC_("RID_SVXSTR_BMP91", "Cardboard") +#define RID_SVXSTR_BMP92 NC_("RID_SVXSTR_BMP92", "Studio") +#define RID_SVXSTR_BMP22 NC_("RID_SVXSTR_BMP22", "5 Percent") +#define RID_SVXSTR_BMP23 NC_("RID_SVXSTR_BMP23", "10 Percent") +#define RID_SVXSTR_BMP24 NC_("RID_SVXSTR_BMP24", "20 Percent") +#define RID_SVXSTR_BMP25 NC_("RID_SVXSTR_BMP25", "25 Percent") +#define RID_SVXSTR_BMP26 NC_("RID_SVXSTR_BMP26", "30 Percent") +#define RID_SVXSTR_BMP27 NC_("RID_SVXSTR_BMP27", "40 Percent") +#define RID_SVXSTR_BMP28 NC_("RID_SVXSTR_BMP28", "50 Percent") +#define RID_SVXSTR_BMP29 NC_("RID_SVXSTR_BMP29", "60 Percent") +#define RID_SVXSTR_BMP30 NC_("RID_SVXSTR_BMP30", "70 Percent") +#define RID_SVXSTR_BMP31 NC_("RID_SVXSTR_BMP31", "75 Percent") +#define RID_SVXSTR_BMP32 NC_("RID_SVXSTR_BMP32", "80 Percent") +#define RID_SVXSTR_BMP33 NC_("RID_SVXSTR_BMP33", "90 Percent") +#define RID_SVXSTR_BMP34 NC_("RID_SVXSTR_BMP34", "Light Downward Diagonal") +#define RID_SVXSTR_BMP35 NC_("RID_SVXSTR_BMP35", "Light Upward Diagonal") +#define RID_SVXSTR_BMP36 NC_("RID_SVXSTR_BMP36", "Dark Downward Diagonal") +#define RID_SVXSTR_BMP37 NC_("RID_SVXSTR_BMP37", "Dark Upward Diagonal") +#define RID_SVXSTR_BMP38 NC_("RID_SVXSTR_BMP38", "Wide Downward Diagonal") +#define RID_SVXSTR_BMP39 NC_("RID_SVXSTR_BMP39", "Wide Upward Diagonal") +#define RID_SVXSTR_BMP40 NC_("RID_SVXSTR_BMP40", "Light Vertical") +#define RID_SVXSTR_BMP41 NC_("RID_SVXSTR_BMP41", "Light Horizontal") +#define RID_SVXSTR_BMP42 NC_("RID_SVXSTR_BMP42", "Narrow Vertical") +#define RID_SVXSTR_BMP43 NC_("RID_SVXSTR_BMP43", "Narrow Horizontal") +#define RID_SVXSTR_BMP44 NC_("RID_SVXSTR_BMP44", "Dark Vertical") +#define RID_SVXSTR_BMP45 NC_("RID_SVXSTR_BMP45", "Dark Horizontal") +#define RID_SVXSTR_BMP46 NC_("RID_SVXSTR_BMP46", "Dashed Downward Diagonal") +#define RID_SVXSTR_BMP47 NC_("RID_SVXSTR_BMP47", "Dashed Upward Diagonal") +#define RID_SVXSTR_BMP48 NC_("RID_SVXSTR_BMP48", "Dashed Horizontal") +#define RID_SVXSTR_BMP49 NC_("RID_SVXSTR_BMP49", "Dashed Vertical") +#define RID_SVXSTR_BMP50 NC_("RID_SVXSTR_BMP50", "Small Confetti") +#define RID_SVXSTR_BMP51 NC_("RID_SVXSTR_BMP51", "Large Confetti") +#define RID_SVXSTR_BMP52 NC_("RID_SVXSTR_BMP52", "Zig Zag") +#define RID_SVXSTR_BMP53 NC_("RID_SVXSTR_BMP53", "Wave") +#define RID_SVXSTR_BMP54 NC_("RID_SVXSTR_BMP54", "Diagonal Brick") +#define RID_SVXSTR_BMP55 NC_("RID_SVXSTR_BMP55", "Horizontal Brick") +#define RID_SVXSTR_BMP56 NC_("RID_SVXSTR_BMP56", "Weave") +#define RID_SVXSTR_BMP57 NC_("RID_SVXSTR_BMP57", "Plaid") +#define RID_SVXSTR_BMP58 NC_("RID_SVXSTR_BMP58", "Divot") +#define RID_SVXSTR_BMP59 NC_("RID_SVXSTR_BMP59", "Dotted Grid") +#define RID_SVXSTR_BMP60 NC_("RID_SVXSTR_BMP60", "Dotted Diamond") +#define RID_SVXSTR_BMP61 NC_("RID_SVXSTR_BMP61", "Shingle") +#define RID_SVXSTR_BMP62 NC_("RID_SVXSTR_BMP62", "Trellis") +#define RID_SVXSTR_BMP63 NC_("RID_SVXSTR_BMP63", "Sphere") +#define RID_SVXSTR_BMP64 NC_("RID_SVXSTR_BMP64", "Small Grid") +#define RID_SVXSTR_BMP65 NC_("RID_SVXSTR_BMP65", "Large Grid") +#define RID_SVXSTR_BMP66 NC_("RID_SVXSTR_BMP66", "Small Checker Board") +#define RID_SVXSTR_BMP67 NC_("RID_SVXSTR_BMP67", "Large Checker Board") +#define RID_SVXSTR_BMP68 NC_("RID_SVXSTR_BMP68", "Outlined Diamond") +#define RID_SVXSTR_BMP69 NC_("RID_SVXSTR_BMP69", "Solid Diamond") +#define RID_SVXSTR_BMP70 NC_("RID_SVXSTR_BMP70", "Vertical") +#define RID_SVXSTR_BMP71 NC_("RID_SVXSTR_BMP71", "Horizontal") +#define RID_SVXSTR_BMP72 NC_("RID_SVXSTR_BMP72", "Downward Diagonal") +#define RID_SVXSTR_BMP73 NC_("RID_SVXSTR_BMP73", "Upward Diagonal") +#define RID_SVXSTR_BMP74 NC_("RID_SVXSTR_BMP74", "Cross") +#define RID_SVXSTR_BMP75 NC_("RID_SVXSTR_BMP75", "Diagonal Cross") +#define RID_SVXSTR_BMP76 NC_("RID_SVXSTR_BMP76", "Dashed Dotted") +#define RID_SVXSTR_BMP77 NC_("RID_SVXSTR_BMP77", "Dashed Dotted Upward Diagonal") +#define RID_SVXSTR_BMP78 NC_("RID_SVXSTR_BMP78", "Solid Dotted") +#define RID_SVXSTR_DASH0 NC_("RID_SVXSTR_DASH0", "Dot") +#define RID_SVXSTR_DASH1 NC_("RID_SVXSTR_DASH1", "Long Dot") +#define RID_SVXSTR_DASH2 NC_("RID_SVXSTR_DASH2", "Double Dot") +#define RID_SVXSTR_DASH3 NC_("RID_SVXSTR_DASH3", "Dash") +#define RID_SVXSTR_DASH4 NC_("RID_SVXSTR_DASH4", "Long Dash") +#define RID_SVXSTR_DASH5 NC_("RID_SVXSTR_DASH5", "Double Dash") +#define RID_SVXSTR_DASH6 NC_("RID_SVXSTR_DASH6", "Long Dash Dot") +#define RID_SVXSTR_DASH7 NC_("RID_SVXSTR_DASH7", "Double Dash Dot") +#define RID_SVXSTR_DASH8 NC_("RID_SVXSTR_DASH8", "Double Dash Dot Dot") +#define RID_SVXSTR_DASH9 NC_("RID_SVXSTR_DASH9", "Ultrafine Dotted") +#define RID_SVXSTR_DASH10 NC_("RID_SVXSTR_DASH10", "Fine Dotted") +#define RID_SVXSTR_DASH11 NC_("RID_SVXSTR_DASH11", "Ultrafine Dashed") +#define RID_SVXSTR_DASH12 NC_("RID_SVXSTR_DASH12", "Fine Dashed") +#define RID_SVXSTR_DASH13 NC_("RID_SVXSTR_DASH13", "Fine Dashed") +#define RID_SVXSTR_DASH14 NC_("RID_SVXSTR_DASH14", "Dashed") +#define RID_SVXSTR_DASH15 NC_("RID_SVXSTR_DASH15", "Line Style 9") +#define RID_SVXSTR_DASH16 NC_("RID_SVXSTR_DASH16", "3 Dashes 3 Dots") +#define RID_SVXSTR_DASH17 NC_("RID_SVXSTR_DASH17", "Ultrafine 2 Dots 3 Dashes") +#define RID_SVXSTR_DASH18 NC_("RID_SVXSTR_DASH18", "2 Dots 1 Dash") +#define RID_SVXSTR_DASH19 NC_("RID_SVXSTR_DASH19", "Line with Fine Dots") +#define RID_SVXSTR_DASH20 NC_("RID_SVXSTR_DASH20", "Dashed") +#define RID_SVXSTR_DASH21 NC_("RID_SVXSTR_DASH21", "Line Style") +#define RID_SVXSTR_IMAP_ALL_FILTER NC_("RID_SVXSTR_IMAP_ALL_FILTER", "All formats") +#define RID_SVXSTR_LEND0 NC_("RID_SVXSTR_LEND0", "Concave short") +#define RID_SVXSTR_LEND1 NC_("RID_SVXSTR_LEND1", "Square 45") +#define RID_SVXSTR_LEND2 NC_("RID_SVXSTR_LEND2", "Arrow short") +#define RID_SVXSTR_LEND3 NC_("RID_SVXSTR_LEND3", "Dimension Lines") +#define RID_SVXSTR_LEND4 NC_("RID_SVXSTR_LEND4", "Double Arrow") +#define RID_SVXSTR_LEND5 NC_("RID_SVXSTR_LEND5", "Triangle") +#define RID_SVXSTR_LEND6 NC_("RID_SVXSTR_LEND6", "Concave") +#define RID_SVXSTR_LEND7 NC_("RID_SVXSTR_LEND7", "Arrow large") +#define RID_SVXSTR_LEND8 NC_("RID_SVXSTR_LEND8", "Dimension Line") +#define RID_SVXSTR_LEND9 NC_("RID_SVXSTR_LEND9", "Circle") +#define RID_SVXSTR_LEND10 NC_("RID_SVXSTR_LEND10", "Square") +#define RID_SVXSTR_LEND11 NC_("RID_SVXSTR_LEND11", "Arrow") +#define RID_SVXSTR_LEND12 NC_("RID_SVXSTR_LEND12", "Half Circle") +#define RID_SVXSTR_LEND13 NC_("RID_SVXSTR_LEND13", "Triangle unfilled") +#define RID_SVXSTR_LEND14 NC_("RID_SVXSTR_LEND14", "Diamond unfilled") +#define RID_SVXSTR_LEND15 NC_("RID_SVXSTR_LEND15", "Diamond") +#define RID_SVXSTR_LEND16 NC_("RID_SVXSTR_LEND16", "Circle unfilled") +#define RID_SVXSTR_LEND17 NC_("RID_SVXSTR_LEND17", "Square 45 unfilled") +#define RID_SVXSTR_LEND18 NC_("RID_SVXSTR_LEND18", "Square unfilled") +#define RID_SVXSTR_LEND19 NC_("RID_SVXSTR_LEND19", "Half Circle unfilled") +#define RID_SVXSTR_LEND20 NC_("RID_SVXSTR_LEND20", "Dimension Line Arrow") +#define RID_SVXSTR_LEND21 NC_("RID_SVXSTR_LEND21", "Line short") +#define RID_SVXSTR_LEND22 NC_("RID_SVXSTR_LEND22", "Line") +#define RID_SVXSTR_LEND23 NC_("RID_SVXSTR_LEND23", "Half Arrow left") +#define RID_SVXSTR_LEND24 NC_("RID_SVXSTR_LEND24", "Half Arrow right") +#define RID_SVXSTR_LEND25 NC_("RID_SVXSTR_LEND25", "Reversed Arrow") +#define RID_SVXSTR_LEND26 NC_("RID_SVXSTR_LEND26", "CF One") +#define RID_SVXSTR_LEND27 NC_("RID_SVXSTR_LEND27", "CF Only One") +#define RID_SVXSTR_LEND28 NC_("RID_SVXSTR_LEND28", "CF Many") +#define RID_SVXSTR_LEND29 NC_("RID_SVXSTR_LEND29", "CF Many One") +#define RID_SVXSTR_LEND30 NC_("RID_SVXSTR_LEND30", "CF Zero One") +#define RID_SVXSTR_LEND31 NC_("RID_SVXSTR_LEND31", "CF Zero Many") +#define RID_SVXSTR_TRASNGR0 NC_("RID_SVXSTR_TRASNGR0", "Transparency") +#define RID_SVXSTR_COLOR_LIBRE_GREEN_1 NC_("RID_SVXSTR_COLOR_LIBRE_GREEN_1", "Green 1 (%PRODUCTNAME Main Color)") +#define RID_SVXSTR_COLOR_LIBRE_GREEN_ACCENT NC_("RID_SVXSTR_COLOR_LIBRE_GREEN_ACCENT", "Green Accent") +#define RID_SVXSTR_COLOR_LIBRE_BLUE_ACCENT NC_("RID_SVXSTR_COLOR_LIBRE_BLUE_ACCENT", "Blue Accent") +#define RID_SVXSTR_COLOR_LIBRE_ORANGE_ACCENT NC_("RID_SVXSTR_COLOR_LIBRE_ORANGE_ACCENT", "Orange Accent") +#define RID_SVXSTR_COLOR_LIBRE_PURPLE NC_("RID_SVXSTR_COLOR_LIBRE_PURPLE", "Purple") +#define RID_SVXSTR_COLOR_LIBRE_PURPLE_ACCENT NC_("RID_SVXSTR_COLOR_LIBRE_PURPLE_ACCENT", "Purple Accent") +#define RID_SVXSTR_COLOR_LIBRE_YELLOW_ACCENT NC_("RID_SVXSTR_COLOR_LIBRE_YELLOW_ACCENT", "Yellow Accent") + +#define RID_SVXSTR_GALLERYPROPS_GALTHEME NC_("RID_SVXSTR_GALLERYPROPS_GALTHEME", "Gallery Theme") +#define RID_SVXSTR_SUCCESSRECOV NC_("RID_SVXSTR_SUCCESSRECOV", "Successfully recovered") +#define RID_SVXSTR_ORIGDOCRECOV NC_("RID_SVXSTR_ORIGDOCRECOV", "Original document recovered") +#define RID_SVXSTR_RECOVFAILED NC_("RID_SVXSTR_RECOVFAILED", "Recovery failed") +#define RID_SVXSTR_RECOVINPROGR NC_("RID_SVXSTR_RECOVINPROGR", "Recovery in progress") +#define RID_SVXSTR_NOTRECOVYET NC_("RID_SVXSTR_NOTRECOVYET", "Not recovered yet") +#define RID_SVXSTR_RECOVERY_INPROGRESS NC_("RID_SVXSTR_RECOVERY_INPROGRESS", "%PRODUCTNAME %PRODUCTVERSION has begun recovering your documents. Depending on the size of the documents this process can take some time.") +#define RID_SVXSTR_RECOVERYONLY_FINISH_DESCR NC_("RID_SVXSTR_RECOVERYONLY_FINISH_DESCR", "Recovery of your documents was finished. Click 'Finish' to see your documents.") +#define RID_SVXSTR_RECOVERYONLY_FINISH NC_("RID_SVXSTR_RECOVERYONLY_FINISH", "~Finish") +#define RID_SVXSTR_WIDTH_LAST_CUSTOM NC_("RID_SVXSTR_WIDTH_LAST_CUSTOM", "Last Custom Value") +#define RID_SVXSTR_PT NC_("RID_SVXSTR_PT", "pt") + +#define RID_SVXSTR_EXPORT_GRAPHIC_TITLE NC_("RID_SVXSTR_EXPORT_GRAPHIC_TITLE", "Image Export") +#define RID_SVXSTR_SAVEAS_IMAGE NC_("RID_SVXSTR_SAVEAS_IMAGE", "Save as Image") + +// Strings for the Draw Dialog -------------------------------------------- +#define RID_SVX_3D_UNDO_EXCHANGE_PASTE NC_("RID_SVX_3D_UNDO_EXCHANGE_PASTE", "Insert object(s)") +#define RID_SVX_3D_UNDO_ROTATE NC_("RID_SVX_3D_UNDO_ROTATE", "Rotate 3D object") +#define RID_SVX_3D_UNDO_EXTRUDE NC_("RID_SVX_3D_UNDO_EXTRUDE", "Create extrusion object") +#define RID_SVX_3D_UNDO_LATHE NC_("RID_SVX_3D_UNDO_LATHE", "Create rotation object") +#define RID_SVX_3D_UNDO_BREAK_LATHE NC_("RID_SVX_3D_UNDO_BREAK_LATHE", "Split 3D object") + +// Language-Strings ------------------------------------------------------ +#define RID_SVXSTR_LANGUAGE_ALL NC_("RID_SVXSTR_LANGUAGE_ALL", "[All]") + +#define RID_SVXSTR_GALLERY_FILTER NC_("RID_SVXSTR_GALLERY_FILTER", "Graphics filter") +#define RID_SVXSTR_GALLERY_NEWTHEME NC_("RID_SVXSTR_GALLERY_NEWTHEME", "New Theme") + +#define RID_GALLERYSTR_THEME_3D NC_("RID_GALLERYSTR_THEME_3D", "3D Effects") +#define RID_GALLERYSTR_THEME_ANIMATIONS NC_("RID_GALLERYSTR_THEME_ANIMATIONS", "Animations") +#define RID_GALLERYSTR_THEME_BULLETS NC_("RID_GALLERYSTR_THEME_BULLETS", "Bullets") +#define RID_GALLERYSTR_THEME_OFFICE NC_("RID_GALLERYSTR_THEME_OFFICE", "Office") +#define RID_GALLERYSTR_THEME_FLAGS NC_("RID_GALLERYSTR_THEME_FLAGS", "Flags") +#define RID_GALLERYSTR_THEME_FLOWCHARTS NC_("RID_GALLERYSTR_THEME_FLOWCHARTS", "Flow Charts") +#define RID_GALLERYSTR_THEME_EMOTICONS NC_("RID_GALLERYSTR_THEME_EMOTICONS", "Emoticons") +#define RID_GALLERYSTR_THEME_PHOTOS NC_("RID_GALLERYSTR_THEME_PHOTOS", "Images") +#define RID_GALLERYSTR_THEME_BACKGROUNDS NC_("RID_GALLERYSTR_THEME_BACKGROUNDS", "Backgrounds") +#define RID_GALLERYSTR_THEME_HOMEPAGE NC_("RID_GALLERYSTR_THEME_HOMEPAGE", "Homepage") +#define RID_GALLERYSTR_THEME_INTERACTION NC_("RID_GALLERYSTR_THEME_INTERACTION", "Interaction") +#define RID_GALLERYSTR_THEME_MAPS NC_("RID_GALLERYSTR_THEME_MAPS", "Maps") +#define RID_GALLERYSTR_THEME_PEOPLE NC_("RID_GALLERYSTR_THEME_PEOPLE", "People") +#define RID_GALLERYSTR_THEME_SURFACES NC_("RID_GALLERYSTR_THEME_SURFACES", "Surfaces") +#define RID_GALLERYSTR_THEME_COMPUTERS NC_("RID_GALLERYSTR_THEME_COMPUTERS", "Computers") +#define RID_GALLERYSTR_THEME_DIAGRAMS NC_("RID_GALLERYSTR_THEME_DIAGRAMS", "Diagrams") +#define RID_GALLERYSTR_THEME_ENVIRONMENT NC_("RID_GALLERYSTR_THEME_ENVIRONMENT", "Environment") +#define RID_GALLERYSTR_THEME_FINANCE NC_("RID_GALLERYSTR_THEME_FINANCE", "Finance") +#define RID_GALLERYSTR_THEME_TRANSPORT NC_("RID_GALLERYSTR_THEME_TRANSPORT", "Transport") +#define RID_GALLERYSTR_THEME_TXTSHAPES NC_("RID_GALLERYSTR_THEME_TXTSHAPES", "Textshapes") +#define RID_GALLERYSTR_THEME_SOUNDS NC_("RID_GALLERYSTR_THEME_SOUNDS", "Sounds") +#define RID_GALLERYSTR_THEME_SYMBOLS NC_("RID_GALLERYSTR_THEME_SYMBOLS", "Symbols") +#define RID_GALLERYSTR_THEME_MYTHEME NC_("RID_GALLERYSTR_THEME_MYTHEME", "My Theme") +#define RID_GALLERYSTR_THEME_ARROWS NC_("RID_GALLERYSTR_THEME_ARROWS", "Arrows") +#define RID_GALLERYSTR_THEME_BALLOONS NC_("RID_GALLERYSTR_THEME_BALLOONS", "Balloons") +#define RID_GALLERYSTR_THEME_KEYBOARD NC_("RID_GALLERYSTR_THEME_KEYBOARD", "Keyboard") +#define RID_GALLERYSTR_THEME_TIME NC_("RID_GALLERYSTR_THEME_TIME", "Time") +#define RID_GALLERYSTR_THEME_PRESENTATION NC_("RID_GALLERYSTR_THEME_PRESENTATION", "Presentation") +#define RID_GALLERYSTR_THEME_CALENDAR NC_("RID_GALLERYSTR_THEME_CALENDAR", "Calendar") +#define RID_GALLERYSTR_THEME_NAVIGATION NC_("RID_GALLERYSTR_THEME_NAVIGATION", "Navigation") +#define RID_GALLERYSTR_THEME_COMMUNICATION NC_("RID_GALLERYSTR_THEME_COMMUNICATION", "Communication") +#define RID_GALLERYSTR_THEME_FINANCES NC_("RID_GALLERYSTR_THEME_FINANCES", "Finances") +#define RID_GALLERYSTR_THEME_COMPUTER NC_("RID_GALLERYSTR_THEME_COMPUTER", "Computers") +#define RID_GALLERYSTR_THEME_CLIMA NC_("RID_GALLERYSTR_THEME_CLIMA", "Climate") +#define RID_GALLERYSTR_THEME_EDUCATION NC_("RID_GALLERYSTR_THEME_EDUCATION", "School & University") +#define RID_GALLERYSTR_THEME_TROUBLE NC_("RID_GALLERYSTR_THEME_TROUBLE", "Problem Solving") +#define RID_GALLERYSTR_THEME_SCREENBEANS NC_("RID_GALLERYSTR_THEME_SCREENBEANS", "Screen Beans") + +#define RID_SVXSTR_QRY_PRINT_TITLE NC_("RID_SVXSTR_QRY_PRINT_TITLE", "Printing selection") +#define RID_SVXSTR_QRY_PRINT_MSG NC_("RID_SVXSTR_QRY_PRINT_MSG", "Do you want to print the selection or the entire document?") +#define RID_SVXSTR_QRY_PRINT_ALL NC_("RID_SVXSTR_QRY_PRINT_ALL", "~All") +#define RID_SVXSTR_QRY_PRINT_SELECTION NC_("RID_SVXSTR_QRY_PRINT_SELECTION", "~Selection") + +#define RID_SVXSTR_DIRECTION_NW NC_("RID_SVXSTR_DIRECTION_NW", "Extrusion North-West") +#define RID_SVXSTR_DIRECTION_N NC_("RID_SVXSTR_DIRECTION_N", "Extrusion North") +#define RID_SVXSTR_DIRECTION_NE NC_("RID_SVXSTR_DIRECTION_NE", "Extrusion North-East") +#define RID_SVXSTR_DIRECTION_W NC_("RID_SVXSTR_DIRECTION_W", "Extrusion West") +#define RID_SVXSTR_DIRECTION_NONE NC_("RID_SVXSTR_DIRECTION_NONE", "Extrusion Backwards") +#define RID_SVXSTR_DIRECTION_E NC_("RID_SVXSTR_DIRECTION_E", "Extrusion East") +#define RID_SVXSTR_DIRECTION_SW NC_("RID_SVXSTR_DIRECTION_SW", "Extrusion South-West") +#define RID_SVXSTR_DIRECTION_S NC_("RID_SVXSTR_DIRECTION_S", "Extrusion South") +#define RID_SVXSTR_DIRECTION_SE NC_("RID_SVXSTR_DIRECTION_SE", "Extrusion South-East") +#define RID_SVXSTR_DEPTH_0 NC_("RID_SVXSTR_DEPTH_0", "~0 cm") +#define RID_SVXSTR_DEPTH_1 NC_("RID_SVXSTR_DEPTH_1", "~1 cm") +#define RID_SVXSTR_DEPTH_2 NC_("RID_SVXSTR_DEPTH_2", "~2.5 cm") +#define RID_SVXSTR_DEPTH_3 NC_("RID_SVXSTR_DEPTH_3", "~5 cm") +#define RID_SVXSTR_DEPTH_4 NC_("RID_SVXSTR_DEPTH_4", "10 ~cm") +#define RID_SVXSTR_DEPTH_0_INCH NC_("RID_SVXSTR_DEPTH_0_INCH", "0 inch") +#define RID_SVXSTR_DEPTH_1_INCH NC_("RID_SVXSTR_DEPTH_1_INCH", "0.~5 inch") +#define RID_SVXSTR_DEPTH_2_INCH NC_("RID_SVXSTR_DEPTH_2_INCH", "~1 inch") +#define RID_SVXSTR_DEPTH_3_INCH NC_("RID_SVXSTR_DEPTH_3_INCH", "~2 inch") +#define RID_SVXSTR_DEPTH_4_INCH NC_("RID_SVXSTR_DEPTH_4_INCH", "~4 inch") + +#define RID_SVXSTR_NOFILL NC_("RID_SVXSTR_NOFILL", "No Fill") +#define RID_SVXSTR_TRANSPARENT NC_("RID_SVXSTR_TRANSPARENT", "Transparent") +#define RID_SVXSTR_DEFAULT NC_("RID_SVXSTR_DEFAULT", "Default") +#define RID_SVXSTR_FRAME NC_("RID_SVXSTR_FRAME", "Borders") +#define RID_SVXSTR_FRAME_STYLE NC_("RID_SVXSTR_FRAME_STYLE", "Border Style") +#define RID_SVXSTR_MORENUMBERING NC_("RID_SVXSTR_MORENUMBERING", "More Numbering...") +#define RID_SVXSTR_MOREBULLETS NC_("RID_SVXSTR_MOREBULLETS", "More Bullets...") +#define RID_SVXSTR_BY_AUTHOR NC_("RID_SVXSTR_BY_AUTHOR", "By author") +#define RID_SVXSTR_PAGES NC_("RID_SVXSTR_PAGES", "Pages") +#define RID_SVXSTR_CLEARFORM NC_("RID_SVXSTR_CLEARFORM", "Clear formatting") +#define RID_SVXSTR_MORE_STYLES NC_("RID_SVXSTR_MORE_STYLES", "More Styles...") +#define RID_SVXSTR_MORE NC_("RID_SVXSTR_MORE", "More Options...") +// This is duplicated in GenericCommands.xcu in officecfg. +#define RID_SVXSTR_CHARFONTNAME NC_("RID_SVXSTR_CHARFONTNAME", "Font Name") +#define RID_SVXSTR_CHARFONTNAME_NOTAVAILABLE NC_("RID_SVXSTR_CHARFONTNAME_NOTAVAILABLE", "Font Name. The current font is not available and will be substituted.") +#define RID_SVXSTR_CUSTOM_PAL NC_("RID_SVXSTR_CUSTOM_PAL", "custom") +#define RID_SVXSTR_DOC_COLORS NC_("RID_SVXSTR_DOC_COLORS", "Document colors") +#define RID_SVXSTR_DOC_COLOR_PREFIX NC_("RID_SVXSTR_DOC_COLOR_PREFIX", "Document Color") + +#define RID_SVX_EXTRUSION_BAR NC_("RID_SVX_EXTRUSION_BAR", "Extrusion") +#define RID_SVXSTR_UNDO_APPLY_EXTRUSION_ON_OFF NC_("RID_SVXSTR_UNDO_APPLY_EXTRUSION_ON_OFF", "Apply Extrusion On/Off") +#define RID_SVXSTR_UNDO_APPLY_EXTRUSION_ROTATE_DOWN NC_("RID_SVXSTR_UNDO_APPLY_EXTRUSION_ROTATE_DOWN", "Tilt Down") +#define RID_SVXSTR_UNDO_APPLY_EXTRUSION_ROTATE_UP NC_("RID_SVXSTR_UNDO_APPLY_EXTRUSION_ROTATE_UP", "Tilt Up") +#define RID_SVXSTR_UNDO_APPLY_EXTRUSION_ROTATE_LEFT NC_("RID_SVXSTR_UNDO_APPLY_EXTRUSION_ROTATE_LEFT", "Tilt Left") +#define RID_SVXSTR_UNDO_APPLY_EXTRUSION_ROTATE_RIGHT NC_("RID_SVXSTR_UNDO_APPLY_EXTRUSION_ROTATE_RIGHT", "Tilt Right") +#define RID_SVXSTR_UNDO_APPLY_EXTRUSION_DEPTH NC_("RID_SVXSTR_UNDO_APPLY_EXTRUSION_DEPTH", "Change Extrusion Depth") +#define RID_SVXSTR_UNDO_APPLY_EXTRUSION_ORIENTATION NC_("RID_SVXSTR_UNDO_APPLY_EXTRUSION_ORIENTATION", "Change Orientation") +#define RID_SVXSTR_UNDO_APPLY_EXTRUSION_PROJECTION NC_("RID_SVXSTR_UNDO_APPLY_EXTRUSION_PROJECTION", "Change Projection Type") +#define RID_SVXSTR_UNDO_APPLY_EXTRUSION_LIGHTING NC_("RID_SVXSTR_UNDO_APPLY_EXTRUSION_LIGHTING", "Change Lighting") +#define RID_SVXSTR_UNDO_APPLY_EXTRUSION_BRIGHTNESS NC_("RID_SVXSTR_UNDO_APPLY_EXTRUSION_BRIGHTNESS", "Change Brightness") +#define RID_SVXSTR_UNDO_APPLY_EXTRUSION_SURFACE NC_("RID_SVXSTR_UNDO_APPLY_EXTRUSION_SURFACE", "Change Extrusion Surface") +#define RID_SVXSTR_UNDO_APPLY_EXTRUSION_COLOR NC_("RID_SVXSTR_UNDO_APPLY_EXTRUSION_COLOR", "Change Extrusion Color") + +#define RID_SVXFLOAT3D_FAVORITE NC_("RID_SVXFLOAT3D_FAVORITE", "Favorite") +#define RID_SVXFLOAT3D_FIX_R NC_("RID_SVXFLOAT3D_FIX_R", "R:") +#define RID_SVXFLOAT3D_FIX_G NC_("RID_SVXFLOAT3D_FIX_G", "G:") +#define RID_SVXFLOAT3D_FIX_B NC_("RID_SVXFLOAT3D_FIX_B", "B:") + +#define RID_SVX_FONTWORK_BAR NC_("RID_SVX_FONTWORK_BAR", "Fontwork") +#define RID_SVXSTR_UNDO_APPLY_FONTWORK_SHAPE NC_("RID_SVXSTR_UNDO_APPLY_FONTWORK_SHAPE", "Apply Fontwork Shape") +#define RID_SVXSTR_UNDO_APPLY_FONTWORK_SAME_LETTER_HEIGHT NC_("RID_SVXSTR_UNDO_APPLY_FONTWORK_SAME_LETTER_HEIGHT", "Apply Fontwork Same Letter Heights") +#define RID_SVXSTR_UNDO_APPLY_FONTWORK_ALIGNMENT NC_("RID_SVXSTR_UNDO_APPLY_FONTWORK_ALIGNMENT", "Apply Fontwork Alignment") +#define RID_SVXSTR_UNDO_APPLY_FONTWORK_CHARACTER_SPACING NC_("RID_SVXSTR_UNDO_APPLY_FONTWORK_CHARACTER_SPACING", "Apply Fontwork Character Spacing") + +#define RID_SVXSTR_A11Y_WITH NC_("RID_SVXSTR_A11Y_WITH", "with") +#define RID_SVXSTR_A11Y_STYLE NC_("RID_SVXSTR_A11Y_STYLE", "Style") +#define RID_SVXSTR_A11Y_AND NC_("RID_SVXSTR_A11Y_AND", "and") +// SvxRectCtl +#define RID_SVXSTR_RECTCTL_ACC_CORN_NAME NC_("RID_SVXSTR_RECTCTL_ACC_CORN_NAME", "Corner control") +#define RID_SVXSTR_RECTCTL_ACC_CORN_DESCR NC_("RID_SVXSTR_RECTCTL_ACC_CORN_DESCR", "Selection of a corner point.") +#define RID_SVXSTR_RECTCTL_ACC_CHLD_LT NC_("RID_SVXSTR_RECTCTL_ACC_CHLD_LT", "Top left") +#define RID_SVXSTR_RECTCTL_ACC_CHLD_MT NC_("RID_SVXSTR_RECTCTL_ACC_CHLD_MT", "Top middle") +#define RID_SVXSTR_RECTCTL_ACC_CHLD_RT NC_("RID_SVXSTR_RECTCTL_ACC_CHLD_RT", "Top right") +#define RID_SVXSTR_RECTCTL_ACC_CHLD_LM NC_("RID_SVXSTR_RECTCTL_ACC_CHLD_LM", "Left center") +#define RID_SVXSTR_RECTCTL_ACC_CHLD_MM NC_("RID_SVXSTR_RECTCTL_ACC_CHLD_MM", "Center") +#define RID_SVXSTR_RECTCTL_ACC_CHLD_RM NC_("RID_SVXSTR_RECTCTL_ACC_CHLD_RM", "Right center") +#define RID_SVXSTR_RECTCTL_ACC_CHLD_LB NC_("RID_SVXSTR_RECTCTL_ACC_CHLD_LB", "Bottom left") +#define RID_SVXSTR_RECTCTL_ACC_CHLD_MB NC_("RID_SVXSTR_RECTCTL_ACC_CHLD_MB", "Bottom middle") +#define RID_SVXSTR_RECTCTL_ACC_CHLD_RB NC_("RID_SVXSTR_RECTCTL_ACC_CHLD_RB", "Bottom right") +// SvxGraphCtrlAccessibleContext +#define RID_SVXSTR_GRAPHCTRL_ACC_NAME NC_("RID_SVXSTR_GRAPHCTRL_ACC_NAME", "Contour control") +#define RID_SVXSTR_GRAPHCTRL_ACC_DESCRIPTION NC_("RID_SVXSTR_GRAPHCTRL_ACC_DESCRIPTION", "This is where you can edit the contour.") +#define RID_SVXSTR_CHARACTER_SELECTION NC_("RID_SVXSTR_CHARACTER_SELECTION", "Special character selection") +#define RID_SVXSTR_CHAR_SEL_DESC NC_("RID_SVXSTR_CHAR_SEL_DESC", "Select special characters in this area.") +// The space behind is a must. +#define RID_SVXSTR_CHARACTER_CODE NC_("RID_SVXSTR_CHARACTER_CODE", "Character code ") + +#define RID_ERR_FIELDREQUIRED NC_("RID_ERR_FIELDREQUIRED", "Input required in field '#'. Please enter a value.") +#define RID_STR_FORMS NC_("RID_STR_FORMS", "Forms") +#define RID_STR_NO_PROPERTIES NC_("RID_STR_NO_PROPERTIES", "No control selected") +#define RID_STR_PROPERTIES_CONTROL NC_("RID_STR_PROPERTIES_CONTROL", "Properties: ") +#define RID_STR_PROPERTIES_FORM NC_("RID_STR_PROPERTIES_FORM", "Form Properties") +#define RID_STR_FMEXPLORER NC_("RID_STR_FMEXPLORER", "Form Navigator") +#define RID_STR_FORM NC_("RID_STR_FORM", "Form") +#define RID_STR_STDFORMNAME NC_("RID_STR_STDFORMNAME", "Form") +#define RID_STR_PROPTITLE_HIDDEN NC_("RID_STR_PROPTITLE_HIDDEN", "Hidden Control") +#define RID_STR_CONTROL NC_("RID_STR_CONTROL", "Control") +#define RID_STR_REC_TEXT NC_("RID_STR_REC_TEXT", "Record") +#define RID_STR_REC_FROM_TEXT NC_("RID_STR_REC_FROM_TEXT", "of") +#define RID_STR_FIELDSELECTION NC_("RID_STR_FIELDSELECTION", "Add field:") +#define RID_STR_WRITEERROR NC_("RID_STR_WRITEERROR", "Error writing data to database") +#define RID_STR_SYNTAXERROR NC_("RID_STR_SYNTAXERROR", "Syntax error in query expression") +#define RID_STR_DELETECONFIRM_RECORD NC_("RID_STR_DELETECONFIRM_RECORD", "You intend to delete 1 record.") +#define RID_STR_DELETECONFIRM_RECORDS NC_("RID_STR_DELETECONFIRM_RECORDS", "# records will be deleted.") +#define RID_STR_DELETECONFIRM NC_("RID_STR_DELETECONFIRM", "If you click Yes, you won't be able to undo this operation.\nDo you want to continue anyway?") +#define RID_STR_NAVIGATIONBAR NC_("RID_STR_NAVIGATIONBAR", "Navigation bar") +#define RID_STR_COLUMN NC_("RID_STR_COLUMN", "Col") +#define RID_STR_UNDO_PROPERTY NC_("RID_STR_UNDO_PROPERTY", "Set property '#'") +#define RID_STR_UNDO_CONTAINER_INSERT NC_("RID_STR_UNDO_CONTAINER_INSERT", "Insert in container") +#define RID_STR_UNDO_CONTAINER_REMOVE NC_("RID_STR_UNDO_CONTAINER_REMOVE", "Delete #") +#define RID_STR_UNDO_CONTAINER_REMOVE_MULTIPLE NC_("RID_STR_UNDO_CONTAINER_REMOVE_MULTIPLE", "Delete # objects") +#define RID_STR_UNDO_CONTAINER_REPLACE NC_("RID_STR_UNDO_CONTAINER_REPLACE", "Replace a container element") +#define RID_STR_UNDO_MODEL_REPLACE NC_("RID_STR_UNDO_MODEL_REPLACE", "Replace Control") +#define RID_STR_PROPTITLE_PUSHBUTTON NC_("RID_STR_PROPTITLE_PUSHBUTTON", "Push Button") +#define RID_STR_PROPTITLE_RADIOBUTTON NC_("RID_STR_PROPTITLE_RADIOBUTTON", "Option Button") +#define RID_STR_PROPTITLE_CHECKBOX NC_("RID_STR_PROPTITLE_CHECKBOX", "Check Box") +#define RID_STR_PROPTITLE_FIXEDTEXT NC_("RID_STR_PROPTITLE_FIXEDTEXT", "Label Field") +#define RID_STR_PROPTITLE_GROUPBOX NC_("RID_STR_PROPTITLE_GROUPBOX", "Group Box") +#define RID_STR_PROPTITLE_EDIT NC_("RID_STR_PROPTITLE_EDIT", "Text Box") +#define RID_STR_PROPTITLE_FORMATTED NC_("RID_STR_PROPTITLE_FORMATTED", "Formatted Field") +#define RID_STR_PROPTITLE_LISTBOX NC_("RID_STR_PROPTITLE_LISTBOX", "List Box") +#define RID_STR_PROPTITLE_COMBOBOX NC_("RID_STR_PROPTITLE_COMBOBOX", "Combo Box") +#define RID_STR_PROPTITLE_IMAGEBUTTON NC_("RID_STR_PROPTITLE_IMAGEBUTTON", "Image Button") +#define RID_STR_PROPTITLE_IMAGECONTROL NC_("RID_STR_PROPTITLE_IMAGECONTROL", "Image Control") +#define RID_STR_PROPTITLE_FILECONTROL NC_("RID_STR_PROPTITLE_FILECONTROL", "File Selection") +#define RID_STR_PROPTITLE_DATEFIELD NC_("RID_STR_PROPTITLE_DATEFIELD", "Date Field") +#define RID_STR_PROPTITLE_TIMEFIELD NC_("RID_STR_PROPTITLE_TIMEFIELD", "Time Field") +#define RID_STR_PROPTITLE_NUMERICFIELD NC_("RID_STR_PROPTITLE_NUMERICFIELD", "Numeric Field") +#define RID_STR_PROPTITLE_CURRENCYFIELD NC_("RID_STR_PROPTITLE_CURRENCYFIELD", "Currency Field") +#define RID_STR_PROPTITLE_PATTERNFIELD NC_("RID_STR_PROPTITLE_PATTERNFIELD", "Pattern Field") +#define RID_STR_PROPTITLE_DBGRID NC_("RID_STR_PROPTITLE_DBGRID", "Table Control ") +#define RID_STR_PROPTITLE_SCROLLBAR NC_("RID_STR_PROPTITLE_SCROLLBAR", "Scrollbar") +#define RID_STR_PROPTITLE_SPINBUTTON NC_("RID_STR_PROPTITLE_SPINBUTTON", "Spin Button") +#define RID_STR_PROPTITLE_NAVBAR NC_("RID_STR_PROPTITLE_NAVBAR", "Navigation Bar") +#define RID_STR_PROPTITLE_MULTISELECT NC_("RID_STR_PROPTITLE_MULTISELECT", "Multiselection") +#define RID_STR_NODATACONTROLS NC_("RID_STR_NODATACONTROLS", "No data-related controls in the current form!") +#define RID_STR_POSTFIX_DATE NC_("RID_STR_POSTFIX_DATE", " (Date)") +#define RID_STR_POSTFIX_TIME NC_("RID_STR_POSTFIX_TIME", " (Time)") +#define RID_STR_FILTER_NAVIGATOR NC_("RID_STR_FILTER_NAVIGATOR", "Filter navigator") +#define RID_STR_FILTER_FILTER_FOR NC_("RID_STR_FILTER_FILTER_FOR", "Filter for") +#define RID_STR_FILTER_FILTER_OR NC_("RID_STR_FILTER_FILTER_OR", "Or") +#define RID_STR_NOCONTROLS_FOR_EXTERNALDISPLAY NC_("RID_STR_NOCONTROLS_FOR_EXTERNALDISPLAY", "Valid bound controls which can be used in the table view do not exist in the current form.") +#define RID_STR_AUTOFIELD NC_("RID_STR_AUTOFIELD", "") +#define RID_STR_SVT_SQL_SYNTAX_ERROR NC_("RID_STR_SVT_SQL_SYNTAX_ERROR", "Syntax error in SQL statement") +#define RID_STR_SVT_SQL_SYNTAX_VALUE_NO_LIKE NC_("RID_STR_SVT_SQL_SYNTAX_VALUE_NO_LIKE", "The value #1 cannot be used with LIKE.") +#define RID_STR_SVT_SQL_SYNTAX_FIELD_NO_LIKE NC_("RID_STR_SVT_SQL_SYNTAX_FIELD_NO_LIKE", "LIKE cannot be used with this field.") +#define RID_STR_SVT_SQL_SYNTAX_ACCESS_DAT_NO_VALID NC_("RID_STR_SVT_SQL_SYNTAX_ACCESS_DAT_NO_VALID", "The value entered is not a valid date. Please enter a date in a valid format, for example, MM/DD/YY.") +#define RID_STR_SVT_SQL_SYNTAX_INT_NO_VALID NC_("RID_STR_SVT_SQL_SYNTAX_INT_NO_VALID", "The field cannot be compared with an integer.") +#define RID_STR_SVT_SQL_SYNTAX_TABLE NC_("RID_STR_SVT_SQL_SYNTAX_TABLE", "The database does not contain a table named \"#\".") +#define RID_STR_SVT_SQL_SYNTAX_TABLE_OR_QUERY NC_("RID_STR_SVT_SQL_SYNTAX_TABLE_OR_QUERY", "The database does contain neither a table nor a query named \"#\".") +#define RID_STR_SVT_SQL_SYNTAX_TABLE_EXISTS NC_("RID_STR_SVT_SQL_SYNTAX_TABLE_EXISTS", "The database already contains a table or view with name \"#\".") +#define RID_STR_SVT_SQL_SYNTAX_QUERY_EXISTS NC_("RID_STR_SVT_SQL_SYNTAX_QUERY_EXISTS", "The database already contains a query with name \"#\".") +#define RID_STR_SVT_SQL_SYNTAX_COLUMN NC_("RID_STR_SVT_SQL_SYNTAX_COLUMN", "The column \"#1\" is unknown in the table \"#2\".") +#define RID_STR_SVT_SQL_SYNTAX_REAL_NO_VALID NC_("RID_STR_SVT_SQL_SYNTAX_REAL_NO_VALID", "The field cannot be compared with a floating point number.") +#define RID_STR_SVT_SQL_SYNTAX_CRIT_NO_COMPARE NC_("RID_STR_SVT_SQL_SYNTAX_CRIT_NO_COMPARE", "The entered criterion cannot be compared with this field.") +#define RID_STR_DATANAVIGATOR NC_("RID_STR_DATANAVIGATOR", "Data Navigator") +#define RID_STR_READONLY_VIEW NC_("RID_STR_READONLY_VIEW", " (read-only)") +#define RID_STR_ALREADYEXISTOVERWRITE NC_("RID_STR_ALREADYEXISTOVERWRITE", "The file already exists. Overwrite?") +#define RID_STR_OBJECT_LABEL NC_("RID_STR_OBJECT_LABEL", "#object# label") + +#define RID_STR_QRY_REMOVE_MODEL NC_("RID_STR_QRY_REMOVE_MODEL", "Deleting the model '$MODELNAME' affects all controls currently bound to this model.\nDo you really want to delete this model?") +#define RID_STR_QRY_REMOVE_INSTANCE NC_("RID_STR_QRY_REMOVE_INSTANCE", "Deleting the instance '$INSTANCENAME' affects all controls currently bound to this instance.\nDo you really want to delete this instance?") +#define RID_STR_QRY_REMOVE_ELEMENT NC_("RID_STR_QRY_REMOVE_ELEMENT", "Deleting the element '$ELEMENTNAME' affects all controls currently bound to this element.\nDo you really want to delete this element?") +#define RID_STR_QRY_REMOVE_ATTRIBUTE NC_("RID_STR_QRY_REMOVE_ATTRIBUTE", "Do you really want to delete the attribute '$ATTRIBUTENAME'?") +#define RID_STR_QRY_REMOVE_SUBMISSION NC_("RID_STR_QRY_REMOVE_SUBMISSION", "Deleting the submission '$SUBMISSIONNAME' affects all controls currently bound to this submission.\n\nDo you really want to delete this submission?") +#define RID_STR_QRY_REMOVE_BINDING NC_("RID_STR_QRY_REMOVE_BINDING", "Deleting the binding '$BINDINGNAME' affects all controls currently bound to this binding.\n\nDo you really want to delete this binding?") +#define RID_STR_INVALID_XMLNAME NC_("RID_STR_INVALID_XMLNAME", "The name '%1' is not valid in XML. Please enter a different name.") +#define RID_STR_INVALID_XMLPREFIX NC_("RID_STR_INVALID_XMLPREFIX", "The prefix '%1' is not valid in XML. Please enter a different prefix.") +#define RID_STR_DOUBLE_MODELNAME NC_("RID_STR_DOUBLE_MODELNAME", "The name '%1' already exists. Please enter a new name.") +#define RID_STR_EMPTY_SUBMISSIONNAME NC_("RID_STR_EMPTY_SUBMISSIONNAME", "The submission must have a name.") +#define RID_STR_METHOD_POST NC_("RID_STR_METHOD_POST", "Post") +#define RID_STR_METHOD_PUT NC_("RID_STR_METHOD_PUT", "Put") +#define RID_STR_METHOD_GET NC_("RID_STR_METHOD_GET", "Get") +#define RID_STR_REPLACE_NONE NC_("RID_STR_REPLACE_NONE", "None") +#define RID_STR_REPLACE_INST NC_("RID_STR_REPLACE_INST", "Instance") +#define RID_STR_REPLACE_DOC NC_("RID_STR_REPLACE_DOC", "Document") +#define RID_STR_DATANAV_SUBM_BIND NC_("RID_STR_DATANAV_SUBM_BIND", "Binding: ") +#define RID_STR_DATANAV_SUBM_REF NC_("RID_STR_DATANAV_SUBM_REF", "Reference: ") +#define RID_STR_DATANAV_SUBM_ACTION NC_("RID_STR_DATANAV_SUBM_ACTION", "Action: ") +#define RID_STR_DATANAV_SUBM_METHOD NC_("RID_STR_DATANAV_SUBM_METHOD", "Method: ") +#define RID_STR_DATANAV_SUBM_REPLACE NC_("RID_STR_DATANAV_SUBM_REPLACE", "Replace: ") +#define RID_STR_DATANAV_ADD_ELEMENT NC_("RID_STR_DATANAV_ADD_ELEMENT", "Add Element") +#define RID_STR_DATANAV_EDIT_ELEMENT NC_("RID_STR_DATANAV_EDIT_ELEMENT", "Edit Element") +#define RID_STR_DATANAV_REMOVE_ELEMENT NC_("RID_STR_DATANAV_REMOVE_ELEMENT", "Delete Element") +#define RID_STR_DATANAV_ADD_ATTRIBUTE NC_("RID_STR_DATANAV_ADD_ATTRIBUTE", "Add Attribute") +#define RID_STR_DATANAV_EDIT_ATTRIBUTE NC_("RID_STR_DATANAV_EDIT_ATTRIBUTE", "Edit Attribute") +#define RID_STR_DATANAV_REMOVE_ATTRIBUTE NC_("RID_STR_DATANAV_REMOVE_ATTRIBUTE", "Delete Attribute") +#define RID_STR_DATANAV_ADD_BINDING NC_("RID_STR_DATANAV_ADD_BINDING", "Add Binding") +#define RID_STR_DATANAV_EDIT_BINDING NC_("RID_STR_DATANAV_EDIT_BINDING", "Edit Binding") +#define RID_STR_DATANAV_REMOVE_BINDING NC_("RID_STR_DATANAV_REMOVE_BINDING", "Delete Binding") +#define RID_STR_DATANAV_ADD_SUBMISSION NC_("RID_STR_DATANAV_ADD_SUBMISSION", "Add Submission") +#define RID_STR_DATANAV_EDIT_SUBMISSION NC_("RID_STR_DATANAV_EDIT_SUBMISSION", "Edit Submission") +#define RID_STR_DATANAV_REMOVE_SUBMISSION NC_("RID_STR_DATANAV_REMOVE_SUBMISSION", "Delete Submission") +#define RID_STR_ELEMENT NC_("RID_STR_ELEMENT", "Element") +#define RID_STR_ATTRIBUTE NC_("RID_STR_ATTRIBUTE", "Attribute") +#define RID_STR_BINDING NC_("RID_STR_BINDING", "Binding") +#define RID_STR_BINDING_EXPR NC_("RID_STR_BINDING_EXPR", "Binding expression") + +#define RID_SVXSTR_QUERY_EXIT_RECOVERY NC_("RID_SVXSTR_QUERY_EXIT_RECOVERY", "Are you sure you want to discard the %PRODUCTNAME document recovery data?") + +#define RID_SVXSTR_RULER_TAB_LEFT NC_("RID_SVXSTR_RULER_TAB_LEFT", "Left") +#define RID_SVXSTR_RULER_TAB_RIGHT NC_("RID_SVXSTR_RULER_TAB_RIGHT", "Right") +#define RID_SVXSTR_RULER_TAB_CENTER NC_("RID_SVXSTR_RULER_TAB_CENTER", "Center") +#define RID_SVXSTR_RULER_TAB_DECIMAL NC_("RID_SVXSTR_RULER_TAB_DECIMAL", "Decimal") + +#define RID_SVXSTR_INSERT_HELPTEXT NC_("RID_SVXSTR_INSERT_HELPTEXT", "Insert mode. Click to change to overwrite mode.") +#define RID_SVXSTR_OVERWRITE_HELPTEXT NC_("RID_SVXSTR_OVERWRITE_HELPTEXT", "Overwrite mode. Click to change to insert mode.") +// To be shown in the status bar when in overwrite mode, please try to make it not longer than the word 'Overwrite'. +#define RID_SVXSTR_OVERWRITE_TEXT NC_("RID_SVXSTR_OVERWRITE_TEXT", "Overwrite") +#define RID_SVXSTR_INSERT_TEXT NC_("RID_SVXSTR_INSERT_TEXT", "Insert") +#define RID_SVXSTR_XMLSEC_SIG_OK NC_("RID_SVXSTR_XMLSEC_SIG_OK", "Digital Signature: The document signature is OK.") +#define RID_SVXSTR_XMLSEC_SIG_OK_NO_VERIFY NC_("RID_SVXSTR_XMLSEC_SIG_OK_NO_VERIFY", "Digital Signature: The document signature is OK, but the certificates could not be validated.") +#define RID_SVXSTR_XMLSEC_SIG_NOT_OK NC_("RID_SVXSTR_XMLSEC_SIG_NOT_OK", "Digital Signature: The document signature does not match the document content. We strongly recommend you not to trust this document.") +#define RID_SVXSTR_XMLSEC_NO_SIG NC_("RID_SVXSTR_XMLSEC_NO_SIG", "Digital Signature: The document is not signed.") +#define RID_SVXSTR_XMLSEC_SIG_CERT_OK_PARTIAL_SIG NC_("RID_SVXSTR_XMLSEC_SIG_CERT_OK_PARTIAL_SIG", "Digital Signature: The document signature and the certificate are OK, but not all parts of the document are signed.") +#define RID_SVXSTR_DOC_MODIFIED_YES NC_("RID_SVXSTR_DOC_MODIFIED_YES", "The document has been modified. Click to save the document.") +#define RID_SVXSTR_DOC_MODIFIED_NO NC_("RID_SVXSTR_DOC_MODIFIED_NO", "The document has not been modified since the last save.") +#define RID_SVXSTR_DOC_LOAD NC_("RID_SVXSTR_DOC_LOAD", "Loading document...") +#define RID_SVXSTR_FIT_SLIDE NC_("RID_SVXSTR_FIT_SLIDE", "Fit slide to current window.") +#define RID_SVXSTR_WARN_MISSING_SMARTART NC_("RID_SVXSTR_WARN_MISSING_SMARTART", "Could not load all SmartArts. Saving in Microsoft Office 2010 or later would avoid this issue.") +#define RID_SVXSTR_ZOOMTOOL_HINT NC_("RID_SVXSTR_ZOOMTOOL_HINT", "Zoom factor. Right-click to change zoom factor or click to open Zoom dialog.") +#define RID_SVXSTR_ZOOM_IN NC_("RID_SVXSTR_ZOOM_IN", "Zoom In") +#define RID_SVXSTR_ZOOM_OUT NC_("RID_SVXSTR_ZOOM_OUT", "Zoom Out") +#define RID_SVXSTR_ZOOM_25 NC_("RID_SVXSTR_ZOOM_25", "25%") +#define RID_SVXSTR_ZOOM_50 NC_("RID_SVXSTR_ZOOM_50", "50%") +#define RID_SVXSTR_ZOOM_75 NC_("RID_SVXSTR_ZOOM_75", "75%") +#define RID_SVXSTR_ZOOM_100 NC_("RID_SVXSTR_ZOOM_100", "100%") +#define RID_SVXSTR_ZOOM_150 NC_("RID_SVXSTR_ZOOM_150", "150%") +#define RID_SVXSTR_ZOOM_200 NC_("RID_SVXSTR_ZOOM_200", "200%") +#define RID_SVXSTR_ZOOM_WHOLE_PAGE NC_("RID_SVXSTR_ZOOM_WHOLE_PAGE", "Entire Page") +#define RID_SVXSTR_ZOOM_PAGE_WIDTH NC_("RID_SVXSTR_ZOOM_PAGE_WIDTH", "Page Width") +#define RID_SVXSTR_ZOOM_OPTIMAL_VIEW NC_("RID_SVXSTR_ZOOM_OPTIMAL_VIEW", "Optimal View") + +#define RID_SVXSTR_SEARCH_STYLES NC_("RID_SVXSTR_SEARCH_STYLES", "Including Styles") +#define RID_SVXSTR_WRITER_STYLES NC_("RID_SVXSTR_WRITER_STYLES", "Paragraph St~yles") +#define RID_SVXSTR_CALC_STYLES NC_("RID_SVXSTR_CALC_STYLES", "Cell St~yles") +#define RID_SVXSTR_SEARCH NC_("RID_SVXSTR_SEARCH", "Search for formatting") +#define RID_SVXSTR_REPLACE NC_("RID_SVXSTR_REPLACE", "Replace with formatting") +#define RID_SVXSTR_SEARCH_END NC_("RID_SVXSTR_SEARCH_END", "Reached the end of the document") +#define RID_SVXSTR_SEARCH_END_WRAPPED NC_("RID_SVXSTR_SEARCH_END_WRAPPED", "Reached the end of the document, continued from the beginning") +#define RID_SVXSTR_SEARCH_END_SHEET NC_("RID_SVXSTR_SEARCH_END_SHEET", "Reached the end of the sheet") +#define RID_SVXSTR_SEARCH_NOT_FOUND NC_("RID_SVXSTR_SEARCH_NOT_FOUND", "Search key not found") +#define RID_SVXSTR_SEARCH_NAV_ELEMENT_NOT_FOUND NC_("RID_SVXSTR_SEARCH_NAV_ELEMENT_NOT_FOUND", "Navigation Element not found") +#define RID_SVXSTR_SEARCH_START NC_("RID_SVXSTR_SEARCH_START", "Reached the beginning of the document") +#define RID_SVXSTR_SEARCH_START_WRAPPED NC_("RID_SVXSTR_SEARCH_START_WRAPPED", "Reached the beginning of the document, continued from the end") +#define RID_SVXSTR_SEARCH_REMINDER_START_WRAPPED NC_("RID_SVXSTR_SEARCH_REMINDER_START_WRAPPED", "Reached the first reminder, continued from the last") +#define RID_SVXSTR_SEARCH_REMINDER_END_WRAPPED NC_("RID_SVXSTR_SEARCH_REMINDER_END_WRAPPED", "Reached the last reminder, continued from the first") + +#define RID_SVXDLG_BMPMASK_STR_PALETTE NC_("RID_SVXDLG_BMPMASK_STR_PALETTE", "Color Palette") +#define RID_SVXDLG_BMPMASK_STR_TITLE NC_("RID_SVXDLG_BMPMASK_STR_TITLE", "Color Replacer") + +#define RID_SVXDLG_FLOAT3D_STR_TITLE NC_("RID_SVXDLG_FLOAT3D_STR_TITLE", "3D Effects") + +#define RID_SVXSTR_ERR_OLD_PASSWD NC_("RID_SVXSTR_ERR_OLD_PASSWD", "Invalid password") +#define RID_SVXSTR_ERR_REPEAT_PASSWD NC_("RID_SVXSTR_ERR_REPEAT_PASSWD", "Passwords do not match") + +#define RID_SVXSTR_BULLET_DESCRIPTION_0 NC_("RID_SVXSTR_BULLET_DESCRIPTION_0", "Solid small circular bullets") +#define RID_SVXSTR_BULLET_DESCRIPTION_1 NC_("RID_SVXSTR_BULLET_DESCRIPTION_1", "Solid large circular bullets") +#define RID_SVXSTR_BULLET_DESCRIPTION_2 NC_("RID_SVXSTR_BULLET_DESCRIPTION_2", "Solid diamond bullets") +#define RID_SVXSTR_BULLET_DESCRIPTION_3 NC_("RID_SVXSTR_BULLET_DESCRIPTION_3", "Solid large square bullets") +#define RID_SVXSTR_BULLET_DESCRIPTION_4 NC_("RID_SVXSTR_BULLET_DESCRIPTION_4", "Right pointing arrow bullets filled out") +#define RID_SVXSTR_BULLET_DESCRIPTION_5 NC_("RID_SVXSTR_BULLET_DESCRIPTION_5", "Right pointing arrow bullets") +#define RID_SVXSTR_BULLET_DESCRIPTION_6 NC_("RID_SVXSTR_BULLET_DESCRIPTION_6", "Cross mark bullets") +#define RID_SVXSTR_BULLET_DESCRIPTION_7 NC_("RID_SVXSTR_BULLET_DESCRIPTION_7", "Check mark bullets") +#define RID_SVXSTR_SINGLENUM_DESCRIPTION_0 NC_("RID_SVXSTR_SINGLENUM_DESCRIPTION_0", "Number 1) 2) 3)") +#define RID_SVXSTR_SINGLENUM_DESCRIPTION_1 NC_("RID_SVXSTR_SINGLENUM_DESCRIPTION_1", "Number 1. 2. 3.") +#define RID_SVXSTR_SINGLENUM_DESCRIPTION_2 NC_("RID_SVXSTR_SINGLENUM_DESCRIPTION_2", "Number (1) (2) (3)") +#define RID_SVXSTR_SINGLENUM_DESCRIPTION_3 NC_("RID_SVXSTR_SINGLENUM_DESCRIPTION_3", "Uppercase Roman number I. II. III.") +#define RID_SVXSTR_SINGLENUM_DESCRIPTION_4 NC_("RID_SVXSTR_SINGLENUM_DESCRIPTION_4", "Uppercase letter A) B) C)") +#define RID_SVXSTR_SINGLENUM_DESCRIPTION_5 NC_("RID_SVXSTR_SINGLENUM_DESCRIPTION_5", "Lowercase letter a) b) c)") +#define RID_SVXSTR_SINGLENUM_DESCRIPTION_6 NC_("RID_SVXSTR_SINGLENUM_DESCRIPTION_6", "Lowercase letter (a) (b) (c)") +#define RID_SVXSTR_SINGLENUM_DESCRIPTION_7 NC_("RID_SVXSTR_SINGLENUM_DESCRIPTION_7", "Lowercase Roman number i. ii. iii.") +#define RID_SVXSTR_OUTLINENUM_DESCRIPTION_0 NC_("RID_SVXSTR_OUTLINENUM_DESCRIPTION_0", "Numeric, numeric, lowercase letters, solid small circular bullet") +#define RID_SVXSTR_OUTLINENUM_DESCRIPTION_1 NC_("RID_SVXSTR_OUTLINENUM_DESCRIPTION_1", "Numeric, lowercase letters, solid small circular bullet") +#define RID_SVXSTR_OUTLINENUM_DESCRIPTION_2 NC_("RID_SVXSTR_OUTLINENUM_DESCRIPTION_2", "Numeric, lowercase letters, lowercase Roman, uppercase letters, solid small circular bullet") +#define RID_SVXSTR_OUTLINENUM_DESCRIPTION_3 NC_("RID_SVXSTR_OUTLINENUM_DESCRIPTION_3", "Numeric") +#define RID_SVXSTR_OUTLINENUM_DESCRIPTION_4 NC_("RID_SVXSTR_OUTLINENUM_DESCRIPTION_4", "Uppercase Roman, uppercase letters, lowercase Roman, lowercase letters, solid small circular bullet") +#define RID_SVXSTR_OUTLINENUM_DESCRIPTION_5 NC_("RID_SVXSTR_OUTLINENUM_DESCRIPTION_5", "Uppercase letters, uppercase Roman, lowercase letters, lowercase Roman, solid small circular bullet") +#define RID_SVXSTR_OUTLINENUM_DESCRIPTION_6 NC_("RID_SVXSTR_OUTLINENUM_DESCRIPTION_6", "Numeric with all sublevels") +#define RID_SVXSTR_OUTLINENUM_DESCRIPTION_7 NC_("RID_SVXSTR_OUTLINENUM_DESCRIPTION_7", "Right pointing bullet, right pointing arrow bullet, solid diamond bullet, solid small circular bullet") + +#define RID_SVXSTR_SAFEMODE_ZIP_FAILURE NC_("RID_SVXSTR_SAFEMODE_ZIP_FAILURE", "The zip file could not be created.") + +#define RID_SVXSTR_STYLEFAMILY_TABLEDESIGN NC_("RID_SVXSTR_STYLEFAMILY_TABLEDESIGN", "Table Design Styles") + +#define RID_SVXSTR_NUM_UNDO_ACTIONS NC_("RID_SVXSTR_NUM_UNDO_ACTIONS", "Actions to undo: $(ARG1)") +#define RID_SVXSTR_NUM_UNDO_ACTION NC_("RID_SVXSTR_NUM_UNDO_ACTION", "Actions to undo: $(ARG1)") +#define RID_SVXSTR_NUM_REDO_ACTIONS NC_("RID_SVXSTR_NUM_REDO_ACTIONS", "Actions to redo: $(ARG1)") +#define RID_SVXSTR_NUM_REDO_ACTION NC_("RID_SVXSTR_NUM_REDO_ACTION", "Actions to redo: $(ARG1)") + +#define RID_SVXSTR_FINDBAR_FIND NC_("RID_SVXSTR_FINDBAR_FIND", "Find") +#define RID_SVXSTR_FINDBAR_MATCHCASE NC_("RID_SVXSTR_FINDBAR_MATCHCASE", "Match Case") +#define RID_SVXSTR_FINDBAR_SEARCHFORMATTED NC_("RID_SVXSTR_FINDBAR_SEARCHFORMATTED", "Formatted Display") + +#define STR_IMAGE_ORIGINAL_SIZE NC_("STR_IMAGE_ORIGINAL_SIZE", "$(WIDTH) x $(HEIGHT) ($(WIDTH_IN_PX) x $(HEIGHT_IN_PX) px)") +#define STR_IMAGE_VIEW_SIZE NC_("STR_IMAGE_VIEW_SIZE", "$(WIDTH) x $(HEIGHT) at $(DPI) DPI") +#define STR_IMAGE_CAPACITY NC_("STR_IMAGE_CAPACITY", "$(CAPACITY) kiB") +#define STR_IMAGE_GIF NC_("STR_IMAGE_GIF", "Gif image") +#define STR_IMAGE_JPEG NC_("STR_IMAGE_JPEG", "Jpeg image") +#define STR_IMAGE_PNG NC_("STR_IMAGE_PNG", "PNG image") +#define STR_IMAGE_TIFF NC_("STR_IMAGE_TIFF", "TIFF image") +#define STR_IMAGE_WMF NC_("STR_IMAGE_WMF", "WMF image") +#define STR_IMAGE_MET NC_("STR_IMAGE_MET", "MET image") +#define STR_IMAGE_PCT NC_("STR_IMAGE_PCT", "PCT image") +#define STR_IMAGE_SVG NC_("STR_IMAGE_SVG", "SVG image") +#define STR_IMAGE_BMP NC_("STR_IMAGE_BMP", "BMP image") +#define STR_IMAGE_UNKNOWN NC_("STR_IMAGE_UNKNOWN", "Unknown") + +#define STR_SWITCH NC_("STR_SWITCH", "Switch") + +#define RID_SVXSTR_UNDO_GRAFMODE NC_("RID_SVXSTR_UNDO_GRAFMODE", "Image Mode") +#define RID_SVXSTR_UNDO_GRAFRED NC_("RID_SVXSTR_UNDO_GRAFRED", "Red") +#define RID_SVXSTR_UNDO_GRAFGREEN NC_("RID_SVXSTR_UNDO_GRAFGREEN", "Green") +#define RID_SVXSTR_UNDO_GRAFBLUE NC_("RID_SVXSTR_UNDO_GRAFBLUE", "Blue") +#define RID_SVXSTR_UNDO_GRAFLUMINANCE NC_("RID_SVXSTR_UNDO_GRAFLUMINANCE", "Brightness") +#define RID_SVXSTR_UNDO_GRAFCONTRAST NC_("RID_SVXSTR_UNDO_GRAFCONTRAST", "Contrast") +#define RID_SVXSTR_UNDO_GRAFGAMMA NC_("RID_SVXSTR_UNDO_GRAFGAMMA", "Gamma") +#define RID_SVXSTR_UNDO_GRAFTRANSPARENCY NC_("RID_SVXSTR_UNDO_GRAFTRANSPARENCY", "Transparency") +#define RID_SVXSTR_GRAFCROP NC_("RID_SVXSTR_GRAFCROP", "Crop") + +#define RID_SVXITEMS_ORI_STANDARD NC_("RID_SVXITEMS_ORI_STANDARD", "Default orientation") +#define RID_SVXITEMS_ORI_TOPBOTTOM NC_("RID_SVXITEMS_ORI_TOPBOTTOM", "From top to bottom") +#define RID_SVXITEMS_ORI_BOTTOMTOP NC_("RID_SVXITEMS_ORI_BOTTOMTOP", "Bottom to Top") +#define RID_SVXITEMS_ORI_STACKED NC_("RID_SVXITEMS_ORI_STACKED", "Stacked") +#define RID_SVXITEMS_MARGIN_LEFT NC_("RID_SVXITEMS_MARGIN_LEFT", "Left margin: ") +#define RID_SVXITEMS_MARGIN_TOP NC_("RID_SVXITEMS_MARGIN_TOP", "Top margin: ") +#define RID_SVXITEMS_MARGIN_RIGHT NC_("RID_SVXITEMS_MARGIN_RIGHT", "Right margin: ") +#define RID_SVXITEMS_MARGIN_BOTTOM NC_("RID_SVXITEMS_MARGIN_BOTTOM", "Bottom margin: ") +#define RID_SVXITEMS_PAGE_COMPLETE NC_("RID_SVXITEMS_PAGE_COMPLETE", "Page Description: ") +#define RID_SVXITEMS_PAGE_NUM_CHR_UPPER NC_("RID_SVXITEMS_PAGE_NUM_CHR_UPPER", "Capitals") +#define RID_SVXITEMS_PAGE_NUM_CHR_LOWER NC_("RID_SVXITEMS_PAGE_NUM_CHR_LOWER", "Lowercase") +#define RID_SVXITEMS_PAGE_NUM_ROM_UPPER NC_("RID_SVXITEMS_PAGE_NUM_ROM_UPPER", "Uppercase Roman") +#define RID_SVXITEMS_PAGE_NUM_ROM_LOWER NC_("RID_SVXITEMS_PAGE_NUM_ROM_LOWER", "Lowercase Roman") +#define RID_SVXITEMS_PAGE_NUM_ARABIC NC_("RID_SVXITEMS_PAGE_NUM_ARABIC", "Arabic") +#define RID_SVXITEMS_PAGE_NUM_NONE NC_("RID_SVXITEMS_PAGE_NUM_NONE", "None") +#define RID_SVXITEMS_PAGE_LAND_TRUE NC_("RID_SVXITEMS_PAGE_LAND_TRUE", "Landscape") +#define RID_SVXITEMS_PAGE_LAND_FALSE NC_("RID_SVXITEMS_PAGE_LAND_FALSE", "Portrait") +#define RID_SVXITEMS_PAGE_USAGE_LEFT NC_("RID_SVXITEMS_PAGE_USAGE_LEFT", "Left") +#define RID_SVXITEMS_PAGE_USAGE_RIGHT NC_("RID_SVXITEMS_PAGE_USAGE_RIGHT", "Right") +#define RID_SVXITEMS_PAGE_USAGE_ALL NC_("RID_SVXITEMS_PAGE_USAGE_ALL", "All") +#define RID_SVXITEMS_PAGE_USAGE_MIRROR NC_("RID_SVXITEMS_PAGE_USAGE_MIRROR", "Mirrored") +#define RID_SVXITEMS_AUTHOR_COMPLETE NC_("RID_SVXITEMS_AUTHOR_COMPLETE", "Author: ") +#define RID_SVXITEMS_DATE_COMPLETE NC_("RID_SVXITEMS_DATE_COMPLETE", "Date: ") +#define RID_SVXITEMS_TEXT_COMPLETE NC_("RID_SVXITEMS_TEXT_COMPLETE", "Text: ") +#define RID_SVXITEMS_BRUSH_CHAR NC_("RID_SVXITEMS_BRUSH_CHAR", "Character background") + +#define STR_COLORTABLE NC_("STR_COLORTABLE", "Color Palette") + +// Used in the Slide Setup dialog of Impress +#define STR_SLIDE_NUMBERS NC_("STR_SLIDE_NUMBERS", "Slide numbers:") + +// String for saving modified image (instead of original) +#define RID_SVXSTR_SAVE_MODIFIED_IMAGE NC_("RID_SVXSTR_SAVE_MODIFIED_IMAGE", "The image has been modified. By default the original image will be saved.\nDo you want to save the modified version instead?") + +#define RID_SUBSETSTR_BASIC_LATIN NC_("RID_SUBSETMAP", "Basic Latin") +#define RID_SUBSETSTR_LATIN_1 NC_("RID_SUBSETMAP", "Latin-1") +#define RID_SUBSETSTR_LATIN_EXTENDED_A NC_("RID_SUBSETMAP", "Latin Extended-A") +#define RID_SUBSETSTR_LATIN_EXTENDED_B NC_("RID_SUBSETMAP", "Latin Extended-B") +#define RID_SUBSETSTR_IPA_EXTENSIONS NC_("RID_SUBSETMAP", "IPA Extensions") +#define RID_SUBSETSTR_SPACING_MODIFIERS NC_("RID_SUBSETMAP", "Spacing Modifier Letters") +#define RID_SUBSETSTR_COMB_DIACRITICAL NC_("RID_SUBSETMAP", "Combining Diacritical Marks") +#define RID_SUBSETSTR_BASIC_GREEK NC_("RID_SUBSETMAP", "Basic Greek") +#define RID_SUBSETSTR_GREEK_SYMS_COPTIC NC_("RID_SUBSETMAP", "Greek Symbols And Coptic") +#define RID_SUBSETSTR_CYRILLIC NC_("RID_SUBSETMAP", "Cyrillic") +#define RID_SUBSETSTR_ARMENIAN NC_("RID_SUBSETMAP", "Armenian") +#define RID_SUBSETSTR_BASIC_HEBREW NC_("RID_SUBSETMAP", "Basic Hebrew") +#define RID_SUBSETSTR_HEBREW_EXTENDED NC_("RID_SUBSETMAP", "Hebrew Extended") +#define RID_SUBSETSTR_BASIC_ARABIC NC_("RID_SUBSETMAP", "Basic Arabic") +#define RID_SUBSETSTR_ARABIC_EXTENDED NC_("RID_SUBSETMAP", "Arabic Extended") +#define RID_SUBSETSTR_DEVANAGARI NC_("RID_SUBSETMAP", "Devanagari") +#define RID_SUBSETSTR_BENGALI NC_("RID_SUBSETMAP", "Bengali") +#define RID_SUBSETSTR_GURMUKHI NC_("RID_SUBSETMAP", "Gurmukhi") +#define RID_SUBSETSTR_GUJARATI NC_("RID_SUBSETMAP", "Gujarati") +#define RID_SUBSETSTR_ODIA NC_("RID_SUBSETMAP", "Odia") +#define RID_SUBSETSTR_TAMIL NC_("RID_SUBSETMAP", "Tamil") +#define RID_SUBSETSTR_TELUGU NC_("RID_SUBSETMAP", "Telugu") +#define RID_SUBSETSTR_KANNADA NC_("RID_SUBSETMAP", "Kannada") +#define RID_SUBSETSTR_MALAYALAM NC_("RID_SUBSETMAP", "Malayalam") +#define RID_SUBSETSTR_THAI NC_("RID_SUBSETMAP", "Thai") +#define RID_SUBSETSTR_LAO NC_("RID_SUBSETMAP", "Lao") +#define RID_SUBSETSTR_BASIC_GEORGIAN NC_("RID_SUBSETMAP", "Basic Georgian") +#define RID_SUBSETSTR_GEORGIAN_EXTENDED NC_("RID_SUBSETMAP", "Georgian Extended") +#define RID_SUBSETSTR_HANGUL_JAMO NC_("RID_SUBSETMAP", "Hangul Jamo") +#define RID_SUBSETSTR_LATIN_EXTENDED_ADDS NC_("RID_SUBSETMAP", "Latin Extended Additionals") +#define RID_SUBSETSTR_GREEK_EXTENDED NC_("RID_SUBSETMAP", "Greek Extended") +#define RID_SUBSETSTR_GENERAL_PUNCTUATION NC_("RID_SUBSETMAP", "General punctuation") +#define RID_SUBSETSTR_SUB_SUPER_SCRIPTS NC_("RID_SUBSETMAP", "Superscripts and Subscripts") +#define RID_SUBSETSTR_CURRENCY_SYMBOLS NC_("RID_SUBSETMAP", "Currency Symbols") +#define RID_SUBSETSTR_COMB_DIACRITIC_SYMS NC_("RID_SUBSETMAP", "Combining Diacritical Symbols") +#define RID_SUBSETSTR_LETTERLIKE_SYMBOLS NC_("RID_SUBSETMAP", "Letterlike Symbols") +#define RID_SUBSETSTR_NUMBER_FORMS NC_("RID_SUBSETMAP", "Number Forms") +#define RID_SUBSETSTR_ARROWS NC_("RID_SUBSETMAP", "Arrows") +#define RID_SUBSETSTR_MATH_OPERATORS NC_("RID_SUBSETMAP", "Mathematical Operators") +#define RID_SUBSETSTR_MISC_TECHNICAL NC_("RID_SUBSETMAP", "Miscellaneous Technical") +#define RID_SUBSETSTR_CONTROL_PICTURES NC_("RID_SUBSETMAP", "Control Pictures") +#define RID_SUBSETSTR_OPTICAL_CHAR_REC NC_("RID_SUBSETMAP", "Optical Character Recognition") +#define RID_SUBSETSTR_ENCLOSED_ALPHANUM NC_("RID_SUBSETMAP", "Enclosed Alphanumerics") +#define RID_SUBSETSTR_BOX_DRAWING NC_("RID_SUBSETMAP", "Box Drawing") +#define RID_SUBSETSTR_BLOCK_ELEMENTS NC_("RID_SUBSETMAP", "Block Elements") +#define RID_SUBSETSTR_GEOMETRIC_SHAPES NC_("RID_SUBSETMAP", "Geometric Shapes") +#define RID_SUBSETSTR_MISC_DINGBATS NC_("RID_SUBSETMAP", "Miscellaneous Symbols") +#define RID_SUBSETSTR_DINGBATS NC_("RID_SUBSETMAP", "Dingbats") +#define RID_SUBSETSTR_CJK_SYMS_PUNCTUATION NC_("RID_SUBSETMAP", "CJK Symbols And Punctuation") +#define RID_SUBSETSTR_HIRAGANA NC_("RID_SUBSETMAP", "Hiragana") +#define RID_SUBSETSTR_KATAKANA NC_("RID_SUBSETMAP", "Katakana") +#define RID_SUBSETSTR_BOPOMOFO NC_("RID_SUBSETMAP", "Bopomofo") +#define RID_SUBSETSTR_HANGUL_COMPAT_JAMO NC_("RID_SUBSETMAP", "Hangul Compatibility Jamo") +#define RID_SUBSETSTR_CJK_MISC NC_("RID_SUBSETMAP", "CJK Miscellaneous") +#define RID_SUBSETSTR_ENCLOSED_CJK_LETTERS NC_("RID_SUBSETMAP", "Enclosed CJK Letters And Months") +#define RID_SUBSETSTR_CJK_COMPATIBILITY NC_("RID_SUBSETMAP", "CJK Compatibility") +#define RID_SUBSETSTR_HANGUL NC_("RID_SUBSETMAP", "Hangul") +#define RID_SUBSETSTR_CJK_UNIFIED_IDGRAPH NC_("RID_SUBSETMAP", "CJK Unified Ideographs") +#define RID_SUBSETSTR_CJK_EXT_A_UNIFIED_IDGRAPH NC_("RID_SUBSETMAP", "CJK Unified Ideographs Extension A") +#define RID_SUBSETSTR_PRIVATE_USE_AREA NC_("RID_SUBSETMAP", "Private Use Area") +#define RID_SUBSETSTR_CJK_COMPAT_IDGRAPHS NC_("RID_SUBSETMAP", "CJK Compatibility Ideographs") +#define RID_SUBSETSTR_ALPHA_PRESENTATION NC_("RID_SUBSETMAP", "Alphabetic Presentation Forms") +#define RID_SUBSETSTR_ARABIC_PRESENT_A NC_("RID_SUBSETMAP", "Arabic Presentation Forms-A") +#define RID_SUBSETSTR_COMBINING_HALF_MARKS NC_("RID_SUBSETMAP", "Combining Half Marks") +#define RID_SUBSETSTR_CJK_COMPAT_FORMS NC_("RID_SUBSETMAP", "CJK Compatibility Forms") +#define RID_SUBSETSTR_SMALL_FORM_VARIANTS NC_("RID_SUBSETMAP", "Small Form Variants") +#define RID_SUBSETSTR_ARABIC_PRESENT_B NC_("RID_SUBSETMAP", "Arabic Presentation Forms-B") +#define RID_SUBSETSTR_HALFW_FULLW_FORMS NC_("RID_SUBSETMAP", "Half-width and Full-width Forms") +#define RID_SUBSETSTR_SPECIALS NC_("RID_SUBSETMAP", "Specials") +#define RID_SUBSETSTR_YI_SYLLABLES NC_("RID_SUBSETMAP", "Yi Syllables") +#define RID_SUBSETSTR_YI_RADICALS NC_("RID_SUBSETMAP", "Yi Radicals") +#define RID_SUBSETSTR_OLD_ITALIC NC_("RID_SUBSETMAP", "Old Italic") +#define RID_SUBSETSTR_GOTHIC NC_("RID_SUBSETMAP", "Gothic") +#define RID_SUBSETSTR_DESERET NC_("RID_SUBSETMAP", "Deseret") +#define RID_SUBSETSTR_BYZANTINE_MUSICAL_SYMBOLS NC_("RID_SUBSETMAP", "Byzantine Musical Symbols") +#define RID_SUBSETSTR_MUSICAL_SYMBOLS NC_("RID_SUBSETMAP", "Musical Symbols") +#define RID_SUBSETSTR_MATHEMATICAL_ALPHANUMERIC_SYMBOLS NC_("RID_SUBSETMAP", "Mathematical Alphanumeric Symbols") +#define RID_SUBSETSTR_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B NC_("RID_SUBSETMAP", "CJK Unified Ideographs Extension B") +#define RID_SUBSETSTR_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C NC_("RID_SUBSETMAP", "CJK Unified Ideographs Extension C") +#define RID_SUBSETSTR_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D NC_("RID_SUBSETMAP", "CJK Unified Ideographs Extension D") +#define RID_SUBSETSTR_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT NC_("RID_SUBSETMAP", "CJK Compatibility Ideographs Supplement") +#define RID_SUBSETSTR_TAGS NC_("RID_SUBSETMAP", "Tags") +#define RID_SUBSETSTR_CYRILLIC_SUPPLEMENTARY NC_("RID_SUBSETMAP", "Cyrillic Supplement") +#define RID_SUBSETSTR_VARIATION_SELECTORS NC_("RID_SUBSETMAP", "Variation Selectors") +#define RID_SUBSETSTR_SUPPLEMENTARY_PRIVATE_USE_AREA_A NC_("RID_SUBSETMAP", "Supplementary Private Use Area-A") +#define RID_SUBSETSTR_SUPPLEMENTARY_PRIVATE_USE_AREA_B NC_("RID_SUBSETMAP", "Supplementary Private Use Area-B") +#define RID_SUBSETSTR_LIMBU NC_("RID_SUBSETMAP", "Limbu") +#define RID_SUBSETSTR_TAI_LE NC_("RID_SUBSETMAP", "Tai Le") +#define RID_SUBSETSTR_KHMER_SYMBOLS NC_("RID_SUBSETMAP", "Khmer Symbols") +#define RID_SUBSETSTR_PHONETIC_EXTENSIONS NC_("RID_SUBSETMAP", "Phonetic Extensions") +#define RID_SUBSETSTR_MISCELLANEOUS_SYMBOLS_AND_ARROWS NC_("RID_SUBSETMAP", "Miscellaneous Symbols And Arrows") +#define RID_SUBSETSTR_YIJING_HEXAGRAM_SYMBOLS NC_("RID_SUBSETMAP", "Yijing Hexagram Symbols") +#define RID_SUBSETSTR_LINEAR_B_SYLLABARY NC_("RID_SUBSETMAP", "Linear B Syllabary") +#define RID_SUBSETSTR_LINEAR_B_IDEOGRAMS NC_("RID_SUBSETMAP", "Linear B Ideograms") +#define RID_SUBSETSTR_AEGEAN_NUMBERS NC_("RID_SUBSETMAP", "Aegean Numbers") +#define RID_SUBSETSTR_UGARITIC NC_("RID_SUBSETMAP", "Ugaritic") +#define RID_SUBSETSTR_SHAVIAN NC_("RID_SUBSETMAP", "Shavian") +#define RID_SUBSETSTR_OSMANYA NC_("RID_SUBSETMAP", "Osmanya") +#define RID_SUBSETSTR_SINHALA NC_("RID_SUBSETMAP", "Sinhala") +#define RID_SUBSETSTR_TIBETAN NC_("RID_SUBSETMAP", "Tibetan") +#define RID_SUBSETSTR_MYANMAR NC_("RID_SUBSETMAP", "Myanmar") +#define RID_SUBSETSTR_KHMER NC_("RID_SUBSETMAP", "Khmer") +#define RID_SUBSETSTR_OGHAM NC_("RID_SUBSETMAP", "Ogham") +#define RID_SUBSETSTR_RUNIC NC_("RID_SUBSETMAP", "Runic") +#define RID_SUBSETSTR_SYRIAC NC_("RID_SUBSETMAP", "Syriac") +#define RID_SUBSETSTR_THAANA NC_("RID_SUBSETMAP", "Thaana") +#define RID_SUBSETSTR_ETHIOPIC NC_("RID_SUBSETMAP", "Ethiopic") +#define RID_SUBSETSTR_CHEROKEE NC_("RID_SUBSETMAP", "Cherokee") +#define RID_SUBSETSTR_CANADIAN_ABORIGINAL NC_("RID_SUBSETMAP", "Canadian Aboriginal Syllables") +#define RID_SUBSETSTR_MONGOLIAN NC_("RID_SUBSETMAP", "Mongolian") +#define RID_SUBSETSTR_MISC_MATH_SYMS_A NC_("RID_SUBSETMAP", "Miscellaneous Mathematical Symbols-A") +#define RID_SUBSETSTR_SUPPL_ARROWS_A NC_("RID_SUBSETMAP", "Supplemental Arrows-A") +#define RID_SUBSETSTR_BRAILLE_PATTERNS NC_("RID_SUBSETMAP", "Braille Patterns") +#define RID_SUBSETSTR_SUPPL_ARROWS_B NC_("RID_SUBSETMAP", "Supplemental Arrows-B") +#define RID_SUBSETSTR_MISC_MATH_SYMS_B NC_("RID_SUBSETMAP", "Miscellaneous Mathematical Symbols-B") +#define RID_SUBSETSTR_CJK_RADICAL_SUPPL NC_("RID_SUBSETMAP", "CJK Radical Supplement") +#define RID_SUBSETSTR_KANGXI_RADICALS NC_("RID_SUBSETMAP", "Kangxi Radicals") +#define RID_SUBSETSTR_IDEO_DESC_CHARS NC_("RID_SUBSETMAP", "Ideographic Description Characters") +#define RID_SUBSETSTR_TAGALOG NC_("RID_SUBSETMAP", "Tagalog") +#define RID_SUBSETSTR_HANUNOO NC_("RID_SUBSETMAP", "Hanunoo") +#define RID_SUBSETSTR_TAGBANWA NC_("RID_SUBSETMAP", "Tagbanwa") +#define RID_SUBSETSTR_BUHID NC_("RID_SUBSETMAP", "Buhid") +#define RID_SUBSETSTR_KANBUN NC_("RID_SUBSETMAP", "Kanbun") +#define RID_SUBSETSTR_BOPOMOFO_EXTENDED NC_("RID_SUBSETMAP", "Bopomofo Extended") +#define RID_SUBSETSTR_KATAKANA_PHONETIC NC_("RID_SUBSETMAP", "Katakana Phonetics") +#define RID_SUBSETSTR_CJK_STROKES NC_("RID_SUBSETMAP", "CJK Strokes") +#define RID_SUBSETSTR_CYPRIOT_SYLLABARY NC_("RID_SUBSETMAP", "Cypriot Syllabary") +#define RID_SUBSETSTR_TAI_XUAN_JING_SYMBOLS NC_("RID_SUBSETMAP", "Tai Xuan Jing Symbols") +#define RID_SUBSETSTR_VARIATION_SELECTORS_SUPPLEMENT NC_("RID_SUBSETMAP", "Variation Selectors Supplement") +#define RID_SUBSETSTR_ANCIENT_GREEK_MUSICAL_NOTATION NC_("RID_SUBSETMAP", "Ancient Greek Musical Notation") +#define RID_SUBSETSTR_ANCIENT_GREEK_NUMBERS NC_("RID_SUBSETMAP", "Ancient Greek Numbers") +#define RID_SUBSETSTR_ARABIC_SUPPLEMENT NC_("RID_SUBSETMAP", "Arabic Supplement") +#define RID_SUBSETSTR_BUGINESE NC_("RID_SUBSETMAP", "Buginese") +#define RID_SUBSETSTR_COMBINING_DIACRITICAL_MARKS_SUPPLEMENT NC_("RID_SUBSETMAP", "Combining Diacritical Marks Supplement") +#define RID_SUBSETSTR_COPTIC NC_("RID_SUBSETMAP", "Coptic") +#define RID_SUBSETSTR_ETHIOPIC_EXTENDED NC_("RID_SUBSETMAP", "Ethiopic Extended") +#define RID_SUBSETSTR_ETHIOPIC_SUPPLEMENT NC_("RID_SUBSETMAP", "Ethiopic Supplement") +#define RID_SUBSETSTR_GEORGIAN_SUPPLEMENT NC_("RID_SUBSETMAP", "Georgian Supplement") +#define RID_SUBSETSTR_GLAGOLITIC NC_("RID_SUBSETMAP", "Glagolitic") +#define RID_SUBSETSTR_KHAROSHTHI NC_("RID_SUBSETMAP", "Kharoshthi") +#define RID_SUBSETSTR_MODIFIER_TONE_LETTERS NC_("RID_SUBSETMAP", "Modifier Tone Letters") +#define RID_SUBSETSTR_NEW_TAI_LUE NC_("RID_SUBSETMAP", "New Tai Lue") +#define RID_SUBSETSTR_OLD_PERSIAN NC_("RID_SUBSETMAP", "Old Persian") +#define RID_SUBSETSTR_PHONETIC_EXTENSIONS_SUPPLEMENT NC_("RID_SUBSETMAP", "Phonetic Extensions Supplement") +#define RID_SUBSETSTR_SUPPLEMENTAL_PUNCTUATION NC_("RID_SUBSETMAP", "Supplemental Punctuation") +#define RID_SUBSETSTR_SYLOTI_NAGRI NC_("RID_SUBSETMAP", "Syloti Nagri") +#define RID_SUBSETSTR_TIFINAGH NC_("RID_SUBSETMAP", "Tifinagh") +#define RID_SUBSETSTR_VERTICAL_FORMS NC_("RID_SUBSETMAP", "Vertical Forms") +#define RID_SUBSETSTR_NKO NC_("RID_SUBSETMAP", "Nko") +#define RID_SUBSETSTR_BALINESE NC_("RID_SUBSETMAP", "Balinese") +#define RID_SUBSETSTR_LATIN_EXTENDED_C NC_("RID_SUBSETMAP", "Latin Extended-C") +#define RID_SUBSETSTR_LATIN_EXTENDED_D NC_("RID_SUBSETMAP", "Latin Extended-D") +#define RID_SUBSETSTR_PHAGS_PA NC_("RID_SUBSETMAP", "Phags-Pa") +#define RID_SUBSETSTR_PHOENICIAN NC_("RID_SUBSETMAP", "Phoenician") +#define RID_SUBSETSTR_CUNEIFORM NC_("RID_SUBSETMAP", "Cuneiform") +#define RID_SUBSETSTR_CUNEIFORM_NUMBERS_AND_PUNCTUATION NC_("RID_SUBSETMAP", "Cuneiform Numbers And Punctuation") +#define RID_SUBSETSTR_COUNTING_ROD_NUMERALS NC_("RID_SUBSETMAP", "Counting Rod Numerals") +#define RID_SUBSETSTR_SUNDANESE NC_("RID_SUBSETMAP", "Sundanese") +#define RID_SUBSETSTR_LEPCHA NC_("RID_SUBSETMAP", "Lepcha") +#define RID_SUBSETSTR_OL_CHIKI NC_("RID_SUBSETMAP", "Ol Chiki") +#define RID_SUBSETSTR_CYRILLIC_EXTENDED_A NC_("RID_SUBSETMAP", "Cyrillic Extended-A") +#define RID_SUBSETSTR_VAI NC_("RID_SUBSETMAP", "Vai") +#define RID_SUBSETSTR_CYRILLIC_EXTENDED_B NC_("RID_SUBSETMAP", "Cyrillic Extended-B") +#define RID_SUBSETSTR_SAURASHTRA NC_("RID_SUBSETMAP", "Saurashtra") +#define RID_SUBSETSTR_KAYAH_LI NC_("RID_SUBSETMAP", "Kayah Li") +#define RID_SUBSETSTR_REJANG NC_("RID_SUBSETMAP", "Rejang") +#define RID_SUBSETSTR_CHAM NC_("RID_SUBSETMAP", "Cham") +#define RID_SUBSETSTR_ANCIENT_SYMBOLS NC_("RID_SUBSETMAP", "Ancient Symbols") +#define RID_SUBSETSTR_PHAISTOS_DISC NC_("RID_SUBSETMAP", "Phaistos Disc") +#define RID_SUBSETSTR_LYCIAN NC_("RID_SUBSETMAP", "Lycian") +#define RID_SUBSETSTR_CARIAN NC_("RID_SUBSETMAP", "Carian") +#define RID_SUBSETSTR_LYDIAN NC_("RID_SUBSETMAP", "Lydian") +#define RID_SUBSETSTR_MAHJONG_TILES NC_("RID_SUBSETMAP", "Mahjong Tiles") +#define RID_SUBSETSTR_DOMINO_TILES NC_("RID_SUBSETMAP", "Domino Tiles") +#define RID_SUBSETSTR_SAMARITAN NC_("RID_SUBSETMAP", "Samaritan") +#define RID_SUBSETSTR_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED NC_("RID_SUBSETMAP", "Canadian Aboriginal Syllabics Extended") +#define RID_SUBSETSTR_TAI_THAM NC_("RID_SUBSETMAP", "Tai Tham") +#define RID_SUBSETSTR_VEDIC_EXTENSIONS NC_("RID_SUBSETMAP", "Vedic Extensions") +#define RID_SUBSETSTR_LISU NC_("RID_SUBSETMAP", "Lisu") +#define RID_SUBSETSTR_BAMUM NC_("RID_SUBSETMAP", "Bamum") +#define RID_SUBSETSTR_COMMON_INDIC_NUMBER_FORMS NC_("RID_SUBSETMAP", "Common Indic Number Forms") +#define RID_SUBSETSTR_DEVANAGARI_EXTENDED NC_("RID_SUBSETMAP", "Devanagari Extended") +#define RID_SUBSETSTR_HANGUL_JAMO_EXTENDED_A NC_("RID_SUBSETMAP", "Hangul Jamo Extended-A") +#define RID_SUBSETSTR_JAVANESE NC_("RID_SUBSETMAP", "Javanese") +#define RID_SUBSETSTR_MYANMAR_EXTENDED_A NC_("RID_SUBSETMAP", "Myanmar Extended-A") +#define RID_SUBSETSTR_TAI_VIET NC_("RID_SUBSETMAP", "Tai Viet") +#define RID_SUBSETSTR_MEETEI_MAYEK NC_("RID_SUBSETMAP", "Meetei Mayek") +#define RID_SUBSETSTR_HANGUL_JAMO_EXTENDED_B NC_("RID_SUBSETMAP", "Hangul Jamo Extended-B") +#define RID_SUBSETSTR_IMPERIAL_ARAMAIC NC_("RID_SUBSETMAP", "Imperial Aramaic") +#define RID_SUBSETSTR_OLD_SOUTH_ARABIAN NC_("RID_SUBSETMAP", "Old South Arabian") +#define RID_SUBSETSTR_AVESTAN NC_("RID_SUBSETMAP", "Avestan") +#define RID_SUBSETSTR_INSCRIPTIONAL_PARTHIAN NC_("RID_SUBSETMAP", "Inscriptional Parthian") +#define RID_SUBSETSTR_INSCRIPTIONAL_PAHLAVI NC_("RID_SUBSETMAP", "Inscriptional Pahlavi") +#define RID_SUBSETSTR_OLD_TURKIC NC_("RID_SUBSETMAP", "Old Turkic") +#define RID_SUBSETSTR_RUMI_NUMERAL_SYMBOLS NC_("RID_SUBSETMAP", "Rumi Numeral Symbols") +#define RID_SUBSETSTR_KAITHI NC_("RID_SUBSETMAP", "Kaithi") +#define RID_SUBSETSTR_EGYPTIAN_HIEROGLYPHS NC_("RID_SUBSETMAP", "Egyptian Hieroglyphs") +#define RID_SUBSETSTR_ENCLOSED_ALPHANUMERIC_SUPPLEMENT NC_("RID_SUBSETMAP", "Enclosed Alphanumeric Supplement") +#define RID_SUBSETSTR_ENCLOSED_IDEOGRAPHIC_SUPPLEMENT NC_("RID_SUBSETMAP", "Enclosed Ideographic Supplement") +#define RID_SUBSETSTR_MANDAIC NC_("RID_SUBSETMAP", "Mandaic") +#define RID_SUBSETSTR_BATAK NC_("RID_SUBSETMAP", "Batak") +#define RID_SUBSETSTR_ETHIOPIC_EXTENDED_A NC_("RID_SUBSETMAP", "Ethiopic Extended-A") +#define RID_SUBSETSTR_BRAHMI NC_("RID_SUBSETMAP", "Brahmi") +#define RID_SUBSETSTR_BAMUM_SUPPLEMENT NC_("RID_SUBSETMAP", "Bamum Supplement") +#define RID_SUBSETSTR_KANA_SUPPLEMENT NC_("RID_SUBSETMAP", "Kana Supplement") +#define RID_SUBSETSTR_PLAYING_CARDS NC_("RID_SUBSETMAP", "Playing Cards") +#define RID_SUBSETSTR_MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS NC_("RID_SUBSETMAP", "Miscellaneous Symbols And Pictographs") +#define RID_SUBSETSTR_EMOTICONS NC_("RID_SUBSETMAP", "Emoticons") +#define RID_SUBSETSTR_TRANSPORT_AND_MAP_SYMBOLS NC_("RID_SUBSETMAP", "Transport And Map Symbols") +#define RID_SUBSETSTR_ALCHEMICAL_SYMBOLS NC_("RID_SUBSETMAP", "Alchemical Symbols") +#define RID_SUBSETSTR_ARABIC_EXTENDED_A NC_("RID_SUBSETMAP", "Arabic Extended-A") +#define RID_SUBSETSTR_ARABIC_MATHEMATICAL_ALPHABETIC_SYMBOLS NC_("RID_SUBSETMAP", "Arabic Mathematical Alphabetic Symbols") +#define RID_SUBSETSTR_CHAKMA NC_("RID_SUBSETMAP", "Chakma") +#define RID_SUBSETSTR_MEETEI_MAYEK_EXTENSIONS NC_("RID_SUBSETMAP", "Meetei Mayek Extensions") +#define RID_SUBSETSTR_MEROITIC_CURSIVE NC_("RID_SUBSETMAP", "Meroitic Cursive") +#define RID_SUBSETSTR_MEROITIC_HIEROGLYPHS NC_("RID_SUBSETMAP", "Meroitic Hieroglyphs") +#define RID_SUBSETSTR_MIAO NC_("RID_SUBSETMAP", "Miao") +#define RID_SUBSETSTR_SHARADA NC_("RID_SUBSETMAP", "Sharada") +#define RID_SUBSETSTR_SORA_SOMPENG NC_("RID_SUBSETMAP", "Sora Sompeng") +#define RID_SUBSETSTR_SUNDANESE_SUPPLEMENT NC_("RID_SUBSETMAP", "Sundanese Supplement") +#define RID_SUBSETSTR_TAKRI NC_("RID_SUBSETMAP", "Takri") +#define RID_SUBSETSTR_BASSA_VAH NC_("RID_SUBSETMAP", "Bassa Vah") +#define RID_SUBSETSTR_CAUCASIAN_ALBANIAN NC_("RID_SUBSETMAP", "Caucasian Albanian") +#define RID_SUBSETSTR_COPTIC_EPACT_NUMBERS NC_("RID_SUBSETMAP", "Coptic Epact Numbers") +#define RID_SUBSETSTR_COMBINING_DIACRITICAL_MARKS_EXTENDED NC_("RID_SUBSETMAP", "Combining Diacritical Marks Extended") +#define RID_SUBSETSTR_DUPLOYAN NC_("RID_SUBSETMAP", "Duployan") +#define RID_SUBSETSTR_ELBASAN NC_("RID_SUBSETMAP", "Elbasan") +#define RID_SUBSETSTR_GEOMETRIC_SHAPES_EXTENDED NC_("RID_SUBSETMAP", "Geometric Shapes Extended") +#define RID_SUBSETSTR_GRANTHA NC_("RID_SUBSETMAP", "Grantha") +#define RID_SUBSETSTR_KHOJKI NC_("RID_SUBSETMAP", "Khojki") +#define RID_SUBSETSTR_KHUDAWADI NC_("RID_SUBSETMAP", "Khudawadi") +#define RID_SUBSETSTR_LATIN_EXTENDED_E NC_("RID_SUBSETMAP", "Latin Extended-E") +#define RID_SUBSETSTR_LINEAR_A NC_("RID_SUBSETMAP", "Linear A") +#define RID_SUBSETSTR_MAHAJANI NC_("RID_SUBSETMAP", "Mahajani") +#define RID_SUBSETSTR_MANICHAEAN NC_("RID_SUBSETMAP", "Manichaean") +#define RID_SUBSETSTR_MENDE_KIKAKUI NC_("RID_SUBSETMAP", "Mende Kikakui") +#define RID_SUBSETSTR_MODI NC_("RID_SUBSETMAP", "Modi") +#define RID_SUBSETSTR_MRO NC_("RID_SUBSETMAP", "Mro") +#define RID_SUBSETSTR_MYANMAR_EXTENDED_B NC_("RID_SUBSETMAP", "Myanmar Extended-B") +#define RID_SUBSETSTR_NABATAEAN NC_("RID_SUBSETMAP", "Nabataean") +#define RID_SUBSETSTR_OLD_NORTH_ARABIAN NC_("RID_SUBSETMAP", "Old North Arabian") +#define RID_SUBSETSTR_OLD_PERMIC NC_("RID_SUBSETMAP", "Old Permic") +#define RID_SUBSETSTR_ORNAMENTAL_DINGBATS NC_("RID_SUBSETMAP", "Ornamental Dingbats") +#define RID_SUBSETSTR_PAHAWH_HMONG NC_("RID_SUBSETMAP", "Pahawh Hmong") +#define RID_SUBSETSTR_PALMYRENE NC_("RID_SUBSETMAP", "Palmyrene") +#define RID_SUBSETSTR_PAU_CIN_HAU NC_("RID_SUBSETMAP", "Pau Cin Hau") +#define RID_SUBSETSTR_PSALTER_PAHLAVI NC_("RID_SUBSETMAP", "Psalter Pahlavi") +#define RID_SUBSETSTR_SHORTHAND_FORMAT_CONTROLS NC_("RID_SUBSETMAP", "Shorthand Format Controls") +#define RID_SUBSETSTR_SIDDHAM NC_("RID_SUBSETMAP", "Siddham") +#define RID_SUBSETSTR_SINHALA_ARCHAIC_NUMBERS NC_("RID_SUBSETMAP", "Sinhala Archaic Numbers") +#define RID_SUBSETSTR_SUPPLEMENTAL_ARROWS_C NC_("RID_SUBSETMAP", "Supplemental Arrows-C") +#define RID_SUBSETSTR_TIRHUTA NC_("RID_SUBSETMAP", "Tirhuta") +#define RID_SUBSETSTR_WARANG_CITI NC_("RID_SUBSETMAP", "Warang Citi") +#define RID_SUBSETSTR_AHOM NC_("RID_SUBSETMAP", "Ahom") +#define RID_SUBSETSTR_ANATOLIAN_HIEROGLYPHS NC_("RID_SUBSETMAP", "Anatolian Hieroglyphs") +#define RID_SUBSETSTR_CHEROKEE_SUPPLEMENT NC_("RID_SUBSETMAP", "Cherokee Supplement") +#define RID_SUBSETSTR_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_E NC_("RID_SUBSETMAP", "CJK Unified Ideographs Extension E") +#define RID_SUBSETSTR_EARLY_DYNASTIC_CUNEIFORM NC_("RID_SUBSETMAP", "Early Dynastic Cuneiform") +#define RID_SUBSETSTR_HATRAN NC_("RID_SUBSETMAP", "Hatran") +#define RID_SUBSETSTR_MULTANI NC_("RID_SUBSETMAP", "Multani") +#define RID_SUBSETSTR_OLD_HUNGARIAN NC_("RID_SUBSETMAP", "Old Hungarian") +#define RID_SUBSETSTR_SUPPLEMENTAL_SYMBOLS_AND_PICTOGRAPHS NC_("RID_SUBSETMAP", "Supplemental Symbols And Pictographs") +#define RID_SUBSETSTR_SUTTON_SIGNWRITING NC_("RID_SUBSETMAP", "Sutton Signwriting") +#define RID_SUBSETSTR_ADLAM NC_("RID_SUBSETMAP", "Adlam") +#define RID_SUBSETSTR_BHAIKSUKI NC_("RID_SUBSETMAP", "Bhaiksuki") +#define RID_SUBSETSTR_CYRILLIC_EXTENDED_C NC_("RID_SUBSETMAP", "Cyrillic Extended-C") +#define RID_SUBSETSTR_GLAGOLITIC_SUPPLEMENT NC_("RID_SUBSETMAP", "Glagolitic Supplement") +#define RID_SUBSETSTR_IDEOGRAPHIC_SYMBOLS_AND_PUNCTUATION NC_("RID_SUBSETMAP", "Ideographic Symbols and Punctuation") +#define RID_SUBSETSTR_MARCHEN NC_("RID_SUBSETMAP", "Marchen") +#define RID_SUBSETSTR_MONGOLIAN_SUPPLEMENT NC_("RID_SUBSETMAP", "Mongolian Supplement") +#define RID_SUBSETSTR_NEWA NC_("RID_SUBSETMAP", "Newa") +#define RID_SUBSETSTR_OSAGE NC_("RID_SUBSETMAP", "Osage") +#define RID_SUBSETSTR_TANGUT NC_("RID_SUBSETMAP", "Tangut") +#define RID_SUBSETSTR_TANGUT_COMPONENTS NC_("RID_SUBSETMAP", "Tangut Components") +#define RID_SUBSETSTR_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_F NC_("RID_SUBSETMAP", "CJK Unified Ideographs Extension F") +#define RID_SUBSETSTR_KANA_EXTENDED_A NC_("RID_SUBSETMAP", "Kana Extended-A") +#define RID_SUBSETSTR_MASARAM_GONDI NC_("RID_SUBSETMAP", "Masaram Gondi") +#define RID_SUBSETSTR_NUSHU NC_("RID_SUBSETMAP", "Nushu") +#define RID_SUBSETSTR_SOYOMBO NC_("RID_SUBSETMAP", "Soyombo") +#define RID_SUBSETSTR_SYRIAC_SUPPLEMENT NC_("RID_SUBSETMAP", "Syriac Supplement") +#define RID_SUBSETSTR_ZANABAZAR_SQUARE NC_("RID_SUBSETMAP", "Zanabazar Square") +#define RID_SUBSETSTR_CHESS_SYMBOLS NC_("RID_SUBSETMAP", "Chess Symbols") +#define RID_SUBSETSTR_DOGRA NC_("RID_SUBSETMAP", "Dogra") +#define RID_SUBSETSTR_GUNJALA_GONDI NC_("RID_SUBSETMAP", "Gunjala Gondi") +#define RID_SUBSETSTR_HANIFI_ROHINGYA NC_("RID_SUBSETMAP", "Hanifi Rohingya") +#define RID_SUBSETSTR_INDIC_SIYAQ_NUMBERS NC_("RID_SUBSETMAP", "Indic Siyaq Numbers") +#define RID_SUBSETSTR_MAKASAR NC_("RID_SUBSETMAP", "Makasar") +#define RID_SUBSETSTR_MAYAN_NUMERALS NC_("RID_SUBSETMAP", "Mayan Numerals") +#define RID_SUBSETSTR_MEDEFAIDRIN NC_("RID_SUBSETMAP", "Medefaidrin") +#define RID_SUBSETSTR_OLD_SOGDIAN NC_("RID_SUBSETMAP", "Old Sogdian") +#define RID_SUBSETSTR_SOGDIAN NC_("RID_SUBSETMAP", "Sogdian") +#define RID_SUBSETSTR_EGYPTIAN_HIEROGLYPH_FORMAT_CONTROLS NC_("RID_SUBSETMAP", "Egyptian Hieroglyph Format Controls") +#define RID_SUBSETSTR_ELYMAIC NC_("RID_SUBSETMAP", "Elymaic") +#define RID_SUBSETSTR_NANDINAGARI NC_("RID_SUBSETMAP", "Nandinagari") +#define RID_SUBSETSTR_NYIAKENG_PUACHUE_HMONG NC_("RID_SUBSETMAP", "Nyiakeng Puachue Hmong") +#define RID_SUBSETSTR_OTTOMAN_SIYAQ_NUMBERS NC_("RID_SUBSETMAP", "Ottoman Siyaq Numbers") +#define RID_SUBSETSTR_SMALL_KANA_EXTENSION NC_("RID_SUBSETMAP", "Small Kana Extension") +#define RID_SUBSETSTR_SYMBOLS_AND_PICTOGRAPHS_EXTENDED_A NC_("RID_SUBSETMAP", "Symbols and Pictographs Extended-A") +#define RID_SUBSETSTR_TAMIL_SUPPLEMENT NC_("RID_SUBSETMAP", "Tamil Supplement") +#define RID_SUBSETSTR_WANCHO NC_("RID_SUBSETMAP", "Wancho") +#define RID_SUBSETSTR_CHORASMIAN NC_("RID_SUBSETMAP", "Chorasmian") +#define RID_SUBSETSTR_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_G NC_("RID_SUBSETMAP", "CJK Unified Ideographs Extension G") +#define RID_SUBSETSTR_DIVES_AKURU NC_("RID_SUBSETMAP", "Dhives Akuru") +#define RID_SUBSETSTR_KHITAN_SMALL_SCRIPT NC_("RID_SUBSETMAP", "Khitan small script") +#define RID_SUBSETSTR_LISU_SUPPLEMENT NC_("RID_SUBSETMAP", "Lisu Supplement") +#define RID_SUBSETSTR_SYMBOLS_FOR_LEGACY_COMPUTING NC_("RID_SUBSETMAP", "Symbols for Legacy Computing") +#define RID_SUBSETSTR_TANGUT_SUPPLEMENT NC_("RID_SUBSETMAP", "Tangut Supplement") +#define RID_SUBSETSTR_YEZIDI NC_("RID_SUBSETMAP", "Yezidi") + +#define RID_SVXSTR_FRAMEDIR_LTR NC_("RID_SVXSTR_FRAMEDIR_LTR", "Left-to-right (LTR)") +#define RID_SVXSTR_FRAMEDIR_RTL NC_("RID_SVXSTR_FRAMEDIR_RTL", "Right-to-left (RTL)") +#define RID_SVXSTR_FRAMEDIR_SUPER NC_("RID_SVXSTR_FRAMEDIR_SUPER", "Use superordinate object settings") +// page direction +#define RID_SVXSTR_PAGEDIR_LTR_HORI NC_("RID_SVXSTR_PAGEDIR_LTR_HORI", "Left-to-right (horizontal)") +#define RID_SVXSTR_PAGEDIR_RTL_HORI NC_("RID_SVXSTR_PAGEDIR_RTL_HORI", "Right-to-left (horizontal)") +#define RID_SVXSTR_PAGEDIR_RTL_VERT NC_("RID_SVXSTR_PAGEDIR_RTL_VERT", "Right-to-left (vertical)") +#define RID_SVXSTR_PAGEDIR_LTR_VERT NC_("RID_SVXSTR_PAGEDIR_LTR_VERT", "Left-to-right (vertical)") +#define RID_SVXSTR_PAGEDIR_LTR_BTT_VERT NC_("RID_SVXSTR_PAGEDIR_LTR_BTT_VERT", "Bottom-to-top, left-to-right (vertical)") + +#define RID_SVXSTR_FONTWORK NC_("RID_SVXSTR_FONTWORK", "Fontwork") + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdcrtv.hxx b/include/svx/svdcrtv.hxx new file mode 100644 index 000000000..1bf7276a0 --- /dev/null +++ b/include/svx/svdcrtv.hxx @@ -0,0 +1,167 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVDCRTV_HXX +#define INCLUDED_SVX_SVDCRTV_HXX + +#include +#include +#include + +class XLineAttrSetItem; +class XFillAttrSetItem; +class SdrEdgeObj; +class SdrObjConnection; + +class ImplConnectMarkerOverlay; +class ImpSdrCreateViewExtraData; + +class SVXCORE_DLLPUBLIC SdrCreateView : public SdrDragView +{ + friend class SdrPageView; + +protected: + SdrObject* pCurrentCreate; // The currently being created object + SdrPageView* pCreatePV; // Here, the creation is started + std::unique_ptr mpCoMaOverlay; + + // for migrating stuff from XOR, use ImpSdrCreateViewExtraData ATM to not need to + // compile the apps all the time + std::unique_ptr mpCreateViewExtraData; + + PointerStyle aCurrentCreatePointer; + + sal_Int32 nAutoCloseDistPix; + sal_Int32 nFreeHandMinDistPix; + SdrInventor nCurrentInvent; // set the current ones + sal_uInt16 nCurrentIdent; // Obj for re-creating + + bool b1stPointAsCenter : 1; + bool bUseIncompatiblePathCreateInterface : 1; + + void ImpClearConnectMarker(); + +private: + SVX_DLLPRIVATE void ImpClearVars(); + +protected: + bool ImpBegCreateObj(SdrInventor nInvent, sal_uInt16 nIdent, const Point& rPnt, OutputDevice* pOut, + sal_Int16 nMinMov, const tools::Rectangle& rLogRect, SdrObject* pPreparedFactoryObject); + + void ShowCreateObj(/*OutputDevice* pOut, bool bFull*/); + void HideCreateObj(/*OutputDevice* pOut, bool bFull*/); + bool CheckEdgeMode(); + +protected: + // #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView + SdrCreateView( + SdrModel& rSdrModel, + OutputDevice* pOut); + + virtual ~SdrCreateView() override; + +public: + virtual bool IsAction() const override; + virtual void MovAction(const Point& rPnt) override; + virtual void EndAction() override; + virtual void BckAction() override; + virtual void BrkAction() override; + virtual void TakeActionRect(tools::Rectangle& rRect) const override; + + virtual bool MouseMove(const MouseEvent& rMEvt, OutputDevice* pWin) override; + + void SetMeasureLayer(const OUString& rName) { maMeasureLayer=rName; } + + // If the MeasureLayer is not set (empty string), then use the active layer for measuring. + void SetEditMode(SdrViewEditMode eMode) { SdrDragView::SetEditMode(eMode); CheckEdgeMode(); } + void SetEditMode(bool bOn=true) { SdrDragView::SetEditMode(bOn); CheckEdgeMode(); } + void SetCreateMode(bool bOn=true) { SdrDragView::SetCreateMode(bOn); CheckEdgeMode(); } + void SetGluePointEditMode(bool bOn=true) { SdrDragView::SetGluePointEditMode(bOn); CheckEdgeMode(); } + + // Determine whether a text tool is activated + bool IsTextTool() const; + + // Determine whether an object connector tool activated + bool IsEdgeTool() const; + + // Determine whether a measurement tool activated + bool IsMeasureTool() const; + + void SetCurrentObj(sal_uInt16 nIdent, SdrInventor nInvent=SdrInventor::Default); + void TakeCurrentObj(sal_uInt16& nIdent, SdrInventor& nInvent) const { nInvent=nCurrentInvent; nIdent=nCurrentIdent; } + SdrInventor GetCurrentObjInventor() const { return nCurrentInvent; } + sal_uInt16 GetCurrentObjIdentifier() const { return nCurrentIdent; } + + // Beginning the regular Create + bool BegCreateObj(const Point& rPnt, OutputDevice* pOut=nullptr, short nMinMov=-3); + bool BegCreatePreparedObject(const Point& rPnt, sal_Int16 nMinMov, SdrObject* pPreparedFactoryObject); + void MovCreateObj(const Point& rPnt); + bool EndCreateObj(SdrCreateCmd eCmd); + void BckCreateObj(); // go back one polygon point + void BrkCreateObj(); + bool IsCreateObj() const { return pCurrentCreate!=nullptr; } + SdrObject* GetCreateObj() const { return pCurrentCreate; } + + /// Setup layer (eg. foreground / background) of the given object. + static void SetupObjLayer(const SdrPageView* pPageView, const OUString& aActiveLayer, SdrObject* pObj); + + // BegCreateCaptionObj() creates a SdrCaptionObj (legend item). + // rObjSiz is the initial size of the legend text frame. + // Only the length of the tip is dragged + bool BegCreateCaptionObj(const Point& rPnt, const Size& rObjSiz, OutputDevice* pOut=nullptr, short nMinMov=-3); + + // Create a circle/rectangle/text frame with the first Point being + // the center of the object instead of the upper-left corner. + // Persistent flag. Default = FALSE. + bool IsCreate1stPointAsCenter() const { return b1stPointAsCenter; } + void SetCreate1stPointAsCenter(bool bOn) { b1stPointAsCenter = bOn; } + + // Default = 5 Pixel + sal_uInt16 GetAutoCloseDistPix() const { return sal_uInt16(nAutoCloseDistPix); } + + // Setting for the minimum distance in pixels between 2 bezier points when + // creating a freehand line. + // Default = 10 Pixel + sal_uInt16 GetFreeHandMinDistPix() const { return sal_uInt16(nFreeHandMinDistPix); } + + // FIXME: Whoever wants to keep the Create Interface for the PathObj which is + // incompatible with the rest of the Create functionality of SvDraw, needs + // to set the following flag. It affects the following object types: + // OBJ_POLY, OBJ_PLIN, OBJ_PATHLINE, OBJ_PATHFILL + + // This flag should be regarded as temporary. The affected applications should + // be changed soon. + // Default = sal_False; + bool IsUseIncompatiblePathCreateInterface() const { return bUseIncompatiblePathCreateInterface; } + void SetUseIncompatiblePathCreateInterface(bool bOn) { bUseIncompatiblePathCreateInterface = bOn; } + void SetConnectMarker(const SdrObjConnection& rCon); + void HideConnectMarker(); + + // Attributes of the object that is in the process of being created + /* new interface src537 */ + void GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr) const; + + bool SetAttributes(const SfxItemSet& rSet, bool bReplaceAll); + SfxStyleSheet* GetStyleSheet() const; // SfxStyleSheet* GetStyleSheet(bool& rOk) const; + void SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr); +}; + +#endif // INCLUDED_SVX_SVDCRTV_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svddef.hxx b/include/svx/svddef.hxx new file mode 100644 index 000000000..3b56f691c --- /dev/null +++ b/include/svx/svddef.hxx @@ -0,0 +1,432 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVDDEF_HXX +#define INCLUDED_SVX_SVDDEF_HXX + +#include +#include + +/*************************************************************************/ +// SdrItemPool V2, 09-11-1995: +// 7 new Items for XLineAttrSetItem +// 7 new Items for XFillAttrSetItem +// 8 new Items for SdrShadowSetItem +// 5 new Items for SdrCaptionSetItem +// 25 new Items for SdrMiscSetItem +// 6 new Items for SdrNotPersist +// SdrItemPool V3, 29-02-1996 +// 17 new Items for XFillAttrSetItem (Bitmapfill) +// SdrItemPool V4, 10-08-1996 +// 45 new Items for Edge and Measure (Connector and Measuring object) +// SdrItemPool V4+, 18-10-1996 +// 8 new Items for CircItems +// 18 new Items for NotPersist + Refactoring there +// SdrItemPool V4++, 13-11-1996 +// 2 new Items for NotPersist+(MoveX/Y) +// SdrItemPool V4+++, 07-06-1999 +// 15 new Items for NotPersist (Reserve) +// 15 new Items for GrafItems + +// WhichMapping: +// V1 Range = 1000..1065 (66) +// V2 Range = 1000..1123 (124) (58 new Whiches) +// V3 Range = 1000..1140 (141) (17 new Whiches) +// V4 Range = 1000..1185 (186) (45 new Whiches) +// Map V2: 10 6 20 4 11 6 9 +// V1: 1000..1009, 1010..1015, 1016..1035, 1036..1039, 1040..1050, 1051..1056 1057..1065 +// V2: 1000..1009, 1017..1022, 1030..1049, 1050..1053, 1062..1072, 1078..1083, 1109..1117, and 6 new ones appended at the end +// |<------------ XOut ------------>| |<----------- SvDraw -----------> +// Map V3: +// V2: 1000..1029, 1030..1123 +// V3: 1000..1029, 1047..1140 +// Map V4: +// V3: 1000..1126, 1127..1140 +// V4: 1000..1126, 1172..1185 + +class SdrAllPositionXItem; +class SdrAllPositionYItem; +class SdrAllSizeHeightItem; +class SdrAllSizeWidthItem; +class SdrAngleItem; +class SdrCaptionEscAbsItem; +class SdrCaptionEscDirItem; +class SdrCaptionEscIsRelItem; +class SdrCaptionEscRelItem; +class SdrCaptionFitLineLenItem; +class SdrCaptionLineLenItem; +class SdrCaptionTypeItem; +class SdrCircKindItem; +class SdrCustomShapeGeometryItem; +class SdrEdgeKindItem; +class SdrEdgeLineDeltaCountItem; +class SdrEdgeNode1GlueDistItem; +class SdrEdgeNode1HorzDistItem; +class SdrEdgeNode1VertDistItem; +class SdrEdgeNode2GlueDistItem; +class SdrEdgeNode2HorzDistItem; +class SdrEdgeNode2VertDistItem; +class SdrGrafBlueItem; +class SdrGrafContrastItem; +class SdrGrafCropItem; +class SdrGrafGamma100Item; +class SdrGrafGreenItem; +class SdrGrafInvertItem; +class SdrGrafLuminanceItem; +class SdrGrafModeItem; +class SdrGrafRedItem; +class SdrGrafTransparenceItem; +class SdrHorzShearAllItem; +class SdrHorzShearOneItem; +class SdrLayerIdItem; +class SdrLayerNameItem; +class SdrLogicSizeHeightItem; +class SdrLogicSizeWidthItem; +class SdrMeasureBelowRefEdgeItem; +class SdrMeasureDecimalPlacesItem; +class SdrMeasureFormatStringItem; +class SdrMeasureKindItem; +class SdrMeasureOverhangItem; +class SdrMeasureTextAutoAngleItem; +class SdrMeasureTextFixedAngleItem; +class SdrMeasureTextHPosItem; +class SdrMeasureTextIsFixedAngleItem; +class SdrMeasureTextRota90Item; +class SdrMeasureTextVPosItem; +class SdrMeasureUnitItem; +class SdrMetricItem; +class SdrMoveXItem; +class SdrMoveYItem; +class SdrObjPrintableItem; +class SdrObjVisibleItem; +class SdrOnOffItem; +class SdrOnePositionXItem; +class SdrOnePositionYItem; +class SdrOneSizeHeightItem; +class SdrOneSizeWidthItem; +class SdrPercentItem; +class SdrResizeXAllItem; +class SdrResizeXOneItem; +class SdrResizeYAllItem; +class SdrResizeYOneItem; +class SdrRotateOneItem; +class SdrShearAngleItem; +class SdrTextFitToSizeTypeItem; +class SdrTextFixedCellHeightItem; +class SdrTextVertAdjustItem; +class SdrTransformRef1XItem; +class SdrTransformRef1YItem; +class SdrTransformRef2XItem; +class SdrTransformRef2YItem; +class SdrVertShearAllItem; +class SdrVertShearOneItem; +class SdrYesNoItem; +class SfxBoolItem; +class SfxUInt16Item; +class SfxUInt32Item; +class SfxStringItem; +class SfxVoidItem; +class Svx3DCharacterModeItem; +class Svx3DCloseBackItem; +class Svx3DCloseFrontItem; +class Svx3DNormalsKindItem; +class Svx3DPerspectiveItem; +class Svx3DReducedLineGeometryItem; +class Svx3DShadeModeItem; +class Svx3DSmoothLidsItem; +class Svx3DSmoothNormalsItem; +class Svx3DTextureProjectionXItem; +class Svx3DTextureProjectionYItem; +class SvxB3DVectorItem; +class SvxBoxInfoItem; +class SvxBoxItem; +class SvxColorItem; +class SvxLineItem; +class SvxTextRotateItem; +class SvxWritingModeItem; +class XColorItem; +class SdrTextAniDirectionItem; +class SdrTextAniKindItem; +class SdrTextHorzAdjustItem; +class SdrTextAniAmountItem; +class SdrTextAniCountItem; +class SdrTextAniStartInsideItem; +class SdrTextAniStopInsideItem; +class SdrTextAniDelayItem; +class SdrMeasureScaleItem; +class SdrRotateAllItem; +class Svx3DTextureKindItem; +class Svx3DTextureModeItem; +class SvXMLAttrContainerItem; + +constexpr sal_uInt16 SDRATTR_START (XATTR_START); /* 1000 */ + /* Pool V4*/ /* Pool V3*/ /* Pool V2*/ +constexpr sal_uInt16 SDRATTR_SHADOW_FIRST (XATTR_END + 1); /* 1067 */ /* 1067 */ /* 1050 */ /* Pool V1: 1036 */ +constexpr TypedWhichId SDRATTR_SHADOW (SDRATTR_SHADOW_FIRST+ 0); /* 1067 */ /* 1067 */ /* 1050 */ +constexpr TypedWhichId SDRATTR_SHADOWCOLOR (SDRATTR_SHADOW_FIRST+ 1); /* 1068 */ /* 1068 */ /* 1051 */ +constexpr TypedWhichId SDRATTR_SHADOWXDIST (SDRATTR_SHADOW_FIRST+ 2); /* 1069 */ /* 1069 */ /* 1052 */ +constexpr TypedWhichId SDRATTR_SHADOWYDIST (SDRATTR_SHADOW_FIRST+ 3); /* 1070 */ /* 1070 */ /* 1053 */ +constexpr TypedWhichId SDRATTR_SHADOWTRANSPARENCE (SDRATTR_SHADOW_FIRST+ 4); /* 1071 */ /* 1071 */ /* 1054 */ /* Pool V2 */ +constexpr TypedWhichId SDRATTR_SHADOW3D (SDRATTR_SHADOW_FIRST+ 5); /* 1072 */ /* 1072 */ /* 1055 */ /* Pool V2 */ +constexpr TypedWhichId SDRATTR_SHADOWPERSP (SDRATTR_SHADOW_FIRST+ 6); /* 1073 */ /* 1073 */ /* 1056 */ /* Pool V2 */ +constexpr TypedWhichId SDRATTR_SHADOWSIZEX (SDRATTR_SHADOW_FIRST+ 7); +constexpr TypedWhichId SDRATTR_SHADOWSIZEY (SDRATTR_SHADOW_FIRST+ 8); +constexpr sal_uInt16 SDRATTR_SHADOW_LAST (SDRATTR_SHADOWSIZEY); /* 1078 */ /* 1078 */ /* 1061 */ /* Pool V1: 1039 */ + +constexpr sal_uInt16 SDRATTR_CAPTION_FIRST (SDRATTR_SHADOW_LAST + 1); /* 1080 */ /* 1080 */ /* 1063 */ /* Pool V1: 1041 */ +constexpr TypedWhichId SDRATTR_CAPTIONTYPE (SDRATTR_CAPTION_FIRST+ 0); /* 1080 */ /* 1080 */ /* 1063 */ +constexpr TypedWhichId SDRATTR_CAPTIONFIXEDANGLE (SDRATTR_CAPTION_FIRST+ 1); /* 1081 */ /* 1081 */ /* 1064 */ +constexpr TypedWhichId SDRATTR_CAPTIONANGLE (SDRATTR_CAPTION_FIRST+ 2); /* 1082 */ /* 1082 */ /* 1065 */ +constexpr TypedWhichId SDRATTR_CAPTIONGAP (SDRATTR_CAPTION_FIRST+ 3); /* 1083 */ /* 1083 */ /* 1066 */ +constexpr TypedWhichId SDRATTR_CAPTIONESCDIR (SDRATTR_CAPTION_FIRST+ 4); /* 1084 */ /* 1084 */ /* 1067 */ +constexpr TypedWhichId SDRATTR_CAPTIONESCISREL (SDRATTR_CAPTION_FIRST+ 5); /* 1085 */ /* 1085 */ /* 1068 */ +constexpr TypedWhichId SDRATTR_CAPTIONESCREL (SDRATTR_CAPTION_FIRST+ 6); /* 1086 */ /* 1086 */ /* 1069 */ +constexpr TypedWhichId SDRATTR_CAPTIONESCABS (SDRATTR_CAPTION_FIRST+ 7); /* 1087 */ /* 1087 */ /* 1070 */ +constexpr TypedWhichId SDRATTR_CAPTIONLINELEN (SDRATTR_CAPTION_FIRST+ 8); /* 1088 */ /* 1088 */ /* 1071 */ +constexpr TypedWhichId SDRATTR_CAPTIONFITLINELEN (SDRATTR_CAPTION_FIRST+ 9); /* 1089 */ /* 1089 */ /* 1072 */ +constexpr sal_uInt16 SDRATTR_CAPTION_LAST (SDRATTR_CAPTIONFITLINELEN); /* 1094 */ /* 1094 */ /* 1077 */ /* Pool V1: 1050 */ + +constexpr sal_uInt16 SDRATTR_MISC_FIRST (SDRATTR_CAPTION_LAST + 1); /* 1097 */ /* 1097 */ /* 1080 */ /* Pool V1: 1053 */ +constexpr TypedWhichId SDRATTR_ECKENRADIUS (SDRATTR_MISC_FIRST + 0); /* 1097 */ /* 1097 */ /* 1080 long, def=0 */ +constexpr TypedWhichId SDRATTR_TEXT_MINFRAMEHEIGHT (SDRATTR_MISC_FIRST + 1); /* 1098 */ /* 1098 */ /* 1081 long, def=0 */ +constexpr TypedWhichId SDRATTR_TEXT_AUTOGROWHEIGHT (SDRATTR_MISC_FIRST + 2); /* 1099 */ /* 1099 */ /* 1082 sal_Bool, def=sal_True */ +constexpr TypedWhichId SDRATTR_TEXT_FITTOSIZE (SDRATTR_MISC_FIRST + 3); /* 1100 */ /* 1100 */ /* 1083 enum, def=css::drawing::TextFitToSizeType_NONE */ +constexpr TypedWhichId SDRATTR_TEXT_LEFTDIST (SDRATTR_MISC_FIRST + 4); /* 1101 */ /* 1101 */ /* 1084 long, def=0 */ /* Pool V2 */ +constexpr TypedWhichId SDRATTR_TEXT_RIGHTDIST (SDRATTR_MISC_FIRST + 5); /* 1102 */ /* 1102 */ /* 1085 long, def=0 */ /* Pool V2 */ +constexpr TypedWhichId SDRATTR_TEXT_UPPERDIST (SDRATTR_MISC_FIRST + 6); /* 1103 */ /* 1103 */ /* 1086 long, def=0 */ /* Pool V2 */ +constexpr TypedWhichId SDRATTR_TEXT_LOWERDIST (SDRATTR_MISC_FIRST + 7); /* 1104 */ /* 1104 */ /* 1087 long, def=0 */ /* Pool V2 */ +constexpr TypedWhichId SDRATTR_TEXT_VERTADJUST (SDRATTR_MISC_FIRST + 8); /* 1105 */ /* 1105 */ /* 1088 enum, def=SDRTEXTVERTADJUST_TOP */ /* Pool V2 */ +constexpr TypedWhichId SDRATTR_TEXT_MAXFRAMEHEIGHT (SDRATTR_MISC_FIRST + 9); /* 1106 */ /* 1106 */ /* 1089 long, def=0 - Pool V2 */ +constexpr TypedWhichId SDRATTR_TEXT_MINFRAMEWIDTH (SDRATTR_MISC_FIRST +10); /* 1107 */ /* 1107 */ /* 1090 long, def=0 - Pool V2 */ +constexpr TypedWhichId SDRATTR_TEXT_MAXFRAMEWIDTH (SDRATTR_MISC_FIRST +11); /* 1108 */ /* 1108 */ /* 1091 long, def=0 - Pool V2 */ +constexpr TypedWhichId SDRATTR_TEXT_AUTOGROWWIDTH (SDRATTR_MISC_FIRST +12); /* 1109 */ /* 1109 */ /* 1092 sal_Bool, def=sal_False - Pool V2 */ +constexpr TypedWhichId SDRATTR_TEXT_HORZADJUST (SDRATTR_MISC_FIRST +13); /* 1110 */ /* 1110 */ /* 1093 enum, def=SDRTEXTHORZADJUST_LEFT */ /* Pool V2+ (04-12-1995) */ +constexpr TypedWhichId SDRATTR_TEXT_ANIKIND (SDRATTR_MISC_FIRST +14); /* 1111 */ /* 1111 */ /* 1094 enum, def=SdrTextAniKind::NONE - Pool V2/V4 */ +constexpr TypedWhichId SDRATTR_TEXT_ANIDIRECTION (SDRATTR_MISC_FIRST +15); /* 1112 */ /* 1112 */ /* 1095 enum, def=SdrTextAniDirection::Left - Pool V2/V4 */ +constexpr TypedWhichId SDRATTR_TEXT_ANISTARTINSIDE (SDRATTR_MISC_FIRST +16); /* 1113 */ /* 1113 */ /* 1096 sal_Bool, def=sal_False - Pool V2/V4 */ +constexpr TypedWhichId SDRATTR_TEXT_ANISTOPINSIDE (SDRATTR_MISC_FIRST +17); /* 1114 */ /* 1114 */ /* 1097 sal_Bool, def=sal_False - Pool V2/V4 */ +constexpr TypedWhichId SDRATTR_TEXT_ANICOUNT (SDRATTR_MISC_FIRST +18); /* 1115 */ /* 1115 */ /* 1098 sal_uInt16, def=0 - Pool V2/V4 */ +constexpr TypedWhichId SDRATTR_TEXT_ANIDELAY (SDRATTR_MISC_FIRST +19); /* 1116 */ /* 1116 */ /* 1099 sal_uInt16, def=0 - Pool V2/V4 */ +constexpr TypedWhichId SDRATTR_TEXT_ANIAMOUNT (SDRATTR_MISC_FIRST +20); /* 1117 */ /* 1117 */ /* 1100 sal_uInt16, def=0 - Pool V2/V4 */ +constexpr TypedWhichId SDRATTR_TEXT_CONTOURFRAME (SDRATTR_MISC_FIRST +21); /* 1118 */ /* 1118 */ /* 1101 */ /* Pool V2 */ +constexpr TypedWhichId SDRATTR_XMLATTRIBUTES (SDRATTR_MISC_FIRST +22); /* 1120 */ /* 1120 */ /* 1103 */ /* Pool V2 */ +constexpr TypedWhichId SDRATTR_TEXT_USEFIXEDCELLHEIGHT (SDRATTR_MISC_FIRST +23); /* 1121 */ /* 1121 */ /* 1104 */ /* Pool V2 */ +constexpr TypedWhichId SDRATTR_TEXT_WORDWRAP (SDRATTR_MISC_FIRST +24); /* 1122 */ /* 1122 */ /* 1105 */ /* Pool V2 */ +constexpr TypedWhichId SDRATTR_TEXT_CHAINNEXTNAME (SDRATTR_MISC_FIRST +25); /* 1123 */ /* 1123 */ /* 1106 */ /* Pool V2 */ +constexpr sal_uInt16 SDRATTR_MISC_LAST (SDRATTR_TEXT_CHAINNEXTNAME); /* 1125 */ /* 1125 */ /* 1108 */ /* Pool V1: 1056 */ + +constexpr sal_uInt16 SDRATTR_EDGE_FIRST (SDRATTR_MISC_LAST + 1); /* 1127 */ /* Pool V4 */ +constexpr TypedWhichId SDRATTR_EDGEKIND (SDRATTR_EDGE_FIRST + 0); /* 1127 */ /* Pool V4 */ +constexpr TypedWhichId SDRATTR_EDGENODE1HORZDIST (SDRATTR_EDGE_FIRST + 1); /* 1128 */ /* Pool V4 */ +constexpr TypedWhichId SDRATTR_EDGENODE1VERTDIST (SDRATTR_EDGE_FIRST + 2); /* 1129 */ /* Pool V4 */ +constexpr TypedWhichId SDRATTR_EDGENODE2HORZDIST (SDRATTR_EDGE_FIRST + 3); /* 1130 */ /* Pool V4 */ +constexpr TypedWhichId SDRATTR_EDGENODE2VERTDIST (SDRATTR_EDGE_FIRST + 4); /* 1131 */ /* Pool V4 */ +constexpr TypedWhichId SDRATTR_EDGENODE1GLUEDIST (SDRATTR_EDGE_FIRST + 5); /* 1132 */ /* Pool V4 */ +constexpr TypedWhichId SDRATTR_EDGENODE2GLUEDIST (SDRATTR_EDGE_FIRST + 6); /* 1133 */ /* Pool V4 */ +constexpr TypedWhichId SDRATTR_EDGELINEDELTACOUNT (SDRATTR_EDGE_FIRST + 7); /* 1134 */ /* Pool V4 */ +constexpr TypedWhichId SDRATTR_EDGELINE1DELTA (SDRATTR_EDGE_FIRST + 8); /* 1135 */ /* Pool V4 */ +constexpr TypedWhichId SDRATTR_EDGELINE2DELTA (SDRATTR_EDGE_FIRST + 9); /* 1136 */ /* Pool V4 */ +constexpr TypedWhichId SDRATTR_EDGELINE3DELTA (SDRATTR_EDGE_FIRST +10); /* 1137 */ /* Pool V4 */ +constexpr sal_uInt16 SDRATTR_EDGE_LAST (SDRATTR_EDGELINE3DELTA); /* 1145 */ /* Pool V4 */ + +constexpr sal_uInt16 SDRATTR_MEASURE_FIRST (SDRATTR_EDGE_LAST + 1); /* 1147 */ /* Pool V4 */ +constexpr TypedWhichId SDRATTR_MEASUREKIND (SDRATTR_MEASURE_FIRST+ 0); /* 1147 */ /* Pool V4 */ +constexpr TypedWhichId SDRATTR_MEASURETEXTHPOS (SDRATTR_MEASURE_FIRST+ 1); /* 1148 */ /* Pool V4 */ +constexpr TypedWhichId SDRATTR_MEASURETEXTVPOS (SDRATTR_MEASURE_FIRST+ 2); /* 1149 */ /* Pool V4 */ +constexpr TypedWhichId SDRATTR_MEASURELINEDIST (SDRATTR_MEASURE_FIRST+ 3); /* 1150 */ /* Pool V4 */ +constexpr TypedWhichId SDRATTR_MEASUREHELPLINEOVERHANG (SDRATTR_MEASURE_FIRST+ 4); /* 1151 */ /* Pool V4 */ +constexpr TypedWhichId SDRATTR_MEASUREHELPLINEDIST (SDRATTR_MEASURE_FIRST+ 5); /* 1152 */ /* Pool V4 */ +constexpr TypedWhichId SDRATTR_MEASUREHELPLINE1LEN (SDRATTR_MEASURE_FIRST+ 6); /* 1153 */ /* Pool V4 */ +constexpr TypedWhichId SDRATTR_MEASUREHELPLINE2LEN (SDRATTR_MEASURE_FIRST+ 7); /* 1154 */ /* Pool V4 */ +constexpr TypedWhichId SDRATTR_MEASUREBELOWREFEDGE (SDRATTR_MEASURE_FIRST+ 8); /* 1155 */ /* Pool V4 */ +constexpr TypedWhichId SDRATTR_MEASURETEXTROTA90 (SDRATTR_MEASURE_FIRST+ 9); /* 1156 */ /* Pool V4 */ +constexpr TypedWhichId SDRATTR_MEASURETEXTUPSIDEDOWN (SDRATTR_MEASURE_FIRST+10); /* 1157 */ /* Pool V4 */ +constexpr TypedWhichId SDRATTR_MEASUREOVERHANG (SDRATTR_MEASURE_FIRST+11); /* 1158 */ /* Pool V4 */ +constexpr TypedWhichId SDRATTR_MEASUREUNIT (SDRATTR_MEASURE_FIRST+12); /* 1159 */ /* Pool V4 */ +constexpr TypedWhichId SDRATTR_MEASURESCALE (SDRATTR_MEASURE_FIRST+13); /* 1160 */ /* Pool V4 */ +constexpr TypedWhichId SDRATTR_MEASURESHOWUNIT (SDRATTR_MEASURE_FIRST+14); /* 1161 */ /* Pool V4 */ +constexpr TypedWhichId SDRATTR_MEASUREFORMATSTRING (SDRATTR_MEASURE_FIRST+15); /* 1162 */ /* Pool V4 */ +constexpr TypedWhichId SDRATTR_MEASURETEXTAUTOANGLE (SDRATTR_MEASURE_FIRST+16); /* 1163 */ /* Pool V4, Correction 25-9-1996 */ +constexpr TypedWhichId SDRATTR_MEASURETEXTAUTOANGLEVIEW (SDRATTR_MEASURE_FIRST+17); /* 1164 */ /* Pool V4, Correction 25-9-1996 */ +constexpr TypedWhichId SDRATTR_MEASURETEXTISFIXEDANGLE (SDRATTR_MEASURE_FIRST+18); /* 1165 */ /* Pool V4, Correction 25-9-1996 */ +constexpr TypedWhichId SDRATTR_MEASURETEXTFIXEDANGLE (SDRATTR_MEASURE_FIRST+19); /* 1166 */ /* Pool V4, Correction 25-9-1996 */ +constexpr TypedWhichId SDRATTR_MEASUREDECIMALPLACES (SDRATTR_MEASURE_FIRST+20); /* 1167 */ /* Pool V4 */ +constexpr sal_uInt16 SDRATTR_MEASURE_LAST (SDRATTR_MEASUREDECIMALPLACES); /* 1170 */ /* Pool V4 */ + +constexpr sal_uInt16 SDRATTR_CIRC_FIRST (SDRATTR_MEASURE_LAST+ 1); /* 1172 */ /* Pool V4+ */ +constexpr TypedWhichId SDRATTR_CIRCKIND (SDRATTR_CIRC_FIRST+ 0); /* 1172 */ /* Pool V4+ */ +constexpr TypedWhichId SDRATTR_CIRCSTARTANGLE (SDRATTR_CIRC_FIRST+ 1); /* 1173 */ /* Pool V4+ */ +constexpr TypedWhichId SDRATTR_CIRCENDANGLE (SDRATTR_CIRC_FIRST+ 2); /* 1174 */ /* Pool V4+ */ +constexpr sal_uInt16 SDRATTR_CIRC_LAST (SDRATTR_CIRCENDANGLE); /* 1178 */ /* Pool V4+ */ + +// Only for Interfacing, not yet implemented. / * + * V4 / +constexpr sal_uInt16 SDRATTR_NOTPERSIST_FIRST (SDRATTR_CIRC_LAST + 1); /* 1180 */ /* 1172 */ /* 1127 */ /* 1110 */ /* Pool V1: 1058 */ +constexpr TypedWhichId SDRATTR_OBJMOVEPROTECT (SDRATTR_NOTPERSIST_FIRST+ 0); /* 1180 sal_Bool, def=sal_False */ +constexpr TypedWhichId SDRATTR_OBJSIZEPROTECT (SDRATTR_NOTPERSIST_FIRST+ 1); /* 1181 sal_Bool, def=sal_False */ +constexpr TypedWhichId SDRATTR_OBJPRINTABLE (SDRATTR_NOTPERSIST_FIRST+ 2); /* 1182 sal_Bool, def=sal_True */ +constexpr TypedWhichId SDRATTR_LAYERID (SDRATTR_NOTPERSIST_FIRST+ 3); /* 1183 sal_uInt16, def=0 */ +constexpr TypedWhichId SDRATTR_LAYERNAME (SDRATTR_NOTPERSIST_FIRST+ 4); /* 1184 String, def="" */ +constexpr TypedWhichId SDRATTR_OBJECTNAME (SDRATTR_NOTPERSIST_FIRST+ 5); /* 1185 String, def="" */ +constexpr TypedWhichId SDRATTR_ALLPOSITIONX (SDRATTR_NOTPERSIST_FIRST+ 6); /* 1186 long, def=0 */ +constexpr TypedWhichId SDRATTR_ALLPOSITIONY (SDRATTR_NOTPERSIST_FIRST+ 7); /* 1187 long, def=0 */ +constexpr TypedWhichId SDRATTR_ALLSIZEWIDTH (SDRATTR_NOTPERSIST_FIRST+ 8); /* 1188 long, def=0 */ +constexpr TypedWhichId SDRATTR_ALLSIZEHEIGHT (SDRATTR_NOTPERSIST_FIRST+ 9); /* 1189 long, def=0 */ +constexpr TypedWhichId SDRATTR_ONEPOSITIONX (SDRATTR_NOTPERSIST_FIRST+10); /* 1190 long, def=0 */ +constexpr TypedWhichId SDRATTR_ONEPOSITIONY (SDRATTR_NOTPERSIST_FIRST+11); /* 1191 long, def=0 */ +constexpr TypedWhichId SDRATTR_ONESIZEWIDTH (SDRATTR_NOTPERSIST_FIRST+12); /* 1192 long, def=0 */ +constexpr TypedWhichId SDRATTR_ONESIZEHEIGHT (SDRATTR_NOTPERSIST_FIRST+13); /* 1193 long, def=0 */ +constexpr TypedWhichId SDRATTR_LOGICSIZEWIDTH (SDRATTR_NOTPERSIST_FIRST+14); /* 1194 long, def=0 */ +constexpr TypedWhichId SDRATTR_LOGICSIZEHEIGHT (SDRATTR_NOTPERSIST_FIRST+15); /* 1195 long, def=0 */ +constexpr TypedWhichId SDRATTR_ROTATEANGLE (SDRATTR_NOTPERSIST_FIRST+16); /* 1196 long, def=0 */ +constexpr TypedWhichId SDRATTR_SHEARANGLE (SDRATTR_NOTPERSIST_FIRST+17); /* 1197 long, def=0 */ +constexpr TypedWhichId SDRATTR_MOVEX (SDRATTR_NOTPERSIST_FIRST+18); /* 1198 long, def=0 */ +constexpr TypedWhichId SDRATTR_MOVEY (SDRATTR_NOTPERSIST_FIRST+19); /* 1199 long, def=0 */ +constexpr TypedWhichId SDRATTR_RESIZEXONE (SDRATTR_NOTPERSIST_FIRST+20); /* 1200 long, def=0 */ +constexpr TypedWhichId SDRATTR_RESIZEYONE (SDRATTR_NOTPERSIST_FIRST+21); /* 1201 long, def=0 */ +constexpr TypedWhichId SDRATTR_ROTATEONE (SDRATTR_NOTPERSIST_FIRST+22); /* 1202 long, def=0 */ +constexpr TypedWhichId SDRATTR_HORZSHEARONE (SDRATTR_NOTPERSIST_FIRST+23); /* 1203 long, def=0 */ +constexpr TypedWhichId SDRATTR_VERTSHEARONE (SDRATTR_NOTPERSIST_FIRST+24); /* 1204 long, def=0 */ +constexpr TypedWhichId SDRATTR_RESIZEXALL (SDRATTR_NOTPERSIST_FIRST+25); /* 1205 long, def=0 */ +constexpr TypedWhichId SDRATTR_RESIZEYALL (SDRATTR_NOTPERSIST_FIRST+26); /* 1206 long, def=0 */ +constexpr TypedWhichId SDRATTR_ROTATEALL (SDRATTR_NOTPERSIST_FIRST+27); /* 1207 long, def=0 */ +constexpr TypedWhichId SDRATTR_HORZSHEARALL (SDRATTR_NOTPERSIST_FIRST+28); /* 1208 long, def=0 */ +constexpr TypedWhichId SDRATTR_VERTSHEARALL (SDRATTR_NOTPERSIST_FIRST+29); /* 1209 long, def=0 */ +constexpr TypedWhichId SDRATTR_TRANSFORMREF1X (SDRATTR_NOTPERSIST_FIRST+30); /* 1210 long, def=0 */ +constexpr TypedWhichId SDRATTR_TRANSFORMREF1Y (SDRATTR_NOTPERSIST_FIRST+31); /* 1211 long, def=0 */ +constexpr TypedWhichId SDRATTR_TRANSFORMREF2X (SDRATTR_NOTPERSIST_FIRST+32); /* 1212 long, def=0 */ +constexpr TypedWhichId SDRATTR_TRANSFORMREF2Y (SDRATTR_NOTPERSIST_FIRST+33); /* 1213 long, def=0 */ +constexpr TypedWhichId SDRATTR_TEXTDIRECTION (SDRATTR_NOTPERSIST_FIRST+34); /* 1214 V4+++ long, def=0 */ +constexpr TypedWhichId SDRATTR_OBJVISIBLE (SDRATTR_NOTPERSIST_FIRST+35); +constexpr sal_uInt16 SDRATTR_NOTPERSIST_LAST (SDRATTR_OBJVISIBLE); /* 1228 V4+++*/ /* 1213*/ /* 1085 */ /* 1040 */ /* 1123 */ /* Pool V1: 1065 */ +// no SetItem for this + +constexpr sal_uInt16 SDRATTR_GRAF_FIRST (SDRATTR_NOTPERSIST_LAST+1); /* 1229 V4+++*/ +constexpr TypedWhichId SDRATTR_GRAFRED (SDRATTR_GRAF_FIRST+0); /* 1229 V4+++*/ +constexpr TypedWhichId SDRATTR_GRAFGREEN (SDRATTR_GRAF_FIRST+1); /* 1230 V4+++*/ +constexpr TypedWhichId SDRATTR_GRAFBLUE (SDRATTR_GRAF_FIRST+2); /* 1231 V4+++*/ +constexpr TypedWhichId SDRATTR_GRAFLUMINANCE (SDRATTR_GRAF_FIRST+3); /* 1232 V4+++*/ +constexpr TypedWhichId SDRATTR_GRAFCONTRAST (SDRATTR_GRAF_FIRST+4); /* 1233 V4+++*/ +constexpr TypedWhichId SDRATTR_GRAFGAMMA (SDRATTR_GRAF_FIRST+5); /* 1234 V4+++*/ +constexpr TypedWhichId SDRATTR_GRAFTRANSPARENCE (SDRATTR_GRAF_FIRST+6); /* 1235 V4+++*/ +constexpr TypedWhichId SDRATTR_GRAFINVERT (SDRATTR_GRAF_FIRST+7); /* 1236 V4+++*/ +constexpr TypedWhichId SDRATTR_GRAFMODE (SDRATTR_GRAF_FIRST+8); /* 1237 V4+++*/ +constexpr TypedWhichId SDRATTR_GRAFCROP (SDRATTR_GRAF_FIRST+9); /* 1238 V4+++*/ +constexpr sal_uInt16 SDRATTR_GRAF_LAST (SDRATTR_GRAFCROP); /* 1242 V4+++*/ + +constexpr sal_uInt16 SDRATTR_3D_FIRST (SDRATTR_GRAF_LAST + 1); /* 1244 V4+++*/ + +constexpr sal_uInt16 SDRATTR_3DOBJ_FIRST (SDRATTR_3D_FIRST); /* 1244 V4+++*/ +constexpr TypedWhichId SDRATTR_3DOBJ_PERCENT_DIAGONAL (SDRATTR_3DOBJ_FIRST + 0); /* 1244 V4+++*/ +constexpr TypedWhichId SDRATTR_3DOBJ_BACKSCALE (SDRATTR_3DOBJ_FIRST + 1); /* 1245 V4+++*/ +constexpr TypedWhichId SDRATTR_3DOBJ_DEPTH (SDRATTR_3DOBJ_FIRST + 2); /* 1246 V4+++*/ +constexpr TypedWhichId SDRATTR_3DOBJ_HORZ_SEGS (SDRATTR_3DOBJ_FIRST + 3); /* 1247 V4+++*/ +constexpr TypedWhichId SDRATTR_3DOBJ_VERT_SEGS (SDRATTR_3DOBJ_FIRST + 4); /* 1248 V4+++*/ +constexpr TypedWhichId SDRATTR_3DOBJ_END_ANGLE (SDRATTR_3DOBJ_FIRST + 5); /* 1249 V4+++*/ +constexpr TypedWhichId SDRATTR_3DOBJ_DOUBLE_SIDED (SDRATTR_3DOBJ_FIRST + 6); /* 1250 V4+++*/ +constexpr TypedWhichId SDRATTR_3DOBJ_NORMALS_KIND (SDRATTR_3DOBJ_FIRST + 7); /* 1251 V4+++*/ +constexpr TypedWhichId SDRATTR_3DOBJ_NORMALS_INVERT (SDRATTR_3DOBJ_FIRST + 8); /* 1252 V4+++*/ +constexpr TypedWhichId SDRATTR_3DOBJ_TEXTURE_PROJ_X (SDRATTR_3DOBJ_FIRST + 9); /* 1253 V4+++*/ +constexpr TypedWhichId SDRATTR_3DOBJ_TEXTURE_PROJ_Y (SDRATTR_3DOBJ_FIRST + 10); /* 1254 V4+++*/ +constexpr TypedWhichId SDRATTR_3DOBJ_SHADOW_3D (SDRATTR_3DOBJ_FIRST + 11); /* 1255 V4+++*/ +constexpr TypedWhichId SDRATTR_3DOBJ_MAT_COLOR (SDRATTR_3DOBJ_FIRST + 12); /* 1256 V4+++*/ +constexpr TypedWhichId SDRATTR_3DOBJ_MAT_EMISSION (SDRATTR_3DOBJ_FIRST + 13); /* 1257 V4+++*/ +constexpr TypedWhichId SDRATTR_3DOBJ_MAT_SPECULAR (SDRATTR_3DOBJ_FIRST + 14); /* 1258 V4+++*/ +constexpr TypedWhichId SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY (SDRATTR_3DOBJ_FIRST + 15); /* 1259 V4+++*/ +constexpr TypedWhichId SDRATTR_3DOBJ_TEXTURE_KIND (SDRATTR_3DOBJ_FIRST + 16); /* 1260 V4+++*/ +constexpr TypedWhichId SDRATTR_3DOBJ_TEXTURE_MODE (SDRATTR_3DOBJ_FIRST + 17); /* 1261 V4+++*/ +constexpr TypedWhichId SDRATTR_3DOBJ_TEXTURE_FILTER (SDRATTR_3DOBJ_FIRST + 18); /* 1262 V4+++*/ + +// #107245# New items for 3d objects use former range SDRATTR_3DOBJ_RESERVED_01 +// up to SDRATTR_3DOBJ_RESERVED_05 +constexpr TypedWhichId SDRATTR_3DOBJ_SMOOTH_NORMALS (SDRATTR_3DOBJ_FIRST + 19); /* 1263 V4+++*/ +constexpr TypedWhichId SDRATTR_3DOBJ_SMOOTH_LIDS (SDRATTR_3DOBJ_FIRST + 20); /* 1264 V4+++*/ +constexpr TypedWhichId SDRATTR_3DOBJ_CHARACTER_MODE (SDRATTR_3DOBJ_FIRST + 21); /* 1265 V4+++*/ +constexpr TypedWhichId SDRATTR_3DOBJ_CLOSE_FRONT (SDRATTR_3DOBJ_FIRST + 22); /* 1266 V4+++*/ +constexpr TypedWhichId SDRATTR_3DOBJ_CLOSE_BACK (SDRATTR_3DOBJ_FIRST + 23); /* 1267 V4+++*/ + +// #i28528# +// Added extra Item (Bool) for chart2 to be able to show reduced line geometry +constexpr TypedWhichId SDRATTR_3DOBJ_REDUCED_LINE_GEOMETRY (SDRATTR_3DOBJ_FIRST + 24); /* 1268 V4+++*/ + +constexpr sal_uInt16 SDRATTR_3DOBJ_LAST (SDRATTR_3DOBJ_REDUCED_LINE_GEOMETRY); /* 1282 V4+++*/ + +constexpr sal_uInt16 SDRATTR_3DSCENE_FIRST (SDRATTR_3DOBJ_LAST + 1); /* 1283 V4+++*/ +constexpr TypedWhichId SDRATTR_3DSCENE_PERSPECTIVE (SDRATTR_3DSCENE_FIRST + 0); /* 1283 V4+++*/ +constexpr TypedWhichId SDRATTR_3DSCENE_DISTANCE (SDRATTR_3DSCENE_FIRST + 1); /* 1284 V4+++*/ +constexpr TypedWhichId SDRATTR_3DSCENE_FOCAL_LENGTH (SDRATTR_3DSCENE_FIRST + 2); /* 1285 V4+++*/ +constexpr TypedWhichId SDRATTR_3DSCENE_TWO_SIDED_LIGHTING (SDRATTR_3DSCENE_FIRST + 3); /* 1286 V4+++*/ +constexpr TypedWhichId SDRATTR_3DSCENE_LIGHTCOLOR_1 (SDRATTR_3DSCENE_FIRST + 4); /* 1287 V4+++*/ +constexpr TypedWhichId SDRATTR_3DSCENE_LIGHTCOLOR_2 (SDRATTR_3DSCENE_FIRST + 5); /* 1288 V4+++*/ +constexpr TypedWhichId SDRATTR_3DSCENE_LIGHTCOLOR_3 (SDRATTR_3DSCENE_FIRST + 6); /* 1289 V4+++*/ +constexpr TypedWhichId SDRATTR_3DSCENE_LIGHTCOLOR_4 (SDRATTR_3DSCENE_FIRST + 7); /* 1290 V4+++*/ +constexpr TypedWhichId SDRATTR_3DSCENE_LIGHTCOLOR_5 (SDRATTR_3DSCENE_FIRST + 8); /* 1291 V4+++*/ +constexpr TypedWhichId SDRATTR_3DSCENE_LIGHTCOLOR_6 (SDRATTR_3DSCENE_FIRST + 9); /* 1292 V4+++*/ +constexpr TypedWhichId SDRATTR_3DSCENE_LIGHTCOLOR_7 (SDRATTR_3DSCENE_FIRST + 10); /* 1293 V4+++*/ +constexpr TypedWhichId SDRATTR_3DSCENE_LIGHTCOLOR_8 (SDRATTR_3DSCENE_FIRST + 11); /* 1294 V4+++*/ +constexpr TypedWhichId SDRATTR_3DSCENE_AMBIENTCOLOR (SDRATTR_3DSCENE_FIRST + 12); /* 1295 V4+++*/ +constexpr TypedWhichId SDRATTR_3DSCENE_LIGHTON_1 (SDRATTR_3DSCENE_FIRST + 13); /* 1296 V4+++*/ +constexpr TypedWhichId SDRATTR_3DSCENE_LIGHTON_2 (SDRATTR_3DSCENE_FIRST + 14); /* 1297 V4+++*/ +constexpr TypedWhichId SDRATTR_3DSCENE_LIGHTON_3 (SDRATTR_3DSCENE_FIRST + 15); /* 1298 V4+++*/ +constexpr TypedWhichId SDRATTR_3DSCENE_LIGHTON_4 (SDRATTR_3DSCENE_FIRST + 16); /* 1299 V4+++*/ +constexpr TypedWhichId SDRATTR_3DSCENE_LIGHTON_5 (SDRATTR_3DSCENE_FIRST + 17); /* 1300 V4+++*/ +constexpr TypedWhichId SDRATTR_3DSCENE_LIGHTON_6 (SDRATTR_3DSCENE_FIRST + 18); /* 1301 V4+++*/ +constexpr TypedWhichId SDRATTR_3DSCENE_LIGHTON_7 (SDRATTR_3DSCENE_FIRST + 19); /* 1302 V4+++*/ +constexpr TypedWhichId SDRATTR_3DSCENE_LIGHTON_8 (SDRATTR_3DSCENE_FIRST + 20); /* 1303 V4+++*/ +constexpr TypedWhichId SDRATTR_3DSCENE_LIGHTDIRECTION_1 (SDRATTR_3DSCENE_FIRST + 21); /* 1304 V4+++*/ +constexpr TypedWhichId SDRATTR_3DSCENE_LIGHTDIRECTION_2 (SDRATTR_3DSCENE_FIRST + 22); /* 1305 V4+++*/ +constexpr TypedWhichId SDRATTR_3DSCENE_LIGHTDIRECTION_3 (SDRATTR_3DSCENE_FIRST + 23); /* 1306 V4+++*/ +constexpr TypedWhichId SDRATTR_3DSCENE_LIGHTDIRECTION_4 (SDRATTR_3DSCENE_FIRST + 24); /* 1307 V4+++*/ +constexpr TypedWhichId SDRATTR_3DSCENE_LIGHTDIRECTION_5 (SDRATTR_3DSCENE_FIRST + 25); /* 1308 V4+++*/ +constexpr TypedWhichId SDRATTR_3DSCENE_LIGHTDIRECTION_6 (SDRATTR_3DSCENE_FIRST + 26); /* 1309 V4+++*/ +constexpr TypedWhichId SDRATTR_3DSCENE_LIGHTDIRECTION_7 (SDRATTR_3DSCENE_FIRST + 27); /* 1310 V4+++*/ +constexpr TypedWhichId SDRATTR_3DSCENE_LIGHTDIRECTION_8 (SDRATTR_3DSCENE_FIRST + 28); /* 1311 V4+++*/ +constexpr TypedWhichId SDRATTR_3DSCENE_SHADOW_SLANT (SDRATTR_3DSCENE_FIRST + 29); /* 1312 V4+++*/ +constexpr TypedWhichId SDRATTR_3DSCENE_SHADE_MODE (SDRATTR_3DSCENE_FIRST + 30); /* 1313 V4+++*/ +constexpr sal_uInt16 SDRATTR_3DSCENE_LAST (SDRATTR_3DSCENE_SHADE_MODE); /* 1333 V4+++*/ +constexpr sal_uInt16 SDRATTR_3D_LAST (SDRATTR_3DSCENE_LAST); /* 1333 V4+++*/ + +constexpr sal_uInt16 SDRATTR_CUSTOMSHAPE_FIRST (SDRATTR_3D_LAST + 1); /* 1334 V4+++*/ +constexpr TypedWhichId SDRATTR_CUSTOMSHAPE_ENGINE (SDRATTR_CUSTOMSHAPE_FIRST + 0); /* 1334 V4+++*/ +constexpr TypedWhichId SDRATTR_CUSTOMSHAPE_DATA (SDRATTR_CUSTOMSHAPE_FIRST + 1); /* 1335 V4+++*/ +constexpr TypedWhichId SDRATTR_CUSTOMSHAPE_GEOMETRY (SDRATTR_CUSTOMSHAPE_FIRST + 2); /* 1336 V4+++*/ +constexpr sal_uInt16 SDRATTR_CUSTOMSHAPE_LAST (SDRATTR_CUSTOMSHAPE_GEOMETRY); /* 1357 V4+++*/ + +constexpr sal_uInt16 SDRATTR_TABLE_FIRST (SDRATTR_CUSTOMSHAPE_LAST+1); +constexpr TypedWhichId SDRATTR_TABLE_BORDER (SDRATTR_TABLE_FIRST+0); +constexpr TypedWhichId SDRATTR_TABLE_BORDER_INNER (SDRATTR_TABLE_FIRST+1); +constexpr TypedWhichId SDRATTR_TABLE_BORDER_TLBR (SDRATTR_TABLE_FIRST+2); +constexpr TypedWhichId SDRATTR_TABLE_BORDER_BLTR (SDRATTR_TABLE_FIRST+3); +constexpr TypedWhichId SDRATTR_TABLE_TEXT_ROTATION (SDRATTR_TABLE_FIRST+4); +constexpr sal_uInt16 SDRATTR_TABLE_LAST (SDRATTR_TABLE_TEXT_ROTATION); + +constexpr sal_uInt16 SDRATTR_GLOW_FIRST (SDRATTR_TABLE_LAST+1); +constexpr TypedWhichId SDRATTR_GLOW_RADIUS (SDRATTR_GLOW_FIRST+0); +constexpr TypedWhichId SDRATTR_GLOW_COLOR (SDRATTR_GLOW_FIRST+1); +constexpr TypedWhichId SDRATTR_GLOW_TRANSPARENCY(SDRATTR_GLOW_FIRST + 2); +constexpr sal_uInt16 SDRATTR_GLOW_LAST (SDRATTR_GLOW_TRANSPARENCY); + +constexpr sal_uInt16 SDRATTR_SOFTEDGE_FIRST(SDRATTR_GLOW_LAST + 1); +constexpr TypedWhichId SDRATTR_SOFTEDGE_RADIUS(SDRATTR_SOFTEDGE_FIRST + 0); +constexpr sal_uInt16 SDRATTR_SOFTEDGE_LAST(SDRATTR_SOFTEDGE_RADIUS); + +constexpr sal_uInt16 SDRATTR_END (SDRATTR_SOFTEDGE_LAST); /* 1357 */ /* 1333 V4+++*/ /* 1243 V4+++*/ /*1213*/ /*1085*/ /*1040*/ /*Pool V2: 1123,V1: 1065 */ + +#endif // INCLUDED_SVX_SVDDEF_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svddrag.hxx b/include/svx/svddrag.hxx new file mode 100644 index 000000000..0deef29e4 --- /dev/null +++ b/include/svx/svddrag.hxx @@ -0,0 +1,165 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVDDRAG_HXX +#define INCLUDED_SVX_SVDDRAG_HXX + + +#include +#include +#include + +#include +#include + +// Status information for specialized object dragging. In order for the model +// to stay status free, the status data is kept on the View +// and handed over to the object at the appropriate time as a parameter. +// This also includes the status of the operation and Interactive +// Object creation. In this case, pHdl is null. +class SdrHdl; +class SdrView; +class SdrPageView; +class SdrDragMethod; + +struct SdrDragStatUserData +{ + virtual ~SdrDragStatUserData() = 0; +}; + +class SVXCORE_DLLPUBLIC SdrDragStat final +{ + SdrHdl* pHdl; // The Handle for the User + SdrView* pView; + SdrPageView* pPageView; + std::vector mvPnts; // All previous Points: [0]=Start, [Count()-2]=Prev + Point aRef1; // Referencepoint: Resize fixed point, (axis of rotation, + Point aRef2; // axis of reflection, ...) + Point aPos0; // Position at the last Event + Point aRealNow; // Current dragging position without Snap, Ortho and Limit + tools::Rectangle aActionRect; + + bool bEndDragChangesAttributes; + bool bEndDragChangesGeoAndAttributes; + /// Table row drag: table will re-layout itself later. + bool mbEndDragChangesLayout; + bool bMouseIsUp; + + bool bShown; // Xor visible? + sal_uInt16 nMinMov; // So much has to be minimally moved first + bool bMinMoved; // MinMove surpassed? + + bool bHorFixed; // Dragging only vertical + bool bVerFixed; // Dragging only horizontal + bool bWantNoSnap; // To decide if pObj-> MovCreate () should use NoSnapPos or not. + // Therefore, NoSnapPos is written into the buffer. + bool bOrtho4; + bool bOrtho8; + + SdrDragMethod* pDragMethod; + std::unique_ptr mpUserData; // Userdata + + void Clear(); + + sal_Int32 GetPrevPos() const { return mvPnts.size()-(mvPnts.size()>1 ? 2 : 1); } + +public: + SdrDragStat() { Reset(); } + ~SdrDragStat(); + void Reset(); + SdrView* GetView() const { return pView; } + void SetView(SdrView* pV) { pView=pV; } + SdrPageView* GetPageView() const { return pPageView; } + void SetPageView(SdrPageView* pPV) { pPageView=pPV; } + const Point& GetPoint(sal_Int32 nNum) const { return mvPnts[nNum]; } + sal_Int32 GetPointCount() const { return mvPnts.size(); } + const Point& GetStart() const { return mvPnts[0]; } + const Point& GetPrev() const { return mvPnts[GetPrevPos()]; } + const Point& GetPos0() const { return aPos0; } + const Point& GetNow() const { return mvPnts.back(); } + void SetNow(Point const &pt) { mvPnts.back() = pt; } + const Point& GetRef1() const { return aRef1; } + void SetRef1(const Point &pt) { aRef1 = pt; } + const Point& GetRef2() const { return aRef2; } + void SetRef2(const Point &pt) { aRef2 = pt; } + const SdrHdl* GetHdl() const { return pHdl; } + void SetHdl(SdrHdl* pH) { pHdl=pH; } + SdrDragStatUserData* GetUser() const { return mpUserData.get(); } + void SetUser(std::unique_ptr pU) { mpUserData = std::move(pU); } + bool IsShown() const { return bShown; } + void SetShown(bool bOn) { bShown=bOn; } + + bool IsMinMoved() const { return bMinMoved; } + void SetMinMoved() { bMinMoved=true; } + void ResetMinMoved() { bMinMoved=false; } + void SetMinMove(sal_uInt16 nDist) { nMinMov=nDist; if (nMinMov<1) nMinMov=1; } + + bool IsHorFixed() const { return bHorFixed; } + void SetHorFixed(bool bOn) { bHorFixed=bOn; } + bool IsVerFixed() const { return bVerFixed; } + void SetVerFixed(bool bOn) { bVerFixed=bOn; } + + // Here, the object can say: "I do not want to snap to coordinates!" + // for example, the angle of the arc ... + bool IsNoSnap() const { return bWantNoSnap; } + void SetNoSnap(bool bOn = true) { bWantNoSnap=bOn; } + + // And here the Obj say which Ortho (if there is one) can be usefully applied to him. + // Ortho4 means Ortho in four directions (for Rect and CIRT) + bool IsOrtho4Possible() const { return bOrtho4; } + void SetOrtho4Possible(bool bOn = true) { bOrtho4=bOn; } + // Ortho8 means Ortho in 8 directions (for lines) + bool IsOrtho8Possible() const { return bOrtho8; } + void SetOrtho8Possible(bool bOn = true) { bOrtho8=bOn; } + + // Is set by an object that was dragged. + bool IsEndDragChangesAttributes() const { return bEndDragChangesAttributes; } + void SetEndDragChangesAttributes(bool bOn) { bEndDragChangesAttributes=bOn; } + bool IsEndDragChangesGeoAndAttributes() const { return bEndDragChangesGeoAndAttributes; } + void SetEndDragChangesGeoAndAttributes(bool bOn) { bEndDragChangesGeoAndAttributes=bOn; } + bool IsEndDragChangesLayout() const { return mbEndDragChangesLayout; } + void SetEndDragChangesLayout(bool bOn) { mbEndDragChangesLayout=bOn; } + + // Is set by the view and can be evaluated by Obj + bool IsMouseDown() const { return !bMouseIsUp; } + void SetMouseDown(bool bDown) { bMouseIsUp=!bDown; } + + void Reset(const Point& rPnt); + void NextMove(const Point& rPnt); + void NextPoint(); + void PrevPoint(); + bool CheckMinMoved(const Point& rPnt); + long GetDX() const { return GetNow().X()-GetPrev().X(); } + long GetDY() const { return GetNow().Y()-GetPrev().Y(); } + Fraction GetXFact() const; + Fraction GetYFact() const; + + SdrDragMethod* GetDragMethod() const { return pDragMethod; } + void SetDragMethod(SdrDragMethod* pMth) { pDragMethod=pMth; } + + const tools::Rectangle& GetActionRect() const { return aActionRect; } + void SetActionRect(const tools::Rectangle& rR) { aActionRect=rR; } + + // Also considering 1stPointAsCenter + void TakeCreateRect(tools::Rectangle& rRect) const; +}; + +#endif // INCLUDED_SVX_SVDDRAG_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svddrgmt.hxx b/include/svx/svddrgmt.hxx new file mode 100644 index 000000000..26e88a7db --- /dev/null +++ b/include/svx/svddrgmt.hxx @@ -0,0 +1,305 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVDDRGMT_HXX +#define INCLUDED_SVX_SVDDRGMT_HXX + +#include +#include +#include +#include + +class SdrDragView; +class SdrDragStat; + +class SAL_DLLPUBLIC_RTTI SdrDragEntry +{ +private: + bool mbAddToTransparent : 1; + +protected: + // access for derived classes + void setAddToTransparent(bool bNew) { mbAddToTransparent = bNew; } + +public: + SdrDragEntry(); + virtual ~SdrDragEntry(); + + virtual drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequenceInCurrentState(SdrDragMethod& rDragMethod) = 0; + + // data read access + bool getAddToTransparent() const { return mbAddToTransparent; } +}; + + +class SVXCORE_DLLPUBLIC SdrDragEntryPolyPolygon final : public SdrDragEntry +{ +private: + basegfx::B2DPolyPolygon maOriginalPolyPolygon; + +public: + SdrDragEntryPolyPolygon(const basegfx::B2DPolyPolygon& rOriginalPolyPolygon); + virtual ~SdrDragEntryPolyPolygon() override; + + virtual drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequenceInCurrentState(SdrDragMethod& rDragMethod) override; +}; + + +class SdrDragEntrySdrObject final : public SdrDragEntry +{ +private: + const SdrObject& maOriginal; + SdrObjectUniquePtr mxClone; + bool mbModify; + +public: + SdrDragEntrySdrObject( + const SdrObject& rOriginal, + bool bModify); + virtual ~SdrDragEntrySdrObject() override; + + // #i54102# Split createPrimitive2DSequenceInCurrentState in prepareCurrentState and processing, + // added accessors to original and clone + void prepareCurrentState(SdrDragMethod& rDragMethod); + const SdrObject& getOriginal() const { return maOriginal; } + SdrObject* getClone() { return mxClone.get(); } + + virtual drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequenceInCurrentState(SdrDragMethod& rDragMethod) override; +}; + + +class SdrDragEntryPrimitive2DSequence final : public SdrDragEntry +{ +private: + drawinglayer::primitive2d::Primitive2DContainer maPrimitive2DSequence; + +public: + SdrDragEntryPrimitive2DSequence( + const drawinglayer::primitive2d::Primitive2DContainer& rSequence); + virtual ~SdrDragEntryPrimitive2DSequence() override; + + virtual drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequenceInCurrentState(SdrDragMethod& rDragMethod) override; +}; + + +class SdrDragEntryPointGlueDrag final : public SdrDragEntry +{ +private: + std::vector< basegfx::B2DPoint > maPositions; + bool mbIsPointDrag; + +public: + SdrDragEntryPointGlueDrag(const std::vector< basegfx::B2DPoint >& rPositions, bool bIsPointDrag); + virtual ~SdrDragEntryPointGlueDrag() override; + + virtual drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequenceInCurrentState(SdrDragMethod& rDragMethod) override; +}; + + +class SVXCORE_DLLPUBLIC SdrDragMethod +{ +private: + std::vector< std::unique_ptr > maSdrDragEntries; + sdr::overlay::OverlayObjectList maOverlayObjectList; + SdrDragView& mrSdrDragView; + + bool mbMoveOnly : 1; + bool mbSolidDraggingActive : 1; + bool mbShiftPressed : 1; + +protected: + // access for derivated classes to maSdrDragEntries + void clearSdrDragEntries(); + void addSdrDragEntry(std::unique_ptr pNew); + virtual void createSdrDragEntries(); + virtual void createSdrDragEntryForSdrObject(const SdrObject& rOriginal); + + // Helper to support inserting a new OverlayObject. It will do all + // necessary stuff involved with that: + // - add GridOffset for non-linear ViewToDevice transformation (calc) + // - add to OverlayManager + // - add to local OverlayObjectList - ownership change (!) + // It is centralized here (and protected) to avoid that new usages/ + // implementations forget one of these needed steps. + void insertNewlyCreatedOverlayObjectForSdrDragMethod( + std::unique_ptr pOverlayObject, + const sdr::contact::ObjectContact& rObjectContact, + sdr::overlay::OverlayManager& rOverlayManager); + + // access for derivated classes to mrSdrDragView + SdrDragView& getSdrDragView() { return mrSdrDragView; } + const SdrDragView& getSdrDragView() const { return mrSdrDragView; } + + // access for derivated classes for bools + void setMoveOnly(bool bNew) { mbMoveOnly = bNew; } + void setSolidDraggingActive(bool bNew) { mbSolidDraggingActive = bNew; } + + // internal helpers for creation of standard drag entries + void createSdrDragEntries_SolidDrag(); + void createSdrDragEntries_PolygonDrag(); + void createSdrDragEntries_PointDrag(); + void createSdrDragEntries_GlueDrag(); + + // old call forwarders to the SdrDragView + OUString ImpGetDescriptionStr(const char* pStrCacheID) const; + SdrHdl* GetDragHdl() const { return getSdrDragView().mpDragHdl; } + SdrHdlKind GetDragHdlKind() const { return getSdrDragView().meDragHdl; } + SdrDragStat& DragStat() { return getSdrDragView().maDragStat; } + const SdrDragStat& DragStat() const { return getSdrDragView().maDragStat; } + Point& Ref1() const { return mrSdrDragView.maRef1; } + Point& Ref2() const { return mrSdrDragView.maRef2; } + const SdrHdlList& GetHdlList() const { return getSdrDragView().GetHdlList(); } + void AddUndo(std::unique_ptr pUndo) { getSdrDragView().AddUndo(std::move(pUndo)); } + bool IsDragLimit() { return getSdrDragView().mbDragLimit; } + const tools::Rectangle& GetDragLimitRect() { return getSdrDragView().maDragLimit; } + const SdrMarkList& GetMarkedObjectList() { return getSdrDragView().GetMarkedObjectList(); } + Point GetSnapPos(const Point& rPt) const { return getSdrDragView().GetSnapPos(rPt,getSdrDragView().mpMarkedPV); } + SdrSnap SnapPos(Point& rPt) const { return getSdrDragView().SnapPos(rPt,getSdrDragView().mpMarkedPV); } + inline const tools::Rectangle& GetMarkedRect() const; + SdrPageView* GetDragPV() const; + SdrObject* GetDragObj() const; + bool IsDraggingPoints() const { return getSdrDragView().IsDraggingPoints(); } + bool IsDraggingGluePoints() const { return getSdrDragView().IsDraggingGluePoints(); } + + bool DoAddConnectorOverlays(); + drawinglayer::primitive2d::Primitive2DContainer AddConnectorOverlays(); + +public: + + void resetSdrDragEntries(); + basegfx::B2DRange getCurrentRange() const; + + // #i58950# also moved constructor implementation to cxx + SdrDragMethod(SdrDragView& rNewView); + + // #i58950# virtual destructor was missing + virtual ~SdrDragMethod(); + + void Show(); + void Hide(); + bool IsShiftPressed() const { return mbShiftPressed; } + void SetShiftPressed(bool bShiftPressed) { mbShiftPressed = bShiftPressed; } + virtual OUString GetSdrDragComment() const=0; + virtual bool BeginSdrDrag()=0; + virtual void MoveSdrDrag(const Point& rPnt)=0; + virtual bool EndSdrDrag(bool bCopy)=0; + virtual void CancelSdrDrag(); + virtual PointerStyle GetSdrDragPointer() const=0; + + virtual void CreateOverlayGeometry( + sdr::overlay::OverlayManager& rOverlayManager, + const sdr::contact::ObjectContact& rObjectContact); + void destroyOverlayGeometry(); + + virtual basegfx::B2DHomMatrix getCurrentTransformation(); + virtual void applyCurrentTransformationToSdrObject(SdrObject& rTarget); + virtual void applyCurrentTransformationToPolyPolygon(basegfx::B2DPolyPolygon& rTarget); + + // data read access + bool getMoveOnly() const { return mbMoveOnly; } + bool getSolidDraggingActive() const { return mbSolidDraggingActive; } +}; + +inline const tools::Rectangle& SdrDragMethod::GetMarkedRect() const +{ + return getSdrDragView().meDragHdl==SdrHdlKind::Poly ? getSdrDragView().GetMarkedPointsRect() : + getSdrDragView().meDragHdl==SdrHdlKind::Glue ? getSdrDragView().GetMarkedGluePointsRect() : + getSdrDragView().GetMarkedObjRect(); +} + + +// SdrDragMove + +class SVXCORE_DLLPUBLIC SdrDragMove : public SdrDragMethod +{ +private: + long nBestXSnap; + long nBestYSnap; + bool bXSnapped; + bool bYSnapped; + + void ImpCheckSnap(const Point& rPt); + +protected: + virtual void createSdrDragEntryForSdrObject(const SdrObject& rOriginal) override; + +public: + SdrDragMove(SdrDragView& rNewView); + + virtual OUString GetSdrDragComment() const override; + virtual bool BeginSdrDrag() override; + virtual void MoveSdrDrag(const Point& rPnt) override; + virtual bool EndSdrDrag(bool bCopy) override; + virtual PointerStyle GetSdrDragPointer() const override; + + virtual basegfx::B2DHomMatrix getCurrentTransformation() override; + virtual void applyCurrentTransformationToSdrObject(SdrObject& rTarget) override; +}; + + +// SdrDragResize + +class SVXCORE_DLLPUBLIC SdrDragResize : public SdrDragMethod +{ +protected: + Fraction aXFact; + Fraction aYFact; + +public: + SdrDragResize(SdrDragView& rNewView); + + virtual OUString GetSdrDragComment() const override; + virtual bool BeginSdrDrag() override; + virtual void MoveSdrDrag(const Point& rPnt) override; + virtual bool EndSdrDrag(bool bCopy) override; + virtual PointerStyle GetSdrDragPointer() const override; + + virtual basegfx::B2DHomMatrix getCurrentTransformation() override; + virtual void applyCurrentTransformationToSdrObject(SdrObject& rTarget) override; +}; + + +// SdrDragObjOwn + +class SVXCORE_DLLPUBLIC SdrDragObjOwn : public SdrDragMethod +{ +private: + // SdrDragObjOwn always works on a clone since it has no transformation + // mechanism to modify wireframe visualisations, but uses the + // SdrObject::applySpecialDrag() method to change a clone of the + // SdrObject + SdrObjectUniquePtr mxClone; + +protected: + virtual void createSdrDragEntries() override; + +public: + SdrDragObjOwn(SdrDragView& rNewView); + virtual ~SdrDragObjOwn() override; + + virtual OUString GetSdrDragComment() const override; + virtual bool BeginSdrDrag() override; + virtual void MoveSdrDrag(const Point& rPnt) override; + virtual bool EndSdrDrag(bool bCopy) override; + virtual PointerStyle GetSdrDragPointer() const override; +}; + +#endif // INCLUDED_SVX_SVDDRGMT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svddrgv.hxx b/include/svx/svddrgv.hxx new file mode 100644 index 000000000..654f010c7 --- /dev/null +++ b/include/svx/svddrgv.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_SVX_SVDDRGV_HXX +#define INCLUDED_SVX_SVDDRGV_HXX + +#include +#include +#include + +class SdrUndoGeoObj; + +class SVXCORE_DLLPUBLIC SdrDragView : public SdrExchangeView +{ + friend class SdrPageView; + friend class SdrDragMethod; + + // See GetDragXorPolyLimit/GetDragXorPointLimit + enum : size_t { + eDragXorPolyLimit = 100, + eDragXorPointLimit = 500 + }; + +protected: + SdrHdl* mpDragHdl; + std::unique_ptr mpCurrentSdrDragMethod; + SdrUndoGeoObj* mpInsPointUndo; + tools::Rectangle maDragLimit; + OUString maInsPointUndoStr; + SdrHdlKind meDragHdl; + + bool mbFramDrag : 1; // currently frame dragging + bool mbMarkedHitMovesAlways : 1; // Persistent + bool mbDragLimit : 1; // Limit on SnapRect instead of BoundRect + bool mbDragHdl : 1; // TRUE: RefPt is slid + bool mbDragStripes : 1; // Persistent + bool mbSolidDragging : 1; // allow solid create/drag of objects + bool mbResizeAtCenter : 1; + bool mbCrookAtCenter : 1; + bool mbDragWithCopy : 1; + bool mbInsGluePoint : 1; + bool mbInsObjPointMode : 1; + bool mbInsGluePointMode : 1; + bool mbNoDragXorPolys : 1; + +private: + SVX_DLLPRIVATE void ImpClearVars(); + +protected: + virtual void SetMarkHandles(SfxViewShell* pOtherShell) override; + void ShowDragObj(); + void HideDragObj(); + bool ImpBegInsObjPoint(bool bIdxZwang, const Point& rPnt, bool bNewObj, OutputDevice* pOut); + +protected: + // #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView + SdrDragView( + SdrModel& rSdrModel, + OutputDevice* pOut); + + virtual ~SdrDragView() override; + +public: + virtual bool IsAction() const override; + virtual void MovAction(const Point& rPnt) override; + virtual void EndAction() override; + virtual void BckAction() override; + virtual void BrkAction() override; + virtual void TakeActionRect(tools::Rectangle& rRect) const override; + + // special implementation for Writer: + // TakeDragObjAnchorPos() returns the position at which an object + // approximately ends up during dragging when it is "released" + // (EndDrag). + // As a general rule, this is the left upper corner of the expected + // new SnapRect. Exception: CaptionObj. There, it is the position + // of the "tail end". + // In case of return value 'false', the position could not be + // determined (e.g. point shift, multiple selection, shift of the + // mirror axis,...) + bool TakeDragObjAnchorPos(Point& rPos, bool bTopRight ) const; + + // If pForcedMeth is passed, then pHdl, ... is not evaluated, but this Drag + // method is used. In this, the ownership of the instance passes + // to the View and is destroyed at the end of the dragging. + virtual bool BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrHdl* pHdl, short nMinMov=-3, SdrDragMethod* pForcedMeth=nullptr); + void MovDragObj(const Point& rPnt); + bool EndDragObj(bool bCopy=false); + void BrkDragObj(); + bool IsDragObj() const { return mpCurrentSdrDragMethod && !mbInsPolyPoint && !mbInsGluePoint; } + SdrHdl* GetDragHdl() const { return mpDragHdl; } + SdrDragMethod* GetDragMethod() const { return mpCurrentSdrDragMethod.get(); } + bool IsDraggingPoints() const { return meDragHdl==SdrHdlKind::Poly; } + bool IsDraggingGluePoints() const { return meDragHdl==SdrHdlKind::Glue; } + + // If you want to define that already during BegDrag + // or in the middle. + // (Is reset to 'false' on each BegDrag, so set it after BegDrag.) + void SetDragWithCopy(bool bOn) { mbDragWithCopy = bOn; } + bool IsDragWithCopy() const { return mbDragWithCopy; } + + void SetInsertGluePoint(bool bOn) { mbInsGluePoint = bOn; } + bool IsInsertGluePoint() const { return mbInsGluePoint; } + + // Interactive insertion of a new point. nIdx=0 => in front of the first point + bool IsInsObjPointPossible() const; + bool BegInsObjPoint(const Point& rPnt, bool bNewObj) { return ImpBegInsObjPoint(false, rPnt, bNewObj, nullptr); } + void MovInsObjPoint(const Point& rPnt) { MovDragObj(rPnt); } + bool EndInsObjPoint(SdrCreateCmd eCmd); + bool IsInsObjPoint() const { return mpCurrentSdrDragMethod && mbInsPolyPoint; } + + // For the app to manage the status. GetPreferredPointer() is + // possibly going to deliver a matching pointer for it. + void SetInsObjPointMode(bool bOn) { mbInsObjPointMode = bOn; } + bool IsInsObjPointMode() const { return mbInsObjPointMode; } + + bool IsInsGluePointPossible() const; + bool BegInsGluePoint(const Point& rPnt); + bool IsInsGluePoint() const { return mpCurrentSdrDragMethod && mbInsGluePoint; } + + // For the app to manage the status. GetPreferredPointer() is + // possibly going to deliver a matching pointer for it. + void SetInsGluePointMode(bool bOn) { mbInsGluePointMode = bOn; } + bool IsInsGluePointMode() const { return mbInsGluePointMode; } + + // border lines over the whole win persistent during the + // whole dragging. Default=FALSE. + void SetDragStripes(bool bOn); + bool IsDragStripes() const { return mbDragStripes; } + + // As a general rule, the contours of the selected objects + // are displayed as Xor-polygons. If this flag is set, only one + // Xor-Frame is drawn (e.g. in case of multiple selection). + // In case of object-specific dragging (polygon points, corner radius,...), + // this setting has no influence. + // Also changeable during the dragging. + // Default=Off + void SetNoDragXorPolys(bool bOn); + bool IsNoDragXorPolys() const { return mbNoDragXorPolys; } + + // If the number of selected objects exceeds the value set here, + // NoDragPolys is (temporarily) activated implicitly. + // PolyPolygons etc. are regarded as multiple objects respectively. + static size_t GetDragXorPolyLimit() { return eDragXorPolyLimit; } + + // Like DragXorPolyLimit, but in respect to the total number of + // all polygons. + // NoDragPolys is (temporarily) activated, if one of the limits + // is exceeded. + static size_t GetDragXorPointLimit() { return eDragXorPointLimit; } + + void SetSolidDragging(bool bOn); + bool IsSolidDragging() const; + + // Connector handling is thus as follows (when using default settings): + // - If at most 10 Connectors are affected, they are recalculated + // on each MouseMove. + // - If 11 to 100 Connectors are affected, the connections + // are shown as straight lines while dragging. + // - In case of more than 100 affected Connectors, nothing that refers + // to the Connectors is drawn while dragging. + + // If a special drag mode like Rotate, Mirror or Crook is enabled, + // then a Hit on the selected object triggers exactly this dragging. + // If MarkedHitMovesAlways is set to 'true', a Hit on the selected + // object always triggers a Move, independent of the DragMode that is + // set. This flag is persistent and should be configurable in the app + // by the user! + void SetMarkedHitMovesAlways(bool bOn) { mbMarkedHitMovesAlways = bOn; } + bool IsMarkedHitMovesAlways() const { return mbMarkedHitMovesAlways; } + + bool IsOrthoDesired() const; + + // center as reference on Resize + // Default=FALSE. + bool IsResizeAtCenter() const { return mbResizeAtCenter; } + void SetResizeAtCenter(bool bOn) { mbResizeAtCenter = bOn; } + + // symmetric Crook + // Default=FALSE. + bool IsCrookAtCenter() const { return mbCrookAtCenter; } + void SetCrookAtCenter(bool bOn) { mbCrookAtCenter = bOn; } + + // Limitation of the working area. The limitation refers to the View, + // not to the single PageViews. This limitation is only evaluated by + // the View on interactions like Dragging and Create. + // In case of actions controlled by the app through algorithms or + // UI-controlled actions (SetGeoAttr, MoveMarkedObj, ...), the + // app must honor this limit itself. + // Furthermore, this limit is to be seen as a rough limit. In certain + // cases (e.g. while rotating), objects cannot be dragged exactly + // up to this limit, objects can overlap a bit because of rounding + // errors,... + // Default=EmptyRect=no limitation + // only partially implemented + void SetWorkArea(const tools::Rectangle& rRect) { maMaxWorkArea=rRect; } + const tools::Rectangle& GetWorkArea() const { return maMaxWorkArea; } + + + // The DragLimit refers to the Page of the object. + // (TODO or to the View?? - must be researched...) + // 'false' = no limit + // The return Rect must contain absolute coordinates. The maximum + // drag area is then selected by the View in a way that the object's + // SnapRect is moved or resized at most up to the corner of the + // LimitRect. For objects like Bezier curves, rotated rectangles, + // it must be taken into account that because of subsequent + // recalculation of the SnapRect (on Resize), rounding errors can + // occur, because of which the LimitRect might be exceeded by a + // very small extent... + // Implemented for Move and Resize + virtual bool TakeDragLimit(SdrDragMode eMode, tools::Rectangle& rRect) const; +}; + +#endif // INCLUDED_SVX_SVDDRGV_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdedtv.hxx b/include/svx/svdedtv.hxx new file mode 100644 index 000000000..35236d6e2 --- /dev/null +++ b/include/svx/svdedtv.hxx @@ -0,0 +1,414 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVDEDTV_HXX +#define INCLUDED_SVX_SVDEDTV_HXX + +#include +#include +#include +#include +#include +#include + +class SfxUndoAction; +class SdrUndoAction; +class SdrUndoGroup; +class SfxStyleSheet; +class SdrLayer; +class SvdProgressInfo; + +enum class SdrHorAlign { + NONE, + Left, + Right, + Center +}; + +enum class SdrVertAlign { + NONE, + Top, + Bottom, + Center +}; + +enum class SdrMergeMode { + Merge, + Subtract, + Intersect +}; + +// Options for InsertObject() +enum class SdrInsertFlags +{ + NONE = 0x0000, + DONTMARK = 0x0001, /* object will not be marked (the actual marking remains) */ + ADDMARK = 0x0002, /* object will be added an existing selection */ + SETDEFATTR = 0x0004, /* actual attributes (+StyleSheet) are assigned to the object */ + SETDEFLAYER = 0x0008, /* actual layer is assigned to the object */ +}; +namespace o3tl +{ + template<> struct typed_flags : is_typed_flags {}; +} + +class SVXCORE_DLLPUBLIC SdrEditView : public SdrMarkView +{ + friend class SdrPageView; + friend class SdrDragDistort; + friend class SdrDragCrook; + +protected: + + // cache the transformation queries, etc. a little + bool m_bPossibilitiesDirty : 1; + bool m_bReadOnly : 1; + bool m_bGroupPossible : 1; + bool m_bUnGroupPossible : 1; + bool m_bGrpEnterPossible : 1; + bool m_bToTopPossible : 1; + bool m_bToBtmPossible : 1; + bool m_bReverseOrderPossible : 1; + bool m_bImportMtfPossible : 1; + bool m_bCombinePossible : 1; + bool m_bDismantlePossible : 1; + bool m_bCombineNoPolyPolyPossible : 1; + bool m_bDismantleMakeLinesPossible : 1; + bool m_bOrthoDesiredOnMarked : 1; + bool m_bOneOrMoreMovable : 1; // at least one object is moveable + bool m_bMoreThanOneNoMovRot : 1; // more than one object is not movable nor turnable (Crook) + bool m_bContortionPossible : 1; // all polygones (grouped if necessary) + bool m_bMoveAllowed : 1; + bool m_bResizeFreeAllowed : 1; + bool m_bResizePropAllowed : 1; + bool m_bRotateFreeAllowed : 1; + bool m_bRotate90Allowed : 1; + bool m_bMirrorFreeAllowed : 1; + bool m_bMirror45Allowed : 1; + bool m_bMirror90Allowed : 1; + bool m_bShearAllowed : 1; + bool m_bEdgeRadiusAllowed : 1; + bool m_bTransparenceAllowed : 1; + bool m_bCropAllowed : 1; + bool m_bGradientAllowed : 1; + bool m_bCanConvToPath : 1; + bool m_bCanConvToPoly : 1; + bool m_bCanConvToContour : 1; + bool m_bMoveProtect : 1; + bool m_bResizeProtect : 1; + +private: + SVX_DLLPRIVATE void ImpClearVars(); + SVX_DLLPRIVATE void ImpResetPossibilityFlags(); + +protected: + void ImpBroadcastEdgesOfMarkedNodes(); + + // convert the objects marked in poly resp. bezier + void ImpConvertTo(bool bPath, bool bLineToArea); + + // converts an object, when positive it removes the old one from its List + // and inserts the new one instead. including Undo. + // Nor MarkEntry nor ModelChgBroadcast is created. + SdrObject* ImpConvertOneObj(SdrObject* pObj, bool bPath, bool bLineToArea); + + // set both flags: bToTopPossible and bToBtmPossible. + // bToTopPossibleDirty and bToBtmPossibleDirty are reset at the same time + void ImpCheckToTopBtmPossible(); + + // for CombineMarkedObjects and DismantleMarkedObjects + void ImpCopyAttributes(const SdrObject* pSource, SdrObject* pDest) const; + + // for CombineMarkedObjects + static bool ImpCanConvertForCombine1(const SdrObject* pObj); + static bool ImpCanConvertForCombine(const SdrObject* pObj); + static basegfx::B2DPolyPolygon ImpGetPolyPolygon1(const SdrObject* pObj); + static basegfx::B2DPolyPolygon ImpGetPolyPolygon(const SdrObject* pObj); + static basegfx::B2DPolygon ImpCombineToSinglePolygon(const basegfx::B2DPolyPolygon& rPolyPolygon); + + // for DismantleMarkedObjects + static bool ImpCanDismantle(const basegfx::B2DPolyPolygon& rPpolyPpolygon, bool bMakeLines); + static bool ImpCanDismantle(const SdrObject* pObj, bool bMakeLines); + void ImpDismantleOneObject(const SdrObject* pObj, SdrObjList& rOL, size_t& rPos, SdrPageView* pPV, bool bMakeLines); + static void ImpCrookObj(SdrObject* pO, const Point& rRef, const Point& rRad, SdrCrookMode eMode, + bool bVertical, bool bNoContortion, bool bRotate, const tools::Rectangle& rMarkRect); + static void ImpDistortObj(SdrObject* pO, const tools::Rectangle& rRef, const XPolygon& rDistortedRect, bool bNoContortion); + bool ImpDelLayerCheck(SdrObjList const * pOL, SdrLayerID nDelID) const; + void ImpDelLayerDelObjs(SdrObjList* pOL, SdrLayerID nDelID); + + // Removes all objects of the MarkList from their ObjLists including Undo. + // The entries in rMark remain. + // @return a list of objects that must be deleted after the outermost EndUndo + std::vector DeleteMarkedList(SdrMarkList const& rMark); // DeleteMarked -> DeleteMarkedList + + // Check possibilities of all marked objects + virtual void CheckPossibilities(); + void ForcePossibilities() const { if (m_bPossibilitiesDirty || mbSomeObjChgdFlag) const_cast(this)->CheckPossibilities(); } + +protected: + // #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView + SdrEditView( + SdrModel& rSdrModel, + OutputDevice* pOut); + + virtual ~SdrEditView() override; + +public: + // each call of an undo-capable method from its view, generates an undo action. + // If one wishes to group method calls into one, these calls should be put + // between BegUndo() and EndUndo() calls (unlimited). + // The comment used for the UndoAction is the first BegUndo(String). + // In this case NotifyNewUndoAction is called at the last EndUndo(). + // NotifyNewUndoAction() is not called for an empty group. + void BegUndo() { mpModel->BegUndo(); } // open undo-grouping + void BegUndo(const OUString& rComment) { mpModel->BegUndo(rComment); } // open undo-grouping + void BegUndo(const OUString& rComment, const OUString& rObjDescr, SdrRepeatFunc eFunc=SdrRepeatFunc::NONE) { mpModel->BegUndo(rComment,rObjDescr,eFunc); } // open undo-grouping + void EndUndo(); // close undo-grouping (incl. BroadcastEdges) + void AddUndo(std::unique_ptr pUndo) { mpModel->AddUndo(std::move(pUndo)); } // add action + // only after first BegUndo or before last EndUndo: + void SetUndoComment(const OUString& rComment, const OUString& rObjDescr) { mpModel->SetUndoComment(rComment,rObjDescr); } + bool IsUndoEnabled() const; + + /** + * Checks if this or other views have an active text edit, if true, end them. + */ + void EndTextEditAllViews() const; + + std::vector< std::unique_ptr > CreateConnectorUndo( SdrObject& rO ); + void AddUndoActions( std::vector< std::unique_ptr > ); + + // Layermanagement with Undo. + void InsertNewLayer(const OUString& rName, sal_uInt16 nPos); + // Delete a layer including all objects contained + void DeleteLayer(const OUString& rName); + + // Marked objects which are outside a page + // are assigned to another page; at the moment without undo!!! + void ForceMarkedObjToAnotherPage(); + void ForceMarkedToAnotherPage() { ForceMarkedObjToAnotherPage(); } + + // delete all marked objects + void DeleteMarkedObj(); + + // Set a logical enclosing rectangle for all marked objects. + // It is not guaranteed if this succeeds, as a horizontal + // line has always a height of 0 + void SetMarkedObjRect(const tools::Rectangle& rRect); + void MoveMarkedObj(const Size& rSiz, bool bCopy=false); + void ResizeMarkedObj(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bCopy=false); + void ResizeMultMarkedObj(const Point& rRef, const Fraction& xFact, const Fraction& yFact, const bool bWdh, const bool bHgt); + long GetMarkedObjRotate() const; + void RotateMarkedObj(const Point& rRef, long nAngle, bool bCopy=false); + void MirrorMarkedObj(const Point& rRef1, const Point& rRef2, bool bCopy=false); + void MirrorMarkedObjHorizontal(); + void MirrorMarkedObjVertical(); + long GetMarkedObjShear() const; + void ShearMarkedObj(const Point& rRef, long nAngle, bool bVShear=false, bool bCopy=false); + void CrookMarkedObj(const Point& rRef, const Point& rRad, SdrCrookMode eMode, bool bVertical, bool bNoContortion, bool bCopy=false); + void DistortMarkedObj(const tools::Rectangle& rRef, const XPolygon& rDistortedRect, bool bNoContortion, bool bCopy=false); + + // copy marked objects and mark them instead of the old ones + void CopyMarkedObj(); + void SetAllMarkedRect(const tools::Rectangle& rRect) { SetMarkedObjRect(rRect); } + void MoveAllMarked(const Size& rSiz, bool bCopy=false) { MoveMarkedObj(rSiz,bCopy); } + void ResizeAllMarked(const Point& rRef, const Fraction& xFact, const Fraction& yFact) { ResizeMarkedObj(rRef,xFact,yFact); } + void RotateAllMarked(const Point& rRef, long nAngle) { RotateMarkedObj(rRef,nAngle); } + void MirrorAllMarkedHorizontal() { MirrorMarkedObjHorizontal(); } + void MirrorAllMarkedVertical() { MirrorMarkedObjVertical(); } + void CopyMarked() { CopyMarkedObj(); } + bool IsMoveAllowed() const { ForcePossibilities(); return m_bMoveAllowed && !m_bMoveProtect; } + bool IsResizeAllowed(bool bProp=false) const; + bool IsRotateAllowed(bool b90Deg=false) const; + bool IsMirrorAllowed(bool b45Deg=false, bool b90Deg=false) const; + bool IsTransparenceAllowed() const; + bool IsGradientAllowed() const; + bool IsShearAllowed() const; + bool IsEdgeRadiusAllowed() const; + bool IsCrookAllowed(bool bNoContortion=false) const; + bool IsCropAllowed() const; + bool IsDistortAllowed(bool bNoContortion=false) const; + + // Consolidate the text from multiple, selected TextObjects, + // attempting to identify paragraph fragments and join them together + void CombineMarkedTextObjects(); + + // Unite several objects to a polygon: + // - rectangles/circles/text... are implicitly converted. + // - polygones are closed automatically + // - attributes and layer are taken from the first object marked + // (thus from lowest Z-order). + // - group objects are included when all (!) member objects of + // the group can be changed. If a group includes for example + // a bitmap or an OLE-object, the complete group is not considered. + // bNoPolyPoly=TRUE: all is grouped to one single polygon + void CombineMarkedObjects(bool bNoPolyPoly = true); + + // for combining multiple polygons, with direct support of the modes + // SID_POLY_MERGE, SID_POLY_SUBSTRACT, SID_POLY_INTERSECT + void MergeMarkedObjects(SdrMergeMode eMode); + + // for distribution dialog function + void DistributeMarkedObjects(weld::Window* pParent); + + // for setting either the width or height of all selected + // objects to the width/height of the last selected object + // of the selection + void EqualizeMarkedObjects(bool bWidth); + + // Decompose marked polypolygon objects into polygons. + // Grouped objects are searched and decomposed, if all member objects are PathObjs. + // bMakeLines=TRUE: all polygones are decomposed into single lines resp. bezier segments + void DismantleMarkedObjects(bool bMakeLines=false); + bool IsCombinePossible(bool bNoPolyPoly=false) const; + bool IsDismantlePossible(bool bMakeLines=false) const; + + // Inserts a new, completely constructed object. Subsequently the object belongs to + // the model. After insertion the object is marked (if not prevented by nOptions). + // Sometimes the object is not inserted, but deleted, this is the case when + // the target layer is locked or not visible. In this case + // the method returns FALSE. + // Amongst others the method does not create an undo-action. + bool InsertObjectAtView(SdrObject* pObj, SdrPageView& rPV, SdrInsertFlags nOptions=SdrInsertFlags::NONE); + + // Replace one drawing object by another. + // *pNewObj belongs to me, *pOldObj is changed into Undo. + // In any case an undo grouping is required and should be applied, e.g.: + // aStr+=" replace"; + // BegUndo(aStr); + // ReplaceObject(...); + + // EndUndo(); + void ReplaceObjectAtView(SdrObject* pOldObj, SdrPageView& rPV, SdrObject* pNewObj, bool bMark=true); + + void SetNotPersistAttrToMarked(const SfxItemSet& rAttr); + void MergeNotPersistAttrFromMarked(SfxItemSet& rAttr) const; + void MergeAttrFromMarked(SfxItemSet& rAttr, bool bOnlyHardAttr) const; + SfxItemSet GetAttrFromMarked(bool bOnlyHardAttr) const; + void SetAttrToMarked(const SfxItemSet& rAttr, bool bReplaceAll); + + // geometrical attribute (position, size, rotation angle) + // A PageOrigin set at a position is taken into account. + SfxItemSet GetGeoAttrFromMarked() const; + void SetGeoAttrToMarked(const SfxItemSet& rAttr); + + // Returns NULL if: + // - nothing is marked, + // - no stylesheet is set at the marked object + // - point the marked objects to different StyleSheets for multiple selections + SfxStyleSheet* GetStyleSheetFromMarked() const; + + // at the moment without undo :( + void SetStyleSheetToMarked(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr); + + /* new interface src537 */ + void GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr) const; + + void SetAttributes(const SfxItemSet& rSet, bool bReplaceAll); + SfxStyleSheet* GetStyleSheet() const; // SfxStyleSheet* GetStyleSheet(bool& rOk) const; + void SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr); + + // Group all marked objects to a single group. + // Subsequently mark the new group . If the group spawns multiple + // pages a group is created per page. + // All groups created are subsequently marked. + // The method creates SdrObjGroup-instances. + void GroupMarked(); + + // All marked object groups are dissolved (1 level). + // Now all previously marked member objects are marked. + // Previously marked objects, which are not group objects, remain marked. + void UnGroupMarked(); + + bool IsGroupPossible() const { ForcePossibilities(); return m_bGroupPossible; } + bool IsUnGroupPossible() const { ForcePossibilities(); return m_bUnGroupPossible; } + bool IsGroupEnterPossible() const { ForcePossibilities(); return m_bGrpEnterPossible; } + + // Convert marked objects to polygones/Beziercurves. The bool-functions + // return sal_True, if at least one marked object could be converted. + // Also member objects of group objects are converted. + // For a better description see: SdrObj.HXX + bool IsConvertToPathObjPossible() const { ForcePossibilities(); return m_bCanConvToPath; } + bool IsConvertToPolyObjPossible() const { ForcePossibilities(); return m_bCanConvToPoly; } + bool IsConvertToContourPossible() const { ForcePossibilities(); return m_bCanConvToContour; } + void ConvertMarkedToPathObj(bool bLineToArea); + void ConvertMarkedToPolyObj(); + + // Align all marked objects vertically. Normally the SnapRect of an object is used. + void AlignMarkedObjects(SdrHorAlign eHor, SdrVertAlign eVert); + bool IsAlignPossible() const; + + // move marked objects "up" + void MovMarkedToTop(); + + // move marked objects "down" + void MovMarkedToBtm(); + + // move marked objects "at top" + void PutMarkedToTop(); + + // move marked objects "at bottom" + void PutMarkedToBtm(); + + // move marked immediately before the object passed + // NULL -> as PutMarkedToTop(); + void PutMarkedInFrontOfObj(const SdrObject* pRefObj); + + // move marked immediately after object passed + // NULL -> as PutMarkedToBtm(); + void PutMarkedBehindObj(const SdrObject* pRefObj); + + // swap Z-Order of marked objects + void ReverseOrderOfMarked(); + + // Check if forward, backward is possible. + // GetMaxToBtmObj() is only partly taken into account by these methods. + // Which means it can happen that IsToTopPossible() returns sal_True, + // but MovMarkedToTop() changes nothing (e.g. for multiple selections), + // as restriction derived via a view by GetMaxToTopObj() prevents this. + bool IsToTopPossible() const { ForcePossibilities(); return m_bToTopPossible; } + bool IsToBtmPossible() const { ForcePossibilities(); return m_bToBtmPossible; } + bool IsReverseOrderPossible() const { ForcePossibilities(); return m_bReverseOrderPossible; } + + // Using this method the view determines how far an object + // can be moved forward or backward (Z-order). + // The object returned is not "obsolete". When NULL is + // returned there is not such a restriction. + virtual SdrObject* GetMaxToTopObj(SdrObject* pObj) const; + virtual SdrObject* GetMaxToBtmObj(SdrObject* pObj) const; + + // Next method is called, if via ToTop, ToBtm, ... the + // sequence of object has been changed. It is called after + // each SdrObjList::SetObjectOrdNum(nOldPos,nNewPos); + virtual void ObjOrderChanged(SdrObject* pObj, size_t nOldPos, size_t nNewPos); + + // If one or more objects of the type SdrGrafObj or SdrOle2Obj + // are marked and these are capable to deliver a StarView-metafile, + // this methods converts the metafile to a drawing object. + // The SdrGrafObjs/SdrOle2Objs are replaced by the new objects. + void DoImportMarkedMtf(SvdProgressInfo *pProgrInfo=nullptr); + bool IsImportMtfPossible() const { ForcePossibilities(); return m_bImportMtfPossible; } + + // override SdrMarkView, for internal use + virtual void MarkListHasChanged() override; + virtual void ModelHasChanged() override; +}; + +#endif // INCLUDED_SVX_SVDEDTV_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx new file mode 100644 index 000000000..4684cd431 --- /dev/null +++ b/include/svx/svdedxv.hxx @@ -0,0 +1,303 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVDEDXV_HXX +#define INCLUDED_SVX_SVDEDXV_HXX + +#include +#include +#include +#include +#include +#include +#include + +class SdrOutliner; +class OutlinerView; +class EditStatus; +class EditFieldInfo; +class ImpSdrEditPara; +struct PasteOrDropInfos; +class SdrUndoManager; +class TextChainCursorManager; + +namespace com::sun::star::uno { + class Any; +} + +namespace sdr { + class SelectionController; +} + +enum class SdrEndTextEditKind +{ + Unchanged, // textobject unchanged + Changed, // textobject changed + Deleted, // textobject implicitly deleted + ShouldBeDeleted // for writer: textobject should be deleted +}; + +// - general edit for objectspecific properties +// - textedit for all drawobjects, inherited from SdrTextObj +// - macromode + + +class SVXCORE_DLLPUBLIC SdrObjEditView : public SdrGlueEditView, public EditViewCallbacks +{ + friend class SdrPageView; + friend class ImpSdrEditPara; + + // Now derived from EditViewCallbacks and overriding these callbacks to + // allow own EditText visualization + virtual void EditViewInvalidate(const tools::Rectangle& rRect) override; + virtual void EditViewSelectionChange() override; + virtual OutputDevice& EditViewOutputDevice() const override; + virtual void EditViewInputContext(const InputContext& rInputContext) override; + virtual void EditViewCursorRect(const tools::Rectangle& rRect, int nExtTextInputWidth) override; + + // The OverlayObjects used for visualizing active TextEdit (currently + // using TextEditOverlayObject, but not limited to it + sdr::overlay::OverlayObjectList maTEOverlayGroup; + +protected: + // TextEdit + tools::WeakReference + mxTextEditObj; // current object in TextEdit + SdrPageView* pTextEditPV; + std::unique_ptr pTextEditOutliner; // outliner for the TextEdit + OutlinerView* pTextEditOutlinerView; // current view of the outliners + VclPtr pTextEditWin; // matching window to pTextEditOutlinerView + vcl::Cursor* pTextEditCursorBuffer; // to restore the cursor in each window + SdrObject* pMacroObj; + SdrPageView* pMacroPV; + VclPtr pMacroWin; + + tools::Rectangle aTextEditArea; + tools::Rectangle aMinTextEditArea; + Link aOldCalcFieldValueLink; // for call the old handler + Point aMacroDownPos; + + sal_uInt16 nMacroTol; + + bool bTextEditDontDelete : 1; // do not delete outliner and view of SdrEndTextEdit (f. spellchecking) + bool bTextEditOnlyOneView : 1; // a single OutlinerView (f. spellchecking) + bool bTextEditNewObj : 1; // current edited object was just recreated + bool bQuickTextEditMode : 1; // persistent(->CrtV). Default=TRUE + bool bMacroDown : 1; + + rtl::Reference< sdr::SelectionController > mxSelectionController; + rtl::Reference< sdr::SelectionController > mxLastSelectionController; + +private: + SfxUndoManager* mpOldTextEditUndoManager; + + SVX_DLLPRIVATE void ImpClearVars(); + +protected: + // central method to get an SdrUndoManager for enhanced TextEdit. Default will + // try to return a dynamic_casted GetModel()->GetSdrUndoManager(). Applications + // which want to use this feature will need to override this virtual method, + // provide their document UndoManager and derive it from SdrUndoManager. + virtual SdrUndoManager* getSdrUndoManagerForEnhancedTextEdit() const; + + void ImpMoveCursorAfterChainingEvent(TextChainCursorManager *pCursorManager); + TextChainCursorManager *ImpHandleMotionThroughBoxesKeyInput(const KeyEvent& rKEvt, bool *bOutHandled); + + + OutlinerView* ImpFindOutlinerView(vcl::Window const * pWin) const; + + // Create a new OutlinerView at the heap and initialize all required parameters. + // pTextEditObj, pTextEditPV and pTextEditOutliner have to be initialized + OutlinerView* ImpMakeOutlinerView(vcl::Window* pWin, OutlinerView* pGivenView, SfxViewShell* pViewShell = nullptr) const; + void ImpPaintOutlinerView(OutlinerView& rOutlView, const tools::Rectangle& rRect, OutputDevice& rTargetDevice) const; + void ImpInvalidateOutlinerView(OutlinerView const & rOutlView) const; + + // Chaining + void ImpChainingEventHdl(); + DECL_LINK(ImpAfterCutOrPasteChainingEventHdl, LinkParamNone*, void); + + + // Check if the whole text is selected. + // Still returns sal_True if there is no text present. + bool ImpIsTextEditAllSelected() const; + void ImpMakeTextCursorAreaVisible(); + + // handler for AutoGrowing text with active Outliner + DECL_LINK(ImpOutlinerStatusEventHdl, EditStatus&, void); + DECL_LINK(ImpOutlinerCalcFieldValueHdl, EditFieldInfo*, void); + + // link for EndTextEditHdl + DECL_LINK(EndTextEditHdl, SdrUndoManager*, void); + + void ImpMacroUp(const Point& rUpPos); + void ImpMacroDown(const Point& rDownPos); + + DECL_LINK( BeginPasteOrDropHdl, PasteOrDropInfos*, void ); + DECL_LINK( EndPasteOrDropHdl, PasteOrDropInfos*, void ); + +protected: + // #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView + SdrObjEditView( + SdrModel& rSdrModel, + OutputDevice* pOut); + + virtual ~SdrObjEditView() override; + +public: + + // used to call the old ImpPaintOutlinerView. Will be replaced when the + // outliner will be displayed on the overlay in edit mode. + void TextEditDrawing(SdrPaintWindow& rPaintWindow); + + // Actionhandling for macromode + virtual bool IsAction() const override; + virtual void MovAction(const Point& rPnt) override; + virtual void EndAction() override; + virtual void BrkAction() override; + virtual void BckAction() override; + virtual void TakeActionRect(tools::Rectangle& rRect) const override; + + SdrPageView* ShowSdrPage(SdrPage* pPage) override; + void HideSdrPage() override; + + virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override; + virtual void ModelHasChanged() override; + + + // TextEdit over an outliner + + // QuickTextEditMode = edit the text straight after selection. Default=TRUE. Persistent. + void SetQuickTextEditMode(bool bOn) { bQuickTextEditMode=bOn; } + bool IsQuickTextEditMode() const { return bQuickTextEditMode; } + + // Start the TextEditMode. If pWin==NULL, use the first window, which is logged at the View. + // The cursor of the currently edited window is stored with SdrBeginTextEdit() + // and restored with SdrEndTextEdit(). + // The app has to ensure, that the BegEdit of the window logged cursor is still valid, + // when SdrEndTextEdit is called. + // With the parameter pEditOutliner, the app has the possibility to specify his own outliner, + // which is used for editing. After the SdrBeginTextEdit call, the outliner belongs to + // SdrObjEditView, and is also later destroyed by this via delete (if bDontDeleteOutliner=sal_False). + // Afterwards the SdrObjEditView sets the modflag (EditEngine/Outliner) at this instance and also the + // StatusEventHdl. + // Similarly a specific OutlinerView can be specified. + + virtual bool SdrBeginTextEdit(SdrObject* pObj, SdrPageView* pPV = nullptr, vcl::Window* pWin = nullptr, bool bIsNewObj = false, + SdrOutliner* pGivenOutliner = nullptr, OutlinerView* pGivenOutlinerView = nullptr, + bool bDontDeleteOutliner = false, bool bOnlyOneView = false, bool bGrabFocus = true); + // bDontDeleteReally is a special parameter for writer + // If this flag is set, then a maybe empty textobject is not deleted. + // Instead you get a return code SdrEndTextEditKind::ShouldBeDeleted + // (in place of SDRENDTEXTEDIT_BEDELETED), which says, the obj should be + // deleted. + virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally = false); + virtual bool IsTextEdit() const final override; + + // This method returns sal_True, if the point rHit is inside the + // objectspace or the OutlinerView. + bool IsTextEditHit(const Point& rHit) const; + + // This method returns sal_True, if the point rHit is inside the + // handle-thick frame, which surrounds the OutlinerView at TextFrames. + bool IsTextEditFrameHit(const Point& rHit) const; + + // At active selection, between MouseButtonDown and + // MouseButtonUp, this method always returns TRUE. + bool IsTextEditInSelectionMode() const; + + // If sb needs the object out of the TextEdit: + SdrTextObj* GetTextEditObject() const { return mxTextEditObj.get(); } + + // info about TextEditPageView. Default is 0L. + SdrPageView* GetTextEditPageView() const; + + // Current window of the outliners. + void SetTextEditWin(vcl::Window* pWin); + + // Now at this outliner, events can be send, attributes can be set, + // call Cut/Copy/Paste, call Undo/Redo, and so on... + const SdrOutliner* GetTextEditOutliner() const { return pTextEditOutliner.get(); } + SdrOutliner* GetTextEditOutliner() { return pTextEditOutliner.get(); } + const OutlinerView* GetTextEditOutlinerView() const { return pTextEditOutlinerView; } + OutlinerView* GetTextEditOutlinerView() { return pTextEditOutlinerView; } + + virtual bool KeyInput(const KeyEvent& rKEvt, vcl::Window* pWin) override; + virtual bool MouseButtonDown(const MouseEvent& rMEvt, OutputDevice* pWin) override; + virtual bool MouseButtonUp(const MouseEvent& rMEvt, OutputDevice* pWin) override; + virtual bool MouseMove(const MouseEvent& rMEvt, OutputDevice* pWin) override; + virtual bool Command(const CommandEvent& rCEvt, vcl::Window* pWin) override; + + // #97766# make virtual to change implementation e.g. for SdOutlineView + virtual SvtScriptType GetScriptType() const; + + /* new interface src537 */ + void GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr) const; + + bool SetAttributes(const SfxItemSet& rSet, bool bReplaceAll); + SfxStyleSheet* GetStyleSheet() const; // SfxStyleSheet* GetStyleSheet(bool& rOk) const; + void SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr); + + // Intern: at mounting new OutlinerView... + virtual void AddWindowToPaintView(OutputDevice* pNewWin, vcl::Window* pWindow) override; + virtual void DeleteWindowFromPaintView(OutputDevice* pOldWin) override; + + sal_uInt16 GetSelectionLevel() const; + + + // Object MacroMode (e.g. rect as button or sth. like that): + + void BegMacroObj(const Point& rPnt, short nTol, SdrObject* pObj, SdrPageView* pPV, vcl::Window* pWin); + void BegMacroObj(const Point& rPnt, SdrObject* pObj, SdrPageView* pPV, vcl::Window* pWin) { BegMacroObj(rPnt,-2,pObj,pPV,pWin); } + void MovMacroObj(const Point& rPnt); + void BrkMacroObj(); + bool EndMacroObj(); + bool IsMacroObj() const { return pMacroObj!=nullptr; } + + /** fills the given any with a XTextCursor for the current text selection. + Leaves the any untouched if there currently is no text selected */ + void getTextSelection( css::uno::Any& rSelection ); + + virtual void MarkListHasChanged() override; + + const rtl::Reference< sdr::SelectionController >& getSelectionController() const { return mxSelectionController; } + + /** returns true if the shape identified by its inventor and identifier supports format paint brush operation */ + static bool SupportsFormatPaintbrush( SdrInventor nObjectInventor, sal_uInt16 nObjectIdentifier ); + + /** returns a format paint brush set from the current selection */ + void TakeFormatPaintBrush( std::shared_ptr< SfxItemSet >& rFormatSet ); + + /** applies a format paint brush set from the current selection. + if bNoCharacterFormats is true, no character attributes are changed. + if bNoParagraphFormats is true, no paragraph attributes are changed. + */ + void ApplyFormatPaintBrush( SfxItemSet& rFormatSet, bool bNoCharacterFormats, bool bNoParagraphFormats ); + + /** helper function for selections with multiple SdrText for one SdrTextObj (f.e. tables ) */ + static void ApplyFormatPaintBrushToText( SfxItemSet const & rFormatSet, SdrTextObj& rTextObj, SdrText* pText, bool bNoCharacterFormats, bool bNoParagraphFormats ); + +protected: + virtual void OnBeginPasteOrDrop( PasteOrDropInfos* pInfo ); + virtual void OnEndPasteOrDrop( PasteOrDropInfos* pInfo ); + +}; + +#endif // INCLUDED_SVX_SVDEDXV_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdetc.hxx b/include/svx/svdetc.hxx new file mode 100644 index 000000000..14af8569f --- /dev/null +++ b/include/svx/svdetc.hxx @@ -0,0 +1,211 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVDETC_HXX +#define INCLUDED_SVX_SVDETC_HXX + +#include +#include +#include +#include +#include +#include + + +/** + * Get ExchangeFormatID of the DrawingEngine. + * The data can then be made available via + * static bool CopyData(pData,nLen,nFormat); + * + * However, pData/nLen describe an SvMemoryStream in which an SdrModel is + * streamed. For its lifetime, the flag SdrModel::SetStreamingSdrModel(true) + * is set. + */ + +class SdrOutliner; +class SdrModel; +class SvtSysLocale; +class LocaleDataWrapper; + +namespace com::sun::star::lang { + struct Locale; +} + +/** + * Create an Outliner with the engine-global default settings on the heap. + * If pMod != nullptr, the MapMode of the passed model is used. + * The resulting default font height, however, stays the same (the logical + * font height is converted). + */ +SVXCORE_DLLPUBLIC std::unique_ptr SdrMakeOutliner(OutlinerMode nOutlinerMode, SdrModel& rMod); + +/** + * Global default settings for the DrawingEngine. + * + * One should set these default settings as the first + * thing at program start, before any other method is called. + */ +namespace SdrEngineDefaults +{ + // Default FontColor is COL_AUTO + inline Color GetFontColor() { return COL_AUTO; } + + // Default FontHeight is 847. The font height uses logical units (MapUnit/MapFraction + // see below for further details). The default setting 847/100mm corresponds to about + // 24 Point. If e.g. one would use Twips (SetMapUnit(MapUnit::MapTwip)) (20 Twip = 1 Point) + // instead, one would need to set the font height to 480, in order to get a 24 Point height. + inline size_t GetFontHeight() { return 847; } + + // The MapMode is needed for the global Outliner. + // Incidentally, every newly instantiated SdrModel is assigned this MapMode by default. + // Default MapUnit is MapUnit::Map100thMM + inline MapUnit GetMapUnit() { return MapUnit::Map100thMM; } + + // Default MapFraction is 1/1. + inline Fraction GetMapFraction() { return Fraction(1, 1); } +}; + +class SfxItemSet; + +/** + * Returns a replacement for an XFillStyle + * + * @returns false for XFILL_NONE and rCol remains unchanged + */ +SVXCORE_DLLPUBLIC bool GetDraftFillColor(const SfxItemSet& rSet, Color& rCol); + + +/** + * Search an ItemSet for Outliner/EditEngine Items + * + * @returns true, if the set contains such items + */ +bool SearchOutlinerItems(const SfxItemSet& rSet, bool bInklDefaults, bool* pbOnlyEE=nullptr); + +/** + * @returns a new WhichTable, which we need to squash at some point with a delete + */ +std::unique_ptr RemoveWhichRange(const sal_uInt16* pOldWhichTable, sal_uInt16 nRangeBeg, sal_uInt16 nRangeEnd); + +/** + * Helper class for the communication between the dialog + * In order to break open Metafiles (sd/source/ui/dlg/brkdlg.cxx), + * SdrEditView::DoImportMarkedMtf() and ImpSdrGDIMetaFileImport::DoImport() + */ +class SVXCORE_DLLPUBLIC SvdProgressInfo +{ +private: + size_t m_nSumCurAction; // Sum of all handled Actions + + size_t m_nActionCount; // Count of Actions in the current object + size_t m_nCurAction; // Count of handled Actions in the current object + + size_t m_nInsertCount; // Count of to-be-inserted Actions in the current object + size_t m_nCurInsert; // Count of already inserted Actions + + size_t m_nObjCount; // Count of selected objects + size_t m_nCurObj; // Current object + + Link maLink; + +public: + SvdProgressInfo( const Link& _pLink ); + + void Init( size_t _nObjCount ); + + void SetNextObject(); + + void SetActionCount( size_t _nActionCount ); + void SetInsertCount( size_t _nInsertCount ); + + bool ReportActions( size_t nActionCount ); + void ReportInserts( size_t nInsertCount ); + + size_t GetSumCurAction() const { return m_nSumCurAction; }; + size_t GetObjCount() const { return m_nObjCount; }; + size_t GetCurObj() const { return m_nCurObj; }; + + size_t GetActionCount() const { return m_nActionCount; }; + size_t GetCurAction() const { return m_nCurAction; }; + + size_t GetInsertCount() const { return m_nInsertCount; }; + size_t GetCurInsert() const { return m_nCurInsert; }; + + void ReportRescales( size_t nRescaleCount ); +}; + + +std::vector>& ImpGetUserMakeObjHdl(); + +class SdrOle2Obj; +class AutoTimer; + +class OLEObjCache +{ + std::vector maObjs; + + size_t nSize; + std::unique_ptr pTimer; + + static bool UnloadObj( SdrOle2Obj* pObj ); + DECL_LINK( UnloadCheckHdl, Timer*, void ); + +public: + OLEObjCache(); + SVXCORE_DLLPUBLIC ~OLEObjCache(); + + void InsertObj(SdrOle2Obj* pObj); + void RemoveObj(SdrOle2Obj* pObj); + + SVXCORE_DLLPUBLIC size_t size() const; + SVXCORE_DLLPUBLIC SdrOle2Obj* operator[](size_t nPos); + SVXCORE_DLLPUBLIC const SdrOle2Obj* operator[](size_t nPos) const; +}; + + +class SVXCORE_DLLPUBLIC SdrGlobalData +{ + const SvtSysLocale* pSysLocale; // follows always locale settings + const LocaleDataWrapper* pLocaleData; // follows always SysLocale +public: + std::vector> + aUserMakeObjHdl; + OLEObjCache aOLEObjCache; + + + const SvtSysLocale* GetSysLocale(); // follows always locale settings + const LocaleDataWrapper* GetLocaleData(); // follows always SysLocale +public: + SdrGlobalData(); + + OLEObjCache& GetOLEObjCache() { return aOLEObjCache; } +}; + +SVXCORE_DLLPUBLIC SdrGlobalData & GetSdrGlobalData(); + + +// #i101872# isolated GetTextEditBackgroundColor for tooling +class SdrObjEditView; + +SVXCORE_DLLPUBLIC Color GetTextEditBackgroundColor(const SdrObjEditView& rView); + + +#endif // INCLUDED_SVX_SVDETC_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdglev.hxx b/include/svx/svdglev.hxx new file mode 100644 index 000000000..53dbef281 --- /dev/null +++ b/include/svx/svdglev.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_SVX_SVDGLEV_HXX +#define INCLUDED_SVX_SVDGLEV_HXX + +#include +#include + +class SdrGluePoint; + + +// Edit GluePoints at the objects (GluePoints for connector) + + +class SVXCORE_DLLPUBLIC SdrGlueEditView : public SdrPolyEditView +{ + // copy marked GluePoints and mark instead of the old ones + void ImpCopyMarkedGluePoints(); + typedef void (*PGlueDoFunc)(SdrGluePoint&, const SdrObject* pObj, const void*, const void*, const void*, const void*); + typedef void (*PGlueTrFunc)(Point&, const void*, const void*, const void*, const void*); + void ImpDoMarkedGluePoints(PGlueDoFunc pDoFunc, bool bConst, const void* p1, const void* p2=nullptr, const void* p3=nullptr, const void* p4=nullptr); + void ImpTransformMarkedGluePoints(PGlueTrFunc pTrFunc, const void* p1, const void* p2=nullptr, const void* p3=nullptr, const void* p4=nullptr); + +protected: + // #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView + SdrGlueEditView( + SdrModel& rSdrModel, + OutputDevice* pOut); + + virtual ~SdrGlueEditView() override; + +public: + // the parameter nThisEsc is used to hand over the direction, + // which one wished to check,set or delete + // possible values for nThisEsc are: + // SdrEscapeDirection::LEFT, SdrEscapeDirection::RIGHT, SdrEscapeDirection::TOP and SdrEscapeDirection::BOTTOM + TriState IsMarkedGluePointsEscDir(SdrEscapeDirection nThisEsc) const; + void SetMarkedGluePointsEscDir(SdrEscapeDirection nThisEsc, bool bOn); + + // check/set, if the GluePoints are relative to the + // object size (Percent=sal_True) or not (Percent=sal_False) + TriState IsMarkedGluePointsPercent() const; + void SetMarkedGluePointsPercent(bool bOn); + + // bVert=FALSE: check/set horizontal alignment + // SdrAlign::HORZ_CENTER + // SdrAlign::HORZ_LEFT + // SdrAlign::HORZ_RIGHT + // SdrAlign::HORZ_DONTCARE (only at Get()) + // bVert=TRUE: check/set vertical alignment + // SdrAlign::VERT_CENTER + // SdrAlign::VERT_TOP + // SdrAlign::VERT_BOTTOM + // SdrAlign::VERT_DONTCARE (only at Get()) + SdrAlign GetMarkedGluePointsAlign(bool bVert) const; + void SetMarkedGluePointsAlign(bool bVert, SdrAlign nAlign); + + // delete all marked GluePoints + void DeleteMarkedGluePoints(); + + void MoveMarkedGluePoints (const Size& rSiz, bool bCopy); + void ResizeMarkedGluePoints(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bCopy); + void RotateMarkedGluePoints(const Point& rRef, long nAngle, bool bCopy); +}; + +#endif // INCLUDED_SVX_SVDGLEV_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdglue.hxx b/include/svx/svdglue.hxx new file mode 100644 index 000000000..ab6d6760c --- /dev/null +++ b/include/svx/svdglue.hxx @@ -0,0 +1,149 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVDGLUE_HXX +#define INCLUDED_SVX_SVDGLUE_HXX + +#include +#include +#include +#include +#include + +namespace vcl { class Window; } +class OutputDevice; +class SvStream; +class SdrObject; + + +enum class SdrEscapeDirection +{ + SMART = 0x0000, + LEFT = 0x0001, + RIGHT = 0x0002, + TOP = 0x0004, + BOTTOM = 0x0008, + HORZ = LEFT | RIGHT, + VERT = TOP | BOTTOM, + ALL = 0x00ff, +}; +namespace o3tl +{ + template<> struct typed_flags : is_typed_flags {}; +} + +enum class SdrAlign +{ + NONE = 0x0000, + HORZ_CENTER = 0x0000, + HORZ_LEFT = 0x0001, + HORZ_RIGHT = 0x0002, + HORZ_DONTCARE = 0x0010, + VERT_CENTER = 0x0000, + VERT_TOP = 0x0100, + VERT_BOTTOM = 0x0200, + VERT_DONTCARE = 0x1000, +}; +namespace o3tl +{ + template<> struct typed_flags : is_typed_flags {}; +} + +class SVXCORE_DLLPUBLIC SdrGluePoint { + // Reference Point is SdrObject::GetSnapRect().Center() + // bNoPercent=false: position is -5000..5000 (1/100)% or 0..10000 (depending on align) + // bNoPercent=true : position is in log unit, relative to the reference point + Point aPos; + SdrEscapeDirection nEscDir; + sal_uInt16 nId; + SdrAlign nAlign; + bool bNoPercent:1; + bool bReallyAbsolute:1; // temp for transformations on the reference object + bool bUserDefined:1; // #i38892# +public: + SdrGluePoint(): nEscDir(SdrEscapeDirection::SMART),nId(0),nAlign(SdrAlign::NONE),bNoPercent(false),bReallyAbsolute(false),bUserDefined(true) {} + SdrGluePoint(const Point& rNewPos): aPos(rNewPos),nEscDir(SdrEscapeDirection::SMART),nId(0),nAlign(SdrAlign::NONE),bNoPercent(false),bReallyAbsolute(false),bUserDefined(true) {} + const Point& GetPos() const { return aPos; } + void SetPos(const Point& rNewPos) { aPos=rNewPos; } + SdrEscapeDirection GetEscDir() const { return nEscDir; } + void SetEscDir(SdrEscapeDirection nNewEsc) { nEscDir=nNewEsc; } + sal_uInt16 GetId() const { return nId; } + void SetId(sal_uInt16 nNewId) { nId=nNewId; } + bool IsPercent() const { return !bNoPercent; } + void SetPercent(bool bOn) { bNoPercent = !bOn; } + // temp for transformations on the reference object + void SetReallyAbsolute(bool bOn, const SdrObject& rObj); + + // #i38892# + bool IsUserDefined() const { return bUserDefined; } + void SetUserDefined(bool bNew) { bUserDefined = bNew; } + + SdrAlign GetAlign() const { return nAlign; } + void SetAlign(SdrAlign nAlg) { nAlign=nAlg; } + SdrAlign GetHorzAlign() const { return nAlign & static_cast(0x00FF); } + void SetHorzAlign(SdrAlign nAlg) { assert((nAlg & static_cast(0xFF00)) == SdrAlign::NONE); nAlign = SdrAlign(nAlign & static_cast(0xFF00)) | (nAlg & static_cast(0x00FF)); } + SdrAlign GetVertAlign() const { return nAlign & static_cast(0xFF00); } + void SetVertAlign(SdrAlign nAlg) { assert((nAlg & static_cast(0x00FF)) == SdrAlign::NONE); nAlign = SdrAlign(nAlign & static_cast(0x00FF)) | (nAlg & static_cast(0xFF00)); } + bool IsHit(const Point& rPnt, const OutputDevice& rOut, const SdrObject* pObj) const; + void Invalidate(vcl::Window& rWin, const SdrObject* pObj) const; + Point GetAbsolutePos(const SdrObject& rObj) const; + void SetAbsolutePos(const Point& rNewPos, const SdrObject& rObj); + long GetAlignAngle() const; + void SetAlignAngle(long nAngle); + static long EscDirToAngle(SdrEscapeDirection nEsc); + static SdrEscapeDirection EscAngleToDir(long nAngle); + void Rotate(const Point& rRef, long nAngle, double sn, double cs, const SdrObject* pObj); + void Mirror(const Point& rRef1, const Point& rRef2, long nAngle, const SdrObject* pObj); + void Shear (const Point& rRef, double tn, bool bVShear, const SdrObject* pObj); +}; + +#define SDRGLUEPOINT_NOTFOUND 0xFFFF + +class SVXCORE_DLLPUBLIC SdrGluePointList { + std::vector> aList; +public: + SdrGluePointList() {}; + SdrGluePointList(const SdrGluePointList& rSrcList) { *this=rSrcList; } + + SdrGluePointList& operator=(const SdrGluePointList& rSrcList); + sal_uInt16 GetCount() const { return sal_uInt16(aList.size()); } + // At insert, the object (GluePoint) automatically gets an ID assigned. + // Return value is the index of the new GluePoint in the list. + sal_uInt16 Insert(const SdrGluePoint& rGP); + void Delete(sal_uInt16 nPos) + { + aList.erase(aList.begin()+nPos); + } + SdrGluePoint& operator[](sal_uInt16 nPos) { return *aList[nPos]; } + const SdrGluePoint& operator[](sal_uInt16 nPos) const { return *aList[nPos]; } + sal_uInt16 FindGluePoint(sal_uInt16 nId) const; + sal_uInt16 HitTest(const Point& rPnt, const OutputDevice& rOut, const SdrObject* pObj) const; + void Invalidate(vcl::Window& rWin, const SdrObject* pObj) const; + // temp for transformations on the reference object + void SetReallyAbsolute(bool bOn, const SdrObject& rObj); + void Rotate(const Point& rRef, long nAngle, double sn, double cs, const SdrObject* pObj); + void Mirror(const Point& rRef1, const Point& rRef2, const SdrObject* pObj); + void Mirror(const Point& rRef1, const Point& rRef2, long nAngle, const SdrObject* pObj); + void Shear (const Point& rRef, double tn, bool bVShear, const SdrObject* pObj); +}; + + +#endif // INCLUDED_SVX_SVDGLUE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdhdl.hxx b/include/svx/svdhdl.hxx new file mode 100644 index 000000000..aca1b4f59 --- /dev/null +++ b/include/svx/svdhdl.hxx @@ -0,0 +1,537 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVDHDL_HXX +#define INCLUDED_SVX_SVDHDL_HXX + +#include +#include + +#include +#include +#include +#include +#include + +class OutputDevice; +class SdrHdlList; +class SdrMarkView; +class SdrObject; +class SdrPageView; +class MouseEvent; +class HelpEvent; + +namespace sdr::contact { + class ObjectContact; +} + +// Every object must be able to create its handles. They will be fetched on +// selection, registered at the View and made visible. +// When a handle is touched by the mouse (IsHit()), from the view the matching mouse pointer +// is picked up from the handle and passed to the app (on demand) to be switched on +// Handles like e.g. rotation center or the mirror axis are generated by +// the view if the correct transformation mode was selected by the controller. +// SdrHdlKind::Move...SdrHdlKind::LowerRight should always be consecutive in the enum! + +enum class SdrHdlKind +{ + Move, // Handle to move the object + UpperLeft, // Upper left + Upper, // Upper + UpperRight, // Upper right + Left, // Left + Right, // Right + LowerLeft, // Bottom left + Lower, // Bottom + LowerRight, // Bottom right + Poly, // Select point in polygon or beziercurve + BezierWeight, // Weight of a beziercurve + Circle, // Angle to circle segment, corner radius to rectangle + Ref1, // Reference point 1, e.g. rotation center + Ref2, // Reference point 2, e.g. endpoint of mirror axis + MirrorAxis, // Mirror axis + Glue, // GluePoint + Anchor, // Anchor symbol (SD, SW) + Transparence, // Interactive transparence + Gradient, // Interactive gradient + Color, // Interactive color + User, + Anchor_TR, // #101688# Anchor handle with (0,0) at top right for SW + + // for SJ and the CustomShapeHandles: + CustomShape1, + + SmartTag +}; + + +enum class BitmapColorIndex +{ + LightGreen = 0, + Cyan = 1, + LightCyan = 2, + Red = 3, + LightRed = 4, + Yellow = 5, +}; + + +enum class BitmapMarkerKind +{ + Rect_7x7, + Rect_9x9, + Rect_11x11, + Rect_13x13, + Circ_7x7, + Circ_9x9, + Circ_11x11, + Elli_7x9, + Elli_9x11, + Elli_9x7, + Elli_11x9, + RectPlus_7x7, + RectPlus_9x9, + RectPlus_11x11, + Crosshair, + Glue, + Glue_Deselected, + Anchor, + + // #98388# add AnchorPressed to be able to animate anchor control, too. + AnchorPressed, + + // #101688# AnchorTR for SW + AnchorTR, + AnchorPressedTR, + + // for SJ and the CustomShapeHandles: + Customshape_7x7, + Customshape_9x9, + Customshape_11x11 +}; + + +class SVXCORE_DLLPUBLIC SdrHdl +{ + friend class SdrMarkView; // for the access to nObjHdlNum + friend class SdrHdlList; + +protected: + SdrObject* pObj; // does handle belong to an object? + SdrPageView* pPV; // does handle belong to an object in certain pageview? + SdrHdlList* pHdlList; // to store the handlesize + // OVERLAYMANAGER + sdr::overlay::OverlayObjectList maOverlayGroup; + + Point aPos; + + SdrHdlKind eKind; + + long nRotationAngle; // turn handle or mousepointer + sal_uInt32 nObjHdlNum; // required by MarkView + sal_uInt32 nPolyNum; // Polygonpoint + sal_uInt32 nPPntNum; // Point number of the polygon + sal_uInt32 nSourceHdlNum; // still to implement + + bool bSelect : 1; // is a polygon point selected? + bool b1PixMore : 1; // True=handle is shown 1 pixel larger + bool bPlusHdl : 1; // for Hld-Paint optimisation at MarkPoint/UnmarkPoint, and other ... + + bool mbMoveOutside; // forces this handle to be moved outside of the selection rectangle + + // create marker for this kind + virtual void CreateB2dIAObject(); + + // cleanup marker if one exists + void GetRidOfIAObject(); + +private: + bool mbMouseOver; // is true if the mouse is over this handle + +protected: + std::unique_ptr CreateOverlayObject( + const basegfx::B2DPoint& rPos, + BitmapColorIndex eColIndex, BitmapMarkerKind eKindOfMarker, + Point aMoveOutsideOffset = Point()); + static BitmapMarkerKind GetNextBigger(BitmapMarkerKind eKnd); + + // Helper to support inserting a new OverlayObject. It will do all + // necessary stuff involved with that: + // - add GridOffset for non-linear ViewToDevice transformation (calc) + // - add to OverlayManager + // - add to local OverlayObjectList - ownership change (!) + // It is centralized here (and protected) to avoid that new usages/ + // implementations forget one of these needed steps. + void insertNewlyCreatedOverlayObjectForSdrHdl( + std::unique_ptr pOverlayObject, + const sdr::contact::ObjectContact& rObjectContact, + sdr::overlay::OverlayManager& rOverlayManager); + +public: + SdrHdl(); + explicit SdrHdl(const Point& rPnt, SdrHdlKind eNewKind); + virtual ~SdrHdl(); + + const sdr::overlay::OverlayObjectList& getOverlayObjectList() const { return maOverlayGroup; } + + void SetHdlList(SdrHdlList* pList); + SdrHdlKind GetKind() const { return eKind; } + void Touch(); + + const Point& GetPos() const { return aPos; } + void SetPos(const Point& rPnt); + + SdrPageView* GetPageView() const { return pPV; } + void SetPageView(SdrPageView* pNewPV) { pPV=pNewPV; } + + SdrObject* GetObj() const { return pObj; } + void SetObj(SdrObject* pNewObj); + + bool IsSelected() const { return bSelect; } + void SetSelected(bool bJa=true); + + void Set1PixMore(bool bJa=true); + void SetRotationAngle(long n); + + bool IsCornerHdl() const { return eKind==SdrHdlKind::UpperLeft || eKind==SdrHdlKind::UpperRight || eKind==SdrHdlKind::LowerLeft || eKind==SdrHdlKind::LowerRight; } + bool IsVertexHdl() const { return eKind==SdrHdlKind::Upper || eKind==SdrHdlKind::Lower || eKind==SdrHdlKind::Left || eKind==SdrHdlKind::Right; } + + void SetObjHdlNum(sal_uInt32 nNum) { nObjHdlNum=nNum; } + sal_uInt32 GetObjHdlNum() const { return nObjHdlNum; } + + void SetPolyNum(sal_uInt32 nNum) { nPolyNum=nNum; } + sal_uInt32 GetPolyNum() const { return nPolyNum; } + + void SetPointNum(sal_uInt32 nNum) { nPPntNum=nNum; } + sal_uInt32 GetPointNum() const { return nPPntNum; } + + void SetPlusHdl(bool bOn) { bPlusHdl=bOn; } + bool IsPlusHdl() const { return bPlusHdl; } + + void SetSourceHdlNum(sal_uInt32 nNum) { nSourceHdlNum=nNum; } + sal_uInt32 GetSourceHdlNum() const { return nSourceHdlNum; } + + virtual PointerStyle GetPointer() const; + bool IsHdlHit(const Point& rPnt) const; + + virtual bool IsFocusHdl() const; + + void SetMoveOutside( bool bMoveOutside ); + + /** is called when the mouse enters the area of this handle. If the handle changes his + visualisation during mouse over it must override this method and call Touch(). */ + virtual void onMouseEnter(const MouseEvent& rMEvt); + + /** is called when help is requested for the area of this handle */ + virtual void onHelpRequest(); + + /** is called when the mouse leaves the area of this handle. If the handle changes his + visualisation during mouse over it must override this method and call Touch(). */ + virtual void onMouseLeave(); + + static BitmapEx createGluePointBitmap(); +}; + + +#define SDR_HANDLE_COLOR_SIZE_NORMAL Size(13, 13) +#define SDR_HANDLE_COLOR_SIZE_SELECTED Size(17, 17) + +class SVXCORE_DLLPUBLIC SdrHdlColor final : public SdrHdl +{ + // size of colr markers + Size aMarkerSize; + + // color + Color aMarkerColor; + + // callback link when value changed + Link aColorChangeHdl; + + // use luminance values only + bool bUseLuminance : 1; + + // create marker for this kind + SVX_DLLPRIVATE virtual void CreateB2dIAObject() override; + + // help functions + SVX_DLLPRIVATE BitmapEx CreateColorDropper(Color aCol); + SVX_DLLPRIVATE static Color GetLuminance(const Color& rCol); + +public: + explicit SdrHdlColor(const Point& rRef, Color aCol, const Size& rSize, bool bLuminance); + virtual ~SdrHdlColor() override; + + bool IsUseLuminance() const { return bUseLuminance; } + + const Color& GetColor() const { return aMarkerColor; } + void SetColor(Color aNew, bool bCallLink = false); + + void SetSize(const Size& rNew); + + void SetColorChangeHdl(const Link& rLink) { aColorChangeHdl = rLink; } +}; + + +class SdrHdlGradient final : public SdrHdl +{ +private: + // pointer to used color handles + SdrHdlColor* pColHdl1; + SdrHdlColor* pColHdl2; + + // 2nd position + Point a2ndPos; + + // is this a gradient or a transparence + bool bGradient : 1; + + // select which handle to move + bool bMoveSingleHandle : 1; + bool bMoveFirstHandle : 1; + + // create marker for this kind + virtual void CreateB2dIAObject() override; + +public: + SdrHdlGradient(const Point& rRef1, const Point& rRef2, bool bGrad); + virtual ~SdrHdlGradient() override; + + bool IsGradient() const { return bGradient; } + + // set the associated color handles + void SetColorHandles(SdrHdlColor* pL1, SdrHdlColor* pL2) { pColHdl1 = pL1; pColHdl2 = pL2; } + SdrHdlColor* GetColorHdl1() const { return pColHdl1; } + SdrHdlColor* GetColorHdl2() const { return pColHdl2; } + + const Point& Get2ndPos() const { return a2ndPos; } + void Set2ndPos(const Point& rPnt); + + // the link called by the color handles + DECL_LINK(ColorChangeHdl, SdrHdlColor*, void); + + // transformation call, create gradient from this handle + void FromIAOToItem(SdrObject* pObj, bool bSetItemOnObject, bool bUndo); + + // selection flags for interaction + bool IsMoveSingleHandle() const { return bMoveSingleHandle; } + void SetMoveSingleHandle(bool bNew) { bMoveSingleHandle = bNew; } + bool IsMoveFirstHandle() const { return bMoveFirstHandle; } + void SetMoveFirstHandle(bool bNew) { bMoveFirstHandle = bNew; } +}; + + +// Spiegelachse +class SdrHdlLine final : public SdrHdl +{ + // create marker for this kind + virtual void CreateB2dIAObject() override; + + SdrHdl* pHdl1; + SdrHdl* pHdl2; + +public: + SdrHdlLine(SdrHdl& rHdl1, SdrHdl& rHdl2, SdrHdlKind eNewKind) { eKind=eNewKind; pHdl1=&rHdl1; pHdl2=&rHdl2; } + virtual ~SdrHdlLine() override; + + virtual PointerStyle GetPointer() const override; +}; + +// a SdrHdlBezWgt knows about its "base handle". Its draw method +// draws additionally a line from its position to the position +// of the base handle +class SdrHdlBezWgt final : public SdrHdl +{ +public: + // this is not a Copy-Ctor!!! + SdrHdlBezWgt(const SdrHdl* pRefHdl1, SdrHdlKind eNewKind=SdrHdlKind::BezierWeight) { eKind=eNewKind; pHdl1=pRefHdl1; } + virtual ~SdrHdlBezWgt() override; + +private: + // create marker for this kind + virtual void CreateB2dIAObject() override; + + const SdrHdl* pHdl1; +}; + + +class E3dVolumeMarker final : public SdrHdl +{ + basegfx::B2DPolyPolygon aWireframePoly; + + // create marker for this kind + virtual void CreateB2dIAObject() override; + +public: + explicit E3dVolumeMarker(const basegfx::B2DPolyPolygon& rWireframePoly); +}; + + +class ImpEdgeHdl: public SdrHdl +{ + SdrEdgeLineCode eLineCode; + + // create marker for this kind + virtual void CreateB2dIAObject() override; + +public: + ImpEdgeHdl(const Point& rPnt, SdrHdlKind eNewKind): SdrHdl(rPnt,eNewKind),eLineCode(SdrEdgeLineCode::MiddleLine) {} + virtual ~ImpEdgeHdl() override; + + void SetLineCode(SdrEdgeLineCode eCode); + SdrEdgeLineCode GetLineCode() const { return eLineCode; } + bool IsHorzDrag() const; + virtual PointerStyle GetPointer() const override; +}; + + +class ImpMeasureHdl final : public SdrHdl +{ + // create marker for this kind + virtual void CreateB2dIAObject() override; + +public: + ImpMeasureHdl(const Point& rPnt, SdrHdlKind eNewKind): SdrHdl(rPnt,eNewKind) {} + virtual ~ImpMeasureHdl() override; + + virtual PointerStyle GetPointer() const override; +}; + + +class ImpTextframeHdl final : public SdrHdl +{ + const tools::Rectangle maRect; + + // create marker for this kind + virtual void CreateB2dIAObject() override; + +public: + explicit ImpTextframeHdl(const tools::Rectangle& rRect); +}; + + +class SVXCORE_DLLPUBLIC SdrHdlList +{ +protected: + size_t mnFocusIndex; + SdrMarkView* pView; + std::deque> maList; + sal_uInt16 nHdlSize; + + bool bRotateShear : 1; + bool bDistortShear : 1; + bool bMoveOutside : 1; // move handles outwards (for TextEdit) + +private: + SVX_DLLPRIVATE SdrHdlList(const SdrHdlList&) = delete; + SVX_DLLPRIVATE void operator=(const SdrHdlList&) = delete; + +public: + explicit SdrHdlList(SdrMarkView* pV); + ~SdrHdlList(); + void Clear(); + + void TravelFocusHdl(bool bForward); + SdrHdl* GetFocusHdl() const; + void SetFocusHdl(SdrHdl* pNew); + void ResetFocusHdl(); + + // Access to View + SdrMarkView* GetView() const { return pView;} + + // Sorting: 1.Level first reference point handle, then normal handles, next Glue, then User then Plushandles + // 2.Level PageView (Pointer) + // 3.Level Position (x+y) + void Sort(); + size_t GetHdlCount() const { return maList.size(); } + SdrHdl* GetHdl(size_t nNum) const { return nNum < maList.size() ? maList[nNum].get() : nullptr; } + size_t GetHdlNum(const SdrHdl* pHdl) const; + void SetHdlSize(sal_uInt16 nSiz); + sal_uInt16 GetHdlSize() const { return nHdlSize; } + void SetMoveOutside(bool bOn); + bool IsMoveOutside() const { return bMoveOutside; } + void SetRotateShear(bool bOn); + bool IsRotateShear() const { return bRotateShear; } + void SetDistortShear(bool bOn); + bool IsDistortShear() const { return bDistortShear; } + + // AddHdl takes ownership of the handle. It should be on the Heap + // as Clear() deletes it. + void AddHdl(std::unique_ptr pHdl); + std::unique_ptr RemoveHdl(size_t nNum); + void RemoveAllByKind(SdrHdlKind eKind); + + // move the ownership of all the SdrHdl to rOther + void MoveTo(SdrHdlList& rOther); + + // Last inserted handles are likely hit (if the handles are above each other) + SdrHdl* IsHdlListHit(const Point& rPnt) const; + SdrHdl* GetHdl(SdrHdlKind eKind1) const; +}; + + +class SVXCORE_DLLPUBLIC SdrCropHdl final : public SdrHdl +{ +public: + SdrCropHdl( + const Point& rPnt, + SdrHdlKind eNewKind, + double fShearX, + double fRotation); + +private: + // create marker for this kind + virtual void CreateB2dIAObject() override; + + BitmapEx GetBitmapForHandle( const BitmapEx& rBitmap, int nSize ); + + // evtl. shear and rotation, equal to the object's one to allow adaptation of + // the visualization handles + double mfShearX; + double mfRotation; +}; + + +class SdrCropViewHdl final : public SdrHdl +{ +private: + basegfx::B2DHomMatrix maObjectTransform; + Graphic maGraphic; + double mfCropLeft; + double mfCropTop; + double mfCropRight; + double mfCropBottom; + +public: + SdrCropViewHdl( + const basegfx::B2DHomMatrix& rObjectTransform, + const Graphic& rGraphic, + double fCropLeft, + double fCropTop, + double fCropRight, + double fCropBottom); + +private: + // create marker for this kind + virtual void CreateB2dIAObject() override; +}; + + +#endif // INCLUDED_SVX_SVDHDL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdhlpln.hxx b/include/svx/svdhlpln.hxx new file mode 100644 index 000000000..aa850773c --- /dev/null +++ b/include/svx/svdhlpln.hxx @@ -0,0 +1,91 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVDHLPLN_HXX +#define INCLUDED_SVX_SVDHLPLN_HXX + +#include +#include + +#include + +#include +#include + +class OutputDevice; +enum class PointerStyle; + +enum class SdrHelpLineKind { Point, Vertical, Horizontal }; + +#define SDRHELPLINE_POINT_PIXELSIZE 15 /* actual size = PIXELSIZE*2+1 */ + +class SdrHelpLine { + Point aPos; // X or Y may be unimportant, depending on the value of eKind + SdrHelpLineKind eKind; + +public: + explicit SdrHelpLine(SdrHelpLineKind eNewKind=SdrHelpLineKind::Point): eKind(eNewKind) {} + SdrHelpLine(SdrHelpLineKind eNewKind, const Point& rNewPos): aPos(rNewPos), eKind(eNewKind) {} + bool operator==(const SdrHelpLine& rCmp) const { return aPos==rCmp.aPos && eKind==rCmp.eKind; } + bool operator!=(const SdrHelpLine& rCmp) const { return !operator==(rCmp); } + + void SetKind(SdrHelpLineKind eNewKind) { eKind=eNewKind; } + SdrHelpLineKind GetKind() const { return eKind; } + void SetPos(const Point& rPnt) { aPos=rPnt; } + const Point& GetPos() const { return aPos; } + + PointerStyle GetPointer() const; + bool IsHit(const Point& rPnt, sal_uInt16 nTolLog, const OutputDevice& rOut) const; + // OutputDevice is required because capture points have a fixed pixel size + tools::Rectangle GetBoundRect(const OutputDevice& rOut) const; +}; + +#define SDRHELPLINE_NOTFOUND 0xFFFF + +class SVXCORE_DLLPUBLIC SdrHelpLineList { + std::vector> aList; + +public: + SdrHelpLineList() {} + SdrHelpLineList(const SdrHelpLineList& rSrcList) { *this=rSrcList; } + SdrHelpLineList& operator=(const SdrHelpLineList& rSrcList); + bool operator==(const SdrHelpLineList& rCmp) const; + bool operator!=(const SdrHelpLineList& rCmp) const { return !operator==(rCmp); } + sal_uInt16 GetCount() const { return sal_uInt16(aList.size()); } + void Insert(const SdrHelpLine& rHL) { aList.emplace_back(new SdrHelpLine(rHL)); } + void Insert(const SdrHelpLine& rHL, sal_uInt16 nPos) + { + if(nPos==0xFFFF) + aList.emplace_back(new SdrHelpLine(rHL)); + else + aList.emplace(aList.begin() + nPos, new SdrHelpLine(rHL)); + } + void Delete(sal_uInt16 nPos) + { + aList.erase(aList.begin() + nPos); + } + SdrHelpLine& operator[](sal_uInt16 nPos) { return *aList[nPos]; } + const SdrHelpLine& operator[](sal_uInt16 nPos) const { return *aList[nPos]; } + sal_uInt16 HitTest(const Point& rPnt, sal_uInt16 nTolLog, const OutputDevice& rOut) const; +}; + + +#endif // INCLUDED_SVX_SVDHLPLN_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svditer.hxx b/include/svx/svditer.hxx new file mode 100644 index 000000000..8f1b022db --- /dev/null +++ b/include/svx/svditer.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_SVX_SVDITER_HXX +#define INCLUDED_SVX_SVDITER_HXX + +#include + +#include + +class SdrObjList; +class SdrObject; +class SdrPage; +class SdrMarkList; + +// SdrObjListIter methods: +// SdrIterMode::Flat : Flat over the list +// SdrIterMode::DeepWithGroups : With recursive descent parser, Next() also returns group objects +// SdrIterMode::DeepNoGroups : With recursive descent parser, Next() returns no group objects +enum class SdrIterMode { Flat, DeepWithGroups, DeepNoGroups }; + +class SVXCORE_DLLPUBLIC SdrObjListIter +{ + std::vector< const SdrObject* > maObjList; + size_t mnIndex; + bool mbReverse; + bool mbUseZOrder; + + void ImpProcessObjectList(const SdrObjList& rSdrObjList, SdrIterMode eMode); + void ImpProcessMarkList(const SdrMarkList& rMarkList, SdrIterMode eMode); + void ImpProcessObj(const SdrObject& rSdrObject, SdrIterMode eMode); + +public: + explicit SdrObjListIter(const SdrObjList* pObjList, SdrIterMode eMode = SdrIterMode::DeepNoGroups, bool bReverse = false); + explicit SdrObjListIter(const SdrObjList* pObjList, bool bUseZOrder, SdrIterMode eMode = SdrIterMode::DeepNoGroups, bool bReverse = false); + + /* SJ: the following function can now be used with every + SdrObject and is no longer limited to group objects */ + explicit SdrObjListIter(const SdrObject& rSdrObject, SdrIterMode eMode = SdrIterMode::DeepNoGroups, bool bReverse = false); + explicit SdrObjListIter(const SdrPage* pSdrPage, SdrIterMode eMode = SdrIterMode::DeepNoGroups, bool bReverse = false); + + /** Iterates over a list of marked objects received from the SdrMarkView. TTTT used in sc */ + explicit SdrObjListIter(const SdrMarkList& rMarkList, SdrIterMode eMode = SdrIterMode::DeepNoGroups); + + void Reset() { mnIndex = (mbReverse ? maObjList.size() : 0L); } + bool IsMore() const { return (mbReverse ? mnIndex != 0 : ( mnIndex < maObjList.size())); } + SdrObject* Next() + { + const size_t idx(mbReverse ? --mnIndex : mnIndex++); + return (idx < maObjList.size()) ? const_cast< SdrObject* >(maObjList[idx]) : nullptr; + } + + size_t Count() { return maObjList.size(); } +}; + +#endif // INCLUDED_SVX_SVDITER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdlayer.hxx b/include/svx/svdlayer.hxx new file mode 100644 index 000000000..cc9e0d4bf --- /dev/null +++ b/include/svx/svdlayer.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_SVX_SVDLAYER_HXX +#define INCLUDED_SVX_SVDLAYER_HXX + +#include +#include +#include +#include +#include + +/** + * Note on the layer mix with symbolic/ID-based interface: + * You create a new layer with + * pLayerAdmin->NewLayer("A new layer"); + * This layer is automatically appended to the end of the list. + * + * The same holds true for layer sets. + * + * The interface for SdrLayerSet is based on LayerIDs. The app must get + * an ID for it at the SdrLayerAdmin, like so: + * SdrLayerID nLayerID=pLayerAdmin->GetLayerID("A new layer"); + * + * If the layer cannot be found, SDRLAYER_NOTFOUND is returned. + * The methods with the ID interface usually handle that error in a + * meaningful way. + * If you not only got a name, but even a SdrLayer*, you can get the ID + * much faster via the layer directly. + * + * @param bInherited: + * TRUE If the layer/layer set cannot be found, we examine the parent layer admin, + * whether there's a corresponding definition + * FALSE We only search this layer admin + * + * Every page's layer admin has a parent layer admin (the model's). The model + * itself does not have a parent. + */ + +class SdrModel; + +class SVXCORE_DLLPUBLIC SdrLayer +{ + friend class SdrLayerAdmin; + + OUString maName; + OUString maTitle; + OUString maDescription; + bool mbVisibleODF; // corresponds to ODF draw:display + bool mbPrintableODF; // corresponds to ODF draw:display + bool mbLockedODF; // corresponds to ODF draw:protected + SdrModel* pModel; // For broadcasting + SdrLayerID nID; + + SdrLayer(SdrLayerID nNewID, const OUString& rNewName); + +public: + bool operator==(const SdrLayer& rCmpLayer) const; + + void SetName(const OUString& rNewName); + const OUString& GetName() const { return maName; } + + void SetTitle(const OUString& rTitle) { maTitle = rTitle; } + const OUString& GetTitle() const { return maTitle; } + + void SetDescription(const OUString& rDesc) { maDescription = rDesc; } + const OUString& GetDescription() const { return maDescription; } + + void SetVisibleODF(bool bVisibleODF) { mbVisibleODF = bVisibleODF; } + bool IsVisibleODF() const { return mbVisibleODF; } + + void SetPrintableODF(bool bPrintableODF) { mbPrintableODF = bPrintableODF; } + bool IsPrintableODF() const { return mbPrintableODF; } + + void SetLockedODF(bool bLockedODF) { mbLockedODF = bLockedODF; } + bool IsLockedODF() const { return mbLockedODF; } + + SdrLayerID GetID() const { return nID; } + void SetModel(SdrModel* pNewModel) { pModel=pNewModel; } +}; + +#define SDRLAYER_MAXCOUNT 255 +#define SDRLAYERPOS_NOTFOUND 0xffff + +// When Changing the layer data you currently have to set the Modify flag manually +class SVXCORE_DLLPUBLIC SdrLayerAdmin { +friend class SdrView; +friend class SdrModel; +friend class SdrPage; + +protected: + std::vector> maLayers; + SdrLayerAdmin* pParent; // The page's admin knows the doc's admin + SdrModel* pModel; // For broadcasting + OUString maControlLayerName; +protected: + // Find a LayerID which is not in use yet. If all have been used up, + // we return 0. + // If you want to play safe, check GetLayerCount() pLayer, sal_uInt16 nPos); + std::unique_ptr RemoveLayer(sal_uInt16 nPos); + + // Delete all layers + void ClearLayers(); + + // New layer is created and inserted + SdrLayer* NewLayer(const OUString& rName, sal_uInt16 nPos=0xFFFF); + + // Iterate over all layers + sal_uInt16 GetLayerCount() const { return sal_uInt16(maLayers.size()); } + + SdrLayer* GetLayer(sal_uInt16 i) { return maLayers[i].get(); } + const SdrLayer* GetLayer(sal_uInt16 i) const { return maLayers[i].get(); } + + sal_uInt16 GetLayerPos(const SdrLayer* pLayer) const; + + SdrLayer* GetLayer(const OUString& rName); + const SdrLayer* GetLayer(const OUString& rName) const; + SdrLayerID GetLayerID(const OUString& rName) const; + SdrLayer* GetLayerPerID(SdrLayerID nID) { return const_cast(const_cast(this)->GetLayerPerID(nID)); } + const SdrLayer* GetLayerPerID(SdrLayerID nID) const; + + void SetControlLayerName(const OUString& rNewName); + const OUString& GetControlLayerName() const { return maControlLayerName; } + + // Removes all elements in rOutSet and then adds all IDs of layers from member aLayer + // that fulfill the criterion visible, printable, or locked respectively. + void getVisibleLayersODF( SdrLayerIDSet& rOutSet) const; + void getPrintableLayersODF( SdrLayerIDSet& rOutSet) const; + void getLockedLayersODF( SdrLayerIDSet& rOutSet) const; + + // Generates a bitfield for settings.xml from the SdrLayerIDSet. + // Output is a UNO sequence of BYTE (which is 'short' in API). + void QueryValue(const SdrLayerIDSet& rViewLayerSet, css::uno::Any& rAny); +}; + +#endif // INCLUDED_SVX_SVDLAYER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdmark.hxx b/include/svx/svdmark.hxx new file mode 100644 index 000000000..f5f9c7b53 --- /dev/null +++ b/include/svx/svdmark.hxx @@ -0,0 +1,263 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVDMARK_HXX +#define INCLUDED_SVX_SVDMARK_HXX + +#include +#include +#include +#include + +#include +#include +#include + +namespace tools { class Rectangle; } +class SdrPage; +class SdrObjList; +class SdrObject; +class SdrPageView; + +typedef std::set SdrUShortCont; + + +/** + * Everything a View needs to know about a selected object + */ +class SVXCORE_DLLPUBLIC SdrMark final : public sdr::ObjectUser +{ + sal_Int64 mnTimeStamp; + SdrObject* mpSelectedSdrObject; // the selected object + SdrPageView* mpPageView; + SdrUShortCont maPoints; // Selected Points + SdrUShortCont maGluePoints; // Selected Gluepoints (their Id's) + bool mbCon1; // for Connectors + bool mbCon2; // for Connectors + sal_uInt16 mnUser; // E.g. for CopyObjects, also copy Edges + + void setTime(); + +public: + explicit SdrMark(SdrObject* pNewObj = nullptr, SdrPageView* pNewPageView = nullptr); + SdrMark(const SdrMark& rMark); + virtual ~SdrMark(); + + // Derived from ObjectUser + virtual void ObjectInDestruction(const SdrObject& rObject) override; + + SdrMark& operator=(const SdrMark& rMark); + + void SetMarkedSdrObj(SdrObject* pNewObj); + SdrObject* GetMarkedSdrObj() const { return mpSelectedSdrObject;} + + SdrPageView* GetPageView() const + { + return mpPageView; + } + + void SetPageView(SdrPageView* pNewPageView) + { + mpPageView = pNewPageView; + } + + void SetCon1(bool bOn) + { + mbCon1 = bOn; + } + + bool IsCon1() const + { + return mbCon1; + } + + void SetCon2(bool bOn) + { + mbCon2 = bOn; + } + + bool IsCon2() const + { + return mbCon2; + } + + void SetUser(sal_uInt16 nVal) + { + mnUser = nVal; + } + + sal_uInt16 GetUser() const + { + return mnUser; + } + + const SdrUShortCont& GetMarkedPoints() const + { + return maPoints; + } + + const SdrUShortCont& GetMarkedGluePoints() const + { + return maGluePoints; + } + + SdrUShortCont& GetMarkedPoints() + { + return maPoints; + } + + SdrUShortCont& GetMarkedGluePoints() + { + return maGluePoints; + } + + sal_Int64 getTimeStamp() const + { + return mnTimeStamp; + } +}; + +class SVXCORE_DLLPUBLIC SdrMarkList final +{ + std::vector> maList; + + OUString maMarkName; + OUString maPointName; + OUString maGluePointName; + + bool mbPointNameOk; + bool mbGluePointNameOk; + bool mbNameOk; + bool mbSorted; + + SVX_DLLPRIVATE void ImpForceSort(); + SVX_DLLPRIVATE const OUString& GetPointMarkDescription(bool bGlue) const; + +public: + SdrMarkList() + : maList(), + mbPointNameOk(false), + mbGluePointNameOk(false), + mbNameOk(false), + mbSorted(true) + { + } + + SdrMarkList(const SdrMarkList& rLst) + : maList() + { + *this = rLst; + } + + ~SdrMarkList() + { + Clear(); + } + + void Clear(); + void ForceSort() const; + void SetUnsorted() + { + mbSorted = false; + } + + size_t GetMarkCount() const + { + return maList.size(); + } + + SdrMark* GetMark(size_t nNum) const; + // returns SAL_MAX_SIZE if not found + size_t FindObject(const SdrObject* pObj) const; + void InsertEntry(const SdrMark& rMark, bool bChkSort = true); + void DeleteMark(size_t nNum); + void ReplaceMark(const SdrMark& rNewMark, size_t nNum); + void Merge(const SdrMarkList& rSrcList, bool bReverse = false); + bool DeletePageView(const SdrPageView& rPV); + bool InsertPageView(const SdrPageView& rPV); + + void SetNameDirty() + { + mbNameOk = false; + mbPointNameOk = false; + mbGluePointNameOk = false; + } + + // A verbal description of selected objects e.g.: + // "27 Lines", "12 Objects", "Polygon" or even "Not an object" + const OUString& GetMarkDescription() const; + const OUString& GetPointMarkDescription() const + { + return GetPointMarkDescription(false); + } + + const OUString& GetGluePointMarkDescription() const + { + return GetPointMarkDescription(true); + } + + // pPage=0: Selection of everything! Respect Pages + bool TakeBoundRect(SdrPageView const * pPageView, tools::Rectangle& rRect) const; + bool TakeSnapRect(SdrPageView const * pPageView, tools::Rectangle& rRect) const; + + // All Entries are copied! + SdrMarkList& operator=(const SdrMarkList& rLst); +}; + + +// migrate selections + +namespace sdr +{ + class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) ViewSelection + { + SdrMarkList maMarkedObjectList; + SdrMarkList maEdgesOfMarkedNodes; + SdrMarkList maMarkedEdgesOfMarkedNodes; + std::vector maAllMarkedObjects; + + bool mbEdgesOfMarkedNodesDirty : 1; + + SVX_DLLPRIVATE void ImpForceEdgesOfMarkedNodes(); + SVX_DLLPRIVATE void ImplCollectCompleteSelection(SdrObject* pObj); + + public: + ViewSelection(); + + void SetEdgesOfMarkedNodesDirty(); + + const SdrMarkList& GetMarkedObjectList() const + { + return maMarkedObjectList; + } + + const SdrMarkList& GetEdgesOfMarkedNodes() const; + const SdrMarkList& GetMarkedEdgesOfMarkedNodes() const; + const std::vector& GetAllMarkedObjects() const; + + SdrMarkList& GetMarkedObjectListWriteAccess() + { + return maMarkedObjectList; + } + }; +} // end of namespace sdr + +#endif // INCLUDED_SVX_SVDMARK_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx new file mode 100644 index 000000000..a02cf8f5d --- /dev/null +++ b/include/svx/svdmodel.hxx @@ -0,0 +1,633 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVDMODEL_HXX +#define INCLUDED_SVX_SVDMODEL_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +class OutputDevice; +#include +#include + +#include +#include + +#ifdef DBG_UTIL +// SdrObjectLifetimeWatchDog +#include +#endif + +#define DEGREE_CHAR u'\x00B0' /* U+00B0 DEGREE SIGN */ + +class SdrOutliner; +class SdrLayerAdmin; +class SdrObjList; +class SdrObject; +class SdrPage; +class SdrPageView; +class SdrTextObj; +class SdrUndoAction; +class SdrUndoGroup; +class AutoTimer; +class SfxItemPool; +class SfxItemSet; +class SfxRepeatTarget; +class SfxStyleSheet; +class SfxUndoAction; +class SfxUndoManager; +class XBitmapList; +class XColorList; +class XDashList; +class XGradientList; +class XHatchList; +class XLineEndList; +class SvxForbiddenCharactersTable; +class SvNumberFormatter; +class SdrOutlinerCache; +class SdrUndoFactory; +class ImageMap; +class TextChain; +enum class CharCompressType; +namespace comphelper +{ + class IEmbeddedHelper; + class LifecycleProxy; +} +namespace sfx2 +{ + class LinkManager; +} + + +enum class SdrHintKind +{ + LayerChange, // changed layer definition + LayerOrderChange, // order of layer changed (Insert/Remove/ChangePos) + PageOrderChange, // order of pages (object pages or master pages) changed (Insert/Remove/ChangePos) + ObjectChange, // object changed + ObjectInserted, // new object inserted + ObjectRemoved, // symbol object removed from list + ModelCleared, // deleted the whole model (no pages exist anymore). not impl. + RefDeviceChange, // RefDevice changed + DefaultTabChange, // Default tabulator width changed + SwitchToPage, // #94278# UNDO/REDO at an object evtl. on another page + BeginEdit, // Is called after the object has entered text edit mode + EndEdit // Is called after the object has left text edit mode +}; + +class SVXCORE_DLLPUBLIC SdrHint final : public SfxHint +{ +private: + SdrHintKind meHint; + const SdrObject* mpObj; + const SdrPage* mpPage; + +public: + explicit SdrHint(SdrHintKind eNewHint); + explicit SdrHint(SdrHintKind eNewHint, const SdrObject& rNewObj); + explicit SdrHint(SdrHintKind eNewHint, const SdrPage* pPage); + explicit SdrHint(SdrHintKind eNewHint, const SdrObject& rNewObj, const SdrPage* pPage); + + const SdrPage* GetPage() const { return mpPage;} + const SdrObject* GetObject() const { return mpObj;} + SdrHintKind GetKind() const { return meHint;} +}; + +//////////////////////////////////////////////////////////////////////////////////////////////////// +// +// SdrModel +// DlgEdModel +// FmFormModel +// ScDrawLayer +// SdDrawDocument +// SwDrawModel +// OReportModel + +struct SdrModelImpl; + +class SVXCORE_DLLPUBLIC SdrModel : public SfxBroadcaster, public tools::WeakBase +{ +private: +#ifdef DBG_UTIL + // SdrObjectLifetimeWatchDog: + // Use maAllIncarnatedObjects to keep track of all SdrObjects incarnated using this SdrModel + // (what is now possible after the paradigm change that a SdrObject stays at a single SdrModel + // for it's whole lifetime). + // The two methods are exclusive, debug-only, only-accessible-by SdrObject accesses to else + // hidden/non-existing maAllIncarnatedObjects. + // SdrObject::SdrObject uses impAddIncarnatedSdrObjectToSdrModel, while SdrObject::~SdrObject + // uses impRemoveIncarnatedSdrObjectToSdrModel. + // There are two places which may trigger SAL_WARN warnings: + // - impRemoveIncarnatedSdrObjectToSdrModel when the to-be-removed SdrObject is not member of SdrModel + // - SdrModel::~SdrModel after all SdrObjects *should* be cleaned-up. + // SdrModel::~SdrModel will also - for convenience - Free the non-deleted SdrObjects if there + // are any. + // Using std::unordered_set will use quasi constant access times, so this watchdog will not + // be expensive. Nonetheless, only use with debug code. It may be seductive to use this in + // product code, too, especially if it will indeed trigger - but its intention is clearly + // to find/identify MemoryLeaks caused by SdrObjects + friend void impAddIncarnatedSdrObjectToSdrModel(const SdrObject& rSdrObject, SdrModel& rSdrModel); + friend void impRemoveIncarnatedSdrObjectToSdrModel(const SdrObject& rSdrObject, SdrModel& rSdrModel); + std::unordered_set< const SdrObject* > maAllIncarnatedObjects; +#endif +protected: + std::vector maMaPag; // master pages + std::vector maPages; + std::function)> m_aUndoLink; // link to a NotifyUndo-Handler + Size m_aMaxObjSize; // e.g. for auto-growing text + Fraction m_aObjUnit; // description of the coordinate units for ClipBoard, Drag&Drop, ... + MapUnit m_eObjUnit; // see above + FieldUnit m_eUIUnit; // unit, scale (e.g. 1/1000) for the UI (status bar) is set by ImpSetUIUnit() + Fraction m_aUIScale; // see above + OUString m_aUIUnitStr; // see above + Fraction m_aUIUnitFact; // see above + int m_nUIUnitDecimalMark; // see above + + std::unique_ptr m_pLayerAdmin; + SfxItemPool* m_pItemPool; + comphelper::IEmbeddedHelper* + m_pEmbeddedHelper; // helper for embedded objects to get rid of the SfxObjectShell + std::unique_ptr m_pDrawOutliner; // an Outliner for outputting text + std::unique_ptr m_pHitTestOutliner;// an Outliner for the HitTest + std::unique_ptr m_pChainingOutliner; // an Outliner for chaining overflowing text + sal_Int32 mnDefTextHgt; // Default text height in logical units + VclPtr m_pRefOutDev; // ReferenceDevice for the EditEngine + rtl::Reference< SfxStyleSheetBasePool > mxStyleSheetPool; + SfxStyleSheet* m_pDefaultStyleSheet; + SfxStyleSheet* mpDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj; // #i119287# + sfx2::LinkManager* m_pLinkManager; // LinkManager + std::unique_ptr>> m_pUndoStack; + std::unique_ptr>> m_pRedoStack; + std::unique_ptr m_pCurrentUndoGroup; // For multi-level + sal_uInt16 m_nUndoLevel; // undo nesting + bool m_bMyPool:1; // to clean up pMyPool from 303a + bool mbUndoEnabled:1; // If false no undo is recorded or we are during the execution of an undo action + bool mbChanged:1; + bool m_bPagNumsDirty:1; + bool m_bMPgNumsDirty:1; + bool m_bTransportContainer:1; // doc is temporary object container, no display (e.g. clipboard) + bool m_bReadOnly:1; + bool m_bTransparentTextFrames:1; + bool m_bSwapGraphics:1; + bool m_bPasteResize:1; // Objects are being resized due to Paste with different MapMode + bool m_bStarDrawPreviewMode:1; + bool mbDisableTextEditUsesCommonUndoManager:1; + sal_uInt16 m_nDefaultTabulator; + sal_uInt32 m_nMaxUndoCount; + + std::unique_ptr m_pTextChain; + + +public: + std::shared_ptr mpForbiddenCharactersTable; + + std::unique_ptr mpOutlinerCache; + //get a vector of all the SdrOutliner belonging to the model + std::vector GetActiveOutliners() const; + std::unique_ptr mpImpl; + CharCompressType mnCharCompressType; + sal_uInt16 mnHandoutPageCount; + bool mbModelLocked; + bool mbKernAsianPunctuation; + bool mbAddExtLeading; + bool mbInDestruction; + + // Color, Dash, Line-End, Hatch, Gradient, Bitmap property lists ... + o3tl::enumarray maProperties; + + sal_uInt16 getHandoutPageCount() const { return mnHandoutPageCount; } + void setHandoutPageCount( sal_uInt16 nHandoutPageCount ) { mnHandoutPageCount = nHandoutPageCount; } + + // Adapt to given Size and Borders scaling all contained data, maybe + // including PresObj's in higher derivations + virtual void adaptSizeAndBorderForAllPages( + const Size& rNewSize, + long nLeft = 0, + long nRight = 0, + long nUpper = 0, + long nLower = 0); + +protected: + virtual css::uno::Reference< css::uno::XInterface > createUnoModel(); + +private: + SdrModel(const SdrModel& rSrcModel) = delete; + void operator=(const SdrModel& rSrcModel) = delete; + bool operator==(const SdrModel& rCmpModel) const = delete; + SVX_DLLPRIVATE void ImpPostUndoAction(std::unique_ptr pUndo); + SVX_DLLPRIVATE void ImpSetUIUnit(); + SVX_DLLPRIVATE void ImpSetOutlinerDefaults( SdrOutliner* pOutliner, bool bInit = false ); + SVX_DLLPRIVATE void ImpReformatAllTextObjects(); + SVX_DLLPRIVATE void ImpReformatAllEdgeObjects(); + SVX_DLLPRIVATE void ImpCreateTables(bool bDisablePropertyFiles); + + SVX_DLLPRIVATE void ImpCtor( + SfxItemPool* pPool, + ::comphelper::IEmbeddedHelper* pPers, + bool bDisablePropertyFiles); + + // this is a weak reference to a possible living api wrapper for this model + css::uno::Reference< css::uno::XInterface > mxUnoModel; + + // used to disable unique name checking during page move + bool mbMakePageObjectsNamesUnique = true; + +public: + SVX_DLLPRIVATE virtual bool IsCreatingDataObj() const { return false; } + bool IsTransportContainer() const { return m_bTransportContainer; } + bool IsPasteResize() const { return m_bPasteResize; } + void SetPasteResize(bool bOn) { m_bPasteResize=bOn; } + // If a custom Pool is put here, the class will call methods + // on it (Put(), Remove()). On disposal of SdrModel the pool + // will be deleted with delete. + // If you give NULL instead, it will create an own pool (SdrItemPool) + // which will also be disposed in the destructor. + // If you do use a custom Pool, make sure you inherit from SdrItemPool, + // if you want to use symbol objects inherited from SdrAttrObj. + // If, however, you use objects inheriting from SdrObject you are free + // to chose a pool of your liking. + // + // tdf#118731 a bDisablePropertyFiles of true will disable ability to load + // XPropertyFiles describing defaults. Useful for UI preview widgets + explicit SdrModel( + SfxItemPool* pPool = nullptr, + ::comphelper::IEmbeddedHelper* pPers = nullptr, + bool bDisablePropertyFiles = false); + virtual ~SdrModel() override; + void ClearModel(bool bCalledFromDestructor); + + // Override this to enable the Swap/LoadOnDemand of graphics. + // If rbDeleteAfterUse is set to sal_True the SvStream instance from + // the caller will be disposed after use. + // If this method returns NULL, a temporary file will be allocated for + // swapping. + // The stream from which the model was loaded or in which is was saved last + // needs to be delivered + virtual css::uno::Reference< + css::embed::XStorage> GetDocumentStorage() const; + css::uno::Reference< + css::io::XInputStream > + GetDocumentStream(OUString const& rURL, + ::comphelper::LifecycleProxy const & rProxy) const; + // Change the template attributes of the symbol objects to hard attributes + void BurnInStyleSheetAttributes(); + // If you inherit from SdrPage you also need to inherit from SdrModel + // and implement both VM AllocPage() and AllocModel()... + virtual SdrPage* AllocPage(bool bMasterPage); + virtual SdrModel* AllocModel() const; + + // Changes on the layers set the modified flag and broadcast on the model! + const SdrLayerAdmin& GetLayerAdmin() const { return *m_pLayerAdmin; } + SdrLayerAdmin& GetLayerAdmin() { return *m_pLayerAdmin; } + + const SfxItemPool& GetItemPool() const { return *m_pItemPool; } + SfxItemPool& GetItemPool() { return *m_pItemPool; } + + SdrOutliner& GetDrawOutliner(const SdrTextObj* pObj=nullptr) const; + + SdrOutliner& GetHitTestOutliner() const { return *m_pHitTestOutliner; } + const SdrTextObj* GetFormattingTextObj() const; + // put the TextDefaults (Font,Height,Color) in a Set + void SetTextDefaults() const; + static void SetTextDefaults( SfxItemPool* pItemPool, sal_Int32 nDefTextHgt ); + + SdrOutliner& GetChainingOutliner(const SdrTextObj* pObj) const; + TextChain * GetTextChain() const; + + // ReferenceDevice for the EditEngine + void SetRefDevice(OutputDevice* pDev); + OutputDevice* GetRefDevice() const { return m_pRefOutDev.get(); } + // If a new MapMode is set on the RefDevice (or similar) + void RefDeviceChanged(); // not yet implemented + // default font height in logical units + void SetDefaultFontHeight(sal_Int32 nVal); + // default tabulator width for the EditEngine + void SetDefaultTabulator(sal_uInt16 nVal); + sal_uInt16 GetDefaultTabulator() const { return m_nDefaultTabulator; } + + // The DefaultStyleSheet will be used in every symbol object which is inserted + // in this model and does not have a StyleSheet set. + SfxStyleSheet* GetDefaultStyleSheet() const { return m_pDefaultStyleSheet; } + void SetDefaultStyleSheet(SfxStyleSheet* pDefSS) { m_pDefaultStyleSheet = pDefSS; } + + // #i119287# default StyleSheet for SdrGrafObj and SdrOle2Obj + SfxStyleSheet* GetDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj() const { return mpDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj; } + void SetDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj(SfxStyleSheet* pDefSS) { mpDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj = pDefSS; } + + sfx2::LinkManager* GetLinkManager() { return m_pLinkManager; } + void SetLinkManager( sfx2::LinkManager* pLinkMgr ) { m_pLinkManager = pLinkMgr; } + + ::comphelper::IEmbeddedHelper* GetPersist() const { return m_pEmbeddedHelper; } + void SetPersist( ::comphelper::IEmbeddedHelper *p ) { m_pEmbeddedHelper = p; } + + // Unit for the symbol coordination + // Default is 1 logical unit = 1/100mm (Unit=MapUnit::Map100thMM, Fract=(1,1)). + // Examples: + // MapUnit::MapPoint, Fraction(72,1) : 1 log Einh = 72 Point = 1 Inch + // MapUnit::MapPoint, Fraction(1,20) : 1 log Einh = 1/20 Point = 1 Twip + // MapUnit::MapTwip, Fraction(1,1) : 1 log Einh = 1 Twip + // MapUnit::Map100thMM, Fraction(1,10) : 1 log Einh = 1/1000mm + // MapUnit::MapMM, Fraction(1000,1) : 1 log Einh = 1000mm = 1m + // MapUnit::MapCM, Fraction(100,1) : 1 log Einh = 100cm = 1m + // MapUnit::MapCM, Fraction(100000,1): 1 log Einh = 100000cm = 1km + // (FWIW: you cannot represent light years). + // The scaling unit is needed for the Engine to serve the Clipboard + // with the correct sizes. + MapUnit GetScaleUnit() const { return m_eObjUnit; } + void SetScaleUnit(MapUnit eMap); + const Fraction& GetScaleFraction() const { return m_aObjUnit; } + void SetScaleFraction(const Fraction& rFrac); + // Setting both simultaneously performs a little better + void SetScaleUnit(MapUnit eMap, const Fraction& rFrac); + + // maximal size e.g. for auto growing texts + const Size& GetMaxObjSize() const { return m_aMaxObjSize; } + void SetMaxObjSize(const Size& rSiz) { m_aMaxObjSize=rSiz; } + + // For the View! to display sane numbers in the status bar: Default is mm. + void SetUIUnit(FieldUnit eUnit); + FieldUnit GetUIUnit() const { return m_eUIUnit; } + // The scale of the drawing. Default 1/1. + void SetUIScale(const Fraction& rScale); + const Fraction& GetUIScale() const { return m_aUIScale; } + // Setting both simultaneously performs a little better + void SetUIUnit(FieldUnit eUnit, const Fraction& rScale); + + static OUString GetUnitString(FieldUnit eUnit); + OUString GetMetricString(long nVal, bool bNoUnitChars = false, sal_Int32 nNumDigits = -1) const; + static OUString GetAngleString(long nAngle); + static OUString GetPercentString(const Fraction& rVal); + + // RecalcPageNums is ordinarily only called by the Page. + bool IsPagNumsDirty() const { return m_bPagNumsDirty; }; + bool IsMPgNumsDirty() const { return m_bMPgNumsDirty; }; + void RecalcPageNums(bool bMaster); + // After the Insert the Page belongs to the SdrModel. + virtual void InsertPage(SdrPage* pPage, sal_uInt16 nPos=0xFFFF); + virtual void DeletePage(sal_uInt16 nPgNum); + // Remove means transferring ownership to the caller (opposite of Insert) + virtual SdrPage* RemovePage(sal_uInt16 nPgNum); + virtual void MovePage(sal_uInt16 nPgNum, sal_uInt16 nNewPos); + const SdrPage* GetPage(sal_uInt16 nPgNum) const; + SdrPage* GetPage(sal_uInt16 nPgNum); + sal_uInt16 GetPageCount() const; + virtual void PageListChanged(); + + // Masterpages + virtual void InsertMasterPage(SdrPage* pPage, sal_uInt16 nPos=0xFFFF); + void DeleteMasterPage(sal_uInt16 nPgNum); + // Remove means transferring ownership to the caller (opposite of Insert) + virtual SdrPage* RemoveMasterPage(sal_uInt16 nPgNum); + void MoveMasterPage(sal_uInt16 nPgNum, sal_uInt16 nNewPos); + const SdrPage* GetMasterPage(sal_uInt16 nPgNum) const; + SdrPage* GetMasterPage(sal_uInt16 nPgNum); + sal_uInt16 GetMasterPageCount() const; + virtual void MasterPageListChanged(); + + // modified flag. Is set automatically when something changes on the Pages + // symbol objects. You need to reset it yourself, however, e.g. on Save(). + bool IsChanged() const { return mbChanged; } + virtual void SetChanged(bool bFlg = true); + + // If set to sal_True, graphics from graphics objects will: + // - not be loaded immediately when loading a document, + // but only once they are needed (e.g. displayed). + // - be pruned from memory if they are not needed. + // For that to work, override the virtual method GetDocumentStream(). + // Default=FALSE. Flag is not persistent. + bool IsSwapGraphics() const { return m_bSwapGraphics; } + void SetSwapGraphics(); + + // Text frames without filling can be select with a mouse click by default (sal_False). + // With this flag set to true you can hit them only in the area in which text is to be + // found. + bool IsPickThroughTransparentTextFrames() const { return m_bTransparentTextFrames; } + void SetPickThroughTransparentTextFrames(bool bOn) { m_bTransparentTextFrames=bOn; } + + // Can the model be changed at all? + // Is only evaluated by the possibility methods of the View. + // Direct manipulations on the model, ... do not respect this flag. + // Override this and return the appropriate ReadOnly status + // of the files, i.e. true or false. (Method is called multiple + // times, so use one flag only!) + virtual bool IsReadOnly() const; + void SetReadOnly(bool bYes); + + // Mixing two SdrModels. Mind that rSourceModel is not const. + // The pages will not be copied but moved, when inserted. + // rSourceModel may very well be empty afterwards. + // nFirstPageNum,nLastPageNum: The pages to take from rSourceModel + // nDestPos..................: position to insert + // bMergeMasterPages.........: sal_True = needed MasterPages will be taken + // from rSourceModel + // sal_False= the MasterPageDescriptors of + // the pages of the rSourceModel will be + // mapped on the existing MasterPages. + // bUndo.....................: An undo action is generated for the merging. + // Undo is only for the target model, not for the + // rSourceModel. + // bTreadSourceAsConst.......: sal_True=the SourceModel will not be changed, + // so pages will be copied. + virtual void Merge(SdrModel& rSourceModel, + sal_uInt16 nFirstPageNum, sal_uInt16 nLastPageNum, + sal_uInt16 nDestPos, + bool bMergeMasterPages, bool bAllMasterPages, + bool bUndo = true, bool bTreadSourceAsConst = false); + + // Behaves like Merge(SourceModel=DestModel,nFirst,nLast,nDest,sal_False,sal_False,bUndo,!bMoveNoCopy); + void CopyPages(sal_uInt16 nFirstPageNum, sal_uInt16 nLastPageNum, + sal_uInt16 nDestPos, + bool bUndo, bool bMoveNoCopy); + + // BegUndo() / EndUndo() enables you to group arbitrarily many UndoActions + // arbitrarily deeply. As comment for the UndoAction the first BegUndo(String) of all + // nestings will be used. + // In that case the NotifyUndoActionHdl will be called on the last EndUndo(). + // No UndoAction will be generated for an empty group. + // All direct modifications on the SdrModel do not create an UndoActions. + // Actions on the SdrView however do generate those. + void BegUndo(); // open Undo group + void BegUndo(const OUString& rComment); // open Undo group + void BegUndo(const OUString& rComment, const OUString& rObjDescr, SdrRepeatFunc eFunc); // open Undo group + void EndUndo(); // close Undo group + void AddUndo(std::unique_ptr pUndo); + sal_uInt16 GetUndoBracketLevel() const { return m_nUndoLevel; } + // only after the first BegUndo or before the last EndUndo: + void SetUndoComment(const OUString& rComment); + void SetUndoComment(const OUString& rComment, const OUString& rObjDescr); + + // The Undo management is only done if NotifyUndoAction-Handler is not set. + // Default is 16. Minimal MaxUndoActionCount is 1. + void SetMaxUndoActionCount(sal_uInt32 nCount); + void ClearUndoBuffer(); + + bool HasUndoActions() const; + bool HasRedoActions() const; + void Undo(); + void Redo(); + void Repeat(SfxRepeatTarget&); + + // The application can set a handler here which collects the UndoActions einsammelt. + // The handler has the following signature: + // void NotifyUndoActionHdl(SfxUndoAction* pUndoAction); + // When calling the handler ownership is transferred; + // The UndoAction belongs to the Handler, not the SdrModel. + void SetNotifyUndoActionHdl(const std::function)>& rLink) { m_aUndoLink=rLink; } + + /** application can set its own undo manager, BegUndo, EndUndo and AddUndoAction + calls are routed to this interface if given */ + void SetSdrUndoManager( SfxUndoManager* pUndoManager ); + SfxUndoManager* GetSdrUndoManager() const; + + /** applications can set their own undo factory to override creation of + undo actions. The SdrModel will become owner of the given SdrUndoFactory + and delete it upon its destruction. */ + void SetSdrUndoFactory( SdrUndoFactory* pUndoFactory ); + + /** returns the models undo factory. This must be used to create + undo actions for this model. */ + SdrUndoFactory& GetSdrUndoFactory() const; + + // Accessor methods for Palettes, Lists and Tables + // FIXME: this badly needs re-factoring... + const XPropertyListRef& GetPropertyList( XPropertyListType t ) const { return maProperties[ t ]; } + void SetPropertyList( XPropertyListRef const & p ) { maProperties[ p->Type() ] = p; } + + // friendlier helpers + XDashListRef GetDashList() const { return XPropertyList::AsDashList(GetPropertyList( XPropertyListType::Dash )); } + XHatchListRef GetHatchList() const { return XPropertyList::AsHatchList(GetPropertyList( XPropertyListType::Hatch )); } + XColorListRef GetColorList() const { return XPropertyList::AsColorList(GetPropertyList( XPropertyListType::Color )); } + XBitmapListRef GetBitmapList() const { return XPropertyList::AsBitmapList(GetPropertyList( XPropertyListType::Bitmap )); } + XPatternListRef GetPatternList() const { return XPropertyList::AsPatternList(GetPropertyList( XPropertyListType::Pattern )); } + XLineEndListRef GetLineEndList() const { return XPropertyList::AsLineEndList(GetPropertyList( XPropertyListType::LineEnd )); } + XGradientListRef GetGradientList() const { return XPropertyList::AsGradientList(GetPropertyList( XPropertyListType::Gradient )); } + + // The DrawingEngine only references the StyleSheetPool, whoever + // made it needs to delete it. + SfxStyleSheetBasePool* GetStyleSheetPool() const { return mxStyleSheetPool.get(); } + void SetStyleSheetPool(SfxStyleSheetBasePool* pPool) { mxStyleSheetPool=pPool; } + + void SetStarDrawPreviewMode(bool bPreview); + bool IsStarDrawPreviewMode() const { return m_bStarDrawPreviewMode; } + + bool GetDisableTextEditUsesCommonUndoManager() const { return mbDisableTextEditUsesCommonUndoManager; } + void SetDisableTextEditUsesCommonUndoManager(bool bNew) { mbDisableTextEditUsesCommonUndoManager = bNew; } + + css::uno::Reference< css::uno::XInterface > const & getUnoModel(); + void setUnoModel( const css::uno::Reference< css::uno::XInterface >& xModel ); + + // these functions are used by the api to disable repaints during a + // set of api calls. + bool isLocked() const { return mbModelLocked; } + void setLock( bool bLock ); + + void SetForbiddenCharsTable( const std::shared_ptr& xForbiddenChars ); + const std::shared_ptr& GetForbiddenCharsTable() const { return mpForbiddenCharactersTable;} + + void SetCharCompressType( CharCompressType nType ); + CharCompressType GetCharCompressType() const { return mnCharCompressType; } + + void SetKernAsianPunctuation( bool bEnabled ); + bool IsKernAsianPunctuation() const { return mbKernAsianPunctuation; } + + void SetAddExtLeading( bool bEnabled ); + bool IsAddExtLeading() const { return mbAddExtLeading; } + + // tdf#99729 compatibility flag + void SetAnchoredTextOverflowLegacy(bool bEnabled); + bool IsAnchoredTextOverflowLegacy() const; + + void ReformatAllTextObjects(); + + std::unique_ptr createOutliner( OutlinerMode nOutlinerMode ); + void disposeOutliner( std::unique_ptr pOutliner ); + + bool IsWriter() const { return !m_bMyPool; } + + // Used as a fallback in *::ReadUserDataSequence() to process common properties + void ReadUserDataSequenceValue(const css::beans::PropertyValue *pValue); + void WriteUserDataSequence(css::uno::Sequence < css::beans::PropertyValue >& rValues); + + /** returns the numbering type that is used to format page fields in drawing shapes */ + virtual SvxNumType GetPageNumType() const; + + /** copies the items from the source set to the destination set. Both sets must have + same ranges but can have different pools. */ + static void MigrateItemSet( const SfxItemSet* pSourceSet, SfxItemSet* pDestSet, SdrModel* pNewModel ); + + bool IsInDestruction() const { return mbInDestruction;} + + static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId(); + + /** enables (true) or disables (false) recording of undo actions + If undo actions are added while undo is disabled, they are deleted. + Disabling undo does not clear the current undo buffer! */ + void EnableUndo( bool bEnable ); + + /** returns true if undo is currently enabled + This returns false if undo was disabled using EnableUndo( false ) and + also during the runtime of the Undo() and Redo() methods. */ + bool IsUndoEnabled() const; + + // used to prevent object name change during page move + bool DoesMakePageObjectsNamesUnique() const { return mbMakePageObjectsNamesUnique; } + void DoMakePageObjectsNamesUnique(bool bDo) { mbMakePageObjectsNamesUnique = bDo; } + + virtual void dumpAsXml(xmlTextWriterPtr pWriter) const; +}; + + +#endif // INCLUDED_SVX_SVDMODEL_HXX + +/* + +-----------+ + | SdrModel | + +--+------+-+ + | +-----------+ + +----+-----+ | + | ... | | + +----+---+ +----+---+ +-----+--------+ + |SdrPage | |SdrPage | |SdrLayerAdmin | + +---+----+ +-+--+--++ +---+-------+--+ + | | | | | +-------------------+ + +----+----+ +-----+-----+ +-------+-------+ + | ... | | ... | | ... | ++---+---+ +---+---+ +----+----+ +----+----+ +-----+------+ +------+-----+ +|SdrObj | |SdrObj | |SdrLayer | |SdrLayer | |SdrLayerSet | |SdrLayerSet | ++-------+ +-------+ +---------+ +---------+ +------------+ +------------+ +This class: SdrModel is the head of the data models for the StarView Drawing Engine. + +///////////////////////////////////////////////////////////////////////////////////////////////// */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdmrkv.hxx b/include/svx/svdmrkv.hxx new file mode 100644 index 000000000..49d39f06f --- /dev/null +++ b/include/svx/svdmrkv.hxx @@ -0,0 +1,457 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVDMRKV_HXX +#define INCLUDED_SVX_SVDMRKV_HXX + +#include +#include +#include +#include +#include +#include + +class SfxViewShell; + +// The following is not yet implemented, or just partially: +enum class SdrSearchOptions +{ + NONE = 0x0000, + DEEP = 0x0001, /* recursive into group objects */ + ALSOONMASTER = 0x0002, /* MasterPages are also scanned */ + WHOLEPAGE = 0x0004, /* Not just the ObjList of PageView */ + TESTMARKABLE = 0x0008, /* just markable objects/points/handles/... */ + TESTMACRO = 0x0010, /* Just objects with macro */ + TESTTEXTEDIT = 0x0020, /* Just TextEdit-enabled objects */ + MARKED = 0x0040, /* Just marked objects/points/... */ + PASS2BOUND = 0x0080, /* In case of empty search results, then 2nd. try with BoundRectHit */ + BEFOREMARK = 0x0100, /* if one marked one found, ignore all behind that */ + + IMPISMASTER = 0x0200, /* MasterPage is being searched right now */ + PICKMARKABLE = TESTMARKABLE, + PICKTEXTEDIT = DEEP | TESTMARKABLE | TESTTEXTEDIT, + PICKMACRO = DEEP | ALSOONMASTER | WHOLEPAGE | TESTMACRO, +}; +namespace o3tl +{ + template<> struct typed_flags : is_typed_flags {}; +} + +enum class SdrHitKind +{ + NONE, // No hit + Object, // Hit + Handle, // Marking handle + HelpLine, // Reference line + Gluepoint, // Glue point + TextEdit, // Open OutlinerView was hit + TextEditObj, // Object for SdrBeginTextEdit (Textbereich) + UrlField, // Field in TextObj was hit (while it is currently not edited) + Macro, // Object for BegMacroObj + MarkedObject, // Marked object (e.g. for dragging) + UnmarkedObject, // non-marked Object (e.g. for marking) + Cell // hit on a cell inside a table shape (outside of the cells text area) +}; + +enum class SdrViewEditMode { + Edit, // Also known as arrow or pointer mode + Create, // Tool for object creation + GluePointEdit // Glue point editing mode +}; + +/** options for ImpGetDescriptionString() */ +enum class ImpGetDescriptionOptions +{ + NONE = 0, + POINTS = 1, + GLUEPOINTS = 2, +}; + +class ImplMarkingOverlay; + +class SVXCORE_DLLPUBLIC SdrMarkView : public SdrSnapView +{ + friend class SdrPageView; + + // #114409#-3 Migrate selections + ImplMarkingOverlay* mpMarkObjOverlay; + ImplMarkingOverlay* mpMarkPointsOverlay; + ImplMarkingOverlay* mpMarkGluePointsOverlay; + +protected: + SdrObject* mpMarkedObj; // If not just one object ( i.e. More than one object ) is marked. + SdrPageView* mpMarkedPV; // If all marked obects are situated on the same PageView. + + Point maRef1; // Persistent - Rotation center / axis of reflection + Point maRef2; // Persistent + SdrHdlList maHdlList; + sdr::ViewSelection maSdrViewSelection; + + tools::Rectangle maMarkedObjRect; + tools::Rectangle maMarkedPointsRect; + tools::Rectangle maMarkedGluePointsRect; + + sal_uInt16 mnFrameHandlesLimit; + + SdrDragMode meDragMode; // Persistent + SdrViewEditMode meEditMode; // Persistent + SdrViewEditMode meEditMode0; // Persistent + + bool mbDesignMode : 1; // DesignMode for SdrUnoObj + bool mbForceFrameHandles : 1; // Persistent - FrameDrag also for single objects + bool mbPlusHdlAlways : 1; // Persistent + bool mbInsPolyPoint : 1; // at this time InsPolyPointDragging + bool mbMarkedObjRectDirty : 1; + bool mbMrkPntDirty : 1; + bool mbMarkedPointsRectsDirty : 1; + + // flag to completely disable handles at the view + bool mbMarkHandlesHidden : 1; + + // Helper to get a possible GridOffset from SdrObject + bool getPossibleGridOffsetForSdrObject( + basegfx::B2DVector& rOffset, + const SdrObject* pObj, + const SdrPageView* pPV) const; + + // Helper to get a possible GridOffset from Position + bool getPossibleGridOffsetForPosition( + basegfx::B2DVector& rOffset, + const basegfx::B2DPoint& rPoint, + const SdrPageView* pPV) const; + +private: + SVX_DLLPRIVATE void ImpClearVars(); + SVX_DLLPRIVATE void ImpSetPointsRects() const; + void UndirtyMrkPnt() const; + + void SetMarkHandlesForLOKit(tools::Rectangle const & rRect, SfxViewShell* pOtherShell); + +protected: + virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override; + virtual void ModelHasChanged() override; // Is called by the PaintView + virtual void SetMarkHandles(SfxViewShell* pOtherShell); // maHdlList - fill (List of handles) + void SetMarkRects(); // Rects at the PageViews + void CheckMarked(); // Scan MarkList after Del and Lock Layer ... + void AddDragModeHdl(SdrDragMode eMode); + virtual bool MouseMove(const MouseEvent& rMEvt, OutputDevice* pWin) override; + virtual bool RequestHelp(const HelpEvent& rHEvt) override; + + // add custom handles (used by other apps, e.g. AnchorPos) + virtual void AddCustomHdl(); + + void ForceRefToMarked(); + void ForceUndirtyMrkPnt() const { if (mbMrkPntDirty) UndirtyMrkPnt(); } + + virtual SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObject* pObj, SdrPageView* pPV, SdrSearchOptions nOptions, const SdrLayerIDSet* pMVisLay) const; + SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObjList const * pOL, SdrPageView* pPV, SdrSearchOptions nOptions, const SdrLayerIDSet* pMVisLay, SdrObject*& rpRootObj) const; + SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObjList const * pOL, SdrPageView* pPV, SdrSearchOptions nOptions, const SdrLayerIDSet* pMVisLay, SdrObject*& rpRootObj,const SdrMarkList * pMarkList) const; + bool ImpIsFrameHandles() const; + OUString ImpGetDescriptionString(const char* pStrCacheID, ImpGetDescriptionOptions nOpt=ImpGetDescriptionOptions::NONE) const; + + // Generates a string including degrees symbol, from an angel specification in 1/100deg + bool ImpMarkPoint(SdrHdl* pHdl, SdrMark* pMark, bool bUnmark); + virtual bool MarkPoints(const tools::Rectangle* pRect, bool bUnmark); + bool MarkGluePoints(const tools::Rectangle* pRect, bool bUnmark); + + void SetMoveOutside(bool bOn); + bool MarkableObjectsExceed( int n ) const; + +protected: + // #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView + SdrMarkView( + SdrModel& rSdrModel, + OutputDevice* pOut); + + virtual ~SdrMarkView() override; + +public: + virtual bool IsAction() const override; + virtual void MovAction(const Point& rPnt) override; + virtual void EndAction() override; + virtual void BckAction() override; + virtual void BrkAction() override; + virtual void TakeActionRect(tools::Rectangle& rRect) const override; + + virtual void ClearPageView() override; + virtual void HideSdrPage() override; + bool IsObjMarkable(SdrObject const * pObj, SdrPageView const * pPV) const; + + // Returns sal_True if objects, points or glue points are selected by drawing a frame + // (as long as the frame is drawn). + bool IsMarking() const { return IsMarkObj() || IsMarkPoints() || IsMarkGluePoints(); } + + // Marking objects by drawing of a selection frame + void BegMarkObj(const Point& rPnt, bool bUnmark = false); + void MovMarkObj(const Point& rPnt); + bool EndMarkObj(); + void BrkMarkObj(); + bool IsMarkObj() const { return (nullptr != mpMarkObjOverlay); } + + // DragModes: SDRDRAG_CREATE,SdrDragMode::Move,SdrDragMode::Resize,SdrDragMode::Rotate,SdrDragMode::Mirror,SdrDragMode::Shear,SdrDragMode::Crook + // Move==Resize + // The interface might maybe be changed in the future because of Ortho-Drag + void SetDragMode(SdrDragMode eMode); + SdrDragMode GetDragMode() const { return meDragMode; } + void SetFrameHandles(bool bOn); + bool IsFrameHandles() const { return mbForceFrameHandles; } + + // returns true if number of markable objects is greater than 1 + bool HasMultipleMarkableObjects() const { return MarkableObjectsExceed(1); }; + + void SetEditMode(SdrViewEditMode eMode); + SdrViewEditMode GetEditMode() const { return meEditMode; } + + void SetEditMode(bool bOn) { SetEditMode(bOn?SdrViewEditMode::Edit:SdrViewEditMode::Create); } + bool IsEditMode() const { return meEditMode==SdrViewEditMode::Edit; } + void SetCreateMode(bool bOn) { SetEditMode(bOn?SdrViewEditMode::Create:SdrViewEditMode::Edit); } + bool IsCreateMode() const { return meEditMode==SdrViewEditMode::Create; } + void SetGluePointEditMode(bool bOn) { SetEditMode(bOn?SdrViewEditMode::GluePointEdit:meEditMode0); } + bool IsGluePointEditMode() const { return meEditMode==SdrViewEditMode::GluePointEdit; } + + void SetDesignMode(bool bOn = true); + bool IsDesignMode() const { return mbDesignMode; } + + void SetFrameDragSingles(bool bOn=true) { SetFrameHandles(bOn); } + bool IsFrameDragSingles() const { return IsFrameHandles(); } + + bool HasMarkableObj() const { return MarkableObjectsExceed(0); }; + + +// migrate selections + +protected: + // all available changing methods + SdrMarkList& GetMarkedObjectListWriteAccess() { return maSdrViewSelection.GetMarkedObjectListWriteAccess(); } + +public: + // all available const methods for read access to selection + const SdrMarkList& GetMarkedObjectList() const { return maSdrViewSelection.GetMarkedObjectList(); } + // returns SAL_MAX_SIZE if not found + size_t TryToFindMarkedObject(const SdrObject* pObj) const { return GetMarkedObjectList().FindObject(pObj); } + SdrPageView* GetSdrPageViewOfMarkedByIndex(size_t nNum) const { return GetMarkedObjectList().GetMark(nNum)->GetPageView(); } + SdrMark* GetSdrMarkByIndex(size_t nNum) const { return GetMarkedObjectList().GetMark(nNum); } + SdrObject* GetMarkedObjectByIndex(size_t nNum) const { return GetMarkedObjectList().GetMark(nNum)->GetMarkedSdrObj(); } + size_t GetMarkedObjectCount() const { return GetMarkedObjectList().GetMarkCount(); } + void SortMarkedObjects() const { GetMarkedObjectList().ForceSort(); } + bool AreObjectsMarked() const { return 0 != GetMarkedObjectList().GetMarkCount(); } + OUString const & GetDescriptionOfMarkedObjects() const { return GetMarkedObjectList().GetMarkDescription(); } + OUString const & GetDescriptionOfMarkedPoints() const { return GetMarkedObjectList().GetPointMarkDescription(); } + OUString const & GetDescriptionOfMarkedGluePoints() const { return GetMarkedObjectList().GetGluePointMarkDescription(); } + + // Get a list of all those links which are connected to marked nodes, + // but which are not marked themselves. + const SdrMarkList& GetEdgesOfMarkedNodes() const { return maSdrViewSelection.GetEdgesOfMarkedNodes(); } + const SdrMarkList& GetMarkedEdgesOfMarkedNodes() const { return maSdrViewSelection.GetMarkedEdgesOfMarkedNodes(); } + const std::vector& GetTransitiveHullOfMarkedObjects() const { return maSdrViewSelection.GetAllMarkedObjects(); } + + + // mechanism to complete disable handles at the view. Handles will be hidden and deleted + // when set, no new ones created, no interaction allowed. Handles will be recreated and shown + // when reset. Default is false. + void hideMarkHandles(); + void showMarkHandles(); + bool areMarkHandlesHidden() const { return mbMarkHandlesHidden; } + + bool IsMarkedHit(const Point& rPnt, short nTol=-2) const { return IsMarkedObjHit(rPnt,nTol); } + bool IsMarkedObjHit(const Point& rPnt, short nTol=-2) const; + + SdrHdl* PickHandle(const Point& rPnt) const; + + // Pick: Supported options for nOptions are: + // SdrSearchOptions::DEEP SdrSearchOptions::ALSOONMASTER SdrSearchOptions::TESTMARKABLE SdrSearchOptions::TESTTEXTEDIT + // SdrSearchOptions::MARKED + // SdrSearchOptions::WHOLEPAGE + SdrObject* PickObj(const Point& rPnt, short nTol, SdrPageView*& rpPV, SdrSearchOptions nOptions, SdrObject** ppRootObj, bool* pbHitPassDirect=nullptr) const; + SdrObject* PickObj(const Point& rPnt, short nTol, SdrPageView*& rpPV, SdrSearchOptions nOptions=SdrSearchOptions::NONE) const; + bool MarkObj(const Point& rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false); + + // Pick: Supported options for nOptions are SdrSearchOptions::PASS2BOUND + bool PickMarkedObj(const Point& rPnt, SdrObject*& rpObj, SdrPageView*& rpPV, SdrSearchOptions nOptions) const; + + // Selects the most upper of the marked objects (O1) and scans from there + // towards bottom direction, selecting the first non-marked object (O2). + // In case of success the marking of O1 is deleted, a marking is created at + // O2 and TRUE is returned. With the parameter bPrev=sal_True the scan + // direction is turned to the other direction. + bool MarkNextObj(bool bPrev=false); + + // Selects the most upper of the marked objects which is hit by rPnt/nTol + // and scans from there to bottom direction, selecting the first non-marked + // object (O2). In case of success the marking of O1 is deleted, a marking + // is created at O2 and sal_True is returned. With the parameter + // bPrev=sal_True the scan direction is turned to the other direction. + bool MarkNextObj(const Point& rPnt, short nTol, bool bPrev); + + // Mark all objects within a rectangular area + // Just objects are marked which are inclosed completely + void MarkObj(const tools::Rectangle& rRect, bool bUnmark); + void MarkObj(SdrObject* pObj, SdrPageView* pPV, bool bUnmark=false, bool bImpNoSetMarkHdl=false); + void MarkAllObj(SdrPageView* pPV=nullptr); // pPage=NULL => all displayed pages + void UnmarkAllObj(SdrPageView const * pPV=nullptr); // pPage=NULL => all displayed pages + + // This function is time-consuming intensive, as the MarkList has to be scanned. + bool IsObjMarked(SdrObject const * pObj) const; + void UnMarkAll(SdrPageView const * pPV=nullptr) { UnmarkAllObj(pPV); } + + // Request/set the size of the marking handles. Declaration in Pixel. + // The value is meant to be the edge length ( link length ). + // Pair values are round up to impair values: 3->3, 4->5, 5->5, 6->7, 7->7, ... + // Default value is 7, minimum value is 3 Pixels. + sal_uInt16 GetMarkHdlSizePixel() const; + void SetMarkHdlSizePixel(sal_uInt16 nSiz); + + virtual bool HasMarkablePoints() const; + virtual sal_Int32 GetMarkablePointCount() const; + virtual bool HasMarkedPoints() const; + + // There might be points which can't be marked: + bool IsPointMarkable(const SdrHdl& rHdl) const; + virtual bool MarkPoint(SdrHdl& rHdl, bool bUnmark=false); + + /** should only be used from outside svx for special ui elements */ + bool MarkPointHelper(SdrHdl* pHdl, SdrMark* pMark, bool bUnmark); + + bool UnmarkPoint(SdrHdl& rHdl) { return MarkPoint(rHdl,true); } + bool IsPointMarked(const SdrHdl& rHdl) const { ForceUndirtyMrkPnt(); return rHdl.IsSelected(); } + bool MarkAllPoints() { return MarkPoints(nullptr,false); } + bool UnmarkAllPoints() { return MarkPoints(nullptr,true); } + + // Selects the first marked point (P1) which is hit by rPnt + // and from there it searches the first non-marked point(P2). + // In case of success the marking of + // P1 is deleted, a mark is set at P2. + void MarkNextPoint(); + + // Search for the number of the suitable handle. In case of empty search result, + // SAL_MAX_SIZE is returned. + size_t GetHdlNum(SdrHdl const * pHdl) const { return maHdlList.GetHdlNum(pHdl); } + SdrHdl* GetHdl(size_t nHdlNum) const { return maHdlList.GetHdl(nHdlNum); } + const SdrHdlList& GetHdlList() const { return maHdlList; } + + // Draw a selection frame for marking of points. + // This routine will just be started in case that HasMarkablePoints() returns sal_True. + bool BegMarkPoints(const Point& rPnt, bool bUnmark = false); + void MovMarkPoints(const Point& rPnt); + bool EndMarkPoints(); + void BrkMarkPoints(); + bool IsMarkPoints() const { return (nullptr != mpMarkPointsOverlay); } + + // Select that additional handles are displayed permanently. + void SetPlusHandlesAlwaysVisible(bool bOn); + bool IsPlusHandlesAlwaysVisible() const { return mbPlusHdlAlways; } + + bool HasMarkableGluePoints() const; + bool HasMarkedGluePoints() const; + + // A gluepoint is clearly identified by the SdrObject + // (to which it belongs) as well as by a sal_uInt16 nId (as each SdrObject may consist of + // several glue points. Here at the View there is an additional + // SdrPageView, which should be defined correctly always. + // Alternatively a gluepoint may be characterized by a SdrHdl. + // In this case the SdrHdl instance consists of all required information. + // And in this case, the glue point are always is marked by enforcement + // (Handlers are just situated at marked gluepoints ) + // Attention: With each change of the glue point status the handle list is re-calculated. + // All previously saved SdrHdl* became invalid by this, the same with the point IDs! + bool PickGluePoint(const Point& rPnt, SdrObject*& rpObj, sal_uInt16& rnId, SdrPageView*& rpPV) const; + bool MarkGluePoint(const SdrObject* pObj, sal_uInt16 nId, bool bUnmark); + void UnmarkGluePoint(const SdrObject* pObj, sal_uInt16 nId) { MarkGluePoint(pObj,nId,true); } + bool IsGluePointMarked(const SdrObject* pObj, sal_uInt16 nId) const; + + // Get the Hdl (handle) of a marked GluePoint. Non-marked + // GluePoints don`t have handles + SdrHdl* GetGluePointHdl(const SdrObject* pObj, sal_uInt16 nId) const; + + // Mark all points within this rectangular (View coordinates) + bool MarkAllGluePoints() { return MarkGluePoints(nullptr,false); } + bool UnmarkAllGluePoints() { return MarkGluePoints(nullptr,true); } + + // Selects the first marked point (P1) which is hit by rPnt + // and from there it searches the first non-marked point(P2). + // In case of success the marking of + // P1 is deleted, a mark is set at P2. + void MarkNextGluePoint(); + + // Draw a selection frame for glue point marking. + // This routine will just be started in case that HasMarkablePoints() returns sal_True. + // The GlueEditMode sal_True is disregarded. + // bool BegMarkGluePoints(const Point& rPnt, OutputDevice* pOut); + bool BegMarkGluePoints(const Point& rPnt, bool bUnmark = false); + void MovMarkGluePoints(const Point& rPnt); + void EndMarkGluePoints(); + void BrkMarkGluePoints(); + bool IsMarkGluePoints() const { return (nullptr != mpMarkGluePointsOverlay); } + + // bRestraintPaint=sal_False causes the handles not to be drawn immediately. + // AdjustMarkHdl is just called in case of changes; usually this causes an Invalidate + // At the end of a redraw the handles are drawn automatically. + // The purpose is to avoid unnecessary flickering. -> This does not yet work, that's why sal_True! + void AdjustMarkHdl(SfxViewShell* pOtherShell = nullptr); //HMHBOOL bRestraintPaint=sal_True); + + const tools::Rectangle& GetMarkedObjRect() const; // SnapRects of Objects, without line width + tools::Rectangle GetMarkedObjBoundRect() const; // incl. line width, overlapping rags, ... + const tools::Rectangle& GetMarkedPointsRect() const; // Enclosing rectangle of all marked points + const tools::Rectangle& GetMarkedGluePointsRect() const; // Enclosing rectangle of all marked glue points + const tools::Rectangle& GetAllMarkedRect() const { return GetMarkedObjRect(); } + tools::Rectangle GetAllMarkedBoundRect() const { return GetMarkedObjBoundRect(); } + + // Will be always called, if the list of marked objects might be changed. + // If you override this method, be sure that you call the + // methods of the base class! + virtual void MarkListHasChanged(); + + // Entering (Editing) of a maybe marked object group. If there are several + // object groups marked, the most upper group is selected. After that + // all member objects of the group are directly accessible. All other + // objects may not be processed in the meantime (until the next + // LeaveGroup()). With markings which overlaps pages, every page is processed + // separately. The method returns sal_True, if at least one group was entered. + void EnterMarkedGroup(); + + // Rotation center point and start point of the axis of reflection, respectively + const Point& GetRef1() const { return maRef1; } + void SetRef1(const Point& rPt); + + // End point of the axis of reflection + const Point& GetRef2() const { return maRef2; } + void SetRef2(const Point& rPt); + /// Get access to the view shell owning this draw view, if any. + virtual SfxViewShell* GetSfxViewShell() const; +}; + + +// - Hit tolerances: +// It has to be declared in logical coordinates. So please translate the +// wanted pixel value with PixelToLogic in Logical values. +// Taking as example a logical value of 100: +// - For a horizontal hairline (Object with height 0), the generated data is +/-100, i.e. +// a vertical area of 200 logical units is sensitive. +// - For a polygon, a rectangular of the size (200,200) is generated and a +// touch test between Poly and this Rect is processed. +// - Obects which respond SdrObject::HasEdit()==TRUE ( e.g. a text frame ), +// are specially treated: An additional sensitive area with a width of +// 2*Tol (200 units for this example) is created around the object. +// When an object is directly hit, the Edit method is called. +// In opposite, a hit in the surrounding sensitive area enables Dragging. + + +#endif // INCLUDED_SVX_SVDMRKV_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdoashp.hxx b/include/svx/svdoashp.hxx new file mode 100644 index 000000000..dd1a86d24 --- /dev/null +++ b/include/svx/svdoashp.hxx @@ -0,0 +1,256 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVDOASHP_HXX +#define INCLUDED_SVX_SVDOASHP_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace sdr +{ + namespace properties + { + class CustomShapeProperties; + } +} + +class SdrAShapeObjGeoData final : public SdrTextObjGeoData +{ +public: + bool bMirroredX; + bool bMirroredY; + double fObjectRotation; + + css::uno::Sequence< css::drawing::EnhancedCustomShapeAdjustmentValue > aAdjustmentSeq; +}; + +enum class CustomShapeHandleModes +{ + NONE = 0, + RESIZE_FIXED = 1, + CREATE_FIXED = 2, + RESIZE_ABSOLUTE_X = 4, + RESIZE_ABSOLUTE_Y = 8, + MOVE_SHAPE = 16, + ORTHO4 = 32, + RESIZE_ABSOLUTE_NEGX = 64 +}; + +namespace o3tl +{ + template<> struct typed_flags : is_typed_flags {}; +} + +struct SdrCustomShapeInteraction +{ + css::uno::Reference< css::drawing::XCustomShapeHandle > xInteraction; + css::awt::Point aPosition; + CustomShapeHandleModes nMode; +}; + +class SVXCORE_DLLPUBLIC SdrObjCustomShape : public SdrTextObj +{ +private: + // fObjectRotation is containing the object rotation in degrees. + double fObjectRotation; + bool mbAdjustingTextFrameWidthAndHeight; + +protected: + virtual std::unique_ptr CreateObjectSpecificViewContact() override; + virtual void impl_setUnoShape(const css::uno::Reference& rxUnoShape) override; + +public: + virtual std::unique_ptr CreateObjectSpecificProperties() override; + + // to allow sdr::properties::CustomShapeProperties access + friend class sdr::properties::CustomShapeProperties; + + css::uno::Reference< css::drawing::XShape > mXRenderedCustomShape; + + mutable css::uno::Reference< css::drawing::XCustomShapeEngine > mxCustomShapeEngine; + + // #i37011# render geometry shadow + SdrObject* mpLastShadowGeometry; + + css::uno::Reference< css::drawing::XCustomShapeEngine > const & GetCustomShapeEngine() const; + + std::vector< SdrCustomShapeInteraction > GetInteractionHandles() const; // needed in unit test + SVX_DLLPRIVATE void DragCreateObject( SdrDragStat& rDrag ); + SVX_DLLPRIVATE void DragResizeCustomShape( const tools::Rectangle& rNewRect ); + void DragMoveCustomShapeHdl( const Point& rDestination, + const sal_uInt16 nCustomShapeHdlNum, bool bMoveCalloutRectangle ); // needed in unit test + + // #i37011# centralize throw-away of render geometry + void InvalidateRenderGeometry(); + + // #i38892# + void ImpCheckCustomGluePointsAreAdded(); + + // returns the new text rect that corresponds to the current logic rect, the return value can be empty if nothing changed. + tools::Rectangle ImpCalculateTextFrame( const bool bHgt, const bool bWdt ); + +public: + // #i37011# + const SdrObject* GetSdrObjectFromCustomShape() const; + const SdrObject* GetSdrObjectShadowFromCustomShape() const; + bool GetTextBounds( tools::Rectangle& rTextBound ) const; + bool IsTextPath() const; + basegfx::B2DPolyPolygon GetLineGeometry( const bool bBezierAllowed ) const; + +protected: + // #115391# new method for SdrObjCustomShape and SdrTextObj to correctly handle and set + // SdrTextMinFrameWidthItem and SdrTextMinFrameHeightItem based on all settings, necessities + // and object sizes + virtual void AdaptTextMinSize() override; + + Size m_aSuggestedTextFrameSize; + + // protected destructor + virtual ~SdrObjCustomShape() override; + +public: + bool UseNoFillStyle() const; + + bool IsMirroredX() const; + bool IsMirroredY() const; + void SetMirroredX( const bool bMirroredX ); + void SetMirroredY( const bool bMirroredY ); + + double GetObjectRotation() const { return fObjectRotation;} + double GetExtraTextRotation( const bool bPreRotation = false ) const; + + SdrObjCustomShape(SdrModel& rSdrModel); + + /* is merging default attributes from type-shape into the SdrCustomShapeGeometryItem. If pType + is NULL then the type is being taken from the "Type" property of the SdrCustomShapeGeometryItem. + MergeDefaultAttributes is called when creating CustomShapes via UI and after importing */ + void MergeDefaultAttributes( const OUString* pType = nullptr ); + + /* the method is checking if the geometry data is unchanged/default, in this case the data might not be stored */ + enum class DefaultType + { + Path, + Viewbox, + Segments, + Gluepoints, + StretchX, + StretchY, + Equations, + TextFrames + }; + bool IsDefaultGeometry( const DefaultType eDefaultType ) const; + + virtual sal_uInt16 GetObjIdentifier() const override; + virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; + + virtual void Move(const Size& rSiz) override; + virtual void Shear(const Point& rRef, long nAngle, double tn, bool bVShear) override; + virtual void SetSnapRect(const tools::Rectangle& rRect) override; + virtual void SetLogicRect(const tools::Rectangle& rRect) override; + virtual void AdjustToMaxRect( const tools::Rectangle& rMaxRect, bool bShrinkOnly = false ) override; + + virtual void NbcMove(const Size& rSiz) override; + virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override; + virtual void NbcRotate(const Point& rRef, long nAngle, double sn, double cs) override; + virtual void NbcMirror(const Point& rRef1, const Point& rRef2) override; + virtual void NbcShear(const Point& rRef, long nAngle, double tn, bool bVShear) override; + virtual void NbcSetSnapRect(const tools::Rectangle& rRect) override; + virtual void NbcSetLogicRect(const tools::Rectangle& rRect) override; + + virtual SdrGluePoint GetVertexGluePoint(sal_uInt16 nNum) const override; + + virtual void NbcSetStyleSheet( SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr ) override; + + // special drag methods + virtual bool hasSpecialDrag() const override; + virtual bool beginSpecialDrag(SdrDragStat& rDrag) const override; + virtual bool applySpecialDrag(SdrDragStat& rDrag) override; + + virtual bool MovCreate(SdrDragStat& rStat) override; // #i37448# + virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) override; + + /** + * Allows suggesting the text frame size: in case the application has its + * own text associated to the shape, instead of using the shape's editeng + * text. + */ + void SuggestTextFrameSize(Size aSuggestedTextFrameSize); + virtual bool AdjustTextFrameWidthAndHeight(tools::Rectangle& rR, bool bHgt = true, bool bWdt = true) const override; + virtual bool NbcAdjustTextFrameWidthAndHeight(bool bHgt = true, bool bWdt = true) override; + virtual bool AdjustTextFrameWidthAndHeight() override; + virtual bool IsAutoGrowHeight() const override; + virtual bool IsAutoGrowWidth() const override; + virtual void SetVerticalWriting(bool bVertical) override; + virtual void TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, tools::Rectangle* pViewInit, tools::Rectangle* pViewMin) const override; + virtual void EndTextEdit( SdrOutliner& rOutl ) override; + virtual void TakeTextAnchorRect( tools::Rectangle& rAnchorRect ) const override; + virtual void TakeTextRect( SdrOutliner& rOutliner, tools::Rectangle& rTextRect, bool bNoEditText, + tools::Rectangle* pAnchorRect, bool bLineWidth = true ) const override; + virtual SdrObjCustomShape* CloneSdrObject(SdrModel& rTargetModel) const override; + SdrObjCustomShape& operator=(const SdrObjCustomShape& rObj); + + virtual OUString TakeObjNameSingul() const override; + virtual OUString TakeObjNamePlural() const override; + + virtual basegfx::B2DPolyPolygon TakeCreatePoly( const SdrDragStat& rDrag) const override; + + virtual basegfx::B2DPolyPolygon TakeXorPoly() const override; + virtual basegfx::B2DPolyPolygon TakeContour() const override; + + virtual void NbcSetOutlinerParaObject(std::unique_ptr pTextObject) override; + + virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const override; + + // react on model/page change + virtual void handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage) override; + + virtual SdrObjGeoData *NewGeoData() const override; + virtual void SaveGeoData(SdrObjGeoData &rGeo) const override; + virtual void RestGeoData(const SdrObjGeoData &rGeo) override; + + // need to take fObjectRotation instead of aGeo.nAngle, replace it temporary + virtual bool TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPolyPolygon& rPolyPolygon) const override; + virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& rPolyPolygon) override; + + virtual const SdrGluePointList* GetGluePointList() const override; + //virtual SdrGluePointList* GetGluePointList(); + virtual SdrGluePointList* ForceGluePointList() override; + + virtual sal_uInt32 GetHdlCount() const override; + virtual void AddToHdlList(SdrHdlList& rHdlList) const override; + + // #i33136# + static bool doConstructOrthogonal(const OUString& rName); + + using SdrTextObj::NbcSetOutlinerParaObject; + + OUString GetCustomShapeName() const; +}; + +#endif // INCLUDED_SVX_SVDOASHP_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdoattr.hxx b/include/svx/svdoattr.hxx new file mode 100644 index 000000000..4c5dab883 --- /dev/null +++ b/include/svx/svdoattr.hxx @@ -0,0 +1,72 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVDOATTR_HXX +#define INCLUDED_SVX_SVDOATTR_HXX + +#include +#include + +// Initial Declarations +class SfxPoolItem; +class SfxSetItem; +class SdrOutliner; +class SfxItemSet; +class SfxItemPool; + +// SdrAttrObj +class SVXCORE_DLLPUBLIC SdrAttrObj : public SdrObject +{ +private: + friend class SdrOutliner; + +protected: + virtual std::unique_ptr CreateObjectSpecificProperties() override; + + tools::Rectangle maSnapRect; + +protected: + /// Detects the width of the line. No line ->0. + sal_Int32 ImpGetLineWdt() const; + + /// Detects when a stylesheet is changed + virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override; + + SdrAttrObj(SdrModel& rSdrModel); + virtual ~SdrAttrObj() override; + +public: + SdrAttrObj(SdrAttrObj const &) = delete; // due to SdrObject + SdrAttrObj(SdrAttrObj &&) = delete; // due to SdrObject + SdrAttrObj & operator =(SdrAttrObj const &) = default; + SdrAttrObj & operator =(SdrAttrObj &&) = default; + + // Detects if bFilledObj && Fill != FillNone + bool HasFill() const; + + // Detects if Line != LineNone + bool HasLine() const; + + virtual const tools::Rectangle& GetSnapRect() const override; +}; + + +#endif // INCLUDED_SVX_SVDOATTR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx new file mode 100644 index 000000000..de4ebc3f9 --- /dev/null +++ b/include/svx/svdobj.hxx @@ -0,0 +1,1099 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVDOBJ_HXX +#define INCLUDED_SVX_SVDOBJ_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +class SfxBroadcaster; +class AutoTimer; +class OutlinerParaObject; +class Outliner; +class SdrOutliner; +class SdrDragStat; +class SdrHdl; +class SdrHdlList; +class SdrItemPool; +class SdrModel; +class SdrObjList; +class SdrObject; +class SdrPage; +class SdrPageView; +class SdrView; +class SfxItemSet; +class SfxGrabBagItem; +class SfxSetItem; +class SfxStyleSheet; +class SfxUndoAction; +class XFillAttrSetItem; +class XLineAttrSetItem; +class SfxItemPool; +namespace tools { class PolyPolygon; } +class SfxPoolItem; +class SdrVirtObj; +class SdrDragView; +class SdrObjUserDataList; +class SdrObjPlusData; +class SdrGluePoint; +class SdrGluePointList; +class SdrLayerIDSet; +class Fraction; +enum class PointerStyle; + +namespace basegfx +{ + class B2DPoint; + class B2DPolyPolygon; + class B2DHomMatrix; +} + +namespace sdr +{ + namespace properties + { + class BaseProperties; + } + + class ObjectUser; +} + +namespace sdr +{ + namespace contact + { + class ViewContact; + } // end of namespace contact +} + +namespace svx +{ + class PropertyChangeNotifier; +} + +class SvxShape; +class SdrObject; +struct SVXCORE_DLLPUBLIC SdrObjectFreeOp; + +// helper for constructing std::unique_ptr for SdrObjects where a +// deleter is needed - here, SdrObject::Free needs to be used. +typedef std::unique_ptr< SdrObject, SdrObjectFreeOp > SdrObjectUniquePtr; + +enum SdrObjKind { + OBJ_NONE = 0, /// abstract object (SdrObject) + OBJ_GRUP = 1, /// object group + OBJ_LINE = 2, /// line + OBJ_RECT = 3, /// rectangle (round corners optional) + OBJ_CIRC = 4, /// circle, ellipse + OBJ_SECT = 5, /// circle section + OBJ_CARC = 6, /// circle arc + OBJ_CCUT = 7, /// circle cut + OBJ_POLY = 8, /// polygon, PolyPolygon + OBJ_PLIN = 9, /// PolyLine + OBJ_PATHLINE =10, /// open Bezier-curve + OBJ_PATHFILL =11, /// closed Bezier-curve + OBJ_FREELINE =12, /// open free-hand line + OBJ_FREEFILL =13, /// closed free-hand line + OBJ_SPLNLINE =14, /// natural cubic Spline (ni) + OBJ_SPLNFILL =15, /// periodic cubic Spline (ni) + OBJ_TEXT =16, /// text object + OBJ_TITLETEXT =20, /// TitleText, special text object for StarDraw + OBJ_OUTLINETEXT=21, /// OutlineText, special text object for StarDraw + OBJ_GRAF =22, /// foreign graphic (StarView Graphic) + OBJ_OLE2 =23, /// OLE object + OBJ_EDGE =24, /// connector object + OBJ_CAPTION =25, /// caption object + OBJ_PATHPOLY =26, /// Polygon/PolyPolygon represented by SdrPathObj + OBJ_PATHPLIN =27, /// Polyline represented by SdrPathObj + OBJ_PAGE =28, /// object that represents a SdrPage + OBJ_MEASURE =29, /// measurement object + OBJ_FRAME =31, /// continuously activated OLE (PlugIn-Frame or similar) + OBJ_UNO =32, /// Universal Network Object packed into SvDraw object + OBJ_CUSTOMSHAPE=33, /// custom shape + OBJ_MEDIA =34, /// media shape + OBJ_TABLE =35, /// table + OBJ_MAXI +}; + +enum class SdrInventor : sal_uInt32 { + Unknown = 0, + BasicDialog = sal_uInt32( 'D' | ('L' << 8) | ('G' << 16) | ('1' << 24) ), + Default = sal_uInt32( 'S' | ('V' << 8) | ('D' << 16) | ('r' << 24) ), + E3d = sal_uInt32( 'E' | ('3' << 8) | ('D' << 16) | ('1' << 24) ), + FmForm = sal_uInt32( 'F' | ('M' << 8) | ('0' << 16) | ('1' << 24) ), + IMap = sal_uInt32( 'I' | ('M' << 8) | ('A' << 16) | ('P' << 24) ), + ReportDesign = sal_uInt32( 'R' | ('P' << 8) | ('T' << 16) | ('1' << 24) ), + ScOrSwDraw = sal_uInt32( 'S' | ('C' << 8) | ('3' << 16) | ('0' << 24) ), // Used in sc/ and sw/ + SgaImap = sal_uInt32( 'S' | ('D' << 8) | ('U' << 16) | ('D' << 24) ), + StarDrawUserData = sal_uInt32( 'S' | ('D' << 8) | ('U' << 16) | ('D' << 24) ), + Swg = sal_uInt32( 'S' | ('W' << 8) | ('G' << 16) ), +}; + +enum class SdrUserCallType { + MoveOnly, // only moved, size unchanged + Resize, // size and maybe position changed + ChangeAttr, // attribute changed. Eventually new size, because of line width + Delete, // object is going to be deleted soon, no attributes anymore + Inserted, // inserted into an object list (e.g. Page) + Removed, // removed from an object list + ChildMoveOnly, // a child within a group has changed + ChildResize, // a child within a group has changed + ChildChangeAttr, // a child within a group has changed + ChildDelete, // a child within a group has changed + ChildInserted, // a child within a group has changed + ChildRemoved // a child within a group has changed +}; + +class SVXCORE_DLLPUBLIC SdrObjUserCall +{ +public: + virtual ~SdrObjUserCall(); + virtual void Changed(const SdrObject& rObj, SdrUserCallType eType, const tools::Rectangle& rOldBoundRect); +}; + +class SVXCORE_DLLPUBLIC SdrObjMacroHitRec +{ +public: + Point aPos; + const SdrLayerIDSet* pVisiLayer; + const SdrPageView* pPageView; + sal_uInt16 nTol; + + SdrObjMacroHitRec(); +}; + +/** + * User data of a drawing object, e.g. application specific data. + * Every drawing object can have an arbitrary amount of such records (SV list). + * Whoever wants to save data here, must inherit from this and set a corresponding link in the factory. + */ +class SVXCORE_DLLPUBLIC SdrObjUserData +{ + SdrInventor nInventor; + sal_uInt16 nIdentifier; + + void operator=(const SdrObjUserData& rData) = delete; + bool operator==(const SdrObjUserData& rData) const = delete; + bool operator!=(const SdrObjUserData& rData) const = delete; + +public: + SdrObjUserData(SdrInventor nInv, sal_uInt16 nId); + SdrObjUserData(const SdrObjUserData& rData); + virtual ~SdrObjUserData(); + + virtual std::unique_ptr Clone(SdrObject* pObj1) const = 0; // #i71039# NULL -> 0 + SdrInventor GetInventor() const { return nInventor;} + sal_uInt16 GetId() const { return nIdentifier;} +}; + +/** + * All geometrical data of an arbitrary object for use in undo/redo + */ +class SAL_DLLPUBLIC_RTTI SdrObjGeoData +{ +public: + tools::Rectangle aBoundRect; + Point aAnchor; + std::unique_ptr + pGPL; + bool bMovProt; + bool bSizProt; + bool bNoPrint; + bool bClosedObj; + bool mbVisible; + SdrLayerID mnLayerID; + +public: + SdrObjGeoData(); + virtual ~SdrObjGeoData(); +}; + +/** + * Provides information about various ZObject properties + */ +class SVXCORE_DLLPUBLIC SdrObjTransformInfoRec +{ +public: + bool bMoveAllowed : 1; // if false, object cannot be moved + bool bResizeFreeAllowed : 1; // if false, object cannot be resized freely + bool bResizePropAllowed : 1; // if false, object cannot even be resized proportionally + bool bRotateFreeAllowed : 1; // if false, object cannot be rotated freely + bool bRotate90Allowed : 1; // if false, object cannot even be rotated in 90 degree steps + bool bMirrorFreeAllowed : 1; // if false, object cannot be mirrored freely + bool bMirror45Allowed : 1; // if false, object cannot even be mirrored over axes in a 45 degree raster + bool bMirror90Allowed : 1; // if false, object cannot even be mirrored over axes in a 90 degree raster + bool bTransparenceAllowed : 1; // if false, object does not have an interactive transparence control + bool bShearAllowed : 1; // if false, object cannot be sheared + bool bEdgeRadiusAllowed : 1; + bool bNoOrthoDesired : 1; // is true for Rect; is false for BMP, MTF + bool bNoContortion : 1; // if false, contortion not possible (for crook, only true for PathObj and grouped PathObjs) + bool bCanConvToPath : 1; // if false, no conversion into PathObj possible + bool bCanConvToPoly : 1; // if false, no conversion into PolyObj possible + bool bCanConvToContour : 1; // if false, no conversion down to whole contour possible + bool bCanConvToPathLineToArea : 1; // if false, no conversion into PathObj with transformation from LineToArea possible + bool bCanConvToPolyLineToArea : 1; // if false, no conversion into PolyObj with transformation from LineToArea possible + + SdrObjTransformInfoRec(); +}; + +//////////////////////////////////////////////////////////////////////////////////////////////////// +// +// SdrObject +// SdrAttrObj +// E3dObject +// E3dCompoundObject +// E3dCubeObj +// E3dExtrudeObj +// E3dLatheObj +// E3dPolygonObj +// E3dSphereObj +// E3dScene +// SdrTextObj +// SdrObjCustomShape +// OCustomShape +// SdrEdgeObj +// SdrMeasureObj +// SdrPathObj +// SdrRectObj +// SdrCaptionObj +// SdrCircObj +// SdrGrafObj +// SdrMediaObj +// SdrOle2Obj +// OOle2Obj +// SdrUnoObj +// DlgEdObj +// DlgEdForm +// OUnoObject +// FmFormObj +// SdrTableObj +// SdrObjGroup +// SdrPageObj +// SdrVirtObj +// SwDrawVirtObj +// SwVirtFlyDrawObj +// SwFlyDrawObj + +/// Abstract DrawObject +class SVXCORE_DLLPUBLIC SdrObject : public SfxListener, public tools::WeakBase +{ +private: + friend class SdrObjListIter; + friend class SdrVirtObj; + friend class SdrRectObj; + + // OperationSmiley: Allow at each SdrObject to set a FillGeometryDefiningShape, + // so that for SdrObjects where this is set, the definition of a defined FillStyle + // will use this, but the local geometry will be filled. This allows to fill + // multiple shapes with a unified fill, e.g think about CustomShapes. + // Currently this is *only* used for CustomShapes, but may be developed to get a + // common mechanism - usages for it are easy to be found. The current limitation + // to CustomShapes allows to think about these SdrObjects to 'vanish' during the + // lifetime of 'this' - the SdrObjects without SdrPage and SdrModel are used as helper + // objects for SdrObjCustomShape and thus their lifetime is limited to the lifetime + // of this local object. For unifying this mechanism, some weak reference of + // SdrObjects would have to be thought about (not easy with the current implementation). + // So - allow *only* EnhancedCustomShape2d (which creates the visualizations for + // SdrObjCustomShape) to set this. Already allow unified read to use it - thus already + // allowing to implement as standard case for all kinds of SdrObjects. + friend class EnhancedCustomShape2d; + const SdrObject* mpFillGeometryDefiningShape; + void setFillGeometryDefiningShape(const SdrObject* pNew) { mpFillGeometryDefiningShape = pNew; } +public: + const SdrObject* getFillGeometryDefiningShape() const { return mpFillGeometryDefiningShape; } + +private: + // the SdrModel this objects was created with, unchanged during SdrObject lifetime + SdrModel& mrSdrModelFromSdrObject; + +public: + // A SdrObject always needs a SdrModel for lifetime (Pool, ...) + SdrObject(SdrModel& rSdrModel); + + // SdrModel/SdrPage access on SdrObject level + SdrPage* getSdrPageFromSdrObject() const; + SdrModel& getSdrModelFromSdrObject() const; + + // access to possible children (SdrObjGroup/E3dScene) + virtual SdrObjList* getChildrenOfSdrObject() const; + + // access to parent + SdrObjList* getParentSdrObjListFromSdrObject() const; + SdrObject* getParentSdrObjectFromSdrObject() const; + +private: + // only allow SetParentAtSdrObjectFromSdrObjList to call setParentOfSdrObject + friend void SetParentAtSdrObjectFromSdrObjList(SdrObject& rSdrObject, SdrObjList* pNew); + SVX_DLLPRIVATE void setParentOfSdrObject(SdrObjList* pNew); + +public: + // react on model/page change + virtual void handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage); + + void AddObjectUser(sdr::ObjectUser& rNewUser); + void RemoveObjectUser(sdr::ObjectUser& rOldUser); + + sdr::contact::ViewContact& GetViewContact() const; + + virtual sdr::properties::BaseProperties& GetProperties() const; + + // DrawContact support: Methods for handling Object changes + void ActionChanged() const; + + static SdrItemPool& GetGlobalDrawObjectItemPool(); + void SetRelativeWidth( double nValue ); + void SetRelativeWidthRelation( sal_Int16 eValue ); + void SetRelativeHeight( double nValue ); + void SetRelativeHeightRelation( sal_Int16 eValue ); + const double* GetRelativeWidth() const; + sal_Int16 GetRelativeWidthRelation() const; + const double* GetRelativeHeight() const; + sal_Int16 GetRelativeHeightRelation() const; + + void SetDiagramData(std::shared_ptr pDiagramData); + std::shared_ptr GetDiagramData() const; + + /// @param bNotMyself = true: set only ObjList to dirty, don't mark this object as dirty. + /// + /// This is needed for instance for NbcMove, because usually one moves SnapRect and aOutRect + /// at the same time to avoid recomputation. + virtual void SetRectsDirty(bool bNotMyself = false, bool bRecursive = true); + + // frees the SdrObject pointed to by the argument + // In case the object has an SvxShape, which has the ownership of the object, it + // is actually *not* deleted. + static void Free( SdrObject*& _rpObject ); + + // this method is only for access from Property objects + virtual void SetBoundRectDirty(); + + SfxItemPool & GetObjectItemPool() const; + + void AddListener(SfxListener& rListener); + void RemoveListener(SfxListener& rListener); + + void AddReference(SdrVirtObj& rVrtObj); + void DelReference(SdrVirtObj& rVrtObj); + virtual SdrInventor GetObjInventor() const; + virtual sal_uInt16 GetObjIdentifier() const; + virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const; + + // Layer interface + virtual SdrLayerID GetLayer() const; + virtual void NbcSetLayer(SdrLayerID nLayer); + virtual void SetLayer(SdrLayerID nLayer); + // renaming GetSdrLayerIDSet -> getMergedHierarchySdrLayerIDSet to make clear what happens here. rSet needs to be empty. + void getMergedHierarchySdrLayerIDSet(SdrLayerIDSet& rSet) const; + + void SendUserCall(SdrUserCallType eUserCall, const tools::Rectangle& rBoundRect) const; + + // #i68101# + // An object may have a user-set Name (Get/SetName()), e.g SdrGrafObj, SdrObjGroup + // or SdrOle2Obj. + // It may also have a Title and a Description for accessibility purposes. + void SetName(const OUString& rStr); + OUString GetName() const; + void MakeNameUnique(); + void MakeNameUnique(std::unordered_set& rNameSet); + void SetTitle(const OUString& rStr); + OUString GetTitle() const; + void SetDescription(const OUString& rStr); + OUString GetDescription() const; + + // for group objects + bool IsGroupObject() const; + virtual SdrObjList* GetSubList() const; + + /// The order number (aka ZOrder, aka z-index) determines whether a + /// SdrObject is located above or below another. Objects are painted from + /// lowest to highest order number. If the order of SdrObjects in the + /// SdrObjList is changed, the bObjOrdNumsDirty flag is set on the SdrPage + /// and the next GetOrdNum() call recalculates the order number of all + /// SdrObjects in the SdrObjList. + sal_uInt32 GetOrdNum() const; + + // setting the order number should only happen from the model or from the page + void SetOrdNum(sal_uInt32 nNum); + + // GrabBagItem for interim interop purposes + void GetGrabBagItem(css::uno::Any& rVal) const; + + void SetGrabBagItem(const css::uno::Any& rVal); + + // Return the position in the navigation order for the called object. + // Note that this method may update the navigation position of the + // called and of other SdrObjects. Therefore this method can not be + // const. + // @return + // If no navigation position has been explicitly defined then the + // result of GetOrdNum() is returned. + sal_uInt32 GetNavigationPosition() const; + + // To make clearer that this method may trigger RecalcBoundRect and thus may be + // expensive and sometimes problematic (inside a bigger object change You will get + // non-useful BoundRects sometimes) i rename that method from GetBoundRect() to + // GetCurrentBoundRect(). + virtual const tools::Rectangle& GetCurrentBoundRect() const; + + // To have a possibility to get the last calculated BoundRect e.g for producing + // the first rectangle for repaints (old and new need to be used) without forcing + // a RecalcBoundRect (which may be problematical and expensive sometimes) i add here + // a new method for accessing the last BoundRect. + virtual const tools::Rectangle& GetLastBoundRect() const; + + virtual void RecalcBoundRect(); + + void BroadcastObjectChange() const; + + const SfxBroadcaster* GetBroadcaster() const; + + // set modified-flag in the model + virtual void SetChanged(); + + // Tooling for painting a single object to an OutputDevice. This will be needed as long + // as not all painting is changed to use DrawContact objects. + void SingleObjectPainter(OutputDevice& rOut) const; + bool LineGeometryUsageIsNecessary() const; + + // RotGrfFlyFrame: If true, this SdrObject supports only limited rotation, that + // means no change of the rotation point (only centered) and no shear allowed + virtual bool HasLimitedRotation() const; + + // Returns a copy of the object. Every inherited class must reimplement this (in class Foo + // it should be sufficient to do "virtual Foo* CloneSdrObject(...) const { return CloneHelper< Foo >(); }". + // Note that this function uses operator= internally. + virtual SdrObject* CloneSdrObject(SdrModel& rTargetModel) const; + + // implemented mainly for the purposes of CloneSdrObject() + SdrObject& operator=(const SdrObject& rObj); + + // TakeObjName...() is for the display in the UI, e.g. "3 frames selected" + virtual OUString TakeObjNameSingul() const; + virtual OUString TakeObjNamePlural() const; + + /// The Xor-Polygon is required by the View to drag the object. + /// All polygons within the PolyPolygon are interpreted as PolyLine. + /// To get a closed Polygon, close it explicitly. + virtual basegfx::B2DPolyPolygon TakeXorPoly() const; + + /// contour for TextToContour + virtual basegfx::B2DPolyPolygon TakeContour() const; + + /// Via GetHdlCount the number of Handles can be retrieved. + /// Normally 8, if it's a line 2. + /// For Polygon objects (Polygon/Spline/Bezier) the number may be much + /// larger. Polygon objects are also allowed to select a point of a + /// selected object. The handle of that point will then be replaced by + /// a new set of handles (PlusHdl). For a Polygon this would be a simple + /// selection Handle, for a Bezier curve this may be up to 3 Handles + /// (including Weights). + /// GetHdl() and GetPlusHdl() must create Handle instances with new! + /// An object that returns true from HasSpacialDrag() must provide these + /// methods (incl. FillHdlList()). + virtual sal_uInt32 GetHdlCount() const; + virtual void AddToPlusHdlList(SdrHdlList& rHdlList, SdrHdl& rHdl) const; + virtual void AddToHdlList(SdrHdlList& rHdlList) const; + virtual void addCropHandles(SdrHdlList& rTarget) const; + + /// The standard transformations (Move,Resize,Rotate,Mirror,Shear) are + /// taken over by the View (TakeXorPoly(),...). + /// Object type specific dragging like corner radius of Rectangle, + /// control points of Splines, weights of Bezier curves, pointer of + /// Label objects must be handled by the object itself. + /// To keep the Model free of state, the state is kept in the View + /// and then passed to the object. EndDrag usually returns true for success, + /// false may be returned if the dragging did not modify the object, + /// where the View already handles the case that the pointer was not + /// moved at all. + virtual bool hasSpecialDrag() const; + virtual bool beginSpecialDrag(SdrDragStat& rDrag) const; + virtual bool applySpecialDrag(SdrDragStat& rDrag); + virtual OUString getSpecialDragComment(const SdrDragStat& rDrag) const; + virtual basegfx::B2DPolyPolygon getSpecialDragPoly(const SdrDragStat& rDrag) const; + + // FullDrag support. This is for standard interactions and for SdrObjOwn + // support. If supportsFullDrag() returns true, getFullDragClone has to + // return a cloned SdrObject (who's ownership it loses) at which modifications + // like Move(), Scale(), etc or applySpecialDrag() will be executed. That + // object will be visualized on overlay for full drag, but should not be + // part of the model, thus not changing anything since it's only a temporary + // helper object for interaction + virtual bool supportsFullDrag() const; + virtual SdrObjectUniquePtr getFullDragClone() const; + + /// Every object must be able to create itself interactively. + /// On MouseDown first an object is created, and its BegCreate() method + /// is called. On every MouseMove, MovCreate() is called. BrkCreate() + /// is called if the user cancels the interactive object creation. + /// EndCreate() is called on the MouseUp event. If EndCreate() returns + /// true, the creation is finished; the object is inserted into the + /// corresponding list. Otherwise it is assumed that further points + /// are necessary to create the object (Polygon, ...). The parameter + /// eCmd contains the number of mouse clicks (if the application + /// provides it). + /// BckCreate() will undo the previous EndCreate(), e.g. to delete the + /// last point of the Polygon. If BckCreate() returns false, creation + /// is cancelled. + virtual bool BegCreate(SdrDragStat& rStat); + virtual bool MovCreate(SdrDragStat& rStat); // if true, Xor needs to be repainted + virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd); + virtual bool BckCreate(SdrDragStat& rStat); + virtual void BrkCreate(SdrDragStat& rStat); + + /// get the cursor/pointer that signals creating this object + virtual PointerStyle GetCreatePointer() const; + + /// Polygon dragged by the user when creating the object + virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const; + + /// The methods Move, Resize, Rotate, Mirror, Shear, SetSnapRect and + /// SetLogicRect call the corresponding Nbc-methods, send a Repaint + /// broadcast and set the Modified state on the Model. + /// Derived classes should usually only override the Nbc methods. + /// Nbc means "no broadcast". + virtual void NbcMove (const Size& rSiz); + virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact); + virtual void NbcCrop (const basegfx::B2DPoint& rRef, double fxFact, double fyFact); + virtual void NbcRotate(const Point& rRef, long nAngle, double sn, double cs); + virtual void NbcMirror(const Point& rRef1, const Point& rRef2); + virtual void NbcShear (const Point& rRef, long nAngle, double tn, bool bVShear); + + virtual void Move (const Size& rSiz); + virtual void Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bUnsetRelative = true); + virtual void Crop (const basegfx::B2DPoint& rRef, double fxFact, double fyFact); + virtual void Rotate(const Point& rRef, long nAngle, double sn, double cs); + virtual void Mirror(const Point& rRef1, const Point& rRef2); + virtual void Shear (const Point& rRef, long nAngle, double tn, bool bVShear); + + /// The relative position of a SdrObject is the distance of the upper + /// left corner of the logic bounding rectangle (SnapRect) to the anchor. + virtual void NbcSetRelativePos(const Point& rPnt); + virtual void SetRelativePos(const Point& rPnt); + virtual Point GetRelativePos() const; + void ImpSetAnchorPos(const Point& rPnt); + virtual void NbcSetAnchorPos(const Point& rPnt); + virtual void SetAnchorPos(const Point& rPnt); + + /// Snap is not done on the BoundRect but if possible on logic coordinates + /// (i.e. without considering stroke width, ...) + /// SetSnapRect() tries to size the Object so that it fits into the + /// passed Rect (without stroke width, ...) + virtual void RecalcSnapRect(); + virtual const tools::Rectangle& GetSnapRect() const; + virtual void SetSnapRect(const tools::Rectangle& rRect); + virtual void NbcSetSnapRect(const tools::Rectangle& rRect); + + // Logic Rect: for the Rect for instance without regard to rotation angle, shear, ... + virtual const tools::Rectangle& GetLogicRect() const; + virtual void SetLogicRect(const tools::Rectangle& rRect); + virtual void NbcSetLogicRect(const tools::Rectangle& rRect); + + // the default is to set the logic rect to the given rectangle rMaxRect. If the shape + // has an intrinsic aspect ratio it may set the logic rect so the aspect + // ratio is kept but still inside the rectangle rMaxRect. + // If bShrinkOnly is set to true, the size of the current logic rect will not + // be changed if it is smaller than the given rectangle rMaxRect. + virtual void AdjustToMaxRect( const tools::Rectangle& rMaxRect, bool bShrinkOnly = false ); + + // rotation and shear angle + virtual long GetRotateAngle() const; + virtual long GetShearAngle(bool bVertical = false) const; + + /// snap to special points of an Object (polygon points, center of circle) + virtual sal_uInt32 GetSnapPointCount() const; + virtual Point GetSnapPoint(sal_uInt32 i) const; + + // For objects, whose points can be moved individually. + // (e.g. polygons, polylines, lines) + // The points of those objects are selected (if necessary multiselection), + // deleted, inserted, or as a multiselection moved or rotated... + // Only such objects can have PlusHandles (e.g. the weights of a Bezier curve). + virtual bool IsPolyObj() const; + virtual sal_uInt32 GetPointCount() const; + virtual Point GetPoint(sal_uInt32 i) const; + void SetPoint(const Point& rPnt, sal_uInt32 i); + virtual void NbcSetPoint(const Point& rPnt, sal_uInt32 i); + + // get all geometrical data for undo/redo + virtual SdrObjGeoData* GetGeoData() const; + virtual void SetGeoData(const SdrObjGeoData& rGeo); + + // ItemSet access + const SfxItemSet& GetMergedItemSet() const; + void SetMergedItem(const SfxPoolItem& rItem); + void ClearMergedItem(const sal_uInt16 nWhich = 0); + void SetMergedItemSet(const SfxItemSet& rSet, bool bClearAllItems = false); + const SfxPoolItem& GetMergedItem(const sal_uInt16 nWhich) const; + template + const T& GetMergedItem( TypedWhichId nWhich ) const + { + return static_cast(GetMergedItem(sal_uInt16(nWhich))); + } + + // syntactical sugar for ItemSet accesses + void SetMergedItemSetAndBroadcast(const SfxItemSet& rSet, bool bClearAllItems = false); + + // NotPersistAttr for Layer, ObjName, geometrical transformations etc. + void TakeNotPersistAttr(SfxItemSet& rAttr) const; + void ApplyNotPersistAttr(const SfxItemSet& rAttr); + void NbcApplyNotPersistAttr(const SfxItemSet& rAttr); + + // if bDontRemoveHardAttr is false, set all attributes, which were set in the style sheet, to their default value + // if true, all hard attributes keep their values + void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr); + virtual void NbcSetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr); + SfxStyleSheet* GetStyleSheet() const; + + virtual bool HasTextEdit() const; + + // keep text in outliner's format + // SetOutlinerParaObject: transfer ownership of *pTextObject! + void SetOutlinerParaObject(std::unique_ptr pTextObject); + virtual void NbcSetOutlinerParaObject(std::unique_ptr pTextObject); + virtual OutlinerParaObject* GetOutlinerParaObject() const; + virtual void NbcReformatText(); + + void BurnInStyleSheetAttributes(); + + // macro abilities, e.g. a rectangle as PushButton. + virtual bool HasMacro() const; + virtual SdrObject* CheckMacroHit (const SdrObjMacroHitRec& rRec) const; + virtual PointerStyle GetMacroPointer (const SdrObjMacroHitRec& rRec) const; + virtual void PaintMacro (OutputDevice& rOut, const tools::Rectangle& rDirtyRect, const SdrObjMacroHitRec& rRec) const; + virtual bool DoMacro (const SdrObjMacroHitRec& rRec); + bool IsMacroHit(const SdrObjMacroHitRec& rRec) const; + + // Connectors + // (see also documentation in SvdoEdge.hxx, SdrEdgeObj, as well as SvdGlue.hxx and SvdGlEV.hxx) + // + // There are nodes and edges. In theory an edge can also be a node, but this isn't implemented yet. + // A node has a number of glue points, onto which edges can glued to + // An edge can be either + // - without any connection to any node, + // - or connected on one end to a node, while the other end is not connected, + // - or connected on both ends with exactly one node each. + // The edge is listener for its up to two nodes. + // Whenever a node is moved or resized, all its connected edges follow. + // This is also true for SetGluePoint()... on the node. + // On the other hand, moving/resizing an edge breaks the connection. + + // automatic glue points: + // a node object must provide four vertex and corner positions + // usually 0: top, 1: right, 2: bottom, 3: left + virtual SdrGluePoint GetVertexGluePoint(sal_uInt16 nNum) const; + + // usually: + // 0: top-left, 1: top-right, 2: bottom-right, 3: bottom-left + virtual SdrGluePoint GetCornerGluePoint(sal_uInt16 nNum) const; + + // list of all glue points, can be NULL + virtual const SdrGluePointList* GetGluePointList() const; + + // after changing the GluePointList, one has to call the object's SendRepaintBroadcast! + virtual SdrGluePointList* ForceGluePointList(); + + // to be set temporarily when transforming related object(?) + void SetGlueReallyAbsolute(bool bOn); + void NbcRotateGluePoints(const Point& rRef, long nAngle, double sn, double cs); + void NbcMirrorGluePoints(const Point& rRef1, const Point& rRef2); + void NbcShearGluePoints (const Point& rRef, double tn, bool bVShear); + + // if bTail1 is true, line start, otherwise line end + // if pObj is null disconnect + virtual void ConnectToNode(bool bTail1, SdrObject* pObj); + virtual void DisconnectFromNode(bool bTail1); + virtual SdrObject* GetConnectedNode(bool bTail1) const; + + // sets the writing mode of the object's context + // Objects which itself do not support different writing modes will ignore this call. + // Objects which support different writing modes, but have an own, explicit writing mode set, + // will also ignore this call. + // Objects which support different writing modes, and whose own mode is set to css.text.WritingMode2.CONTEXT, + // will use the given writing mode to calculate their "effective writing mode". + // The behaviour of this method is undefined if you pass css.text.WritingMode2.CONTEXT. + // @param _nContextWritingMode + // the effective writing mode of the context of the object + virtual void SetContextWritingMode( const sal_Int16 _nContextWritingMode ); + + // If an object is able to convert itself into a polygon or into a Bezier curve (or into both), + // then the following methods should be overridden. + // E.g., convert a RectObj with line width 10, SOLID_PEN into a polygon: + // In the bLineToArea=false mode a PolyObj with four supporting points, + // line width 10 and SOLID_PEN shall be created. + // On the contrary in the bLineToArea=true mode the generated object should + // still have a line attribute NULL_PEN, and the line (also line pattern) + // itself should be emulated by the polygon area, which thereby can be + // manipulated by the user afterwards. + // The RectObj therefore can only convert correctly if it has an area attribute NULL_BRUSH. + // In this case it would have to: + // - set SOLID_BRUSH with the color of the given pen, + // - set NULL_PEN, and + // - generate tools::PolyPolygon with two polygons with four supporting points each. + // In each case the return value is a SdrObject*, because it is also + // allowed to return group objects (e.g. for SdrTextObj). + // In the case of the conversion from TextObj to PathObj, + // both modi (bLineToArea=true/false) would be identical. + // The methods' default implementations report "I'm unable to do this" (false/null). + virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const; + SdrObjectUniquePtr ConvertToPolyObj(bool bBezier, bool bLineToArea) const; + + // convert this path object to contour object; bForceLineDash converts even + // when there is no filled new polygon created from line-to-polygon conversion, + // specially used for XLINE_DASH and 3D conversion + SdrObject* ConvertToContourObj(SdrObject* pRet, bool bForceLineDash = false) const; +private: + SdrObject* ImpConvertToContourObj(bool bForceLineDash); +public: + + // if true, reference onto an object + bool IsVirtualObj() const { return bVirtObj;} + + // is true, if object can probably be filled + // is false, if object has probably line ends + // is invalid, if this is a group object + bool IsClosedObj() const { return bClosedObj;} + + // tdf#118662 reorganize inserted state, no local bool needed anymore, + // it depends on being a member of a SdrObjList + void InsertedStateChange(); + bool IsInserted() const { return nullptr != getParentSdrObjListFromSdrObject(); } + + bool IsEdgeObj() const { return bIsEdge;} + bool Is3DObj() const { return bIs3DObj;} + bool IsUnoObj() const { return bIsUnoObj;} + void SetMoveProtect(bool bProt); + bool IsMoveProtect() const { return bMovProt;} + void SetResizeProtect(bool bProt); + bool IsResizeProtect() const { return bSizProt;} + void SetPrintable(bool bPrn); + bool IsPrintable() const { return !bNoPrint;} + void SetVisible(bool bVisible); + bool IsVisible() const { return mbVisible;} + void SetMarkProtect(bool bProt); + bool IsMarkProtect() const { return bMarkProt;} + + /// Whether the aspect ratio should be kept by default when resizing. + virtual bool shouldKeepAspectRatio() const { return false; } + + // application specific data + sal_uInt16 GetUserDataCount() const; + SdrObjUserData* GetUserData(sal_uInt16 nNum) const; + + void AppendUserData(std::unique_ptr pData); + + // removes the record from the list and performs delete (FreeMem+Dtor). + void DeleteUserData(sal_uInt16 nNum); + + // access to the UNO representation of the shape + virtual css::uno::Reference< css::uno::XInterface > getUnoShape(); + + static SdrObject* getSdrObjectFromXShape( const css::uno::Reference< css::uno::XInterface >& xInt ); + + // retrieves the instance responsible for notifying changes in the properties of the shape associated with + // the SdrObject + // + // @precond + // There already exists an SvxShape instance associated with the SdrObject + // @throws css::uno::RuntimeException + // if there does nt yet exists an SvxShape instance associated with the SdrObject. + svx::PropertyChangeNotifier& getShapePropertyChangeNotifier(); + + // notifies a change in the given property, to all applicable listeners registered at the associated SvxShape + // + // This method is equivalent to calling getShapePropertyChangeNotifier().notifyPropertyChange( _eProperty ), + // exception that it is allowed to be called when there does not yet exist an associated SvxShape - in which + // case the method will silently return without doing anything. + void notifyShapePropertyChange( const svx::ShapeProperty _eProperty ) const; + + // transformation interface for StarOfficeAPI. This implements support for + // homogen 3x3 matrices containing the transformation of the SdrObject. At the + // moment it contains a shearX, rotation and translation, but for setting all linear + // transforms like Scale, ShearX, ShearY, Rotate and Translate are supported. + // + // gets base transformation and rectangle of object. If it's an SdrPathObj it fills the PolyPolygon + // with the base geometry and returns TRUE. Otherwise it returns FALSE. + virtual bool TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPolyPolygon& rPolyPolygon) const; + + // sets the base geometry of the object using infos contained in the homogen 3x3 matrix. + // If it's an SdrPathObj it will use the provided geometry information. The Polygon has + // to use (0,0) as upper left and will be scaled to the given size in the matrix. + virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& rPolyPolygon); + + // give info if object is in destruction + bool IsInDestruction() const; + + // return if fill is != XFILL_NONE + bool HasFillStyle() const; + bool HasLineStyle() const; + + // on import of OLE object from MS documents the BLIP size might be retrieved, + // the following methods are used to control it; + // usually this data makes no sense after the import is finished, since the object + // might be resized + const tools::Rectangle& GetBLIPSizeRectangle() const { return maBLIPSizeRectangle;} + void SetBLIPSizeRectangle( const tools::Rectangle& aRect ); + + // #i121917# + virtual bool HasText() const; + + bool Equals(const SdrObject&) const; + + virtual void dumpAsXml(xmlTextWriterPtr pWriter) const; + + /// Is this a textbox of a drawinglayer shape? + virtual bool IsTextBox() const; + + void SetEmptyPresObj(bool bEpt); + bool IsEmptyPresObj() const { return bEmptyPresObj;} + void SetNotVisibleAsMaster(bool bFlg); + bool IsNotVisibleAsMaster() const { return bNotVisibleAsMaster;} + void SetUserCall(SdrObjUserCall* pUser); + SdrObjUserCall* GetUserCall() const { return pUserCall;} + /// @see mbDoNotInsertIntoPageAutomatically + void SetDoNotInsertIntoPageAutomatically(bool bSet); + /// @see mbDoNotInsertIntoPageAutomatically + bool IsDoNotInsertIntoPageAutomatically() const { return mbDoNotInsertIntoPageAutomatically;} + + // Warning: this method should only be used if you really know what you're doing + sal_uInt32 GetOrdNumDirect() const { return nOrdNum;} + + // #i25616# + bool DoesSupportTextIndentingOnLineWidthChange() const { return mbSupportTextIndentingOnLineWidthChange;} + + const Point& GetAnchorPos() const; + + // #i25616# + bool LineIsOutsideGeometry() const { return mbLineIsOutsideGeometry;} + + // Set the position in the navigation position to the given value. + // This method is typically used only by the model after a change to + // the navigation order. + // This method does not change the navigation position of other + // objects. + // Use SdrObjList::SetObjectNavigationPosition() instead. + void SetNavigationPosition (const sal_uInt32 nPosition); + + // sets a new UNO representation of the shape + // This is only a public interface function. The actual work is + // done by impl_setUnoShape(). + // Calling this function is only allowed for the UNO representation + // itself! + void setUnoShape( const css::uno::Reference& _rxUnoShape); + + const css::uno::WeakReference< css::uno::XInterface >& getWeakUnoShape() const { return maWeakUnoShape; } + + void setSuitableOutlinerBg(Outliner& rOutliner) const; + +protected: + tools::Rectangle aOutRect; // surrounding rectangle for Paint (incl. LineWidth, ...) + Point aAnchor; // anchor position (Writer) + SdrObjUserCall* pUserCall; + std::unique_ptr + pPlusData; // Broadcaster, UserData, connectors, ... (this is the Bitsack) + // object is only pointing to another one + bool bVirtObj : 1; + bool bSnapRectDirty : 1; + // the following flags will be streamed + bool bMovProt : 1; // if true, the position is protected + bool bSizProt : 1; // if true, the size is protected + // If bEmptyPresObj is true, it is a presentation object that has no content yet. + // The flag's default value is false. + // The management is done by the application. + // Neither assign operator nor cloning copies the flag! + // The flag is persistent. + bool bEmptyPresObj : 1; // empty presentation object (Draw) + // if true, object is invisible as object of the MasterPage + bool bNotVisibleAsMaster : 1; + // if true, the object is closed, i.e. no line, arc... + bool bClosedObj : 1; + bool bIsEdge : 1; + bool bIs3DObj : 1; + bool bIsUnoObj : 1; + // #i25616# + bool mbLineIsOutsideGeometry : 1; + // #i25616# + bool mbSupportTextIndentingOnLineWidthChange : 1; + + virtual ~SdrObject() override; + + virtual std::unique_ptr CreateObjectSpecificProperties(); + + virtual std::unique_ptr CreateObjectSpecificViewContact(); + + tools::Rectangle ImpDragCalcRect(const SdrDragStat& rDrag) const; + + // for GetDragComment + OUString ImpGetDescriptionStr(const char* pStrCacheID) const; + + void ImpForcePlusData(); + + OUString GetMetrStr(long nVal) const; + + /// A derived class must override these 3 methods if it has own geometric + /// data that must be saved for Undo. + /// NewGeoData() creates an empty instance of a class derived from + /// SdrObjGeoData. + virtual SdrObjGeoData* NewGeoData() const; + virtual void SaveGeoData(SdrObjGeoData& rGeo) const; + virtual void RestGeoData(const SdrObjGeoData& rGeo); + + // internal versions + const SfxItemSet& GetObjectItemSet() const; + void SetObjectItem(const SfxPoolItem& rItem); + void SetObjectItemSet(const SfxItemSet& rSet); + const SfxPoolItem& GetObjectItem(const sal_uInt16 nWhich) const; + template const T& GetObjectItem( TypedWhichId nWhich ) const + { + return static_cast(GetObjectItem(sal_uInt16(nWhich))); + } + + /// Sets a new UNO shape + /// + /// The default implementation of this function sets the new UNO + /// shape. Derived classes should override the function to handle + /// any other actions that are needed when the shape is being + /// changed. + /// + /// The implementation _must_ call the same method of its parent + /// class (preferably as the first step)! + virtual void impl_setUnoShape( const css::uno::Reference< css::uno::XInterface >& _rxUnoShape ); + + // helper function for reimplementing Clone(). + template< typename T > T* CloneHelper(SdrModel& rTargetModel) const; + +private: + struct Impl; + std::unique_ptr mpImpl; + SdrObjList* mpParentOfSdrObject; // list that includes this object + sal_uInt32 nOrdNum; // order number of the object in the list + std::unique_ptr pGrabBagItem; // holds the GrabBagItem property + // Position in the navigation order. SAL_MAX_UINT32 when not used. + sal_uInt32 mnNavigationPosition; + SdrLayerID mnLayerID; + bool bNoPrint : 1; // if true, the object is not printed. + bool mbVisible : 1; // if false, the object is not visible on screen (but maybe on printer, depending on bNoprint + bool bMarkProt : 1; // marking forbidden, persistent + // on import of OLE object from MS documents the BLIP size might be retrieved, + // in this case the following member is initialized as nonempty rectangle + tools::Rectangle maBLIPSizeRectangle; + std::unique_ptr + mpProperties; + std::unique_ptr + mpViewContact; + + // global static ItemPool for not-yet-inserted items + static SdrItemPool* mpGlobalItemPool; + + // do not use directly, always use getSvxShape() if you have to! + SvxShape* mpSvxShape; + css::uno::WeakReference< css::uno::XInterface > + maWeakUnoShape; + // HACK: Do not automatically insert newly created object into a page. + // The user needs to do it manually later. + bool mbDoNotInsertIntoPageAutomatically; + + // only for internal use! + SvxShape* getSvxShape(); + + SdrObject( const SdrObject& ) = delete; +}; + +struct SVXCORE_DLLPUBLIC SdrObjectFreeOp +{ + void operator()(SdrObject* obj) + { + SdrObject::Free(obj); + } +}; + +struct SdrObjCreatorParams +{ + SdrInventor nInventor; + sal_uInt16 nObjIdentifier; + SdrModel& rSdrModel; +}; + +/** + * Whoever creates his own objects must set a link in the SdrObjFactory class. + * The handler must have the following signature: + * void Hdl(SdrObjFactory*) + * He must take a look at the referenced instance's nInventor and nIdentifier values, + * and must create a new drawing object instance accordingly. + * He must also make the pNewObj pointer reference to this instance. + */ +class SVXCORE_DLLPUBLIC SdrObjFactory +{ +public: + static SdrObject* MakeNewObject( + SdrModel& rSdrModel, + SdrInventor nInventor, + sal_uInt16 nObjIdentifier, + const tools::Rectangle* pSnapRect = nullptr); + + static void InsertMakeObjectHdl(Link const & rLink); + static void RemoveMakeObjectHdl(Link const & rLink); + +private: + static SVX_DLLPRIVATE SdrObject* CreateObjectFromFactory( + SdrModel& rSdrModel, + SdrInventor nInventor, + sal_uInt16 nIdentifier); + + SdrObjFactory() = delete; +}; + +template< typename T > T* SdrObject::CloneHelper(SdrModel& rTargetModel) const +{ + OSL_ASSERT( typeid( T ) == typeid( *this )); + T* pObj = dynamic_cast< T* >( + SdrObjFactory::MakeNewObject( + rTargetModel, + GetObjInventor(), + GetObjIdentifier())); + + if(nullptr != pObj) + { + // use ::operator=() + *pObj = *static_cast< const T* >( this ); + } + + return pObj; +} + +#endif // INCLUDED_SVX_SVDOBJ_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdocapt.hxx b/include/svx/svdocapt.hxx new file mode 100644 index 000000000..01b928b61 --- /dev/null +++ b/include/svx/svdocapt.hxx @@ -0,0 +1,159 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVDOCAPT_HXX +#define INCLUDED_SVX_SVDOCAPT_HXX + +#include +#include + + +// Forward Declarations +class ImpCaptParams; + +namespace sdr::properties { + class CaptionProperties; +} + +// Helper Class SdrCaptObjGeoData +class SdrCaptObjGeoData final : public SdrTextObjGeoData +{ +public: + tools::Polygon aTailPoly; +}; + +// SdrCaptionObj +class SVXCORE_DLLPUBLIC SdrCaptionObj final : public SdrRectObj +{ +private: + // to allow sdr::properties::CaptionProperties access to ImpRecalcTail() + friend class sdr::properties::CaptionProperties; + friend class SdrTextObj; // for ImpRecalcTail() during AutoGrow + + // tdf#118662 exclusive friend function and setter for SuppressGetBitmap + friend void setSuppressGetBitmapFromXclObjComment(SdrCaptionObj* pSdrCaptionObj, bool bValue); + void setSuppressGetBitmap(bool bNew) + { + mbSuppressGetBitmap = bNew; + } + + virtual std::unique_ptr CreateObjectSpecificProperties() override; + virtual std::unique_ptr CreateObjectSpecificViewContact() override; + + tools::Polygon aTailPoly; // the whole tail polygon + bool mbSpecialTextBoxShadow; // for calc special shadow, default FALSE + bool mbFixedTail; // for calc note box fixed tail, default FALSE + bool mbSuppressGetBitmap; // tdf#118662 + Point maFixedTailPos; // for calc note box fixed tail position. + + SVX_DLLPRIVATE void ImpGetCaptParams(ImpCaptParams& rPara) const; + SVX_DLLPRIVATE static void ImpCalcTail1(const ImpCaptParams& rPara, tools::Polygon& rPoly, tools::Rectangle const & rRect); + SVX_DLLPRIVATE static void ImpCalcTail2(const ImpCaptParams& rPara, tools::Polygon& rPoly, tools::Rectangle const & rRect); + SVX_DLLPRIVATE static void ImpCalcTail3(const ImpCaptParams& rPara, tools::Polygon& rPoly, tools::Rectangle const & rRect); + SVX_DLLPRIVATE static void ImpCalcTail (const ImpCaptParams& rPara, tools::Polygon& rPoly, tools::Rectangle const & rRect); + SVX_DLLPRIVATE void ImpRecalcTail(); + + // protected destructor + virtual ~SdrCaptionObj() override; + +public: + SdrCaptionObj(SdrModel& rSdrModel); + SdrCaptionObj( + SdrModel& rSdrModel, + const tools::Rectangle& rRect, + const Point& rTail); + + // tdf#118662 getter for SuppressGetBitmap + bool isSuppressGetBitmap() const { return mbSuppressGetBitmap; } + + virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; + virtual sal_uInt16 GetObjIdentifier() const override; + virtual SdrCaptionObj* CloneSdrObject(SdrModel& rTargetModel) const override; + + // implemented mainly for the purposes of Clone() + SdrCaptionObj& operator=(const SdrCaptionObj& rObj); + + // for calc: special shadow only for text box + void SetSpecialTextBoxShadow() { mbSpecialTextBoxShadow = true; } + bool GetSpecialTextBoxShadow() const { return mbSpecialTextBoxShadow; } + + // for calc: fixed note tail position. + void SetFixedTail() { mbFixedTail = true; } + + virtual OUString TakeObjNameSingul() const override; + virtual OUString TakeObjNamePlural() const override; + + virtual basegfx::B2DPolyPolygon TakeXorPoly() const override; + virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override; + + virtual sal_uInt32 GetHdlCount() const override; + virtual void AddToHdlList(SdrHdlList& rHdlList) const override; + + // special drag methods + virtual bool hasSpecialDrag() const override; + virtual bool beginSpecialDrag(SdrDragStat& rDrag) const override; + virtual bool applySpecialDrag(SdrDragStat& rDrag) override; + virtual OUString getSpecialDragComment(const SdrDragStat& rDrag) const override; + + virtual bool BegCreate(SdrDragStat& rStat) override; + virtual bool MovCreate(SdrDragStat& rStat) override; + virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) override; + virtual bool BckCreate(SdrDragStat& rStat) override; + virtual void BrkCreate(SdrDragStat& rStat) override; + virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const override; + virtual PointerStyle GetCreatePointer() const override; + + virtual void NbcMove(const Size& rSiz) override; + virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override; + + virtual void NbcSetRelativePos(const Point& rPnt) override; + virtual Point GetRelativePos() const override; + + virtual const tools::Rectangle& GetLogicRect() const override; + virtual void NbcSetLogicRect(const tools::Rectangle& rRect) override; + + virtual sal_uInt32 GetSnapPointCount() const override; + virtual Point GetSnapPoint(sal_uInt32 i) const override; + +private: + virtual SdrObjGeoData* NewGeoData() const override; + virtual void SaveGeoData(SdrObjGeoData& rGeo) const override; + virtual void RestGeoData(const SdrObjGeoData& rGeo) override; + +public: + virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const override; + + const Point& GetTailPos() const; + void SetTailPos(const Point& rPos); + void NbcSetTailPos(const Point& rPos); + + // #i32599# + // Add own implementation for TRSetBaseGeometry to handle TailPos over changes + virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& rPolyPolygon) override; + + const Point& GetFixedTailPos() const {return maFixedTailPos;} + + // geometry access + ::basegfx::B2DPolygon getTailPolygon() const; +}; + + +#endif //_SVDOCAPT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdocirc.hxx b/include/svx/svdocirc.hxx new file mode 100644 index 000000000..105850fa3 --- /dev/null +++ b/include/svx/svdocirc.hxx @@ -0,0 +1,147 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVDOCIRC_HXX +#define INCLUDED_SVX_SVDOCIRC_HXX + +#include +#include + +namespace sdr::properties { + class CircleProperties; +} + +// Helper class SdrCircObjGeoData + +class SdrCircObjGeoData final : public SdrTextObjGeoData +{ +public: + long nStartAngle; + long nEndAngle; +}; + +enum class SdrCircKind { Full, Section, Cut, Arc }; + +extern SVXCORE_DLLPUBLIC SdrCircKind ToSdrCircKind(SdrObjKind); + + +class SVXCORE_DLLPUBLIC SdrCircObj final : public SdrRectObj +{ +private: + // to allow sdr::properties::CircleProperties access to ImpSetAttrToCircInfo() + friend class sdr::properties::CircleProperties; + + virtual std::unique_ptr CreateObjectSpecificViewContact() override; + virtual std::unique_ptr CreateObjectSpecificProperties() override; + + SdrCircKind meCircleKind; + long nStartAngle; + long nEndAngle; + + SVX_DLLPRIVATE basegfx::B2DPolygon ImpCalcXPolyCirc(const SdrCircKind eKind, const tools::Rectangle& rRect1, long nStart, long nEnd) const; + SVX_DLLPRIVATE static void ImpSetCreateParams(SdrDragStat& rStat); + SVX_DLLPRIVATE void ImpSetAttrToCircInfo(); // copy values from pool + SVX_DLLPRIVATE void ImpSetCircInfoToAttr(); // copy values into pool + + // returns sal_True if paint requires a XPolygon + SVX_DLLPRIVATE bool PaintNeedsXPolyCirc() const; // PaintNeedsXPoly-> PaintNeedsXPolyCirc + SVX_DLLPRIVATE virtual void RecalcXPoly() override; + + virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override; + +private: + // protected destructor - due to final, make private + virtual ~SdrCircObj() override; + +public: + SdrCircObj( + SdrModel& rSdrModel, + SdrCircKind eNewKind); + SdrCircObj( + SdrModel& rSdrModel, + SdrCircKind eNewKind, + const tools::Rectangle& rRect); + + // 0=0.00Deg=3h 9000=90.00Deg=12h 18000=180.00Deg=9h 27000=270.00Deg=6h + // The circle is build up from StartAngle to EndWink anti-clockwise. + // If nNewStartAngle==nNewEndWink, then arc has an angle of 0 degrees. + // If nNewStartAngle+36000==nNewEndWink, then the arc has angle of 360 degrees. + SdrCircObj( + SdrModel& rSdrModel, + SdrCircKind eNewKind, + const tools::Rectangle& rRect, + long nNewStartAngle, + long nNewEndWink); + + SdrCircKind GetCircleKind() const { return meCircleKind; } + + virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; + virtual sal_uInt16 GetObjIdentifier() const override; + virtual void TakeUnrotatedSnapRect(tools::Rectangle& rRect) const override; + + virtual OUString TakeObjNameSingul() const override; + virtual OUString TakeObjNamePlural() const override; + + virtual SdrCircObj* CloneSdrObject(SdrModel& rTargetModel) const override; + + // implemented mainly for the purposes of Clone() + SdrCircObj& operator=(const SdrCircObj& rObj); + + virtual void RecalcSnapRect() override; + virtual void NbcSetSnapRect(const tools::Rectangle& rRect) override; + virtual basegfx::B2DPolyPolygon TakeXorPoly() const override; + + virtual sal_uInt32 GetSnapPointCount() const override; + virtual Point GetSnapPoint(sal_uInt32 i) const override; + + virtual sal_uInt32 GetHdlCount() const override; + virtual void AddToHdlList(SdrHdlList& rHdlList) const override; + + // special drag methods + virtual bool hasSpecialDrag() const override; + virtual bool beginSpecialDrag(SdrDragStat& rDrag) const override; + virtual bool applySpecialDrag(SdrDragStat& rDrag) override; + virtual OUString getSpecialDragComment(const SdrDragStat& rDrag) const override; + + virtual bool BegCreate(SdrDragStat& rStat) override; + virtual bool MovCreate(SdrDragStat& rStat) override; + virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) override; + virtual bool BckCreate(SdrDragStat& rStat) override; + virtual void BrkCreate(SdrDragStat& rStat) override; + virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const override; + virtual PointerStyle GetCreatePointer() const override; + virtual void NbcMove(const Size& aSiz) override; + virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override; + virtual void NbcMirror(const Point& rRef1, const Point& rRef2) override; + virtual void NbcShear (const Point& rRef, long nAngle, double tn, bool bVShear) override; + virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const override; + +private: + virtual SdrObjGeoData* NewGeoData() const override; + virtual void SaveGeoData(SdrObjGeoData& rGeo) const override; + virtual void RestGeoData(const SdrObjGeoData& rGeo) override; +public: + long GetStartAngle() const { return nStartAngle; } + long GetEndAngle() const { return nEndAngle; } + +}; + +#endif // INCLUDED_SVX_SVDOCIRC_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdoedge.hxx b/include/svx/svdoedge.hxx new file mode 100644 index 000000000..2320091ab --- /dev/null +++ b/include/svx/svdoedge.hxx @@ -0,0 +1,412 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVDOEDGE_HXX +#define INCLUDED_SVX_SVDOEDGE_HXX + +#include +#include +#include +#include + + +class SdrDragMethod; +class SdrPageView; + +namespace sdr::properties { + class ConnectorProperties; +} + + +/// Utility class SdrObjConnection +class SdrObjConnection final +{ + friend class SdrEdgeObj; + friend class ImpEdgeHdl; + friend class SdrCreateView; + + Point aObjOfs; // set during dragging of a node + SdrObject* pObj; // referenced object + sal_uInt16 nConId; // connector number + + bool bBestConn : 1; // true -> the best-matching connector is searched for + bool bBestVertex : 1; // true -> the best-matching vertex to connect is searched for + bool bAutoVertex : 1; // autoConnector at apex nCon + bool bAutoCorner : 1; // autoConnector at corner nCon + +public: + SdrObjConnection() { ResetVars(); } + + void ResetVars(); + bool TakeGluePoint(SdrGluePoint& rGP) const; + + void SetBestConnection( bool rB ) { bBestConn = rB; }; + void SetBestVertex( bool rB ) { bBestVertex = rB; }; + void SetAutoVertex( bool rB ) { bAutoVertex = rB; }; + void SetConnectorId( sal_uInt16 nId ) { nConId = nId; }; + + bool IsBestConnection() const { return bBestConn; }; + bool IsAutoVertex() const { return bAutoVertex; }; + sal_uInt16 GetConnectorId() const { return nConId; }; + SdrObject* GetObject() const { return pObj; } +}; + + +enum class SdrEdgeLineCode { Obj1Line2, Obj1Line3, Obj2Line2, Obj2Line3, MiddleLine }; + +/// Utility class SdrEdgeInfoRec +class SdrEdgeInfoRec +{ +public: + // The 5 distances are set on dragging or via SetAttr and are + // evaluated by ImpCalcEdgeTrack. Only 0-3 longs are transported + // via Get/SetAttr/Get/SetStyleSh though. + Point aObj1Line2; + Point aObj1Line3; + Point aObj2Line2; + Point aObj2Line3; + Point aMiddleLine; + + // Following values are set by ImpCalcEdgeTrack + long nAngle1; // exit angle at Obj1 + long nAngle2; // exit angle at Obj2 + sal_uInt16 nObj1Lines; // 1..3 + sal_uInt16 nObj2Lines; // 1..3 + sal_uInt16 nMiddleLine; // 0xFFFF=none, otherwise point number of the beginning of the line + +public: + SdrEdgeInfoRec() + : nAngle1(0), + nAngle2(0), + nObj1Lines(0), + nObj2Lines(0), + nMiddleLine(0xFFFF) + {} + + Point& ImpGetLineOffsetPoint(SdrEdgeLineCode eLineCode); + sal_uInt16 ImpGetPolyIdx(SdrEdgeLineCode eLineCode, const XPolygon& rXP) const; + bool ImpIsHorzLine(SdrEdgeLineCode eLineCode, const XPolygon& rXP) const; + void ImpSetLineOffset(SdrEdgeLineCode eLineCode, const XPolygon& rXP, long nVal); + long ImpGetLineOffset(SdrEdgeLineCode eLineCode, const XPolygon& rXP) const; +}; + + +/// Utility class SdrEdgeObjGeoData +class SdrEdgeObjGeoData final : public SdrTextObjGeoData +{ +public: + SdrObjConnection aCon1; // connection status of the beginning of the line + SdrObjConnection aCon2; // connection status of the end of the line + std::unique_ptr pEdgeTrack; + bool bEdgeTrackDirty; // true -> connector track needs to be recalculated + bool bEdgeTrackUserDefined; + SdrEdgeInfoRec aEdgeInfo; + +public: + SdrEdgeObjGeoData(); + virtual ~SdrEdgeObjGeoData() override; +}; + + +/// Utility class SdrEdgeObj +class SVXCORE_DLLPUBLIC SdrEdgeObj : public SdrTextObj +{ +private: + // to allow sdr::properties::ConnectorProperties access to ImpSetAttrToEdgeInfo() + friend class sdr::properties::ConnectorProperties; + + friend class SdrCreateView; + friend class ImpEdgeHdl; + +protected: + virtual std::unique_ptr CreateObjectSpecificViewContact() override; + virtual std::unique_ptr CreateObjectSpecificProperties() override; + + SdrObjConnection aCon1; // Connection status of the beginning of the line + SdrObjConnection aCon2; // Connection status of the end of the line + + std::unique_ptr pEdgeTrack; + sal_uInt16 nNotifyingCount; // Locking + SdrEdgeInfoRec aEdgeInfo; + + bool bEdgeTrackDirty : 1; // true -> Connection track needs to be recalculated + bool bEdgeTrackUserDefined : 1; + + // Bool to allow suppression of default connects at object + // inside test (HitTest) and object center test (see ImpFindConnector()) + bool mbSuppressDefaultConnect : 1; + + // Flag value for avoiding infinite loops when calculating + // BoundRects from ring-connected connectors. A coloring algorithm + // is used here. When the GetCurrentBoundRect() calculation of a + // SdrEdgeObj is running, the flag is set, else it is always + // false. + bool mbBoundRectCalculationRunning : 1; + + // #i123048# need to remember if layouting was suppressed before to get + // to a correct state for first real layouting + bool mbSuppressed : 1; + +public: + // Interface to default connect suppression + void SetSuppressDefaultConnect(bool bNew) { mbSuppressDefaultConnect = bNew; } + bool GetSuppressDefaultConnect() const { return mbSuppressDefaultConnect; } + +protected: + virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override; + + static XPolygon ImpCalcObjToCenter(const Point& rStPt, long nEscAngle, const tools::Rectangle& rRect, const Point& rCenter); + void ImpRecalcEdgeTrack(); // recalculation of the connection track + XPolygon ImpCalcEdgeTrack(const XPolygon& rTrack0, SdrObjConnection& rCon1, SdrObjConnection& rCon2, SdrEdgeInfoRec* pInfo) const; + XPolygon ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const tools::Rectangle& rBoundRect1, const tools::Rectangle& rBewareRect1, + const Point& rPt2, long nAngle2, const tools::Rectangle& rBoundRect2, const tools::Rectangle& rBewareRect2, + sal_uIntPtr* pnQuality, SdrEdgeInfoRec* pInfo) const; + static bool ImpFindConnector(const Point& rPt, const SdrPageView& rPV, SdrObjConnection& rCon, const SdrEdgeObj* pThis, OutputDevice* pOut=nullptr); + static SdrEscapeDirection ImpCalcEscAngle(SdrObject const * pObj, const Point& aPt2); + void ImpSetTailPoint(bool bTail1, const Point& rPt); + void ImpUndirtyEdgeTrack(); // potential recalculation of the connection track + void ImpDirtyEdgeTrack(); // invalidate connector path, so it will be recalculated next time + void ImpSetAttrToEdgeInfo(); // copying values from the pool to aEdgeInfo + void ImpSetEdgeInfoToAttr(); // copying values from the aEdgeInfo to the pool + + // protected destructor + virtual ~SdrEdgeObj() override; + +public: + SdrEdgeObj(SdrModel& rSdrModel); + + // react on model/page change + virtual void handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage) override; + + SdrObjConnection& GetConnection(bool bTail1) { return *(bTail1 ? &aCon1 : &aCon2); } + virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; + virtual sal_uInt16 GetObjIdentifier() const override; + virtual const tools::Rectangle& GetCurrentBoundRect() const override; + virtual const tools::Rectangle& GetSnapRect() const override; + virtual SdrGluePoint GetVertexGluePoint(sal_uInt16 nNum) const override; + virtual SdrGluePoint GetCornerGluePoint(sal_uInt16 nNum) const override; + virtual const SdrGluePointList* GetGluePointList() const override; + virtual SdrGluePointList* ForceGluePointList() override; + + // * for all of the below: bTail1=true: beginning of the line, + // otherwise end of the line + // * pObj=NULL: disconnect connector + void SetEdgeTrackDirty() { bEdgeTrackDirty=true; } + void ConnectToNode(bool bTail1, SdrObject* pObj) override; + void DisconnectFromNode(bool bTail1) override; + SdrObject* GetConnectedNode(bool bTail1) const override; + const SdrObjConnection& GetConnection(bool bTail1) const { return *(bTail1 ? &aCon1 : &aCon2); } + bool CheckNodeConnection(bool bTail1) const; + + virtual void RecalcSnapRect() override; + virtual void TakeUnrotatedSnapRect(tools::Rectangle& rRect) const override; + virtual SdrEdgeObj* CloneSdrObject(SdrModel& rTargetModel) const override; + SdrEdgeObj& operator=(const SdrEdgeObj& rObj); + virtual OUString TakeObjNameSingul() const override; + virtual OUString TakeObjNamePlural() const override; + + void SetEdgeTrackPath( const basegfx::B2DPolyPolygon& rPoly ); + basegfx::B2DPolyPolygon GetEdgeTrackPath() const; + + virtual basegfx::B2DPolyPolygon TakeXorPoly() const override; + virtual sal_uInt32 GetHdlCount() const override; + virtual void AddToHdlList(SdrHdlList& rHdlList) const override; + + // special drag methods + virtual bool hasSpecialDrag() const override; + virtual bool beginSpecialDrag(SdrDragStat& rDrag) const override; + virtual bool applySpecialDrag(SdrDragStat& rDrag) override; + virtual OUString getSpecialDragComment(const SdrDragStat& rDrag) const override; + + // FullDrag support + virtual SdrObjectUniquePtr getFullDragClone() const override; + + virtual void NbcSetSnapRect(const tools::Rectangle& rRect) override; + virtual void NbcMove(const Size& aSize) override; + virtual void NbcResize(const Point& rRefPnt, const Fraction& aXFact, const Fraction& aYFact) override; + + // #i54102# added rotate, mirror and shear support + virtual void NbcRotate(const Point& rRef, long nAngle, double sn, double cs) override; + virtual void NbcMirror(const Point& rRef1, const Point& rRef2) override; + virtual void NbcShear(const Point& rRef, long nAngle, double tn, bool bVShear) override; + + // #102344# Added missing implementation + virtual void NbcSetAnchorPos(const Point& rPnt) override; + + virtual bool BegCreate(SdrDragStat& rStat) override; + virtual bool MovCreate(SdrDragStat& rStat) override; + virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) override; + virtual bool BckCreate(SdrDragStat& rStat) override; + virtual void BrkCreate(SdrDragStat& rStat) override; + virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const override; + virtual PointerStyle GetCreatePointer() const override; + virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const override; + + virtual sal_uInt32 GetSnapPointCount() const override; + virtual Point GetSnapPoint(sal_uInt32 i) const override; + virtual bool IsPolyObj() const override; + virtual sal_uInt32 GetPointCount() const override; + virtual Point GetPoint(sal_uInt32 i) const override; + virtual void NbcSetPoint(const Point& rPnt, sal_uInt32 i) override; + + virtual SdrObjGeoData* NewGeoData() const override; + virtual void SaveGeoData(SdrObjGeoData& rGeo) const override; + virtual void RestGeoData(const SdrObjGeoData& rGeo) override; + + /** updates edges that are connected to the edges of this object + as if the connected objects send a repaint broadcast + #103122# + */ + void Reformat(); + + // helper methods for the StarOffice api + Point GetTailPoint( bool bTail ) const; + void SetTailPoint( bool bTail, const Point& rPt ); + void setGluePointIndex( bool bTail, sal_Int32 nId = -1 ); + sal_Int32 getGluePointIndex( bool bTail ); + + virtual bool TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPolyPolygon& rPolyPolygon) const override; + virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& rPolyPolygon) override; + + // for geometry access + ::basegfx::B2DPolygon getEdgeTrack() const; + + // helper method for SdrDragMethod::AddConnectorOverlays. Adds an overlay polygon for + // this connector to rResult. + basegfx::B2DPolygon ImplAddConnectorOverlay(SdrDragMethod& rDragMethod, bool bTail1, bool bTail2, bool bDetail) const; +}; + + // The following item parameters of the SdrItemPool are used to + // determine the actual connector line routing: + // + // sal_uInt16 EdgeFlowAngle default 9000 (= 90.00 deg), min 0, max 9000 + // Clearance angle. + // The angle at which the connecting line may run. + // + // sal_uInt16 EdgeEscAngle default 9000 (= 90.00 Deg), min 0, max 9000 + // Object exit angle. + // The angle at which the connection line may exit from the object. + // + // bool EdgeEscAsRay default false + // true -> the connecting line emerges from the object radially. + // Thus, angle specification by the line ObjCenter / connector. + // + // bool EdgeEscUseObjAngle default false + // Object rotation angle is considered + // true -> when determining the connector exit angle, angle for + // object rotation is taken as an offset. + // + // sal_uIntPtr EdgeFlowDefDist default 0, min 0, max ? + // This is the default minimum distance on calculation of the + // connection Line to the docked objects is in logical units. + // This distance is overridden within the object, as soon as the + // user drags on the lines. When docking onto a new object, + // however, this default is used again. + // + // + // General Information About Connectors: + // + // There are nodes and edge objects. Two nodes can be joined by an + // edge. If a connector is connected to a node only at one end, the + // other end is fixed to an absolute position in the document. It is + // of course also possible for a connector to be "free" at both ends, + // i.e. not connected to a node object on each side. + // + // A connector object can also theoretically be a node object at the + // same time. In the first version, however, this will not yet be + // realized. + // + // A connection between node and connector edge can be established by: + // - Interactive creation of a new edge object at the SdrView where + // the beginning or end point of the edge is placed on a connector + // (glueing point) of an already existing node object. + // - Interactive dragging of the beginning or end point of an + // existing connector edge object on the SdrView to a connector + // (glueing point) of an already existing node object. + // - Undo/Redo + // Moving node objects does not make any connections. Also not the + // direct shifting of edge endpoints on the SdrModel... Connections + // can also be established, if the connectors are not configured to + // be visible in the view. + // + // An existing connection between node and edge is retained for: + // - Dragging (Move/Resize/Rotate/...) of the node object + // - Moving a connector position in the node object + // - Simultaneous dragging (Move/Resize/Rotate/...) of the node and the + // edge + // + // A connection between node and edge can be removed by: + // - Deleting one of the objects + // - Dragging the edge object without simultaneously dragging the node + // - Deleting the connector at the node object + // - Undo/Redo/Repeat + // When dragging, the request to remove the connection must be + // requested from outside of the model (for example, from the + // SdrView). SdrEdgeObj::Move() itself does not remove the + // connection. + // + // Each node object can have connectors, so-called glue points. These + // are the geometric points at which the connecting edge object ends + // when the connection is established. By default, each object has no + // connectors. Nevertheless, one can dock an edge in certain view + // settings since then, e.g., connectors can be automatically + // generated at the 4 vertices of the node object when needed. Each + // object provides 2x4 so-called default connector positions, 4 at + // the vertices and 4 at the corner positions. In the normal case, + // these are located at the 8 handle positions; exceptions here are + // ellipses, parallelograms, ... . In addition, user-specific + // connectors can be set for each node object. + // + // Then there is also the possibility to dock an edge on an object + // with the attribute "bUseBestConnector". The best-matching + // connector position for the routing of the connection line is then + // used from the offering of connectors of the object or/and of the + // vertices. The user assigns this attribute by docking the node in + // its center (see, e.g., Visio). + // 09-06-1996: bUseBestConnector uses vertex glue points only. + // + // And here is some terminology: + // Connector : The connector object (edge object) + // Node : Any object to which a connector can be glued to, e.g., a rectangle, + // etc. + // Glue point: The point at which the connector is glued to the node object. + // There are: + // Vertex glue points: Each node object presents these glue + // points inherently. Perhaps there is already the option + // "automatically glue to object vertex" in Draw (default is + // on). + // Corner glue points: These glue points, too, are already + // auto-enabled on objects. Similar to the ones above, + // there may already be an option for them in Draw (default is + // off). + // In contrast to Visio, vertex glue points and corner glue + // points are not displayed in the UI; they are simply there (if + // the option is activated). + // Custom glue points: Any number of them are present on each + // node object. They can be made visible using the option + // (always visible when editing). At the moment, however, they + // are not yet fully implemented. + // Automatic glue point selection: If the connector is docked + // to the node object so that the black frame encompasses the + // entire object, then the connector tries to find the most + // convenient of the 4 vertex glue points (and only of those). + +#endif // INCLUDED_SVX_SVDOEDGE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdograf.hxx b/include/svx/svdograf.hxx new file mode 100644 index 000000000..db4a3f168 --- /dev/null +++ b/include/svx/svdograf.hxx @@ -0,0 +1,302 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVDOGRAF_HXX +#define INCLUDED_SVX_SVDOGRAF_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace sdr +{ + namespace properties + { + class GraphicProperties; + } // end of namespace properties + namespace contact + { + class ViewObjectContactOfGraphic; + } // end of namespace contact +} // end of namespace sdr + +/** + * Options for GetTransformedGraphic() + */ +enum class SdrGrafObjTransformsAttrs +{ + NONE = 0x00, + MIRROR = 0x01, + ROTATE = 0x02, + ALL = 0x03, +}; +namespace o3tl +{ + template<> struct typed_flags : is_typed_flags {}; +} + +class SdrGrafObjGeoData final : public SdrTextObjGeoData +{ +public: + bool bMirrored; + + SdrGrafObjGeoData() + : bMirrored(false) + { + } +}; + +class GraphicObject; +class SdrGraphicLink; + +/** + * This class represents an embedded or linked bitmap graphic object. + */ +class SVXCORE_DLLPUBLIC SdrGrafObj : public SdrRectObj +{ +private: + // to allow sdr::properties::GraphicProperties access to SetXPolyDirty() + friend class sdr::properties::GraphicProperties; + + // to allow sdr::contact::ViewObjectContactOfGraphic access to ImpUpdateGraphicLink() + friend class sdr::contact::ViewObjectContactOfGraphic; + friend class SdrExchangeView; // Only for a ForceSwapIn() call. + friend class SdrGraphicLink; + + virtual std::unique_ptr CreateObjectSpecificViewContact() override; + virtual std::unique_ptr CreateObjectSpecificProperties() override; + + void ImpSetAttrToGrafInfo(); // Copy values from the pool + GraphicAttr aGrafInfo; + + OUString aFileName; // If it's a Link, the filename can be found in here + OUString aReferer; + OUString aFilterName; + std::unique_ptr mpGraphicObject; // In order to speed up output of bitmaps, especially rotated ones + std::unique_ptr mpReplacementGraphicObject; + SdrGraphicLink* pGraphicLink; // And here a pointer for linked graphics + bool bMirrored:1; // True: the graphic is horizontal, which means it's mirrored along the y-axis + + // Flag for allowing text animation. Default is true. + bool mbGrafAnimationAllowed:1; + + bool mbIsSignatureLine; + OUString maSignatureLineId; + OUString maSignatureLineSuggestedSignerName; + OUString maSignatureLineSuggestedSignerTitle; + OUString maSignatureLineSuggestedSignerEmail; + OUString maSignatureLineSigningInstructions; + bool mbIsSignatureLineShowSignDate; + bool mbIsSignatureLineCanAddComment; + bool mbSignatureLineIsSigned; + css::uno::Reference mpSignatureLineUnsignedGraphic; + + std::unique_ptr mpQrCode; + void ImpRegisterLink(); + void ImpDeregisterLink(); + void ImpSetLinkedGraphic( const Graphic& rGraphic ); + void onGraphicChanged(); + GDIMetaFile GetMetaFile(GraphicType &rGraphicType) const; + +protected: + // protected destructor + virtual ~SdrGrafObj() override; + +public: + SdrGrafObj(SdrModel& rSdrModel); + SdrGrafObj( + SdrModel& rSdrModel, + const Graphic& rGrf); + SdrGrafObj( + SdrModel& rSdrModel, + const Graphic& rGrf, + const tools::Rectangle& rRect); + + void SetGraphicObject( const GraphicObject& rGrfObj ); + const GraphicObject& GetGraphicObject(bool bForceSwapIn = false) const; + const GraphicObject* GetReplacementGraphicObject() const; + + void NbcSetGraphic(const Graphic& rGrf); + void SetGraphic(const Graphic& rGrf); + const Graphic& GetGraphic() const; + + Graphic GetTransformedGraphic( SdrGrafObjTransformsAttrs nTransformFlags = SdrGrafObjTransformsAttrs::ALL ) const; + + GraphicType GetGraphicType() const; + + GraphicAttr GetGraphicAttr( SdrGrafObjTransformsAttrs nTransformFlags = SdrGrafObjTransformsAttrs::ALL ) const; + + // Keep ATM for SD. + bool IsAnimated() const; + bool IsEPS() const; + + MapMode GetGrafPrefMapMode() const; + Size GetGrafPrefSize() const; + + void SetGrafStreamURL( const OUString& rGraphicStreamURL ); + OUString const & GetGrafStreamURL() const; + Size getOriginalSize() const; + +private: + void ForceSwapIn() const; + +public: + void SetGraphicLink(const OUString& rFileName, const OUString& rReferer, const OUString& rFilterName); + void ReleaseGraphicLink(); + bool IsLinkedGraphic() const; + + const OUString& GetFileName() const { return aFileName;} + + void StartAnimation(); + + virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; + virtual sal_uInt16 GetObjIdentifier() const override; + + virtual OUString TakeObjNameSingul() const override; + virtual OUString TakeObjNamePlural() const override; + + virtual SdrGrafObj* CloneSdrObject(SdrModel& rTargetModel) const override; + SdrGrafObj& operator=(const SdrGrafObj& rObj); + + virtual sal_uInt32 GetHdlCount() const override; + virtual void AddToHdlList(SdrHdlList& rHdlList) const override; + + virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override; + virtual void NbcMirror(const Point& rRef1, const Point& rRef2) override; + virtual SdrObjGeoData* NewGeoData() const override; + virtual void SaveGeoData(SdrObjGeoData& rGeo) const override; + virtual void RestGeoData(const SdrObjGeoData& rGeo) override; + + bool HasGDIMetaFile() const; + + // react on model/page change + virtual void handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage) override; + + bool isEmbeddedVectorGraphicData() const; + GDIMetaFile getMetafileFromEmbeddedVectorGraphicData() const; + + /// Returns the page number of the embedded data (typically to re-render or import it). + sal_Int32 getEmbeddedPageNumber() const; + + virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const override; + + virtual void AdjustToMaxRect( const tools::Rectangle& rMaxRect, bool bShrinkOnly = false ) override; + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override; + + bool IsMirrored() const { return bMirrored;} + void SetMirrored( bool _bMirrored ); + + virtual bool shouldKeepAspectRatio() const override { return true; } + + // Access to GrafAnimationAllowed flag + void SetGrafAnimationAllowed(bool bNew); + + css::uno::Reference< css::io::XInputStream > getInputStream() const; + + // #i103116# FullDrag support + virtual SdrObjectUniquePtr getFullDragClone() const override; + + // add handles for crop mode when selected + virtual void addCropHandles(SdrHdlList& rTarget) const override; + + // Signature Line + void setIsSignatureLine(bool bIsSignatureLine) { mbIsSignatureLine = bIsSignatureLine; }; + bool isSignatureLine() const { return mbIsSignatureLine; }; + void setSignatureLineId(const OUString& rSignatureLineId) + { + maSignatureLineId = rSignatureLineId; + }; + const OUString& getSignatureLineId() const { return maSignatureLineId; }; + void setSignatureLineSuggestedSignerName(const OUString& rSuggestedSignerName) + { + maSignatureLineSuggestedSignerName = rSuggestedSignerName; + }; + const OUString& getSignatureLineSuggestedSignerName() const + { + return maSignatureLineSuggestedSignerName; + }; + void setSignatureLineSuggestedSignerTitle(const OUString& rSuggestedSignerTitle) + { + maSignatureLineSuggestedSignerTitle = rSuggestedSignerTitle; + }; + const OUString& getSignatureLineSuggestedSignerTitle() const + { + return maSignatureLineSuggestedSignerTitle; + }; + void setSignatureLineSuggestedSignerEmail(const OUString& rSuggestedSignerEmail) + { + maSignatureLineSuggestedSignerEmail = rSuggestedSignerEmail; + }; + const OUString& getSignatureLineSuggestedSignerEmail() const + { + return maSignatureLineSuggestedSignerEmail; + }; + void setSignatureLineSigningInstructions(const OUString& rSigningInstructions) + { + maSignatureLineSigningInstructions = rSigningInstructions; + }; + const OUString& getSignatureLineSigningInstructions() const + { + return maSignatureLineSigningInstructions; + }; + void setSignatureLineShowSignDate(bool bIsSignatureLineShowSignDate) + { + mbIsSignatureLineShowSignDate = bIsSignatureLineShowSignDate; + }; + bool isSignatureLineShowSignDate() const { return mbIsSignatureLineShowSignDate; }; + void setSignatureLineCanAddComment(bool bIsSignatureCanAddComment) + { + mbIsSignatureLineCanAddComment = bIsSignatureCanAddComment; + }; + bool isSignatureLineCanAddComment() const { return mbIsSignatureLineCanAddComment; }; + css::uno::Reference const & getSignatureLineUnsignedGraphic() const + { + return mpSignatureLineUnsignedGraphic; + }; + void setSignatureLineUnsignedGraphic(css::uno::Reference rGraphic) + { + mpSignatureLineUnsignedGraphic = rGraphic; + }; + bool isSignatureLineSigned() const { return mbSignatureLineIsSigned; }; + void setSignatureLineIsSigned(bool bIsSigned) { mbSignatureLineIsSigned = bIsSigned; } + + // Qr Code + void setQrCode(css::drawing::QRCode& rQrCode) + { + mpQrCode = std::make_unique(rQrCode); + }; + + css::drawing::QRCode* getQrCode() const + { + return mpQrCode.get(); + }; +}; + +#endif // INCLUDED_SVX_SVDOGRAF_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdogrp.hxx b/include/svx/svdogrp.hxx new file mode 100644 index 000000000..2f71c5936 --- /dev/null +++ b/include/svx/svdogrp.hxx @@ -0,0 +1,114 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVDOGRP_HXX +#define INCLUDED_SVX_SVDOGRP_HXX + +#include +#include +#include +#include + +// Forward declarations +class SfxItemSet; + +// SdrObjGroup +class SVXCORE_DLLPUBLIC SdrObjGroup final : public SdrObject, public SdrObjList +{ +private: + virtual std::unique_ptr CreateObjectSpecificViewContact() override; + virtual std::unique_ptr CreateObjectSpecificProperties() override; + + Point aRefPoint; // Reference point inside the object group + +private: + // protected destructor - due to final, make private + virtual ~SdrObjGroup() override; + +public: + SdrObjGroup(SdrModel& rSdrModel); + + // derived from SdrObjList + virtual SdrPage* getSdrPageFromSdrObjList() const override; + virtual SdrObject* getSdrObjectFromSdrObjList() const override; + + // derived from SdrObject + virtual SdrObjList* getChildrenOfSdrObject() const override; + + virtual void SetBoundRectDirty() override; + virtual sal_uInt16 GetObjIdentifier() const override; + virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; + virtual SdrLayerID GetLayer() const override; + virtual void NbcSetLayer(SdrLayerID nLayer) override; + + // react on model/page change + virtual void handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage) override; + + virtual SdrObjList* GetSubList() const override; + + virtual const tools::Rectangle& GetCurrentBoundRect() const override; + virtual const tools::Rectangle& GetSnapRect() const override; + + virtual SdrObjGroup* CloneSdrObject(SdrModel& rTargetModel) const override; + SdrObjGroup& operator=(const SdrObjGroup& rObj); + + virtual OUString TakeObjNameSingul() const override; + virtual OUString TakeObjNamePlural() const override; + + virtual void RecalcSnapRect() override; + virtual basegfx::B2DPolyPolygon TakeXorPoly() const override; + + // special drag methods + virtual bool beginSpecialDrag(SdrDragStat& rDrag) const override; + + virtual bool BegCreate(SdrDragStat& rStat) override; + + virtual long GetRotateAngle() const override; + virtual long GetShearAngle(bool bVertical = false) const override; + + virtual void Move(const Size& rSiz) override; + virtual void Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bUnsetRelative = true) override; + virtual void Rotate(const Point& rRef, long nAngle, double sn, double cs) override; + virtual void Mirror(const Point& rRef1, const Point& rRef2) override; + virtual void Shear(const Point& rRef, long nAngle, double tn, bool bVShear) override; + virtual void SetAnchorPos(const Point& rPnt) override; + virtual void SetRelativePos(const Point& rPnt) override; + virtual void SetSnapRect(const tools::Rectangle& rRect) override; + virtual void SetLogicRect(const tools::Rectangle& rRect) override; + + virtual void NbcMove(const Size& rSiz) override; + virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override; + virtual void NbcRotate(const Point& rRef, long nAngle, double sn, double cs) override; + virtual void NbcMirror(const Point& rRef1, const Point& rRef2) override; + virtual void NbcShear(const Point& rRef, long nAngle, double tn, bool bVShear) override; + virtual void NbcSetAnchorPos(const Point& rPnt) override; + virtual void NbcSetRelativePos(const Point& rPnt) override; + virtual void NbcSetSnapRect(const tools::Rectangle& rRect) override; + virtual void NbcSetLogicRect(const tools::Rectangle& rRect) override; + + virtual void NbcReformatText() override; + + virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const override; + + virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override; +}; + +#endif // INCLUDED_SVX_SVDOGRP_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdomeas.hxx b/include/svx/svdomeas.hxx new file mode 100644 index 000000000..6384d7488 --- /dev/null +++ b/include/svx/svdomeas.hxx @@ -0,0 +1,201 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVDOMEAS_HXX +#define INCLUDED_SVX_SVDOMEAS_HXX + +#include +#include +#include + +class SdrOutliner; +struct ImpMeasureRec; +struct ImpMeasurePoly; + +namespace sdr::properties { + class MeasureProperties; +} + +class SdrMeasureObjGeoData final : public SdrTextObjGeoData +{ +public: + Point aPt1; + Point aPt2; + +public: + SdrMeasureObjGeoData(); + virtual ~SdrMeasureObjGeoData() override; +}; + +class SVXCORE_DLLPUBLIC SdrMeasureObj : public SdrTextObj +{ +private: + // to allow sdr::properties::MeasureProperties access to SetTextDirty() + friend class sdr::properties::MeasureProperties; + + friend class SdrMeasureField; + +protected: + virtual std::unique_ptr CreateObjectSpecificViewContact() override; + virtual std::unique_ptr CreateObjectSpecificProperties() override; + + Point aPt1; + Point aPt2; + bool bTextDirty; + +protected: + void ImpTakeAttr(ImpMeasureRec& rRec) const; + OUString TakeRepresentation(SdrMeasureFieldKind eMeasureFieldKind) const; + void ImpCalcGeometrics(const ImpMeasureRec& rRec, ImpMeasurePoly& rPol) const; + static basegfx::B2DPolyPolygon ImpCalcXPoly(const ImpMeasurePoly& rPol); + void ImpEvalDrag(ImpMeasureRec& rRec, const SdrDragStat& rDrag) const; + void SetTextDirty() { bTextDirty=true; SetTextSizeDirty(); if (!aOutRect.IsEmpty()) { SetBoundRectDirty(); SetRectsDirty(true); } } + void UndirtyText() const; + + virtual SdrObjGeoData* NewGeoData() const override; + virtual void SaveGeoData(SdrObjGeoData& rGeo) const override; + virtual void RestGeoData(const SdrObjGeoData& rGeo) override; + + // protected destructor + virtual ~SdrMeasureObj() override; + +public: + SdrMeasureObj(SdrModel& rSdrModel); + SdrMeasureObj( + SdrModel& rSdrModel, + const Point& rPt1, + const Point& rPt2); + + virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; + virtual sal_uInt16 GetObjIdentifier() const override; + virtual void TakeUnrotatedSnapRect(tools::Rectangle& rRect) const override; + virtual SdrMeasureObj* CloneSdrObject(SdrModel& rTargetModel) const override; + + // implemented mainly for the purposes of Clone() + SdrMeasureObj& operator=(const SdrMeasureObj& rObj); + + virtual OUString TakeObjNameSingul() const override; + virtual OUString TakeObjNamePlural() const override; + + virtual basegfx::B2DPolyPolygon TakeXorPoly() const override; + virtual sal_uInt32 GetHdlCount() const override; + virtual void AddToHdlList(SdrHdlList& rHdlList) const override; + + // special drag methods + virtual bool hasSpecialDrag() const override; + virtual bool beginSpecialDrag(SdrDragStat& rDrag) const override; + virtual bool applySpecialDrag(SdrDragStat& rDrag) override; + virtual OUString getSpecialDragComment(const SdrDragStat& rDrag) const override; + + virtual bool BegCreate(SdrDragStat& rStat) override; + virtual bool MovCreate(SdrDragStat& rStat) override; + virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) override; + virtual bool BckCreate(SdrDragStat& rStat) override; + virtual void BrkCreate(SdrDragStat& rStat) override; + virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const override; + virtual PointerStyle GetCreatePointer() const override; + + virtual void NbcMove(const Size& rSiz) override; + virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override; + virtual void NbcRotate(const Point& rRef, long nAngle, double sn, double cs) override; + virtual void NbcMirror(const Point& rRef1, const Point& rRef2) override; + virtual void NbcShear(const Point& rRef, long nAngle, double tn, bool bVShear) override; + virtual long GetRotateAngle() const override; + virtual void RecalcSnapRect() override; + + virtual sal_uInt32 GetSnapPointCount() const override; + virtual Point GetSnapPoint(sal_uInt32 i) const override; + + virtual bool IsPolyObj() const override; + virtual sal_uInt32 GetPointCount() const override; + virtual Point GetPoint(sal_uInt32 i) const override; + virtual void NbcSetPoint(const Point& rPnt, sal_uInt32 i) override; + + virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const override; + + virtual bool BegTextEdit(SdrOutliner& rOutl) override; + virtual const Size& GetTextSize() const override; + virtual void TakeTextRect( SdrOutliner& rOutliner, tools::Rectangle& rTextRect, bool bNoEditText, + tools::Rectangle* pAnchorRect, bool bLineWidth = true ) const override; + virtual void TakeTextAnchorRect(tools::Rectangle& rAnchorRect) const override; + virtual void TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, tools::Rectangle* pViewInit, tools::Rectangle* pViewMin) const override; + virtual EEAnchorMode GetOutlinerViewAnchorMode() const override; + virtual void NbcSetOutlinerParaObject(std::unique_ptr pTextObject) override; + virtual OutlinerParaObject* GetOutlinerParaObject() const override; + + virtual bool CalcFieldValue(const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos, + bool bEdit, std::optional& rpTxtColor, std::optional& rpFldColor, OUString& rRet) const override; + + // #i97878# + virtual bool TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPolyPolygon& rPolyPolygon) const override; + virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& rPolyPolygon) override; +}; + +// Creating: +// ~~~~~~~~~ +// dragging reference point 1 to reference point 2 -> reference edge +// +// Defaults: +// ~~~~~~~~~~~~~ +// dimension line and auxiliary dimension lines: solid black hairlines +// arrows : 2mm x 4mm +// text size +// ___ +// | dimension | 2mm +// |<--------------------->|--- +// | | 8mm +// | | +// Pt1============# Pt2-- <----reference edge (from Pt1 to Pt2) +// # # |___ <-excess length of the auxiliary dimension line(s) +// # #=========# +// # objected to be dimensioned # +// #=======================# +// +// Attributes: +// ~~~~~~~~~~ +// 1. Where is the text: middle, right or left (default=automatic) +// 2. Text above or below the line or line broken by text (default=automatic) +// Default=8mm +// 3. The distance from the dimension line to the reference edge (= to the dimensioned object) +// 4. dimension line below the reference edge (default=no)) +// 5. excess length of the auxiliary dimension lines beyond the reference edge (2x, default=0) +// 6. excess length of the auxiliary dimension lines past the dimension line (default=2mm) +// 7. distance between the auxiliary dimension line and the reference edge +// +// Dragging: Handle Shift +// ~~~~~~~~~ +// - reference points SolidQuadHdl only the length +// 1.+2. Seizing the text +// 3.+4. Hdl on arrow (2x) SolidQuadHdl only the Bool +// 5. Hdl one end point CircHdl both lengths ? +// 6.+7. no dragging +// +// Open: +// ~~~~~~ +// - radiuses (anchor as type immediately) +// +// Special: +// ~~~~~~~~ +// Connecting to a maximum of two objects +// -> during Copy, etc. use the respective code of the connectors?!? +// this probably will be pretty complicated ... + +#endif // INCLUDED_SVX_SVDOMEAS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdomedia.hxx b/include/svx/svdomedia.hxx new file mode 100644 index 000000000..258a28750 --- /dev/null +++ b/include/svx/svdomedia.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_SVX_SVDOMEDIA_HXX +#define INCLUDED_SVX_SVDOMEDIA_HXX + +#include +#include +#include +#include + +class Graphic; + +namespace sdr::contact { class ViewContactOfSdrMediaObj; } +namespace com::sun::star::graphic { class XGraphic; } + + +class SVXCORE_DLLPUBLIC SdrMediaObj final : public SdrRectObj +{ + friend class sdr::contact::ViewContactOfSdrMediaObj; + +private: + // protected destructor - due to final, make private + virtual ~SdrMediaObj() override; + +public: + SdrMediaObj(SdrModel& rSdrModel); + SdrMediaObj( + SdrModel& rSdrModel, + const tools::Rectangle& rRect); + + virtual bool HasTextEdit() const override; + + virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; + virtual sal_uInt16 GetObjIdentifier() const override; + + virtual OUString TakeObjNameSingul() const override; + virtual OUString TakeObjNamePlural() const override; + + virtual SdrMediaObj* CloneSdrObject(SdrModel& rTargetModel) const override; + SdrMediaObj& operator=(const SdrMediaObj& rObj); + + virtual void AdjustToMaxRect( const tools::Rectangle& rMaxRect, bool bShrinkOnly = false ) override; + + void setURL( const OUString& rURL, const OUString& rReferer, const OUString& rMimeType = OUString() ); + const OUString& getURL() const; + + void setMediaProperties( const ::avmedia::MediaItem& rState ); + const ::avmedia::MediaItem& getMediaProperties() const; + + css::uno::Reference< css::graphic::XGraphic > const & + getSnapshot() const; + css::uno::Reference< css::io::XInputStream> + GetInputStream() const; + void SetInputStream(css::uno::Reference const&); + + virtual bool shouldKeepAspectRatio() const override { return true; } + +private: + void mediaPropertiesChanged( const ::avmedia::MediaItem& rNewState ); + virtual std::unique_ptr CreateObjectSpecificViewContact() override; + + struct Impl; + std::unique_ptr m_xImpl; +}; + +#endif // INCLUDED_SVX_SVDOMEDIA_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdoole2.hxx b/include/svx/svdoole2.hxx new file mode 100644 index 000000000..85f0125c1 --- /dev/null +++ b/include/svx/svdoole2.hxx @@ -0,0 +1,205 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVDOOLE2_HXX +#define INCLUDED_SVX_SVDOOLE2_HXX + +#include +#include +#include +#include + +#include + +namespace com::sun::star { + +namespace awt { class XWindow; } + +namespace datatransfer { class XTransferable; } + +namespace embed { class XEmbeddedObject; } + +namespace frame { class XModel; } + +} + +namespace svt { class EmbeddedObjectRef; } + +class SdrOle2ObjImpl; + +class SVXCORE_DLLPUBLIC SdrOle2Obj : public SdrRectObj +{ +private: + std::unique_ptr mpImpl; + +private: + SVX_DLLPRIVATE void Connect_Impl(); + SVX_DLLPRIVATE void Disconnect_Impl(); + SVX_DLLPRIVATE void AddListeners_Impl(); + SVX_DLLPRIVATE void RemoveListeners_Impl(); + SVX_DLLPRIVATE void GetObjRef_Impl(); + + // #i118485# helper added + SVX_DLLPRIVATE SdrObjectUniquePtr createSdrGrafObjReplacement(bool bAddText) const; + SVX_DLLPRIVATE void ImpSetVisAreaSize(); + + SVX_DLLPRIVATE void Init(); + +protected: + virtual std::unique_ptr CreateObjectSpecificViewContact() override; + virtual std::unique_ptr CreateObjectSpecificProperties() override; + + // protected destructor + virtual ~SdrOle2Obj() override; + +public: + OUString GetStyleString(); + + SdrOle2Obj( + SdrModel& rSdrModel, + bool bFrame_ = false); + SdrOle2Obj( + SdrModel& rSdrModel, + const svt::EmbeddedObjectRef& rNewObjRef, + const OUString& rNewObjName, + const tools::Rectangle& rNewRect); + + const svt::EmbeddedObjectRef& getEmbeddedObjectRef() const; + + sal_Int64 GetAspect() const; + bool isInplaceActive() const; + bool isUiActive() const; + void SetAspect( sal_Int64 nAspect ); + + // An OLE graphic object can contain a StarView graphic, + // which will be displayed if the OLE object is empty. + void SetGraphic(const Graphic& rGrf); + void ClearGraphic(); + const Graphic* GetGraphic() const; + void GetNewReplacement(); + + // The original size of the object (size of the icon for iconified object) + // no conversion is done if no target mode is provided + Size GetOrigObjSize( MapMode const * pTargetMapMode = nullptr ) const; + + // #i118524# Allow suppress SetVisAreaSize in changing methods when call + // comes from OLE client + void setSuppressSetVisAreaSize( bool bNew ); + + // OLE object has got a separate PersistName member now; + // !!! use ::SetPersistName( ... ) only, if you know what you do !!! + const OUString& GetPersistName() const; + void SetPersistName( const OUString& rPersistName ); + + // One can add an application name to a SdrOle2Obj, which can be queried for + // later on (SD needs this for presentation objects). + void SetProgName( const OUString& rName ); + const OUString& GetProgName() const; + bool IsEmpty() const; + + void SetObjRef(const css::uno::Reference < css::embed::XEmbeddedObject >& rNewObjRef); + css::uno::Reference < css::embed::XEmbeddedObject > const & GetObjRef() const; + + SVX_DLLPRIVATE css::uno::Reference < css::embed::XEmbeddedObject > const & GetObjRef_NoInit() const; + + void AbandonObject(); + + // react on model/page change + virtual void handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage) override; + + /** Change the IsClosedObj attribute + + @param bIsClosed + Whether the OLE object is closed, i.e. has opaque background + */ + void SetClosedObj( bool bIsClosed ); + + // FullDrag support + virtual SdrObjectUniquePtr getFullDragClone() const override; + + virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; + virtual sal_uInt16 GetObjIdentifier() const override; + virtual OUString TakeObjNameSingul() const override; + virtual OUString TakeObjNamePlural() const override; + + virtual SdrOle2Obj* CloneSdrObject(SdrModel& rTargetModel) const override; + + SdrOle2Obj& assignFrom(const SdrOle2Obj& rObj); + SdrOle2Obj& operator=(const SdrOle2Obj& rObj); + + virtual void NbcMove(const Size& rSize) override; + virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override; + virtual void NbcSetSnapRect(const tools::Rectangle& rRect) override; + virtual void NbcSetLogicRect(const tools::Rectangle& rRect) override; + virtual void SetGeoData(const SdrObjGeoData& rGeo) override; + + static bool CanUnloadRunningObj( const css::uno::Reference< css::embed::XEmbeddedObject >& xObj, + sal_Int64 nAspect ); + static bool Unload( const css::uno::Reference< css::embed::XEmbeddedObject >& xObj, sal_Int64 nAspect ); + bool Unload(); + void Connect(); + void Disconnect(); + void ObjectLoaded(); + + css::uno::Reference< css::frame::XModel > getXModel() const; + + bool IsChart() const; + bool IsCalc() const; + + bool UpdateLinkURL_Impl(); + void BreakFileLink_Impl(); + void DisconnectFileLink_Impl(); + void CheckFileLink_Impl(); + + // allows to transfer the graphics to the object helper + void SetGraphicToObj( const Graphic& aGraphic ); + void SetGraphicToObj( const css::uno::Reference< css::io::XInputStream >& xGrStream, + const OUString& aMediaType ); + + css::uno::Reference< css::frame::XModel > GetParentXModel() const; + bool CalculateNewScaling( Fraction& aScaleWidth, Fraction& aScaleHeight, Size& aObjAreaSize ); + bool AddOwnLightClient(); + + // handy to get the empty replacement graphic without accessing all the old stuff + static Graphic GetEmptyOLEReplacementGraphic(); + + void SetWindow(const css::uno::Reference < css::awt::XWindow >& _xWindow); + + // #i118485# missing converter added + virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const override; +}; + +class SVXCORE_DLLPUBLIC SdrEmbedObjectLink final : public sfx2::SvBaseLink +{ + SdrOle2Obj* pObj; + +public: + explicit SdrEmbedObjectLink(SdrOle2Obj* pObj); + virtual ~SdrEmbedObjectLink() override; + + virtual void Closed() override; + virtual ::sfx2::SvBaseLink::UpdateResult DataChanged( + const OUString& rMimeType, const css::uno::Any & rValue ) override; + + void Connect() { GetRealObject(); } +}; + +#endif // INCLUDED_SVX_SVDOOLE2_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdopage.hxx b/include/svx/svdopage.hxx new file mode 100644 index 000000000..af557b27b --- /dev/null +++ b/include/svx/svdopage.hxx @@ -0,0 +1,72 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVDOPAGE_HXX +#define INCLUDED_SVX_SVDOPAGE_HXX + +#include +#include +#include + +class SVXCORE_DLLPUBLIC SdrPageObj final : public SdrObject, public sdr::PageUser +{ +public: + // this method is called from the destructor of the referenced page. + // do all necessary action to forget the page. It is not necessary to call + // RemovePageUser(), that is done from the destructor. + virtual void PageInDestruction(const SdrPage& rPage) override; + +private: + // To make things more safe, remember the page, not a number + SdrPage* mpShownPage; + + virtual std::unique_ptr CreateObjectSpecificViewContact() override; + virtual std::unique_ptr CreateObjectSpecificProperties() override; + + // protected destructor + virtual ~SdrPageObj() override; + +public: + SdrPageObj( + SdrModel& rSdrModel, + SdrPage* pNewPage = nullptr); + SdrPageObj( + SdrModel& rSdrModel, + const tools::Rectangle& rRect, + SdrPage* pNewPage = nullptr); + + SdrPage* GetReferencedPage() const { return mpShownPage;} + void SetReferencedPage(SdrPage* pNewPage); + + // #i96598# + virtual void SetBoundRectDirty() override; + + virtual sal_uInt16 GetObjIdentifier() const override; + virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; + virtual SdrPageObj* CloneSdrObject(SdrModel& rTargetModel) const override; + SdrPageObj& operator=(const SdrPageObj& rObj); + + virtual OUString TakeObjNameSingul() const override; + virtual OUString TakeObjNamePlural() const override; +}; + + +#endif // INCLUDED_SVX_SVDOPAGE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdopath.hxx b/include/svx/svdopath.hxx new file mode 100644 index 000000000..1436eca52 --- /dev/null +++ b/include/svx/svdopath.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_SVX_SVDOPATH_HXX +#define INCLUDED_SVX_SVDOPATH_HXX + +#include +#include +#include + +class ImpPathForDragAndCreate; + +// Helper class SdrPathObjGeoData +// used for undo/redo + +class SdrPathObjGeoData final : public SdrTextObjGeoData +{ +public: + basegfx::B2DPolyPolygon maPathPolygon; + SdrObjKind meKind; + + SdrPathObjGeoData(); + virtual ~SdrPathObjGeoData() override; +}; + + +class SVXCORE_DLLPUBLIC SdrPathObj final : public SdrTextObj +{ +private: + friend class ImpPathForDragAndCreate; + + virtual std::unique_ptr CreateObjectSpecificViewContact() override; + + basegfx::B2DPolyPolygon maPathPolygon; + SdrObjKind meKind; + + // for isolation of old Drag/Create code + std::unique_ptr mpDAC; + + // helper functions for GET, SET, INS etc. PNT + void ImpSetClosed(bool bClose); + void ImpForceKind(); + void ImpForceLineAngle(); + ImpPathForDragAndCreate& impGetDAC() const; + +private: + // protected destructor - due to final, make private + virtual ~SdrPathObj() override; + +public: + SdrPathObj( + SdrModel& rSdrModel, + SdrObjKind eNewKind); + SdrPathObj( + SdrModel& rSdrModel, + SdrObjKind eNewKind, + const basegfx::B2DPolyPolygon& rPathPoly); + + virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; + virtual sal_uInt16 GetObjIdentifier() const override; + virtual void TakeUnrotatedSnapRect(tools::Rectangle& rRect) const override; + virtual SdrPathObj* CloneSdrObject(SdrModel& rTargetModel) const override; + SdrPathObj& operator=(const SdrPathObj& rObj); + + virtual OUString TakeObjNameSingul() const override; + virtual OUString TakeObjNamePlural() const override; + virtual basegfx::B2DPolyPolygon TakeXorPoly() const override; + virtual void RecalcSnapRect() override; + virtual void NbcSetSnapRect(const tools::Rectangle& rRect) override; + virtual sal_uInt32 GetHdlCount() const override; + virtual void AddToHdlList(SdrHdlList& rHdlList) const override; + virtual void AddToPlusHdlList(SdrHdlList& rHdlList, SdrHdl& rHdl) const override; + + // special drag methods + virtual bool hasSpecialDrag() const override; + virtual bool beginSpecialDrag(SdrDragStat& rDrag) const override; + virtual bool applySpecialDrag(SdrDragStat& rDrag) override; + virtual OUString getSpecialDragComment(const SdrDragStat& rDrag) const override; + virtual basegfx::B2DPolyPolygon getSpecialDragPoly(const SdrDragStat& rDrag) const override; + + virtual bool BegCreate(SdrDragStat& rStat) override; + virtual bool MovCreate(SdrDragStat& rStat) override; + virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) override; + virtual bool BckCreate(SdrDragStat& rStat) override; + virtual void BrkCreate(SdrDragStat& rStat) override; + virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const override; + PointerStyle GetCreatePointer() const override; + + // during drag or create, allow accessing the so-far created/modified polyPolygon + basegfx::B2DPolyPolygon getObjectPolyPolygon(const SdrDragStat& rDrag) const; + basegfx::B2DPolyPolygon getDragPolyPolygon(const SdrDragStat& rDrag) const; + + virtual void NbcMove(const Size& aSize) override; + virtual void NbcResize(const Point& rRefPnt, const Fraction& aXFact, const Fraction& aYFact) override; + virtual void NbcRotate(const Point& rRefPnt, long nAngle, double fSin, double fCos) override; + virtual void NbcMirror(const Point& rRefPnt1, const Point& rRefPnt2) override; + virtual void NbcShear(const Point& rRefPnt, long nAngle, double fTan, bool bVShear) override; + + virtual sal_uInt32 GetSnapPointCount() const override; + virtual Point GetSnapPoint(sal_uInt32 i) const override; + + virtual bool IsPolyObj() const override; + virtual sal_uInt32 GetPointCount() const override; + virtual Point GetPoint(sal_uInt32 nHdlNum) const override; + virtual void NbcSetPoint(const Point& rPnt, sal_uInt32 nHdlNum) override; + + // insert point + sal_uInt32 NbcInsPointOld(const Point& rPos, bool bNewObj); + sal_uInt32 NbcInsPoint(const Point& rPos, bool bNewObj); + + // rip at given point + SdrObject* RipPoint(sal_uInt32 nHdlNum, sal_uInt32& rNewPt0Index); + +private: + virtual SdrObjGeoData* NewGeoData() const override; + virtual void SaveGeoData(SdrObjGeoData& rGeo) const override; + virtual void RestGeoData(const SdrObjGeoData& rGeo) override; + +public: + virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const override; + + // Bezier-polygon getter/setter + const basegfx::B2DPolyPolygon& GetPathPoly() const { return maPathPolygon; } + void SetPathPoly(const basegfx::B2DPolyPolygon& rPathPoly); + void NbcSetPathPoly(const basegfx::B2DPolyPolygon& rPathPoly); + + // special functions for Bezier-polygon handling + bool IsClosed() const { return meKind==OBJ_POLY || meKind==OBJ_PATHPOLY || meKind==OBJ_PATHFILL || meKind==OBJ_FREEFILL || meKind==OBJ_SPLNFILL; } + bool IsLine() const { return meKind==OBJ_PLIN || meKind==OBJ_PATHPLIN || meKind==OBJ_PATHLINE || meKind==OBJ_FREELINE || meKind==OBJ_SPLNLINE || meKind==OBJ_LINE; } + bool IsBezier() const { return meKind==OBJ_PATHLINE || meKind==OBJ_PATHFILL; } + bool IsSpline() const { return meKind==OBJ_SPLNLINE || meKind==OBJ_SPLNFILL; } + + // close/open path + // if opening, move end point by "nOpenDistance" + void ToggleClosed(); // long nOpenDistance); + + // transformation interface for StarOfficeAPI. This implements support for + // homogen 3x3 matrices containing the transformation of the SdrObject. At the + // moment it contains a shearX, rotation and translation, but for setting all linear + // transforms like Scale, ShearX, ShearY, Rotate and Translate are supported. + // + // gets base transformation and rectangle of object. If it's an SdrPathObj it fills the PolyPolygon + // with the base geometry and returns TRUE. Otherwise it returns FALSE. + virtual bool TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPolyPolygon& rPolyPolygon) const override; + // sets the base geometry of the object using infos contained in the homogen 3x3 matrix. + // If it's an SdrPathObj it will use the provided geometry information. The Polygon has + // to use (0,0) as upper left and will be scaled to the given size in the matrix. + virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& rPolyPolygon) override; +}; + +#endif // INCLUDED_SVX_SVDOPATH_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdorect.hxx b/include/svx/svdorect.hxx new file mode 100644 index 000000000..98929002b --- /dev/null +++ b/include/svx/svdorect.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_SVX_SVDORECT_HXX +#define INCLUDED_SVX_SVDORECT_HXX + +#include +#include +#include + + +// Forward declaration +class XPolygon; + +namespace sdr::properties { + class RectangleProperties; +} + + +// SdrRectObj + +/// Rectangle objects (rectangle, circle, ...) +class SVXCORE_DLLPUBLIC SdrRectObj : public SdrTextObj +{ +private: + // to allow sdr::properties::RectangleProperties access to SetXPolyDirty() + friend class sdr::properties::RectangleProperties; + friend class SdrTextObj; // Due to SetXPolyDirty for GrowAdjust + +protected: + virtual std::unique_ptr CreateObjectSpecificViewContact() override; + virtual std::unique_ptr CreateObjectSpecificProperties() override; + + std::unique_ptr mpXPoly; + +protected: + XPolygon ImpCalcXPoly(const tools::Rectangle& rRect1, long nRad1) const; + void SetXPolyDirty(); + + /// Subclasses should override RecalcXPoly() by creating an XPolygon + /// instance with new and assigning it to mpXPoly. + virtual void RecalcXPoly(); + const XPolygon& GetXPoly() const; + virtual void RestGeoData(const SdrObjGeoData& rGeo) override; + + // protected destructor + virtual ~SdrRectObj() override; + +public: + /** + * The corner radius parameter is dropped at some point. + * We need to set the corner radius via SfxItems later on, using SetAttributes() + * + * Constructor of a rectangular drawing object + */ + SdrRectObj(SdrModel& rSdrModel); + SdrRectObj( + SdrModel& rSdrModel, + const tools::Rectangle& rRect); + + SdrRectObj& operator=(const SdrRectObj& rCopy); + + // Constructor of a text frame + SdrRectObj( + SdrModel& rSdrModel, + SdrObjKind eNewTextKind); + SdrRectObj( + SdrModel& rSdrModel, + SdrObjKind eNewTextKind, + const tools::Rectangle& rRect); + + virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; + virtual sal_uInt16 GetObjIdentifier() const override; + virtual void TakeUnrotatedSnapRect(tools::Rectangle& rRect) const override; + + virtual OUString TakeObjNameSingul() const override; + virtual OUString TakeObjNamePlural() const override; + + virtual SdrRectObj* CloneSdrObject(SdrModel& rTargetModel) const override; + virtual void RecalcSnapRect() override; + virtual void NbcSetSnapRect(const tools::Rectangle& rRect) override; + virtual void NbcSetLogicRect(const tools::Rectangle& rRect) override; + virtual basegfx::B2DPolyPolygon TakeXorPoly() const override; + + virtual sal_uInt32 GetHdlCount() const override; + virtual void AddToHdlList(SdrHdlList& rHdlList) const override; + + // Special drag methods + virtual bool hasSpecialDrag() const override; + virtual bool beginSpecialDrag(SdrDragStat& rDrag) const override; + virtual bool applySpecialDrag(SdrDragStat& rDrag) override; + virtual OUString getSpecialDragComment(const SdrDragStat& rDrag) const override; + + virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const override; + virtual PointerStyle GetCreatePointer() const override; + + virtual void NbcMove(const Size& rSiz) override; + virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override; + virtual void NbcRotate(const Point& rRef, long nAngle, double sn, double cs) override; + virtual void NbcMirror(const Point& rRef1, const Point& rRef2) override; + virtual void NbcShear(const Point& rRef, long nAngle, double tn, bool bVShear) override; + + virtual SdrGluePoint GetVertexGluePoint(sal_uInt16 nNum) const override; + virtual SdrGluePoint GetCornerGluePoint(sal_uInt16 nNum) const override; + + virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const override; + + virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override; +}; + +#endif // INCLUDED_SVX_SVDORECT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdotable.hxx b/include/svx/svdotable.hxx new file mode 100644 index 000000000..df713b66c --- /dev/null +++ b/include/svx/svdotable.hxx @@ -0,0 +1,292 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVDOTABLE_HXX +#define INCLUDED_SVX_SVDOTABLE_HXX + +#include +#include +#include +#include +#include +#include +#include + +class SvStream; +class SfxStyleSheet; +class SdrUndoAction; + +namespace sdr::contact { + class ViewContactOfTableObj; +} + +namespace sdr::table { + +class TableLayouter; +struct ImplTableShadowPaintInfo; + +#ifndef CellRef + class Cell; + typedef rtl::Reference< Cell > CellRef; +#endif + + +/// SdrTableHitKind +enum class TableHitKind +{ + NONE, + Cell, + CellTextArea, + HorizontalBorder, + VerticallBorder +}; + + +struct CellPos +{ + sal_Int32 mnCol; + sal_Int32 mnRow; + + CellPos() : mnCol( 0 ), mnRow( 0 ) {} + CellPos( sal_Int32 nCol, sal_Int32 nRow ) { mnCol = nCol; mnRow = nRow; } + + bool operator==( const CellPos& r ) const { return (r.mnCol == mnCol) && (r.mnRow == mnRow); } + bool operator!=( const CellPos& r ) const { return (r.mnCol != mnCol) || (r.mnRow != mnRow); } +}; + + +/// TableStyleSettings +struct TableStyleSettings +{ + bool mbUseFirstRow; + bool mbUseLastRow; + bool mbUseFirstColumn; + bool mbUseLastColumn; + bool mbUseRowBanding; + bool mbUseColumnBanding; + + TableStyleSettings(); + TableStyleSettings( const TableStyleSettings& rStyle ); + TableStyleSettings& operator=(const TableStyleSettings& rStyle); + + bool operator==( const TableStyleSettings& r ) const; +}; + +/// SdrTableObj +class SdrTableObjImpl; + +class SVXCORE_DLLPUBLIC SdrTableObj final : public ::SdrTextObj +{ + friend class Cell; + friend class SdrTableObjImpl; + + // protected destructor + virtual ~SdrTableObj() override; + +public: + SdrTableObj(SdrModel& rSdrModel); + SdrTableObj( + SdrModel& rSdrModel, + const ::tools::Rectangle& rNewRect, + sal_Int32 nColumns, + sal_Int32 nRows); + + // helper to limit existing TableModel to a given selection + void CropTableModelToSelection(const CellPos& rStart, const CellPos& rEnd); + + // Table stuff + void DistributeColumns( sal_Int32 nFirstColumn, sal_Int32 nLastColumn, const bool bOptimize, const bool bMinimize ); + void DistributeRows( sal_Int32 nFirstRow, sal_Int32 nLastRow, const bool bOptimize, const bool bMinimize ); + + css::uno::Reference< css::table::XTable > getTable() const; + + bool isValid( const sdr::table::CellPos& rPos ) const; + static CellPos getFirstCell(); + CellPos getLastCell() const; + CellPos getLeftCell( const CellPos& rPos, bool bEdgeTravel ) const; + CellPos getRightCell( const CellPos& rPos, bool bEdgeTravel ) const; + CellPos getUpCell( const CellPos& rPos, bool bEdgeTravel ) const; + CellPos getDownCell( const CellPos& rPos, bool bEdgeTravel ) const; + CellPos getPreviousCell( const CellPos& rPos, bool bEdgeTravel ) const; + CellPos getNextCell( const CellPos& rPos, bool bEdgeTravel ) const; + CellPos getPreviousRow( const CellPos& rPos, bool bEdgeTravel ) const; + CellPos getNextRow( const CellPos& rPos, bool bEdgeTravel ) const; + + void createCell( sdr::table::CellRef& xCell ); + + const sdr::table::TableStyleSettings& getTableStyleSettings() const; + void setTableStyleSettings( const sdr::table::TableStyleSettings& rStyle ); + + TableHitKind CheckTableHit( const Point& rPos, sal_Int32& rnX, sal_Int32& rnY, const sal_uInt16 aTol = 0 ) const; + + void uno_lock(); + void uno_unlock(); + + /** The active table has the focus or is currently edited */ + const sdr::table::CellRef& getActiveCell() const; + + void setActiveCell( const sdr::table::CellPos& rPos ); + void getActiveCellPos( sdr::table::CellPos& rPos ) const; + sal_Int32 getColumnCount() const; + sal_Int32 getRowCount() const; + + bool createTableEdgesJson(boost::property_tree::ptree & rJsonRoot); + void changeEdge(bool bHorizontal, int nEdge, sal_Int32 nOffset); + + void getCellBounds( const sdr::table::CellPos& rPos, ::tools::Rectangle& rCellRect ); + + const SfxItemSet& GetActiveCellItemSet() const; + + void setTableStyle( const css::uno::Reference< css::container::XIndexAccess >& xAutoFormatStyle ); + const css::uno::Reference< css::container::XIndexAccess >& getTableStyle() const; + + // Text stuff + + /** Returns the currently active text */ + virtual SdrText* getActiveText() const override; + + /** Returns the nth available text */ + virtual SdrText* getText( sal_Int32 nIndex ) const override; + + /** Returns the number of texts available for this object */ + virtual sal_Int32 getTextCount() const override; + + /** Changes the current active text */ + virtual void setActiveText( sal_Int32 nIndex ) override; + + /** Returns the index of the text that contains the given point or -1 */ + virtual sal_Int32 CheckTextHit(const Point& rPnt) const override; + + // #i121917# + virtual bool HasText() const override; + + bool IsTextEditActive() const { return (pEdtOutl != nullptr); } + bool IsTextEditActive( const sdr::table::CellPos& rPos ); + + /** Returns true only if we are in edit mode and the user actually changed anything */ + virtual bool IsReallyEdited() const override; + + /** At the same time, we set the text in the outliner (if applicable the EditOutliners') + * as well as the PaperSize + */ + void TakeTextRect( const sdr::table::CellPos& rPos, SdrOutliner& rOutliner, ::tools::Rectangle& rTextRect, bool bNoEditText, ::tools::Rectangle* pAnchorRect ) const; + virtual void TakeTextRect( SdrOutliner& rOutliner, tools::Rectangle& rTextRect, bool bNoEditText, tools::Rectangle* pAnchorRect, bool bLineWidth = true ) const override; + void TakeTextAnchorRect(const sdr::table::CellPos& rPos, ::tools::Rectangle& rAnchorRect ) const; + virtual void TakeTextAnchorRect(::tools::Rectangle& rAnchorRect) const override; + + virtual bool IsAutoGrowHeight() const override; + virtual bool IsAutoGrowWidth() const override; + + virtual bool IsFontwork() const override; + + virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; + virtual sal_uInt16 GetObjIdentifier() const override; + virtual void SetChanged() override; + + virtual bool AdjustTextFrameWidthAndHeight(tools::Rectangle& rR, bool bHgt = true, bool bWdt = true) const override; + virtual bool AdjustTextFrameWidthAndHeight() override; + virtual OUString TakeObjNameSingul() const override; + virtual OUString TakeObjNamePlural() const override; + virtual SdrTableObj* CloneSdrObject(SdrModel& rTargetModel) const override; + SdrTableObj& operator=(const SdrTableObj& rObj); + virtual void RecalcSnapRect() override; + virtual const tools::Rectangle& GetSnapRect() const override; + virtual void NbcSetSnapRect(const tools::Rectangle& rRect) override; + + virtual const tools::Rectangle& GetLogicRect() const override; + virtual void NbcSetLogicRect(const tools::Rectangle& rRect) override; + virtual void AdjustToMaxRect( const tools::Rectangle& rMaxRect, bool bShrinkOnly = false ) override; + + virtual sal_uInt32 GetHdlCount() const override; + virtual void AddToHdlList(SdrHdlList& rHdlList) const override; + + // Special drag methods + virtual bool hasSpecialDrag() const override; + virtual bool beginSpecialDrag(SdrDragStat& rDrag) const override; + virtual bool applySpecialDrag(SdrDragStat& rDrag) override; + virtual basegfx::B2DPolyPolygon getSpecialDragPoly(const SdrDragStat& rDrag) const override; + + virtual bool BegCreate(SdrDragStat& rStat) override; + virtual bool MovCreate(SdrDragStat& rStat) override; + virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) override; + virtual bool BckCreate(SdrDragStat& rStat) override; + virtual void BrkCreate(SdrDragStat& rStat) override; + virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const override; + virtual PointerStyle GetCreatePointer() const override; + + virtual void NbcMove(const Size& rSiz) override; + virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override; + + virtual bool BegTextEdit(SdrOutliner& rOutl) override; + virtual void EndTextEdit(SdrOutliner& rOutl) override; + virtual void TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, tools::Rectangle* pViewInit, tools::Rectangle* pViewMin) const override; + void TakeTextEditArea(const sdr::table::CellPos& rPos, Size* pPaperMin, Size* pPaperMax, tools::Rectangle* pViewInit, tools::Rectangle* pViewMin) const; + virtual EEAnchorMode GetOutlinerViewAnchorMode() const override; + + virtual void NbcSetOutlinerParaObject(std::unique_ptr pTextObject) override; + + virtual OutlinerParaObject* GetOutlinerParaObject() const override; + + virtual void NbcReformatText() override; + + virtual bool IsVerticalWriting() const override; + virtual void SetVerticalWriting(bool bVertical) override; + + css::text::WritingMode GetWritingMode() const; + + /// Add an undo action that should be on the undo stack after ending text edit. + void AddUndo(SdrUndoAction* pUndo); + + /// Next time layouting would be done, skip it (to layout at the end of multiple actions). + void SetSkipChangeLayout(bool bSkipChangeLayout); + + virtual void onEditOutlinerStatusEvent( EditStatus* pEditStatus ) override; + + virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override; + +private: + void init( sal_Int32 nColumns, sal_Int32 nRows ); + + virtual std::unique_ptr CreateObjectSpecificProperties() override; + virtual std::unique_ptr CreateObjectSpecificViewContact() override; + + virtual SdrObjGeoData* NewGeoData() const override; + virtual void SaveGeoData(SdrObjGeoData& rGeo) const override; + virtual void RestGeoData(const SdrObjGeoData& rGeo) override; + + SdrOutliner* GetCellTextEditOutliner( const sdr::table::Cell& rCell ) const; + + // For the ViewContactOfTableObj to build the primitive representation, it is necessary to access the + // TableLayouter for position and attribute information + friend class sdr::contact::ViewContactOfTableObj; + const TableLayouter& getTableLayouter() const; + + tools::Rectangle maLogicRect; + rtl::Reference mpImpl; +}; + +/** Hack for clipboard with calc and writer, export and import table content as rtf table */ +SVX_DLLPUBLIC void ExportAsRTF( SvStream& rStrm, SdrTableObj& rObj ); +SVX_DLLPUBLIC void ImportAsRTF( SvStream& rStrm, SdrTableObj& rObj ); + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx new file mode 100644 index 000000000..9e680b30d --- /dev/null +++ b/include/svx/svdotext.hxx @@ -0,0 +1,636 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVDOTEXT_HXX +#define INCLUDED_SVX_SVDOTEXT_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +// forward declarations + + +class OutlinerParaObject; +class OverflowingText; +class SdrOutliner; +class SdrPathObj; +class SdrTextObj; +class SdrTextObjTest; +class SvxFieldItem; +class ImpSdrObjTextLink; +class EditStatus; +class TextChain; +class TextChainFlow; + +enum class EEAnchorMode; +enum class EETextFormat; + +namespace sdr::properties { + class TextProperties; +} + +namespace drawinglayer::primitive2d { + class SdrContourTextPrimitive2D; + class SdrPathTextPrimitive2D; + class SdrBlockTextPrimitive2D; + class SdrAutoFitTextPrimitive2D; + class SdrStretchTextPrimitive2D; + class SdrChainedTextPrimitive2D; +} + +namespace drawinglayer::animation { + class AnimationEntryList; +} + +namespace drawinglayer::geometry { + class ViewInformation2D; +} + +namespace sdr::table { + class Cell; + class SdrTableRtfExporter; + class SdrTableRTFParser; +} + + +// Defines + + +#define SDRUSERDATA_OBJTEXTLINK (1) + + +// helper class SdrTextObjGeoData + + +class SdrTextObjGeoData : public SdrObjGeoData +{ +public: + tools::Rectangle aRect; + GeoStat aGeo; +}; + + +// helper class ImpSdrObjTextLinkUserData + + +class ImpSdrObjTextLinkUserData final : public SdrObjUserData +{ + friend class SdrTextObj; + friend class ImpSdrObjTextLink; + + OUString aFileName; // name of the referenced document + OUString aFilterName; // a filter, if need be + DateTime aFileDate0; // avoiding unnecessary reload + tools::SvRef + pLink; + rtl_TextEncoding eCharSet; + +public: + ImpSdrObjTextLinkUserData(); + virtual ~ImpSdrObjTextLinkUserData() override; + + virtual std::unique_ptr Clone(SdrObject* pObj1) const override; +}; + +namespace sdr +{ + namespace properties + { + class CustomShapeProperties; + class CellProperties; + } // end of namespace properties +} // end of namespace sdr + +// SdrTextObj + +typedef std::unique_ptr SdrPathObjUniquePtr; + +class SVXCORE_DLLPUBLIC SdrTextObj : public SdrAttrObj, public svx::ITextProvider +{ +private: + // Cell needs access to ImpGetDrawOutliner(); + friend class sdr::table::Cell; + friend class sdr::table::SdrTableRtfExporter; + friend class sdr::table::SdrTableRTFParser; + friend class TextChain; + friend class TextChainFlow; + friend class EditingTextChainFlow; + + // CustomShapeproperties need to access the "bTextFrame" member: + friend class sdr::properties::CustomShapeProperties; + +protected: + virtual std::unique_ptr CreateObjectSpecificProperties() override; + virtual std::unique_ptr CreateObjectSpecificViewContact() override; + +private: + // This method is only allowed for sdr::properties::TextProperties + SVX_DLLPRIVATE SdrOutliner* GetTextEditOutliner() const + { + return pEdtOutl; + } + + // to allow sdr::properties::TextProperties access to SetPortionInfoChecked() + // and GetTextEditOutliner() + friend class sdr::properties::TextProperties; + friend class sdr::properties::CellProperties; + + friend class ImpSdrObjTextLink; + friend class ImpSdrObjTextLinkUserData; + friend class SdrPowerPointImport; // for PowerPointImport + friend class SdrExchangeView; // for ImpGetDrawOutliner + friend class SdrView; // for ImpGetDrawOutliner + friend class SdrObjEditView; // for TextEdit + friend class SdrMeasureObj; // for ImpGetDrawOutliner + friend class SvxMSDffManager; // for ImpGetDrawOutliner + friend class SdrObjCustomShape; // for ImpGetDrawOutliner + friend class SdrText; // for ImpGetDrawOutliner + +protected: + // The "aRect" is also the rect of RectObj and CircObj. + // When bTextFrame=sal_True the text will be formatted into this rect + // When bTextFrame=sal_False the text will be centered around its middle + tools::Rectangle maRect; + + // The GeoStat contains the rotation and shear angles + GeoStat aGeo; + + // this is the active text + std::unique_ptr mpText; + + // This contains the dimensions of the text + Size aTextSize; + + // an Outliner*, so that + // 1. the TextObj won't be edited simultaneously by multiple views, and + // 2. when streaming while editing Flush() can be done + SdrOutliner* pEdtOutl; + + // Possible values for eTextKind are: + // OBJ_TEXT regular text frame + // OBJ_TITLETEXT TitleText for presentations + // OBJ_OUTLINETEXT OutlineText for presentations + // eTextKind only has meaning when bTextFrame=sal_True, since otherwise + // we're dealing with a labeled graphical object + SdrObjKind eTextKind; + + // For text editing in SW Header/Footer it is necessary to be + // able to set an offset for the text edit to allow text editing at the + // position of the virtual object. This offset is used when setting up + // and maintaining the OutlinerView. + Point maTextEditOffset; + + virtual SdrObjectUniquePtr getFullDragClone() const override; + + +public: + const Point& GetTextEditOffset() const { return maTextEditOffset; } + void SetTextEditOffset(const Point& rNew) { maTextEditOffset = rNew; } + +protected: + bool mbIsUnchainableClone = false; + + // the successor in a chain + SdrTextObj *mpNextInChain = nullptr; + SdrTextObj *mpPrevInChain = nullptr; + + // For labeled graphical objects bTextFrame is FALSE. The block of text + // will then be centered horizontally and vertically on aRect. + // For bTextFalse=sal_True the text will be formatted into aRect. + // The actual text frame is realized by an SdrRectObj with + // bTextFrame=sal_True. + bool bTextFrame : 1; + bool bNoShear : 1; // disable shearing (->graphic+Ole+TextFrame) + bool bTextSizeDirty : 1; + + bool mbInEditMode : 1; // Is this text object in edit mode? + + // For objects with free size (flow text). The flag is set by the + // application on create. If the object width is later resized, + // AutoGrowWidth will be disabled (set to sal_False). This flag will + // then also be set to sal_False, so that the object behaves like a + // normal text object. + // Width resize can result from: + // - Interactive Resize in single or multiple selections + // - position/size dialog + bool bDisableAutoWidthOnDragging : 1; + + // Flag for allowing text animation. Default is sal_true. + bool mbTextAnimationAllowed : 1; + + // flag for preventing recursive onEditOutlinerStatusEvent calls + bool mbInDownScale : 1; + + SdrOutliner& ImpGetDrawOutliner() const; + +private: + // #101029#: Extracted from ImpGetDrawOutliner() + SVX_DLLPRIVATE void ImpInitDrawOutliner( SdrOutliner& rOutl ) const; + // #101029#: Extracted from Paint() + SVX_DLLPRIVATE void ImpSetupDrawOutlinerForPaint( bool bContourFrame, + SdrOutliner& rOutliner, + tools::Rectangle& rTextRect, + tools::Rectangle& rAnchorRect, + tools::Rectangle& rPaintRect, + Fraction& aFitXCorrection ) const; + void ImpAutoFitText( SdrOutliner& rOutliner ) const; + void ImpAutoFitText( SdrOutliner& rOutliner, const Size& rShapeSize, bool bIsVerticalWriting ) const; + SVX_DLLPRIVATE SdrObjectUniquePtr ImpConvertContainedTextToSdrPathObjs(bool bToPoly) const; + SVX_DLLPRIVATE void ImpRegisterLink(); + SVX_DLLPRIVATE void ImpDeregisterLink(); + SVX_DLLPRIVATE ImpSdrObjTextLinkUserData* GetLinkUserData() const; + + /** Appends the style family to a provided style name */ + static void AppendFamilyToStyleName(OUString& styleName, SfxStyleFamily family); + + /** Reads the style family from a style name to which the family has been appended. */ + static SfxStyleFamily ReadFamilyFromStyleName(const OUString& styleName); + +protected: + bool ImpCanConvTextToCurve() const; + SdrPathObjUniquePtr ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPolygon, bool bClosed, bool bBezier) const; + SdrObjectUniquePtr ImpConvertAddText(SdrObjectUniquePtr pObj, bool bBezier) const; + void ImpSetTextStyleSheetListeners(); + static void ImpSetCharStretching(SdrOutliner& rOutliner, const Size& rTextSize, const Size& rShapeSize, Fraction& rFitXCorrection); + static void ImpJustifyRect(tools::Rectangle& rRect); + void ImpCheckShear(); + tools::Rectangle ImpDragCalcRect(const SdrDragStat& rDrag) const; + void ImpSetTextEditParams() const; + void SetTextSizeDirty() { bTextSizeDirty=true; } + + // rAnchorRect is InOut-Parameter! + void ImpSetContourPolygon( SdrOutliner& rOutliner, tools::Rectangle const & rAnchorRect, bool bLineWidth ) const; + + virtual SdrObjGeoData* NewGeoData() const override; + virtual void SaveGeoData(SdrObjGeoData& rGeo) const override; + virtual void RestGeoData(const SdrObjGeoData& rGeo) override; + void NbcSetEckenradius(long nRad); + + // #115391# new method for SdrObjCustomShape and SdrTextObj to correctly handle and set + // SdrTextMinFrameWidthItem and SdrTextMinFrameHeightItem based on all settings, necessities + // and object sizes + virtual void AdaptTextMinSize(); + + // constructors for labeled graphical objects + SdrTextObj(SdrModel& rSdrModel); + SdrTextObj( + SdrModel& rSdrModel, + const tools::Rectangle& rNewRect); + + // constructors for text frames + SdrTextObj( + SdrModel& rSdrModel, + SdrObjKind eNewTextKind); + SdrTextObj( + SdrModel& rSdrModel, + SdrObjKind eNewTextKind, + const tools::Rectangle& rNewRect); + + // protected destructor + virtual ~SdrTextObj() override; + +public: + + bool IsInEditMode() const { return mbInEditMode; } + + // Currently ASCII and RTF are supported and the differentiation is done + // internally. + // rFilterName has no meaning and must be empty + // Normally the application only has to call SetTextLink() - the + // remainder is automatic (SfxLinkManager). + // The LoadText() method can also be used to load a file into a text + // object (without linking.) + // TextLinks can't be edited (if needed later could be ReadOnly). + // Setting attributes can only be done on the text frame. + void SetTextLink(const OUString& rFileName, const OUString& rFilterName); + void ReleaseTextLink(); + bool IsLinkedText() const { return pPlusData!=nullptr && GetLinkUserData()!=nullptr; } + bool ReloadLinkedText(bool bForceLoad); + bool LoadText(const OUString& rFileName, rtl_TextEncoding eCharSet); + + virtual bool AdjustTextFrameWidthAndHeight(tools::Rectangle& rR, bool bHgt = true, bool bWdt = true) const; + virtual bool NbcAdjustTextFrameWidthAndHeight(bool bHgt = true, bool bWdt = true); + virtual bool AdjustTextFrameWidthAndHeight(); + bool IsTextFrame() const { return bTextFrame; } + bool IsOutlText() const { return bTextFrame && (eTextKind==OBJ_OUTLINETEXT || eTextKind==OBJ_TITLETEXT); } + /// returns true if the PPT autofit of text into shape bounds is enabled. implies IsFitToSize()==false! + bool IsAutoFit() const; + /// returns true if the old feature for fitting shape content should into shape is enabled. implies IsAutoFit()==false! + bool IsFitToSize() const; + + // Chaining + SdrTextObj *GetNextLinkInChain() const; + void SetNextLinkInChain(SdrTextObj *); + SdrTextObj *GetPrevLinkInChain() const; + bool IsChainable() const; + bool GetPreventChainable() const; + TextChain *GetTextChain() const; + + SdrObjKind GetTextKind() const { return eTextKind; } + + // #i121917# + virtual bool HasText() const override; + + bool IsTextEditActive() const { return pEdtOutl != nullptr; } + + /** returns the currently active text. */ + virtual SdrText* getActiveText() const; + + /** returns the nth available text. */ + virtual SdrText* getText( sal_Int32 nIndex ) const override; + + /** returns the number of texts available for this object. */ + virtual sal_Int32 getTextCount() const override; + + /** returns true only if we are in edit mode and the user actually changed anything */ + virtual bool IsReallyEdited() const; + + /** changes the current active text */ + virtual void setActiveText( sal_Int32 nIndex ); + + /** returns the index of the text that contains the given point or -1 */ + virtual sal_Int32 CheckTextHit(const Point& rPnt) const; + + void SetDisableAutoWidthOnDragging(bool bOn) { bDisableAutoWidthOnDragging=bOn; } + void NbcSetText(const OUString& rStr); + void SetText(const OUString& rStr); + void NbcSetText(SvStream& rInput, const OUString& rBaseURL, EETextFormat eFormat); + void SetText(SvStream& rInput, const OUString& rBaseURL, EETextFormat eFormat); + + // FitToSize and Fontwork are not taken into account in GetTextSize()! + virtual const Size& GetTextSize() const; + void FitFrameToTextSize(); + double GetFontScaleY() const; + + // Simultaneously sets the text into the Outliner (possibly + // the one of the EditOutliner) and sets the PaperSize. + virtual void TakeTextRect( SdrOutliner& rOutliner, tools::Rectangle& rTextRect, bool bNoEditText, + tools::Rectangle* pAnchorRect, bool bLineWidth = true ) const; + virtual void TakeTextAnchorRect(::tools::Rectangle& rAnchorRect) const; + const GeoStat& GetGeoStat() const { return aGeo; } + + // get corner radius + long GetEckenradius() const; + virtual bool IsAutoGrowHeight() const; + long GetMinTextFrameHeight() const; + long GetMaxTextFrameHeight() const; + virtual bool IsAutoGrowWidth() const; + long GetMinTextFrameWidth() const; + long GetMaxTextFrameWidth() const; + + css::drawing::TextFitToSizeType GetFitToSize() const; + const tools::Rectangle &GetGeoRect() const; + + // check if it's a TextFontwork + virtual bool IsFontwork() const; + + // should the Fontwork contour be hidden? + bool IsHideContour() const; + + // text flow within contour + bool IsContourTextFrame() const; + + SdrTextHorzAdjust GetTextHorizontalAdjust(const SfxItemSet& rSet) const; + SdrTextHorzAdjust GetTextHorizontalAdjust() const; + + SdrTextVertAdjust GetTextVerticalAdjust(const SfxItemSet& rSet) const; + SdrTextVertAdjust GetTextVerticalAdjust() const; + + /** Left inner spacing to borders */ + long GetTextLeftDistance() const; + /** Right inner spacing to borders */ + long GetTextRightDistance() const; + /** Top inner spacing to borders */ + long GetTextUpperDistance() const; + /** Bottom inner spacing to borders */ + long GetTextLowerDistance() const; + SdrTextAniKind GetTextAniKind() const; + SdrTextAniDirection GetTextAniDirection() const; + + // react on model/page change + virtual void handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage) override; + + virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; + virtual sal_uInt16 GetObjIdentifier() const override; + + // needed to determine text anchor area + virtual void TakeUnrotatedSnapRect(tools::Rectangle& rRect) const; + virtual OUString TakeObjNameSingul() const override; + virtual OUString TakeObjNamePlural() const override; + virtual SdrTextObj* CloneSdrObject(SdrModel& rTargetModel) const override; + SdrTextObj& operator=(const SdrTextObj& rObj); + virtual basegfx::B2DPolyPolygon TakeXorPoly() const override; + virtual basegfx::B2DPolyPolygon TakeContour() const override; + virtual void RecalcSnapRect() override; + virtual void NbcSetSnapRect(const tools::Rectangle& rRect) override; + virtual void NbcSetLogicRect(const tools::Rectangle& rRect) override; + virtual const tools::Rectangle& GetLogicRect() const override; + virtual long GetRotateAngle() const override; + virtual long GetShearAngle(bool bVertical = false) const override; + + virtual sal_uInt32 GetSnapPointCount() const override; + virtual Point GetSnapPoint(sal_uInt32 i) const override; + + virtual sal_uInt32 GetHdlCount() const override; + virtual void AddToHdlList(SdrHdlList& rHdlList) const override; + + // special drag methods + virtual bool hasSpecialDrag() const override; + virtual bool applySpecialDrag(SdrDragStat& rDrag) override; + virtual OUString getSpecialDragComment(const SdrDragStat& rDrag) const override; + + virtual bool BegCreate(SdrDragStat& rStat) override; + virtual bool MovCreate(SdrDragStat& rStat) override; + virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) override; + virtual bool BckCreate(SdrDragStat& rStat) override; + virtual void BrkCreate(SdrDragStat& rStat) override; + virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const override; + virtual PointerStyle GetCreatePointer() const override; + + virtual void NbcMove(const Size& rSiz) override; + virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override; + virtual void NbcRotate(const Point& rRef, long nAngle, double sn, double cs) override; + virtual void NbcMirror(const Point& rRef1, const Point& rRef2) override; + virtual void NbcShear(const Point& rRef, long nAngle, double tn, bool bVShear) override; + + virtual bool HasTextEdit() const override; + // returns true if TextEditMode started + virtual bool BegTextEdit(SdrOutliner& rOutl); + virtual void TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, tools::Rectangle* pViewInit, tools::Rectangle* pViewMin) const; + virtual void EndTextEdit(SdrOutliner& rOutl); + virtual EEAnchorMode GetOutlinerViewAnchorMode() const; + + virtual void NbcSetOutlinerParaObject(std::unique_ptr pTextObject) override; + void NbcSetOutlinerParaObjectForText( std::unique_ptr pTextObject, SdrText* pText ); + virtual OutlinerParaObject* GetOutlinerParaObject() const override; + bool CanCreateEditOutlinerParaObject() const; + std::unique_ptr CreateEditOutlinerParaObject() const; + + virtual void NbcReformatText() override; + + virtual bool CalcFieldValue(const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos, + bool bEdit, std::optional& rpTxtColor, std::optional& rpFldColor, OUString& rRet) const; + + virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const override; + + void SetTextEditOutliner(SdrOutliner* pOutl) { pEdtOutl=pOutl; } + + /** Setup given Outliner equivalently to SdrTextObj::Paint() + + To setup an arbitrary Outliner in the same way as the draw + outliner on SdrTextObj::Paint(). Among others, the paper size, + control word and character stretching are initialized, such + that the formatting should match the screen representation. + The textual content of the outliner is not touched, i.e. no + Init() or Clear() is called on the Outliner. + + @param rOutl + The Outliner to setup. + + @param rPaintRect + The region to paint the outliner content into. This is useful + to e.g. determine the top, left position of text in shapes. + */ + void SetupOutlinerFormatting( SdrOutliner& rOutl, tools::Rectangle& rPaintRect ) const; + + /** Update given Outliner equivalently to SdrTextObj::Paint() + + Same functionality as in SetupOutlinerFormatting(), except + that the outliner content is not cleared. + + @param rOutl + The Outliner to update. + + @param rPaintRect + The region to paint the outliner content into. This is useful + to e.g. determine the top, left position of text in shapes. + */ + void UpdateOutlinerFormatting( SdrOutliner& rOutl, tools::Rectangle& rPaintRect ) const; + void ForceOutlinerParaObject(); + virtual bool IsVerticalWriting() const; + virtual void SetVerticalWriting(bool bVertical); + + /** called from the SdrObjEditView during text edit when the status of the edit outliner changes */ + virtual void onEditOutlinerStatusEvent( EditStatus* pEditStatus ); + + /** called from the SdrObjEditView during text edit when a chain of boxes is to be updated */ + void onChainingEvent(); + + + // transformation interface for StarOfficeAPI. This implements support for + // homogen 3x3 matrices containing the transformation of the SdrObject. At the + // moment it contains a shearX, rotation and translation, but for setting all linear + // transforms like Scale, ShearX, ShearY, Rotate and Translate are supported. + + + // gets base transformation and rectangle of object. If it's an SdrPathObj it fills the PolyPolygon + // with the base geometry and returns TRUE. Otherwise it returns FALSE. + virtual bool TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPolyPolygon& rPolyPolygon) const override; + + // sets the base geometry of the object using infos contained in the homogen 3x3 matrix. + // If it's an SdrPathObj it will use the provided geometry information. The Polygon has + // to use (0,0) as upper left and will be scaled to the given size in the matrix. + virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& rPolyPolygon) override; + + // #103836# iterates over the paragraphs of a given SdrObject and removes all + // hard set character attributes with the which ids contained in the + // given vector + void RemoveOutlinerCharacterAttribs( const std::vector& rCharWhichIds ); + + // Get necessary data for text scroll animation. ATM base it on a Text-Metafile and a + // painting rectangle. Rotation is taken from the object. + GDIMetaFile* GetTextScrollMetaFileAndRectangle(tools::Rectangle& rScrollRectangle, tools::Rectangle& rPaintRectangle); + + // Access to TextAnimationAllowed flag + void SetTextAnimationAllowed(bool bNew); + + // #i8824# + // Set single item at the local ItemSet. *Does not use* AllowItemChange(), + // ItemChange(), PostItemChange() and ItemSetChanged() calls. + void SetObjectItemNoBroadcast(const SfxPoolItem& rItem); + double GetCameraZRotation() const; + +public: + + // text primitive decomposition helpers + void impDecomposeContourTextPrimitive( + drawinglayer::primitive2d::Primitive2DContainer& rTarget, + const drawinglayer::primitive2d::SdrContourTextPrimitive2D& rSdrContourTextPrimitive, + const drawinglayer::geometry::ViewInformation2D& aViewInformation) const; + void impDecomposePathTextPrimitive( + drawinglayer::primitive2d::Primitive2DContainer& rTarget, + const drawinglayer::primitive2d::SdrPathTextPrimitive2D& rSdrPathTextPrimitive, + const drawinglayer::geometry::ViewInformation2D& aViewInformation) const; + void impDecomposeBlockTextPrimitive( + drawinglayer::primitive2d::Primitive2DContainer& rTarget, + const drawinglayer::primitive2d::SdrBlockTextPrimitive2D& rSdrBlockTextPrimitive, + const drawinglayer::geometry::ViewInformation2D& aViewInformation) const; + void impDecomposeAutoFitTextPrimitive( + drawinglayer::primitive2d::Primitive2DContainer& rTarget, + const drawinglayer::primitive2d::SdrAutoFitTextPrimitive2D& rSdrAutofitTextPrimitive, + const drawinglayer::geometry::ViewInformation2D& aViewInformation) const; + void impDecomposeStretchTextPrimitive( + drawinglayer::primitive2d::Primitive2DContainer& rTarget, + const drawinglayer::primitive2d::SdrStretchTextPrimitive2D& rSdrStretchTextPrimitive, + const drawinglayer::geometry::ViewInformation2D& aViewInformation) const; + void impDecomposeChainedTextPrimitive( + drawinglayer::primitive2d::Primitive2DContainer& rTarget, + const drawinglayer::primitive2d::SdrChainedTextPrimitive2D& rSdrChainedTextPrimitive, + const drawinglayer::geometry::ViewInformation2D& aViewInformation) const; + void impHandleChainingEventsDuringDecomposition(SdrOutliner &rOutliner) const; + + // timing generators + void impGetBlinkTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList) const; + void impGetScrollTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList, double fFrameLength, double fTextLength) const; + + // Direct decomposer for text visualization when you already have a prepared + // Outliner containing all the needed information + static void impDecomposeBlockTextPrimitiveDirect( + drawinglayer::primitive2d::Primitive2DContainer& rTarget, + SdrOutliner& rOutliner, + const basegfx::B2DHomMatrix& rNewTransformA, + const basegfx::B2DHomMatrix& rNewTransformB, + const basegfx::B2DRange& rClipRange); + + /** returns false if the given pointer is NULL + or if the given SdrOutliner contains no text. + Also checks for one empty paragraph. + */ + static bool HasTextImpl( SdrOutliner const * pOutliner ); + + friend class ::SdrTextObjTest; +}; + + +#endif // INCLUDED_SVX_SVDOTEXT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdouno.hxx b/include/svx/svdouno.hxx new file mode 100644 index 000000000..22f10d334 --- /dev/null +++ b/include/svx/svdouno.hxx @@ -0,0 +1,146 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVDOUNO_HXX +#define INCLUDED_SVX_SVDOUNO_HXX + +#include +#include +#include +#include +#include +#include +#include + + +// Forward declaration +class SdrView; +class SdrPageWindow; +class SdrControlEventListenerImpl; + +namespace sdr::contact { + class ViewContactOfUnoControl; +} + + +// SdrUnoObj +struct SdrUnoObjDataHolder; +class SVXCORE_DLLPUBLIC SdrUnoObj : public SdrRectObj +{ + friend class SdrPageView; + friend class SdrControlEventListenerImpl; + + std::unique_ptr m_pImpl; + + OUString aUnoControlModelTypeName; + OUString aUnoControlTypeName; + +protected: + css::uno::Reference< css::awt::XControlModel > xUnoControlModel; // Can also be set from outside + +private: + SVX_DLLPRIVATE void CreateUnoControlModel(const OUString& rModelName); + SVX_DLLPRIVATE void CreateUnoControlModel(const OUString& rModelName, + const css::uno::Reference< css::lang::XMultiServiceFactory >& rxSFac ); + +protected: + // protected destructor + virtual ~SdrUnoObj() override; + +public: + explicit SdrUnoObj( + SdrModel& rSdrModel, + const OUString& rModelName); + SdrUnoObj( + SdrModel& rSdrModel, + const OUString& rModelName, + const css::uno::Reference< css::lang::XMultiServiceFactory >& rxSFac); + + virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; + virtual sal_uInt16 GetObjIdentifier() const override; + + virtual SdrUnoObj* CloneSdrObject(SdrModel& rTargetModel) const override; + SdrUnoObj& operator= (const SdrUnoObj& rObj); + virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override; + virtual void NbcSetLayer(SdrLayerID nLayer) override; + + // SpecialDrag support + virtual bool hasSpecialDrag() const override; + + virtual OUString TakeObjNameSingul() const override; + virtual OUString TakeObjNamePlural() const override; + + virtual void SetContextWritingMode( const sal_Int16 _nContextWritingMode ) override; + + const css::uno::Reference< css::awt::XControlModel >& GetUnoControlModel() const {return xUnoControlModel;} + css::uno::Reference< css::awt::XControl > GetUnoControl(const SdrView& _rView, const OutputDevice& _rOut) const; + + /** Retrieves a temporary XControl instance for a given output device + + The method GetUnoControl, used to retrieve the XControl whose parent is a given device, only works + if the SdrUnoObj has already been painted at least once onto this device. However, there are valid + scenarios where you need certain information on how a control is painted onto a window, without + actually painting it. For example, you might be interested in the DeviceInfo of a UNO control. + + For those cases, you can contain an XControl which behaves as the control which *would* be used to + paint onto a window. + + @param _rWindow + the window for which should act as parent for the temporary control + @param _inout_ControlContainer + the control container belonging to the window, necessary as context + for the newly created control. A control container is usually created by calling + VCLUnoHelper::CreateControlContainer. + If _inout_ControlContainer is , it will be created internally, and passed to the caller. + In this case, the caller also takes ownership of the control container, and is responsible for + disposing it when not needed anymore. + @return + The requested control. This control is temporary only, and the caller is responsible for it. + In particular, the caller is required to dispose it when it's not needed anymore. + + */ + css::uno::Reference< css::awt::XControl > + GetTemporaryControlForWindow( + const vcl::Window& _rWindow, + css::uno::Reference< css::awt::XControlContainer >& _inout_ControlContainer + ) const; + + const OUString& GetUnoControlTypeName() const { return aUnoControlTypeName; } + + virtual void SetUnoControlModel( const css::uno::Reference< css::awt::XControlModel >& xModel ); + +protected: + // SdrObject overridables + virtual std::unique_ptr CreateObjectSpecificViewContact() override; + +private: + /** Retrieves the typed ViewContact for the object + @param _out_rpContact + Upon successful return, ->_out_rpContact contains the ViewContact. + @return + if and only if the contact was successfully retrieved. In this case, + ->_out_rpContact contains a pointer to this contact. + A failure to retrieve the contact object fires an assertion in non-product builds. + */ + SVX_DLLPRIVATE bool impl_getViewContact( sdr::contact::ViewContactOfUnoControl*& _out_rpContact ) const; +}; + +#endif // INCLUDED_SVX_SVDOUNO_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdoutl.hxx b/include/svx/svdoutl.hxx new file mode 100644 index 000000000..767d82318 --- /dev/null +++ b/include/svx/svdoutl.hxx @@ -0,0 +1,53 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVDOUTL_HXX +#define INCLUDED_SVX_SVDOUTL_HXX + +#include +#include +#include + +class SdrTextObj; +class SdrPage; + +class SVXCORE_DLLPUBLIC SdrOutliner : public Outliner +{ + tools::WeakReference mpTextObj; + const SdrPage* mpVisualizedPage; + +public: + SdrOutliner( SfxItemPool* pItemPool, OutlinerMode nMode ); + virtual ~SdrOutliner() override ; + + void SetTextObj( const SdrTextObj* pObj ); + void SetTextObjNoInit( const SdrTextObj* pObj ); + const SdrTextObj* GetTextObj() const; + + void setVisualizedPage(const SdrPage* pPage) { if(pPage != mpVisualizedPage) mpVisualizedPage = pPage; } + const SdrPage* getVisualizedPage() const { return mpVisualizedPage; } + + virtual OUString CalcFieldValue(const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos, std::optional& rpTxtColor, std::optional& rpFldColor) override; + + bool hasEditViewCallbacks() const; +}; + +#endif // INCLUDED_SVX_SVDOUTL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdovirt.hxx b/include/svx/svdovirt.hxx new file mode 100644 index 000000000..5c6c68d87 --- /dev/null +++ b/include/svx/svdovirt.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_SVX_SVDOVIRT_HXX +#define INCLUDED_SVX_SVDOVIRT_HXX + +#include +#include + +/** + * FIXME: The virtual object is not yet fully implemented and tested. + * At the moment we only use it in a derived class in Writer. + */ +class SVXCORE_DLLPUBLIC SdrVirtObj : public SdrObject +{ + SdrVirtObj( const SdrVirtObj& ) = delete; +public: + virtual sdr::properties::BaseProperties& GetProperties() const override; + +protected: + virtual std::unique_ptr CreateObjectSpecificViewContact() override; + + SdrObject& rRefObj; // Referenced drawing object + tools::Rectangle aSnapRect; + +protected: + virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override; + + virtual SdrObjGeoData* NewGeoData() const override; + virtual void SaveGeoData(SdrObjGeoData& rGeo) const override; + virtual void RestGeoData(const SdrObjGeoData& rGeo) override; + + // protected destructor + virtual ~SdrVirtObj() override; + +public: + SdrVirtObj( + SdrModel& rSdrModel, + SdrObject& rNewObj); + + SdrObject& ReferencedObj(); + const SdrObject& GetReferencedObj() const; + virtual void NbcSetAnchorPos(const Point& rAnchorPos) override; + + virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; + virtual SdrInventor GetObjInventor() const override; + virtual sal_uInt16 GetObjIdentifier() const override; + virtual SdrObjList* GetSubList() const override; + + virtual const tools::Rectangle& GetCurrentBoundRect() const override; + virtual const tools::Rectangle& GetLastBoundRect() const override; + virtual void RecalcBoundRect() override; + virtual SdrVirtObj* CloneSdrObject(SdrModel& rTargetModel) const override; + SdrVirtObj& operator=(const SdrVirtObj& rObj); + + virtual OUString TakeObjNameSingul() const override; + virtual OUString TakeObjNamePlural() const override; + + // RotGrfFlyFrame: If true, this SdrObject supports only limited rotation + virtual bool HasLimitedRotation() const override; + + virtual basegfx::B2DPolyPolygon TakeXorPoly() const override; + virtual sal_uInt32 GetHdlCount() const override; + virtual void AddToPlusHdlList(SdrHdlList& rHdlList, SdrHdl& rHdl) const override; + virtual void AddToHdlList(SdrHdlList& rHdlList) const override; + + // special drag methods + virtual bool hasSpecialDrag() const override; + virtual bool beginSpecialDrag(SdrDragStat& rDrag) const override; + virtual bool applySpecialDrag(SdrDragStat& rDrag) override; + virtual OUString getSpecialDragComment(const SdrDragStat& rDrag) const override; + virtual basegfx::B2DPolyPolygon getSpecialDragPoly(const SdrDragStat& rDrag) const override; + + // FullDrag support + virtual bool supportsFullDrag() const override; + virtual SdrObjectUniquePtr getFullDragClone() const override; + + virtual bool BegCreate(SdrDragStat& rStat) override; + virtual bool MovCreate(SdrDragStat& rStat) override; + virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) override; + virtual bool BckCreate(SdrDragStat& rStat) override; + virtual void BrkCreate(SdrDragStat& rStat) override; + virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const override; + + virtual void NbcMove(const Size& rSiz) override; + virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override; + virtual void NbcRotate(const Point& rRef, long nAngle, double sn, double cs) override; + virtual void NbcMirror(const Point& rRef1, const Point& rRef2) override; + virtual void NbcShear(const Point& rRef, long nAngle, double tn, bool bVShear) override; + + virtual void Move(const Size& rSiz) override; + virtual void Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bUnsetRelative = true) override; + virtual void Rotate(const Point& rRef, long nAngle, double sn, double cs) override; + virtual void Mirror(const Point& rRef1, const Point& rRef2) override; + virtual void Shear(const Point& rRef, long nAngle, double tn, bool bVShear) override; + + virtual void RecalcSnapRect() override; + virtual const tools::Rectangle& GetSnapRect() const override; + virtual void SetSnapRect(const tools::Rectangle& rRect) override; + virtual void NbcSetSnapRect(const tools::Rectangle& rRect) override; + + virtual const tools::Rectangle& GetLogicRect() const override; + virtual void SetLogicRect(const tools::Rectangle& rRect) override; + virtual void NbcSetLogicRect(const tools::Rectangle& rRect) override; + + virtual long GetRotateAngle() const override; + virtual long GetShearAngle(bool bVertical = false) const override; + + virtual sal_uInt32 GetSnapPointCount() const override; + virtual Point GetSnapPoint(sal_uInt32 i) const override; + + virtual bool IsPolyObj() const override; + virtual sal_uInt32 GetPointCount() const override; + virtual Point GetPoint(sal_uInt32 i) const override; + virtual void NbcSetPoint(const Point& rPnt, sal_uInt32 i) override; + + virtual SdrObjGeoData* GetGeoData() const override; + virtual void SetGeoData(const SdrObjGeoData& rGeo) override; + + virtual void NbcReformatText() override; + + virtual bool HasMacro() const override; + virtual SdrObject* CheckMacroHit (const SdrObjMacroHitRec& rRec) const override; + virtual PointerStyle GetMacroPointer (const SdrObjMacroHitRec& rRec) const override; + virtual void PaintMacro (OutputDevice& rOut, const tools::Rectangle& rDirtyRect, const SdrObjMacroHitRec& rRec) const override; + virtual bool DoMacro (const SdrObjMacroHitRec& rRec) override; + + // #i73248# for default SdrVirtObj, offset is aAnchor, not (0,0) + virtual Point GetOffset() const; +}; + +#endif // INCLUDED_SVX_SVDOVIRT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx new file mode 100644 index 000000000..7d55b0fab --- /dev/null +++ b/include/svx/svdpage.hxx @@ -0,0 +1,536 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVDPAGE_HXX +#define INCLUDED_SVX_SVDPAGE_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +// predefines +namespace reportdesign { class OSection; } +namespace sdr::contact { class ViewContact; } +class SdrPage; +class SdrModel; +class SfxItemPool; +class SdrPageView; +class SdrLayerAdmin; +class SdrLayerIDSet; +class Color; +class SfxStyleSheet; +class SvxUnoDrawPagesAccess; + +//////////////////////////////////////////////////////////////////////////////////////////////////// +// +// SdrObjList +// E3dObjList +// SdrPage -> see continuation there + +// class SdrObjList +class SVXCORE_DLLPUBLIC SdrObjList +{ +friend class SdrObjListIter; +friend class SdrEditView; + +private: + SdrObjList(const SdrObjList& rSrcList) = delete; + SdrObjList &operator=(const SdrObjList& rSrcList) = delete; + + ::std::vector maList; + + tools::Rectangle maSdrObjListOutRect; + tools::Rectangle maSdrObjListSnapRect; + bool mbObjOrdNumsDirty; + bool mbRectsDirty; + +protected: + void RecalcRects(); + +private: + /// simple ActionChildInserted forwarder to have it on a central place + static void impChildInserted(SdrObject const & rChild); + + // tdf#116879 Clear SdrObjList, no Undo done. Used from destructor, but also + // from other places. When used from destructor, suppress broadcasts + // to not get callbacks to evtl. derived objects already in destruction + // (e.g. SdrPage) + void impClearSdrObjList(bool bBroadcast); + +protected: + // protected constructor to make clear that this class should only + // be used as base for derivations, not naked. See getSdrModelFromSdrObjList + // which is pure virtual to force this, too + SdrObjList(); + virtual ~SdrObjList(); + +public: + // SdrModel/SdrPage access on SdrObjList level + virtual SdrPage* getSdrPageFromSdrObjList() const; + virtual SdrObject* getSdrObjectFromSdrObjList() const; + + void CopyObjects(const SdrObjList& rSrcList); + + // tdf#116879 clean up everything (without Undo), plus broadcasting + // changes. Split to this call and a private one (impClearSdrObjList) + // that allows cleanup without broadcasting in the destructor + void ClearSdrObjList(); + + /// recalculate order numbers / ZIndex + void RecalcObjOrdNums(); + bool IsObjOrdNumsDirty() const { return mbObjOrdNumsDirty; } + virtual void NbcInsertObject(SdrObject* pObj, size_t nPos=SAL_MAX_SIZE); + virtual void InsertObject(SdrObject* pObj, size_t nPos=SAL_MAX_SIZE); + void sort( std::vector& sortOrder ); + + void InsertObjectThenMakeNameUnique(SdrObject* pObj); + void InsertObjectThenMakeNameUnique(SdrObject* pObj, std::unordered_set& rNameSet, size_t nPos=SAL_MAX_SIZE); + + /// remove from list without delete + virtual SdrObject* NbcRemoveObject(size_t nObjNum); + virtual SdrObject* RemoveObject(size_t nObjNum); + + /// Replace existing object by different one. + /// Same as Remove(old)+Insert(new) but faster because the order numbers + /// do not have to be set dirty. + virtual SdrObject* ReplaceObject(SdrObject* pNewObj, size_t nObjNum); + + /// Modify ZOrder of an SdrObject + virtual SdrObject* SetObjectOrdNum(size_t nOldObjNum, size_t nNewObjNum); + + void SetSdrObjListRectsDirty(); + + const tools::Rectangle& GetAllObjSnapRect() const; + const tools::Rectangle& GetAllObjBoundRect() const; + + /// reformat all text objects, e.g. when changing printer + void NbcReformatAllTextObjects(); + void ReformatAllTextObjects(); + + /** #103122# reformats all edge objects that are connected to other objects */ + void ReformatAllEdgeObjects(); + + /// convert attributes of the style to hard formatting + void BurnInStyleSheetAttributes(); + + size_t GetObjCount() const; + SdrObject* GetObj(size_t nNum) const; + + /// linked page or linked group object + virtual bool IsReadOnly() const; + + /** Makes the object list flat, i.e. the object list content are + then tree leaves + + This method travels recursively over all group objects in this + list, extracts the content, inserts it flat to the list and + removes the group object afterwards. + */ + void FlattenGroups(); + + /** Ungroup the object at the given index + + This method ungroups the content of the group object at the + given index, i.e. the content is put flat into the object list + (if the object at the given index is no group, this method is + a no-op). If the group itself contains group objects, the + operation is performed recursively, such that the content of + the given object contains no groups afterwards. + */ + void UnGroupObj( size_t nObjNum ); + + /** Return whether there is an explicit, user defined, object navigation + order. When there is one this method returns and the + GetObjectForNavigationPosition() and + SdrObject::GetNavigationPosition() methods will return values + different from those returned by SdrObject::GetOrdNum() and + GetObj(). + */ + bool HasObjectNavigationOrder() const; + + /** Set the navigation position of the given object to the specified + value. Note that this changes the navigation position for all + objects on or following the old or new position. + */ + void SetObjectNavigationPosition ( + SdrObject& rObject, + const sal_uInt32 nNewNavigationPosition); + + /** Return the object for the given navigation position. When there is + a user defined navigation order, i.e. mxNavigationOrder is not NULL, + then that is used to look up the object. Otherwise the z-order is + used by looking up the object in maList. + @param nNavigationPosition + Valid values include 0 and are smaller than the number of + objects as returned by GetObjCount(). + @return + The returned pointer is NULL for invalid positions. + */ + SdrObject* GetObjectForNavigationPosition (const sal_uInt32 nNavigationPosition) const; + + /** Restore the navigation order to that defined by the z-order. + */ + void ClearObjectNavigationOrder(); + + /** Set the navigation position of all SdrObjects to their position in + the mxNavigationOrder list. This method returns immediately when no + update is necessary. + @return + This method returns when the navigation positions stored + in SdrObjects are up to date. + It returns when the navigation positions are not valid, + for example because no explicit navigation order has been + defined, i.e. HasObjectNavigationOrder() would return . + */ + bool RecalcNavigationPositions(); + + /** Set the navigation order to the one defined by the given list of + XShape objects. + @param rxOrder + When this is an empty reference then the navigation order is + reset to the z-order. The preferred way to do this, however, is + to call ClearObjectNavigationOrder(). + Otherwise this list is expected to contain all the shapes in the + called SdrObjList. + */ + void SetNavigationOrder (const css::uno::Reference< + css::container::XIndexAccess>& rxOrder); + + virtual void dumpAsXml(xmlTextWriterPtr pWriter) const; + +private: + class WeakSdrObjectContainerType; + /// This list, if it exists, defines the navigation order. If it does + /// not exist then maList defines the navigation order. + std::unique_ptr mxNavigationOrder; + + /// This flag is when the mpNavigation list has been changed but + /// the indices of the referenced SdrObjects still have their old values. + bool mbIsNavigationOrderDirty; + + /** Insert an SdrObject into maList. Do not modify the maList member + directly. + @param rObject + The object to insert into the object list. + @param nInsertPosition + The given object is inserted before the object at this + position. Valid values include 0 (the object is inserted at the + head of the list) and the number of objects in the list as + returned by GetObjCount() (the object is inserted at the end of + the list.) + */ + void InsertObjectIntoContainer ( + SdrObject& rObject, + const sal_uInt32 nInsertPosition); + + /** Replace an object in the object list. + @param rObject + The new object that replaces the one in the list at the + specified position. + @param nObjectPosition + The object at this position in the object list is replaced by + the given object. Valid values include 0 and are smaller than + the number of objects in the list. + */ + void ReplaceObjectInContainer ( + SdrObject& rObject, + const sal_uInt32 nObjectPosition); + + /** Remove an object from the object list. + The object list has to contain at least one element. + @param nObjectPosition + The object at this position is removed from the object list. + Valid values include 0 and are smaller than the number of + objects in the list. + */ + void RemoveObjectFromContainer ( + const sal_uInt32 nObjectPosition); +}; + +// Used for all methods which return a page number +#define SDRPAGE_NOTFOUND 0xFFFF + +/// for the snap-to-grid in Writer +class SdrPageGridFrame +{ + tools::Rectangle aPaper; + tools::Rectangle aUserArea; +public: + SdrPageGridFrame(const tools::Rectangle& rPaper, const tools::Rectangle& rUser): aPaper(rPaper), aUserArea(rUser) {} + const tools::Rectangle& GetPaperRect() const { return aPaper; } + const tools::Rectangle& GetUserArea() const { return aUserArea; } +}; + +class SVXCORE_DLLPUBLIC SdrPageGridFrameList final +{ + std::vector aList; + + SdrPageGridFrameList(const SdrPageGridFrameList& rSrcList) = delete; + void operator=(const SdrPageGridFrameList& rSrcList) = delete; + SdrPageGridFrame* GetObject(sal_uInt16 i) const { return aList[i]; } + +public: + SdrPageGridFrameList(): aList() {} + ~SdrPageGridFrameList() { Clear(); } + void Clear(); + sal_uInt16 GetCount() const { return sal_uInt16(aList.size()); } + void Insert(const SdrPageGridFrame& rGF) { aList.push_back(new SdrPageGridFrame(rGF)); } + SdrPageGridFrame& operator[](sal_uInt16 nPos) { return *GetObject(nPos); } + const SdrPageGridFrame& operator[](sal_uInt16 nPos) const { return *GetObject(nPos); } +}; + +// class SdrPageProperties +class SVXCORE_DLLPUBLIC SdrPageProperties : public SfxListener, public svl::StyleSheetUser +{ +private: + // data + SdrPage* mpSdrPage; + SfxStyleSheet* mpStyleSheet; + SfxItemSet maProperties; + + // internal helpers + void ImpRemoveStyleSheet(); + void ImpAddStyleSheet(SfxStyleSheet& rNewStyleSheet); + + SdrPageProperties& operator=(const SdrPageProperties& rCandidate) = delete; + +public: + // construct/destruct + SdrPageProperties(SdrPage& rSdrPage); + virtual ~SdrPageProperties() override; + + // Notify(...) from baseclass SfxListener + virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override; + + virtual bool isUsedByModel() const override; + + // data read/write + const SfxItemSet& GetItemSet() const { return maProperties;} + void PutItemSet(const SfxItemSet& rSet); + void PutItem(const SfxPoolItem& rItem); + void ClearItem(const sal_uInt16 nWhich = 0); + + // StyleSheet access + void SetStyleSheet(SfxStyleSheet* pStyleSheet); + SfxStyleSheet* GetStyleSheet() const { return mpStyleSheet;} +}; + + +/** + A SdrPage contains exactly one SdrObjList and a description of the physical + page dimensions (size / margins). The latter is required to "catch" objects + during drag-and-drop. + The SdrPage allows (via SdrObjList) inserting and removing SdrObjects, + as well as moving them into the foreground or background. + Also it's possible to request and directly set the order number (ZOrder) + of SdrObjects. +*/ + +//////////////////////////////////////////////////////////////////////////////////////////////////// +// +// SdrPage +// DlgEdPage +// FmFormPage +// ScDrawPage +// SdPage +// SwDPage +// OReportPage + +class SVXCORE_DLLPUBLIC SdrPage : public SdrObjList, public tools::WeakBase +{ + // #i9076# + friend class SdrModel; + friend class SvxUnoDrawPagesAccess; + + // this class uses its own UNO wrapper + // and thus has to set mxUnoPage (it also relies on mxUnoPage not being WeakRef) + friend class reportdesign::OSection; + + SdrPage& operator=(const SdrPage&) = delete; + SdrPage(const SdrPage&) = delete; + + // start PageUser section +private: + // #111111# PageUser section + sdr::PageUserVector maPageUsers; + + std::unique_ptr mpViewContact; + +public: + void AddPageUser(sdr::PageUser& rNewUser); + void RemovePageUser(sdr::PageUser& rOldUser); + + // SdrModel access on SdrPage level + SdrModel& getSdrModelFromSdrPage() const { return mrSdrModelFromSdrPage; } + +protected: + std::unique_ptr CreateObjectSpecificViewContact(); +public: + const sdr::contact::ViewContact& GetViewContact() const; + sdr::contact::ViewContact& GetViewContact(); + + // #110094# DrawContact support: Methods for handling Page changes + void ActionChanged(); + +private: + // the SdrModel this page was created with, unchanged during SdrPage lifetime + SdrModel& mrSdrModelFromSdrPage; + +private: + sal_Int32 mnWidth; // page size + sal_Int32 mnHeight; // page size + sal_Int32 mnBorderLeft; // left page margin + sal_Int32 mnBorderUpper; // top page margin + sal_Int32 mnBorderRight; // right page margin + sal_Int32 mnBorderLower; // bottom page margin + + std::unique_ptr mpLayerAdmin; + std::unique_ptr mpSdrPageProperties; + css::uno::Reference< css::uno::XInterface > mxUnoPage; + +public: + SdrPageProperties& getSdrPageProperties(); + const SdrPageProperties& getSdrPageProperties() const; + const SdrPageProperties* getCorrectSdrPageProperties() const; + +protected: + // new MasterPageDescriptorVector + std::unique_ptr mpMasterPageDescriptor; + + sal_uInt16 nPageNum; + + bool mbMaster : 1; // flag if this is a MasterPage + bool mbInserted : 1; + bool mbObjectsNotPersistent : 1; + + // #i93597# + bool mbPageBorderOnlyLeftRight : 1; + + void SetUnoPage(css::uno::Reference const&); + virtual css::uno::Reference< css::uno::XInterface > createUnoPage(); + + // Copying of pages is split into two parts: construction and copying of page objects, + // because the copying might need access to fully initialized page. CloneSdrPage() is responsible + // to call lateInit() after copy-construction of a new object. Any initialization in derived + // classes that needs access to the page objects must be deferred to lateInit. And it must + // call lateInit() of its parent class. + void lateInit(const SdrPage& rSrcPage); + +public: + explicit SdrPage(SdrModel& rModel, bool bMasterPage=false); + virtual ~SdrPage() override; + + virtual SdrPage* CloneSdrPage(SdrModel& rTargetModel) const; + bool IsMasterPage() const { return mbMaster; } + void SetInserted(bool bNew = true); + bool IsInserted() const { return mbInserted; } + void SetChanged(); + + // derived from SdrObjList, returns this + virtual SdrPage* getSdrPageFromSdrObjList() const override; + + // #i68775# React on PageNum changes (from Model in most cases) + void SetPageNum(sal_uInt16 nNew); + sal_uInt16 GetPageNum() const; + + // #i93597# Allow page border definition to not be the full rectangle but to + // use only the left and right vertical edges (reportdesigner) + void setPageBorderOnlyLeftRight(bool bNew) { mbPageBorderOnlyLeftRight = bNew; } + bool getPageBorderOnlyLeftRight() const { return mbPageBorderOnlyLeftRight; } + + virtual void SetSize(const Size& aSiz); + Size GetSize() const; + virtual void SetOrientation(Orientation eOri); + virtual Orientation GetOrientation() const; + sal_Int32 GetWidth() const; + sal_Int32 GetHeight() const; + virtual void SetBorder(sal_Int32 nLft, sal_Int32 nUpp, sal_Int32 nRgt, sal_Int32 Lwr); + virtual void SetLeftBorder(sal_Int32 nBorder); + virtual void SetUpperBorder(sal_Int32 nBorder); + virtual void SetRightBorder(sal_Int32 nBorder); + virtual void SetLowerBorder(sal_Int32 nBorder); + sal_Int32 GetLeftBorder() const; + sal_Int32 GetUpperBorder() const; + sal_Int32 GetRightBorder() const; + sal_Int32 GetLowerBorder() const; + + // New MasterPage interface + bool TRG_HasMasterPage() const { return (nullptr != mpMasterPageDescriptor); } + void TRG_SetMasterPage(SdrPage& rNew); + void TRG_ClearMasterPage(); + SdrPage& TRG_GetMasterPage() const; + const SdrLayerIDSet& TRG_GetMasterPageVisibleLayers() const; + void TRG_SetMasterPageVisibleLayers(const SdrLayerIDSet& rNew); + sdr::contact::ViewContact& TRG_GetMasterPageDescriptorViewContact() const; + + void MakePageObjectsNamesUnique(); + +protected: + void TRG_ImpMasterPageRemoved(const SdrPage& rRemovedPage); +public: + + /// changing the layers does not set the modified-flag! + const SdrLayerAdmin& GetLayerAdmin() const; + SdrLayerAdmin& GetLayerAdmin(); + + virtual OUString GetLayoutName() const; + + /// for snap-to-grid in Writer, also for AlignObjects if 1 object is marked + /// if pRect != null, then the pages that are intersected by this Rect, + /// otherwise the visible pages + virtual const SdrPageGridFrameList* GetGridFrameList(const SdrPageView* pPV, const tools::Rectangle* pRect) const; + + css::uno::Reference< css::uno::XInterface > const & getUnoPage(); + + virtual SfxStyleSheet* GetTextStyleSheetForObject( SdrObject* pObj ) const; + + /** *deprecated* returns an averaged background color of this page */ + // #i75566# GetBackgroundColor -> GetPageBackgroundColor + Color GetPageBackgroundColor() const; + + /** *deprecated* returns an averaged background color of this page */ + // #i75566# GetBackgroundColor -> GetPageBackgroundColor and bScreenDisplay hint value + Color GetPageBackgroundColor( SdrPageView const * pView, bool bScreenDisplay = true) const; + + /** this method returns true if the object from the ViewObjectContact should + be visible on this page while rendering. + bEdit selects if visibility test is for an editing view or a final render, + like printing. + */ + virtual bool checkVisibility( + const sdr::contact::ViewObjectContact& rOriginal, + const sdr::contact::DisplayInfo& rDisplayInfo, + bool bEdit ); +}; + + +#endif // INCLUDED_SVX_SVDPAGE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdpagv.hxx b/include/svx/svdpagv.hxx new file mode 100644 index 000000000..6d703d5c6 --- /dev/null +++ b/include/svx/svdpagv.hxx @@ -0,0 +1,262 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVDPAGV_HXX +#define INCLUDED_SVX_SVDPAGV_HXX + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + + +namespace vcl { class Region; } +class SdrObjList; +class SdrObject; +class SdrPage; +class SdrUnoObj; +class SdrPaintWindow; +class SdrView; +class SdrPageObj; +class SdrPageView; + +namespace sdr +{ + namespace contact + { + class ViewObjectContactRedirector; + class DisplayInfo; + class ViewObjectContactRedirector; + } // end of namespace contact +} // end of namespace sdr + +// typedefs for a list of SdrPageWindow +class SdrPageWindow; + + +class SVXCORE_DLLPUBLIC SdrPageView +{ +private: + SdrView& mrView; + SdrPage* mpPage; + Point aPgOrg; // The Page's point of origin + + tools::Rectangle aMarkBound; + tools::Rectangle aMarkSnap; + bool mbHasMarked; + bool mbVisible; + + SdrLayerIDSet aLayerVisi; // Set of visible Layers + SdrLayerIDSet aLayerLock; // Set of non-editable Layers + SdrLayerIDSet aLayerPrn; // Set of printable Layers + + SdrObjList* pCurrentList; // Current List, usually the Page + SdrObject* pCurrentGroup; // Current Group; nullptr means none + + SdrHelpLineList aHelpLines; // Helper lines and points + + // #103911# Use one reserved slot (bReserveBool2) for the document color + Color maDocumentColor; + + // #103834# Use one reserved slot (bReserveBool1) for the background color + Color maBackgroundColor; + + std::vector< std::unique_ptr > maPageWindows; + + // #i72752# member to remember with which SdrPageWindow the BeginDrawLayer + // was done + SdrPageWindow* mpPreparedPageWindow; + +public: + sal_uInt32 PageWindowCount() const { return maPageWindows.size(); } + SdrPageWindow* FindPageWindow( SdrPaintWindow& rPaintWindow ) const; + SdrPageWindow* FindPageWindow( const OutputDevice& rOutDev ) const; + SdrPageWindow* GetPageWindow(sal_uInt32 nIndex) const; + + /** + * Finds the page window whose PaintWindow belongs to the given output device + * In opposite to FindPageWindow, this method also cares possibly patched PaintWindow instances. + * That is, a SdrPageWindow might have an original, and a patched SdrPaintWindow instance - if + * this is the case, then the original SdrPaintWindow is examined before the patched one. + */ + const SdrPageWindow* FindPatchedPageWindow( const OutputDevice& rOutDev ) const; + +private: + void ImpInvalidateHelpLineArea(sal_uInt16 nNum) const; + + void SetLayer(const OUString& rName, SdrLayerIDSet& rBS, bool bJa); + bool IsLayer(const OUString& rName, const SdrLayerIDSet& rBS) const; + + /// Let's see if the current Group (pCurrentGroup) is still inserted + void CheckCurrentGroup(); + + void AdjHdl(); + +public: + SdrPageView(SdrPage* pPage1, SdrView& rNewView); + ~SdrPageView(); + + SdrPageView& operator=( SdrPageView const & ) = delete; // MSVC2017 workaround + SdrPageView( SdrPageView const & ) = delete; // MSVC2017 workaround + + + /// Is called by PaintView, when modal changes have finished + void ModelHasChanged(); + + void Show(); + void Hide(); + + void AddPaintWindowToPageView(SdrPaintWindow& rPaintWindow); + void RemovePaintWindowFromPageView(SdrPaintWindow& rPaintWindow); + + SdrView& GetView() { return mrView; } + const SdrView& GetView() const { return mrView; } + + /** + * Looks up the control container belonging to given output device + * @return + * If the given output device belongs to one of the SdrPageViewWinRecs associated with this + * SdrPageView instance, the XControlContainer for this output device is returned, + * otherwise. + */ + css::uno::Reference< css::awt::XControlContainer > + GetControlContainer( const OutputDevice& _rDevice ) const; + + /// Sets all elements in the view which support a design and an alive mode into the given mode + void SetDesignMode( bool _bDesignMode ) const; + + bool IsVisible() const { return mbVisible; } + + /// Invalidates the Page's whole area + void InvalidateAllWin(); + + /// PrePaint call forwarded from app windows + void PrePaint(); + + /// @param rReg refers to the OutDev and not to the Page + void CompleteRedraw( SdrPaintWindow& rPaintWindow, const vcl::Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector ); + + /// Write access to mpPreparedPageWindow + void setPreparedPageWindow(SdrPageWindow* pKnownTarget); + + void DrawLayer(SdrLayerID nID, OutputDevice* pGivenTarget, sdr::contact::ViewObjectContactRedirector* pRedirector = nullptr, + const tools::Rectangle& rRect = tools::Rectangle(), + basegfx::B2IRectangle const* pPageFrame = nullptr); + void DrawPageViewGrid(OutputDevice& rOut, const tools::Rectangle& rRect, Color aColor = COL_BLACK ); + + tools::Rectangle GetPageRect() const; + SdrPage* GetPage() const { return mpPage; } + + /// Return current List + SdrObjList* GetObjList() const { return pCurrentList; } + + /// Return current Group + SdrObject* GetCurrentGroup() const { return pCurrentGroup; } + + /// Set current Group and List + void SetCurrentGroupAndList(SdrObject* pNewGroup, SdrObjList* pNewList); + + bool HasMarkedObjPageView() const { return mbHasMarked; } + void SetHasMarkedObj(bool bOn) { mbHasMarked = bOn; } + + const tools::Rectangle& MarkBound() const { return aMarkBound; } + const tools::Rectangle& MarkSnap() const { return aMarkSnap; } + tools::Rectangle& MarkBound() { return aMarkBound; } + tools::Rectangle& MarkSnap() { return aMarkSnap; } + + void SetLayerVisible(const OUString& rName, bool bShow) { + SetLayer(rName, aLayerVisi, bShow); + if(!bShow) AdjHdl(); + InvalidateAllWin(); + } + bool IsLayerVisible(const OUString& rName) const { return IsLayer(rName, aLayerVisi); } + + void SetLayerLocked(const OUString& rName, bool bLock) { SetLayer(rName, aLayerLock, bLock); if(bLock) AdjHdl(); } + bool IsLayerLocked(const OUString& rName) const { return IsLayer(rName,aLayerLock); } + + void SetLayerPrintable(const OUString& rName, bool bPrn) { SetLayer(rName, aLayerPrn, bPrn); } + bool IsLayerPrintable(const OUString& rName) const { return IsLayer(rName, aLayerPrn); } + + /// PV represents a RefPage or a SubList of a RefObj, or the Model is ReadOnly + bool IsReadOnly() const; + + /// The Origin always refers to the upper left corner of the Page + const Point& GetPageOrigin() const { return aPgOrg; } + void SetPageOrigin(const Point& rOrg); + + void LogicToPagePos(Point& rPnt) const { rPnt-=aPgOrg; } + void LogicToPagePos(tools::Rectangle& rRect) const { rRect.Move(-aPgOrg.X(),-aPgOrg.Y()); } + void PagePosToLogic(Point& rPnt) const { rPnt+=aPgOrg; } + + void SetVisibleLayers(const SdrLayerIDSet& rSet) { aLayerVisi=rSet; } + const SdrLayerIDSet& GetVisibleLayers() const { return aLayerVisi; } + void SetPrintableLayers(const SdrLayerIDSet& rSet) { aLayerPrn=rSet; } + const SdrLayerIDSet& GetPrintableLayers() const { return aLayerPrn; } + void SetLockedLayers(const SdrLayerIDSet& rSet) { aLayerLock=rSet; } + const SdrLayerIDSet& GetLockedLayers() const { return aLayerLock; } + + const SdrHelpLineList& GetHelpLines() const { return aHelpLines; } + void SetHelpLines(const SdrHelpLineList& rHLL); + //void SetHelpLinePos(sal_uInt16 nNum, const Point& rNewPos); + void SetHelpLine(sal_uInt16 nNum, const SdrHelpLine& rNewHelpLine); + void DeleteHelpLine(sal_uInt16 nNum); + void InsertHelpLine(const SdrHelpLine& rHL); + + /// At least one member must be visible for the Group object and + /// it must not be locked + /// @returns + /// true, if the object's layer is visible and not locked + bool IsObjMarkable(SdrObject const * pObj) const; + + /// Entering (editing) an object group + /// After that, we have direct access to all member objects of the group. + /// All other objects are not editable in the meantime (until the next + /// LeaveGroup()) + bool EnterGroup(SdrObject* pObj); + + /// Leave an object group we entered previously + void LeaveOneGroup(); + + /// Leave all object groups we entered previously + void LeaveAllGroup(); + + /// Determine, how deep we descended (0 = Root(Page)) + sal_uInt16 GetEnteredLevel() const; + + // #103834# Set background color for svx at SdrPageViews + void SetApplicationBackgroundColor(Color aBackgroundColor); + + const Color& GetApplicationBackgroundColor() const { return maBackgroundColor;} + + // #103911# Set/Get document color for svx at SdrPageViews + void SetApplicationDocumentColor(Color aDocumentColor); + const Color& GetApplicationDocumentColor() const { return maDocumentColor;} +}; + + +#endif // INCLUDED_SVX_SVDPAGV_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdpntv.hxx b/include/svx/svdpntv.hxx new file mode 100644 index 000000000..3f899f529 --- /dev/null +++ b/include/svx/svdpntv.hxx @@ -0,0 +1,520 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVDPNTV_HXX +#define INCLUDED_SVX_SVDPNTV_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +// Pre defines +class SdrPageWindow; + +namespace com::sun::star::awt { + class XControlContainer; +} +namespace sdr::overlay { class OverlayManager; } + +class SdrPage; +class SdrView; +class SfxItemSet; +class SfxStyleSheet; +class SdrOle2Obj; +class SdrModel; +class SdrObject; +enum class GraphicManagerDrawFlags; + +namespace sdr::contact { + class ViewObjectContactRedirector; +} + + +// Defines for AnimationMode +enum class SdrAnimationMode +{ + Animate, + Disable +}; + + +class SdrPaintView; + +namespace sdr +{ + namespace contact + { + class ViewObjectContactRedirector; + } +} + + +class SvxViewChangedHint final : public SfxHint +{ +public: + explicit SvxViewChangedHint(); +}; + +class SdrPaintWindow; + +/** + * Helper to convert any GDIMetaFile to a good quality BitmapEx, + * using default parameters and graphic::XPrimitive2DRenderer + */ +BitmapEx convertMetafileToBitmapEx( + const GDIMetaFile& rMtf, + const basegfx::B2DRange& rTargetRange, + const sal_uInt32 nMaximumQuadraticPixels); + +//////////////////////////////////////////////////////////////////////////////////////////////////// +// +// SdrPaintView +// SdrSnapView +// SdrMarkView +// SdrEditView +// SdrPolyEditView +// SdrGlueEditView +// SdrObjEditView +// SdrExchangeView +// SdrDragView +// SdrCreateView +// SdrView +// DlgEdView +// GraphCtrlView +// E3dView +// DrawViewWrapper +// FmFormView +// ScDrawView +// sd::View (may have more?) +// sd::DrawView +// SwDrawView +// OSectionView + +class SVXCORE_DLLPUBLIC SdrPaintView : public SfxListener, public SfxRepeatTarget, public SfxBroadcaster, public ::utl::ConfigurationListener +{ +private: + friend class SdrPageView; + friend class SdrGrafObj; + + // the SdrModel this view was created with, unchanged during lifetime + SdrModel& mrSdrModelFromSdrView; + + std::unique_ptr mpPageView; +protected: + SdrModel* mpModel; + VclPtr mpActualOutDev; // Only for comparison + VclPtr mpDragWin; + SfxStyleSheet* mpDefaultStyleSheet; + + OUString maActualLayer; // Current drawing layer + OUString maMeasureLayer; // Current layer for measurements + +// Container aPagV; // List of SdrPageViews + + // All windows this view is displayed on + std::vector< std::unique_ptr > maPaintWindows; + + Size maGridBig; // FIXME: We need to get rid of this eventually + Size maGridFin; // FIXME: We need to get rid of this eventually + SdrDragStat maDragStat; + tools::Rectangle maMaxWorkArea; + SfxItemSet maDefaultAttr; + Idle maComeBackIdle; + + SdrAnimationMode meAnimationMode; + + sal_uInt16 mnHitTolPix; + sal_uInt16 mnMinMovPix; + sal_uInt16 mnHitTolLog; + sal_uInt16 mnMinMovLog; + + // Hold an incarnation of Drawinglayer configuration options + SvtOptionsDrawinglayer maDrawinglayerOpt; + + bool mbPageVisible : 1; + bool mbPageShadowVisible : 1; + bool mbPageBorderVisible : 1; + bool mbBordVisible : 1; + bool mbGridVisible : 1; + bool mbGridFront : 1; + bool mbHlplVisible : 1; + bool mbHlplFront : 1; + bool mbGlueVisible : 1; // Persistent; show glue points + bool mbGlueVisible2 : 1; // Also show glue points for GluePointEdit + bool mbGlueVisible3 : 1; // Also show glue points for EdgeTool + bool mbGlueVisible4 : 1; // Show glue points, if one edge is selected + bool mbSomeObjChgdFlag : 1; + bool mbSwapAsynchron : 1; + bool mbPrintPreview : 1; + + // These bools manage, the status that is displayed + // + bool mbAnimationPause : 1; + + // Flag which decides if buffered output for this view is allowed. When + // set, PreRendering for PageView rendering will be used. Default is sal_False + bool mbBufferedOutputAllowed : 1; + + // Flag which decides if buffered overlay for this view is allowed. When + // set, the output will be buffered in an overlay vdev. When not, overlay is + // directly painted to OutDev. Default is sal_False. + bool mbBufferedOverlayAllowed : 1; + + // Allow page painting at all? + bool mbPagePaintingAllowed : 1; + + // Is this a preview renderer? + bool mbPreviewRenderer : 1; + + // Flags for calc and sw for suppressing OLE, CHART or DRAW objects + bool mbHideOle : 1; + bool mbHideChart : 1; + bool mbHideDraw : 1; // hide draw objects other than form controls + bool mbHideFormControl : 1; // hide form controls only + +public: + // Interface for PagePaintingAllowed flag + bool IsBufferedOutputAllowed() const; + void SetBufferedOutputAllowed(bool bNew); + + // Interface for BufferedOverlayAllowed flag + bool IsBufferedOverlayAllowed() const; + void SetBufferedOverlayAllowed(bool bNew); + + // Allow page painting at all? + bool IsPagePaintingAllowed() const { return mbPagePaintingAllowed;} + void SetPagePaintingAllowed(bool bNew); + + virtual rtl::Reference CreateOverlayManager(OutputDevice& rDevice) const; + +protected: + svtools::ColorConfig maColorConfig; + Color maGridColor; + + // Interface to SdrPaintWindow + void DeletePaintWindow(SdrPaintWindow& rOld); + void ConfigurationChanged( ::utl::ConfigurationBroadcaster*, ConfigurationHints ) override; + void InitOverlayManager(rtl::Reference xOverlayManager) const; + +public: + sal_uInt32 PaintWindowCount() const { return maPaintWindows.size(); } + SdrPaintWindow* FindPaintWindow(const OutputDevice& rOut) const; + SdrPaintWindow* GetPaintWindow(sal_uInt32 nIndex) const; + // Replacement for GetWin(0), may return 0L (!) + OutputDevice* GetFirstOutputDevice() const; + +private: + SVX_DLLPRIVATE void ImpClearVars(); + DECL_LINK(ImpComeBackHdl, Timer*, void); + +protected: + sal_uInt16 ImpGetMinMovLogic(short nMinMov, const OutputDevice* pOut) const; + sal_uInt16 ImpGetHitTolLogic(short nHitTol, const OutputDevice* pOut) const; + + // If one does not want to wait for the IdleState of the system (cheated as const) + void FlushComeBackTimer() const; + void TheresNewMapMode(); + void ImpSetGlueVisible2(bool bOn) { if (mbGlueVisible2!=bOn) { mbGlueVisible2=bOn; if (!mbGlueVisible && !mbGlueVisible3 && !mbGlueVisible4) GlueInvalidate(); } } + void ImpSetGlueVisible3(bool bOn) { if (mbGlueVisible3!=bOn) { mbGlueVisible3=bOn; if (!mbGlueVisible && !mbGlueVisible2 && !mbGlueVisible4) GlueInvalidate(); } } + void ImpSetGlueVisible4(bool bOn) { if (mbGlueVisible4!=bOn) { mbGlueVisible4=bOn; if (!mbGlueVisible && !mbGlueVisible2 && !mbGlueVisible3) GlueInvalidate(); } } + +public: + bool ImpIsGlueVisible() { return mbGlueVisible || mbGlueVisible2 || mbGlueVisible3 || mbGlueVisible4; } + +protected: + virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override; + void GlueInvalidate() const; + + // ModelHasChanged is called, as soon as the system is idle again after many SdrHintKind::ObjectChange. + // + // Any sub-class override this method, MUST call the base class' ModelHasChanged() method + virtual void ModelHasChanged(); + + // #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView + // A SdrView always needs a SdrModel for lifetime (Pool, ...) + SdrPaintView(SdrModel& rSdrModel, OutputDevice* pOut); + virtual ~SdrPaintView() override; + +public: + // SdrModel access on SdrView level + SdrModel& getSdrModelFromSdrView() const { return mrSdrModelFromSdrView; } + + virtual void ClearPageView(); + SdrModel* GetModel() const { return mpModel; } + + virtual bool IsAction() const; + virtual void MovAction(const Point& rPnt); + virtual void EndAction(); + virtual void BckAction(); + virtual void BrkAction(); // Cancel all Actions (e.g. cancel dragging) + virtual void TakeActionRect(tools::Rectangle& rRect) const; + + // Info about TextEdit. Default is sal_False. + virtual bool IsTextEdit() const; + + // Must be called for every Window change as well as MapMode (Scaling) change: + // If the SdrView is shown in multiple windows at the same time (e.g. + // using the split pane), so that I can convert my pixel values to logical + // values. + void SetActualWin(const OutputDevice* pWin); + void SetMinMoveDistancePixel(sal_uInt16 nVal) { mnMinMovPix=nVal; TheresNewMapMode(); } + void SetHitTolerancePixel(sal_uInt16 nVal) { mnHitTolPix=nVal; TheresNewMapMode(); } + sal_uInt16 GetHitTolerancePixel() const { return mnHitTolPix; } + + // Data read access on logic HitTolerance and MinMoveTolerance + sal_uInt16 getHitTolLog() const { return mnHitTolLog; } + + // Using the DragState we can tell e.g. which distance was + // already dragged + const SdrDragStat& GetDragStat() const { return maDragStat; } + + // Registering/de-registering a PageView at a View + // + // The same Page cannot be registered multiple times. + // + // Methods ending in PgNum expect being passed a Page number. + // Methods ending in PvNum, instead, expect the number of the + // PageView at the SdrView (iterating over all registered Pages). + virtual SdrPageView* ShowSdrPage(SdrPage* pPage); + virtual void HideSdrPage(); + + // Iterate over all registered PageViews + SdrPageView* GetSdrPageView() const { return mpPageView.get(); } + + // A SdrView can be displayed on multiple Windows at the same time + virtual void AddWindowToPaintView(OutputDevice* pNewWin, vcl::Window* pWindow); + virtual void DeleteWindowFromPaintView(OutputDevice* pOldWin); + + void SetLayerVisible(const OUString& rName, bool bShow); + bool IsLayerVisible(const OUString& rName) const; + + void SetLayerLocked(const OUString& rName, bool bLock=true); + bool IsLayerLocked(const OUString& rName) const; + + void SetLayerPrintable(const OUString& rName, bool bPrn); + bool IsLayerPrintable(const OUString& rName) const; + + // PrePaint call forwarded from app windows + void PrePaint(); + + + // Used internally for Draw/Impress/sch/chart2 + virtual void CompleteRedraw(OutputDevice* pOut, const vcl::Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = nullptr); + + // #i72889# used from CompleteRedraw() implementation internally, added to be able to do a complete redraw in single steps + + // BeginCompleteRedraw returns (or even creates) a SdrPaintWindow which will then be used as the + // target for paints. Since paints may be buffered, use its GetTargetOutputDevice() method which will + // return the buffer in case it's buffered. + // + // DoCompleteRedraw then draws the DrawingLayer hierarchy + // EndCompleteRedraw does the necessary refreshes, paints text edit and overlay as well as destroys the + // SdrPaintWindow again, if needed. + // This means: the SdrPaintWindow is no longer safe after this closing call. + virtual SdrPaintWindow* BeginCompleteRedraw(OutputDevice* pOut); + void DoCompleteRedraw(SdrPaintWindow& rPaintWindow, const vcl::Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = nullptr); + virtual void EndCompleteRedraw(SdrPaintWindow& rPaintWindow, bool bPaintFormLayer); + + + // Used for the other applications basctl/sc/sw which call DrawLayer at PageViews + // #i74769# Interface change to use common BeginCompleteRedraw/EndCompleteRedraw + // #i76114# bDisableIntersect disables intersecting rReg with the Window's paint region + SdrPaintWindow* BeginDrawLayers(OutputDevice* pOut, const vcl::Region& rReg, bool bDisableIntersect = false); + + // Used when the region passed to BeginDrawLayers needs to be changed + void UpdateDrawLayersRegion(OutputDevice* pOut, const vcl::Region& rReg); + void EndDrawLayers(SdrPaintWindow& rPaintWindow, bool bPaintFormLayer); + +protected: + + // Used to paint the form layer after the PreRender device is flushed (painted) to the window. + void ImpFormLayerDrawing( SdrPaintWindow& rPaintWindow ); + + static vcl::Region OptimizeDrawLayersRegion(OutputDevice* pOut, const vcl::Region& rReg, bool bDisableIntersect); + +public: + /// Draw Page as a white area or not + bool IsPageVisible() const { return mbPageVisible; } + + /// Draw Page shadow or not + bool IsPageShadowVisible() const { return mbPageShadowVisible; } + + /// Draw Page as a white area or not + bool IsPageBorderVisible() const { return mbPageBorderVisible; } + + /// Draw Border line or not + bool IsBordVisible() const { return mbBordVisible; } + + /// Draw Grid or not + bool IsGridVisible() const { return mbGridVisible; } + + /// Draw Grid in front of objects or behind them + bool IsGridFront() const { return mbGridFront ; } + + /// Draw Help line of the Page or not + bool IsHlplVisible() const { return mbHlplVisible; } + + /// Draw Help line in front of the objects or behind them + bool IsHlplFront() const { return mbHlplFront ; } + + const Color& GetGridColor() const { return maGridColor;} + void SetPageVisible(bool bOn = true) { mbPageVisible=bOn; InvalidateAllWin(); } + void SetPageShadowVisible(bool bOn) { mbPageShadowVisible=bOn; InvalidateAllWin(); } + void SetPageBorderVisible(bool bOn = true) { mbPageBorderVisible=bOn; InvalidateAllWin(); } + void SetBordVisible(bool bOn = true) { mbBordVisible=bOn; InvalidateAllWin(); } + void SetGridVisible(bool bOn) { mbGridVisible=bOn; InvalidateAllWin(); } + void SetGridFront(bool bOn) { mbGridFront =bOn; InvalidateAllWin(); } + void SetHlplVisible(bool bOn = true) { mbHlplVisible=bOn; InvalidateAllWin(); } + void SetHlplFront(bool bOn) { mbHlplFront =bOn; InvalidateAllWin(); } + void SetGlueVisible(bool bOn = true) { if (mbGlueVisible!=bOn) { mbGlueVisible=bOn; if (!mbGlueVisible2 && !mbGlueVisible3 && !mbGlueVisible4) GlueInvalidate(); } } + + bool IsPreviewRenderer() const { return mbPreviewRenderer; } + void SetPreviewRenderer(bool bOn) { mbPreviewRenderer=bOn; } + + // Access methods for calc and sw hide object modes + bool getHideOle() const { return mbHideOle; } + bool getHideChart() const { return mbHideChart; } + bool getHideDraw() const { return mbHideDraw; } + bool getHideFormControl() const { return mbHideFormControl; } + void setHideOle(bool bNew) { if(bNew != mbHideOle) mbHideOle = bNew; } + void setHideChart(bool bNew) { if(bNew != mbHideChart) mbHideChart = bNew; } + void setHideDraw(bool bNew) { if(bNew != mbHideDraw) mbHideDraw = bNew; } + void setHideFormControl(bool bNew) { if(bNew != mbHideFormControl) mbHideFormControl = bNew; } + + void SetGridCoarse(const Size& rSiz) { maGridBig=rSiz; } + void SetGridFine(const Size& rSiz) { + maGridFin=rSiz; + if (maGridFin.Height()==0) maGridFin.setHeight(maGridFin.Width()); + if (mbGridVisible) InvalidateAllWin(); + } + const Size& GetGridCoarse() const { return maGridBig; } + const Size& GetGridFine() const { return maGridFin; } + + void InvalidateAllWin(); + void InvalidateAllWin(const tools::Rectangle& rRect); + + /// If the View should not call Invalidate() on the windows, override + /// the following 2 methods and do something else. + virtual void InvalidateOneWin(OutputDevice& rWin); + virtual void InvalidateOneWin(OutputDevice& rWin, const tools::Rectangle& rRect); + + void SetActiveLayer(const OUString& rName) { maActualLayer=rName; } + const OUString& GetActiveLayer() const { return maActualLayer; } + + /// Leave an object group of all visible Pages (like `chdir ..` in MS-DOS) + void LeaveOneGroup(); + + /// Leave all entered object groups of all visible Pages (like `chdir \` in MS-DOS) + void LeaveAllGroup(); + + /// Determine, whether Leave is useful or not + bool IsGroupEntered() const; + + /// Default attributes at the View + /// Newly created objects are assigned these attributes by default when they are created. + void SetDefaultAttr(const SfxItemSet& rAttr, bool bReplaceAll); + const SfxItemSet& GetDefaultAttr() const { return maDefaultAttr; } + void SetDefaultStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr); + + void SetNotPersistDefaultAttr(const SfxItemSet& rAttr); + void MergeNotPersistDefaultAttr(SfxItemSet& rAttr) const; + + /// Execute a swap-in of e.g. graphics asynchronously. + /// This does not reload all graphics like Paint does, but kicks off + /// the loading there. When such an object is done loading, it is displayed. + /// TODO: Only works at the moment, if SwapGraphics is enabled in the model. + /// The default = false flag is non-persistent + bool IsSwapAsynchron() const { return mbSwapAsynchron; } + void SetSwapAsynchron(bool bJa=true) { mbSwapAsynchron=bJa; } + virtual bool KeyInput(const KeyEvent& rKEvt, vcl::Window* pWin); + + virtual bool MouseButtonDown(const MouseEvent& /*rMEvt*/, OutputDevice* /*pWin*/) { return false; } + virtual bool MouseButtonUp(const MouseEvent& /*rMEvt*/, OutputDevice* /*pWin*/) { return false; } + virtual bool MouseMove(const MouseEvent& /*rMEvt*/, OutputDevice* /*pWin*/) { return false; } + virtual bool RequestHelp(const HelpEvent& /*rHEvt*/) { return false; } + virtual bool Command(const CommandEvent& /*rCEvt*/, vcl::Window* /*pWin*/) { return false; } + + void GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr) const; + + void SetAttributes(const SfxItemSet& rSet, bool bReplaceAll); + SfxStyleSheet* GetStyleSheet() const; // SfxStyleSheet* GetStyleSheet(bool& rOk) const; + void SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr); + + virtual void MakeVisible(const tools::Rectangle& rRect, vcl::Window& rWin); + + /// For Plugins + /// Is called by the Paint of the OLE object + virtual void DoConnect(SdrOle2Obj* pOleObj); + + /// Enable/disable animations for ::Paint + /// Is used by e.g. SdrGrafObj, if it contains an animation + /// Preventing automatic animation is needed for e.g. the presentation view + bool IsAnimationEnabled() const { return ( SdrAnimationMode::Animate == meAnimationMode ); } + void SetAnimationEnabled( bool bEnable=true ); + + /// Set/unset pause state for animations + void SetAnimationPause( bool bSet ); + + /// Mode when starting an animation in the Paint Handler: + /// 1. SdrAnimationMode::Animate (default): start animation normally + /// 2. SDR_ANIMATION_DONT_ANIMATE: only show the replacement picture + /// 3. SdrAnimationMode::Disable: don't start and don't show any replacement + void SetAnimationMode( const SdrAnimationMode eMode ); + + /// Must be called by the App when scrolling etc. in order for + /// an active FormControl to be moved too + void VisAreaChanged(const OutputDevice* pOut); + void VisAreaChanged(); + + bool IsPrintPreview() const { return mbPrintPreview; } + void SetPrintPreview(bool bOn = true) { mbPrintPreview=bOn; } + + const svtools::ColorConfig& getColorConfig() const { return maColorConfig;} + + void onChangeColorConfig(); + + // #103834# Set background color for svx at SdrPageViews + void SetApplicationBackgroundColor(Color aBackgroundColor); + + // #103911# Set document color for svx at SdrPageViews + void SetApplicationDocumentColor(Color aDocumentColor); + + // #i38135# + // Sets the timer for Object animations and restarts. + void SetAnimationTimer(sal_uInt32 nTime); + + // Access to Drawinglayer configuration options + const SvtOptionsDrawinglayer& getOptionsDrawinglayer() const { return maDrawinglayerOpt; } +}; + +#endif // INCLUDED_SVX_SVDPNTV_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdpoev.hxx b/include/svx/svdpoev.hxx new file mode 100644 index 000000000..171baf536 --- /dev/null +++ b/include/svx/svdpoev.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_SVX_SVDPOEV_HXX +#define INCLUDED_SVX_SVDPOEV_HXX + +#include +#include + +#include + +class SVXCORE_DLLPUBLIC SdrPolyEditView : public SdrEditView, public IPolyPolygonEditorController +{ + friend class SdrEditView; + + bool bSetMarkedPointsSmoothPossible : 1; + bool bSetMarkedSegmentsKindPossible : 1; + + SdrPathSmoothKind eMarkedPointsSmooth; + SdrPathSegmentKind eMarkedSegmentsKind; + +private: + SVX_DLLPRIVATE void ImpResetPolyPossibilityFlags(); + SVX_DLLPRIVATE void ImpCheckPolyPossibilities(); + + typedef void (*PPolyTrFunc)(Point&, Point*, Point*, const void*, const void*, const void*, const void*); + SVX_DLLPRIVATE void ImpTransformMarkedPoints(PPolyTrFunc pTrFunc, const void* p1, const void* p2=nullptr, const void* p3=nullptr, const void* p4=nullptr); + +protected: + // #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView + SdrPolyEditView( + SdrModel& rSdrModel, + OutputDevice* pOut); + + virtual ~SdrPolyEditView() override; + +public: + bool IsSetMarkedPointsSmoothPossible() const override; + SdrPathSmoothKind GetMarkedPointsSmooth() const override; + void SetMarkedPointsSmooth(SdrPathSmoothKind eKind) override; + + // A PolySegment can either be a segment or a Bézier curve + bool IsSetMarkedSegmentsKindPossible() const override; + SdrPathSegmentKind GetMarkedSegmentsKind() const override; + void SetMarkedSegmentsKind(SdrPathSegmentKind eKind) override; + + // Probably Obj has been deleted afterwards + void DeleteMarkedPoints() override; + bool IsDeleteMarkedPointsPossible() const override; + + void MoveMarkedPoints(const Size& rSiz); + void ResizeMarkedPoints(const Point& rRef, const Fraction& xFact, const Fraction& yFact); + void RotateMarkedPoints(const Point& rRef, long nAngle); + + // This probably creates an arbitrary amount of new objects + void RipUpAtMarkedPoints() override; + bool IsRipUpAtMarkedPointsPossible() const override; + + // All marked Polylines are turned into polygons + // All open Bézier curves are turned into closed ones + bool IsOpenCloseMarkedObjectsPossible() const override; + SdrObjClosedKind GetMarkedObjectsClosedState() const override; + + void CheckPolyPossibilitiesHelper( SdrMark* pM, bool& b1stSmooth, bool& b1stSegm, bool& bCurve, bool& bSmoothFuz, bool& bSegmFuz, basegfx::B2VectorContinuity& eSmooth ); +}; + +#endif // INCLUDED_SVX_SVDPOEV_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdpool.hxx b/include/svx/svdpool.hxx new file mode 100644 index 000000000..54847e568 --- /dev/null +++ b/include/svx/svdpool.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_SVX_SVDPOOL_HXX +#define INCLUDED_SVX_SVDPOOL_HXX + +#include +#include + +class XLineAttrSetItem; +class XFillAttrSetItem; + + +class SVXCORE_DLLPUBLIC SdrItemPool final : public XOutdevItemPool +{ +public: + SdrItemPool(SfxItemPool* pMaster = nullptr); + SdrItemPool(const SdrItemPool& rPool); +private: + virtual ~SdrItemPool() override; +public: + + virtual SdrItemPool* Clone() const override; + virtual bool GetPresentation(const SfxPoolItem& rItem, + MapUnit ePresentationMetric, + OUString& rText, + const IntlWrapper& rIntlWrapper) const override; + + static OUString GetItemName(sal_uInt16 nWhich); +}; + +#endif // INCLUDED_SVX_SVDPOOL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdsnpv.hxx b/include/svx/svdsnpv.hxx new file mode 100644 index 000000000..89dc40d6a --- /dev/null +++ b/include/svx/svdsnpv.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_SVX_SVDSNPV_HXX +#define INCLUDED_SVX_SVDSNPV_HXX + +#include +#include +#include +#include + +/** + * Definition: + * - snap something means e.g. the mouse pointer or some marked objects in drag can be snapped + * - snap on something means you can e.g. snap on the grid or on auxiliary lines + * + * + * Basically, we only catch visible elements (borders, helper lines, connectors), + * with the exception of the grid. Likewise, we can only catch visible elements (i.e. connectors). + * We only catch on the grid, if nothing else is close by (magnetic behaviour). + * + * The cursor which is used during creation of objects, while dragging polygon points + * etc. (i.e. the mouse cursor) is always caught on all enabled catch alternatives (max 6). + * + * This is different, when moving selected objects. Instead of one mouse cursor, there are + * four alternatives, which can be caught at the selected objects: + * 1. the logically enclosing frame of every single object + * 2. the logically enclosing frame of all selected objects + * 3. highlighted points of all selected objects (polygon points, ...) + * 4. the connectors of the selected objects + * + * As the first and second case exclude each other (the second is a refinement of the first one) + * three alternatives remain, which are independent from each other. For 6 possible values for the + * caught ones, we would end up with max. 18 different possible combinations! + * + * Therefore, we introduce the following simplifications: + * 1. Connectors only catch on connectors + * + * Only max. 2*5+1 = 11 combinations remain for MoveDrag: + * 1-3. enclosing frame on grid/border/helper lines + * 4. enclosing frame on highlighted object points + * 5. enclosing frame on enclosing frame + * 6-8. highlighted points on grid/border/helper lines + * 7. highlighted points on highlighted object points + * 8-10. highlighted points on enclosing frame + * 11. connectors on connectors + * + * We test for all of these possible 11 combinations in the MouseMove event in the DragMove + * and those with the least need of correction are carried out. + * + * In the Resize() etc. methods we only catch the logically enclosing frame of the highlighted objects. + */ + +/** Return value for SnapPos() method */ +enum class SdrSnap +{ + NOTSNAPPED = 0x00, + XSNAPPED = 0x01, + YSNAPPED = 0x02 +}; +namespace o3tl +{ + template<> struct typed_flags : is_typed_flags {}; +} + +// TODO SdrCrookMode::Stretch is not implemented yet! +enum class SdrCrookMode { + Rotate, + Slant, + Stretch +}; + + +// #114409#-1 Migrate PageOrigin +class ImplPageOriginOverlay; + +class SVXCORE_DLLPUBLIC SdrSnapView : public SdrPaintView +{ +protected: + // #114409#-1 Migrate PageOrigin + class ImplPageOriginOverlay* mpPageOriginOverlay; + + // #114409#-2 Migrate HelpLine + class ImplHelpLineOverlay* mpHelpLineOverlay; + + Size aMagnSiz; + Fraction aSnapWdtX; + Fraction aSnapWdtY; + + sal_uInt16 nMagnSizPix; + long nSnapAngle; + long nEliminatePolyPointLimitAngle; + + SdrCrookMode eCrookMode; + + bool bSnapEnab : 1; + bool bGridSnap : 1; + bool bBordSnap : 1; + bool bHlplSnap : 1; + bool bOFrmSnap : 1; + bool bOPntSnap : 1; + bool bOConSnap : 1; + bool bMoveSnapOnlyTopLeft : 1; // Special for dialogeditor + bool bOrtho : 1; + bool bBigOrtho : 1; + bool bAngleSnapEnab : 1; + bool bMoveOnlyDragging : 1; // only move objects while Resize/Rotate/... + bool bSlantButShear : 1; // use slant instead of shear + bool bCrookNoContortion : 1; // no contorsion while Crook + bool bEliminatePolyPoints : 1; + +protected: + // #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView + SdrSnapView( + SdrModel& rSdrModel, + OutputDevice* pOut); + + virtual ~SdrSnapView() override; + +public: + virtual bool IsAction() const override; + virtual void MovAction(const Point& rPnt) override; + virtual void EndAction() override; + virtual void BckAction() override; + virtual void BrkAction() override; // break actions for derived classes e.g. interrupt dragging. + virtual void TakeActionRect(tools::Rectangle& rRect) const override; + + void SetSnapGridWidth(const Fraction& rX, const Fraction& rY) { aSnapWdtX=rX; aSnapWdtY=rY; } + const Fraction& GetSnapGridWidthX() const { return aSnapWdtX; } + const Fraction& GetSnapGridWidthY() const { return aSnapWdtY; } + + void SetSnapMagnetic(const Size& rSiz) { if (rSiz!=aMagnSiz) { aMagnSiz=rSiz; } } + void SetSnapMagneticPixel(sal_uInt16 nPix) { nMagnSizPix=nPix; } + sal_uInt16 GetSnapMagneticPixel() const { return nMagnSizPix; } + + // RecalcLogicSnapMagnetic has to be called for every change of OutputDevices and every change of the MapMode! + void RecalcLogicSnapMagnetic(const OutputDevice& rOut) { SetSnapMagnetic(rOut.PixelToLogic(Size(nMagnSizPix,nMagnSizPix))); } + void SetActualWin(const OutputDevice* pWin) { SdrPaintView::SetActualWin(pWin); if (pWin!=nullptr) RecalcLogicSnapMagnetic(*pWin); } + + // Coordinates referred to the view! + // Returnvalues are SdrSnap::NOTSNAPPED,SdrSnap::XSNAPPED, + // SdrSnap::YSNAPPED or SdrSnap::XYSNAPPED + SdrSnap SnapPos(Point& rPnt, const SdrPageView* pPV) const; + Point GetSnapPos(const Point& rPnt, const SdrPageView* pPV) const; + void CheckSnap(const Point& rPt, long& nBestXSnap, long& nBestYSnap, bool& bXSnapped, bool& bYSnapped) const; + + // All attitudes to snap are persistent. + bool IsSnapEnabled() const { return bSnapEnab; } + bool IsGridSnap() const { return bGridSnap; } // Snap to grid + bool IsBordSnap() const { return bBordSnap; } // Snap to border + bool IsHlplSnap() const { return bHlplSnap; } // Snap to auxiliary line + bool IsOFrmSnap() const { return bOFrmSnap; } // Snap to LogFram from surrounding drawing objects + bool IsOPntSnap() const { return bOPntSnap; } // Snap to distinct points from surrounding drawing objects + bool IsOConSnap() const { return bOConSnap; } // Snap to connectors of the drawing objects + void SetSnapEnabled(bool bOn) { bSnapEnab=bOn; } + void SetGridSnap(bool bOn) { bGridSnap=bOn; } + void SetBordSnap(bool bOn) { bBordSnap=bOn; } + void SetHlplSnap(bool bOn) { bHlplSnap=bOn; } + void SetOFrmSnap(bool bOn) { bOFrmSnap=bOn; } + void SetOPntSnap(bool bOn) { bOPntSnap=bOn; } + void SetOConSnap(bool bOn) { bOConSnap=bOn; } + + // Usually every 4 corners of Object-SnapRects are snapped for Move-Dragging. + // The following attitudes e.g. if you only want to snap the left corner on the top (e.g. DialogEditor) + // persistent, Default=FALSE. + void SetMoveSnapOnlyTopLeft(bool bOn) { bMoveSnapOnlyTopLeft=bOn; } + bool IsMoveSnapOnlyTopLeft() const { return bMoveSnapOnlyTopLeft; } + + // #114409#-1 Migrate PageOrigin + void BegSetPageOrg(const Point& rPnt); + void MovSetPageOrg(const Point& rPnt); + void EndSetPageOrg(); + void BrkSetPageOrg(); + bool IsSetPageOrg() const { return (nullptr != mpPageOriginOverlay); } + + // HitTest. If sal_True, in rnHelpLineNum is the number of the auxiliary line and in rpPv + // the appended PageView. + bool PickHelpLine(const Point& rPnt, short nTol, const OutputDevice& rOut, sal_uInt16& rnHelpLineNum, SdrPageView*& rpPV) const; + + // Move of an available auxiliary line. Use nHelpLineNum and pPV from PickHelpLine. + bool BegDragHelpLine(sal_uInt16 nHelpLineNum, SdrPageView* pPV); + // interactive insertion of a new auxiliary line + void BegDragHelpLine(const Point& rPnt, SdrHelpLineKind eNewKind); + PointerStyle GetDraggedHelpLinePointer() const; + + // change the type of auxiliary line while dragging + // void SetDraggedHelpLineKind(SdrHelpLineKind eNewKind); + void MovDragHelpLine(const Point& rPnt); + bool EndDragHelpLine(); + void BrkDragHelpLine(); + bool IsDragHelpLine() const { return (nullptr != mpHelpLineOverlay); } + + // SnapAngle is for angles in circle, RotateDragging, ... + // The snapping of an angle is beared down, if it is switched off + // with SetAngleSnapEnabled(sal_False) + // The snapping angles is independent of snapping coordinates + // and so independent of the attitude IsSnapEnabled() + // Only values should be specified for them is applied: + // 36000 modulo nAngle = 0 + // Implemented for: + // - Rotate (Dragging) + // - Shear (Dragging) + // - circular arc/-sector/-section angle (Create and Dragging) + // persistent. + void SetAngleSnapEnabled(bool bOn) { bAngleSnapEnab=bOn; } + bool IsAngleSnapEnabled() const { return bAngleSnapEnab; } + void SetSnapAngle(long nAngle) { nSnapAngle=nAngle; } + long GetSnapAngle() const { return nSnapAngle; } + + // different effects from Ortho (depending on the context): + // - Create + // - only lines in 45deg grid + // - instead of rectangles squares are created + // - instead of ellipse circles are created + // - Dragging + // - general Dragging + // - Move only horizontal, vertical or 45deg + // - Resize proportional + // - Mirror: nothing + // - Shear without Resize + // - Crook without Resize + // - move handles + // - mirror axis only 45deg grid + // - object-specific Dragging + // - rectangle corner radius: nothing + // - circle object angle: nothing + // - line keeps while Dragging the angle and is only stretched/ contracted + // Default value for Ortho is off. persistent. + void SetOrtho(bool bOn) { bOrtho=bOn; } // incomplete + bool IsOrtho() const { return bOrtho; } + + // BigOrtho is only relevant if Ortho is switched on. + // Example: rectangle is created and ortho is switched on (--> square) + // and the Mouse was dragged from zero to the coordinates + // (80,30). Now there are 2 alternatives to determine the edge length + // of the square: 30 and 80. + // The standard Ortho-Function took 30 (every time the smaller length) + // If BigOrtho is switched on, you get a square with edge length of 80. + // The same also applies to Resize. + // Default value for BigOrtho is on. persistent. + void SetBigOrtho(bool bOn) { bBigOrtho=bOn; } + bool IsBigOrtho() const { return bBigOrtho; } + + // If MoveOnlyDragging=sal_True only the center of the marked objects is + // transformed when Resize/Rotate/Shear/Mirror/Crook is executed. + // Size, form and rotation angle of the objects are conserved only their positions + // are changed. persistent. Default=FALSE. (ni) + void SetMoveOnlyDragging(bool bOn) { bMoveOnlyDragging=bOn; } + bool IsMoveOnlyDragging() const { return bMoveOnlyDragging; } + + // Use Slant instead of Shear. persistent. Default=FALSE. + void SetSlantButShear(bool bOn) { bSlantButShear=bOn; } + bool IsSlantButShear() const { return bSlantButShear; } + + // Don't contort objecte while Crook. persistent. Default=FALSE. (ni) + void SetCrookNoContortion(bool bOn) { bCrookNoContortion=bOn; } + bool IsCrookNoContortion() const { return bCrookNoContortion; } + + // Crook-Mode. persistent. Default=SdrCrookMode::Rotate. (ni) + void SetCrookMode(SdrCrookMode eMode) { eCrookMode=eMode; } + SdrCrookMode GetCrookMode() const { return eCrookMode; } + + // Special for IBM: While Dragging of a traverse station, it is deleted + // if its adjacent lines are almost a solid line. + void SetEliminatePolyPoints(bool bOn) { bEliminatePolyPoints=bOn; } + bool IsEliminatePolyPoints() const { return bEliminatePolyPoints; } + void SetEliminatePolyPointLimitAngle(long nAngle) { nEliminatePolyPointLimitAngle=nAngle; } + long GetEliminatePolyPointLimitAngle() const { return nEliminatePolyPointLimitAngle; } +}; + +#endif // INCLUDED_SVX_SVDSNPV_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdsob.hxx b/include/svx/svdsob.hxx new file mode 100644 index 000000000..92725a329 --- /dev/null +++ b/include/svx/svdsob.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_SVX_SVDSOB_HXX +#define INCLUDED_SVX_SVDSOB_HXX + +#include + +#include +#include + + +/* + Stores a bitfield of the layer values that have been set. +*/ + +class SVXCORE_DLLPUBLIC SdrLayerIDSet final +{ + sal_uInt8 aData[32]; + +public: + explicit SdrLayerIDSet(bool bInitVal = false) + { + memset(aData, bInitVal ? 0xFF : 0x00, sizeof(aData)); + } + + bool operator!=(const SdrLayerIDSet& rCmpSet) const + { + return (memcmp(aData, rCmpSet.aData, sizeof(aData))!=0); + } + + void Set(SdrLayerID a) + { + aData[sal_uInt8(a)/8] |= 1 << (sal_uInt8(a) % 8); + } + + void Clear(SdrLayerID a) + { + aData[sal_uInt8(a)/8] &= ~(1 << (sal_uInt8(a) % 8)); + } + + void Set(SdrLayerID a, bool b) + { + if(b) + Set(a); + else + Clear(a); + } + + bool IsSet(SdrLayerID a) const + { + return (aData[sal_uInt8(a)/8] & 1< +#include +#include +#include + + +class OutlinerParaObject; +class SdrOutliner; +class SdrTextObj; +class SdrModel; +class SfxItemSet; +enum class OutlinerMode; + +namespace sdr::properties { + class TextProperties; +} + +/** This class stores information about one text inside a shape. +*/ + +class SfxStyleSheet; +class SVXCORE_DLLPUBLIC SdrText : public tools::WeakBase +{ +public: + explicit SdrText( SdrTextObj& rObject ); + virtual ~SdrText() override; + + void ForceOutlinerParaObject( OutlinerMode nOutlMode ); + + virtual void SetOutlinerParaObject( std::unique_ptr pTextObject ); + OutlinerParaObject* GetOutlinerParaObject() const; + + void CheckPortionInfo( SdrOutliner& rOutliner ); + void ReformatText(); + + // default uses GetObjectItemSet, but may be overridden to + // return a text-specific ItemSet + const SfxItemSet& GetItemSet() const; + + // This class does not need an own SdrModel reference - always + // has the SdrTextObj working with so can use SdrModel::getSdrModelFromSdrObject() + SdrTextObj& GetObject() const { return mrObject; } + + /** returns the current OutlinerParaObject and removes it from this instance */ + std::unique_ptr RemoveOutlinerParaObject(); + + void dumpAsXml(xmlTextWriterPtr pWriter) const; + +protected: + virtual const SfxItemSet& GetObjectItemSet(); + virtual SfxStyleSheet* GetStyleSheet() const; + +private: + std::unique_ptr mpOutlinerParaObject; + SdrTextObj& mrObject; + bool mbPortionInfoChecked; +}; + +#endif // INCLUDED_SVX_SVDTEXT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdtrans.hxx b/include/svx/svdtrans.hxx new file mode 100644 index 000000000..9e5bca9fd --- /dev/null +++ b/include/svx/svdtrans.hxx @@ -0,0 +1,302 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVDTRANS_HXX +#define INCLUDED_SVX_SVDTRANS_HXX + +#include +#include +#include +#include +#include +#include +#include +#include + +// The DrawingEngine's angles are specified in 1/100th degrees +// We need to convert these angles to radians, in order to be able +// to process them with trigonometric functions. +// This is done, using the constant F_PI18000. +// +// Example usage: +// nAngle ... is an angle in 1/100 Deg +// +// Which is converted, by this: +// double nSin=sin(nAngle*F_PI18000); +// +// To convert it back, we use division. + +// That maximum shear angle +#define SDRMAXSHEAR 8900 + +class XPolygon; +class XPolyPolygon; + +inline void MovePoly(tools::Polygon& rPoly, const Size& S) { rPoly.Move(S.Width(),S.Height()); } +void MoveXPoly(XPolygon& rPoly, const Size& S); + +SVXCORE_DLLPUBLIC void ResizeRect(tools::Rectangle& rRect, const Point& rRef, const Fraction& xFact, const Fraction& yFact); +inline void ResizePoint(Point& rPnt, const Point& rRef, const Fraction& xFract, const Fraction& yFract); +void ResizePoly(tools::Polygon& rPoly, const Point& rRef, const Fraction& xFact, const Fraction& yFact); +void ResizeXPoly(XPolygon& rPoly, const Point& rRef, const Fraction& xFact, const Fraction& yFact); + +inline void RotatePoint(Point& rPnt, const Point& rRef, double sn, double cs); +SVXCORE_DLLPUBLIC void RotatePoly(tools::Polygon& rPoly, const Point& rRef, double sn, double cs); +void RotateXPoly(XPolygon& rPoly, const Point& rRef, double sn, double cs); +void RotateXPoly(XPolyPolygon& rPoly, const Point& rRef, double sn, double cs); + +void MirrorPoint(Point& rPnt, const Point& rRef1, const Point& rRef2); +void MirrorXPoly(XPolygon& rPoly, const Point& rRef1, const Point& rRef2); + +inline void ShearPoint(Point& rPnt, const Point& rRef, double tn, bool bVShear = false); +SVXCORE_DLLPUBLIC void ShearPoly(tools::Polygon& rPoly, const Point& rRef, double tn); +void ShearXPoly(XPolygon& rPoly, const Point& rRef, double tn, bool bVShear = false); + +/** + * rPnt.X/rPnt.Y is set to rCenter.X or rCenter.Y! + * We then only need to rotate rPnt by rCenter. + * + * @return the returned angle is in rad + */ +inline double GetCrookAngle(Point& rPnt, const Point& rCenter, const Point& rRad, bool bVertical); + +/** + * The following methods accept a point of an XPolygon, whereas the neighbouring + * control points of the actual point are passed in pC1/pC2. + * Via rSin/rCos, sin(nAngle) and cos(nAngle) are returned. + * + * @return the returned angle is in rad + */ +double CrookRotateXPoint(Point& rPnt, Point* pC1, Point* pC2, const Point& rCenter, + const Point& rRad, double& rSin, double& rCos, bool bVert); +double CrookSlantXPoint(Point& rPnt, Point* pC1, Point* pC2, const Point& rCenter, + const Point& rRad, double& rSin, double& rCos, bool bVert); +double CrookStretchXPoint(Point& rPnt, Point* pC1, Point* pC2, const Point& rCenter, + const Point& rRad, double& rSin, double& rCos, bool bVert, + const tools::Rectangle& rRefRect); + +void CrookRotatePoly(XPolygon& rPoly, const Point& rCenter, const Point& rRad, bool bVert); +void CrookSlantPoly(XPolygon& rPoly, const Point& rCenter, const Point& rRad, bool bVert); +void CrookStretchPoly(XPolygon& rPoly, const Point& rCenter, const Point& rRad, bool bVert, const tools::Rectangle& rRefRect); + +void CrookRotatePoly(XPolyPolygon& rPoly, const Point& rCenter, const Point& rRad, bool bVert); +void CrookSlantPoly(XPolyPolygon& rPoly, const Point& rCenter, const Point& rRad, bool bVert); +void CrookStretchPoly(XPolyPolygon& rPoly, const Point& rCenter, const Point& rRad, bool bVert, const tools::Rectangle& rRefRect); + +/**************************************************************************************************/ +/* Inline */ +/**************************************************************************************************/ + +inline void ResizePoint(Point& rPnt, const Point& rRef, const Fraction& xFract, const Fraction& yFract) +{ + double nxFract = xFract.IsValid() ? static_cast(xFract) : 1.0; + double nyFract = yFract.IsValid() ? static_cast(yFract) : 1.0; + rPnt.setX(rRef.X() + FRound( (rPnt.X() - rRef.X()) * nxFract )); + rPnt.setY(rRef.Y() + FRound( (rPnt.Y() - rRef.Y()) * nyFract )); +} + +inline void RotatePoint(Point& rPnt, const Point& rRef, double sn, double cs) +{ + long dx=rPnt.X()-rRef.X(); + long dy=rPnt.Y()-rRef.Y(); + rPnt.setX(FRound(rRef.X()+dx*cs+dy*sn)); + rPnt.setY(FRound(rRef.Y()+dy*cs-dx*sn)); +} + +inline void ShearPoint(Point& rPnt, const Point& rRef, double tn, bool bVShear) +{ + if (!bVShear) { // Horizontal + if (rPnt.Y()!=rRef.Y()) { // else not needed + rPnt.AdjustX(-FRound((rPnt.Y()-rRef.Y())*tn)); + } + } else { // or else vertical + if (rPnt.X()!=rRef.X()) { // else not needed + rPnt.AdjustY(-FRound((rPnt.X()-rRef.X())*tn)); + } + } +} + +inline double GetCrookAngle(Point& rPnt, const Point& rCenter, const Point& rRad, bool bVertical) +{ + double nAngle; + if (bVertical) { + long dy=rPnt.Y()-rCenter.Y(); + nAngle=static_cast(dy)/static_cast(rRad.Y()); + rPnt.setY(rCenter.Y()); + } else { + long dx=rCenter.X()-rPnt.X(); + nAngle=static_cast(dx)/static_cast(rRad.X()); + rPnt.setX(rCenter.X()); + } + return nAngle; +} + +/**************************************************************************************************/ +/**************************************************************************************************/ + +/** + * The Y axis points down! + * The function negates the Y axis, when calculating the angle, such + * that GetAngle(Point(0,-1))=90 deg. + * GetAngle(Point(0,0)) returns 0. + * + * @return the returned value is in the range of -180.00..179.99 deg + * and is in 1/100 deg units + */ +SVXCORE_DLLPUBLIC long GetAngle(const Point& rPnt); + +long NormAngle18000(long a); /// Normalize angle to -180.00..179.99 + +SVXCORE_DLLPUBLIC long NormAngle36000(long a); /// Normalize angle to 0.00..359.99 + +sal_uInt16 GetAngleSector(long nAngle); /// Determine sector within the cartesian coordinate system + +/** + * Calculates the length of (0,0) via a^2 + b^2 = c^2 + * In order to avoid overflows, we ignore some decimal places. + */ +long GetLen(const Point& rPnt); + +/** + * The transformation of a rectangle into a polygon, by + * using angle parameters from GeoStat. ------------ + * The point of reference is always the Point 0, meaning /1 2/ + * the upper left corner of the initial rectangle. / / + * When calculating the polygon, the order is first / / + * shear and then the rotation. / / + * / / \ + * / / | + * A) Initial rectangle aRect B) After applying Shear /0 3/ Rot| + * +------------------+ -------------------- ------------------ + * |0 1| \0 1\ C) After applying Rotate + * | | \ \ + * | | | \ \ + * |3 2| | \3 2\ + * +------------------+ | -------------------- + * |Shr + * + * When converting the polygon back into a rect, the order is necessarily the + * other way around: + * - Calculating the rotation angle: angle of the line 0-1 in figure C) to the horizontal + * - Turning the sheared rect back (we get figure B) + * - Determining the width of the rect = length of the line 0-1 in figure B) + * - Determining the height of the rect = vertical distance between the points 0 and 3 + * of figure B) + * - Determining the shear angle from the line 0-3 to the perpendicular line. + * + * We need to keep in mind that the polygon can be mirrored when it was + * transformed in the meantime (e.g. mirror or resize with negative factor). + * In that case, we first need to normalize, by swapping points (0 with 3 and 1 + * with 2), so that it has the right orientation. + * + * Note: a positive shear angle means a shear with a positive visible curvature + * on the screen. Mathematically, that would be a negative curvature, as the + * Y axis runs from top to bottom on the screen. + * Rotation angle: positive means a visible left rotation. + */ + +class GeoStat { // Geometric state for a rect +public: + long nRotationAngle; + long nShearAngle; + double nTan; // tan(nShearAngle) + double nSin; // sin(nRotationAngle) + double nCos; // cos(nRotationAngle) + + GeoStat(): nRotationAngle(0),nShearAngle(0),nTan(0.0),nSin(0.0),nCos(1.0) {} + void RecalcSinCos(); + void RecalcTan(); +}; + +tools::Polygon Rect2Poly(const tools::Rectangle& rRect, const GeoStat& rGeo); +void Poly2Rect(const tools::Polygon& rPol, tools::Rectangle& rRect, GeoStat& rGeo); + +void OrthoDistance8(const Point& rPt0, Point& rPt, bool bBigOrtho); +void OrthoDistance4(const Point& rPt0, Point& rPt, bool bBigOrtho); + +// Multiplication and subsequent division +// Calculation and intermediate values are in BigInt +SVXCORE_DLLPUBLIC long BigMulDiv(long nVal, long nMul, long nDiv); + +class FrPair { + Fraction aX; + Fraction aY; +public: + FrPair(const Fraction& rBoth) : aX(rBoth),aY(rBoth) {} + FrPair(const Fraction& rX, const Fraction& rY) : aX(rX),aY(rY) {} + FrPair(long nMul, long nDiv) : aX(nMul,nDiv),aY(nMul,nDiv) {} + FrPair(long xMul, long xDiv, long yMul, long yDiv): aX(xMul,xDiv),aY(yMul,yDiv) {} + const Fraction& X() const { return aX; } + const Fraction& Y() const { return aY; } + Fraction& X() { return aX; } + Fraction& Y() { return aY; } +}; + +// To convert units of measurement +SVXCORE_DLLPUBLIC FrPair GetMapFactor(MapUnit eS, MapUnit eD); +FrPair GetMapFactor(FieldUnit eS, FieldUnit eD); + +inline bool IsMetric(MapUnit eU) { + return (eU==MapUnit::Map100thMM || eU==MapUnit::Map10thMM || eU==MapUnit::MapMM || eU==MapUnit::MapCM); +} + +inline bool IsInch(MapUnit eU) { + return (eU==MapUnit::Map1000thInch || eU==MapUnit::Map100thInch || eU==MapUnit::Map10thInch || eU==MapUnit::MapInch || + eU==MapUnit::MapPoint || eU==MapUnit::MapTwip); +} + +inline bool IsMetric(FieldUnit eU) { + return (eU == FieldUnit::MM || eU == FieldUnit::CM || eU == FieldUnit::M + || eU == FieldUnit::KM || eU == FieldUnit::MM_100TH); +} + +inline bool IsInch(FieldUnit eU) { + return (eU == FieldUnit::TWIP || eU == FieldUnit::POINT + || eU == FieldUnit::PICA || eU == FieldUnit::INCH + || eU == FieldUnit::FOOT || eU == FieldUnit::MILE); +} + +class SVXCORE_DLLPUBLIC SdrFormatter { + long nMul_; + long nDiv_; + short nComma_; + bool bDirty; + MapUnit eSrcMU; + MapUnit eDstMU; +private: + SVX_DLLPRIVATE void Undirty(); +public: + SdrFormatter(MapUnit eSrc, MapUnit eDst) + : nMul_(0) + , nDiv_(0) + , nComma_(0) + , bDirty(true) + , eSrcMU(eSrc) + , eDstMU(eDst) + { + } + OUString GetStr(long nVal) const; + static OUString GetUnitStr(MapUnit eUnit); + static OUString GetUnitStr(FieldUnit eUnit); +}; + + +#endif // INCLUDED_SVX_SVDTRANS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdtypes.hxx b/include/svx/svdtypes.hxx new file mode 100644 index 000000000..f6c6b36e6 --- /dev/null +++ b/include/svx/svdtypes.hxx @@ -0,0 +1,94 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVDTYPES_HXX +#define INCLUDED_SVX_SVDTYPES_HXX + +#include +#include + +// commands for EndCreate() +enum class SdrCreateCmd +{ + NextPoint, // next traverse station, segment of a circle: next coordinate + NextObject, // next polygon in PolyPolygon + ForceEnd // forced end +}; + +enum class SdrDragMode +{ + Move, + Resize, + Rotate, + Mirror, + Shear, + Crook, + + // new modes for interactive transparence and gradient tools + Transparence, + Gradient, + + // new mode for interactive cropping of graphics + Crop +}; + + + +/* + * Layer + */ +// You can use this value in the methods of SdrLayerSet, but false is returned +// every time or the method does nothing. +// type declaration for Layer-IDs +typedef o3tl::strong_int SdrLayerID; + +// If there is no layer when it should be identified, then +// SdrLayerAdmin::GetLayerID(const String&) returns a value. +constexpr SdrLayerID SDRLAYER_NOTFOUND(0xff); + +/* + * Repeat + */ +enum class SdrRepeatFunc { + NONE, + // with parameter + Move, // distance + Resize, // factor, reference(%) related to MarkRect + Rotate, // rotation angle, reference(%) related to MarkRect + // Without parameter + Delete, + CombinePolyPoly, + CombineOnePoly, + DismantlePolys, + DismantleLines, + ConvertToPoly, + ConvertToPath, + Group, + Ungroup, + PutToTop, + PutToBottom, + MoveToTop, + MoveToBottom, + ReverseOrder, + ImportMtf, +}; + +#endif // INCLUDED_SVX_SVDTYPES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdundo.hxx b/include/svx/svdundo.hxx new file mode 100644 index 000000000..d1aac69b1 --- /dev/null +++ b/include/svx/svdundo.hxx @@ -0,0 +1,746 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVDUNDO_HXX +#define INCLUDED_SVX_SVDUNDO_HXX + +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +class SfxItemSet; +class SfxPoolItem; +class SfxStyleSheet; +class SdrView; +class SdrPageView; +class SdrModel; +class SdrObject; +class SdrPage; +class SdrObjList; +class SdrLayer; +class SdrLayerAdmin; +class SdrObjGeoData; +class OutlinerParaObject; + +/** + * Abstract base class (ABC) for all UndoActions of DrawingEngine + */ + +class SVXCORE_DLLPUBLIC SdrUndoAction : public SfxUndoAction +{ +protected: + SdrModel& rMod; + ViewShellId m_nViewShellId; + +protected: + SdrUndoAction(SdrModel& rNewMod); + +public: + virtual ~SdrUndoAction() override; + + virtual bool CanRepeat(SfxRepeatTarget& rView) const override; + virtual void Repeat(SfxRepeatTarget& rView) override; + + virtual OUString GetRepeatComment(SfxRepeatTarget& rView) const override; + virtual OUString GetSdrRepeatComment() const; + + virtual bool CanSdrRepeat(SdrView& rView) const; + virtual void SdrRepeat(SdrView& rView); + + /// See SfxUndoAction::GetViewShellId(). + ViewShellId GetViewShellId() const override; +}; + +/** + * Aggregation of arbitrarily many UndoActions to a single UndoAction. + * Undo() executes the single UndoActions backwards (LIFO, first the last + * ones attached), Redo() executes the UndoActions in the order they were + * added (FIFO). + */ + +class SVXCORE_DLLPUBLIC SdrUndoGroup final : public SdrUndoAction +{ + std::vector> maActions; + + // No expanded description of the Action (contains %O) + OUString aComment; + OUString aObjDescription; + + SdrRepeatFunc eFunction; + +public: + SdrUndoGroup(SdrModel& rNewMod); + virtual ~SdrUndoGroup() override; + + sal_Int32 GetActionCount() const { return maActions.size(); } + SdrUndoAction* GetAction(sal_Int32 nNum) const { return maActions[nNum].get(); } + void AddAction(std::unique_ptr pAct); + + void SetComment(const OUString& rStr) { aComment=rStr; } + void SetObjDescription(const OUString& rStr) { aObjDescription=rStr; } + virtual OUString GetComment() const override; + virtual OUString GetSdrRepeatComment() const override; + + virtual void Undo() override; + virtual void Redo() override; + + virtual bool CanSdrRepeat(SdrView& rView) const override; + virtual void SdrRepeat(SdrView& rView) override; + void SetRepeatFunction(SdrRepeatFunc eFunc) { eFunction=eFunc; } +}; + +/** + * Abstract base class for all UndoActions that handle objects. + */ + +class SVXCORE_DLLPUBLIC SdrUndoObj : public SdrUndoAction +{ +protected: + SdrObject* pObj; + +protected: + SdrUndoObj(SdrObject& rNewObj); + + OUString ImpGetDescriptionStr(const char* pStrCacheID, bool bRepeat = false) const; + + [[nodiscard]] static OUString GetDescriptionStringForObject( const SdrObject& _rForObject, const char* pStrCacheID, bool bRepeat = false ); + + // #94278# new method for evtl. PageChange at UNDO/REDO + void ImpShowPageOfThisObject(); +}; + +/** + * Changing the object attributes. + * Create Action right before setting the new attributes. + * Also for StyleSheets. + */ + +class SVXCORE_DLLPUBLIC SdrUndoAttrObj : public SdrUndoObj +{ +protected: + std::unique_ptr pUndoSet; + std::unique_ptr pRedoSet; + + // FIXME: Or should we better remember the StyleSheetNames? + rtl::Reference< SfxStyleSheetBase > mxUndoStyleSheet; + rtl::Reference< SfxStyleSheetBase > mxRedoStyleSheet; + bool bStyleSheet; + bool bHaveToTakeRedoSet; + + // When assigning TextItems to a drawing object with text: + std::unique_ptr + pTextUndo; + // #i8508# + // The text rescue mechanism needs also to be implemented for redo actions. + std::unique_ptr + pTextRedo; + + // If we have a group object: + std::unique_ptr pUndoGroup; + + // Helper to ensure StyleSheet is in pool (provided by SdrModel from SdrObject) + static void ensureStyleSheetInStyleSheetPool(SfxStyleSheetBasePool& rStyleSheetPool, SfxStyleSheet& rSheet); + +public: + SdrUndoAttrObj(SdrObject& rNewObj, bool bStyleSheet1 = false, bool bSaveText = false); + virtual ~SdrUndoAttrObj() override; + virtual void Undo() override; + virtual void Redo() override; + + virtual OUString GetComment() const override; + virtual OUString GetSdrRepeatComment() const override; +}; + +/** + * Only moving of an object. + * Create Action right before moving. + */ + +class SVXCORE_DLLPUBLIC SdrUndoMoveObj final : public SdrUndoObj +{ + Size aDistance; // Distance by which we move + +public: + SdrUndoMoveObj(SdrObject& rNewObj, const Size& rDist): SdrUndoObj(rNewObj),aDistance(rDist) {} + virtual ~SdrUndoMoveObj() override; + + virtual void Undo() override; + virtual void Redo() override; + + virtual OUString GetComment() const override; + virtual OUString GetSdrRepeatComment() const override; + + virtual void SdrRepeat(SdrView& rView) override; + virtual bool CanSdrRepeat(SdrView& rView) const override; +}; + +/** + * Changing the geometry of an object. + * Create Action right before the geometric transformation. + */ + +class SVXCORE_DLLPUBLIC SdrUndoGeoObj : public SdrUndoObj +{ + std::unique_ptr pUndoGeo; + std::unique_ptr pRedoGeo; + // If we have a group object: + std::unique_ptr pUndoGroup; + /// If we have a table object, should its layout change? + bool mbSkipChangeLayout; + +public: + SdrUndoGeoObj(SdrObject& rNewObj); + virtual ~SdrUndoGeoObj() override; + + virtual void Undo() override; + virtual void Redo() override; + + virtual OUString GetComment() const override; + void SetSkipChangeLayout(bool bOn) { mbSkipChangeLayout=bOn; } +}; + +/** + * Manipulation of an ObjList: New Object, DeleteObj, SetObjZLevel, Grouping, ... + * Abstract base class. + */ + +class SVXCORE_DLLPUBLIC SdrUndoObjList : public SdrUndoObj { + class ObjListListener; + friend class ObjListListener; + +private: + bool bOwner; + +protected: + SdrObjList* pObjList; + sal_uInt32 nOrdNum; + +protected: + SdrUndoObjList(SdrObject& rNewObj, bool bOrdNumDirect); + virtual ~SdrUndoObjList() override; + + bool IsOwner() const { return bOwner; } + void SetOwner(bool bNew); +}; + +/** + * Removing an Object from an ObjectList. + * To be used with corresponding Inserts within a UndoGroup. + * + * Create Action before removing from the ObjList. + */ + +class SVXCORE_DLLPUBLIC SdrUndoRemoveObj : public SdrUndoObjList +{ +public: + SdrUndoRemoveObj(SdrObject& rNewObj, bool bOrdNumDirect = false) + : SdrUndoObjList(rNewObj,bOrdNumDirect) {} + + virtual void Undo() override; + virtual void Redo() override; + + virtual ~SdrUndoRemoveObj() override; +}; + +/** + * Inserting Objects into an ObjectList. + * Use with corresponding Removes within an UndoGroup. + * Create Action before removal from ObjList. + */ + +class SVXCORE_DLLPUBLIC SdrUndoInsertObj : public SdrUndoObjList +{ +public: + SdrUndoInsertObj(SdrObject& rNewObj, bool bOrdNumDirect = false) + : SdrUndoObjList(rNewObj,bOrdNumDirect) {} + + virtual void Undo() override; + virtual void Redo() override; +}; + +/** + * Deleting an Object. + * Create Action before removing from ObjList. + */ + +class SVXCORE_DLLPUBLIC SdrUndoDelObj : public SdrUndoRemoveObj +{ +public: + SdrUndoDelObj(SdrObject& rNewObj, bool bOrdNumDirect = false); + + virtual void Undo() override; + virtual void Redo() override; + + virtual OUString GetComment() const override; + virtual OUString GetSdrRepeatComment() const override; + + virtual void SdrRepeat(SdrView& rView) override; + virtual bool CanSdrRepeat(SdrView& rView) const override; +}; + +/** + * Inserting a NEW Object. + * Create Action after insertion into the ObjList. + */ + +class SVXCORE_DLLPUBLIC SdrUndoNewObj : public SdrUndoInsertObj +{ +public: + SdrUndoNewObj(SdrObject& rNewObj, bool bOrdNumDirect = false) + : SdrUndoInsertObj(rNewObj,bOrdNumDirect) {} + + virtual void Undo() override; + virtual void Redo() override; + + virtual OUString GetComment() const override; + + static OUString GetComment(const SdrObject& _rForObject); +}; + +/** + * Replacing an Object. + * Create Action before Replace in ObjList. + */ + +class SVXCORE_DLLPUBLIC SdrUndoReplaceObj : public SdrUndoObj +{ + bool bOldOwner; + bool bNewOwner; + + SdrObjList* pObjList; + SdrObject* pNewObj; + +public: + SdrUndoReplaceObj(SdrObject& rOldObj1, SdrObject& rNewObj1); + virtual ~SdrUndoReplaceObj() override; + + virtual void Undo() override; + virtual void Redo() override; + + bool IsNewOwner() const { return bNewOwner; } + void SetNewOwner(bool bNew); + + bool IsOldOwner() const { return bOldOwner; } + void SetOldOwner(bool bNew); +}; + +/** + * Copying an Object. + * Create Action before inserting into the ObjList. + */ + +class SdrUndoCopyObj final : public SdrUndoNewObj +{ +public: + SdrUndoCopyObj(SdrObject& rNewObj, bool bOrdNumDirect) + : SdrUndoNewObj(rNewObj,bOrdNumDirect) {} + + virtual OUString GetComment() const override; +}; + +class SdrUndoObjOrdNum final : public SdrUndoObj +{ + sal_uInt32 nOldOrdNum; + sal_uInt32 nNewOrdNum; + +public: + SdrUndoObjOrdNum(SdrObject& rNewObj, sal_uInt32 nOldOrdNum1, sal_uInt32 nNewOrdNum1); + + virtual void Undo() override; + virtual void Redo() override; + + virtual OUString GetComment() const override; +}; + + +// #i11702# + +class SVXCORE_DLLPUBLIC SdrUndoObjectLayerChange final : public SdrUndoObj +{ + SdrLayerID maOldLayer; + SdrLayerID maNewLayer; + +public: + SdrUndoObjectLayerChange(SdrObject& rObj, SdrLayerID aOldLayer, SdrLayerID aNewLayer); + + virtual void Undo() override; + virtual void Redo() override; +}; + +class SVXCORE_DLLPUBLIC SdrUndoObjSetText : public SdrUndoObj +{ +protected: + std::unique_ptr + pOldText; + std::unique_ptr + pNewText; + bool bNewTextAvailable; + bool bEmptyPresObj; + sal_Int32 mnText; + +public: + SdrUndoObjSetText(SdrObject& rNewObj, sal_Int32 nText ); + virtual ~SdrUndoObjSetText() override; + + bool IsDifferent() const { return pOldText!=pNewText; } + void AfterSetText(); + + virtual void Undo() override; + virtual void Redo() override; + + virtual OUString GetComment() const override; + virtual OUString GetSdrRepeatComment() const override; + + virtual void SdrRepeat(SdrView& rView) override; + virtual bool CanSdrRepeat(SdrView& rView) const override; +}; + +/** + * Implement Title/Description Elements UI for Writer + * text frames, graphics and embedded objects (#i73249#) + */ +class SdrUndoObjStrAttr final : public SdrUndoObj +{ +public: + enum class ObjStrAttrType + { + Name, + Title, + Description + }; + + SdrUndoObjStrAttr( SdrObject& rNewObj, + const ObjStrAttrType eObjStrAttr, + const OUString& sOldStr, + const OUString& sNewStr); + + virtual void Undo() override; + virtual void Redo() override; + + virtual OUString GetComment() const override; + +private: + const ObjStrAttrType meObjStrAttr; + const OUString msOldStr; + const OUString msNewStr; + +}; + + +/* + * Layer + */ + +/** + * Abstract base class for all UndoActions that have something to do with SdrLayer. + */ + +class SdrUndoLayer : public SdrUndoAction +{ +protected: + SdrLayer* pLayer; + SdrLayerAdmin* pLayerAdmin; + sal_uInt16 nNum; + bool bItsMine; + +protected: + SdrUndoLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel); + virtual ~SdrUndoLayer() override; +}; + +/** + * Inserting a new Layer. + * Create Action after Insertion. + */ + +class SdrUndoNewLayer final : public SdrUndoLayer +{ +public: + SdrUndoNewLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel) + : SdrUndoLayer(nLayerNum,rNewLayerAdmin,rNewModel) {} + + virtual void Undo() override; + virtual void Redo() override; + + virtual OUString GetComment() const override; +}; + +/** + * Deleting a Layer. + * Create Action before the Remove. + */ + +class SdrUndoDelLayer final : public SdrUndoLayer +{ +public: + SdrUndoDelLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel) + : SdrUndoLayer(nLayerNum,rNewLayerAdmin,rNewModel) { bItsMine=true; } + + virtual void Undo() override; + virtual void Redo() override; + + virtual OUString GetComment() const override; +}; + +/* + * Pages + */ + +/** + * ABC for all UndoActions that have something to do with SdrPages. + */ + +class SdrUndoPage : public SdrUndoAction +{ +protected: + SdrPage& mrPage; + +protected: + void ImpInsertPage(sal_uInt16 nNum); + void ImpRemovePage(sal_uInt16 nNum); + void ImpMovePage(sal_uInt16 nOldNum, sal_uInt16 nNewNum); + +protected: + SdrUndoPage(SdrPage& rNewPg); + + static OUString ImpGetDescriptionStr(const char* pStrCacheID); +}; + +/** + * ABC for manipulation of a PageList: New Page, DeletePage, MovePage (ChangePageNum). + */ + +class SVXCORE_DLLPUBLIC SdrUndoPageList : public SdrUndoPage +{ +protected: + sal_uInt16 nPageNum; + + // It's possible that the object is re-assigned during a Undo/Redo. + // The Page is deleted in the dtor, if bItsMine==TRUE + bool bItsMine; + +protected: + SdrUndoPageList(SdrPage& rNewPg); + virtual ~SdrUndoPageList() override; +}; + +/** + * Deleting a Page. + * Create Action before removing from the List. + */ + +class SVXCORE_DLLPUBLIC SdrUndoDelPage final : public SdrUndoPageList +{ + // When deleting a MasterPage, we remember all relations of the + // Character Page with the MasterPage in this UndoGroup. + std::unique_ptr pUndoGroup; + std::unique_ptr mpFillBitmapItem; + bool mbHasFillBitmap; + +public: + SdrUndoDelPage(SdrPage& rNewPg); + virtual ~SdrUndoDelPage() override; + + virtual void Undo() override; + virtual void Redo() override; + + virtual OUString GetComment() const override; + virtual OUString GetSdrRepeatComment() const override; + + virtual void SdrRepeat(SdrView& rView) override; + virtual bool CanSdrRepeat(SdrView& rView) const override; + +private: + void queryFillBitmap(const SfxItemSet &rItemSet); + void clearFillBitmap(); + void restoreFillBitmap(); +}; + +/** + * Inserting a new Page. + * Create Action after inserting into the List. + */ + +class SVXCORE_DLLPUBLIC SdrUndoNewPage : public SdrUndoPageList +{ +public: + SdrUndoNewPage(SdrPage& rNewPg): SdrUndoPageList(rNewPg) {} + + virtual void Undo() override; + virtual void Redo() override; + + virtual OUString GetComment() const override; +}; + +/** + * Copying a Page. + * Create Action after inserting into the List. + */ + +class SdrUndoCopyPage final : public SdrUndoNewPage +{ +public: + SdrUndoCopyPage(SdrPage& rNewPg): SdrUndoNewPage(rNewPg) {} + + virtual OUString GetComment() const override; + virtual OUString GetSdrRepeatComment() const override; + + virtual void SdrRepeat(SdrView& rView) override; + virtual bool CanSdrRepeat(SdrView& rView) const override; +}; + +/** + * Moving a Page within the List. + * Create Action before moving the Page. + */ + +class SdrUndoSetPageNum final : public SdrUndoPage +{ + sal_uInt16 nOldPageNum; + sal_uInt16 nNewPageNum; + +public: + SdrUndoSetPageNum(SdrPage& rNewPg, sal_uInt16 nOldPageNum1, sal_uInt16 nNewPageNum1) + : SdrUndoPage(rNewPg),nOldPageNum(nOldPageNum1),nNewPageNum(nNewPageNum1) {} + + virtual void Undo() override; + virtual void Redo() override; + + virtual OUString GetComment() const override; +}; + + +/* + * Masterpages + */ + +/** + * ABC for all UndoActions that have something to do with + * MasterPage relationships. + */ + +class SdrUndoPageMasterPage : public SdrUndoPage +{ +protected: + bool mbOldHadMasterPage; + SdrLayerIDSet maOldSet; + sal_uInt16 maOldMasterPageNumber; + +protected: + SdrUndoPageMasterPage(SdrPage& rChangedPage); + +public: + UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) virtual ~SdrUndoPageMasterPage() override; +}; + +/** + * Removal of a MasterPage from a Character Page. + * Create Action before removing the MasterPageDescriptor. + */ + +class SdrUndoPageRemoveMasterPage final : public SdrUndoPageMasterPage +{ +public: + SdrUndoPageRemoveMasterPage(SdrPage& rChangedPage); + + virtual void Undo() override; + virtual void Redo() override; + + virtual OUString GetComment() const override; +}; + +/** + * Changing the MasterPageDescriptor (e.g. change of the VisibleLayer). + * Create Action before changing the MasterPageDescriptors. + */ + +class SdrUndoPageChangeMasterPage final : public SdrUndoPageMasterPage +{ + bool mbNewHadMasterPage; + SdrLayerIDSet maNewSet; + sal_uInt16 maNewMasterPageNumber; + +public: + SdrUndoPageChangeMasterPage(SdrPage& rChangedPage); + + virtual void Undo() override; + virtual void Redo() override; + + virtual OUString GetComment() const override; +}; + + +/** + * The SdrUndoFactory can be set and retrieved from the SdrModel. + * It is used by the drawing layer implementations to create undo actions. + * It can be used by applications to create application specific undo actions. + */ +class SVXCORE_DLLPUBLIC SdrUndoFactory +{ +public: + // Shapes + virtual ~SdrUndoFactory(); + virtual std::unique_ptr CreateUndoMoveObject( SdrObject& rObject, const Size& rDist ); + virtual std::unique_ptr CreateUndoGeoObject( SdrObject& rObject ); + virtual std::unique_ptr CreateUndoAttrObject( SdrObject& rObject, bool bStyleSheet1 = false, bool bSaveText = false ); + virtual std::unique_ptr CreateUndoRemoveObject(SdrObject& rObject); + virtual std::unique_ptr CreateUndoInsertObject( SdrObject& rObject, bool bOrdNumDirect = false); + virtual std::unique_ptr CreateUndoDeleteObject( SdrObject& rObject, bool bOrdNumDirect = false); + virtual std::unique_ptr CreateUndoNewObject( SdrObject& rObject, bool bOrdNumDirect = false); + virtual std::unique_ptr CreateUndoCopyObject( SdrObject& rObject, bool bOrdNumDirect = false); + + virtual std::unique_ptr CreateUndoObjectOrdNum( SdrObject& rObject, sal_uInt32 nOldOrdNum1, sal_uInt32 nNewOrdNum1); + + virtual std::unique_ptr CreateUndoReplaceObject( SdrObject& rOldObject, SdrObject& rNewObject ); + virtual std::unique_ptr CreateUndoObjectLayerChange( SdrObject& rObject, SdrLayerID aOldLayer, SdrLayerID aNewLayer ); + virtual std::unique_ptr CreateUndoObjectSetText( SdrObject& rNewObj, sal_Int32 nText ); + + // Implement Title/Description Elements UI for Writer text frames, graphics and embedded objects (#i73249#) + static std::unique_ptr CreateUndoObjectStrAttr( SdrObject& rObject, + SdrUndoObjStrAttr::ObjStrAttrType eObjStrAttrType, + const OUString& sOldStr, + const OUString& sNewStr ); + + // Layer + virtual std::unique_ptr CreateUndoNewLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel); + virtual std::unique_ptr CreateUndoDeleteLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel); + + // Page + virtual std::unique_ptr CreateUndoDeletePage(SdrPage& rPage); + virtual std::unique_ptr CreateUndoNewPage(SdrPage& rPage); + virtual std::unique_ptr CreateUndoCopyPage(SdrPage& rPage); + virtual std::unique_ptr CreateUndoSetPageNum(SdrPage& rNewPg, sal_uInt16 nOldPageNum1, sal_uInt16 nNewPageNum1); + + // Master page + virtual std::unique_ptr CreateUndoPageRemoveMasterPage(SdrPage& rChangedPage); + virtual std::unique_ptr CreateUndoPageChangeMasterPage(SdrPage& rChangedPage); +}; + +#endif // INCLUDED_SVX_SVDUNDO_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdview.hxx b/include/svx/svdview.hxx new file mode 100644 index 000000000..f37cf1098 --- /dev/null +++ b/include/svx/svdview.hxx @@ -0,0 +1,281 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVDVIEW_HXX +#define INCLUDED_SVX_SVDVIEW_HXX + +// HACK to avoid too deep includes and to have some +// levels free in svdmark itself (MS compiler include depth limit) +#include +#include +#include +#include +#include +#include +#include +#include + +// class hierarchy of View: +// SfxListener +// SdrPaintView PntV Action ModChg Attr Notify +// SdrSnapView SnpV Action +// +// SdrMarkView MrkV Action MrkChg ModChg Notify +// +// SdrEditView EdtV MrkChg ModChg Attr +// SdrPolyEditView PoEV +// SdrGlueEditView GlEV +// SdrObjEditView EdxV Action ModChg Attr Notify +// +// SdrExchangeView XcgV +// SdrDragView DrgV Action +// +// SdrCreateView CrtV Action +// SdrView View + +class SvxURLField; +namespace sdr::contact { class ObjectContact; } + +enum class SdrViewContext { + Standard, + PointEdit, + GluePointEdit, + Graphic, + Media, + Table +}; + +enum class SdrEventKind { + NONE, + TextEdit, + MoveAction, + EndAction, + BackAction, + EndCreate, + EndDrag, + MarkObj, + MarkPoint, + MarkGluePoint, + BeginMark, + BeginInsertObjPoint, + EndInsertObjPoint, + BeginInsertGluePoint, + BeginDragHelpline, + BeginDragObj, + BeginCreateObj, + BeginMacroObj, + BeginTextEdit, + EndMark, + BrkMark, + ExecuteUrl +}; + +/* for PickAnything() */ +enum class SdrMouseEventKind +{ + BUTTONDOWN = 1, + MOVE = 2, + BUTTONUP = 3, +}; + +// helper class SdrViewEvent +struct SVXCORE_DLLPUBLIC SdrViewEvent +{ + SdrHdl* pHdl; + SdrObject* pObj; + SdrObject* pRootObj; // mark this when SdrBeginTextEdit is executed + SdrPageView* pPV; + const SvxURLField* pURLField; + + Point aLogicPos; + SdrHitKind eHit; + SdrEventKind eEvent; + + sal_uInt16 nMouseClicks; + MouseEventModifiers nMouseMode; + sal_uInt16 nMouseCode; + sal_uInt16 nHlplIdx; + sal_uInt16 nGlueId; + + bool bMouseDown : 1; + bool bMouseUp : 1; + bool bIsAction : 1; // Action is active + bool bIsTextEdit : 1; // TextEdit runs currently + bool bAddMark : 1; + bool bUnmark : 1; + bool bPrevNextMark : 1; + bool bMarkPrev : 1; + +public: + SdrViewEvent(); + ~SdrViewEvent(); +}; + +// helper class for all D&D overlays +class SVXCORE_DLLPUBLIC SdrDropMarkerOverlay +{ + // The OverlayObjects + sdr::overlay::OverlayObjectList maObjects; + + void ImplCreateOverlays( + const SdrView& rView, + const basegfx::B2DPolyPolygon& rLinePolyPolygon); + +public: + SdrDropMarkerOverlay(const SdrView& rView, const SdrObject& rObject); + SdrDropMarkerOverlay(const SdrView& rView, const tools::Rectangle& rRectangle); + SdrDropMarkerOverlay(const SdrView& rView, const Point& rStart, const Point& rEnd); + ~SdrDropMarkerOverlay(); +}; + + +class SVXCORE_DLLPUBLIC SdrView : public SdrCreateView, public tools::WeakBase +{ + friend class SdrPageView; + + bool bNoExtendedMouseDispatcher : 1; + bool bNoExtendedKeyDispatcher : 1; + bool mbMasterPagePaintCaching : 1; + + SvtAccessibilityOptions maAccessibilityOptions; + +public: + explicit SdrView( + SdrModel& rSdrModel, + OutputDevice* pOut = nullptr); + + virtual ~SdrView() override; + + // The default value for all dispatchers is activated. If the app for example + // wants to intervene in MouseDispatcher for special treatment, you have to + // deactivate the MouseDispatcher with the help of the method below and you have + // to implement it yourself. Example for MouseButtonDown: + // SdrViewEvent aVEvt; + // SdrHitKind eHit=pSdrView->PickAnything(rMEvt,SdrMouseEventKind::BUTTONDOWN,aVEvt); + // ... here application-specific intervention ... + // pSdrView->DoMouseEvent(aVEvt); + // SetPointer(GetPreferredPointer(...)) + // CaptureMouse(...) + void EnableExtendedMouseEventDispatcher(bool bOn) { bNoExtendedMouseDispatcher = !bOn; } + bool IsExtendedMouseEventDispatcherEnabled() const { return bNoExtendedMouseDispatcher; } + + void EnableExtendedKeyInputDispatcher(bool bOn) { bNoExtendedKeyDispatcher=!bOn; } + bool IsExtendedKeyInputDispatcherEnabled() const { return bNoExtendedKeyDispatcher; } + + void SetMasterPagePaintCaching(bool bOn); + bool IsMasterPagePaintCaching() const { return mbMasterPagePaintCaching; } + + bool KeyInput(const KeyEvent& rKEvt, vcl::Window* pWin) override; + virtual bool MouseButtonDown(const MouseEvent& rMEvt, OutputDevice* pWin) override; + virtual bool MouseButtonUp(const MouseEvent& rMEvt, OutputDevice* pWin) override; + virtual bool MouseMove(const MouseEvent& rMEvt, OutputDevice* pWin) override; + using SdrCreateView::RequestHelp; + virtual bool Command(const CommandEvent& rCEvt, vcl::Window* pWin) override; + + virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, ConfigurationHints ) override; + + bool SetAttributes(const SfxItemSet& rSet, bool bReplaceAll=false) { return SdrCreateView::SetAttributes(rSet,bReplaceAll); } + + /* new interface src537 */ + void GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr=false) const; + + // incomplete implementation: + // OutputDevice is necessary to determine HandleSize. + // If NULL the first signed on Win is used. + PointerStyle GetPreferredPointer(const Point& rMousePos, const OutputDevice* pOut, sal_uInt16 nModifier=0, bool bLeftDown=false) const; + SdrHitKind PickAnything(const MouseEvent& rMEvt, SdrMouseEventKind nMouseDownOrMoveOrUp, SdrViewEvent& rVEvt) const; + SdrHitKind PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) const; + bool DoMouseEvent(const SdrViewEvent& rVEvt); + virtual SdrViewContext GetContext() const; + + // The methods consider the particular context: + // - simple drawing + // - mode for editing points + // - mode for editing glue points + // - TextEdit + // - ... to be continued + void MarkAll(); + void UnmarkAll(); + + const tools::Rectangle& GetMarkedRect() const; + + virtual void DeleteMarked(); + + // Marking objects, traverse stations or glue points (depending on view- + // context) by enveloping the selection frame. + // bAddMark=TRUE: add to existing selection (->Shift) + // bUnmark=TRUE: remove objects from selection which are inside of + // the enveloped frame. + bool BegMark(const Point& rPnt, bool bAddMark, bool bUnmark); + + // The following actions are possible: + // - ObjectCreating + // - ObjectMarking + // - Object-specific dragging + // - General dragging + // and more... + OUString GetStatusText(); + + SvtAccessibilityOptions& getAccessibilityOptions() { return maAccessibilityOptions;} + + virtual void onAccessibilityOptionsChanged(); + + // Do not create ObjectContact locally, but offer a call to allow override + // and to create own derivations of ObjectContact + virtual sdr::contact::ObjectContact* createViewSpecificObjectContact( + SdrPageWindow& rPageWindow, + const char* pDebugName) const; +}; + +// First of all the app creates a SdrModel. +// Then it opens a Win and creates a SdrView. +// ShowSdrPage() announces a page at SdrView. +// It's possible to show SdrView in any Wins at once. +// internal: +// SdrView can show as many Wins as it wants at once. Pages are announced +// or checked out with the help of ShowSdrPage()/HideSdrPage(). For every announced +// page there is a SdrPageView instance in container aPages. If more than one page +// is showed, you have to pay attention that the offset parameter of ShowSdrPage() +// is conformed to the size of the page (to prevent overlapping of two pages). +// +// elementary methods: +// ~~~~~~~~~~~~~~~~~~~~ +// simple events: +// ~~~~~~~~~~~~~~~~ +// bool KeyInput(const KeyEvent& rKEvt, vcl::Window* pWin); +// bool MouseButtonDown(const MouseEvent& rMEvt, vcl::Window* pWin); +// bool MouseButtonUp(const MouseEvent& rMEvt, vcl::Window* pWin); +// bool MouseMove(const MouseEvent& rMEvt, vcl::Window* pWin); +// bool Command(const CommandEvent& rCEvt, vcl::Window* pWin); +// +// SfxItems: +// ~~~~~~~~~ +// sal_Bool GetAttributes(SfxItemSet& rTargetSet, sal_Bool bOnlyHardAttr=sal_False) const; +// sal_Bool SetAttributes(const SfxItemSet& rSet, sal_Bool bReplaceAll); +// SfxStyleSheet* GetStyleSheet() const; +// sal_Bool SetStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr); +// +// others: +// ~~~~~~~~~~ +// Pointer GetPreferredPointer(const Point& rMousePos, const OutputDevice* pOut, sal_uInt16 nTol=0) const; +// OUString GetStatusText(); + +#endif // INCLUDED_SVX_SVDVIEW_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdviter.hxx b/include/svx/svdviter.hxx new file mode 100644 index 000000000..d8a3de577 --- /dev/null +++ b/include/svx/svdviter.hxx @@ -0,0 +1,87 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVDVITER_HXX +#define INCLUDED_SVX_SVDVITER_HXX + +#include + +/* + +Using this class, you can find out: +- SdrView* First/NextView() + - All Views in which a model is displayed + - All Views in which a certain page is visible (also as MasterPage) + - All Views in which a certain object is visible (also as MasterPage) +- SdrPageView* First/NextPageView() + - All PageViews in which a model is displayed + - All PageViews in which a certain page is visible (also as MasterPage) + - All PageViews in which a certain object is visible (also as MasterPage) +- vcl::Window* First/NextWindow() + - All Windows in which a model is displayed + - All Windows in which a certain page is visible (also as MasterPage) + - All Windows in which a certain object is visible (also as MasterPage) +You can specify if the selection is restricted to a certain page/object by +choosing the corresponding constructor. + +Among others, the following are considered: +- Visibility state of the layer +- Visible Layer of MasterPages +- Multiple layer for group objects + +Not considered are: +- Whether the pages/objects were already painted or if an Invalidate is still pending +- Whether the pages/objects in a Window are in a visible region + +*/ + +class OutputDevice; +namespace vcl { class Window; } +class SdrView; +class SdrPageView; +class SdrModel; +class SdrPage; +class SdrObject; +class SdrLayerIDSet; + +class SVXCORE_DLLPUBLIC SdrViewIter +{ + const SdrModel* mpModel; + const SdrPage* mpPage; + const SdrObject* mpObject; + SdrView* mpCurrentView; + + size_t mnListenerNum; + +private: + SVX_DLLPRIVATE void ImpInitVars(); + SVX_DLLPRIVATE SdrView* ImpFindView(); + SVX_DLLPRIVATE bool ImpCheckPageView(SdrPageView const * pPV) const; + +public: + SdrViewIter(const SdrPage* pPage); + SdrViewIter(const SdrObject* pObject); + + SdrView* FirstView(); + SdrView* NextView(); +}; + +#endif // INCLUDED_SVX_SVDVITER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdxcgv.hxx b/include/svx/svdxcgv.hxx new file mode 100644 index 000000000..ea96eefe1 --- /dev/null +++ b/include/svx/svdxcgv.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_SVX_SVDXCGV_HXX +#define INCLUDED_SVX_SVDXCGV_HXX + +#include + +#include +#include + +class SVXCORE_DLLPUBLIC SdrExchangeView : public SdrObjEditView +{ + friend class SdrPageView; + +protected: + + void ImpGetPasteObjList(Point& rPos, SdrObjList*& rpLst); + void ImpPasteObject(SdrObject* pObj, SdrObjList& rLst, const Point& rCenter, const Size& rSiz, const MapMode& rMap, SdrInsertFlags nOptions); + bool ImpGetPasteLayer(const SdrObjList* pObjList, SdrLayerID& rLayer) const; + + // Returns true if rPt has changed + bool ImpLimitToWorkArea(Point& rPt) const; + +protected: + // #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView + SdrExchangeView( + SdrModel& rSdrModel, + OutputDevice* pOut); + +public: + // Output all marked objects on the specified OutputDevice + ::std::vector< SdrObject* > GetMarkedObjects() const; + virtual void DrawMarkedObj(OutputDevice& rOut) const; + + // E.g. for Clipboard, Drag'n'Drop, ... + // Add all marked objects to a metafile. + // FIXME: This is known to be somewhat buggy still (Offset..., + // foreign graphics objects (SdrGrafObj), virtual object + // copies (SdrVirtObj) with anchor position <>(0,0)). + GDIMetaFile GetMarkedObjMetaFile(bool bNoVDevIfOneMtfMarked = false) const; + + // Draw all marked objects onto a bitmap, with the display's color depth + // and resolution + BitmapEx GetMarkedObjBitmapEx(bool bNoVDevIfOneBmpMarked = false) const; + + // Copy all marked objects to a new model, consisting of exactly one page, + // with the flag PageNotValid set. This means, that only the page's objects + // are valid and not the page itself (page size, margins). + // The new model is created on the free store and passed to the caller of + // this method, which is responsible to dispose it later on. + // + // When inserting the marked objects into the one page of the new model, + // the page-local layer is merged. If there's no more room left for + // additional page-local layers, the corresponding objects are assigned + // the default layer (layer 0, document-global standard layer). + virtual std::unique_ptr CreateMarkedObjModel() const; + + Graphic GetAllMarkedGraphic() const; + + /** Generate a Graphic for the given draw object + + @param rSdrObject + The object (can also be a group object) to retrieve a Graphic + for. + + @return a graphical representation of the given object, as it + appears on screen (e.g. with rotation, if any, applied). + */ + static Graphic GetObjGraphic(const SdrObject& rSdrObject); + + // The new Draw objects are marked for all paste methods. + // If bAddMark is true, the new Draw objects are added to an existing + // selection, which is meant for Drag'n'Drop with multiple items. + // + // The methods with a point parameter insert objects centered at that + // position, all others are centered at the 1st OutputDevice of the View. + // + // If pPg is set, the objects are inserted at that page. The positioning + // (rPos or alignment) are not relative to the View, but to the Page. + // + // Note: SdrObjList is the base class of SdrPage. + // All methods return true, if the objects have been successfully created + // and inserted. + // If pLst = false and no TextEdit active, we can rely on the fact, that + // it is marked at the View. Or else the marking only happens if the pLst + // is also shown at the View at the moment. + // + // Valid values for nOptions are SDRINSERT_DONTMARK and SDRINSERT_ADDMARK + // (@see svdedtv.hxx). + virtual bool Paste( + const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, SdrInsertFlags nOptions); + + bool Paste(const OUString& rStr, const Point& rPos, SdrObjList* pLst, SdrInsertFlags nOptions); + bool Paste(SvStream& rInput, EETextFormat eFormat, const Point& rPos, SdrObjList* pLst, SdrInsertFlags nOptions); +}; + +#endif // INCLUDED_SVX_SVDXCGV_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svx3ditems.hxx b/include/svx/svx3ditems.hxx new file mode 100644 index 000000000..466095701 --- /dev/null +++ b/include/svx/svx3ditems.hxx @@ -0,0 +1,319 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_SVX3DITEMS_HXX +#define INCLUDED_SVX_SVX3DITEMS_HXX + +#include +#include +#include + + +#include +#include +#include +#include +#include + +// Svx3D _3DOBJ_ Items +inline SfxUInt16Item makeSvx3DPercentDiagonalItem(sal_uInt16 nVal) { + return SfxUInt16Item(SDRATTR_3DOBJ_PERCENT_DIAGONAL, nVal); +} + +inline SfxUInt16Item makeSvx3DBackscaleItem(sal_uInt16 nVal) { + return SfxUInt16Item(SDRATTR_3DOBJ_BACKSCALE, nVal); +} + +inline SfxUInt32Item makeSvx3DDepthItem(sal_uInt32 nVal) { + return SfxUInt32Item(SDRATTR_3DOBJ_DEPTH, nVal); +} + +inline SfxUInt32Item makeSvx3DHorizontalSegmentsItem(sal_uInt32 nVal) { + return SfxUInt32Item(SDRATTR_3DOBJ_HORZ_SEGS, nVal); +} + +inline SfxUInt32Item makeSvx3DVerticalSegmentsItem(sal_uInt32 nVal) { + return SfxUInt32Item(SDRATTR_3DOBJ_VERT_SEGS, nVal); +} + +inline SfxUInt32Item makeSvx3DEndAngleItem(sal_uInt32 nVal) { + return SfxUInt32Item(SDRATTR_3DOBJ_END_ANGLE, nVal); +} + +inline SfxBoolItem makeSvx3DDoubleSidedItem(bool bVal) { + return SfxBoolItem(SDRATTR_3DOBJ_DOUBLE_SIDED, bVal); +} + +// #i28528# +// Added extra Item (Bool) for chart2 to be able to show reduced line geometry +class Svx3DReducedLineGeometryItem : public SfxBoolItem { +public: + Svx3DReducedLineGeometryItem(bool bVal = false); + Svx3DReducedLineGeometryItem* Clone(SfxItemPool * = nullptr) const override; +}; + +class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) Svx3DNormalsKindItem : public SfxUInt16Item { +public: + Svx3DNormalsKindItem(sal_uInt16 nVal = 0); + + // use drawing::NormalsKind + SVX_DLLPRIVATE virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + SVX_DLLPRIVATE virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + SVX_DLLPRIVATE virtual Svx3DNormalsKindItem* Clone(SfxItemPool* pPool = nullptr) const override; +}; + +inline SfxBoolItem makeSvx3DNormalsInvertItem(bool bVal) { + return SfxBoolItem(SDRATTR_3DOBJ_NORMALS_INVERT, bVal); +} + +class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) Svx3DTextureProjectionXItem : public SfxUInt16Item { +public: + Svx3DTextureProjectionXItem(sal_uInt16 nVal = 0); + + // use drawing::TextureProjectionMode + SVX_DLLPRIVATE virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + SVX_DLLPRIVATE virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + SVX_DLLPRIVATE virtual Svx3DTextureProjectionXItem* Clone(SfxItemPool* pPool = nullptr) const override; +}; + +class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) Svx3DTextureProjectionYItem : public SfxUInt16Item { +public: + Svx3DTextureProjectionYItem(sal_uInt16 nVal = 0); + + // use drawing::TextureProjectionMode + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + virtual Svx3DTextureProjectionYItem* Clone(SfxItemPool* pPool = nullptr) const override; +}; + +inline SfxBoolItem makeSvx3DShadow3DItem(bool bVal) { + return SfxBoolItem(SDRATTR_3DOBJ_SHADOW_3D, bVal); +} + +inline SvxColorItem makeSvx3DMaterialEmissionItem(const Color& rCol) { + return SvxColorItem(rCol, SDRATTR_3DOBJ_MAT_EMISSION); +} + +inline SvxColorItem makeSvx3DMaterialSpecularItem(const Color& rCol) { + return SvxColorItem(rCol, SDRATTR_3DOBJ_MAT_SPECULAR); +} + +inline SfxUInt16Item makeSvx3DMaterialSpecularIntensityItem(sal_uInt16 nVal) { + return SfxUInt16Item(SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY, nVal); +} + +class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) Svx3DTextureKindItem final : public SfxUInt16Item { +public: + Svx3DTextureKindItem(sal_uInt16 nVal = 3); + + // use drawing::TextureKind + SVX_DLLPRIVATE virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + SVX_DLLPRIVATE virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + SVX_DLLPRIVATE virtual Svx3DTextureKindItem* Clone(SfxItemPool* pPool = nullptr) const override; +}; + +class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) Svx3DTextureModeItem final : public SfxUInt16Item { +public: + Svx3DTextureModeItem(sal_uInt16 nVal = 2); + + // use drawing:TextureMode + SVX_DLLPRIVATE virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + SVX_DLLPRIVATE virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + SVX_DLLPRIVATE virtual Svx3DTextureModeItem* Clone(SfxItemPool* pPool = nullptr) const override; +}; + +inline SfxBoolItem makeSvx3DTextureFilterItem(bool bVal) { + return SfxBoolItem(SDRATTR_3DOBJ_TEXTURE_FILTER, bVal); +} + +// Svx3D _3DSCENE_ Items +class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) Svx3DPerspectiveItem : public SfxUInt16Item { +public: + Svx3DPerspectiveItem(ProjectionType nVal = ProjectionType::Perspective); + + // use drawing::ProjectionMode + SVX_DLLPRIVATE virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + SVX_DLLPRIVATE virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + SVX_DLLPRIVATE virtual Svx3DPerspectiveItem* Clone(SfxItemPool* pPool = nullptr) const override; +}; + +inline SfxUInt32Item makeSvx3DDistanceItem(sal_uInt32 nVal) { + return SfxUInt32Item(SDRATTR_3DSCENE_DISTANCE, nVal); +} + +inline SfxUInt32Item makeSvx3DFocalLengthItem(sal_uInt32 nVal) { + return SfxUInt32Item(SDRATTR_3DSCENE_FOCAL_LENGTH, nVal); +} + +inline SfxBoolItem makeSvx3DTwoSidedLightingItem(bool bVal) { + return SfxBoolItem(SDRATTR_3DSCENE_TWO_SIDED_LIGHTING, bVal); +} + +inline SvxColorItem makeSvx3DLightcolor1Item(const Color& rCol) { + return SvxColorItem(rCol, SDRATTR_3DSCENE_LIGHTCOLOR_1); +} + +inline SvxColorItem makeSvx3DLightcolor2Item(const Color& rCol) { + return SvxColorItem(rCol, SDRATTR_3DSCENE_LIGHTCOLOR_2); +} + +inline SvxColorItem makeSvx3DLightcolor3Item(const Color& rCol) { + return SvxColorItem(rCol, SDRATTR_3DSCENE_LIGHTCOLOR_3); +} + +inline SvxColorItem makeSvx3DLightcolor4Item(const Color& rCol) { + return SvxColorItem(rCol, SDRATTR_3DSCENE_LIGHTCOLOR_4); +} + +inline SvxColorItem makeSvx3DLightcolor5Item(const Color& rCol) { + return SvxColorItem(rCol, SDRATTR_3DSCENE_LIGHTCOLOR_5); +} + +inline SvxColorItem makeSvx3DLightcolor6Item(const Color& rCol) { + return SvxColorItem(rCol, SDRATTR_3DSCENE_LIGHTCOLOR_6); +} + +inline SvxColorItem makeSvx3DLightcolor7Item(const Color& rCol) { + return SvxColorItem(rCol, SDRATTR_3DSCENE_LIGHTCOLOR_7); +} + +inline SvxColorItem makeSvx3DLightcolor8Item(const Color& rCol) { + return SvxColorItem(rCol, SDRATTR_3DSCENE_LIGHTCOLOR_8); +} + +inline SvxColorItem makeSvx3DAmbientcolorItem(const Color& rCol) { + return SvxColorItem(rCol, SDRATTR_3DSCENE_AMBIENTCOLOR); +} + +inline SfxBoolItem makeSvx3DLightOnOff1Item(bool bVal) { + return SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_1, bVal); +} + +inline SfxBoolItem makeSvx3DLightOnOff2Item(bool bVal) { + return SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_2, bVal); +} + +inline SfxBoolItem makeSvx3DLightOnOff3Item(bool bVal) { + return SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_3, bVal); +} + +inline SfxBoolItem makeSvx3DLightOnOff4Item(bool bVal) { + return SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_4, bVal); +} + +inline SfxBoolItem makeSvx3DLightOnOff5Item(bool bVal) { + return SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_5, bVal); +} + +inline SfxBoolItem makeSvx3DLightOnOff6Item(bool bVal) { + return SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_6, bVal); +} + +inline SfxBoolItem makeSvx3DLightOnOff7Item(bool bVal) { + return SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_7, bVal); +} + +inline SfxBoolItem makeSvx3DLightOnOff8Item(bool bVal) { + return SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_8, bVal); +} + +inline SvxB3DVectorItem makeSvx3DLightDirection1Item(const basegfx::B3DVector& rVec) { + return SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_1, rVec); +} + +inline SvxB3DVectorItem makeSvx3DLightDirection2Item(const basegfx::B3DVector& rVec) { + return SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_2, rVec); +} + +inline SvxB3DVectorItem makeSvx3DLightDirection3Item(const basegfx::B3DVector& rVec) { + return SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_3, rVec); +} + +inline SvxB3DVectorItem makeSvx3DLightDirection4Item(const basegfx::B3DVector& rVec) { + return SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_4, rVec); +} + +inline SvxB3DVectorItem makeSvx3DLightDirection5Item(const basegfx::B3DVector& rVec) { + return SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_5, rVec); +} + +inline SvxB3DVectorItem makeSvx3DLightDirection6Item(const basegfx::B3DVector& rVec) { + return SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_6, rVec); +} + +inline SvxB3DVectorItem makeSvx3DLightDirection7Item(const basegfx::B3DVector& rVec) { + return SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_7, rVec); +} + +inline SvxB3DVectorItem makeSvx3DLightDirection8Item(const basegfx::B3DVector& rVec) { + return SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_8, rVec); +} + +inline SfxUInt16Item makeSvx3DShadowSlantItem(sal_uInt16 nVal) { + return SfxUInt16Item(SDRATTR_3DSCENE_SHADOW_SLANT, nVal); +} + +class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) Svx3DShadeModeItem : public SfxUInt16Item { +public: + Svx3DShadeModeItem(sal_uInt16 nVal = 2); + + // use drawing::ShadeMode + SVX_DLLPRIVATE virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + SVX_DLLPRIVATE virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + SVX_DLLPRIVATE virtual Svx3DShadeModeItem* Clone(SfxItemPool* pPool = nullptr) const override; +}; + + +// #107245# Item to replace bExtrudeSmoothed and bLatheSmoothed +class Svx3DSmoothNormalsItem : public SfxBoolItem { +public: + Svx3DSmoothNormalsItem(bool bVal = true); + Svx3DSmoothNormalsItem* Clone(SfxItemPool * = nullptr) const override; +}; + +// #107245# Item to replace bExtrudeSmoothFrontBack and bLatheSmoothFrontBack +class Svx3DSmoothLidsItem : public SfxBoolItem { +public: + Svx3DSmoothLidsItem(bool bVal = false); + Svx3DSmoothLidsItem* Clone(SfxItemPool * = nullptr) const override; +}; + +// #107245# Item to replace bExtrudeCharacterMode and bLatheCharacterMode +class Svx3DCharacterModeItem : public SfxBoolItem { +public: + Svx3DCharacterModeItem(bool bVal = false); + Svx3DCharacterModeItem* Clone(SfxItemPool * = nullptr) const override; +}; + +// #107245# Item to replace bExtrudeCloseFront and bLatheCloseFront +class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) Svx3DCloseFrontItem : public SfxBoolItem { +public: + Svx3DCloseFrontItem(bool bVal = true); + Svx3DCloseFrontItem* Clone(SfxItemPool * = nullptr) const override; +}; + +// #107245# Item to replace bExtrudeCloseBack and bLatheCloseBack +class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) Svx3DCloseBackItem : public SfxBoolItem { +public: + Svx3DCloseBackItem(bool bVal = true); + Svx3DCloseBackItem* Clone(SfxItemPool * = nullptr) const override; +}; + +#endif // INCLUDED_SVX_SVX3DITEMS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx new file mode 100644 index 000000000..7fb3767ad --- /dev/null +++ b/include/svx/svxdlg.hxx @@ -0,0 +1,464 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_SVXDLG_HXX +#define INCLUDED_SVX_SVXDLG_HXX + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +namespace sd { + class View; +} + +namespace com::sun::star::linguistic2 { + class XDictionary; + class XSpellChecker1; + class XSpellChecker; + class XThesaurus; + class XHyphenator; +} +class SdrModel; +class SdrView; +class SvxSpellWrapper; +enum class TransliterationFlags; +struct ExchangeData; +class INetURLObject; +class GalleryTheme; +class SvxHyperlinkTabPageBase; +class SearchAttrItemList; +class FmFormShell; +class Graphic; +class SdrObject; +class SvxSpellWrapper; +struct FmSearchContext; + +typedef const sal_uInt16* (*DialogGetRanges)(); + +typedef ::std::vector< OUString > TargetList; + +namespace svx{ class SpellDialogChildWindow;} +namespace weld{ + class Dialog; + class Window; +} + +class AbstractSvxDistributeDialog :public VclAbstractDialog +{ +protected: + virtual ~AbstractSvxDistributeDialog() override = default; +public: + virtual SvxDistributeHorizontal GetDistributeHor() const = 0; + virtual SvxDistributeVertical GetDistributeVer() const = 0; +}; + +class AbstractFmShowColsDialog : public VclAbstractDialog +{ +protected: + virtual ~AbstractFmShowColsDialog() override = default; +public: + virtual void SetColumns(const css::uno::Reference< css::container::XIndexContainer>& xCols)= 0; +}; + +class AbstractSvxZoomDialog : public VclAbstractDialog +{ +protected: + virtual ~AbstractSvxZoomDialog() override = default; +public: + virtual void SetLimits( sal_uInt16 nMin, sal_uInt16 nMax ) = 0; + virtual void HideButton( ZoomButtonId nBtnId )= 0; + virtual const SfxItemSet* GetOutputItemSet() const = 0 ; +}; + +class AbstractSpellDialog : public VclAbstractDialog +{ +protected: + virtual ~AbstractSpellDialog() override = default; +public: + virtual void InvalidateDialog() = 0; + virtual std::shared_ptr GetController() = 0; + virtual SfxBindings& GetBindings() = 0; +}; + +class AbstractTitleDialog :public VclAbstractDialog +{ +protected: + virtual ~AbstractTitleDialog() override = default; +public: + virtual OUString GetTitle() const =0; +}; + +class AbstractGalleryIdDialog :public VclAbstractDialog +{ +protected: + virtual ~AbstractGalleryIdDialog() override = default; +public: + virtual sal_uInt32 GetId() const =0; +}; + +class AbstractURLDlg :public VclAbstractDialog +{ +protected: + virtual ~AbstractURLDlg() override = default; +public: + virtual OUString GetURL() const = 0; + virtual OUString GetAltText() const = 0; + virtual OUString GetDesc() const = 0; + virtual OUString GetTarget() const = 0; + virtual OUString GetName() const = 0; +}; + +class AbstractSvxSearchSimilarityDialog :public VclAbstractDialog +{ +protected: + virtual ~AbstractSvxSearchSimilarityDialog() override = default; +public: + virtual sal_uInt16 GetOther() =0 ; + virtual sal_uInt16 GetShorter() =0 ; + virtual sal_uInt16 GetLonger() =0 ; + virtual bool IsRelaxed() =0 ; +}; + +class AbstractSvxJSearchOptionsDialog :public VclAbstractDialog +{ +protected: + virtual ~AbstractSvxJSearchOptionsDialog() override = default; +public: + virtual TransliterationFlags GetTransliterationFlags() const = 0; +}; + +class AbstractFmInputRecordNoDialog :public VclAbstractDialog +{ +protected: + virtual ~AbstractFmInputRecordNoDialog() override = default; +public: + virtual void SetValue(long dNew) = 0; + virtual long GetValue() const = 0; +}; + +class AbstractSvxNewDictionaryDialog :public VclAbstractDialog +{ +protected: + virtual ~AbstractSvxNewDictionaryDialog() override = default; +public: + virtual css::uno::Reference< css::linguistic2::XDictionary > GetNewDictionary() = 0; +}; + +class AbstractSvxNameDialog :public VclAbstractDialog +{ +protected: + virtual ~AbstractSvxNameDialog() override = default; +public: + virtual void GetName( OUString& rName ) = 0; + virtual void SetCheckNameHdl( const Link& rLink, bool bCheckImmediately = false ) = 0; + virtual void SetCheckNameTooltipHdl( const Link& rLink ) = 0; + virtual void SetEditHelpId(const OString&) = 0; + //from class Window + virtual void SetHelpId( const OString& ) = 0; + virtual void SetText( const OUString& rStr ) = 0; +}; + +class AbstractSvxObjectNameDialog :public VclAbstractDialog +{ +protected: + virtual ~AbstractSvxObjectNameDialog() override = default; +public: + virtual void GetName(OUString& rName) = 0; + virtual void SetCheckNameHdl(const Link& rLink) = 0; +}; + +class AbstractSvxObjectTitleDescDialog :public VclAbstractDialog +{ +protected: + virtual ~AbstractSvxObjectTitleDescDialog() override = default; +public: + virtual void GetTitle(OUString& rTitle) = 0; + virtual void GetDescription(OUString& rDescription) = 0; +}; + +/// Abstract class provides the get information from the numbering and position dialog. +class AbstractSvxBulletAndPositionDlg :public VclAbstractDialog +{ +protected: + virtual ~AbstractSvxBulletAndPositionDlg() override = default; +public: + virtual const SfxItemSet* GetOutputItemSet( SfxItemSet* pSet) const = 0 ; + virtual bool IsApplyToMaster() = 0; + virtual bool IsSlideScope() = 0; +}; + +class AbstractSvxMultiPathDialog : public VclAbstractDialog +{ +protected: + virtual ~AbstractSvxMultiPathDialog() override = default; +public: + virtual OUString GetPath() const = 0; + virtual void SetPath( const OUString& rPath ) = 0; + virtual void SetTitle( const OUString& rNewTitle ) = 0; +}; + +class AbstractSvxHpLinkDlg : public VclAbstractDialog +{ +protected: + virtual ~AbstractSvxHpLinkDlg() override = default; +public: + virtual std::shared_ptr GetController() = 0; + virtual bool QueryClose() = 0; +}; + +struct FmFoundRecordInformation; +class AbstractFmSearchDialog :public VclAbstractDialog +{ +protected: + virtual ~AbstractFmSearchDialog() override = default; +public: + virtual void SetFoundHandler(const Link& lnk) = 0; + virtual void SetCanceledNotFoundHdl(const Link& lnk)=0; + virtual void SetActiveField(const OUString& strField)=0; +}; + +class AbstractGraphicFilterDialog :public VclAbstractDialog +{ +protected: + virtual ~AbstractGraphicFilterDialog() override = default; +public: + virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY ) = 0; +}; + +class AbstractSvxAreaTabDialog :public SfxAbstractTabDialog +{ +protected: + virtual ~AbstractSvxAreaTabDialog() override = default; +}; + +struct SvxSwFrameValidation; +class AbstractSvxTransformTabDialog : public SfxAbstractTabDialog +{ +protected: + virtual ~AbstractSvxTransformTabDialog() override = default; +public: + virtual void SetValidateFramePosLink( const Link& rLink ) = 0; +}; + +class AbstractSvxCaptionDialog : public SfxAbstractTabDialog +{ +protected: + virtual ~AbstractSvxCaptionDialog() override = default; +public: + virtual void SetValidateFramePosLink( const Link& rLink ) = 0; +}; + +class AbstractSvxPostItDialog : public VclAbstractDialog +{ +protected: + virtual ~AbstractSvxPostItDialog() override = default; +public: + virtual void SetText( const OUString& rStr ) = 0; //From class Window + virtual const SfxItemSet* GetOutputItemSet() const = 0; + virtual void SetPrevHdl( const Link& rLink ) = 0; + virtual void SetNextHdl( const Link& rLink ) = 0; + virtual void EnableTravel(bool bNext, bool bPrev) = 0; + virtual OUString GetNote() = 0; + virtual void SetNote(const OUString& rTxt) = 0; + virtual void ShowLastAuthor(const OUString& rAuthor, const OUString& rDate) = 0; + virtual void DontChangeAuthor() = 0; + virtual void HideAuthor() = 0; + virtual std::shared_ptr GetDialog() = 0; +}; + +class SvxAbstractSplitTableDialog : public VclAbstractDialog +{ +protected: + virtual ~SvxAbstractSplitTableDialog() override = default; +public: + virtual bool IsHorizontal() const = 0; + virtual bool IsProportional() const = 0; + virtual long GetCount() const = 0; + virtual void SetSplitVerticalByDefault() = 0; +}; + +class SvxAbstractNewTableDialog +{ +protected: + virtual ~SvxAbstractNewTableDialog() = default; +public: + virtual sal_Int32 getRows() const = 0; + virtual sal_Int32 getColumns() const = 0; + virtual std::shared_ptr getDialogController() = 0; +}; + +class SvxAbstractInsRowColDlg : public VclAbstractDialog +{ +protected: + virtual ~SvxAbstractInsRowColDlg() override = default; +public: + virtual bool isInsertBefore() const = 0; + virtual sal_uInt16 getInsertCount() const = 0; +}; + +class SVXCORE_DLLPUBLIC SvxAbstractDialogFactory : public SfxAbstractDialogFactory, public EditAbstractDialogFactory +{ +public: + static SvxAbstractDialogFactory* Create(); + + virtual ~SvxAbstractDialogFactory() override; + + virtual VclPtr CreateTextTabDialog( weld::Window* pParent, + const SfxItemSet* pAttrSet, + SdrView* pView ) = 0 ; + + virtual VclPtr CreateCaptionDialog(weld::Window* pParent, + const SdrView* pView, + SvxAnchorIds nAnchorTypes = SvxAnchorIds::NONE) = 0; + + virtual VclPtr CreateSvxDistributeDialog(weld::Window* pParent, + const SfxItemSet& rAttr)= 0; + + virtual VclPtr CreateFmShowColsDialog(weld::Window* pParent) = 0; + + virtual VclPtr CreateSvxZoomDialog(weld::Window* pParent, const SfxItemSet& rCoreSet) = 0; + + virtual VclPtr CreateSvxSpellDialog(weld::Window* pParent, + SfxBindings* pBindings, + svx::SpellDialogChildWindow* pSpellChildWindow )=0; + + virtual VclPtr CreateActualizeProgressDialog(weld::Widget* pParent, + GalleryTheme* pThm) = 0; + virtual VclPtr CreateTitleDialog(weld::Widget* pParent, + const OUString& rOldText) = 0; + virtual VclPtr CreateGalleryIdDialog(weld::Widget* pParent, + GalleryTheme* pThm) = 0; + virtual VclPtr CreateGalleryThemePropertiesDialog(weld::Widget* pParent, + ExchangeData* pData, + SfxItemSet* pItemSet ) = 0; + + virtual VclPtr CreateURLDialog(weld::Widget* pParent, + const OUString& rURL, const OUString& rAltText, const OUString& rDescription, + const OUString& rTarget, const OUString& rName, + TargetList& rTargetList ) = 0; + + virtual VclPtr CreateTabItemDialog(weld::Window* pParent, const SfxItemSet& rSet) = 0; + virtual VclPtr CreateSvxSearchAttributeDialog(weld::Window* pParent, + SearchAttrItemList& rLst, + const sal_uInt16* pWhRanges)=0; + virtual VclPtr CreateSvxSearchSimilarityDialog( weld::Window* pParent, + bool bRelax, + sal_uInt16 nOther, + sal_uInt16 nShorter, + sal_uInt16 nLonger ) = 0; + // add for SvxBorderBackgroundDlg + virtual VclPtr CreateSvxBorderBackgroundDlg( + weld::Window* pParent, + const SfxItemSet& rCoreSet, + bool bEnableDrawingLayerFillStyles) = 0; + + virtual VclPtr CreateSvxTransformTabDialog(weld::Window* pParent, + const SfxItemSet* pAttr, + const SdrView* pView, + SvxAnchorIds nAnchorTypes = SvxAnchorIds::NONE) = 0; + virtual VclPtr CreateSchTransformTabDialog(weld::Window* pParent, + const SfxItemSet* pAttr, + const SdrView* pSdrView, + bool bSizeTabPage) = 0; + virtual VclPtr CreateSvxJSearchOptionsDialog(weld::Window* pParent, + const SfxItemSet& rOptionsSet, + TransliterationFlags nInitialFlags) = 0; + virtual VclPtr CreateFmInputRecordNoDialog(weld::Window* pParent) = 0; + virtual VclPtr CreateSvxNewDictionaryDialog(weld::Window* pParent) = 0; + virtual VclPtr CreateSvxEditDictionaryDialog(weld::Window* pParent, const OUString& rName) = 0; + virtual VclPtr CreateSvxNameDialog(weld::Window* pParent, + const OUString& rName, const OUString& rDesc ) = 0; + + // #i68101# + virtual VclPtr CreateSvxObjectNameDialog(weld::Window* pParent, const OUString& rName) = 0; + virtual VclPtr CreateSvxObjectTitleDescDialog(weld::Window* pParent, const OUString& rTitle, const OUString& rDescription) = 0; + virtual VclPtr CreateSvxMultiPathDialog(weld::Window* pParent) = 0 ; + virtual VclPtr CreateSvxPathSelectDialog(weld::Window* pParent) = 0 ; + virtual VclPtr CreateSvxHpLinkDlg(SfxChildWindow* pChild, SfxBindings* pBindings, weld::Window* pParent) = 0; + virtual VclPtr CreateFmSearchDialog(weld::Window* pParent, + const OUString& strInitialText, + const ::std::vector< OUString >& _rContexts, + sal_Int16 nInitialContext, + const Link& lnkContextSupplier)=0; + virtual VclPtr CreateGraphicFilterEmboss(weld::Window* pParent, + const Graphic& rGraphic)=0; + virtual VclPtr CreateGraphicFilterPoster(weld::Window* pParent, + const Graphic& rGraphic)=0; + virtual VclPtr CreateGraphicFilterSepia(weld::Window* pParent, + const Graphic& rGraphic)=0; + virtual VclPtr CreateGraphicFilterSmooth(weld::Window* pParent, + const Graphic& rGraphic, + double nRadius)=0; + virtual VclPtr CreateGraphicFilterSolarize(weld::Window* pParent, + const Graphic& rGraphic)=0; + virtual VclPtr CreateGraphicFilterMosaic(weld::Window* pParent, + const Graphic& rGraphic)=0; + virtual VclPtr CreateSvxAreaTabDialog(weld::Window* pParent, + const SfxItemSet* pAttr, + SdrModel* pModel, + bool bShadow) = 0 ; + virtual VclPtr CreateSvxLineTabDialog(weld::Window* pParent, const SfxItemSet* pAttr, //add forSvxLineTabDialog + SdrModel* pModel, + const SdrObject* pObj, + bool bHasObj )=0; + virtual VclPtr CreateSfxDialog( weld::Window* pParent, + const SfxItemSet& rAttr, + const SdrView* pView, + sal_uInt32 nResId )=0; + virtual VclPtr CreateCharMapDialog(weld::Window* pParent, const SfxItemSet& rAttr, + const css::uno::Reference& rFrame) = 0; + virtual VclPtr CreateEventConfigDialog(weld::Widget* pParent, const SfxItemSet& rAttr, + const css::uno::Reference< css::frame::XFrame >& rFrame) = 0; + virtual VclPtr CreateSvxPostItDialog(weld::Widget* pParent, const SfxItemSet& rCoreSet, bool bPrevNext = false) = 0; + virtual VclPtr CreateSvxScriptOrgDialog(weld::Window* pParent, const OUString& rLanguage) override = 0; + + virtual DialogGetRanges GetDialogGetRangesFunc() = 0; + + virtual VclPtr CreateScriptSelectorDialog(weld::Window* pParent, + const css::uno::Reference< css::frame::XFrame >& rxFrame) override = 0; + + virtual VclPtr CreateScriptErrorDialog(const css::uno::Any& rException) override = 0; + + virtual VclPtr CreateSvxMacroAssignDlg( + weld::Window* _pParent, + const css::uno::Reference< css::frame::XFrame >& _rxDocumentFrame, + const bool _bUnoDialogMode, + const css::uno::Reference< css::container::XNameReplace >& _rxEvents, + const sal_uInt16 _nInitiallySelectedEvent + ) = 0; + + virtual VclPtr CreateSvxFormatCellsDialog(weld::Window* pParent, const SfxItemSet* pAttr, const SdrModel& rModel )=0; + + virtual VclPtr CreateSvxSplitTableDialog(weld::Window* pParent, bool bIsTableVertical, long nMaxVertical) = 0; + + virtual std::shared_ptr CreateSvxNewTableDialog(weld::Window* pParent) = 0; + + virtual VclPtr CreateSvxInsRowColDlg(weld::Window* pParent, bool bCol, const OString& rHelpId) = 0; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svxdllapi.h b/include/svx/svxdllapi.h new file mode 100644 index 000000000..3e3de30c4 --- /dev/null +++ b/include/svx/svxdllapi.h @@ -0,0 +1,40 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SVXDLLAPI_H +#define INCLUDED_SVX_SVXDLLAPI_H + +#include + +#if defined(SVX_DLLIMPLEMENTATION) +#define SVX_DLLPUBLIC SAL_DLLPUBLIC_EXPORT +#else +#define SVX_DLLPUBLIC SAL_DLLPUBLIC_IMPORT +#endif +#define SVX_DLLPRIVATE SAL_DLLPRIVATE + +#if defined(SVXCORE_DLLIMPLEMENTATION) +#define SVXCORE_DLLPUBLIC SAL_DLLPUBLIC_EXPORT +#else +#define SVXCORE_DLLPUBLIC SAL_DLLPUBLIC_IMPORT +#endif + +#endif // INCLUDED_SVX_SVXDLLAPI_H + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svxerr.hxx b/include/svx/svxerr.hxx new file mode 100644 index 000000000..ecb98cd27 --- /dev/null +++ b/include/svx/svxerr.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_SVX_SVXERR_HXX +#define INCLUDED_SVX_SVXERR_HXX + +#include +#include +#include + +#define ERRCODE_SVX_LINGU_LINGUNOTEXISTS ErrCode( ErrCodeArea::Svx, ErrCodeClass::NotExists, 3 ) +#define ERRCODE_SVX_LINGU_DICT_NOTWRITEABLE ErrCode( ErrCodeArea::Svx, ErrCodeClass::Write, 6 ) +#define ERRCODE_SVX_GRAPHIC_NOTREADABLE ErrCode( ErrCodeArea::Svx, ErrCodeClass::Read, 7 ) +#define ERRCODE_SVX_LINGU_NOLANGUAGE ErrCode( ErrCodeArea::Svx, ErrCodeClass::NotExists, 9 ) +#define ERRCODE_SVX_MODIFIED_VBASIC_STORAGE ErrCode( WarningFlag::Yes, ErrCodeArea::Svx, ErrCodeClass::Write, 13 ) +#define ERRCODE_SVX_VBASIC_STORAGE_EXIST ErrCode( WarningFlag::Yes, ErrCodeArea::Svx, ErrCodeClass::Write, 14 ) +/** Error message: "Wrong password." */ +#define ERRCODE_SVX_WRONGPASS ErrCode( ErrCodeArea::Svx, ErrCodeClass::NONE, 15) +/** Error message: "Read error. Unsupported encryption method." */ +#define ERRCODE_SVX_READ_FILTER_CRYPT ErrCode( ErrCodeArea::Svx, ErrCodeClass::Read, 16) +/** Error message: "Read error. Passwort encrypted Powerpoint documents..." */ +#define ERRCODE_SVX_READ_FILTER_PPOINT ErrCode( ErrCodeArea::Svx, ErrCodeClass::Read, 17) +/** Error message: "Warning. Passwort protection is not supported when..." */ +#define ERRCODE_SVX_EXPORT_FILTER_CRYPT ErrCode( WarningFlag::Yes, ErrCodeArea::Svx, ErrCodeClass::Export, 18) + + +// both codes will be used twice : with ErrCodeClass::Read- and ErrCodeClass::Write-bits +#define ERRCTX_SVX_LINGU_THESAURUS 1 +#define ERRCTX_SVX_LINGU_SPELLING 2 +#define ERRCTX_SVX_LINGU_HYPHENATION 3 +#define ERRCTX_SVX_LINGU_DICTIONARY 4 +#define ERRCTX_SVX_BACKGROUND 5 +#define ERRCTX_SVX_IMPORT_GRAPHIC 6 + +class SVX_DLLPUBLIC SvxErrorHandler final : private SfxErrorHandler +{ +public: + SvxErrorHandler(); + static void ensure(); +}; + +SVX_DLLPUBLIC extern const ErrMsgCode RID_SVXERRCODE[]; +SVX_DLLPUBLIC extern const ErrMsgCode RID_SVXERRCTX[]; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svxgrahicitem.hxx b/include/svx/svxgrahicitem.hxx new file mode 100644 index 000000000..6d9a757c5 --- /dev/null +++ b/include/svx/svxgrahicitem.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_SVX_SVXGRAHICITEM_HXX +#define INCLUDED_SVX_SVXGRAHICITEM_HXX + + +#include +#include + +#include + +class SVX_DLLPUBLIC SvxGraphicItem final : public SfxPoolItem +{ + Graphic aGraphic; + +public: + SvxGraphicItem( const Graphic& rGraphic); + + virtual bool operator==( const SfxPoolItem& ) const override; + virtual SvxGraphicItem* Clone( SfxItemPool *pPool = nullptr ) const override; + + const Graphic& GetGraphic() const { return aGraphic; } + +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc new file mode 100644 index 000000000..8d0c608b6 --- /dev/null +++ b/include/svx/svxids.hrc @@ -0,0 +1,1023 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_SVXIDS_HRC +#define INCLUDED_SVX_SVXIDS_HRC + +#include +#include +#include +#include + +class SfxInt32Item; +class SfxPointItem; +class SfxBoolItem; +class SfxUInt32Item; +class SfxRectangleItem; +class SvxPageItem; +class SvxSizeItem; +class SvxLongULSpaceItem; +class SvxLongLRSpaceItem; +class SvxPostItAuthorItem; +class SvxPostItDateItem; +class SvxPostItTextItem; +class SvxPostItIdItem; +class SvxColorListItem; +class SvxColorItem; +class SvxGradientListItem; +class SvxRulerItem; +class SvxNumberInfoItem; +class SvxHatchListItem; +class SvxBitmapListItem; +class SvxPatternListItem; +class SvxDashListItem; +class SvxLineEndListItem; +class SvxLineItem; +class SvxBoxInfoItem; +class SfxStringItem; +class SvxSetItem; + +// member IDs + +#define MID_INTER_LINESPACE 0x36 +#define MID_INTER_SPACE 0x37 + +#define MID_LOWER 0x3d +#define MID_RIGHT 0x46 +#define MID_UPPER 0x4b + +#define MID_HLINK_NAME 0x6f +#define MID_HLINK_URL 0x70 +#define MID_HLINK_TARGET 0x71 +#define MID_HLINK_TYPE 0x72 +#define MID_HLINK_TEXT 0x73 + +#define MID_VIEWLAYOUT_COLUMNS 0x77 +#define MID_VIEWLAYOUT_BOOKMODE 0x78 + +#define MID_ZOOMSLIDER_CURRENTZOOM 0x79 +#define MID_ZOOMSLIDER_SNAPPINGPOINTS 0x7a +#define MID_ZOOMSLIDER_MINZOOM 0x7b +#define MID_ZOOMSLIDER_MAXZOOM 0x7c + +// function IDs +#define FID_SVX_START (SID_LIB_START + 500) + +#define FID_SEARCH_ON (FID_SVX_START + 0) +#define FID_SEARCH_OFF (FID_SVX_START + 1) +#define FID_SEARCH_NOW (FID_SVX_START + 2) + +#define SID_CHARMAP (FID_SVX_START + 3) + +#define FID_SEARCH_SEARCHSET (FID_SVX_START + 4) +#define FID_SEARCH_REPLACESET (FID_SVX_START + 5) + +// SFX IDs + +#define SID_POLY_MERGE (SID_SFX_START + 679) +#define SID_POLY_SUBSTRACT (SID_SFX_START + 680) +#define SID_POLY_INTERSECT (SID_SFX_START + 681) +#define SID_DISTRIBUTE_DLG (SID_SFX_START + 683) +#define SID_EQUALIZEWIDTH (SID_SFX_START + 684) +#define SID_EQUALIZEHEIGHT (SID_SFX_START + 685) + +// StarBase IDs + +#define SID_SBA_BRW_UPDATE (SID_SBA_START+100) // data in fields +#define SID_SBA_BRW_INSERT (SID_SBA_START+101) // data in text +#define SID_SBA_BRW_MERGE (SID_SBA_START+102) // form letter + +// SD IDs + +#define SID_RULER (SID_SD_START+40) +#define SID_BEZIER_CONVERT (SID_SD_START+65) +#define SID_BEZIER_ELIMINATE_POINTS (SID_SD_START+30) +#define SID_BEZIER_EDGE (SID_SD_START+66) +#define SID_BEZIER_SYMMTR (SID_SD_START+67) +#define SID_TEXTEDIT (SID_SD_START+76) +#define SID_ENTER_GROUP (SID_SD_START+96) +#define SID_LEAVE_GROUP (SID_SD_START+97) +#define SID_SIZE_PAGE_WIDTH (SID_SD_START+98) +#define SID_INSERT_MATH (SID_SD_START+106) +#define SID_SIZE_VISAREA (SID_SD_START+114) +#define SID_ATTR_SYMBOLTYPE (SID_SD_START+115) // used by Chart and SvxLineTabPage +#define SID_ATTR_SYMBOLSIZE (SID_SD_START+116) +#define SID_HELPLINES_MOVE (SID_SD_START+153) +#define SID_GRID_USE (SID_SD_START+154) +#define ID_VAL_MOUSESTART_X (SID_SD_START+200) +#define ID_VAL_MOUSESTART_Y (SID_SD_START+201) + // free +#define ID_VAL_MOUSEEND_X (SID_SD_START+204) +#define ID_VAL_MOUSEEND_Y (SID_SD_START+205) +#define ID_VAL_AXIS_X (SID_SD_START+206) +#define ID_VAL_AXIS_Y (SID_SD_START+207) +#define ID_VAL_ANGLESTART (SID_SD_START+208) +#define ID_VAL_ANGLEEND (SID_SD_START+209) +#define ID_VAL_CENTER_X (SID_SD_START+210) +#define ID_VAL_CENTER_Y (SID_SD_START+211) +#define ID_VAL_STYLE (SID_SD_START+240) +#define ID_VAL_DOTS (SID_SD_START+241) +#define ID_VAL_DOTLEN (SID_SD_START+242) +#define ID_VAL_DASHES (SID_SD_START+243) +#define ID_VAL_DASHLEN (SID_SD_START+244) +#define ID_VAL_DISTANCE (SID_SD_START+245) +#define ID_VAL_INDEX (SID_SD_START+246) +#define SID_BEZIERTO (SID_SD_START+252) +#define SID_DASH (SID_SD_START+267) +#define SID_TEXT_FITTOSIZE_VERTICAL (SID_SD_START+286) +#define SID_GRID_VISIBLE (SID_SD_START+322) +#define ID_VAL_USEFIRSTROWSTYLE (SID_SD_START+323) +#define ID_VAL_USELASTROWSTYLE (SID_SD_START+324) +#define ID_VAL_USEBANDINGROWSTYLE (SID_SD_START+325) +#define ID_VAL_USEFIRSTCOLUMNSTYLE (SID_SD_START+326) +#define ID_VAL_USELASTCOLUMNSTYLE (SID_SD_START+327) +#define ID_VAL_USEBANDINGCOLUMNSTYLE (SID_SD_START+328) + +// Writer IDs + +#define FN_EDIT (SID_SW_START + 100) +#define FN_NUM_BULLET_OFF (FN_EDIT + 37) // numbering off +#define FN_NUM_BULLET_ON (FN_EDIT + 38) // numbering with bullets on +#define FN_NUM_NUMBERING_ON (FN_EDIT + 44) // numbering on +#define FN_BUL_NUM_RULE_INDEX (FN_EDIT + 120) // achieving num rule index +#define FN_NUM_NUM_RULE_INDEX (FN_EDIT + 121) +#define FN_OUTLINE_RULE_INDEX (FN_EDIT + 122) + +#define FN_INSERT (SID_SW_START + 300) +#define FN_DELETE_BOOKMARK (FN_INSERT + 1) +#define FN_INSERT_BREAK (FN_INSERT + 3) +#define FN_INSERT_SOFT_HYPHEN (FN_INSERT + 43) /* optional hyphen */ +#define FN_INSERT_HARD_SPACE (FN_INSERT + 44) /* hard space */ +#define FN_INSERT_NNBSP (FN_INSERT + 45) /* U+202F NARROW NO-BREAK SPACE (NNBSP) */ +#define FN_INSERT_HARDHYPHEN (FN_INSERT + 85) /* hyphen without break*/ + +//!! be aware to not overwrite something that is used in sw/inc/cmdid.h already !! +#define FN_FORMAT (SID_SW_START + 400) +#define FN_FORMAT_RESET (FN_FORMAT + 69) + +#define FN_EXTRA (SID_SW_START + 600) + +#define FN_SELECTION (SID_SW_START + 900) +#define FN_END_OF_DOCUMENT (FN_SELECTION + 8) +#define FN_START_DOC_DIRECT (FN_SELECTION + 78) +#define FN_END_DOC_DIRECT (FN_SELECTION + 79) + +#define FN_PARAM (SID_SW_START + 1100) +#define FN_PARAM_FILTER (FN_PARAM + 30) +#define FN_PARAM_FIELD_CONTENT (FN_PARAM + 55) + +#define FN_PGPREVIEW (SID_SW_START + 1250) +#define FN_SHOW_MULTIPLE_PAGES (FN_PGPREVIEW + 2) + +// Svx-Id's +// When adding new entries here, note that other SID_SVX_START entries exist in +// include/editeng/editids.hrc and include/sfx2/sfxsids.hrc so don't use the +// same id for two different attributes + +// CAUTION! Range <1 .. 22> used by EditEngine (!) + +#define SID_ATTR_BORDER_INNER TypedWhichId( SID_SVX_START + 23 ) + +// CAUTION! Range <24 .. 43> used by EditEngine (!) + +#define SID_ATTR_POSTIT_AUTHOR TypedWhichId( SID_SVX_START + 44 ) +#define SID_ATTR_POSTIT_DATE TypedWhichId( SID_SVX_START + 45 ) +#define SID_ATTR_POSTIT_TEXT TypedWhichId( SID_SVX_START + 46 ) +#define SID_ATTR_POSTIT_ID TypedWhichId( SID_SVX_START + 47 ) +// free + +// CAUTION! Range <48 .. 49> used by EditEngine (!) + +#define SID_ATTR_PAGE TypedWhichId( SID_SVX_START + 50 ) +#define SID_ATTR_PAGE_SIZE TypedWhichId( SID_SVX_START + 51 ) +#define SID_ATTR_PAGE_MAXSIZE TypedWhichId( SID_SVX_START + 52 ) +#define SID_ATTR_PAGE_ORIENTATION TypedWhichId( SID_SVX_START + 53 ) +#define SID_ATTR_PAGE_PAPERBIN TypedWhichId( SID_SVX_START + 54 ) +// this is used both as a SfxBoolItem(sd/source/ui/func/fupage.cxx) and as a SfxStringItem(sw/source/uibase/utlui/uitool.cxx) +#define SID_ATTR_PAGE_EXT1 ( SID_SVX_START + 55 ) +#define SID_ATTR_PAGE_EXT2 TypedWhichId( SID_SVX_START + 56 ) +#define SID_ATTR_PAGE_HEADERSET TypedWhichId( SID_SVX_START + 57 ) +#define SID_ATTR_PAGE_FOOTERSET TypedWhichId( SID_SVX_START + 58 ) +#define SID_ATTR_PAGE_ON TypedWhichId( SID_SVX_START + 59 ) +#define SID_ATTR_PAGE_DYNAMIC TypedWhichId( SID_SVX_START + 60 ) +#define SID_ATTR_PAGE_SHARED TypedWhichId( SID_SVX_START + 61 ) +#define SID_ATTR_PAGE_LRSPACE TypedWhichId( SID_SVX_START + 62 ) +#define SID_ATTR_PAGE_ULSPACE TypedWhichId( SID_SVX_START + 63 ) + +// CAUTION! Range <64 .. 67> used by EditEngine (!) + +#define SID_RULER_CHANGE_STATE ( SID_SVX_START + 78 ) +#define SID_RULER_NULL_OFFSET TypedWhichId( SID_SVX_START + 79 ) +#define SID_RULER_BORDERS TypedWhichId( SID_SVX_START + 80 ) +#define SID_RULER_OBJECT TypedWhichId( SID_SVX_START + 81 ) +#define SID_RULER_PAGE_POS TypedWhichId( SID_SVX_START + 82 ) +#define SID_RULER_ACT_LINE_ONLY TypedWhichId( SID_SVX_START + 83 ) +#define SID_RULER_LR_MIN_MAX TypedWhichId( SID_SVX_START + 84 ) +#define SID_ATTR_NUMBERFORMAT_VALUE TypedWhichId( SID_SVX_START + 85 ) +#define SID_ATTR_NUMBERFORMAT_INFO TypedWhichId( SID_SVX_START + 86 ) +#define SID_ATTR_TRANSFORM TypedWhichId( SID_SVX_START + 87 ) +#define SID_ATTR_TRANSFORM_POS_X TypedWhichId( SID_SVX_START + 88 ) +#define SID_ATTR_TRANSFORM_POS_Y TypedWhichId( SID_SVX_START + 89 ) +#define SID_ATTR_TRANSFORM_WIDTH TypedWhichId( SID_SVX_START + 90 ) +#define SID_ATTR_TRANSFORM_HEIGHT TypedWhichId( SID_SVX_START + 91 ) +#define SID_ATTR_TRANSFORM_SIZE_POINT TypedWhichId( SID_SVX_START + 92 ) +#define SID_ATTR_TRANSFORM_ROT_X TypedWhichId( SID_SVX_START + 93 ) +#define SID_ATTR_TRANSFORM_ROT_Y TypedWhichId( SID_SVX_START + 94 ) +#define SID_ATTR_TRANSFORM_ANGLE TypedWhichId( SID_SVX_START + 95 ) +#define SID_ATTR_TRANSFORM_DELTA_ANGLE TypedWhichId( SID_SVX_START + 96 ) +// CAUTION! Range <96..100> used by SFX2 (!) +#define SID_SIZE_ALL ( SID_SVX_START + 101 ) +#define SID_DRAW_LINE ( SID_SVX_START + 102 ) +#define SID_DRAW_XLINE ( SID_SVX_START + 103 ) +#define SID_DRAW_RECT ( SID_SVX_START + 104 ) +#define SID_DRAW_RECT_ROUND ( SID_SVX_START + 105 ) +#define SID_TABLE_CHANGE_CURRENT_BORDER_POSITION ( SID_SVX_START + 106 ) +#define SID_DRAW_ELLIPSE ( SID_SVX_START + 110 ) +#define SID_DRAW_PIE ( SID_SVX_START + 112 ) +#define SID_DRAW_ARC ( SID_SVX_START + 114 ) +#define SID_DRAW_CIRCLECUT ( SID_SVX_START + 115 ) +#define SID_DRAW_POLYGON ( SID_SVX_START + 117 ) +#define SID_DRAW_BEZIER_FILL ( SID_SVX_START + 118 ) +#define SID_BEZIER_INSERT ( SID_SVX_START + 119 ) +#define SID_BEZIER_DELETE ( SID_SVX_START + 120 ) +#define SID_BEZIER_MOVE ( SID_SVX_START + 121 ) +#define SID_BEZIER_CLOSE TypedWhichId( SID_SVX_START + 122 ) +#define SID_BEZIER_SMOOTH TypedWhichId( SID_SVX_START + 123 ) +#define SID_BEZIER_EDIT ( SID_SVX_START + 126 ) +#define SID_BEZIER_CUTLINE ( SID_SVX_START + 127 ) +#define SID_OBJECT_SELECT ( SID_SVX_START + 128 ) +#define SID_OBJECT_ROTATE TypedWhichId( SID_SVX_START + 129 ) +#define SID_OBJECT_ALIGN ( SID_SVX_START + 130 ) +#define SID_OBJECT_ALIGN_LEFT ( SID_SVX_START + 131 ) +#define SID_OBJECT_ALIGN_CENTER ( SID_SVX_START + 132 ) +#define SID_OBJECT_ALIGN_RIGHT ( SID_SVX_START + 133 ) +#define SID_OBJECT_ALIGN_UP ( SID_SVX_START + 134 ) +#define SID_OBJECT_ALIGN_MIDDLE ( SID_SVX_START + 135 ) +#define SID_OBJECT_ALIGN_DOWN ( SID_SVX_START + 136 ) +#define SID_INSERT_DIAGRAM ( SID_SVX_START + 140 ) +#define SID_INSERT_TABLE ( SID_SVX_START + 141 ) +#define SID_ATTRIBUTES_AREA ( SID_SVX_START + 142 ) +#define SID_ATTRIBUTES_LINE ( SID_SVX_START + 143 ) +#define SID_CHOOSE_CONTROLS ( SID_SVX_START + 144 ) +#define SID_INSERT_PUSHBUTTON ( SID_SVX_START + 146 ) +#define SID_INSERT_RADIOBUTTON ( SID_SVX_START + 147 ) +#define SID_INSERT_CHECKBOX ( SID_SVX_START + 148 ) +#define SID_OUTLINE_UP ( SID_SVX_START + 150 ) +#define SID_OUTLINE_DOWN ( SID_SVX_START + 151 ) +#define SID_OUTLINE_LEFT ( SID_SVX_START + 152 ) +#define SID_OUTLINE_RIGHT ( SID_SVX_START + 153 ) +#define SID_OUTLINE_FORMAT ( SID_SVX_START + 154 ) +#define SID_OUTLINE_COLLAPSE_ALL ( SID_SVX_START + 155 ) +#define SID_OUTLINE_BULLET ( SID_SVX_START + 156 ) +#define SID_PRESENTATION ( SID_SVX_START + 157 ) +#define SID_PRESENTATION_CURRENT_SLIDE ( SID_SVX_START + 158 ) +#define SID_REHEARSE_TIMINGS ( SID_SVX_START + 159 ) +// +#define SID_HIDE_SLIDE ( SID_SVX_START + 161 ) +#define SID_ATTR_FILL_STYLE ( SID_SVX_START + 164 ) +#define SID_ATTR_FILL_COLOR ( SID_SVX_START + 165 ) +#define SID_ATTR_FILL_GRADIENT ( SID_SVX_START + 166 ) +#define SID_ATTR_FILL_HATCH ( SID_SVX_START + 167 ) +#define SID_ATTR_FILL_BITMAP ( SID_SVX_START + 168 ) +#define SID_ATTR_LINE_STYLE ( SID_SVX_START + 169 ) +#define SID_ATTR_LINE_DASH ( SID_SVX_START + 170 ) +#define SID_ATTR_LINE_WIDTH ( SID_SVX_START + 171 ) +#define SID_ATTR_LINE_COLOR ( SID_SVX_START + 172 ) +#define SID_ATTR_LINE_START ( SID_SVX_START + 173 ) +#define SID_ATTR_LINE_END ( SID_SVX_START + 174 ) +#define SID_ATTR_LINE_STARTWIDTH ( SID_SVX_START + 175 ) +#define SID_ATTR_LINE_ENDWIDTH ( SID_SVX_START + 176 ) +#define SID_ATTR_LINE_STARTCENTER ( SID_SVX_START + 177 ) +#define SID_ATTR_LINE_ENDCENTER ( SID_SVX_START + 178 ) +#define SID_COLOR_TABLE TypedWhichId( SID_SVX_START + 179 ) +#define SID_GRADIENT_LIST TypedWhichId( SID_SVX_START + 180 ) +#define SID_HATCH_LIST TypedWhichId( SID_SVX_START + 181 ) +#define SID_BITMAP_LIST TypedWhichId( SID_SVX_START + 182 ) +#define SID_PATTERN_LIST TypedWhichId( SID_SVX_START + 183 ) +#define SID_DASH_LIST TypedWhichId( SID_SVX_START + 184 ) +#define SID_LINEEND_LIST TypedWhichId( SID_SVX_START + 185 ) +#define SID_BACKGROUND_COLOR TypedWhichId( SID_SVX_START + 186 ) +#define SID_BACKGROUND_PATTERN ( SID_SVX_START + 187 ) +#define SID_ATTR_BORDER ( SID_SVX_START + 188 ) +#define SID_INSERT_FIXEDTEXT ( SID_SVX_START + 189 ) +#define SID_INSERT_GROUPBOX ( SID_SVX_START + 190 ) +#define SID_INSERT_EDIT ( SID_SVX_START + 191 ) +#define SID_INSERT_LISTBOX ( SID_SVX_START + 192 ) +#define SID_INSERT_COMBOBOX ( SID_SVX_START + 193 ) +#define SID_INSERT_SPINBUTTON ( SID_SVX_START + 194 ) +#define SID_INSERT_HSCROLLBAR ( SID_SVX_START + 195 ) +#define SID_INSERT_VSCROLLBAR ( SID_SVX_START + 196 ) +#define SID_INSERT_SELECT ( SID_SVX_START + 199 ) +#define SID_DIALOG_TESTMODE ( SID_SVX_START + 200 ) +#define SID_FRAME_LINESTYLE TypedWhichId( SID_SVX_START + 201 ) +#define SID_FRAME_LINECOLOR TypedWhichId( SID_SVX_START + 202 ) +#define SID_ATTR_LINE_WIDTH_ARG ( SID_SVX_START + 203 ) +#define SID_FILL_GRADIENT_JSON ( SID_SVX_START + 204 ) +#define SID_SEARCHDLG_SEARCHSTRINGS ( SID_SVX_START + 215 ) +#define SID_SEARCHDLG_REPLACESTRINGS ( SID_SVX_START + 216 ) +#define SID_ATTR_TABLE ( SID_SVX_START + 217 ) +#define SID_ATTR_TABLE_COLUMN TypedWhichId( SID_SVX_START + 218 ) +#define SID_ATTR_TABLE_ROW TypedWhichId( SID_SVX_START + 219 ) +#define SID_ATTR_COLUMNS TypedWhichId( SID_SVX_START + 220 ) +#define SID_ATTR_INSERT TypedWhichId( SID_SVX_START + 221 ) +#define SID_ATTR_ZOOM_USER TypedWhichId( SID_SVX_START + 222 ) +#define SID_ATTR_POSITION TypedWhichId( SID_SVX_START + 223 ) +#define SID_ATTR_SIZE TypedWhichId( SID_SVX_START + 224 ) +#define SID_TABLE_CELL ( SID_SVX_START + 225 ) +#define SID_ATTR_ALIGN_MARGIN ( SID_SVX_START + 228 ) +#define SID_ATTR_ALIGN_STACKED ( SID_SVX_START + 229 ) +#define SID_ATTR_ALIGN_LINEBREAK ( SID_SVX_START + 230 ) +#define SID_OUTLINE_COLLAPSE ( SID_SVX_START + 231 ) +#define SID_OUTLINE_EXPAND_ALL ( SID_SVX_START + 232 ) +#define SID_OUTLINE_EXPAND ( SID_SVX_START + 233 ) +#define SID_OUTLINE_DELETEALL ( SID_SVX_START + 234 ) +#define SID_ATTR_TRANSFORM_PROTECT_POS TypedWhichId( SID_SVX_START + 236 ) +#define SID_ATTR_TRANSFORM_PROTECT_SIZE TypedWhichId( SID_SVX_START + 237 ) +#define SID_ATTR_TRANSFORM_AUTOSIZE ( SID_SVX_START + 238 ) // !!! +#define SID_ATTR_TRANSFORM_INTERN TypedWhichId( SID_SVX_START + 239 ) +#define SID_INSERT_FRAME ( SID_SVX_START + 240 ) +#define SID_INSERT_GRAPHIC TypedWhichId( SID_SVX_START + 241 ) +#define SID_AUTOFORMAT TypedWhichId( SID_SVX_START + 242 ) +#define SID_SPELL_DIALOG ( SID_SVX_START + 243 ) +#define SID_INSERT_DRAW ( SID_SVX_START + 244 ) +#define SID_THESAURUS ( SID_SVX_START + 245 ) +#define SID_SPELLCHECK_IGNORE ( SID_SVX_START + 246 ) +#define SID_SPELLCHECK_IGNORE_ALL ( SID_SVX_START + 247 ) +#define SID_SPELLCHECK_APPLY_SUGGESTION ( SID_SVX_START + 248 ) + +// CAUTION! Range <250 .. 250> used by EditEngine (!) + +#define SID_DRAW_TEXT ( SID_SVX_START + 253 ) +#define SID_DRAW_CAPTION ( SID_SVX_START + 254 ) +#define SID_DRAW_SELECT ( SID_SVX_START + 255 ) +#define SID_FONTWORK ( SID_SVX_START + 256 ) +#define SID_FORMTEXT_STYLE ( SID_SVX_START + 257 ) +#define SID_FORMTEXT_ADJUST ( SID_SVX_START + 258 ) +#define SID_FORMTEXT_DISTANCE ( SID_SVX_START + 259 ) +#define SID_FORMTEXT_START ( SID_SVX_START + 260 ) +#define SID_FORMTEXT_MIRROR ( SID_SVX_START + 261 ) +#define SID_FORMTEXT_OUTLINE ( SID_SVX_START + 262 ) +#define SID_FORMTEXT_SHADOW ( SID_SVX_START + 263 ) +#define SID_FORMTEXT_SHDWCOLOR ( SID_SVX_START + 264 ) +#define SID_FORMTEXT_SHDWXVAL ( SID_SVX_START + 265 ) +#define SID_FORMTEXT_SHDWYVAL ( SID_SVX_START + 266 ) +#define SID_FORMTEXT_HIDEFORM ( SID_SVX_START + 268 ) +#define SID_GALLERY_ENABLE_ADDCOPY ( SID_SVX_START + 276 ) +#define SID_GALLERY_BG_POS ( SID_SVX_START + 278 ) +#define SID_GALLERY_FORMATS ( SID_SVX_START + 280 ) +#define SID_OBJECT_HELL ( SID_SVX_START + 282 ) +#define SID_OBJECT_HEAVEN ( SID_SVX_START + 283 ) +#define SID_ATTR_LONG_ULSPACE ( SID_SVX_START + 284 ) +#define SID_ATTR_LONG_LRSPACE ( SID_SVX_START + 285 ) +#define SID_FRAME_TO_TOP ( SID_SVX_START + 286 ) +#define SID_FRAME_TO_BOTTOM ( SID_SVX_START + 287 ) +#define SID_SEARCH_SEARCHSET ( SID_SVX_START + 292 ) +#define SID_SEARCH_REPLACESET ( SID_SVX_START + 293 ) +#define SID_SET_SUPER_SCRIPT ( SID_SVX_START + 294 ) +#define SID_SET_SUB_SCRIPT ( SID_SVX_START + 295 ) +#define SID_CHAR_DLG ( SID_SVX_START + 296 ) +#define SID_PARA_DLG ( SID_SVX_START + 297 ) +#define SID_ATTR_GRID_OPTIONS ( SID_SVX_START + 298 ) +#define SID_ATTR_FILL_SHADOW ( SID_SVX_START + 299 ) + +// CAUTION! Range <300 .. 300> used by EditEngine (!) + +#define SID_ATTR_LINEEND_STYLE ( SID_SVX_START + 301 ) +#define SID_ATTR_TRANSFORM_SHEAR ( SID_SVX_START + 304 ) +#define SID_ATTR_TRANSFORM_SHEAR_X ( SID_SVX_START + 305 ) +#define SID_ATTR_TRANSFORM_SHEAR_Y ( SID_SVX_START + 306 ) +#define SID_ATTR_TRANSFORM_SHEAR_VERTICAL ( SID_SVX_START + 307 ) +#define SID_ATTR_TRANSFORM_RESIZE_REF_X ( SID_SVX_START + 308 ) +#define SID_ATTR_TRANSFORM_RESIZE_REF_Y ( SID_SVX_START + 309 ) +#define SID_ATTR_TRANSFORM_AUTOWIDTH ( SID_SVX_START + 310 ) +#define SID_ATTR_TRANSFORM_AUTOHEIGHT ( SID_SVX_START + 311 ) +#define SID_ATTR_TRANSFORM_HORI_RELATION ( SID_SVX_START + 312 ) +#define SID_ATTR_TRANSFORM_VERT_RELATION ( SID_SVX_START + 313 ) +#define SID_ATTR_TRANSFORM_HORI_ORIENT ( SID_SVX_START + 314 ) +#define SID_ATTR_TRANSFORM_IN_VERTICAL_TEXT ( SID_SVX_START + 315 ) +#define SID_ATTR_TRANSFORM_IN_RTL_TEXT ( SID_SVX_START + 316 ) +#define SID_ATTR_TRANSFORM_HORI_MIRROR ( SID_SVX_START + 317 ) +#define SID_ATTR_TRANSFORM_ANCHOR ( SID_SVX_START + 318 ) +#define SID_ATTR_TRANSFORM_VERT_ORIENT ( SID_SVX_START + 319 ) +#define SID_ATTR_GLOW_RADIUS ( SID_SVX_START + 320 ) +#define SID_ATTR_GLOW_COLOR ( SID_SVX_START + 321 ) +#define SID_ATTR_GLOW_TRANSPARENCY ( SID_SVX_START + 322 ) +#define SID_ATTR_SOFTEDGE_RADIUS ( SID_SVX_START + 323 ) +#define SID_SCAN ( SID_SVX_START + 330 ) +#define SID_TWAIN_SELECT ( SID_SVX_START + 331 ) +#define SID_TWAIN_TRANSFER ( SID_SVX_START + 332 ) +#define SID_CONTOUR_DLG ( SID_SVX_START + 334 ) +#define SID_CONTOUR_EXEC ( SID_SVX_START + 335 ) + +//#define SID_SIDEBAR ( SID_SVX_START + 336 ) -> sfxsids.hrc + +#define SID_SB_CONNECTIONPOOLING ( SID_SVX_START + 348 ) +#define SID_SB_DBREGISTEROPTIONS ( SID_SVX_START + 349 ) +#define SID_BMPMASK ( SID_SVX_START + 350 ) +#define SID_BMPMASK_PIPETTE ( SID_SVX_START + 351 ) +#define SID_BMPMASK_EXEC ( SID_SVX_START + 353 ) + +// CAUTION! Range <363 .. 363> used by EditEngine (!) + +#define SID_ATTR_TEXT_FITTOSIZE ( SID_SVX_START + 367 ) +#define SID_ATTR_BRUSH_ROW ( SID_SVX_START + 368 ) +#define SID_OPTFILTER_MSOFFICE ( SID_SVX_START + 369 ) +#define SID_IMAP ( SID_SVX_START + 371 ) +#define SID_IMAP_EXEC ( SID_SVX_START + 374 ) +#define SID_DRAW_RECT_NOFILL ( SID_SVX_START + 378 ) +#define SID_DRAW_RECT_ROUND_NOFILL ( SID_SVX_START + 379 ) +#define SID_DRAW_SQUARE ( SID_SVX_START + 380 ) +#define SID_DRAW_SQUARE_ROUND ( SID_SVX_START + 381 ) +#define SID_DRAW_SQUARE_NOFILL ( SID_SVX_START + 382 ) +#define SID_DRAW_SQUARE_ROUND_NOFILL ( SID_SVX_START + 383 ) +#define SID_DRAW_ELLIPSE_NOFILL ( SID_SVX_START + 384 ) +#define SID_DRAW_CIRCLE ( SID_SVX_START + 385 ) +#define SID_DRAW_CIRCLE_NOFILL ( SID_SVX_START + 386 ) +#define SID_DRAW_PIE_NOFILL ( SID_SVX_START + 387 ) +#define SID_DRAW_CIRCLEPIE ( SID_SVX_START + 388 ) +#define SID_DRAW_CIRCLEPIE_NOFILL ( SID_SVX_START + 389 ) +#define SID_DRAW_CIRCLEARC ( SID_SVX_START + 390 ) +#define SID_DRAW_CIRCLECUT_NOFILL ( SID_SVX_START + 391 ) +#define SID_DRAW_ELLIPSECUT ( SID_SVX_START + 392 ) +#define SID_DRAW_ELLIPSECUT_NOFILL ( SID_SVX_START + 393 ) +#define SID_DRAW_XPOLYGON ( SID_SVX_START + 394 ) +#define SID_DRAW_POLYGON_NOFILL ( SID_SVX_START + 395 ) +#define SID_DRAW_XPOLYGON_NOFILL ( SID_SVX_START + 396 ) +#define SID_DRAW_BEZIER_NOFILL ( SID_SVX_START + 397 ) +#define SID_DRAWTBX_TEXT ( SID_SVX_START + 398 ) +#define SID_DRAWTBX_RECTANGLES ( SID_SVX_START + 399 ) +#define SID_DRAWTBX_ELLIPSES ( SID_SVX_START + 400 ) +#define SID_DRAWTBX_LINES ( SID_SVX_START + 401 ) +#define SID_BACKGRND_DESTINATION ( SID_SVX_START + 404 ) +#define SID_ATTR_FLASH ( SID_SVX_START + 406 ) + +// CAUTION! Range <413 .. 413> used by EditEngine (!) + +#define SID_DRAWTBX_REDACTED_EXPORT ( SID_SVX_START + 606 ) + +#define SID_ATTR_3D_START ( SID_SVX_START + 415 ) +#define SID_RULER_PROTECT SID_ATTR_3D_START +#define SID_COLOR_CONTROL ( SID_SVX_START + 417 ) + +#define SID_TABLE_INSERT_COL_BEFORE ( SID_SVX_START + 418 ) +#define SID_TABLE_INSERT_COL_AFTER ( SID_SVX_START + 419 ) +#define SID_TABLE_INSERT_ROW_BEFORE ( SID_SVX_START + 420 ) +#define SID_TABLE_INSERT_ROW_AFTER ( SID_SVX_START + 421 ) + +#define SID_ATTR_3D_INTERN ( SID_SVX_START + 422 ) +#define SID_PSZ_FUNCTION ( SID_SVX_START + 423 ) + +// CAUTION! <424 > used by sfxids (!) +#define SID_TABLE_INSERT_COL_DLG ( SID_SVX_START + 426 ) +#define SID_TABLE_INSERT_ROW_DLG ( SID_SVX_START + 427 ) +#define SID_TABLE_PARAM_INSERT_AFTER ( SID_SVX_START + 428 ) + +#define SID_TABLEDESIGN ( SID_SVX_START + 429 ) +#define SID_GENERAL_OPTIONS ( SID_SVX_START + 432 ) +#define SID_SW_EDITOPTIONS ( SID_SVX_START + 433 ) +#define SID_SD_EDITOPTIONS ( SID_SVX_START + 434 ) +#define SID_SC_EDITOPTIONS ( SID_SVX_START + 435 ) +#define SID_SM_EDITOPTIONS ( SID_SVX_START + 436 ) +#define SID_SCH_EDITOPTIONS ( SID_SVX_START + 437 ) +#define SID_SW_ONLINEOPTIONS ( SID_SVX_START + 439 ) +#define SID_GET_COLORLIST ( SID_SVX_START + 441 ) +#define SID_OUTLINE_TO_IMPRESS ( SID_SVX_START + 443 ) +#define SID_SPELLCHECKER_CHANGED ( SID_SVX_START + 446 ) +#define SID_SD_GRAPHIC_OPTIONS ( SID_SVX_START + 447 ) +#define SID_SM_TP_PRINTOPTIONS ( SID_SVX_START + 448 ) +#define SID_SB_STARBASEOPTIONS ( SID_SVX_START + 450 ) +#define SID_SWREGISTER_COLLECTION ( SID_SVX_START + 451 ) +#define SID_FILTER_DLG ( SID_SVX_START + 452 ) +#define SID_ATTR_BRUSH_TABLE ( SID_SVX_START + 453 ) +#define SID_GROUP ( SID_SVX_START + 454 ) +#define SID_UNGROUP ( SID_SVX_START + 455 ) +#define SID_SET_DEFAULT ( SID_SVX_START + 456 ) + +// CAUTION! Range <457 .. 457> used by EditEngine (!) + +#define SID_REMOVE_HYPERLINK ( SID_SVX_START + 459 ) +#define SID_ATTR_ALIGN_INDENT ( SID_SVX_START + 460 ) +#define SID_DEC_INDENT ( SID_SVX_START + 461 ) +#define SID_INC_INDENT ( SID_SVX_START + 462 ) +#define SID_DRAW_FREELINE ( SID_SVX_START + 463 ) +#define SID_DRAW_FREELINE_NOFILL ( SID_SVX_START + 464 ) +#define SID_DRAW_TEXT_MARQUEE ( SID_SVX_START + 465 ) +#define SID_SWREGISTER_MODE ( SID_SVX_START + 467 ) +#define SID_GRFFILTER ( SID_SVX_START + 469 ) +#define SID_GRFFILTER_INVERT ( SID_SVX_START + 470 ) +#define SID_GRFFILTER_SMOOTH ( SID_SVX_START + 471 ) +#define SID_GRFFILTER_SHARPEN ( SID_SVX_START + 472 ) +#define SID_GRFFILTER_REMOVENOISE ( SID_SVX_START + 473 ) +#define SID_GRFFILTER_SOBEL ( SID_SVX_START + 474 ) +#define SID_GRFFILTER_MOSAIC ( SID_SVX_START + 475 ) +#define SID_GRFFILTER_EMBOSS ( SID_SVX_START + 476 ) +#define SID_GRFFILTER_POSTER ( SID_SVX_START + 477 ) +#define SID_GRFFILTER_POPART ( SID_SVX_START + 478 ) +#define SID_GRFFILTER_SEPIA ( SID_SVX_START + 479 ) +#define SID_GRFFILTER_SOLARIZE ( SID_SVX_START + 480 ) +#define SID_FIELD_GRABFOCUS ( SID_SVX_START + 567 ) +#define SID_ATTR_ALIGN_DEGREES ( SID_SVX_START + 577 ) +#define SID_ATTR_ALIGN_LOCKPOS ( SID_SVX_START + 578 ) +#define SID_ATTR_NUMBERFORMAT_ONE_AREA ( SID_SVX_START + 580 ) +#define SID_TABSTOP_ADD_OR_CHANGE ( SID_SVX_START + 581 ) +#define SID_TABSTOP_ATTR_INDEX ( SID_SVX_START + 582 ) +#define SID_TABSTOP_ATTR_POSITION ( SID_SVX_START + 583 ) +#define SID_TABSTOP_ATTR_REMOVE ( SID_SVX_START + 584 ) + +// CAUTION! Range <587 .. 587> used by EditEngine (!) + +#define SID_PARAGRAPH_FIRST_LINE_INDENT ( SID_SVX_START + 588 ) +#define SID_PARAGRAPH_LEFT_INDENT ( SID_SVX_START + 589 ) +#define SID_PARAGRAPH_RIGHT_INDENT ( SID_SVX_START + 590 ) + +// CAUTION! Range <591 .. 591> used by EditEngine (!) + +#define SID_FMSLOTS_START ( SID_SVX_START + 592 ) +#define SID_FM_CONFIG ( SID_SVX_START + 593 ) +#define SID_FM_PUSHBUTTON ( SID_SVX_START + 594 ) +#define SID_FM_RADIOBUTTON ( SID_SVX_START + 595 ) +#define SID_FM_CHECKBOX ( SID_SVX_START + 596 ) +#define SID_FM_FIXEDTEXT ( SID_SVX_START + 597 ) +#define SID_FM_GROUPBOX ( SID_SVX_START + 598 ) +#define SID_FM_EDIT ( SID_SVX_START + 599 ) +#define SID_FM_LISTBOX ( SID_SVX_START + 600 ) +#define SID_FM_COMBOBOX ( SID_SVX_START + 601 ) +#define SID_FM_DBGRID ( SID_SVX_START + 603 ) +#define SID_FM_IMAGEBUTTON ( SID_SVX_START + 604 ) +#define SID_FM_FILECONTROL ( SID_SVX_START + 605 ) +//( SID_SVX_START + 606 ) is used by SID_DRAWTBX_REDACTED_EXPORT +#define SID_FM_NAVIGATIONBAR ( SID_SVX_START + 607 ) +//FREE +//FREE +#define SID_FM_DELETEROWS ( SID_SVX_START + 610 ) +//FREE +//FREE +#define SID_FM_CTL_PROPERTIES ( SID_SVX_START + 613 ) +#define SID_FM_PROPERTIES ( SID_SVX_START + 614 ) +#define SID_FM_TAB_DIALOG ( SID_SVX_START + 615 ) +#define SID_FM_RECORD_FIRST ( SID_SVX_START + 616 ) +#define SID_FM_RECORD_NEXT ( SID_SVX_START + 617 ) +#define SID_FM_RECORD_PREV ( SID_SVX_START + 618 ) +#define SID_FM_RECORD_LAST ( SID_SVX_START + 619 ) +#define SID_FM_RECORD_NEW ( SID_SVX_START + 620 ) +#define SID_FM_RECORD_DELETE ( SID_SVX_START + 621 ) +#define SID_FM_RECORD_ABSOLUTE ( SID_SVX_START + 622 ) +#define SID_FM_ADD_FIELD ( SID_SVX_START + 623 ) +#define SID_FM_RECORD_TEXT ( SID_SVX_START + 624 ) +#define SID_FM_RECORD_FROM_TEXT ( SID_SVX_START + 625 ) +#define SID_FM_RECORD_TOTAL ( SID_SVX_START + 626 ) +#define SID_FM_RECORD_SAVE ( SID_SVX_START + 627 ) +#define SID_FM_CREATE_CONTROL ( SID_SVX_START + 628 ) +#define SID_FM_DESIGN_MODE ( SID_SVX_START + 629 ) +#define SID_FM_RECORD_UNDO ( SID_SVX_START + 630 ) +#define SID_FM_CONTROL_IDENTIFIER ( SID_SVX_START + 631 ) +#define SID_FM_CONTROL_INVENTOR ( SID_SVX_START + 632 ) +#define SID_FM_SHOW_FMEXPLORER ( SID_SVX_START + 633 ) +#define SID_FM_FIELDS_CONTROL ( SID_SVX_START + 634 ) +#define SID_FM_SHOW_PROPERTIES ( SID_SVX_START + 635 ) +#define SID_FM_PROPERTY_CONTROL ( SID_SVX_START + 636 ) +#define SID_FM_FMEXPLORER_CONTROL ( SID_SVX_START + 637 ) +//FREE +//FREE +//FREE +#define SID_3D_WIN ( SID_SVX_START + 644 ) +#define SID_3D_STATE ( SID_SVX_START + 645 ) +#define SID_3D_INIT ( SID_SVX_START + 646 ) +#define SID_3D_ASSIGN ( SID_SVX_START + 647 ) +#define SID_CONVERT_TO_3D ( SID_SVX_START + 648 ) +#define SID_CONVERT_TO_3D_LATHE_FAST ( SID_SVX_START + 649 ) +#define SID_ATTR_3D_END SID_CONVERT_TO_3D_LATHE_FAST +#define SID_ATTR_NUMBERFORMAT_NOLANGUAGE ( SID_SVX_START + 700 ) + +#define SID_MORE_FMSLOTS_START ( SID_SVX_START + 702 ) +#define SID_FM_SHOW_PROPERTY_BROWSER ( SID_SVX_START + 703 ) +#define SID_FM_DATEFIELD ( SID_SVX_START + 704 ) +#define SID_FM_TIMEFIELD ( SID_SVX_START + 705 ) +#define SID_FM_NUMERICFIELD ( SID_SVX_START + 706 ) +#define SID_FM_CURRENCYFIELD ( SID_SVX_START + 707 ) +#define SID_FM_PATTERNFIELD ( SID_SVX_START + 708 ) +#define SID_FM_OPEN_READONLY ( SID_SVX_START + 709 ) +#define SID_FM_IMAGECONTROL ( SID_SVX_START + 710 ) +#define SID_FM_REMOVE_FILTER_SORT ( SID_SVX_START + 711 ) +#define SID_FM_SORTUP ( SID_SVX_START + 712 ) +#define SID_FM_SORTDOWN ( SID_SVX_START + 713 ) +#define SID_FM_ORDERCRIT ( SID_SVX_START + 714 ) +#define SID_FM_FILTERCRIT ( SID_SVX_START + 715 ) +#define SID_FM_AUTOFILTER ( SID_SVX_START + 716 ) +#define SID_FM_NATIVESQL ( SID_SVX_START + 720 ) +#define SID_FM_EXECUTE ( SID_SVX_START + 721 ) +#define SID_SBA_QRY_EXECUTE SID_FM_EXECUTE +#define SID_FM_ADDTABLE ( SID_SVX_START + 722 ) +#define SID_FM_FORM_FILTERED ( SID_SVX_START + 723 ) +#define SID_FM_REFRESH ( SID_SVX_START + 724 ) +#define SID_FM_SEARCH ( SID_SVX_START + 725 ) +#define SID_FM_LEAVE_CREATE ( SID_SVX_START + 726 ) // pop Formcontroller Button +#define SID_FM_USE_WIZARDS ( SID_SVX_START + 727 ) +#define SID_FM_FORMATTEDFIELD ( SID_SVX_START + 728 ) +#define SID_FM_FILTER_START ( SID_SVX_START + 729 ) +#define SID_FM_FILTER_EXIT ( SID_SVX_START + 730 ) +#define SID_FM_FILTER_EXECUTE ( SID_SVX_START + 731 ) +#define SID_FM_FILTER_NAVIGATOR ( SID_SVX_START + 732 ) +#define SID_FM_CHANGECONTROLTYPE ( SID_SVX_START + 733 ) +#define SID_FM_CONVERTTO_EDIT ( SID_SVX_START + 734 ) +#define SID_FM_CONVERTTO_BUTTON ( SID_SVX_START + 735 ) +#define SID_FM_CONVERTTO_FIXEDTEXT ( SID_SVX_START + 736 ) +#define SID_FM_CONVERTTO_LISTBOX ( SID_SVX_START + 737 ) +#define SID_FM_CONVERTTO_CHECKBOX ( SID_SVX_START + 738 ) +#define SID_FM_CONVERTTO_RADIOBUTTON ( SID_SVX_START + 739 ) +#define SID_FM_CONVERTTO_GROUPBOX ( SID_SVX_START + 740 ) +#define SID_FM_CONVERTTO_COMBOBOX ( SID_SVX_START + 741 ) +#define SID_FM_CONVERTTO_IMAGEBUTTON ( SID_SVX_START + 743 ) +#define SID_FM_CONVERTTO_FILECONTROL ( SID_SVX_START + 744 ) +#define SID_FM_CONVERTTO_DATE ( SID_SVX_START + 745 ) +#define SID_FM_CONVERTTO_TIME ( SID_SVX_START + 746 ) +#define SID_FM_CONVERTTO_NUMERIC ( SID_SVX_START + 747 ) +#define SID_FM_CONVERTTO_CURRENCY ( SID_SVX_START + 748 ) +#define SID_FM_CONVERTTO_PATTERN ( SID_SVX_START + 749 ) +#define SID_FM_CONVERTTO_IMAGECONTROL ( SID_SVX_START + 750 ) +#define SID_FM_CONVERTTO_FORMATTED ( SID_SVX_START + 751 ) +#define SID_FM_FILTER_NAVIGATOR_CONTROL ( SID_SVX_START + 752 ) +#define SID_INSERT_GRIDCONTROL ( SID_SVX_START + 753 ) +#define SID_PARAGRAPH_CHANGE_STATE ( SID_SVX_START + 754 ) +//FREE +//FREE +//FREE +//FREE +//FREE +//FREE +#define SID_FM_VIEW_AS_GRID ( SID_SVX_START + 761 ) +#define SID_FM_AUTOCONTROLFOCUS ( SID_SVX_START + 763 ) +#define SID_DSBROWSER_EXPLORER ( SID_SVX_START + 764 ) +#define SID_FM_CREATE_FIELDCONTROL ( SID_SVX_START + 765 ) +#define SID_FM_DATACCESS_DESCRIPTOR ( SID_SVX_START + 766 ) +#define SID_FM_TOGGLECONTROLFOCUS ( SID_SVX_START + 767 ) +#define SID_FM_SCROLLBAR ( SID_SVX_START + 768 ) +#define SID_FM_SPINBUTTON ( SID_SVX_START + 769 ) +#define SID_FM_CONVERTTO_SCROLLBAR ( SID_SVX_START + 770 ) +#define SID_FM_CONVERTTO_SPINBUTTON ( SID_SVX_START + 771 ) +#define SID_FM_CONVERTTO_NAVIGATIONBAR ( SID_SVX_START + 772 ) +#define SID_FM_SHOW_DATANAVIGATOR ( SID_SVX_START + 773 ) +#define SID_FM_DATANAVIGATOR_CONTROL ( SID_SVX_START + 774 ) +#define SID_FM_REFRESH_FORM_CONTROL ( SID_SVX_START + 775 ) + +// CAUTION! Range <855 .. 855> used by EditEngine (!) + +#define SID_PARAM_NUM_PRESET ( SID_SVX_START + 856 ) +#define SID_PARAM_CUR_NUM_LEVEL ( SID_SVX_START + 859 ) +#define SID_CREATE_SW_DRAWVIEW ( SID_SVX_START + 860 ) +#define SID_ATTR_GRAF_LUMINANCE ( SID_SVX_START + 863 ) +#define SID_ATTR_GRAF_CONTRAST ( SID_SVX_START + 864 ) +#define SID_ATTR_GRAF_RED ( SID_SVX_START + 865 ) +#define SID_ATTR_GRAF_GREEN ( SID_SVX_START + 866 ) +#define SID_ATTR_GRAF_BLUE ( SID_SVX_START + 867 ) +#define SID_ATTR_GRAF_GAMMA ( SID_SVX_START + 868 ) +#define SID_ATTR_GRAF_TRANSPARENCE ( SID_SVX_START + 869 ) +#define SID_ATTR_GRAF_INVERT ( SID_SVX_START + 870 ) +#define SID_ATTR_GRAF_MODE ( SID_SVX_START + 871 ) + +// CAUTION! Range <877 .. 877> used by EditEngine (!) + +#define SID_ATTR_GRAF_KEEP_ZOOM ( SID_SVX_START + 882 ) +#define SID_ATTR_GRAF_CROP ( SID_SVX_START + 883 ) +#define SID_ATTR_GRAF_FRMSIZE ( SID_SVX_START + 884 ) +#define SID_ATTR_GRAF_FRMSIZE_PERCENT ( SID_SVX_START + 885 ) +#define SID_ATTR_GRAF_GRAPHIC ( SID_SVX_START + 886 ) +#define SID_DRAW_TEXT_VERTICAL SID_ATTR_CHAR_VERTICAL + +// CAUTION! Range <887 .. 903> used by EditEngine (!) + +// CAUTION! Range <905 .. 905> used by EditEngine (!) + +#define SID_DRAW_CAPTION_VERTICAL ( SID_SVX_START + 906 ) +#define SID_TEXTDIRECTION_LEFT_TO_RIGHT ( SID_SVX_START + 907 ) +#define SID_TEXTDIRECTION_TOP_TO_BOTTOM ( SID_SVX_START + 908 ) + +// CAUTION! Range <910 .. 911> used by EditEngine (!) + +#define SID_TRANSLITERATE_UPPER ( SID_SVX_START + 912 ) +#define SID_TRANSLITERATE_LOWER ( SID_SVX_START + 913 ) +#define SID_TRANSLITERATE_HALFWIDTH ( SID_SVX_START + 914 ) +#define SID_TRANSLITERATE_FULLWIDTH ( SID_SVX_START + 915 ) +#define SID_TRANSLITERATE_HIRAGANA ( SID_SVX_START + 916 ) +#define SID_TRANSLITERATE_KATAKANA ( SID_SVX_START + 917 ) + +// CAUTION! Range <919 .. 920> used by EditEngine (!) + +#define SID_LANGUAGE_OPTIONS ( SID_SVX_START + 921 ) +#define SID_GETUNDOSTRINGS ( SID_SVX_START + 923 ) +#define SID_GETREDOSTRINGS ( SID_SVX_START + 924 ) + +// CAUTION! Range <925 .. 925> used by EditEngine (!) + +#define SID_INSERT_IMAGECONTROL ( SID_SVX_START + 926 ) +#define SID_INSERT_PROGRESSBAR ( SID_SVX_START + 927 ) +#define SID_INSERT_HFIXEDLINE ( SID_SVX_START + 928 ) +#define SID_INSERT_VFIXEDLINE ( SID_SVX_START + 929 ) +#define SID_READONLY_MODE ( SID_SVX_START + 930 ) +#define SID_ATTR_ALIGN_HYPHENATION ( SID_SVX_START + 931 ) +#define SID_ATTR_NUMBERFORMAT_SOURCE ( SID_SVX_START + 932 ) + +#define SID_RULER_BORDER_DISTANCE ( SID_SVX_START + 935 ) +#define SID_INSERT_DATEFIELD ( SID_SVX_START + 936 ) +#define SID_INSERT_TIMEFIELD ( SID_SVX_START + 937 ) +#define SID_INSERT_NUMERICFIELD ( SID_SVX_START + 938 ) +#define SID_INSERT_CURRENCYFIELD ( SID_SVX_START + 939 ) +#define SID_INSERT_FORMATTEDFIELD ( SID_SVX_START + 940 ) +#define SID_INSERT_PATTERNFIELD ( SID_SVX_START + 941 ) +#define SID_INSERT_FILECONTROL ( SID_SVX_START + 942 ) +#define SID_SHOW_PROPERTYBROWSER ( SID_SVX_START + 943 ) + +// CAUTION! Range <944 .. 945> used by EditEngine (!) + +#define SID_ATTR_TABSTOP_VERTICAL ( SID_SVX_START + 946 ) + +// CAUTION! Range <947 .. 947> used by EditEngine (!) + +#define SID_RULER_BORDERS_VERTICAL ( SID_SVX_START + 948 ) +#define SID_ATTR_ALIGN_ASIANVERTICAL ( SID_SVX_START + 949 ) + +// CAUTION! Range <950 .. 951> used by EditEngine (!) + +#define SID_RULER_TEXT_RIGHT_TO_LEFT ( SID_SVX_START + 952 ) +#define SID_ATTR_HDFT_DYNAMIC_SPACING ( SID_SVX_START + 953 ) +#define SID_ATTR_NUMBERFORMAT_ADD_AUTO ( SID_SVX_START + 954 ) +#define SID_OPEN_HYPERLINK ( SID_SVX_START + 955 ) +#define SID_CTLFONT_STATE ( SID_SVX_START + 956 ) +#define SID_VERTICALTEXT_STATE ( SID_SVX_START + 957 ) +#define SID_OPEN_XML_FILTERSETTINGS ( SID_SVX_START + 958 ) +#define SID_HANGUL_HANJA_CONVERSION ( SID_SVX_START + 959 ) +#define SID_EXTRUSION_TOGGLE ( SID_SVX_START + 960 ) +#define SID_EXTRUSION_TILT_DOWN ( SID_SVX_START + 961 ) +#define SID_EXTRUSION_TILT_UP ( SID_SVX_START + 962 ) +#define SID_EXTRUSION_TILT_LEFT ( SID_SVX_START + 963 ) +#define SID_EXTRUSION_TILT_RIGHT ( SID_SVX_START + 964 ) +#define SID_EXTRUSION_DEPTH_FLOATER ( SID_SVX_START + 965 ) +#define SID_EXTRUSION_DIRECTION_FLOATER ( SID_SVX_START + 966 ) +#define SID_EXTRUSION_LIGHTING_FLOATER ( SID_SVX_START + 967 ) +#define SID_EXTRUSION_SURFACE_FLOATER ( SID_SVX_START + 968 ) +#define SID_EXTRUSION_3D_COLOR ( SID_SVX_START + 969 ) +#define SID_EXTRUSION_DEPTH ( SID_SVX_START + 970 ) +#define SID_EXTRUSION_DIRECTION ( SID_SVX_START + 971 ) +#define SID_EXTRUSION_PROJECTION ( SID_SVX_START + 972 ) +#define SID_EXTRUSION_LIGHTING_DIRECTION ( SID_SVX_START + 973 ) +#define SID_EXTRUSION_LIGHTING_INTENSITY ( SID_SVX_START + 974 ) +#define SID_EXTRUSION_SURFACE ( SID_SVX_START + 975 ) +#define SID_EXTRUSION_DEPTH_DIALOG ( SID_SVX_START + 976 ) +#define SID_FONTWORK_GALLERY_FLOATER ( SID_SVX_START + 977 ) +#define SID_EDIT_HYPERLINK ( SID_SVX_START + 978 ) +#define SID_FONTWORK_SHAPE_TYPE ( SID_SVX_START + 979 ) +#define SID_FONTWORK_SAME_LETTER_HEIGHTS ( SID_SVX_START + 980 ) +#define SID_FONTWORK_ALIGNMENT_FLOATER ( SID_SVX_START + 981 ) +#define SID_FONTWORK_CHARACTER_SPACING_FLOATER ( SID_SVX_START + 982 ) +#define SID_FONTWORK_SHAPE ( SID_SVX_START + 983 ) +#define SID_FONTWORK_ALIGNMENT ( SID_SVX_START + 984 ) +#define SID_FONTWORK_CHARACTER_SPACING ( SID_SVX_START + 985 ) +#define SID_FONTWORK_KERN_CHARACTER_PAIRS ( SID_SVX_START + 986 ) +#define SID_DRAW_FONTWORK ( SID_SVX_START + 987 ) +#define SID_DRAW_FONTWORK_VERTICAL ( SID_SVX_START + 988 ) + +// CAUTION! Range <989 .. 989> used by EditEngine (!) + +#define SID_ATTR_BORDER_CONNECT ( SID_SVX_START + 990 ) +#define SID_SW_FOLLOW_TEXT_FLOW ( SID_SVX_START + 991 ) /* #i18732# - slot-id for new option IsFollowingTextFlow' */ +#define SID_RULER_ROWS ( SID_SVX_START + 992 ) +#define SID_RULER_ROWS_VERTICAL ( SID_SVX_START + 993 ) + +// CAUTION! Range <994 .. 998> used by EditEngine (!) + +#define SID_ATTR_TRANSFORM_HORI_POSITION ( SID_SVX_START + 999 ) +#define SID_ATTR_TRANSFORM_VERT_POSITION ( SID_SVX_START + 1000 ) +// Available for use 1001 +#define SID_ALIGN_ANY_LEFT ( SID_SVX_START + 1002 ) +#define SID_ALIGN_ANY_HCENTER ( SID_SVX_START + 1003 ) +#define SID_ALIGN_ANY_RIGHT ( SID_SVX_START + 1004 ) +#define SID_ALIGN_ANY_JUSTIFIED ( SID_SVX_START + 1005 ) +#define SID_ALIGN_ANY_TOP ( SID_SVX_START + 1006 ) +#define SID_ALIGN_ANY_VCENTER ( SID_SVX_START + 1007 ) +#define SID_ALIGN_ANY_BOTTOM ( SID_SVX_START + 1008 ) +#define SID_ALIGN_ANY_HDEFAULT ( SID_SVX_START + 1009 ) +#define SID_ALIGN_ANY_VDEFAULT ( SID_SVX_START + 1010 ) +#define SID_SW_COLLAPSING_BORDERS ( SID_SVX_START + 1011 ) +#define SID_SW_WRAP_INFLUENCE_ON_OBJPOS ( SID_SVX_START + 1012 ) /* #i28701# - slot-id for new attribute WrapInfluenceOnObjPos' */ +#define SID_ATTR_BORDER_DIAG_TLBR ( SID_SVX_START + 1013 ) +#define SID_ATTR_BORDER_DIAG_BLTR ( SID_SVX_START + 1014 ) +#define SID_ATTR_ALIGN_SHRINKTOFIT ( SID_SVX_START + 1015 ) +#define SID_CHINESE_CONVERSION ( SID_SVX_START + 1016 ) +#define SID_PAGE_TYPE ( SID_SVX_START + 1017 ) +#define SID_DLG_TYPE ( SID_SVX_START + 1018 ) +#define SID_TABPAGE_POS ( SID_SVX_START + 1019 ) +#define SID_GRAPHIC ( SID_SVX_START + 1020 ) +#define SID_OBJECT_LIST ( SID_SVX_START + 1021 ) +#define SID_ATTR_SET ( SID_SVX_START + 1022 ) +#define SID_CHAR_FMT_LIST_BOX ( SID_SVX_START + 1023 ) +#define SID_METRIC_ITEM TypedWhichId( SID_SVX_START + 1024 ) +#define SID_NUM_CHAR_FMT ( SID_SVX_START + 1025 ) +#define SID_BULLET_CHAR_FMT ( SID_SVX_START + 1026 ) +#define SID_DISABLE_SVXEXTPARAGRAPHTABPAGE_PAGEBREAK ( SID_SVX_START + 1027 ) +#define SID_SVXPARAALIGNTABPAGE_ENABLEJUSTIFYEXT ( SID_SVX_START + 1028 ) +#define SID_SVXSTDPARAGRAPHTABPAGE_PAGEWIDTH ( SID_SVX_START + 1029 ) +#define SID_SVXSTDPARAGRAPHTABPAGE_FLAGSET ( SID_SVX_START + 1030 ) +#define SID_SVXSTDPARAGRAPHTABPAGE_ABSLINEDIST ( SID_SVX_START + 1031 ) +#define SID_SVXTABULATORTABPAGE_DISABLEFLAGS ( SID_SVX_START + 1032 ) +#define SID_SVXTEXTATTRPAGE_OBJKIND ( SID_SVX_START + 1033 ) +#define SID_FLAG_TYPE ( SID_SVX_START + 1034 ) +#define SID_SWMODE_TYPE ( SID_SVX_START + 1035 ) +#define SID_DISABLE_CTL ( SID_SVX_START + 1036 ) +#define SID_INSERT_HYPERLINKCONTROL ( SID_SVX_START + 1037 ) +#define SID_ENUM_PAGE_MODE TypedWhichId( SID_SVX_START + 1038 ) +#define SID_PAPER_START TypedWhichId( SID_SVX_START + 1039 ) +#define SID_PAPER_END TypedWhichId( SID_SVX_START + 1040 ) +#define SID_COLLECT_LIST ( SID_SVX_START + 1041 ) +#define SID_GROW_FONT_SIZE ( SID_SVX_START + 1042 ) +#define SID_SHRINK_FONT_SIZE ( SID_SVX_START + 1043 ) +// color subtoolbar on graphictoolbar +#define SID_COLOR_SETTINGS ( SID_SVX_START + 1044 ) +#define SID_FM_FORM_DESIGN_TOOLS ( SID_SVX_START + 1046 ) +#define SID_DRAWTBX_CS_BASIC ( SID_SVX_START + 1047 ) +#define SID_DRAWTBX_CS_SYMBOL ( SID_SVX_START + 1048 ) +#define SID_DRAWTBX_CS_ARROW ( SID_SVX_START + 1049 ) +#define SID_DRAWTBX_CS_FLOWCHART ( SID_SVX_START + 1050 ) +#define SID_DRAWTBX_CS_CALLOUT ( SID_SVX_START + 1051 ) +#define SID_DRAWTBX_CS_STAR ( SID_SVX_START + 1052 ) +#define SID_DRAW_CS_ID ( SID_SVX_START + 1053 ) +#define SID_FONTWORK_CHARACTER_SPACING_DIALOG ( SID_SVX_START + 1054 ) +#define SID_BORDER_REDUCED_MODE ( SID_SVX_START + 1055 ) +#define SID_INSERT_RLM ( SID_SVX_START + 1056 ) /* insert RLM - right to left mark */ +#define SID_INSERT_LRM ( SID_SVX_START + 1057 ) /* insert LRM - left to right mark */ +#define SID_INSERT_ZWSP ( SID_SVX_START + 1058 ) /* insert ZWJ - invisible space, keep words together*/ +#define SID_INSERT_ZWNBSP ( SID_SVX_START + 1059 ) /* insert ZWNJ - invisible space, forces linebreak*/ +#define SID_OPTIONS_DATABASES ( SID_SVX_START + 1060 ) +#define SID_OPEN_SMARTTAGMENU ( SID_SVX_START + 1061 ) +// (SID_SVX_START + 1062) is in include/sfx2/sfxsids.hrc +#define SID_INSERT_TREECONTROL ( SID_SVX_START + 1063 ) +#define SID_ATTR_VIEWLAYOUT ( SID_SVX_START + 1064 ) +#define SID_ATTR_ZOOMSLIDER ( SID_SVX_START + 1065 ) +#define SID_LANGUAGE_STATUS ( SID_SVX_START + 1067 ) +#define SID_CHAR_DLG_FOR_PARAGRAPH ( SID_SVX_START + 1068 ) +#define SID_SET_DOCUMENT_LANGUAGE ( SID_SVX_START + 1069 ) + +#define SID_TABLE_MERGE_CELLS ( SID_SVX_START + 1070 ) +#define SID_TABLE_SPLIT_CELLS ( SID_SVX_START + 1071 ) +#define SID_OPTIMIZE_TABLE ( SID_SVX_START + 1072 ) +#define SID_TABLE_VERT_BOTTOM ( SID_SVX_START + 1073 ) +#define SID_TABLE_VERT_CENTER ( SID_SVX_START + 1074 ) +#define SID_TABLE_VERT_NONE ( SID_SVX_START + 1075 ) +#define SID_TABLE_INSERT_ROW ( SID_SVX_START + 1076 ) +#define SID_TABLE_INSERT_COL ( SID_SVX_START + 1077 ) +#define SID_TABLE_DELETE_ROW ( SID_SVX_START + 1078 ) +#define SID_TABLE_DELETE_COL ( SID_SVX_START + 1079 ) +#define SID_TABLE_SELECT_ALL ( SID_SVX_START + 1080 ) +#define SID_TABLE_SELECT_COL ( SID_SVX_START + 1081 ) +#define SID_TABLE_SELECT_ROW ( SID_SVX_START + 1082 ) +#define SID_FORMAT_TABLE_DLG ( SID_SVX_START + 1083 ) +#define SID_TABLE_SORT_DIALOG ( SID_SVX_START + 1084 ) +#define SID_TABLE_AUTOSUM ( SID_SVX_START + 1085 ) +#define SID_TABLE_DISTRIBUTE_COLUMNS ( SID_SVX_START + 1086 ) +#define SID_TABLE_DISTRIBUTE_ROWS ( SID_SVX_START + 1087 ) +#define SID_TABLE_STYLE ( SID_SVX_START + 1088 ) +#define SID_TABLE_STYLE_SETTINGS ( SID_SVX_START + 1089 ) +#define SID_CHAR_DLG_PREVIEW_STRING ( SID_SVX_START + 1090 ) +#define SID_RECHECK_DOCUMENT ( SID_SVX_START + 1091 ) + +#define SID_OBJECT_MIRROR ( SID_SVX_START + 1093 ) + +#define SID_DELETE_POSTIT ( SID_SVX_START + 1094 ) +#define SID_NEXT_POSTIT ( SID_SVX_START + 1095 ) +#define SID_PREVIOUS_POSTIT ( SID_SVX_START + 1096 ) +#define SID_DELETEALL_POSTIT ( SID_SVX_START + 1097 ) +#define SID_TOGGLE_NOTES ( SID_SVX_START + 1098 ) +#define SID_REPLYTO_POSTIT ( SID_SVX_START + 1099 ) +#define SID_DELETEALLBYAUTHOR_POSTIT ( SID_SVX_START + 1100 ) +#define SID_INSERT_POSTIT ( SID_SVX_START + 1101 ) + +#define SID_TRANSLITERATE_SENTENCE_CASE ( SID_SVX_START + 1102 ) +#define SID_TRANSLITERATE_TITLE_CASE ( SID_SVX_START + 1103 ) +#define SID_TRANSLITERATE_TOGGLE_CASE ( SID_SVX_START + 1104 ) +#define SID_TRANSLITERATE_ROTATE_CASE ( SID_SVX_START + 1105 ) +#define SID_INSERT_FORM_RADIO ( SID_SVX_START + 1106 ) +#define SID_INSERT_FORM_CHECK ( SID_SVX_START + 1107 ) +#define SID_INSERT_FORM_LIST ( SID_SVX_START + 1108 ) +#define SID_INSERT_FORM_COMBO ( SID_SVX_START + 1109 ) +#define SID_INSERT_FORM_SPIN ( SID_SVX_START + 1110 ) +#define SID_INSERT_FORM_VSCROLL ( SID_SVX_START + 1111 ) +#define SID_INSERT_FORM_HSCROLL ( SID_SVX_START + 1112 ) +#define SID_EXTERNAL_EDIT ( SID_SVX_START + 1113 ) +#define SID_ATTR_PAGE_SHARED_FIRST ( SID_SVX_START + 1114 ) +#define SID_CHANGE_PICTURE ( SID_SVX_START + 1115 ) +#define SID_SAVE_GRAPHIC ( SID_SVX_START + 1116 ) +#define SID_COMPRESS_GRAPHIC ( SID_SVX_START + 1117 ) +#define SID_FRAME_UP ( SID_SVX_START + 1118 ) +#define SID_FRAME_DOWN ( SID_SVX_START + 1119 ) +#define SID_ATTR_SPECIALCHAR ( SID_SVX_START + 1120 ) +#define SID_ROTATE_GRAPHIC_LEFT ( SID_SVX_START + 1121 ) +#define SID_ROTATE_GRAPHIC_RIGHT ( SID_SVX_START + 1122 ) +#define SID_ROTATE_GRAPHIC_180 ( SID_SVX_START + 1123 ) +#define SID_ROTATE_GRAPHIC_RESET ( SID_SVX_START + 1092 ) /* RotGrfFlyFrame: */ + +// new slots for panels +#define SID_ATTR_FILL_TRANSPARENCE ( SID_SVX_START + 1124 ) +#define SID_ATTR_FILL_FLOATTRANSPARENCE ( SID_SVX_START + 1125 ) +#define SID_ATTR_LINE_TRANSPARENCE ( SID_SVX_START + 1126 ) +#define SID_FLIP_HORIZONTAL ( SID_SVX_START + 1127 ) +#define SID_FLIP_VERTICAL ( SID_SVX_START + 1128 ) +#define SID_ATTR_LINE_JOINT ( SID_SVX_START + 1129 ) +#define SID_ATTR_LINE_CAP ( SID_SVX_START + 1130 ) +#define SID_ATTR_TRANSFORM_MATRIX ( SID_SVX_START + 1131 ) + +#define SID_CELL_FORMAT_BORDER ( SID_SVX_START + 1132 ) +#define SID_CHAR_DLG_EFFECT ( SID_SVX_START + 1133 ) + +#define FN_SVX_SET_NUMBER ( SID_SVX_START + 1136 ) +#define FN_SVX_SET_BULLET ( SID_SVX_START + 1137 ) +#define FN_SVX_SET_OUTLINE ( SID_SVX_START + 1138 ) + +#define SID_ATTR_BORDER_STYLES ( SID_SVX_START + 1140 ) +#define SID_ATTR_BORDER_DEFAULT_WIDTH ( SID_SVX_START + 1141 ) +// 1142 is used by editeng (SID_ATTR_CHAR_GRABBAG) + +#define SID_OFFER_IMPORT ( SID_SVX_START + 1143 ) +#define SID_DRAWINGLAYER_FILLSTYLES ( SID_SVX_START + 1144) +#define SID_PARASPACE_INCREASE ( SID_SVX_START + 1145 ) +#define SID_PARASPACE_DECREASE ( SID_SVX_START + 1146 ) + +#define SID_OBJECT_CROP ( SID_SVX_START + 1147 ) +#define SID_ATTR_SHADOW_TRANSPARENCE ( SID_SVX_START + 1148 ) +#define SID_ATTR_SHADOW_COLOR ( SID_SVX_START + 1149 ) +#define SID_ATTR_SHADOW_XDISTANCE ( SID_SVX_START + 1150 ) +#define SID_ATTR_SHADOW_YDISTANCE ( SID_SVX_START + 1151 ) + +#define SID_ATTR_PAGE_COLOR ( SID_SVX_START + 1152 ) +// 1153 is used by editeng (SID_ATTR_CHAR_BACK_COLOR) +#define SID_ATTR_PAGE_GRADIENT ( SID_SVX_START + 1154 ) +#define SID_ATTR_PAGE_HATCH ( SID_SVX_START + 1155 ) +#define SID_ATTR_PAGE_BITMAP ( SID_SVX_START + 1156 ) +#define SID_ATTR_PAGE_FILLSTYLE ( SID_SVX_START + 1157 ) + +#define SID_EDIT_POSTIT ( SID_SVX_START + 1158 ) + +#define SID_LINE_ARROW_CIRCLE ( SID_SVX_START + 1159 ) +#define SID_LINE_ARROW_SQUARE ( SID_SVX_START + 1160 ) +#define SID_LINE_CIRCLE_ARROW ( SID_SVX_START + 1161 ) +#define SID_LINE_SQUARE_ARROW ( SID_SVX_START + 1162 ) +#define SID_LINE_ARROWS ( SID_SVX_START + 1163 ) +#define SID_DRAWTBX_ARROWS ( SID_SVX_START + 1164 ) +#define SID_LINE_ARROW_START ( SID_SVX_START + 1165 ) +#define SID_LINE_ARROW_END ( SID_SVX_START + 1166 ) +#define SID_DRAW_MEASURELINE ( SID_SVX_START + 1167 ) +#define SID_AUTHOR_COLOR ( SID_SVX_START + 1168 ) +#define SID_BMPMASK_COLOR ( SID_SVX_START + 1169 ) +#define SID_PARAGRAPH_SIGN_CLASSIFY_DLG ( SID_SVX_START + 1170 ) +#define SID_CLASSIFICATION_DIALOG ( SID_SVX_START + 1171 ) +#define SID_ANCHOR_MENU ( SID_SVX_START + 1172 ) + +#define SID_INSERT_SIGNATURELINE ( SID_SVX_START + 1173 ) +#define SID_EDIT_SIGNATURELINE ( SID_SVX_START + 1174 ) +#define SID_SIGN_SIGNATURELINE ( SID_SVX_START + 1175 ) +#define SID_MEASURE_DLG ( SID_SVX_START + 1176 ) + +#define SID_TABLE_MINIMAL_COLUMN_WIDTH ( SID_SVX_START + 1185 ) +#define SID_TABLE_MINIMAL_ROW_HEIGHT ( SID_SVX_START + 1186 ) +#define SID_TABLE_OPTIMAL_COLUMN_WIDTH ( SID_SVX_START + 1187 ) +#define SID_TABLE_OPTIMAL_ROW_HEIGHT ( SID_SVX_START + 1188 ) + +#define SID_TABLE_CELL_BACKGROUND_COLOR TypedWhichId( SID_SVX_START + 1189 ) + +#define SID_TOGGLE_RESOLVED_NOTES ( SID_SVX_START + 1190 ) + +#define SID_INSERT_QRCODE ( SID_SVX_START + 1191 ) +#define SID_EDIT_QRCODE ( SID_SVX_START + 1192 ) +#define SID_COPY_HYPERLINK_LOCATION ( SID_SVX_START + 1193 ) + +#define SID_IMPRESS_DOC TypedWhichId( SID_SVX_START + 1194 ) + +#define SID_ULINE_VAL_NONE (SID_SVX_START + 1195) /* no underline */ +#define SID_ULINE_VAL_SINGLE (SID_SVX_START + 1196) /* single underline */ +#define SID_ULINE_VAL_DOUBLE (SID_SVX_START + 1197) /* double underline */ +#define SID_ULINE_VAL_DOTTED (SID_SVX_START + 1198) /* dotted underline */ + +// IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id +#define SID_SVX_FIRSTFREE ( SID_SVX_START + 1198 + 1 ) + +// Overflow check for slot IDs +#if SID_SVX_FIRSTFREE > SID_SVX_END +#error Resource-overflow in #line, #file +#endif + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svxitems.hrc b/include/svx/svxitems.hrc new file mode 100644 index 000000000..052c7fbd2 --- /dev/null +++ b/include/svx/svxitems.hrc @@ -0,0 +1,94 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_INC_SVX_ITEMS_HRC +#define INCLUDED_SVX_INC_SVX_ITEMS_HRC + +#include +#include +#include +#include +#include + +#define NC_(Context, String) reinterpret_cast(Context "\004" u8##String) + +const std::pair RID_ATTR_NAMES[] = +{ + { NC_("RID_ATTR_NAMES", "Scale") , SID_ATTR_ZOOM }, + { NC_("RID_ATTR_NAMES", "Brush") , SID_ATTR_BRUSH }, + { NC_("RID_ATTR_NAMES", "Tab stops") , SID_ATTR_TABSTOP }, + { NC_("RID_ATTR_NAMES", "Character") , SID_ATTR_CHAR }, + { NC_("RID_ATTR_NAMES", "Font") , SID_ATTR_CHAR_FONT }, + { NC_("RID_ATTR_NAMES", "Font posture") , SID_ATTR_CHAR_POSTURE }, + { NC_("RID_ATTR_NAMES", "Font weight") , SID_ATTR_CHAR_WEIGHT }, + { NC_("RID_ATTR_NAMES", "Shadowed") , SID_ATTR_CHAR_SHADOWED }, + { NC_("RID_ATTR_NAMES", "Individual words") , SID_ATTR_CHAR_WORDLINEMODE }, + { NC_("RID_ATTR_NAMES", "Outline") , SID_ATTR_CHAR_CONTOUR }, + { NC_("RID_ATTR_NAMES", "Strikethrough") , SID_ATTR_CHAR_STRIKEOUT }, + { NC_("RID_ATTR_NAMES", "Underline") , SID_ATTR_CHAR_UNDERLINE }, + { NC_("RID_ATTR_NAMES", "Font size") , SID_ATTR_CHAR_FONTHEIGHT }, + { NC_("RID_ATTR_NAMES", "Font color") , SID_ATTR_CHAR_COLOR }, + { NC_("RID_ATTR_NAMES", "Kerning") , SID_ATTR_CHAR_KERNING }, + { NC_("RID_ATTR_NAMES", "Effects") , SID_ATTR_CHAR_CASEMAP }, + { NC_("RID_ATTR_NAMES", "Language"), SID_ATTR_CHAR_LANGUAGE }, + { NC_("RID_ATTR_NAMES", "Position") , SID_ATTR_CHAR_ESCAPEMENT }, + { NC_("RID_ATTR_NAMES", "Character blinking") , SID_ATTR_CHAR_AUTOKERN }, + { NC_("RID_ATTR_NAMES", "Character set color") , SID_ATTR_CHAR_CHARSETCOLOR }, + { NC_("RID_ATTR_NAMES", "Overline") , SID_ATTR_CHAR_OVERLINE }, + { NC_("RID_ATTR_NAMES", "Alignment") , SID_ATTR_PARA_ADJUST }, + { NC_("RID_ATTR_NAMES", "Line spacing") , SID_ATTR_PARA_LINESPACE }, + { NC_("RID_ATTR_NAMES", "Page Break") , SID_ATTR_PARA_PAGEBREAK }, + { NC_("RID_ATTR_NAMES", "Hyphenation") , SID_ATTR_PARA_HYPHENZONE }, + { NC_("RID_ATTR_NAMES", "Do not split paragraph"), SID_ATTR_PARA_SPLIT }, + { NC_("RID_ATTR_NAMES", "Orphans") , SID_ATTR_PARA_ORPHANS }, + { NC_("RID_ATTR_NAMES", "Widows") , SID_ATTR_PARA_WIDOWS }, + { NC_("RID_ATTR_NAMES", "Paragraph spacing") , SID_ATTR_PARA_ULSPACE }, + { NC_("RID_ATTR_NAMES", "Paragraph indent") , SID_ATTR_PARA_LRSPACE }, + { NC_("RID_ATTR_NAMES", "Indent") , SID_ATTR_LRSPACE }, + { NC_("RID_ATTR_NAMES", "Spacing") , SID_ATTR_ULSPACE }, + { NC_("RID_ATTR_NAMES", "Page") , SID_ATTR_PAGE }, + { NC_("RID_ATTR_NAMES", "Page Style") , SID_ATTR_PARA_MODEL }, + { NC_("RID_ATTR_NAMES", "Keep with next paragraph"), SID_ATTR_PARA_KEEP }, + { NC_("RID_ATTR_NAMES", "Blinking") , SID_ATTR_FLASH }, + { NC_("RID_ATTR_NAMES", "Register-true") , SID_ATTR_PARA_REGISTER }, + { NC_("RID_ATTR_NAMES", "Character background") , SID_ATTR_BRUSH_CHAR }, + { NC_("RID_ATTR_NAMES", "Asian font") , SID_ATTR_CHAR_CJK_FONT }, + { NC_("RID_ATTR_NAMES", "Size of Asian font") , SID_ATTR_CHAR_CJK_FONTHEIGHT }, + { NC_("RID_ATTR_NAMES", "Language of Asian font"), SID_ATTR_CHAR_CJK_LANGUAGE }, + { NC_("RID_ATTR_NAMES", "Posture of Asian font") , SID_ATTR_CHAR_CJK_POSTURE }, + { NC_("RID_ATTR_NAMES", "Weight of Asian font") , SID_ATTR_CHAR_CJK_WEIGHT }, + { NC_("RID_ATTR_NAMES", "CTL") , SID_ATTR_CHAR_CTL_FONT }, + { NC_("RID_ATTR_NAMES", "Size of complex scripts") , SID_ATTR_CHAR_CTL_FONTHEIGHT }, + { NC_("RID_ATTR_NAMES", "Language of complex scripts"),SID_ATTR_CHAR_CTL_LANGUAGE }, + { NC_("RID_ATTR_NAMES", "Posture of complex scripts"), SID_ATTR_CHAR_CTL_POSTURE }, + { NC_("RID_ATTR_NAMES", "Weight of complex scripts"), SID_ATTR_CHAR_CTL_WEIGHT }, + { NC_("RID_ATTR_NAMES", "Double-lined") , SID_ATTR_CHAR_TWO_LINES }, + { NC_("RID_ATTR_NAMES", "Emphasis mark") , SID_ATTR_CHAR_EMPHASISMARK }, + { NC_("RID_ATTR_NAMES", "Text spacing") , SID_ATTR_PARA_SCRIPTSPACE }, + { NC_("RID_ATTR_NAMES", "Hanging punctuation") , SID_ATTR_PARA_HANGPUNCTUATION }, + { NC_("RID_ATTR_NAMES", "Forbidden characters") , SID_ATTR_PARA_FORBIDDEN_RULES }, + { NC_("RID_ATTR_NAMES", "Rotation") , SID_ATTR_CHAR_ROTATED }, + { NC_("RID_ATTR_NAMES", "Character scaling") , SID_ATTR_CHAR_SCALEWIDTH }, + { NC_("RID_ATTR_NAMES", "Relief") , SID_ATTR_CHAR_RELIEF }, + { NC_("RID_ATTR_NAMES", "Vertical text alignment") , SID_PARA_VERTALIGN } +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/swframeexample.hxx b/include/svx/swframeexample.hxx new file mode 100644 index 000000000..fc64982ce --- /dev/null +++ b/include/svx/swframeexample.hxx @@ -0,0 +1,94 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_SWFRAMEEXAMPLE_HXX +#define INCLUDED_SVX_SWFRAMEEXAMPLE_HXX + +#include +#include +#include +#include +#include +#include + +class SVX_DLLPUBLIC SwFrameExample final : public weld::CustomWidgetController +{ + Color m_aTransColor; ///< transparency + Color m_aBgCol; ///< background + Color m_aFrameColor; ///< graphic frame + Color m_aAlignColor; ///< align anchor + Color m_aBorderCol; ///< frame of doc + Color m_aPrintAreaCol; ///< frame of printable area of doc + Color m_aTxtCol; ///< symbolised text + Color m_aBlankCol; ///< area of symbol for blank + Color m_aBlankFrameCol; ///< frame of symbol for blank + + tools::Rectangle aPage; + tools::Rectangle aPagePrtArea; + tools::Rectangle aTextLine; + tools::Rectangle aPara; + tools::Rectangle aParaPrtArea; + tools::Rectangle aFrameAtFrame; + tools::Rectangle aDrawObj; + tools::Rectangle aAutoCharFrame; + Size aFrmSize; + + short nHAlign; + short nHRel; + + short nVAlign; + short nVRel; + + css::text::WrapTextMode nWrap; + RndStdIds nAnchor; + bool bTrans; + + Point aRelPos; + + void InitColors_Impl(); + void InitAllRects_Impl(vcl::RenderContext& rRenderContext); + void CalcBoundRect_Impl(const vcl::RenderContext& rRenderContext, tools::Rectangle &rRect); + tools::Rectangle DrawInnerFrame_Impl(vcl::RenderContext& rRenderContext, const tools::Rectangle &rRect, const Color &rFillColor, const Color &rBorderColor); + + virtual void StyleUpdated() override; + virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) override; +public: + + SwFrameExample(); + + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; + + void SetWrap(css::text::WrapTextMode nW) { nWrap = nW; } + + void SetHAlign(short nH) { nHAlign = nH; } + void SetHoriRel(short nR) { nHRel = nR; } + + void SetVAlign(short nV) { nVAlign = nV; } + void SetVertRel(short nR) { nVRel = nR; } + + void SetTransparent(bool bT) { bTrans = bT; } + void SetAnchor(RndStdIds nA) { nAnchor = nA; } + + void SetRelPos(const Point& rP); +}; + + + +#endif // INCLUDED_SVX_SWFRAMEEXAMPLE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/swframeposstrings.hxx b/include/svx/swframeposstrings.hxx new file mode 100644 index 000000000..346553c70 --- /dev/null +++ b/include/svx/swframeposstrings.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 . + */ + +#pragma once + +#include +#include + +/* + contains strings needed for positioning dialogs + of frames and drawing in Writer + */ +class SVX_DLLPUBLIC SvxSwFramePosString +{ +public: + enum StringId + { + LEFT , + RIGHT , + FROMLEFT , + MIR_LEFT , + MIR_RIGHT , + MIR_FROMLEFT , + FRAME , + PRTAREA , + REL_PG_LEFT , + REL_PG_RIGHT , + REL_FRM_LEFT , + REL_FRM_RIGHT , + MIR_REL_PG_LEFT , + MIR_REL_PG_RIGHT , + MIR_REL_FRM_LEFT , + MIR_REL_FRM_RIGHT , + REL_PG_FRAME , + REL_PG_PRTAREA , + REL_PG_PRTAREA_BOTTOM , + REL_BASE , + REL_CHAR , + REL_ROW , + REL_BORDER , + REL_PRTAREA , + FLY_REL_PG_LEFT , + FLY_REL_PG_RIGHT , + FLY_REL_PG_FRAME , + FLY_REL_PG_PRTAREA , + FLY_MIR_REL_PG_LEFT , + FLY_MIR_REL_PG_RIGHT , + TOP, + BOTTOM, + CENTER_HORI, + CENTER_VERT, + FROMTOP, + FROMBOTTOM, + BELOW, + FROMRIGHT, + REL_PG_TOP, + REL_PG_BOTTOM, + REL_FRM_TOP, + REL_FRM_BOTTOM, + REL_LINE, + + STR_MAX + }; + static OUString GetString(StringId eId); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/swframetypes.hxx b/include/svx/swframetypes.hxx new file mode 100644 index 000000000..cd33ae477 --- /dev/null +++ b/include/svx/swframetypes.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_SVX_INC_SWFRAMETYPES_HXX +#define INCLUDED_SVX_INC_SWFRAMETYPES_HXX + +#include + +// The former Rendezvous-IDs live on: +// There are IDs for the anchors (SwFormatAnchor) and some others +// that are only of importance for interfaces (SwDoc). +enum class RndStdIds +{ + UNKNOWN = -1, // return value used by SwFEShell::GetAnchorId + + // the following 5 values are deliberately the same as the values in css::text::TextContentAnchorType + FLY_AT_PARA = int(css::text::TextContentAnchorType_AT_PARAGRAPH), // Anchored at paragraph. + FLY_AS_CHAR = int(css::text::TextContentAnchorType_AS_CHARACTER), // Anchored as character. + FLY_AT_PAGE = int(css::text::TextContentAnchorType_AT_PAGE), // Anchored at page. + FLY_AT_FLY = int(css::text::TextContentAnchorType_AT_FRAME), // Anchored at frame. + FLY_AT_CHAR = int(css::text::TextContentAnchorType_AT_CHARACTER), // Anchored at character. + + HEADER, + FOOTER, + HEADERL, + HEADERR, + + DRAW_OBJECT // A draw-Object! For the SwDoc-interface only! +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/swframevalidation.hxx b/include/svx/swframevalidation.hxx new file mode 100644 index 000000000..049fce9af --- /dev/null +++ b/include/svx/swframevalidation.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_SVX_SWFRAMEVALIDATION_HXX +#define INCLUDED_SVX_SWFRAMEVALIDATION_HXX + +#include +#include +#include + +/* + struct to determine min/max values for fly frame positioning in Writer + */ +struct SvxSwFrameValidation +{ + RndStdIds nAnchorType; + sal_Int16 nHoriOrient; //css::text::HoriOrientation + sal_Int16 nVertOrient; //css::text::VertOrientation + sal_Int16 nHRelOrient; //css::text::RelOrientation + sal_Int16 nVRelOrient; //css::text::RelOrientation + bool bAutoHeight; + bool bMirror; + bool bFollowTextFlow; + + sal_Int32 nHPos; + sal_Int32 nMaxHPos; + sal_Int32 nMinHPos; + + sal_Int32 nVPos; + sal_Int32 nMaxVPos; + sal_Int32 nMinVPos; + + sal_Int32 nWidth; + sal_Int32 nMinWidth; + sal_Int32 nMaxWidth; + + sal_Int32 nHeight; + sal_Int32 nMinHeight; + sal_Int32 nMaxHeight; + + Size aPercentSize; // Size for 100% value + + SvxSwFrameValidation() : + nAnchorType(RndStdIds::FLY_AT_PARA), + nHoriOrient(0), + nVertOrient(0), + nHRelOrient(0), + nVRelOrient(0), + bAutoHeight(false), + bMirror(false), + bFollowTextFlow( false ), + nHPos(0), + nMaxHPos(SAL_MAX_INT32), + nMinHPos(0), + nVPos(0), + nMaxVPos(SAL_MAX_INT32), + nMinVPos(0), + nWidth( 283 * 4 ), //2.0 cm + nMinWidth(0), + nMaxWidth(SAL_MAX_INT32), + nHeight( 283 ), //0.5 cm + nMinHeight(0), + nMaxHeight(SAL_MAX_INT32) + { + } +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sxcecitm.hxx b/include/svx/sxcecitm.hxx new file mode 100644 index 000000000..5f946d2aa --- /dev/null +++ b/include/svx/sxcecitm.hxx @@ -0,0 +1,98 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_SXCECITM_HXX +#define INCLUDED_SVX_SXCECITM_HXX + +#include +#include +#include +#include +#include + +enum class SdrCaptionEscDir { Horizontal, Vertical, BestFit }; + + +// class SdrCaptionEscDirItem + +class SVXCORE_DLLPUBLIC SdrCaptionEscDirItem: public SfxEnumItem { +public: + SdrCaptionEscDirItem(SdrCaptionEscDir eDir=SdrCaptionEscDir::Horizontal): SfxEnumItem(SDRATTR_CAPTIONESCDIR, eDir) {} + virtual SdrCaptionEscDirItem* Clone(SfxItemPool* pPool=nullptr) const override; + virtual sal_uInt16 GetValueCount() const override; // { return 3; } + + static OUString GetValueTextByPos(sal_uInt16 nPos); + + virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString& rText, const IntlWrapper&) const override; +}; + + +// class SdrCaptionEscIsRelItem +// sal_True = line escape position is relative +// sal_False = line escape position is absolute + +class SVXCORE_DLLPUBLIC SdrCaptionEscIsRelItem: public SdrYesNoItem { +public: + SdrCaptionEscIsRelItem(bool bRel=true): SdrYesNoItem(SDRATTR_CAPTIONESCISREL,bRel) {} + virtual ~SdrCaptionEscIsRelItem() override; + virtual SdrCaptionEscIsRelItem* Clone(SfxItemPool* pPool=nullptr) const override; + + SdrCaptionEscIsRelItem(SdrCaptionEscIsRelItem const &) = default; + SdrCaptionEscIsRelItem(SdrCaptionEscIsRelItem &&) = default; + SdrCaptionEscIsRelItem & operator =(SdrCaptionEscIsRelItem const &) = delete; // due to SdrYesNoItem + SdrCaptionEscIsRelItem & operator =(SdrCaptionEscIsRelItem &&) = delete; // due to SdrYesNoItem +}; + + +// class SdrCaptionEscRelItem +// relative line escape +// 0 = 0.00% = up resp. left, +// 10000 = 100.00% = right resp. down +// only when SdrCaptionEscIsRelItem=TRUE + +class SVXCORE_DLLPUBLIC SdrCaptionEscRelItem: public SfxInt32Item { +public: + SdrCaptionEscRelItem(long nEscRel=5000): SfxInt32Item(SDRATTR_CAPTIONESCREL,nEscRel) {} + virtual ~SdrCaptionEscRelItem() override; + virtual SdrCaptionEscRelItem* Clone(SfxItemPool* pPool=nullptr) const override; + + SdrCaptionEscRelItem(SdrCaptionEscRelItem const &) = default; + SdrCaptionEscRelItem(SdrCaptionEscRelItem &&) = default; + SdrCaptionEscRelItem & operator =(SdrCaptionEscRelItem const &) = delete; // due to SfxInt32Item + SdrCaptionEscRelItem & operator =(SdrCaptionEscRelItem &&) = delete; // due to SfxInt32Item +}; + + +// class SdrCaptionEscAbsItem +// absolute line escape +// 0 = up resp. left, +// >0 = in direction right resp. down +// only when SdrCaptionEscIsRelItem=FALSE + +class SdrCaptionEscAbsItem: public SdrMetricItem { +public: + SdrCaptionEscAbsItem(long nEscAbs=0): SdrMetricItem(SDRATTR_CAPTIONESCABS,nEscAbs) {} + virtual SdrCaptionEscAbsItem* Clone(SfxItemPool*) const override + { + return new SdrCaptionEscAbsItem(*this); + } +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sxcgitm.hxx b/include/svx/sxcgitm.hxx new file mode 100644 index 000000000..e39fff444 --- /dev/null +++ b/include/svx/sxcgitm.hxx @@ -0,0 +1,40 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_SXCGITM_HXX +#define INCLUDED_SVX_SXCGITM_HXX + +#include +#include + +/** + * class SdrCaptionGapItem + * Distance of the line start from the Rect + */ +class SdrCaptionGapItem final : public SdrMetricItem { +public: + SdrCaptionGapItem(long nGap=0) : SdrMetricItem(SDRATTR_CAPTIONGAP,nGap) {} + virtual SdrCaptionGapItem* Clone(SfxItemPool*) const override + { + return new SdrCaptionGapItem(*this); + } +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sxciaitm.hxx b/include/svx/sxciaitm.hxx new file mode 100644 index 000000000..27bc07a18 --- /dev/null +++ b/include/svx/sxciaitm.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_SVX_SXCIAITM_HXX +#define INCLUDED_SVX_SXCIAITM_HXX + +#include +#include + +inline SdrAngleItem makeSdrCircStartAngleItem(long nAngle) { + return SdrAngleItem(SDRATTR_CIRCSTARTANGLE, nAngle); +} + +inline SdrAngleItem makeSdrCircEndAngleItem(long nAngle) { + return SdrAngleItem(SDRATTR_CIRCENDANGLE, nAngle); +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sxcllitm.hxx b/include/svx/sxcllitm.hxx new file mode 100644 index 000000000..00b4903be --- /dev/null +++ b/include/svx/sxcllitm.hxx @@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_SXCLLITM_HXX +#define INCLUDED_SVX_SXCLLITM_HXX + +#include +#include +#include + +/** + * Length of the first caption line + * Only for Type3 and Type4 + * Only relevant, if SdrCaptionFitLineLenItem = false + */ +class SVXCORE_DLLPUBLIC SdrCaptionLineLenItem: public SdrMetricItem { +public: + SdrCaptionLineLenItem(long nLineLen=0): SdrMetricItem(SDRATTR_CAPTIONLINELEN,nLineLen) {} + virtual ~SdrCaptionLineLenItem() override; + virtual SdrCaptionLineLenItem* Clone(SfxItemPool* pPool=nullptr) const override; + + SdrCaptionLineLenItem(SdrCaptionLineLenItem const &) = default; + SdrCaptionLineLenItem(SdrCaptionLineLenItem &&) = default; + SdrCaptionLineLenItem & operator =(SdrCaptionLineLenItem const &) = delete; // due to SdrMetricItem + SdrCaptionLineLenItem & operator =(SdrCaptionLineLenItem &&) = delete; // due to SdrMetricItem +}; + +/** + * The length of the first caption line is either automatically + * calculated or the default setting is used (SdrCaptionLineLenItem) + */ +class SVXCORE_DLLPUBLIC SdrCaptionFitLineLenItem: public SdrYesNoItem { +public: + SdrCaptionFitLineLenItem(bool bBestFit=true): SdrYesNoItem(SDRATTR_CAPTIONFITLINELEN,bBestFit) {} + virtual ~SdrCaptionFitLineLenItem() override; + virtual SdrCaptionFitLineLenItem* Clone(SfxItemPool* pPool=nullptr) const override; + + SdrCaptionFitLineLenItem(SdrCaptionFitLineLenItem const &) = default; + SdrCaptionFitLineLenItem(SdrCaptionFitLineLenItem &&) = default; + SdrCaptionFitLineLenItem & operator =(SdrCaptionFitLineLenItem const &) = delete; // due to SdrYesNoItem + SdrCaptionFitLineLenItem & operator =(SdrCaptionFitLineLenItem &&) = delete; // due to SdrYesNoItem +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sxctitm.hxx b/include/svx/sxctitm.hxx new file mode 100644 index 000000000..6c2b728a2 --- /dev/null +++ b/include/svx/sxctitm.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_SVX_SXCTITM_HXX +#define INCLUDED_SVX_SXCTITM_HXX + +#include +#include +#include + +enum class SdrCaptionType { Type1, Type2, Type3, Type4 }; + + + +class SVXCORE_DLLPUBLIC SdrCaptionTypeItem: public SfxEnumItem { +public: + SdrCaptionTypeItem(SdrCaptionType eStyle=SdrCaptionType::Type3): SfxEnumItem(SDRATTR_CAPTIONTYPE, eStyle) {} + virtual SdrCaptionTypeItem* Clone(SfxItemPool* pPool=nullptr) const override; + virtual sal_uInt16 GetValueCount() const override; // { return 4; } + static OUString GetValueTextByPos(sal_uInt16 nPos); + virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString& rText, const IntlWrapper&) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sxekitm.hxx b/include/svx/sxekitm.hxx new file mode 100644 index 000000000..36a9b72d5 --- /dev/null +++ b/include/svx/sxekitm.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_SVX_SXEKITM_HXX +#define INCLUDED_SVX_SXEKITM_HXX + +#include +#include +#include + +enum class SdrEdgeKind +{ + OrthoLines, ThreeLines, OneLine, Bezier, Arc +}; + +class SVXCORE_DLLPUBLIC SdrEdgeKindItem: public SfxEnumItem { +public: + SdrEdgeKindItem(SdrEdgeKind eStyle=SdrEdgeKind::OrthoLines): SfxEnumItem(SDRATTR_EDGEKIND, eStyle) {} + virtual SdrEdgeKindItem* Clone(SfxItemPool* pPool=nullptr) const override; + virtual sal_uInt16 GetValueCount() const override; // { return 5; } + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + static OUString GetValueTextByPos(sal_uInt16 nPos); + virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString& rText, const IntlWrapper&) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sxelditm.hxx b/include/svx/sxelditm.hxx new file mode 100644 index 000000000..a1efd2c91 --- /dev/null +++ b/include/svx/sxelditm.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_SVX_SXELDITM_HXX +#define INCLUDED_SVX_SXELDITM_HXX + +#include +#include + +class SdrEdgeLineDeltaCountItem: public SfxUInt16Item { +public: + SdrEdgeLineDeltaCountItem(sal_uInt16 nVal=0): SfxUInt16Item(SDRATTR_EDGELINEDELTACOUNT,nVal) {} + virtual SdrEdgeLineDeltaCountItem* Clone(SfxItemPool*) const override + { + return new SdrEdgeLineDeltaCountItem(*this); + } +}; + +inline SdrMetricItem makeSdrEdgeLine1DeltaItem(long nVal) { + return SdrMetricItem(SDRATTR_EDGELINE1DELTA, nVal); +} + +inline SdrMetricItem makeSdrEdgeLine2DeltaItem(long nVal) { + return SdrMetricItem(SDRATTR_EDGELINE2DELTA, nVal); +} + +inline SdrMetricItem makeSdrEdgeLine3DeltaItem(long nVal) { + return SdrMetricItem(SDRATTR_EDGELINE3DELTA, nVal); +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sxenditm.hxx b/include/svx/sxenditm.hxx new file mode 100644 index 000000000..c34dfed30 --- /dev/null +++ b/include/svx/sxenditm.hxx @@ -0,0 +1,72 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_SXENDITM_HXX +#define INCLUDED_SVX_SXENDITM_HXX + +#include +#include +#include + +class SVXCORE_DLLPUBLIC SdrEdgeNode1HorzDistItem: public SdrMetricItem { +public: + SdrEdgeNode1HorzDistItem(long nVal): SdrMetricItem(SDRATTR_EDGENODE1HORZDIST,nVal) {} + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + virtual SdrEdgeNode1HorzDistItem* Clone(SfxItemPool* pPool=nullptr) const override; +}; + +class SVXCORE_DLLPUBLIC SdrEdgeNode1VertDistItem: public SdrMetricItem { +public: + SdrEdgeNode1VertDistItem(long nVal): SdrMetricItem(SDRATTR_EDGENODE1VERTDIST,nVal) {} + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + virtual SdrEdgeNode1VertDistItem* Clone(SfxItemPool* pPool=nullptr) const override; +}; + +class SVXCORE_DLLPUBLIC SdrEdgeNode2HorzDistItem: public SdrMetricItem { +public: + SdrEdgeNode2HorzDistItem(long nVal): SdrMetricItem(SDRATTR_EDGENODE2HORZDIST,nVal) {} + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + virtual SdrEdgeNode2HorzDistItem* Clone(SfxItemPool* pPool=nullptr) const override; +}; + +class SVXCORE_DLLPUBLIC SdrEdgeNode2VertDistItem: public SdrMetricItem { +public: + SdrEdgeNode2VertDistItem(long nVal): SdrMetricItem(SDRATTR_EDGENODE2VERTDIST,nVal) {} + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + virtual SdrEdgeNode2VertDistItem* Clone(SfxItemPool* pPool=nullptr) const override; +}; + +class SdrEdgeNode1GlueDistItem: public SdrMetricItem { +public: + SdrEdgeNode1GlueDistItem(long nVal=0): SdrMetricItem(SDRATTR_EDGENODE1GLUEDIST,nVal) {} + virtual SdrEdgeNode1GlueDistItem* Clone(SfxItemPool* pPool=nullptr) const override; +}; + +class SdrEdgeNode2GlueDistItem: public SdrMetricItem { +public: + SdrEdgeNode2GlueDistItem(long nVal=0): SdrMetricItem(SDRATTR_EDGENODE2GLUEDIST,nVal) {} + virtual SdrEdgeNode2GlueDistItem* Clone(SfxItemPool* pPool=nullptr) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sxmbritm.hxx b/include/svx/sxmbritm.hxx new file mode 100644 index 000000000..c26d2b25f --- /dev/null +++ b/include/svx/sxmbritm.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_SVX_SXMBRITM_HXX +#define INCLUDED_SVX_SXMBRITM_HXX + +#include + +#include + +// dimension line below the reference edge +// for dimensioning the lower edge of the object +// (redundant to turn the reference edge through 180deg + +// TextUpsideDown, but easily operated) +// can also be dragged by dragging the measure line item +// (SdrMeasureLineDistItem) over the reference edge +class SVXCORE_DLLPUBLIC SdrMeasureBelowRefEdgeItem: public SdrYesNoItem { +public: + SdrMeasureBelowRefEdgeItem(bool bOn=false): SdrYesNoItem(SDRATTR_MEASUREBELOWREFEDGE,bOn) {} + virtual ~SdrMeasureBelowRefEdgeItem() override; + virtual SdrMeasureBelowRefEdgeItem* Clone(SfxItemPool* pPool=nullptr) const override; + + SdrMeasureBelowRefEdgeItem(SdrMeasureBelowRefEdgeItem const &) = default; + SdrMeasureBelowRefEdgeItem(SdrMeasureBelowRefEdgeItem &&) = default; + SdrMeasureBelowRefEdgeItem & operator =(SdrMeasureBelowRefEdgeItem const &) = delete; // due to SdrYesNoItem + SdrMeasureBelowRefEdgeItem & operator =(SdrMeasureBelowRefEdgeItem &&) = delete; // due to SdrYesNoItem +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sxmlhitm.hxx b/include/svx/sxmlhitm.hxx new file mode 100644 index 000000000..b2d45fa50 --- /dev/null +++ b/include/svx/sxmlhitm.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_SVX_SXMLHITM_HXX +#define INCLUDED_SVX_SXMLHITM_HXX + +#include +#include + +// Measure +// ___ +// | 100,00km | 2mm = SdrMeasureHelplineOverhangItem +// |<--------------------->|--- +// | | 8mm = SdrMeasureLineDistItem +// | | +// #=============# |--- +// # # | SdrMeasureHelpline1/2LenItem +// # #=========#--- +// # dimensioned object # +// #=======================# + +// gab between dimension line and document reference edge (norm=8mm) +// can be dragged on the handles of the arrowheads +inline SdrMetricItem makeSdrMeasureLineDistItem(long nVal) { + return SdrMetricItem(SDRATTR_MEASURELINEDIST, nVal); +} + +// overhang of dimension help line to dimension line (norm=2mm) +inline SdrMetricItem makeSdrMeasureHelplineOverhangItem(long nVal) { + return SdrMetricItem(SDRATTR_MEASUREHELPLINEOVERHANG, nVal); +} + +// gab between dimension line and document reference edge +// dimension help lines shell not touch the object +inline SdrMetricItem makeSdrMeasureHelplineDistItem(long nVal) { + return SdrMetricItem(SDRATTR_MEASUREHELPLINEDIST, nVal); +} + +// overlength of the help lines can be dragged at the round handles, +// which are under the reference points by default +inline SdrMetricItem makeSdrMeasureHelpline1LenItem(long nVal) { + return SdrMetricItem(SDRATTR_MEASUREHELPLINE1LEN, nVal); +} +inline SdrMetricItem makeSdrMeasureHelpline2LenItem(long nVal) { + return SdrMetricItem(SDRATTR_MEASUREHELPLINE2LEN, nVal); +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sxmtfitm.hxx b/include/svx/sxmtfitm.hxx new file mode 100644 index 000000000..4701c037f --- /dev/null +++ b/include/svx/sxmtfitm.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_SVX_SXMTFITM_HXX +#define INCLUDED_SVX_SXMTFITM_HXX + +#include +#include +#include + +// The two following are not implemented yet! +// Nail text down to a fix angle. +// The text angle is independent of the dimension line. +// Abrogate TextUpsideDown, TextRota90 and TextAutoAngle. (n.i.) +class SdrMeasureTextIsFixedAngleItem: public SdrYesNoItem { +public: + SdrMeasureTextIsFixedAngleItem(bool bOn=false): SdrYesNoItem(SDRATTR_MEASURETEXTISFIXEDANGLE,bOn) {} + virtual ~SdrMeasureTextIsFixedAngleItem() override; + virtual SdrMeasureTextIsFixedAngleItem* Clone(SfxItemPool* pPool=nullptr) const override; + + SdrMeasureTextIsFixedAngleItem(SdrMeasureTextIsFixedAngleItem const &) = default; + SdrMeasureTextIsFixedAngleItem(SdrMeasureTextIsFixedAngleItem &&) = default; + SdrMeasureTextIsFixedAngleItem & operator =(SdrMeasureTextIsFixedAngleItem const &) = delete; // due to SdrYesNoItem + SdrMeasureTextIsFixedAngleItem & operator =(SdrMeasureTextIsFixedAngleItem &&) = delete; // due to SdrYesNoItem +}; + +//Angle of the text in 1/100deg. 0=horizontal; read from left to right. (n.i.) +class SdrMeasureTextFixedAngleItem: public SdrAngleItem { +public: + SdrMeasureTextFixedAngleItem(long nVal=0): SdrAngleItem(SDRATTR_MEASURETEXTFIXEDANGLE,nVal) {} + virtual ~SdrMeasureTextFixedAngleItem() override; + virtual SdrMeasureTextFixedAngleItem* Clone(SfxItemPool* pPool=nullptr) const override; + + SdrMeasureTextFixedAngleItem(SdrMeasureTextFixedAngleItem const &) = default; + SdrMeasureTextFixedAngleItem(SdrMeasureTextFixedAngleItem &&) = default; + SdrMeasureTextFixedAngleItem & operator =(SdrMeasureTextFixedAngleItem const &) = delete; // due to SdrAngleItem + SdrMeasureTextFixedAngleItem & operator =(SdrMeasureTextFixedAngleItem &&) = delete; // due to SdrAngleItem +}; + +// The decimal places used for the measure value +class SVXCORE_DLLPUBLIC SdrMeasureDecimalPlacesItem: public SfxInt16Item { +public: + SdrMeasureDecimalPlacesItem(sal_Int16 nVal=2): SfxInt16Item(SDRATTR_MEASUREDECIMALPLACES,nVal) {} + virtual ~SdrMeasureDecimalPlacesItem() override; + virtual SdrMeasureDecimalPlacesItem* Clone(SfxItemPool* pPool=nullptr) const override; + + SdrMeasureDecimalPlacesItem(SdrMeasureDecimalPlacesItem const &) = default; + SdrMeasureDecimalPlacesItem(SdrMeasureDecimalPlacesItem &&) = default; + SdrMeasureDecimalPlacesItem & operator =(SdrMeasureDecimalPlacesItem const &) = delete; // due to SfxInt16Item + SdrMeasureDecimalPlacesItem & operator =(SdrMeasureDecimalPlacesItem &&) = delete; // due to SfxInt16Item +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sxmtpitm.hxx b/include/svx/sxmtpitm.hxx new file mode 100644 index 000000000..3a751b419 --- /dev/null +++ b/include/svx/sxmtpitm.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_SVX_SXMTPITM_HXX +#define INCLUDED_SVX_SXMTPITM_HXX + +#include +#include +#include +#include +#include + +class SVXCORE_DLLPUBLIC SdrMeasureTextHPosItem: public SfxEnumItem { +public: + SdrMeasureTextHPosItem(css::drawing::MeasureTextHorzPos ePos = css::drawing::MeasureTextHorzPos::MeasureTextHorzPos_AUTO) + : SfxEnumItem(SDRATTR_MEASURETEXTHPOS, ePos) + { + } + virtual SdrMeasureTextHPosItem* Clone(SfxItemPool* pPool=nullptr) const override; + virtual sal_uInt16 GetValueCount() const override; // { return 4; } + + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + static OUString GetValueTextByPos(sal_uInt16 nPos); + virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString& rText, const IntlWrapper&) const override; +}; + +class SVXCORE_DLLPUBLIC SdrMeasureTextVPosItem: public SfxEnumItem { +public: + SdrMeasureTextVPosItem(css::drawing::MeasureTextVertPos ePos = css::drawing::MeasureTextVertPos_AUTO) + : SfxEnumItem(SDRATTR_MEASURETEXTVPOS, ePos) + { + } + virtual SdrMeasureTextVPosItem* Clone(SfxItemPool* pPool=nullptr) const override; + virtual sal_uInt16 GetValueCount() const override; // { return 5; } + + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + static OUString GetValueTextByPos(sal_uInt16 nPos); + virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString& rText, const IntlWrapper&) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sxmtritm.hxx b/include/svx/sxmtritm.hxx new file mode 100644 index 000000000..e208d2790 --- /dev/null +++ b/include/svx/sxmtritm.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_SVX_SXMTRITM_HXX +#define INCLUDED_SVX_SXMTRITM_HXX + +#include +#include + +// text across the dimension line (90deg counter-clockwise rotation) +class SVXCORE_DLLPUBLIC SdrMeasureTextRota90Item: public SdrYesNoItem { +public: + SdrMeasureTextRota90Item(bool bOn=false): SdrYesNoItem(SDRATTR_MEASURETEXTROTA90,bOn) {} + virtual ~SdrMeasureTextRota90Item() override; + virtual SdrMeasureTextRota90Item* Clone(SfxItemPool* pPool=nullptr) const override; + + SdrMeasureTextRota90Item(SdrMeasureTextRota90Item const &) = default; + SdrMeasureTextRota90Item(SdrMeasureTextRota90Item &&) = default; + SdrMeasureTextRota90Item & operator =(SdrMeasureTextRota90Item const &) = delete; // due to SdrYesNoItem + SdrMeasureTextRota90Item & operator =(SdrMeasureTextRota90Item &&) = delete; // due to SdrYesNoItem +}; + +// Turn the calculated TextRect through 180 deg +// Text is also switched to the other side of the dimension line, if not Rota90 +class SdrMeasureTextUpsideDownItem final : public SdrYesNoItem { +public: + SdrMeasureTextUpsideDownItem(bool bOn=false): SdrYesNoItem(SDRATTR_MEASURETEXTUPSIDEDOWN,bOn) {} + virtual ~SdrMeasureTextUpsideDownItem() override; + virtual SdrMeasureTextUpsideDownItem* Clone(SfxItemPool* pPool=nullptr) const override; + + SdrMeasureTextUpsideDownItem(SdrMeasureTextUpsideDownItem const &) = default; + SdrMeasureTextUpsideDownItem(SdrMeasureTextUpsideDownItem &&) = default; + SdrMeasureTextUpsideDownItem & operator =(SdrMeasureTextUpsideDownItem const &) = delete; // due to SdrYesNoItem + SdrMeasureTextUpsideDownItem & operator =(SdrMeasureTextUpsideDownItem &&) = delete; // due to SdrYesNoItem +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/sxmuitm.hxx b/include/svx/sxmuitm.hxx new file mode 100644 index 000000000..e350e9677 --- /dev/null +++ b/include/svx/sxmuitm.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_SVX_SXMUITM_HXX +#define INCLUDED_SVX_SXMUITM_HXX + +#include +#include +#include +#include + +// specification of the unit if measurement. The numerical quantity value is converted in this unity. +// (based on the facts of the MapUnit of the model). This unity is displayed if necessary. +class SVXCORE_DLLPUBLIC SdrMeasureUnitItem: public SfxEnumItem { +public: + SdrMeasureUnitItem(FieldUnit eUnit=FieldUnit::NONE): SfxEnumItem(SDRATTR_MEASUREUNIT, eUnit) {} + virtual SdrMeasureUnitItem* Clone(SfxItemPool* pPool=nullptr) const override; + virtual sal_uInt16 GetValueCount() const override; // { return 14; } + + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + static OUString GetValueTextByPos(sal_uInt16 nPos); + virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString& rText, const IntlWrapper&) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/tabarea.hxx b/include/svx/tabarea.hxx new file mode 100644 index 000000000..b1307b4c4 --- /dev/null +++ b/include/svx/tabarea.hxx @@ -0,0 +1,37 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_TABAREA_HXX +#define INCLUDED_SVX_TABAREA_HXX + +#include + +enum class ChangeType +{ + NONE = 0x00, + MODIFIED = 0x01, + CHANGED = 0x02 +}; +namespace o3tl +{ + template<> struct typed_flags : is_typed_flags {}; +} + +#endif // INCLUDED_SVX_TABAREA_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/tabline.hxx b/include/svx/tabline.hxx new file mode 100644 index 000000000..398845146 --- /dev/null +++ b/include/svx/tabline.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_SVX_TABLINE_HXX +#define INCLUDED_SVX_TABLINE_HXX + +class SvxBrushItem; +class SdrModel; +class SdrObject; + +//defines for the symbol selection on the page +//Positive value (0,...n) declares the index in pSymbollist, else: +#define SVX_SYMBOLTYPE_NONE (-3) //symbol hidden +#define SVX_SYMBOLTYPE_AUTO (-2) //symbol automatically generated +#define SVX_SYMBOLTYPE_BRUSHITEM (-1) //symbol is contained as graphic in item: +#define SVX_SYMBOLTYPE_UNKNOWN (-100) //unknown/not initialized + +#endif // INCLUDED_SVX_TABLINE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/tbcontrl.hxx b/include/svx/tbcontrl.hxx new file mode 100644 index 000000000..387c67f4b --- /dev/null +++ b/include/svx/tbcontrl.hxx @@ -0,0 +1,281 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_TBCONTRL_HXX +#define INCLUDED_SVX_TBCONTRL_HXX + +/*--------------------------------------------------------------*\ + + Description: + ------------- + ToolBox-Controller for: + Font-Name, Font-Height, Font-Color + Fore-/Background color /-patterns + Frames, Lines + (indentation-)templates + + Use: + ---------- + SvxFontNameToolBoxControl + ------------------------- + Item type: SvxFontItem + Execute-Id: SID_ATTR_CHAR_FONT + -> SvxFontItem + Additional information + from DocShell: SvxFontListItem (SID_ATTR_CHAR_FONTLIST) + + SvxColorToolBoxControl + ---------------------- + Item type: SvxColorItem + SvxLineItem + SfxBoolItem + XLineColorItem + and XFillColorItem + + for font color (writer, ...) + Execute-Id SID_ATTR_CHAR_COLOR2 + and SID_ATTR_CHAR_COLOR_EXT + + for font color + (calc/impress/draw and writer drawing objects) + Execute-Id SID_ATTR_CHAR_COLOR + + for character background color (writer) + Execute-Id SID_ATTR_CHAR_COLOR_BACKGROUND + and SID_ATTR_CHAR_COLOR_BACKGROUND_EXT + + for paragraph background color (writer) + and cell background color (calc) + Execute-Id SID_BACKGROUND_COLOR + + for table/cell border color (writer, calc) + Execute-Id SID_FRAME_LINECOLOR + + for 3D extrusion + Execute-Id SID_EXTRUSION_3D_COLOR + + for line color + Execute-Id SID_ATTR_LINE_COLOR + + for area fill color + Execute-Id SID_ATTR_FILL_COLOR + + SvxPatternToolBoxControl + ------------------------ + Item type: SvxBrushItem + Execute-Id: SID_BACKGROUND_PATTERN + -> SvxBrushItem + Additional information + from DocShell: presently none + in future: color palette + Note: Analysis of BrushItem: + Brush-FillColor() is misused as switch, + to distinguish whether a new style + or a new color has been set + + GetFillColor() == COL_BLACK -> GetStyle() , + GetFillColor() == COL_WHITE -> GetColor() + + SvxFrameToolBoxControl + ---------------------- + Item type: SvxBoxItem + Execute-Id: SID_ATTR_BORDER + -> SvxBoxItem & SvxBoxInfoItem + Additional information + from DocShell: none + Note: provides, depending on chosen ValueSet-Item, + only SvxBoxItem or additionally SvxBoxInfoItem + If the Controller in SfxUInt16Item receives a + value != 0, paragraph mode will be switched on, + i.e. the last line will be hidden. + A value == 0 switches again to Table mode. + + SvxFrameLineStyleToolBoxControl + ------------------------------- + Item type: SvxLineItem + Execute-Id: SID_FRAME_LINESTYLE + -> SvxLineItem + Additional information + from DocShell: none + Note: provides a SvxLineItem, which provides a SvxBorderLine + without color information. + + SvxStyleToolBoxControl + ---------------------- + Item type: SfxTemplateItem + Execute-Id: SID_TEMPLATE_APPLY + -> StyleName (SfxStringItem) + -> eStyleFamily (SfxUInt16Item) + Additional information + from DocShell: none + Note: Switch family by Invalidate + at the Bindings (->SfxStyleControllerItem) + +\*--------------------------------------------------------------*/ + +// ITEMID_... defines in the *.cxx + +#include +#include +#include +#include +#include +#include +#include +#include + +// important in the tbxctrls.hxx created with HeDaBu !!! +class SvxLineItem; +class SvxBoxInfoItem; +class SvxFontItem; +class SfxStyleControllerItem_Impl; +class SfxStyleSheetBasePool; +class SfxTemplateItem; +class PaletteManager; + +namespace svx +{ + class ToolboxButtonColorUpdaterBase; +} + +class SVXCORE_DLLPUBLIC SvxStyleToolBoxControl final : public cppu::ImplInheritanceHelper +{ + struct Impl; + std::unique_ptr pImpl; + +public: + SvxStyleToolBoxControl(); + virtual ~SvxStyleToolBoxControl() override; + + // XStatusListener + virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) override; + + // XToolbarController + virtual css::uno::Reference SAL_CALL createItemWindow(const css::uno::Reference& rParent) override; + + // XInitialization + virtual void SAL_CALL initialize(const css::uno::Sequence& aArguments) override; + + // XUpdatable + virtual void SAL_CALL update() override; + + // XComponent + virtual void SAL_CALL dispose() override; + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() override; + virtual sal_Bool SAL_CALL supportsService(const OUString& rServiceName) override; + virtual css::uno::Sequence SAL_CALL getSupportedServiceNames() override; + +private: +#define MAX_FAMILIES 5 + + SfxStyleSheetBasePool* pStyleSheetPool; + SfxStyleControllerItem_Impl* pBoundItems[MAX_FAMILIES]; + css::uno::Reference m_xBoundItems[MAX_FAMILIES]; + std::unique_ptr pFamilyState[MAX_FAMILIES]; + sal_uInt16 nActFamily; // Id in the ToolBox = Position - 1 + + SVX_DLLPRIVATE void Update(); + SVX_DLLPRIVATE void FillStyleBox(); + SVX_DLLPRIVATE void SelectStyle(const OUString& rStyleName); + +friend class SfxStyleControllerItem_Impl; + + SVX_DLLPRIVATE void SetFamilyState(sal_uInt16 nIdx, const SfxTemplateItem* pItem); + SVX_DLLPRIVATE SfxStyleFamily GetActFamily() const; +}; + +typedef std::function ColorSelectFunction; + +class SVXCORE_DLLPUBLIC SvxColorToolBoxControl final : public cppu::ImplInheritanceHelper< svt::PopupWindowController, + css::frame::XSubToolbarController > +{ + std::unique_ptr m_xBtnUpdater; + std::shared_ptr m_xPaletteManager; + ColorStatus m_aColorStatus; + bool m_bSplitButton; + sal_uInt16 m_nSlotId; + ColorSelectFunction m_aColorSelectFunction; + DECL_LINK(SelectedHdl, const NamedColor&, void); + +public: + explicit SvxColorToolBoxControl( const css::uno::Reference& rContext ); + virtual ~SvxColorToolBoxControl() override; + + // XInitialization + virtual void SAL_CALL initialize( const css::uno::Sequence& rArguments ) override; + + // XUpdatable + virtual void SAL_CALL update() override; + + // XStatusListener + virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) override; + + // XToolbarController + virtual void SAL_CALL execute( sal_Int16 nSelectModifier ) override; + + virtual VclPtr createVclPopupWindow( vcl::Window* pParent ) override; + virtual std::unique_ptr weldPopupWindow() override; + + // XSubToolbarController + virtual sal_Bool SAL_CALL opensSubToolbar() override; + virtual OUString SAL_CALL getSubToolbarName() override; + virtual void SAL_CALL functionSelected( const OUString& rCommand ) override; + virtual void SAL_CALL updateImage() override; + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() override; + virtual css::uno::Sequence SAL_CALL getSupportedServiceNames() override; + + void setColorSelectFunction(const ColorSelectFunction& aColorSelectFunction); + void EnsurePaletteManager(); +}; + +class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) SvxCurrencyToolBoxControl final : public svt::PopupWindowController +{ +private: + OUString m_aFormatString; + LanguageType m_eLanguage; + sal_uInt32 m_nFormatKey; + +public: + static void GetCurrencySymbols( std::vector& rList, bool bFlag, + std::vector& rCurrencyList ); + + explicit SvxCurrencyToolBoxControl( const css::uno::Reference& rContext ); + virtual ~SvxCurrencyToolBoxControl() override; + + // XToolbarController + virtual void SAL_CALL execute( sal_Int16 nSelectModifier ) override; + + virtual VclPtr createVclPopupWindow( vcl::Window* pParent ) override; + virtual std::unique_ptr weldPopupWindow() override; + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() override; + virtual css::uno::Sequence SAL_CALL getSupportedServiceNames() override; + + // XInitialization + virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& rArguments ) override; +}; + +#endif // INCLUDED_SVX_TBCONTRL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/tbxcolor.hxx b/include/svx/tbxcolor.hxx new file mode 100644 index 000000000..b98b0be7b --- /dev/null +++ b/include/svx/tbxcolor.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 . + */ + +#pragma once + +#include +#include + + +namespace svx +{ + + + //= ToolboxAccess + + class SVX_DLLPUBLIC ToolboxAccess + { + private: + OUString m_sToolboxResName; + css::uno::Reference< + css::frame::XLayoutManager > m_xLayouter; + + public: + ToolboxAccess( const OUString& rToolboxName ); + + public: + /** toggles the toolbox + */ + void toggleToolbox() const; + + /** determines whether the toolbox is currently visible + */ + bool isToolboxVisible() const; + }; + + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/tbxcolorupdate.hxx b/include/svx/tbxcolorupdate.hxx new file mode 100644 index 000000000..5a7e64c22 --- /dev/null +++ b/include/svx/tbxcolorupdate.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_SVX_TBXCOLORUPDATE_HXX +#define INCLUDED_SVX_TBXCOLORUPDATE_HXX + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +class ToolBox; +class VirtualDevice; + +namespace weld +{ + class Toolbar; +} + +namespace svx +{ + + + //= ToolboxButtonColorUpdater + + /** helper class to update a color in a toolbox button image + + formerly known as SvxTbxButtonColorUpdater_Impl, residing in svx/source/tbxctrls/colorwindow.hxx. + */ + class ToolboxButtonColorUpdaterBase + { + public: + ToolboxButtonColorUpdaterBase(bool bWideButton, const OUString& rCommandLabel, + const OUString& rCommandURL, + const css::uno::Reference& rFrame); + + virtual ~ToolboxButtonColorUpdaterBase(); + + void Update( const NamedColor& rNamedColor ); + void Update( const Color& rColor, bool bForceUpdate = false ); + Color const & GetCurrentColor() const { return maCurColor; } + OUString GetCurrentColorName(); + + private: + ToolboxButtonColorUpdaterBase(ToolboxButtonColorUpdaterBase const &) = delete; + ToolboxButtonColorUpdaterBase& operator =(ToolboxButtonColorUpdaterBase const &) = delete; + + protected: + bool mbWideButton; + bool mbWasHiContrastMode; + Color maCurColor; + tools::Rectangle maUpdRect; + Size maBmpSize; + vcl::ImageType meImageType; + OUString maCommandLabel; + OUString maCommandURL; + css::uno::Reference mxFrame; + + void Init(sal_uInt16 nSlotId); + + virtual void SetQuickHelpText(const OUString& rText) = 0; + virtual OUString GetQuickHelpText() const = 0; + virtual void SetImage(VirtualDevice* pVirDev) = 0; + virtual VclPtr CreateVirtualDevice() const = 0; + virtual vcl::ImageType GetImageSize() const = 0; + virtual Size GetItemSize(const Size& rImageSize) const = 0; + }; + + class VclToolboxButtonColorUpdater : public ToolboxButtonColorUpdaterBase + { + public: + VclToolboxButtonColorUpdater(sal_uInt16 nSlotId, sal_uInt16 nTbxBtnId, ToolBox* ptrTbx, bool bWideButton, + const OUString& rCommandLabel, const OUString& rCommandURL, + const css::uno::Reference& rFrame); + + + private: + sal_uInt16 mnBtnId; + VclPtr mpTbx; + + virtual void SetQuickHelpText(const OUString& rText) override; + virtual OUString GetQuickHelpText() const override; + virtual void SetImage(VirtualDevice* pVirDev) override; + virtual VclPtr CreateVirtualDevice() const override; + virtual vcl::ImageType GetImageSize() const override; + virtual Size GetItemSize(const Size& rImageSize) const override; + }; + + class ToolboxButtonColorUpdater : public ToolboxButtonColorUpdaterBase + { + public: + ToolboxButtonColorUpdater(sal_uInt16 nSlotId, const OString& rTbxBtnId, weld::Toolbar* ptrTbx, bool bWideButton, + const OUString& rCommandLabel, const css::uno::Reference& rFrame); + + private: + OString msBtnId; + weld::Toolbar* mpTbx; + + virtual void SetQuickHelpText(const OUString& rText) override; + virtual OUString GetQuickHelpText() const override; + virtual void SetImage(VirtualDevice* pVirDev) override; + virtual VclPtr CreateVirtualDevice() const override; + virtual vcl::ImageType GetImageSize() const override; + virtual Size GetItemSize(const Size& rImageSize) const override; + }; + + class ToolboxButtonLineStyleUpdater + { + private: + css::drawing::LineStyle m_eXLS; + int m_nDashStyleIndex; + public: + ToolboxButtonLineStyleUpdater(); + void Update(const css::frame::FeatureStateEvent& rEvent); + int GetStyleIndex() const; + }; +} + +#endif // INCLUDED_SVX_TBXCOLORUPDATE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/tbxctl.hxx b/include/svx/tbxctl.hxx new file mode 100644 index 000000000..46b8d6dbb --- /dev/null +++ b/include/svx/tbxctl.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_SVX_TBXCTL_HXX +#define INCLUDED_SVX_TBXCTL_HXX + +#include +#include + +/************************************************************************* +|* +|* Class for SwToolbox +|* +\************************************************************************/ + +class SVX_DLLPUBLIC SvxTbxCtlDraw final : public SfxToolBoxControl +{ +private: + OUString m_sToolboxName; + + void toggleToolbox(); + +protected: + +public: + SvxTbxCtlDraw( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ); + // XInitialization + virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override; + + SFX_DECL_TOOLBOX_CONTROL(); + + virtual void Select(sal_uInt16 nSelectModifier) override; + virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, + const SfxPoolItem* pState ) override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/transfrmhelper.hxx b/include/svx/transfrmhelper.hxx new file mode 100644 index 000000000..9e683d445 --- /dev/null +++ b/include/svx/transfrmhelper.hxx @@ -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 INCLUDED_SVX_TRANSFRMHELPER_HXX +#define INCLUDED_SVX_TRANSFRMHELPER_HXX + +#include +#include +#include +#include +#include + +namespace TransfrmHelper +{ + inline void ConvertRect(basegfx::B2DRange& rRange, const sal_uInt16 nDigits, const MapUnit ePoolUnit, const FieldUnit eDlgUnit) + { + const basegfx::B2DPoint aTopLeft( + static_cast(vcl::ConvertValue(basegfx::fround(rRange.getMinX()), nDigits, ePoolUnit, eDlgUnit)), + static_cast(vcl::ConvertValue(basegfx::fround(rRange.getMinY()), nDigits, ePoolUnit, eDlgUnit))); + const basegfx::B2DPoint aBottomRight( + static_cast(vcl::ConvertValue(basegfx::fround(rRange.getMaxX()), nDigits, ePoolUnit, eDlgUnit)), + static_cast(vcl::ConvertValue(basegfx::fround(rRange.getMaxY()), nDigits, ePoolUnit, eDlgUnit))); + + rRange = basegfx::B2DRange(aTopLeft, aBottomRight); + } + + inline void ScaleRect(basegfx::B2DRange& rRange, const Fraction& rUIScale) + { + const double fFactor(1.0 / double(rUIScale)); + rRange = basegfx::B2DRange(rRange.getMinimum() * fFactor, rRange.getMaximum() * fFactor); + } +} + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/txencbox.hxx b/include/svx/txencbox.hxx new file mode 100644 index 000000000..d98c66713 --- /dev/null +++ b/include/svx/txencbox.hxx @@ -0,0 +1,163 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_TXENCBOX_HXX +#define INCLUDED_SVX_TXENCBOX_HXX + +#include +#include +#include + +class SVX_DLLPUBLIC SvxTextEncodingBox +{ +private: + std::unique_ptr m_xControl; + +public: + SvxTextEncodingBox(std::unique_ptr pControl); + + ~SvxTextEncodingBox(); + + /** Fill with all known encodings but exclude those matching one or more + given flags as defined in rtl/tencinfo.h + +

    If nButIncludeInfoFlags is given, encodings are included even if they + match nExcludeInfoFlags. Thus it is possible to exclude 16/32-bit + Unicode with RTL_TEXTENCODING_INFO_UNICODE but to include UTF7 and UTF8 + with RTL_TEXTENCODING_INFO_MIME

    + + @param bExcludeImportSubsets + If , some specific encodings are not listed, as they are a + subset of another encoding. This is the case for + RTL_TEXTENCODING_GB_2312, RTL_TEXTENCODING_GBK, + RTL_TEXTENCODING_MS_936, which are covered by + RTL_TEXTENCODING_GB_18030. Normally, this flag should be set to + whenever the box is used in import dialogs. */ + void FillFromTextEncodingTable( + bool bExcludeImportSubsets, + sal_uInt32 nExcludeInfoFlags = 0, + sal_uInt32 nButIncludeInfoFlags = 0 + ); + + /** Fill with all encodings known to the dbtools::OCharsetMap but exclude + those matching one or more given flags as defined in rtl/tencinfo.h + +

    If nButIncludeInfoFlags is given, encodings are included even if they + match nExcludeInfoFlags. Thus it is possible to exclude 16/32-bit + Unicode with RTL_TEXTENCODING_INFO_UNICODE but to include UTF7 and UTF8 + with RTL_TEXTENCODING_INFO_MIME

    + + @param bExcludeImportSubsets + If , some specific encodings are not listed, as they are a + subset of another encoding. This is the case for + RTL_TEXTENCODING_GB_2312, RTL_TEXTENCODING_GBK, + RTL_TEXTENCODING_MS_936, which are covered by + RTL_TEXTENCODING_GB_18030. Normally, this flag should be set to + whenever the box is used in import dialogs. */ + void FillFromDbTextEncodingMap( + bool bExcludeImportSubsets, + sal_uInt32 nExcludeInfoFlags = 0); + + /** Fill with all known MIME encodings and select the best according to + GetBestMimeEncoding + */ + void FillWithMimeAndSelectBest(); + + void InsertTextEncoding( const rtl_TextEncoding nEnc ); + + void InsertTextEncoding( const rtl_TextEncoding nEnc, + const OUString& rEntry ); + + void SelectTextEncoding( const rtl_TextEncoding nEnc ); + + rtl_TextEncoding GetSelectTextEncoding() const; + + void connect_changed(const Link& rLink) { m_xControl->connect_changed(rLink); } + void set_sensitive(bool bSensitive) { m_xControl->set_sensitive(bSensitive); } + void grab_focus() { m_xControl->grab_focus(); } + int get_active() const { return m_xControl->get_active(); } + void set_active(int nActive) { m_xControl->set_active(nActive); } + void show() { m_xControl->show(); } + void hide() { m_xControl->hide(); } +}; + +class SVX_DLLPUBLIC SvxTextEncodingTreeView +{ +private: + std::unique_ptr m_xControl; + +public: + SvxTextEncodingTreeView(std::unique_ptr pControl); + + ~SvxTextEncodingTreeView(); + + /** Fill with all known encodings but exclude those matching one or more + given flags as defined in rtl/tencinfo.h + + @param bExcludeImportSubsets + If , some specific encodings are not listed, as they are a + subset of another encoding. This is the case for + RTL_TEXTENCODING_GB_2312, RTL_TEXTENCODING_GBK, + RTL_TEXTENCODING_MS_936, which are covered by + RTL_TEXTENCODING_GB_18030. Normally, this flag should be set to + whenever the box is used in import dialogs. */ + void FillFromTextEncodingTable( + bool bExcludeImportSubsets, + sal_uInt32 nExcludeInfoFlags = 0); + + /** Fill with all encodings known to the dbtools::OCharsetMap but exclude + those matching one or more given flags as defined in rtl/tencinfo.h + + @param bExcludeImportSubsets + If , some specific encodings are not listed, as they are a + subset of another encoding. This is the case for + RTL_TEXTENCODING_GB_2312, RTL_TEXTENCODING_GBK, + RTL_TEXTENCODING_MS_936, which are covered by + RTL_TEXTENCODING_GB_18030. Normally, this flag should be set to + whenever the box is used in import dialogs. */ + void FillFromDbTextEncodingMap( + bool bExcludeImportSubsets, + sal_uInt32 nExcludeInfoFlags = 0); + + void InsertTextEncoding( const rtl_TextEncoding nEnc ); + + void InsertTextEncoding( const rtl_TextEncoding nEnc, + const OUString& rEntry ); + + void SelectTextEncoding( const rtl_TextEncoding nEnc ); + + rtl_TextEncoding GetSelectTextEncoding() const; + + void connect_changed(const Link& rLink) { m_xControl->connect_changed(rLink); } + void connect_row_activated(const Link& rLink) { m_xControl->connect_row_activated(rLink); } + void grab_focus() { m_xControl->grab_focus(); } + void show() { m_xControl->show(); } + void hide() { m_xControl->hide(); } + int get_height_rows(int nRows) const + { + return m_xControl->get_height_rows(nRows); + } + void set_size_request(int nWidth, int nHeight) + { + m_xControl->set_size_request(nWidth, nHeight); + } +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/txenctab.hxx b/include/svx/txenctab.hxx new file mode 100644 index 000000000..c4bbbd4e9 --- /dev/null +++ b/include/svx/txenctab.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_SVX_TXENCTAB_HXX +#define INCLUDED_SVX_TXENCTAB_HXX + +#include +#include +#include + +class SVX_DLLPUBLIC SvxTextEncodingTable +{ +public: + static OUString GetTextString(const rtl_TextEncoding nEnc); + static rtl_TextEncoding GetTextEncoding(const OUString& rStr); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/ucsubset.hxx b/include/svx/ucsubset.hxx new file mode 100644 index 000000000..106a0d9d4 --- /dev/null +++ b/include/svx/ucsubset.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_SVX_UCSUBSET_HXX +#define INCLUDED_SVX_UCSUBSET_HXX + +#include + +#include + +#include + +class FontCharMap; + +// TODO: should be moved into Font Attributes territory, +// we let them mature here though because this is currently the only use + +class Subset +{ +public: + Subset(sal_UCS4 nMin, sal_UCS4 nMax, const OUString& rName); + + sal_UCS4 GetRangeMin() const { return mnRangeMin;} + sal_UCS4 GetRangeMax() const { return mnRangeMax;} + const OUString& GetName() const { return maRangeName;} + +private: + sal_UCS4 mnRangeMin; + sal_UCS4 mnRangeMax; + OUString maRangeName; +}; + +inline bool operator<(const Subset &rLHS, const Subset &rRHS) +{ + return rLHS.GetRangeMin() < rRHS.GetRangeMin(); +} + +typedef ::std::vector SubsetVec; + +class SVX_DLLPUBLIC SubsetMap +{ +public: + SubsetMap( const FontCharMapRef& ); + + const Subset* GetSubsetByUnicode( sal_UCS4 ) const; + const SubsetVec& GetSubsetMap() const; + +private: + SubsetVec maSubsets; + + SVX_DLLPRIVATE void InitList(); + SVX_DLLPRIVATE void ApplyCharMap( const FontCharMapRef& ); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/uiobject.hxx b/include/svx/uiobject.hxx new file mode 100644 index 000000000..ea40c2a6b --- /dev/null +++ b/include/svx/uiobject.hxx @@ -0,0 +1,37 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_SVX_UIOBJECT_HXX +#define INCLUDED_SVX_UIOBJECT_HXX + +#include + +#include + +class SdrObject; + +class SVXCORE_DLLPUBLIC SdrUIObject : public UIObject +{ +public: + + virtual ~SdrUIObject() override; + + virtual StringMap get_state() override; + + virtual void execute(const OUString& rAction, + const StringMap& rParameters) override; + + virtual OUString get_type() const override; + + virtual SdrObject* get_object() = 0; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/unoapi.hxx b/include/svx/unoapi.hxx new file mode 100644 index 000000000..693a15646 --- /dev/null +++ b/include/svx/unoapi.hxx @@ -0,0 +1,95 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_UNOAPI_HXX +#define INCLUDED_SVX_UNOAPI_HXX + +#include +#include +#include +#include +#include +#include + +class SvxShape; +class SdrObject; +class SdrPage; +class SvxNumBulletItem; +class SfxItemPool; +enum class SdrInventor : sal_uInt32; + +/** + * Creates a StarOffice API wrapper with the given type and inventor + * Deprecated: This will be replaced with a function returning XShape. + * + * @throws css::uno::RuntimeException + */ +SVXCORE_DLLPUBLIC SvxShape* CreateSvxShapeByTypeAndInventor(sal_uInt16 nType, SdrInventor nInventor, OUString const & referer); + +/** Returns a StarOffice API wrapper for the given SdrObject */ +SVXCORE_DLLPUBLIC css::uno::Reference< css::drawing::XShape > GetXShapeForSdrObject( SdrObject* pObj ) throw (); + +/** Returns the SdrObject from the given StarOffice API wrapper */ +SVXCORE_DLLPUBLIC SdrObject* GetSdrObjectFromXShape( const css::uno::Reference< css::drawing::XShape >& xShape ) throw() ; + +/** Returns a StarOffice API wrapper for the given SdrPage */ +SVXCORE_DLLPUBLIC css::uno::Reference< css::drawing::XDrawPage > GetXDrawPageForSdrPage( SdrPage* pPage ) throw (); + +/** Returns the SdrPage from the given StarOffice API wrapper */ +SVXCORE_DLLPUBLIC SdrPage* GetSdrPageFromXDrawPage( const css::uno::Reference< css::drawing::XDrawPage >& xDrawPage ) throw() ; + +/** + * Maps the vcl MapUnit enum to an API constant MeasureUnit. + * Returns false if conversion is not supported. + */ +SVXCORE_DLLPUBLIC bool SvxMapUnitToMeasureUnit( const MapUnit nVcl, short& eApi ) throw(); + +/** + * Maps the API constant MeasureUnit to a vcl MapUnit enum. + * Returns false if conversion is not supported. + */ +SVXCORE_DLLPUBLIC bool SvxMeasureUnitToFieldUnit( const short eApi, FieldUnit& nVcl ) throw(); + +/** + * Maps the vcl MapUnit enum to an API constant MeasureUnit. + * Returns false if conversion is not supported. + */ +SVXCORE_DLLPUBLIC bool SvxFieldUnitToMeasureUnit( const FieldUnit nVcl, short& eApi ) throw(); + +/** + * If the given name is a predefined name for the current language it is replaced by + * the corresponding API name. + * + * @throws std::exception +*/ +[[nodiscard]] SVXCORE_DLLPUBLIC OUString + SvxUnogetApiNameForItem(const sal_uInt16 nWhich, const OUString& rInternalName); + +/** + * If the given name is a predefined API name it is replaced by the predefined name + * for the current language. + * + * @throws std::exception +*/ +[[nodiscard]] OUString + SvxUnogetInternalNameForItem(const sal_uInt16 nWhich, const OUString& rApiName); + +#endif // INCLUDED_SVX_UNOAPI_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/unobrushitemhelper.hxx b/include/svx/unobrushitemhelper.hxx new file mode 100644 index 000000000..1bb7d8f14 --- /dev/null +++ b/include/svx/unobrushitemhelper.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_SVX_UNOBRUSHITEMHELPER_HXX +#define INCLUDED_SVX_UNOBRUSHITEMHELPER_HXX + +#include +#include + +// Helper function definitions for UNO API fallbacks to replace SvxBrushItem. The +// idea is to have fallbacks to create a SvxBrushItem if needed for backwards compatibility +// if needed from the SfxItemSet and vice versa. This is used in cases where e.g. UNO API +// accesses to slots in the SvxBrushItem are used (see cases in SvxBrushItem::QueryValue +// and SvxBrushItem::PutValue as MID_BACK_COLOR and similar). +// To make this work, a cycle of creating a SvxBrushItem from a SfxItemSet, changing a value +// using PutValue, putting back to the SfxItemSet should create the *same* SvxBrushItem +// the next time this will be created using getSvxBrushItemFromSourceSet. For more details, +// see comments at the implementations of that two methods. + +// Set the equivalent in the range [XATTR_FILL_FIRST .. XATTR_FILL_LAST] in the given +// SfxItemSet to create the same FillStyle as is expressed by the given SvxBrushItem. +// This method will reset all items in the XATTR_FILL_* range first. +SVXCORE_DLLPUBLIC void setSvxBrushItemAsFillAttributesToTargetSet( + const SvxBrushItem& rBrush, + SfxItemSet& rToSet); + +// Create a SvxBrushItem as close as possible to the settings in the DrawingLayer +// items in the range [XATTR_FILL_FIRST .. XATTR_FILL_LAST]. Since this is not 100% +// representable this may lead to reduced data. With nBackgroundID a Which-ID for the +// to-be-created SvxBrushItem has to be given (default should be 99 as in RES_BACKGROUND). +SVXCORE_DLLPUBLIC std::unique_ptr getSvxBrushItemFromSourceSet( + const SfxItemSet& rSourceSet, + sal_uInt16 nBackgroundID, + bool bSearchInParents = true, + bool bXMLImportHack = false); + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/unofill.hxx b/include/svx/unofill.hxx new file mode 100644 index 000000000..a59f9c8fb --- /dev/null +++ b/include/svx/unofill.hxx @@ -0,0 +1,37 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_UNOFILL_HXX +#define INCLUDED_SVX_UNOFILL_HXX + +#include +#include + +class SdrModel; + +SVXCORE_DLLPUBLIC css::uno::Reference< css::uno::XInterface > SvxUnoGradientTable_createInstance( SdrModel* pModel ); +SVXCORE_DLLPUBLIC css::uno::Reference< css::uno::XInterface > SvxUnoHatchTable_createInstance( SdrModel* pModel ); +SVXCORE_DLLPUBLIC css::uno::Reference< css::uno::XInterface > SvxUnoBitmapTable_createInstance( SdrModel* pModel ); +SVXCORE_DLLPUBLIC css::uno::Reference< css::uno::XInterface > SvxUnoTransGradientTable_createInstance( SdrModel* pModel ); +SVXCORE_DLLPUBLIC css::uno::Reference< css::uno::XInterface > SvxUnoMarkerTable_createInstance( SdrModel* pModel ); +SVXCORE_DLLPUBLIC css::uno::Reference< css::uno::XInterface > SvxUnoDashTable_createInstance( SdrModel* pModel ); + +#endif // INCLUDED_SVX_UNOFILL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/unomaster.hxx b/include/svx/unomaster.hxx new file mode 100644 index 000000000..f544d2f8b --- /dev/null +++ b/include/svx/unomaster.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_SVX_UNOMASTER_HXX +#define INCLUDED_SVX_UNOMASTER_HXX + +#include +#include +#include +#include + +/** this abstract class is the interface for an instance that likes to enhance + the functionality of components implemented with derivations from SvxShape + + @see SvxShape::setMaster +*/ +class SvxShapeMaster +{ +public: + virtual bool queryAggregation( const css::uno::Type & rType, css::uno::Any& aAny ) = 0; + + /// @throws css::uno::RuntimeException + virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) = 0; + /// @throws css::beans::UnknownPropertyException + /// @throws css::beans::PropertyVetoException + /// @throws css::lang::IllegalArgumentException + /// @throws css::lang::WrappedTargetException + /// @throws css::uno::RuntimeException + virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) = 0; + /// @throws css::beans::UnknownPropertyException + /// @throws css::lang::WrappedTargetException + /// @throws css::uno::RuntimeException + virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) = 0; + + /// @throws css::beans::UnknownPropertyException + /// @throws css::uno::RuntimeException + virtual css::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName ) = 0; + /// @throws css::beans::UnknownPropertyException + /// @throws css::uno::RuntimeException + virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) = 0; + /// @throws css::beans::UnknownPropertyException + /// @throws css::lang::WrappedTargetException + /// @throws css::uno::RuntimeException + virtual css::uno::Any SAL_CALL getPropertyDefault( const OUString& aPropertyName ) = 0; + + /// @throws css::uno::RuntimeException + virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) = 0; + + /// @throws css::uno::RuntimeException + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() = 0; + + virtual void dispose() = 0; + +protected: + ~SvxShapeMaster() {} +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/unomid.hxx b/include/svx/unomid.hxx new file mode 100644 index 000000000..fe07fee51 --- /dev/null +++ b/include/svx/unomid.hxx @@ -0,0 +1,97 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_UNOMID_HXX +#define INCLUDED_SVX_UNOMID_HXX + +//SvxPageItem +#define MID_PAGE_NUMTYPE 0 +#define MID_PAGE_ORIENTATION 1 +#define MID_PAGE_LAYOUT 2 + +//SvxMarginItem +#define MID_MARGIN_L_MARGIN 2 +#define MID_MARGIN_R_MARGIN 3 +#define MID_MARGIN_UP_MARGIN 4 +#define MID_MARGIN_LO_MARGIN 5 + +#define ALL_BORDER 10 +#define ALL_BORDER_PADDING 11 +#define LEFT_BORDER_PADDING 12 +#define RIGHT_BORDER_PADDING 13 +#define TOP_BORDER_PADDING 14 +#define BOTTOM_BORDER_PADDING 15 +#define ALL_BORDER_LINE_WIDTH 16 +#define LEFT_BORDER_LINE_WIDTH 17 +#define RIGHT_BORDER_LINE_WIDTH 18 +#define TOP_BORDER_LINE_WIDTH 19 +#define BOTTOM_BORDER_LINE_WIDTH 20 + +// XFillBitmapItem (is also a NameOrIndex) +#define MID_BITMAP 8 + +// SvxObjectItem +#define MID_START_X 1 +#define MID_START_Y 2 +#define MID_END_X 3 +#define MID_END_Y 4 +#define MID_LIMIT 5 + +// SvxColumnItem +#define MID_COLUMNARRAY 7 +#define MID_ACTUAL 4 +#define MID_TABLE 5 +#define MID_ORTHO 6 + +// XFillGradientItem +// Don't use 0 as it used for the whole struct +#define MID_FILLGRADIENT 1 +#define MID_GRADIENT_STYLE 2 +#define MID_GRADIENT_STARTCOLOR 3 +#define MID_GRADIENT_ENDCOLOR 4 +#define MID_GRADIENT_ANGLE 5 +#define MID_GRADIENT_BORDER 6 +#define MID_GRADIENT_XOFFSET 7 +#define MID_GRADIENT_YOFFSET 8 +#define MID_GRADIENT_STARTINTENSITY 9 +#define MID_GRADIENT_ENDINTENSITY 10 +#define MID_GRADIENT_STEPCOUNT 11 + +// XFillHatchItem +// Don't use 0 as it used for the whole struct +#define MID_FILLHATCH 1 +#define MID_HATCH_STYLE 2 +#define MID_HATCH_COLOR 3 +#define MID_HATCH_DISTANCE 4 +#define MID_HATCH_ANGLE 5 + +// XLineDashItem +// Don't use 0 as it used for the whole struct +#define MID_LINEDASH 1 +#define MID_LINEDASH_STYLE 2 +#define MID_LINEDASH_DOTS 3 +#define MID_LINEDASH_DOTLEN 4 +#define MID_LINEDASH_DASHES 5 +#define MID_LINEDASH_DASHLEN 6 +#define MID_LINEDASH_DISTANCE 7 + +#define MID_LEFT 3 + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/unomod.hxx b/include/svx/unomod.hxx new file mode 100644 index 000000000..35730594c --- /dev/null +++ b/include/svx/unomod.hxx @@ -0,0 +1,67 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_UNOMOD_HXX +#define INCLUDED_SVX_UNOMOD_HXX + +#include +#include +#include +#include + +class SdrHint; +class SdrModel; + +SVXCORE_DLLPUBLIC css::uno::Reference< css::container::XIndexReplace > SvxCreateNumRule(SdrModel* pModel); + +class SVXCORE_DLLPUBLIC SvxUnoDrawMSFactory : public css::lang::XMultiServiceFactory +{ +protected: + /** abstract SdrModel provider */ + // Every App has a DrwingLayer as internal Tooling, thus ist is + // not too hard to asl a UnoModel to hand back a DrawingLayer Model in the + // form of an SdrModel. Thus, returning a reference and make usages + // safer and easier is justified. + virtual SdrModel& getSdrModelFromUnoModel() const = 0; //TTTT make reference return + +public: + SvxUnoDrawMSFactory() throw() {}; + + virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance( const OUString& aServiceSpecifier ) override; + virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArguments( const OUString& ServiceSpecifier, const css::uno::Sequence< css::uno::Any >& Arguments ) override; + virtual css::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames( ) override; + + /// @throws css::uno::Exception + /// @throws css::uno::RuntimeException + static css::uno::Reference< css::uno::XInterface > createTextField( const OUString& aServiceSpecifier ); + + /** fills the given EventObject from the given SdrHint. + @returns + true if the SdrHint could be translated to an EventObject
    + false if not + */ + static bool createEvent( const SdrModel* pDoc, const SdrHint* pSdrHint, css::document::EventObject& aEvent ); + +protected: + ~SvxUnoDrawMSFactory() {} +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/unomodel.hxx b/include/svx/unomodel.hxx new file mode 100644 index 000000000..08b910ca8 --- /dev/null +++ b/include/svx/unomodel.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_SVX_UNOMODEL_HXX +#define INCLUDED_SVX_UNOMODEL_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class SdrModel; + +class SVXCORE_DLLPUBLIC SvxUnoDrawingModel +: public SfxBaseModel, // implements SfxListener, OWEAKOBJECT & other + public SvxFmMSFactory, + public css::drawing::XDrawPagesSupplier, + public css::lang::XServiceInfo, + public css::ucb::XAnyCompareFactory +{ + friend class SvxUnoDrawPagesAccess; + +private: + SdrModel* mpDoc; + + css::uno::WeakReference< css::drawing::XDrawPages > mxDrawPagesAccess; + + css::uno::Reference< css::uno::XInterface > mxDashTable; + css::uno::Reference< css::uno::XInterface > mxGradientTable; + css::uno::Reference< css::uno::XInterface > mxHatchTable; + css::uno::Reference< css::uno::XInterface > mxBitmapTable; + css::uno::Reference< css::uno::XInterface > mxTransGradientTable; + css::uno::Reference< css::uno::XInterface > mxMarkerTable; + + css::uno::Sequence< css::uno::Type > maTypeSequence; + +protected: + // SvxUnoDrawMSFactory + virtual SdrModel& getSdrModelFromUnoModel() const override; + +public: + SvxUnoDrawingModel( SdrModel* pDoc ) throw(); + virtual ~SvxUnoDrawingModel() throw() override; + + SdrModel* GetDoc() const { return mpDoc; } + + // XInterface + virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; + virtual void SAL_CALL acquire() throw() override + { SfxBaseModel::acquire(); } + virtual void SAL_CALL release() throw() override + { SfxBaseModel::release(); } + + // XModel + virtual void SAL_CALL lockControllers( ) override; + virtual void SAL_CALL unlockControllers( ) override; + virtual sal_Bool SAL_CALL hasControllersLocked( ) override; + + // XTypeProvider + virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; + virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override; + + // XDrawPagesSupplier + virtual css::uno::Reference< css::drawing::XDrawPages > SAL_CALL getDrawPages( ) override; + + // XMultiServiceFactory ( SvxFmMSFactory ) + virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance( const OUString& aServiceSpecifier ) override; + virtual css::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames( ) override; + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() override; + virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; + + // XAnyCompareFactory + virtual css::uno::Reference< css::ucb::XAnyCompare > SAL_CALL createAnyCompareByName( const OUString& PropertyName ) override; +}; + +SVXCORE_DLLPUBLIC extern bool SvxDrawingLayerExport( SdrModel* pModel, const css::uno::Reference& xOut ); +extern bool SvxDrawingLayerExport( SdrModel* pModel, const css::uno::Reference& xOut, const css::uno::Reference< css::lang::XComponent >& xComponent ); +SVXCORE_DLLPUBLIC extern bool SvxDrawingLayerExport( SdrModel* pModel, const css::uno::Reference& xOut, const css::uno::Reference< css::lang::XComponent >& xComponent, const char* pExportService ); +SVXCORE_DLLPUBLIC extern bool SvxDrawingLayerImport( SdrModel* pModel, const css::uno::Reference& xInputStream ); +extern bool SvxDrawingLayerImport( SdrModel* pModel, const css::uno::Reference& xInputStream, const css::uno::Reference< css::lang::XComponent >& xComponent ); +SVXCORE_DLLPUBLIC extern bool SvxDrawingLayerImport( SdrModel* pModel, const css::uno::Reference& xInputStream, const css::uno::Reference< css::lang::XComponent >& xComponent, const char* pImportService ); + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/unopage.hxx b/include/svx/unopage.hxx new file mode 100644 index 000000000..911be0c2a --- /dev/null +++ b/include/svx/unopage.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_SVX_UNOPAGE_HXX +#define INCLUDED_SVX_UNOPAGE_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +class SdrPage; +class SdrModel; +class SdrView; +class SdrPageView; +class SdrObject; +class SvxShape; +class SvxShapeGroup; +class SvxShapeConnector; +enum class SdrInventor : sal_uInt32; + +/** +* Macros to convert Twips<->100tel mm +*/ +#define TWIPS_TO_MM(val) ((val * 127 + 36) / 72) +#define MM_TO_TWIPS(val) ((val * 72 + 63) / 127) + +class SVXCORE_DLLPUBLIC SvxDrawPage : public ::cppu::WeakAggImplHelper7< css::drawing::XDrawPage, + css::drawing::XShapeGrouper, + css::drawing::XShapes2, + css::drawing::XShapes3, + css::lang::XServiceInfo, + css::lang::XUnoTunnel, + css::lang::XComponent>, + protected SvxMutexHelper +{ + protected: + cppu::OBroadcastHelper mrBHelper; + + SdrPage* mpPage; // TTTT should be reference + SdrModel* mpModel; // TTTT probably not needed -> use from SdrPage + std::unique_ptr mpView; + + void SelectObjectsInView( const css::uno::Reference< css::drawing::XShapes >& aShapes, SdrPageView* pPageView ) throw (); + void SelectObjectInView( const css::uno::Reference< css::drawing::XShape >& xShape, SdrPageView* pPageView ) throw(); + + virtual void disposing() throw(); + + public: + SvxDrawPage(SdrPage* pPage); + virtual ~SvxDrawPage() throw() override; + + // Internals + SdrPage* GetSdrPage() const { return mpPage; } + + // Creation of a SdrObject and insertion into the SdrPage + SdrObject *CreateSdrObject( const css::uno::Reference< css::drawing::XShape >& xShape, bool bBeginning = false ) throw(); + + // Determine Type and Inventor + static void GetTypeAndInventor( sal_uInt16& rType, SdrInventor& rInventor, const OUString& aName ) throw(); + + // Creating a SdrObject using it's Description. + // Can be used by derived classes to support their owen Shapes (e.g. Controls). + /// @throws css::uno::RuntimeException + virtual SdrObject *CreateSdrObject_( const css::uno::Reference< css::drawing::XShape >& xShape ); + + /// @throws css::uno::RuntimeException + static SvxShape* CreateShapeByTypeAndInventor( sal_uInt16 nType, SdrInventor nInventor, SdrObject *pObj, SvxDrawPage *pPage = nullptr, OUString const & referer = OUString() ); + + // The following method is called if a SvxShape object is to be created. + // Derived classes can create a derivation or an SvxShape aggregating object. + /// @throws css::uno::RuntimeException + virtual css::uno::Reference< css::drawing::XShape > CreateShape( SdrObject *pObj ) const; + + UNO3_GETIMPLEMENTATION_DECL( SvxDrawPage ) + + // XInterface + virtual void SAL_CALL release() throw() override; + + // XShapes + virtual void SAL_CALL add( const css::uno::Reference< css::drawing::XShape >& xShape ) override; + virtual void SAL_CALL remove( const css::uno::Reference< css::drawing::XShape >& xShape ) override; + + // XShapes2 + virtual void SAL_CALL addTop( const css::uno::Reference< css::drawing::XShape >& xShape ) override; + virtual void SAL_CALL addBottom( const css::uno::Reference< css::drawing::XShape >& xShape ) override; + + // XShapes3 + virtual void SAL_CALL sort( const css::uno::Sequence< sal_Int32 >& sortOrder ) override; + + // XElementAccess + virtual css::uno::Type SAL_CALL getElementType() override; + virtual sal_Bool SAL_CALL hasElements() override; + + // XIndexAccess + virtual sal_Int32 SAL_CALL getCount() override ; + virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override; + + // XShapeGrouper + virtual css::uno::Reference< css::drawing::XShapeGroup > SAL_CALL group( const css::uno::Reference< css::drawing::XShapes >& xShapes ) override; + virtual void SAL_CALL ungroup( const css::uno::Reference< css::drawing::XShapeGroup >& aGroup ) override; + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() override; + virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; + + // XComponent + virtual void SAL_CALL dispose() override; + virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override; + virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/unopool.hxx b/include/svx/unopool.hxx new file mode 100644 index 000000000..b8cc1c7d4 --- /dev/null +++ b/include/svx/unopool.hxx @@ -0,0 +1,97 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_UNOPOOL_HXX +#define INCLUDED_SVX_UNOPOOL_HXX + +#include +#include +#include +#include +#include + +class SdrModel; +class SfxItemPool; + +/** This class implements the service com.sun.star.drawing.Defaults. + It works on the SfxItemPool from the given model and the global + draw object item pool. + The class can work in a read only mode without a model. Derivated + classes can set a model on demand by overriding getModelPool(). +*/ +class SVX_DLLPUBLIC SvxUnoDrawPool : public ::cppu::OWeakAggObject, + public css::lang::XServiceInfo, + public css::lang::XTypeProvider, + public comphelper::PropertySetHelper +{ +public: + SvxUnoDrawPool(SdrModel* pModel, sal_Int32 nServiceId); + + /** deprecated */ + SvxUnoDrawPool(SdrModel* pModel); + virtual ~SvxUnoDrawPool() throw() override; + + /** This returns the item pool from the given model, or the default pool if there is no model and bReadOnly is true. + If bReadOnly is false and there is no model the default implementation returns NULL. + */ + virtual SfxItemPool* getModelPool( bool bReadOnly ) throw(); + + // overridden helpers from comphelper::PropertySetHelper + virtual void _setPropertyValues( const comphelper::PropertyMapEntry** ppEntries, const css::uno::Any* pValues ) override; + virtual void _getPropertyValues( const comphelper::PropertyMapEntry** ppEntries, css::uno::Any* pValue ) override; + + virtual void _getPropertyStates( const comphelper::PropertyMapEntry** ppEntries, css::beans::PropertyState* pStates ) override; + virtual void _setPropertyToDefault( const comphelper::PropertyMapEntry* pEntry ) override; + virtual css::uno::Any _getPropertyDefault( const comphelper::PropertyMapEntry* pEntry ) override; + + // XInterface + virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override; + virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; + virtual void SAL_CALL acquire() throw() override + { OWeakAggObject::acquire(); } + virtual void SAL_CALL release() throw() override + { OWeakAggObject::release(); } + + // XTypeProvider + virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; + virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override; + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() override; + virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; + +protected: + void init(); + + /// @throws css::beans::UnknownPropertyException + static void getAny( SfxItemPool const * pPool, const comphelper::PropertyMapEntry* pEntry, css::uno::Any& rValue ); + /// @throws css::beans::UnknownPropertyException + /// @throws css::lang::IllegalArgumentException + /// @throws css::uno::RuntimeException + virtual void putAny( SfxItemPool* pPool, const comphelper::PropertyMapEntry* pEntry, const css::uno::Any& rValue ); + +protected: + SdrModel* mpModel; + SfxItemPool* mpDefaultsPool; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/unoprov.hxx b/include/svx/unoprov.hxx new file mode 100644 index 000000000..d69ddfca1 --- /dev/null +++ b/include/svx/unoprov.hxx @@ -0,0 +1,125 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_UNOPROV_HXX +#define INCLUDED_SVX_UNOPROV_HXX + +#include +#include +#include +#include +#include +#include +#include + + +class SvxItemPropertySet; +class SfxItemPool; + +/** + * class UHashMap + */ + +#define UHASHMAP_NOTFOUND sal::static_int_cast< sal_uInt32 >(~0) +class UHashMap +{ + UHashMap() = delete; +public: + static sal_uInt32 getId( const OUString& rCompareString ); + static OUString getNameFromId (sal_uInt32 nId); + static css::uno::Sequence< OUString > getServiceNames(); +}; + +/** + * Sorter + */ + +#define SVXMAP_SHAPE 0 +#define SVXMAP_CONNECTOR 1 +#define SVXMAP_DIMENSIONING 2 +#define SVXMAP_CIRCLE 3 +#define SVXMAP_POLYPOLYGON 4 +#define SVXMAP_GRAPHICOBJECT 5 +#define SVXMAP_3DSCENEOBJECT 6 +#define SVXMAP_3DCUBEOBJECT 7 +#define SVXMAP_3DSPHEREOBJECT 8 +#define SVXMAP_3DLATHEOBJECT 9 +#define SVXMAP_3DEXTRUDEOBJECT 10 +#define SVXMAP_3DPOLYGONOBJECT 11 +#define SVXMAP_ALL 12 +#define SVXMAP_GROUP 13 +#define SVXMAP_CAPTION 14 +#define SVXMAP_OLE2 15 +#define SVXMAP_PLUGIN 16 +#define SVXMAP_FRAME 17 +#define SVXMAP_APPLET 18 +#define SVXMAP_CONTROL 19 +#define SVXMAP_TEXT 20 +#define SVXMAP_CUSTOMSHAPE 21 +#define SVXMAP_MEDIA 22 +#define SVXMAP_TABLE 23 +#define SVXMAP_PAGE 24 +#define SVXMAP_END 25 // last+1 ! + +/** + * SvxUnoPropertyMapProvider + */ + +class SVXCORE_DLLPUBLIC SvxUnoPropertyMapProvider +{ + SfxItemPropertyMapEntry const * aMapArr[SVXMAP_END]; + std::unique_ptr aSetArr[SVXMAP_END]; +public: + SvxUnoPropertyMapProvider(); + ~SvxUnoPropertyMapProvider(); + const SfxItemPropertyMapEntry* GetMap(sal_uInt16 nPropertyId); + const SvxItemPropertySet* GetPropertySet(sal_uInt16 nPropertyId, SfxItemPool& rPool); +}; + +/** + * Globals + */ + +const sal_Int16 OBJ_OLE2_APPLET = 100; +const sal_Int16 OBJ_OLE2_PLUGIN = 101; + +#define E3D_INVENTOR_FLAG (0x80000000) + +/** + * class SvxPropertySetInfoPool + */ + +const sal_Int32 SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS = 0; +const sal_Int32 SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS_WRITER = 1; +const sal_Int32 SVXUNO_SERVICEID_LASTID = 1; + +namespace comphelper { class PropertySetInfo; } + +class SvxPropertySetInfoPool +{ +public: + UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) static rtl::Reference const & getOrCreate( sal_Int32 nServiceId ) throw(); + +private: + static rtl::Reference mxInfos[SVXUNO_SERVICEID_LASTID+1]; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/unoshape.hxx b/include/svx/unoshape.hxx new file mode 100644 index 000000000..1f948f505 --- /dev/null +++ b/include/svx/unoshape.hxx @@ -0,0 +1,858 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_UNOSHAPE_HXX +#define INCLUDED_SVX_UNOSHAPE_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 +#include + +class SfxItemSet; +class SdrModel; +class SvxDrawPage; +class SvGlobalName; +class Pair; +class IOpenGLRenderer; + +// Dimension arrows change size/position on save/reload (#i59051#) +namespace basegfx + { + class B2DPolyPolygon; + } // end of namespace basegfx + +class SvxShapeMutex +{ +protected: + ::osl::Mutex maMutex; +}; + +struct SvxShapeImpl; +class SvxShapeMaster; +class SvxItemPropertySet; +class SfxItemSet; + +void SVXCORE_DLLPUBLIC SvxItemPropertySet_setPropertyValue( const SfxItemPropertySimpleEntry* pMap, + const css::uno::Any& rVal, SfxItemSet& rSet ); + +css::uno::Any SVXCORE_DLLPUBLIC SvxItemPropertySet_getPropertyValue( const SfxItemPropertySimpleEntry* pMap, const SfxItemSet& rSet ); + + +// WARNING: if you update the supported interfaces, +// also update SvxShape::_getTypes() +typedef ::cppu::WeakAggImplHelper12< + css::drawing::XShape, + css::lang::XComponent, + css::beans::XPropertySet, + css::beans::XMultiPropertySet, + css::beans::XPropertyState, + css::lang::XUnoTunnel, + css::container::XNamed, + css::drawing::XGluePointsSupplier, + css::container::XChild, + css::lang::XServiceInfo, + css::document::XActionLockable, + css::beans::XMultiPropertyStates> SvxShape_UnoImplHelper; + +class SVXCORE_DLLPUBLIC SvxShape : public SvxShape_UnoImplHelper, + public SfxListener, + public SvxShapeMutex +{ +private: + css::awt::Size maSize; + css::awt::Point maPosition; + OUString maShapeType; + OUString maShapeName; + + /** these members are used to optimize XMultiProperty calls */ + std::unique_ptr mpImpl; + bool mbIsMultiPropertyCall; + + css::uno::WeakReference< css::container::XIndexContainer > mxGluePoints; + +protected: + friend class SvxDrawPage; + friend class SvxShapeConnector; + friend class SdXShape; + + const SvxItemPropertySet* mpPropSet; + const SfxItemPropertyMapEntry* maPropMapEntries; + +private: + ::tools::WeakReference< SdrObject > mpSdrObjectWeakReference; + +protected: + // translations for writer, which works in TWIPS + void ForceMetricToItemPoolMetric(Pair& rPoint) const throw(); + void ForceMetricToItemPoolMetric(Point& rPoint) const throw() { ForceMetricToItemPoolMetric(rPoint.toPair()); } + void ForceMetricToItemPoolMetric(Size& rPoint) const throw() { ForceMetricToItemPoolMetric(rPoint.toPair()); } + void ForceMetricTo100th_mm(Pair& rPoint) const throw(); + void ForceMetricTo100th_mm(Point& rPoint) const throw() { ForceMetricTo100th_mm(rPoint.toPair()); } + void ForceMetricTo100th_mm(Size& rPoint) const throw() { ForceMetricTo100th_mm(rPoint.toPair()); } + + // version for basegfx::B2DPolyPolygon + void ForceMetricToItemPoolMetric(basegfx::B2DPolyPolygon& rPolyPolygon) const throw(); + void ForceMetricTo100th_mm(basegfx::B2DPolyPolygon& rPolyPolygon) const throw(); + + // tdf#117145 version for basegfx::B2DHomMatrix + void ForceMetricToItemPoolMetric(basegfx::B2DHomMatrix& rB2DHomMatrix) const throw(); + void ForceMetricTo100th_mm(basegfx::B2DHomMatrix& rB2DHomMatrix) const throw(); + + css::uno::Any GetAnyForItem( SfxItemSet const & aSet, const SfxItemPropertySimpleEntry* pMap ) const; + + bool SetFillAttribute( sal_uInt16 nWID, const OUString& rName ); + + /** called from the XActionLockable interface methods on initial locking */ + virtual void lock(); + + /** called from the XActionLockable interface methods on final unlock */ + virtual void unlock(); + + /** used from the XActionLockable interface */ + sal_uInt16 mnLockCount; + + const SfxItemPropertyMapEntry* getPropertyMapEntries() const { return maPropMapEntries; } + + void updateShapeKind(); + void endSetPropertyValues(); + + // override these for special property handling in subcasses. Return true if property is handled + /// @throws css::beans::UnknownPropertyException + /// @throws css::beans::PropertyVetoException + /// @throws css::lang::IllegalArgumentException + /// @throws css::lang::WrappedTargetException + /// @throws css::uno::RuntimeException + virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ); + /// @throws css::beans::UnknownPropertyException + /// @throws css::lang::WrappedTargetException + /// @throws css::uno::RuntimeException + virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ); + /// @throws css::beans::UnknownPropertyException + /// @throws css::uno::RuntimeException + virtual bool getPropertyStateImpl( const SfxItemPropertySimpleEntry* pProperty, css::beans::PropertyState& rState ); + /// @throws css::beans::UnknownPropertyException + /// @throws css::uno::RuntimeException + virtual bool setPropertyToDefaultImpl( const SfxItemPropertySimpleEntry* pProperty ); + +public: + /// @throws css::uno::RuntimeException + SvxShape( SdrObject* pObj ); + /// @throws css::uno::RuntimeException + SvxShape( SdrObject* pObject, const SfxItemPropertyMapEntry* pEntries, const SvxItemPropertySet* pPropertySet ); + virtual ~SvxShape() throw () override; + + // Internals + void ObtainSettingsFromPropertySet(const SvxItemPropertySet& rPropSet); + virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage ); + /** takes the ownership of the SdrObject. + + When the shape is disposed, and it has the ownership of its associated SdrObject, then + it will delete this object. + */ + void TakeSdrObjectOwnership(); + bool HasSdrObjectOwnership() const; + + // used exclusively by SdrObject + void InvalidateSdrObject(); + + // Encapsulated access to SdrObject + SdrObject* GetSdrObject() const { return mpSdrObjectWeakReference.get(); } + bool HasSdrObject() const { return mpSdrObjectWeakReference.is(); } + + void SetShapeType( const OUString& ShapeType ) { maShapeType = ShapeType; } + /// @throws css::uno::RuntimeException + css::uno::Any GetBitmap( bool bMetaFile = false ) const; + + svx::PropertyChangeNotifier& getShapePropertyChangeNotifier(); + + void setShapeKind( sal_uInt32 nKind ); + sal_uInt32 getShapeKind() const; + + // styles need this + static bool SetFillAttribute( sal_uInt16 nWID, const OUString& rName, SfxItemSet& rSet, SdrModel const * pModel ); + static bool SetFillAttribute( sal_uInt16 nWID, const OUString& rName, SfxItemSet& rSet ); + + /** same as SetFillAttribute but for property names instead of which ids, + and the property found is returned instead of set at the object + directly. + */ + + UNO3_GETIMPLEMENTATION_DECL( SvxShape ) + + // access methods for master objects + /// @throws css::uno::RuntimeException + css::uno::Reference< css::beans::XPropertySetInfo > const & _getPropertySetInfo( ); + /// @throws css::beans::UnknownPropertyException + /// @throws css::beans::PropertyVetoException + /// @throws css::lang::IllegalArgumentException + /// @throws css::lang::WrappedTargetException + /// @throws css::uno::RuntimeException + void _setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ); + /// @throws css::beans::UnknownPropertyException + /// @throws css::lang::WrappedTargetException + /// @throws css::uno::RuntimeException + css::uno::Any _getPropertyValue( const OUString& PropertyName ); + + /// @throws css::beans::UnknownPropertyException + /// @throws css::uno::RuntimeException + css::beans::PropertyState _getPropertyState( const OUString& PropertyName ); + /// @throws css::beans::UnknownPropertyException + /// @throws css::uno::RuntimeException + void _setPropertyToDefault( const OUString& PropertyName ); + /// @throws css::beans::UnknownPropertyException + /// @throws css::lang::WrappedTargetException + /// @throws css::uno::RuntimeException + css::uno::Any _getPropertyDefault( const OUString& aPropertyName ); + + /// @throws css::uno::RuntimeException + css::uno::Sequence< OUString > _getSupportedServiceNames(); + + /// @throws css::uno::RuntimeException + css::uno::Sequence< css::uno::Type > const & _getTypes( ); + + void setMaster( SvxShapeMaster* pMaster ); + + // SfxListener + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) throw () override; + + // XAggregation + virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type& aType ) override; + + // XNamed + virtual OUString SAL_CALL getName( ) override; + virtual void SAL_CALL setName( const OUString& aName ) override; + + // XShapeDescriptor + virtual OUString SAL_CALL getShapeType() override; + + // XShape + virtual css::awt::Point SAL_CALL getPosition() override; + virtual void SAL_CALL setPosition( const css::awt::Point& aPosition ) override; + virtual css::awt::Size SAL_CALL getSize() override; + virtual void SAL_CALL setSize( const css::awt::Size& aSize ) override; + + // XComponent + virtual void SAL_CALL dispose() override; + virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override; + virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override; + + // XPropertySet + virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override; + virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override; + virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override; + virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override; + virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override; + virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; + virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; + + // XMultiPropertySet + virtual void SAL_CALL setPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Sequence< css::uno::Any >& aValues ) override; + virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames ) override; + virtual void SAL_CALL addPropertiesChangeListener( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override; + virtual void SAL_CALL removePropertiesChangeListener( const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override; + virtual void SAL_CALL firePropertiesChangeEvent( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override; + + // XPropertyState + virtual css::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName ) override; + virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates( const css::uno::Sequence< OUString >& aPropertyName ) override; + virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) override; + virtual css::uno::Any SAL_CALL getPropertyDefault( const OUString& aPropertyName ) override; + + // XMultiPropertyStates + virtual void SAL_CALL setAllPropertiesToDefault() override; + virtual void SAL_CALL setPropertiesToDefault( + const css::uno::Sequence< + OUString >& aPropertyNames ) override; + virtual css::uno::Sequence< css::uno::Any > + SAL_CALL getPropertyDefaults( + const css::uno::Sequence< + OUString >& aPropertyNames ) override; + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; + virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; + + // XGluePointsSupplier + virtual css::uno::Reference< css::container::XIndexContainer > SAL_CALL getGluePoints( ) override; + + // XChild + virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent( ) override; + virtual void SAL_CALL setParent( const css::uno::Reference< css::uno::XInterface >& Parent ) override; + + // XTypeProvider + virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; + virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override; + + // XActionLockable + virtual sal_Bool SAL_CALL isActionLocked( ) override; + virtual void SAL_CALL addActionLock( ) override; + virtual void SAL_CALL removeActionLock( ) override; + virtual void SAL_CALL setActionLocks( sal_Int16 nLock ) override; + virtual sal_Int16 SAL_CALL resetActionLocks( ) override; + +private: + /** initializes SdrObj-dependent members. Only to be called when GetSdrObject() != NULL + */ + SVX_DLLPRIVATE void impl_initFromSdrObject(); + /// CTOR-Impl + SVX_DLLPRIVATE void impl_construct(); +}; + +class SVXCORE_DLLPUBLIC SvxShapeText : public SvxShape, public SvxUnoTextBase +{ +protected: + /** called from the XActionLockable interface methods on initial locking */ + virtual void lock() override; + + /** called from the XActionLockable interface methods on final unlock */ + virtual void unlock() override; + +protected: + // override these for special property handling in subcasses. Return true if property is handled + virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override; + virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override; + virtual bool getPropertyStateImpl( const SfxItemPropertySimpleEntry* pProperty, css::beans::PropertyState& rState ) override; + virtual bool setPropertyToDefaultImpl( const SfxItemPropertySimpleEntry* pProperty ) override; + +public: + SvxShapeText(SdrObject* pObj); + SvxShapeText(SdrObject* pObject, const SfxItemPropertyMapEntry* pPropertyMap, const SvxItemPropertySet* pPropertySet); + virtual ~SvxShapeText() throw () override; + + virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage ) override; + + // XInterface + virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override; + virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; + virtual void SAL_CALL acquire() throw() override + { SvxShape::acquire(); } + virtual void SAL_CALL release() throw() override + { SvxShape::release(); } + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; + virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; + + // css::text::XTextRange + virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getStart() override; + virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getEnd() override; + virtual OUString SAL_CALL getString() override; + virtual void SAL_CALL setString( const OUString& aString ) override; + + // XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; + + // XTypeProvider + virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; + virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override; +}; + +class SvxShapeRect final : public SvxShapeText +{ +public: + SvxShapeRect(SdrObject* pObj); + virtual ~SvxShapeRect() throw () override; + + // XInterface + virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override; + virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; + virtual void SAL_CALL acquire() throw() override + { OWeakAggObject::acquire(); } + virtual void SAL_CALL release() throw() override + { OWeakAggObject::release(); } + + // XServiceInfo + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; +}; + +/*********************************************************************** +* * +***********************************************************************/ +class SvxShapeGroup final : public SvxShape, + public css::drawing::XShapeGroup, + public css::drawing::XShapes2, + public css::drawing::XShapes +{ +private: + rtl::Reference< SvxDrawPage> mxPage; + + void addUnoShape( const css::uno::Reference< css::drawing::XShape >& xShape, size_t nPos ); + +public: + SvxShapeGroup(SdrObject* pObj,SvxDrawPage* pDrawPage); + virtual ~SvxShapeGroup() throw () override; + + virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage ) override; + + // XInterface + virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override; + virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; + virtual void SAL_CALL acquire() throw() override + { SvxShape::acquire(); } + virtual void SAL_CALL release() throw() override + { SvxShape::release(); } + + // XShapes + virtual void SAL_CALL add( const css::uno::Reference< css::drawing::XShape >& xShape ) override; + virtual void SAL_CALL remove( const css::uno::Reference< css::drawing::XShape >& xShape ) override; + + // XShapes2 + virtual void SAL_CALL addTop( const css::uno::Reference< css::drawing::XShape >& xShape ) override; + virtual void SAL_CALL addBottom( const css::uno::Reference< css::drawing::XShape >& xShape ) override; + + // XElementAccess + virtual css::uno::Type SAL_CALL getElementType() override; + virtual sal_Bool SAL_CALL hasElements() override; + + // XIndexAccess + virtual sal_Int32 SAL_CALL getCount() override ; + virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override; + + // XShapeDescriptor + virtual OUString SAL_CALL getShapeType() override; + + // XShape + virtual css::awt::Point SAL_CALL getPosition() override; + virtual void SAL_CALL setPosition( const css::awt::Point& aPosition ) override; + virtual css::awt::Size SAL_CALL getSize() override; + virtual void SAL_CALL setSize( const css::awt::Size& aSize ) override; + + // XShapeGroup + virtual void SAL_CALL enterGroup( ) override; + virtual void SAL_CALL leaveGroup( ) override; + + // XTypeProvider + virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override; +}; + +/*********************************************************************** +* * +***********************************************************************/ +class SvxShapeConnector : public css::drawing::XConnectorShape, + public SvxShapeText +{ +public: + SvxShapeConnector(SdrObject* pObj); + virtual ~SvxShapeConnector() throw() override; + + // XInterface + virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override; + virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; + virtual void SAL_CALL acquire() throw() override + { SvxShapeText::acquire(); } + virtual void SAL_CALL release() throw() override + { SvxShapeText::release(); } + + // XShapeDescriptor + virtual OUString SAL_CALL getShapeType() override; + + // XShape + virtual css::awt::Point SAL_CALL getPosition() override; + virtual void SAL_CALL setPosition( const css::awt::Point& aPosition ) override; + virtual css::awt::Size SAL_CALL getSize() override; + virtual void SAL_CALL setSize( const css::awt::Size& aSize ) override; + + // XConnectorShape + virtual void SAL_CALL connectStart( const css::uno::Reference< css::drawing::XConnectableShape >& xShape, css::drawing::ConnectionType nPos ) override; + virtual void SAL_CALL connectEnd( const css::uno::Reference< css::drawing::XConnectableShape >& xShape, css::drawing::ConnectionType nPos ) override; + virtual void SAL_CALL disconnectBegin( const css::uno::Reference< css::drawing::XConnectableShape >& xShape ) override; + virtual void SAL_CALL disconnectEnd( const css::uno::Reference< css::drawing::XConnectableShape >& xShape ) override; + + // XTypeProvider + virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; + virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override; +}; + +/*********************************************************************** +* * +***********************************************************************/ +class SVXCORE_DLLPUBLIC SvxShapeControl final : public css::drawing::XControlShape, public SvxShapeText +{ +protected: + using SvxUnoTextRangeBase::setPropertyValue; + using SvxUnoTextRangeBase::getPropertyValue; + +public: + SvxShapeControl(SdrObject* pObj); + virtual ~SvxShapeControl() throw() override; + + // XInterface + virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override; + virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; + virtual void SAL_CALL acquire() throw() override + { SvxShapeText::acquire(); } + virtual void SAL_CALL release() throw() override + { SvxShapeText::release(); } + + // XPropertySet + virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override; + virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override; + + // XPropertyState + virtual css::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName ) override; + virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) override; + virtual css::uno::Any SAL_CALL getPropertyDefault( const OUString& aPropertyName ) override; + + // XShapeDescriptor + virtual OUString SAL_CALL getShapeType() override; + + // XShape + virtual css::awt::Point SAL_CALL getPosition() override; + virtual void SAL_CALL setPosition( const css::awt::Point& aPosition ) override; + virtual css::awt::Size SAL_CALL getSize() override; + virtual void SAL_CALL setSize( const css::awt::Size& aSize ) override; + + // XControlShape + virtual css::uno::Reference< css::awt::XControlModel > SAL_CALL getControl() override; + virtual void SAL_CALL setControl( const css::uno::Reference< css::awt::XControlModel >& xControl ) override; + + // XTypeProvider + virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; + virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override; +}; + +/*********************************************************************** +* * +***********************************************************************/ +class SvxShapeDimensioning final : public SvxShapeText +{ +public: + SvxShapeDimensioning(SdrObject* pObj); + virtual ~SvxShapeDimensioning() throw() override; +}; + +/*********************************************************************** +* * +***********************************************************************/ +class SvxShapeCircle final : public SvxShapeText +{ +public: + SvxShapeCircle(SdrObject* pObj); + virtual ~SvxShapeCircle() throw () override; +}; + +/*********************************************************************** +* * +***********************************************************************/ + +// #i118485# changed parent to SvxShapeText to allow Text handling over UNO API +class SVXCORE_DLLPUBLIC SvxOle2Shape : public SvxShapeText +{ +protected: + // override these for special property handling in subcasses. Return true if property is handled + virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override; + virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override; + + void resetModifiedState(); + + SvGlobalName GetClassName_Impl(OUString& rHexCLSID); +public: + SvxOle2Shape(SdrObject* pObj); + SvxOle2Shape(SdrObject* pObject, const SfxItemPropertyMapEntry* pPropertyMap, const SvxItemPropertySet* pPropertySet); + virtual ~SvxOle2Shape() throw() override; + + bool createObject( const SvGlobalName &aClassName ); + + void createLink( const OUString& aLinkURL ); +}; + + +/*********************************************************************** +* * +***********************************************************************/ +class SvxShapePolyPolygon final : public SvxShapeText +{ + using SvxUnoTextRangeBase::setPropertyValue; + using SvxUnoTextRangeBase::getPropertyValue; + + // override these for special property handling in subcasses. Return true if property is handled + virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override; + virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override; + + // local helper to detect PolygonKind from SdrObject::GetObjIdentifier() + css::drawing::PolygonKind GetPolygonKind() const; + +public: + /// @throws css::lang::IllegalArgumentException + /// @throws css::beans::PropertyVetoException + SvxShapePolyPolygon( SdrObject* pObj ); + virtual ~SvxShapePolyPolygon() throw() override; + + // Local support functions + /// @throws css::uno::RuntimeException + void SetPolygon(const basegfx::B2DPolyPolygon& rNew); + basegfx::B2DPolyPolygon GetPolygon() const throw(); +}; + +/*********************************************************************** +* * +***********************************************************************/ + +class SvxGraphicObject final : public SvxShapeText +{ + using SvxUnoTextRangeBase::setPropertyValue; + using SvxUnoTextRangeBase::getPropertyValue; + + // override these for special property handling in subcasses. Return true if property is handled + virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override; + virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override; + +public: + SvxGraphicObject(SdrObject* pObj); + virtual ~SvxGraphicObject() throw() override; +}; + +/*********************************************************************** +* * +***********************************************************************/ +class Svx3DSceneObject final : public css::drawing::XShapes, public SvxShape +{ +private: + rtl::Reference< SvxDrawPage > mxPage; + +protected: + using SvxShape::setPropertyValue; + using SvxShape::getPropertyValue; + +public: + Svx3DSceneObject(SdrObject* pObj, SvxDrawPage* pDrawPage); + // override these for special property handling in subcasses. Return true if property is handled + virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override; + virtual bool getPropertyValueImpl(const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, + css::uno::Any& rValue ) override; + + virtual ~Svx3DSceneObject() throw() override; + + virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage ) override; + + // XInterface + virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override; + virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; + virtual void SAL_CALL acquire() throw() override + { SvxShape::acquire(); } + virtual void SAL_CALL release() throw() override + { SvxShape::release(); } + + // XShapes + virtual void SAL_CALL add( const css::uno::Reference< css::drawing::XShape >& xShape ) override; + virtual void SAL_CALL remove( const css::uno::Reference< css::drawing::XShape >& xShape ) override; + + // XElementAccess + virtual css::uno::Type SAL_CALL getElementType( ) override; + virtual sal_Bool SAL_CALL hasElements( ) override; + + // XIndexAccess + virtual sal_Int32 SAL_CALL getCount( ) override ; + virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override; + + // XServiceInfo + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; + + // XTypeProvider + virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override; +}; + +/*********************************************************************** +* * +***********************************************************************/ +class Svx3DCubeObject final : public SvxShape +{ + // override these for special property handling in subcasses. Return true if property is handled + virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override; + virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override; + +public: + Svx3DCubeObject(SdrObject* pObj); + virtual ~Svx3DCubeObject() throw() override; + + // XServiceInfo + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; +}; + +/*********************************************************************** +* * +***********************************************************************/ +class Svx3DSphereObject final : public SvxShape +{ +public: + Svx3DSphereObject(SdrObject* pObj); +private: + // override these for special property handling in subcasses. Return true if property is handled + virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override; + virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override; + + virtual ~Svx3DSphereObject() throw() override; + + // XServiceInfo + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; +}; + +/*********************************************************************** +* * +***********************************************************************/ +class Svx3DLatheObject final : public SvxShape +{ + // override these for special property handling in subcasses. Return true if property is handled + virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override; + virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override; + +public: + Svx3DLatheObject(SdrObject* pObj); + virtual ~Svx3DLatheObject() throw() override; + + // XServiceInfo + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; +}; + +/*********************************************************************** +* * +***********************************************************************/ +class Svx3DExtrudeObject final : public SvxShape +{ +public: + Svx3DExtrudeObject(SdrObject* pObj); +private: + // override these for special property handling in subcasses. Return true if property is handled + virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override; + virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override; + + virtual ~Svx3DExtrudeObject() throw() override; + + // XServiceInfo + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; +}; + +/*********************************************************************** +* * +***********************************************************************/ +class Svx3DPolygonObject final : public SvxShape +{ + // override these for special property handling in subcasses. Return true if property is handled + virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override; + virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override; + +public: + Svx3DPolygonObject(SdrObject* pObj); + virtual ~Svx3DPolygonObject() throw() override; + + // XServiceInfo + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; +}; + +/*********************************************************************** +* * +***********************************************************************/ +typedef ::cppu::WeakAggImplHelper1< + css::drawing::XEnhancedCustomShapeDefaulter + > SvxShape_UnoImplHelper1; + +class SVXCORE_DLLPUBLIC SvxCustomShape final : public SvxShapeText, public SvxShape_UnoImplHelper1 +{ +protected: + using SvxUnoTextRangeBase::setPropertyValue; + using SvxUnoTextRangeBase::getPropertyValue; + +public: + SvxCustomShape(SdrObject* pObj); + // override these for special property handling in subcasses. Return true if property is handled + virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override; + + + virtual ~SvxCustomShape() throw () override; + + // XInterface + virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override; + virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; + virtual void SAL_CALL acquire() throw() override + { SvxShapeText::acquire(); } + virtual void SAL_CALL release() throw() override + { SvxShapeText::release(); } + + // XShape + virtual css::awt::Point SAL_CALL getPosition() override; + + // XPropertySet + void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override; + + // XTypeProvider + virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; + virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override; + + //XEnhancedCustomShapeDefaulter + virtual void SAL_CALL createCustomShapeDefaults( const OUString& rShapeType ) override; +}; + +/*********************************************************************** +* * +***********************************************************************/ + +class SvxMediaShape final : public SvxShape +{ +public: + SvxMediaShape(SdrObject* pObj, OUString const & referer); + virtual ~SvxMediaShape() throw() override; + +private: + // override these for special property handling in subcasses. Return true if property is handled + virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override; + virtual bool getPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, css::uno::Any& rValue ) override; + + OUString referer_; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/unoshprp.hxx b/include/svx/unoshprp.hxx new file mode 100644 index 000000000..cf7452e83 --- /dev/null +++ b/include/svx/unoshprp.hxx @@ -0,0 +1,564 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_UNOSHPRP_HXX +#define INCLUDED_SVX_UNOSHPRP_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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#define OWN_ATTR_VALUE_START_TEXT (OWN_ATTR_VALUE_START+0) // the next 10 entries are reserved for text +#define OWN_ATTR_VALUE_POLYGONKIND (OWN_ATTR_VALUE_START+10) +#define OWN_ATTR_VALUE_POLYPOLYGON (OWN_ATTR_VALUE_START+11) +#define OWN_ATTR_VALUE_POLYPOLYGONBEZIER (OWN_ATTR_VALUE_START+12) +#define OWN_ATTR_VALUE_FILLBITMAP (OWN_ATTR_VALUE_START+13) +#define OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX (OWN_ATTR_VALUE_START+14) +#define OWN_ATTR_3D_VALUE_POSITION (OWN_ATTR_VALUE_START+15) +#define OWN_ATTR_3D_VALUE_SIZE (OWN_ATTR_VALUE_START+16) +#define OWN_ATTR_3D_VALUE_POS_IS_CENTER (OWN_ATTR_VALUE_START+17) +#define OWN_ATTR_3D_VALUE_POLYPOLYGON3D (OWN_ATTR_VALUE_START+18) +#define OWN_ATTR_3D_VALUE_LINEONLY (OWN_ATTR_VALUE_START+19) +#define OWN_ATTR_BITMAP (OWN_ATTR_VALUE_START+20) +#define OWN_ATTR_EDGE_START_OBJ (OWN_ATTR_VALUE_START+21) +#define OWN_ATTR_EDGE_START_POS (OWN_ATTR_VALUE_START+22) +#define OWN_ATTR_EDGE_END_OBJ (OWN_ATTR_VALUE_START+23) +#define OWN_ATTR_EDGE_END_POS (OWN_ATTR_VALUE_START+24) +#define OWN_ATTR_FRAMERECT (OWN_ATTR_VALUE_START+25) +#define OWN_ATTR_VALUE_POLYGON (OWN_ATTR_VALUE_START+26) +#define OWN_ATTR_METAFILE (OWN_ATTR_VALUE_START+27) +#define OWN_ATTR_ISFONTWORK (OWN_ATTR_VALUE_START+28) +#define OWN_ATTR_BOUNDRECT (OWN_ATTR_VALUE_START+29) +#define OWN_ATTR_LDNAME (OWN_ATTR_VALUE_START+30) +#define OWN_ATTR_LDBITMAP (OWN_ATTR_VALUE_START+31) +#define OWN_ATTR_OLESIZE (OWN_ATTR_VALUE_START+32) +#define OWN_ATTR_GRAPHIC_URL (OWN_ATTR_VALUE_START+33) +#define OWN_ATTR_OLEMODEL (OWN_ATTR_VALUE_START+34) +#define OWN_ATTR_MIRRORED (OWN_ATTR_VALUE_START+35) +#define OWN_ATTR_CLSID (OWN_ATTR_VALUE_START+36) +#define OWN_ATTR_GLUEID_TAIL (OWN_ATTR_VALUE_START+37) +#define OWN_ATTR_GLUEID_HEAD (OWN_ATTR_VALUE_START+38) +#define OWN_ATTR_ZORDER (OWN_ATTR_VALUE_START+39) +#define OWN_ATTR_MEASURE_START_POS (OWN_ATTR_VALUE_START+40) +#define OWN_ATTR_MEASURE_END_POS (OWN_ATTR_VALUE_START+41) +#define OWN_ATTR_3D_VALUE_CAMERA_GEOMETRY (OWN_ATTR_VALUE_START+42) +#define OWN_ATTR_WRITINGMODE (OWN_ATTR_VALUE_START+43) +#define OWN_ATTR_GRAFSTREAMURL (OWN_ATTR_VALUE_START+44) +#define OWN_ATTR_FILLBMP_MODE (OWN_ATTR_VALUE_START+45) +#define OWN_ATTR_TRANSFORMATION (OWN_ATTR_VALUE_START+46) +#define OWN_ATTR_BASE_GEOMETRY (OWN_ATTR_VALUE_START+47) + +/// reuse attr slots for GraphicObject which will never be used together with graphic object +#define OWN_ATTR_REPLACEMENT_GRAPHIC (OWN_ATTR_VALUE_START+14) + +#define OWN_ATTR_APPLET_DOCBASE (OWN_ATTR_VALUE_START+48) +#define OWN_ATTR_APPLET_CODEBASE (OWN_ATTR_VALUE_START+49) +#define OWN_ATTR_APPLET_NAME (OWN_ATTR_VALUE_START+50) +#define OWN_ATTR_APPLET_CODE (OWN_ATTR_VALUE_START+51) +#define OWN_ATTR_APPLET_COMMANDS (OWN_ATTR_VALUE_START+52) +#define OWN_ATTR_APPLET_ISSCRIPT (OWN_ATTR_VALUE_START+53) +#define OWN_ATTR_PLUGIN_MIMETYPE (OWN_ATTR_VALUE_START+54) +#define OWN_ATTR_PLUGIN_URL (OWN_ATTR_VALUE_START+55) +#define OWN_ATTR_PLUGIN_COMMANDS (OWN_ATTR_VALUE_START+56) +#define OWN_ATTR_FRAME_URL (OWN_ATTR_VALUE_START+57) +#define OWN_ATTR_FRAME_NAME (OWN_ATTR_VALUE_START+58) +#define OWN_ATTR_FRAME_ISAUTOSCROLL (OWN_ATTR_VALUE_START+59) +#define OWN_ATTR_FRAME_ISBORDER (OWN_ATTR_VALUE_START+60) +#define OWN_ATTR_FRAME_MARGIN_WIDTH (OWN_ATTR_VALUE_START+61) +#define OWN_ATTR_FRAME_MARGIN_HEIGHT (OWN_ATTR_VALUE_START+62) + +// reuse own attr from ole shapes for tables +#define OWN_ATTR_TABLETEMPLATE (OWN_ATTR_VALUE_START+48) +#define OWN_ATTR_TABLETEMPLATE_FIRSTROW (OWN_ATTR_VALUE_START+49) +#define OWN_ATTR_TABLETEMPLATE_LASTROW (OWN_ATTR_VALUE_START+50) +#define OWN_ATTR_TABLETEMPLATE_FIRSTCOLUMN (OWN_ATTR_VALUE_START+51) +#define OWN_ATTR_TABLETEMPLATE_LASTCOLUMN (OWN_ATTR_VALUE_START+52) +#define OWN_ATTR_TABLETEMPLATE_BANDINGROWS (OWN_ATTR_VALUE_START+53) +#define OWN_ATTR_TABLETEMPLATE_BANDINGCOULUMNS (OWN_ATTR_VALUE_START+54) +#define OWN_ATTR_TABLEBORDER (OWN_ATTR_VALUE_START+55) + +#define OWN_ATTR_OLE_VISAREA (OWN_ATTR_VALUE_START+63) +#define OWN_ATTR_CAPTION_POINT (OWN_ATTR_VALUE_START+64) +#define OWN_ATTR_PAGE_NUMBER (OWN_ATTR_VALUE_START+65) +#define OWN_ATTR_THUMBNAIL (OWN_ATTR_VALUE_START+66) +#define OWN_ATTR_PERSISTNAME (OWN_ATTR_VALUE_START+67) +#define OWN_ATTR_OLE_EMBEDDED_OBJECT_NONEWCLIENT (OWN_ATTR_VALUE_START+68) +#define OWN_ATTR_MEDIA_URL (OWN_ATTR_VALUE_START+69) +#define OWN_ATTR_MEDIA_PREFERREDSIZE (OWN_ATTR_VALUE_START+70) +#define OWN_ATTR_MEDIA_LOOP (OWN_ATTR_VALUE_START+71) +#define OWN_ATTR_MEDIA_MUTE (OWN_ATTR_VALUE_START+72) +#define OWN_ATTR_MEDIA_VOLUMEDB (OWN_ATTR_VALUE_START+73) +#define OWN_ATTR_MEDIA_ZOOM (OWN_ATTR_VALUE_START+74) +#define OWN_ATTR_UINAME_SINGULAR (OWN_ATTR_VALUE_START+75) +#define OWN_ATTR_UINAME_PLURAL (OWN_ATTR_VALUE_START+76) +#define OWN_ATTR_VALUE_GRAPHIC (OWN_ATTR_VALUE_START+77) +#define OWN_ATTR_INTERNAL_OLE (OWN_ATTR_VALUE_START+78) +#define OWN_ATTR_OLE_EMBEDDED_OBJECT (OWN_ATTR_VALUE_START+79) +#define OWN_ATTR_OLE_ASPECT (OWN_ATTR_VALUE_START+80) + +// #i68101# +#define OWN_ATTR_MISC_OBJ_TITLE (OWN_ATTR_VALUE_START+81) +#define OWN_ATTR_MISC_OBJ_DESCRIPTION (OWN_ATTR_VALUE_START+82) + +#define OWN_ATTR_GRAPHIC_STREAM (OWN_ATTR_VALUE_START+83) +#define OWN_ATTR_3D_VALUE_NORMALSPOLYGON3D (OWN_ATTR_VALUE_START+84) +#define OWN_ATTR_3D_VALUE_TEXTUREPOLYGON3D (OWN_ATTR_VALUE_START+85) + +#define OWN_ATTR_OLE_LINKURL (OWN_ATTR_VALUE_START+86) + +#define OWN_ATTR_STYLE (OWN_ATTR_VALUE_START+87) + +#define OWN_ATTR_EDGE_POLYPOLYGONBEZIER (OWN_ATTR_VALUE_START+88) + +#define OWN_ATTR_MEDIA_STREAM (OWN_ATTR_VALUE_START+89) +#define OWN_ATTR_MEDIA_TEMPFILEURL (OWN_ATTR_VALUE_START+90) +#define OWN_ATTR_INTEROPGRABBAG (OWN_ATTR_VALUE_START+91) +#define OWN_ATTR_MEDIA_MIMETYPE (OWN_ATTR_VALUE_START+92) +#define OWN_ATTR_FALLBACK_GRAPHIC (OWN_ATTR_VALUE_START+93) +#define OWN_ATTR_IS_SIGNATURELINE (OWN_ATTR_VALUE_START+94) +#define OWN_ATTR_SIGNATURELINE_ID (OWN_ATTR_VALUE_START+95) +#define OWN_ATTR_SIGNATURELINE_SUGGESTED_SIGNER_NAME (OWN_ATTR_VALUE_START+96) +#define OWN_ATTR_SIGNATURELINE_SUGGESTED_SIGNER_TITLE (OWN_ATTR_VALUE_START+97) +#define OWN_ATTR_SIGNATURELINE_SUGGESTED_SIGNER_EMAIL (OWN_ATTR_VALUE_START+98) +#define OWN_ATTR_SIGNATURELINE_SIGNING_INSTRUCTIONS (OWN_ATTR_VALUE_START+99) +#define OWN_ATTR_SIGNATURELINE_SHOW_SIGN_DATE (OWN_ATTR_VALUE_START+100) +#define OWN_ATTR_SIGNATURELINE_CAN_ADD_COMMENT (OWN_ATTR_VALUE_START+101) +#define OWN_ATTR_SIGNATURELINE_UNSIGNED_IMAGE (OWN_ATTR_VALUE_START+102) +#define OWN_ATTR_SIGNATURELINE_IS_SIGNED (OWN_ATTR_VALUE_START+103) +#define OWN_ATTR_QRCODE (OWN_ATTR_VALUE_START+104) +#define OWN_ATTR_TEXTFITTOSIZESCALE (OWN_ATTR_VALUE_START+105) +// ATTENTION: maximum is OWN_ATTR_VALUE_START+105 svx, see include/svl/solar.hrc + +// #FontWork# +#define FONTWORK_PROPERTIES \ + { OUString("FontWorkStyle"), XATTR_FORMTXTSTYLE, /*ENUM*/::cppu::UnoType::get(), 0, 0}, \ + { OUString("FontWorkAdjust"), XATTR_FORMTXTADJUST, /*ENUM*/::cppu::UnoType::get(), 0, 0}, \ + { OUString("FontWorkDistance"), XATTR_FORMTXTDISTANCE, ::cppu::UnoType::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { OUString("FontWorkStart"), XATTR_FORMTXTSTART, ::cppu::UnoType::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { OUString("FontWorkMirror"), XATTR_FORMTXTMIRROR, cppu::UnoType::get(), 0, 0}, \ + { OUString("FontWorkOutline"), XATTR_FORMTXTOUTLINE, cppu::UnoType::get(), 0, 0}, \ + { OUString("FontWorkShadow"), XATTR_FORMTXTSHADOW, /*ENUM*/::cppu::UnoType::get(), 0, 0}, \ + { OUString("FontWorkShadowColor"), XATTR_FORMTXTSHDWCOLOR, ::cppu::UnoType::get(), 0, 0}, \ + { OUString("FontWorkShadowOffsetX"), XATTR_FORMTXTSHDWXVAL, ::cppu::UnoType::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { OUString("FontWorkShadowOffsetY"), XATTR_FORMTXTSHDWYVAL, ::cppu::UnoType::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { OUString("FontWorkHideForm"), XATTR_FORMTXTHIDEFORM, cppu::UnoType::get(), 0, 0}, \ + { OUString("FontWorkShadowTransparence"),XATTR_FORMTXTSHDWTRANSP, ::cppu::UnoType::get(), 0, 0}, + +#define GLOW_PROPERTIES \ + { OUString{"GlowEffectRadius"}, SDRATTR_GLOW_RADIUS, ::cppu::UnoType::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { OUString{"GlowEffectColor"}, SDRATTR_GLOW_COLOR, ::cppu::UnoType::get(), 0, 0}, \ + { OUString{"GlowEffectTransparency"}, SDRATTR_GLOW_TRANSPARENCY,::cppu::UnoType::get(), 0, 0 }, + +#define SOFTEDGE_PROPERTIES \ + { OUString{"SoftEdgeRadius"}, SDRATTR_SOFTEDGE_RADIUS, cppu::UnoType::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, + +#define SHADOW_PROPERTIES \ + { OUString(UNO_NAME_SHADOW), SDRATTR_SHADOW, cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_SHADOWCOLOR), SDRATTR_SHADOWCOLOR, ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_SHADOWTRANSPARENCE),SDRATTR_SHADOWTRANSPARENCE, ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_SHADOWXDIST), SDRATTR_SHADOWXDIST, ::cppu::UnoType::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { OUString(UNO_NAME_SHADOWYDIST), SDRATTR_SHADOWYDIST, ::cppu::UnoType::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { OUString(UNO_NAME_SHADOWSIZEX), SDRATTR_SHADOWSIZEX, ::cppu::UnoType::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { OUString(UNO_NAME_SHADOWSIZEY), SDRATTR_SHADOWSIZEY, ::cppu::UnoType::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, + +#define LINE_PROPERTIES_DEFAULTS\ + { OUString(UNO_NAME_LINECAP), XATTR_LINECAP, ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_LINECOLOR), XATTR_LINECOLOR, ::cppu::UnoType::get() , 0, 0}, \ + { OUString(UNO_NAME_LINEENDCENTER), XATTR_LINEENDCENTER, cppu::UnoType::get() , 0, 0}, \ + { OUString(UNO_NAME_LINEENDWIDTH), XATTR_LINEENDWIDTH, ::cppu::UnoType::get() , 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { OUString(UNO_NAME_LINEJOINT), XATTR_LINEJOINT, ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_LINESTARTCENTER), XATTR_LINESTARTCENTER, cppu::UnoType::get() , 0, 0}, \ + { OUString(UNO_NAME_LINESTARTWIDTH), XATTR_LINESTARTWIDTH, ::cppu::UnoType::get() , 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { OUString(UNO_NAME_LINESTYLE), XATTR_LINESTYLE, cppu::UnoType::get() , 0, 0}, \ + { OUString(UNO_NAME_LINETRANSPARENCE), XATTR_LINETRANSPARENCE, ::cppu::UnoType::get() , 0, 0}, \ + { OUString(UNO_NAME_LINEWIDTH), XATTR_LINEWIDTH, ::cppu::UnoType::get() , 0, 0, PropertyMoreFlags::METRIC_ITEM}, + +#define LINE_PROPERTIES \ + { OUString(UNO_NAME_LINEDASH), XATTR_LINEDASH, ::cppu::UnoType::get() , 0, MID_LINEDASH}, \ + { OUString("LineDashName"), XATTR_LINEDASH, ::cppu::UnoType::get() , 0, MID_NAME}, \ + LINE_PROPERTIES_DEFAULTS + +#define LINE_PROPERTIES_START_END \ + { OUString(UNO_NAME_LINEEND), XATTR_LINEEND, ::cppu::UnoType::get(), css::beans::PropertyAttribute::MAYBEVOID, 0}, \ + { OUString("LineEndName"), XATTR_LINEEND, ::cppu::UnoType::get(), 0, MID_NAME }, \ + { OUString(UNO_NAME_LINESTART), XATTR_LINESTART, ::cppu::UnoType::get(), css::beans::PropertyAttribute::MAYBEVOID, 0}, \ + { OUString("LineStartName"), XATTR_LINESTART, ::cppu::UnoType::get(), 0, MID_NAME }, + +#define FILL_PROPERTIES_BMP \ + { OUString(UNO_NAME_FILLBMP_LOGICAL_SIZE), XATTR_FILLBMP_SIZELOG, cppu::UnoType::get() , 0, 0}, \ + { OUString(UNO_NAME_FILLBMP_OFFSET_X), XATTR_FILLBMP_TILEOFFSETX, ::cppu::UnoType::get() , 0, 0}, \ + { OUString(UNO_NAME_FILLBMP_OFFSET_Y), XATTR_FILLBMP_TILEOFFSETY, ::cppu::UnoType::get() , 0, 0}, \ + { OUString(UNO_NAME_FILLBMP_POSITION_OFFSET_X), XATTR_FILLBMP_POSOFFSETX, ::cppu::UnoType::get() , 0, 0}, \ + { OUString(UNO_NAME_FILLBMP_POSITION_OFFSET_Y), XATTR_FILLBMP_POSOFFSETY, ::cppu::UnoType::get() , 0, 0}, \ + { OUString(UNO_NAME_FILLBMP_RECTANGLE_POINT), XATTR_FILLBMP_POS, ::cppu::UnoType::get() , 0, 0}, \ + { OUString(UNO_NAME_FILLBMP_SIZE_X), XATTR_FILLBMP_SIZEX, ::cppu::UnoType::get() , 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { OUString(UNO_NAME_FILLBMP_SIZE_Y), XATTR_FILLBMP_SIZEY, ::cppu::UnoType::get() , 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { OUString(UNO_NAME_FILLBMP_STRETCH), XATTR_FILLBMP_STRETCH, cppu::UnoType::get() , 0, 0}, \ + { OUString(UNO_NAME_FILLBMP_TILE), XATTR_FILLBMP_TILE, cppu::UnoType::get() , 0, 0},\ + { OUString(UNO_NAME_FILLBMP_MODE), OWN_ATTR_FILLBMP_MODE, ::cppu::UnoType::get(), 0, 0}, + +#define FILL_PROPERTIES_DEFAULTS \ + { OUString(UNO_NAME_FILLCOLOR), XATTR_FILLCOLOR, ::cppu::UnoType::get(), 0, 0}, \ + +#define FILL_PROPERTIES \ + FILL_PROPERTIES_BMP \ + FILL_PROPERTIES_DEFAULTS \ + { OUString(UNO_NAME_FILLBACKGROUND), XATTR_FILLBACKGROUND , cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_FILLBITMAP), XATTR_FILLBITMAP , cppu::UnoType::get() , 0, MID_BITMAP}, \ + { OUString(UNO_NAME_FILLBITMAPURL), XATTR_FILLBITMAP , cppu::UnoType::get(), 0, MID_BITMAP }, \ + { OUString(UNO_NAME_FILLBITMAPNAME), XATTR_FILLBITMAP , ::cppu::UnoType::get(), 0, MID_NAME }, \ + { OUString(UNO_NAME_FILLGRADIENTSTEPCOUNT), XATTR_GRADIENTSTEPCOUNT , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_FILLGRADIENT), XATTR_FILLGRADIENT , ::cppu::UnoType::get(), 0, MID_FILLGRADIENT}, \ + { OUString(UNO_NAME_FILLGRADIENTNAME), XATTR_FILLGRADIENT , ::cppu::UnoType::get(), 0, MID_NAME }, \ + { OUString(UNO_NAME_FILLHATCH), XATTR_FILLHATCH , ::cppu::UnoType::get(), 0, MID_FILLHATCH}, \ + { OUString(UNO_NAME_FILLHATCHNAME), XATTR_FILLHATCH , ::cppu::UnoType::get(), 0, MID_NAME }, \ + { OUString(UNO_NAME_FILLSTYLE), XATTR_FILLSTYLE , ::cppu::UnoType::get() , 0, 0}, \ + { OUString(UNO_NAME_FILL_TRANSPARENCE), XATTR_FILLTRANSPARENCE, ::cppu::UnoType::get() , 0, 0}, \ + { OUString(UNO_NAME_FILLTRANSPARENCEGRADIENT), XATTR_FILLFLOATTRANSPARENCE, ::cppu::UnoType::get(), 0, MID_FILLGRADIENT}, \ + { OUString(UNO_NAME_FILLTRANSPARENCEGRADIENTNAME), XATTR_FILLFLOATTRANSPARENCE, ::cppu::UnoType::get(), 0, MID_NAME }, \ + { OUString(UNO_NAME_FILLCOLOR_2), XATTR_SECONDARYFILLCOLOR, ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_GRAPHIC_GRAPHICCROP), SDRATTR_GRAFCROP , ::cppu::UnoType::get(), 0, 0 }, + +#define EDGERADIUS_PROPERTIES \ + { OUString(UNO_NAME_EDGERADIUS), SDRATTR_ECKENRADIUS , ::cppu::UnoType::get() , 0, 0, PropertyMoreFlags::METRIC_ITEM}, + +#define TEXT_PROPERTIES_DEFAULTS\ + { OUString(UNO_NAME_TEXT_WRITINGMODE), SDRATTR_TEXTDIRECTION, ::cppu::UnoType::get(), 0, 0},\ + { OUString(UNO_NAME_TEXT_ANIAMOUNT), SDRATTR_TEXT_ANIAMOUNT, ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_TEXT_ANICOUNT), SDRATTR_TEXT_ANICOUNT, ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_TEXT_ANIDELAY), SDRATTR_TEXT_ANIDELAY, ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_TEXT_ANIDIRECTION), SDRATTR_TEXT_ANIDIRECTION, cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_TEXT_ANIKIND), SDRATTR_TEXT_ANIKIND, cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_TEXT_ANISTARTINSIDE), SDRATTR_TEXT_ANISTARTINSIDE, cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_TEXT_ANISTOPINSIDE), SDRATTR_TEXT_ANISTOPINSIDE, cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_TEXT_AUTOGROWHEIGHT), SDRATTR_TEXT_AUTOGROWHEIGHT, cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_TEXT_AUTOGROWWIDTH), SDRATTR_TEXT_AUTOGROWWIDTH, cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_TEXT_CONTOURFRAME), SDRATTR_TEXT_CONTOURFRAME, cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_TEXT_FITTOSIZE), SDRATTR_TEXT_FITTOSIZE, cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_TEXT_HORZADJUST), SDRATTR_TEXT_HORZADJUST, cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_TEXT_LEFTDIST), SDRATTR_TEXT_LEFTDIST, ::cppu::UnoType::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { OUString(UNO_NAME_TEXT_LOWERDIST), SDRATTR_TEXT_LOWERDIST, ::cppu::UnoType::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { OUString(UNO_NAME_TEXT_MAXFRAMEHEIGHT), SDRATTR_TEXT_MAXFRAMEHEIGHT, ::cppu::UnoType::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { OUString(UNO_NAME_TEXT_MAXFRAMEWIDTH), SDRATTR_TEXT_MAXFRAMEWIDTH, ::cppu::UnoType::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { OUString(UNO_NAME_TEXT_MINFRAMEHEIGHT), SDRATTR_TEXT_MINFRAMEHEIGHT, ::cppu::UnoType::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { OUString(UNO_NAME_TEXT_MINFRAMEWIDTH), SDRATTR_TEXT_MINFRAMEWIDTH, ::cppu::UnoType::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { OUString(UNO_NAME_TEXT_RIGHTDIST), SDRATTR_TEXT_RIGHTDIST, ::cppu::UnoType::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { OUString(UNO_NAME_TEXT_UPPERDIST), SDRATTR_TEXT_UPPERDIST, ::cppu::UnoType::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { OUString(UNO_NAME_TEXT_FONTINDEPENDENTLINESPACING),SDRATTR_TEXT_USEFIXEDCELLHEIGHT,cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_TEXT_VERTADJUST), SDRATTR_TEXT_VERTADJUST, cppu::UnoType::get(), 0, 0},\ + { OUString(UNO_NAME_TEXT_WORDWRAP), SDRATTR_TEXT_WORDWRAP, cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_TEXT_CHAINNEXTNAME), SDRATTR_TEXT_CHAINNEXTNAME, ::cppu::UnoType::get(), 0, 0}, \ + SVX_UNOEDIT_CHAR_PROPERTIES, \ + SVX_UNOEDIT_PARA_PROPERTIES, + +#define TEXT_PROPERTIES \ + SVX_UNOEDIT_NUMBERING_PROPERTIE, \ + TEXT_PROPERTIES_DEFAULTS + +// { "HasLevels", OWN_ATTR_HASLEVELS, cppu::UnoType::get(), css::beans::PropertyAttribute::READONLY, 0}, + +#define MISC_OBJ_PROPERTIES_NO_SHEAR \ + { OUString("Transformation"), OWN_ATTR_TRANSFORMATION, cppu::UnoType::get(), 0, 0 }, \ + { OUString(UNO_NAME_MISC_OBJ_ZORDER), OWN_ATTR_ZORDER, ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_MISC_OBJ_FRAMERECT), OWN_ATTR_FRAMERECT, cppu::UnoType::get(), 0, 0 }, \ + { OUString(UNO_NAME_MISC_OBJ_ROTATEANGLE), SDRATTR_ROTATEANGLE, ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_BITMAP), OWN_ATTR_BITMAP, cppu::UnoType::get(), css::beans::PropertyAttribute::READONLY, 0}, \ + { OUString(UNO_NAME_OLE2_METAFILE), OWN_ATTR_METAFILE, cppu::UnoType>::get(), css::beans::PropertyAttribute::READONLY, 0}, \ + { OUString("IsFontwork"), OWN_ATTR_ISFONTWORK, cppu::UnoType::get(), css::beans::PropertyAttribute::READONLY, 0}, \ + { OUString(UNO_NAME_MISC_OBJ_BOUNDRECT), OWN_ATTR_BOUNDRECT, cppu::UnoType::get(), css::beans::PropertyAttribute::READONLY, 0}, + +#define MISC_OBJ_PROPERTIES \ + { OUString(UNO_NAME_MISC_OBJ_INTEROPGRABBAG), OWN_ATTR_INTEROPGRABBAG, cppu::UnoType>::get(), 0, 0}, \ + MISC_OBJ_PROPERTIES_NO_SHEAR \ + { OUString(UNO_NAME_MISC_OBJ_SHEARANGLE), SDRATTR_SHEARANGLE, ::cppu::UnoType::get(), 0, 0}, + + +#define SHAPE_DESCRIPTOR_PROPERTIES \ + { OUString(UNO_NAME_MISC_OBJ_LAYERID), SDRATTR_LAYERID , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_MISC_OBJ_LAYERNAME), SDRATTR_LAYERNAME , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_MISC_OBJ_MOVEPROTECT), SDRATTR_OBJMOVEPROTECT , cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_MISC_OBJ_NAME), SDRATTR_OBJECTNAME , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_MISC_OBJ_PRINTABLE), SDRATTR_OBJPRINTABLE , cppu::UnoType::get(), 0, 0}, \ + { OUString("Visible"), SDRATTR_OBJVISIBLE , cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_MISC_OBJ_SIZEPROTECT), SDRATTR_OBJSIZEPROTECT , cppu::UnoType::get(), 0, 0},\ + { OUString("UINameSingular"), OWN_ATTR_UINAME_SINGULAR , ::cppu::UnoType::get(), css::beans::PropertyAttribute::READONLY, 0}, \ + { OUString("UINamePlural"), OWN_ATTR_UINAME_PLURAL , ::cppu::UnoType::get(), css::beans::PropertyAttribute::READONLY, 0}, \ + { OUString("TextFitToSizeScale"), OWN_ATTR_TEXTFITTOSIZESCALE, ::cppu::UnoType::get(), 0, 0}, \ + /* #i68101# */ \ + { OUString(UNO_NAME_MISC_OBJ_TITLE), OWN_ATTR_MISC_OBJ_TITLE , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_MISC_OBJ_DESCRIPTION), OWN_ATTR_MISC_OBJ_DESCRIPTION , ::cppu::UnoType::get(), 0, 0}, + +#define LINKTARGET_PROPERTIES \ + { OUString(UNO_NAME_LINKDISPLAYNAME), OWN_ATTR_LDNAME , ::cppu::UnoType::get(), css::beans::PropertyAttribute::READONLY, 0}, \ + { OUString(UNO_NAME_LINKDISPLAYBITMAP), OWN_ATTR_LDBITMAP , cppu::UnoType::get(), css::beans::PropertyAttribute::READONLY, 0}, + + +#define CONNECTOR_PROPERTIES \ + { OUString(UNO_NAME_EDGEKIND), SDRATTR_EDGEKIND, ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_EDGENODE1HORZDIST), SDRATTR_EDGENODE1HORZDIST, ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_EDGENODE1VERTDIST), SDRATTR_EDGENODE1VERTDIST, ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_EDGENODE2HORZDIST), SDRATTR_EDGENODE2HORZDIST, ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_EDGENODE2VERTDIST), SDRATTR_EDGENODE2VERTDIST, ::cppu::UnoType::get(), 0, 0}, + +#define SPECIAL_CONNECTOR_PROPERTIES \ + CONNECTOR_PROPERTIES \ + { OUString(UNO_NAME_EDGELINE1DELTA), SDRATTR_EDGELINE1DELTA, ::cppu::UnoType::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { OUString(UNO_NAME_EDGELINE2DELTA), SDRATTR_EDGELINE2DELTA, ::cppu::UnoType::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { OUString(UNO_NAME_EDGELINE3DELTA), SDRATTR_EDGELINE3DELTA, ::cppu::UnoType::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { OUString("StartShape"), OWN_ATTR_EDGE_START_OBJ, cppu::UnoType::get(), css::beans::PropertyAttribute::MAYBEVOID, 0}, \ + { OUString("StartGluePointIndex"), OWN_ATTR_GLUEID_HEAD, ::cppu::UnoType::get(), 0, 0}, \ + { OUString("StartPosition"), OWN_ATTR_EDGE_START_POS, ::cppu::UnoType::get(), 0, 0}, \ + { OUString("EndShape"), OWN_ATTR_EDGE_END_OBJ, cppu::UnoType::get(), css::beans::PropertyAttribute::MAYBEVOID, 0}, \ + { OUString("EndPosition"), OWN_ATTR_EDGE_END_POS, ::cppu::UnoType::get(), 0, 0},\ + { OUString("EndGluePointIndex"), OWN_ATTR_GLUEID_TAIL, ::cppu::UnoType::get(), 0, 0}, \ +\ + { OUString("EdgeStartConnection"), OWN_ATTR_EDGE_START_OBJ, cppu::UnoType::get(), css::beans::PropertyAttribute::MAYBEVOID, 0}, \ + { OUString("EdgeStartPoint"), OWN_ATTR_EDGE_START_POS, ::cppu::UnoType::get(), css::beans::PropertyAttribute::READONLY, 0}, \ + { OUString("EdgeEndConnection"), OWN_ATTR_EDGE_END_OBJ, cppu::UnoType::get(), css::beans::PropertyAttribute::MAYBEVOID, 0}, \ + { OUString("EdgeEndPoint"), OWN_ATTR_EDGE_END_POS, ::cppu::UnoType::get(), css::beans::PropertyAttribute::READONLY, 0}, \ +\ + { OUString(UNO_NAME_POLYPOLYGONBEZIER), OWN_ATTR_EDGE_POLYPOLYGONBEZIER, ::cppu::UnoType::get(), 0, 0}, + +#define SPECIAL_DIMENSIONING_PROPERTIES_DEFAULTS \ + { OUString(UNO_NAME_MEASUREBELOWREFEDGE), SDRATTR_MEASUREBELOWREFEDGE, cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_MEASUREFORMATSTRING), SDRATTR_MEASUREFORMATSTRING, ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_MEASUREHELPLINE1LEN), SDRATTR_MEASUREHELPLINE1LEN, ::cppu::UnoType::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { OUString(UNO_NAME_MEASUREHELPLINE2LEN), SDRATTR_MEASUREHELPLINE2LEN, ::cppu::UnoType::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { OUString(UNO_NAME_MEASUREHELPLINEDIST), SDRATTR_MEASUREHELPLINEDIST, ::cppu::UnoType::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { OUString(UNO_NAME_MEASUREHELPLINEOVERHANG), SDRATTR_MEASUREHELPLINEOVERHANG, ::cppu::UnoType::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { OUString(UNO_NAME_MEASUREKIND), SDRATTR_MEASUREKIND, ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_MEASURELINEDIST), SDRATTR_MEASURELINEDIST, ::cppu::UnoType::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { OUString(UNO_NAME_MEASUREOVERHANG), SDRATTR_MEASUREOVERHANG, ::cppu::UnoType::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { OUString(UNO_NAME_MEASUREUNIT), SDRATTR_MEASUREUNIT, ::cppu::UnoType::get(), 0, 0},\ + { OUString(UNO_NAME_MEASURESHOWUNIT), SDRATTR_MEASURESHOWUNIT, cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_MEASURETEXTAUTOANGLE), SDRATTR_MEASURETEXTAUTOANGLE, cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_MEASURETEXTAUTOANGLEVIEW), SDRATTR_MEASURETEXTAUTOANGLEVIEW, ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_MEASURETEXTFIXEDANGLE), SDRATTR_MEASURETEXTFIXEDANGLE, ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_MEASURETEXTHPOS), SDRATTR_MEASURETEXTHPOS, ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_MEASURETEXTISFIXEDANGLE), SDRATTR_MEASURETEXTISFIXEDANGLE, cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_MEASURETEXTROTA90), SDRATTR_MEASURETEXTROTA90, cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_MEASURETEXTUPSIDEDOWN), SDRATTR_MEASURETEXTUPSIDEDOWN, cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_MEASURETEXTVPOS), SDRATTR_MEASURETEXTVPOS, ::cppu::UnoType::get(), 0, 0}, \ + { OUString("MeasureDecimalPlaces"), SDRATTR_MEASUREDECIMALPLACES, ::cppu::UnoType::get(), 0, 0}, + + +#define SPECIAL_DIMENSIONING_PROPERTIES \ + SPECIAL_DIMENSIONING_PROPERTIES_DEFAULTS \ + { OUString("StartPosition"), OWN_ATTR_MEASURE_START_POS, ::cppu::UnoType::get(), 0, 0},\ + { OUString("EndPosition"), OWN_ATTR_MEASURE_END_POS, ::cppu::UnoType::get(), 0, 0}, + +#define SPECIAL_CIRCLE_PROPERTIES \ + { OUString(UNO_NAME_CIRCENDANGLE), SDRATTR_CIRCENDANGLE, ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_CIRCKIND), SDRATTR_CIRCKIND, ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_CIRCSTARTANGLE),SDRATTR_CIRCSTARTANGLE, ::cppu::UnoType::get(), 0, 0}, + +#define SPECIAL_POLYGON_PROPERTIES \ + { OUString(UNO_NAME_POLYGONKIND), OWN_ATTR_VALUE_POLYGONKIND, ::cppu::UnoType::get(), css::beans::PropertyAttribute::READONLY, 0}, + +#define SPECIAL_POLYPOLYGON_PROPERTIES \ + { OUString(UNO_NAME_POLYPOLYGON), OWN_ATTR_VALUE_POLYPOLYGON, ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_POLYGON), OWN_ATTR_VALUE_POLYGON, ::cppu::UnoType::get(), 0, 0}, + +#define SPECIAL_POLYPOLYGONBEZIER_PROPERTIES \ + { OUString(UNO_NAME_POLYPOLYGONBEZIER), OWN_ATTR_VALUE_POLYPOLYGONBEZIER, ::cppu::UnoType::get(), 0, 0}, + +#define SPECIAL_GRAPHOBJ_PROPERTIES_DEFAULTS \ + { OUString(UNO_NAME_GRAPHIC_LUMINANCE), SDRATTR_GRAFLUMINANCE , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_GRAPHIC_CONTRAST), SDRATTR_GRAFCONTRAST , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_GRAPHIC_RED), SDRATTR_GRAFRED , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_GRAPHIC_GREEN), SDRATTR_GRAFGREEN , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_GRAPHIC_BLUE), SDRATTR_GRAFBLUE , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_GRAPHIC_GAMMA), SDRATTR_GRAFGAMMA , cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_GRAPHIC_TRANSPARENCY), SDRATTR_GRAFTRANSPARENCE , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_GRAPHIC_COLOR_MODE), SDRATTR_GRAFMODE , ::cppu::UnoType::get(), 0, 0}, + +#define SPECIAL_GRAPHOBJ_PROPERTIES \ + SPECIAL_GRAPHOBJ_PROPERTIES_DEFAULTS \ + { OUString(UNO_NAME_GRAPHIC_GRAPHICCROP), SDRATTR_GRAFCROP , ::cppu::UnoType::get(), 0, 0 }, \ + { OUString(UNO_NAME_GRAPHOBJ_REPLACEMENT_GRAPHIC), OWN_ATTR_REPLACEMENT_GRAPHIC, cppu::UnoType::get() , 0, 0}, \ + { OUString(UNO_NAME_GRAPHOBJ_GRAFSTREAMURL), OWN_ATTR_GRAFSTREAMURL , ::cppu::UnoType::get(), css::beans::PropertyAttribute::MAYBEVOID, 0 }, \ + { OUString(UNO_NAME_GRAPHOBJ_FILLBITMAP), OWN_ATTR_VALUE_FILLBITMAP , cppu::UnoType::get() , 0, 0}, \ + { OUString(UNO_NAME_GRAPHOBJ_GRAPHIC), OWN_ATTR_VALUE_GRAPHIC , cppu::UnoType::get() , 0, 0}, \ + { OUString(UNO_NAME_GRAPHOBJ_GRAPHIC_URL), OWN_ATTR_GRAPHIC_URL , cppu::UnoType::get(), 0, 0 }, \ + { OUString(UNO_NAME_GRAPHOBJ_IS_SIGNATURELINE), OWN_ATTR_IS_SIGNATURELINE , cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_GRAPHOBJ_SIGNATURELINE_ID), OWN_ATTR_SIGNATURELINE_ID , cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_GRAPHOBJ_SIGNATURELINE_SUGGESTED_SIGNER_NAME), OWN_ATTR_SIGNATURELINE_SUGGESTED_SIGNER_NAME, cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_GRAPHOBJ_SIGNATURELINE_SUGGESTED_SIGNER_TITLE), OWN_ATTR_SIGNATURELINE_SUGGESTED_SIGNER_TITLE, cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_GRAPHOBJ_SIGNATURELINE_SUGGESTED_SIGNER_EMAIL), OWN_ATTR_SIGNATURELINE_SUGGESTED_SIGNER_EMAIL, cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_GRAPHOBJ_SIGNATURELINE_SIGNING_INSTRUCTIONS), OWN_ATTR_SIGNATURELINE_SIGNING_INSTRUCTIONS, cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_GRAPHOBJ_SIGNATURELINE_SHOW_SIGN_DATE), OWN_ATTR_SIGNATURELINE_SHOW_SIGN_DATE, cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_GRAPHOBJ_SIGNATURELINE_CAN_ADD_COMMENT), OWN_ATTR_SIGNATURELINE_CAN_ADD_COMMENT, cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_GRAPHOBJ_SIGNATURELINE_UNSIGNED_IMAGE), OWN_ATTR_SIGNATURELINE_UNSIGNED_IMAGE, cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_GRAPHOBJ_SIGNATURELINE_IS_SIGNED), OWN_ATTR_SIGNATURELINE_IS_SIGNED , cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_GRAPHOBJ_QRCODE), OWN_ATTR_QRCODE , cppu::UnoType::get(), 0, 0}, + +#define SPECIAL_3DSCENEOBJECT_PROPERTIES_DEFAULTS \ + { OUString(UNO_NAME_3D_SCENE_AMBIENTCOLOR), SDRATTR_3DSCENE_AMBIENTCOLOR , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_SCENE_DISTANCE), SDRATTR_3DSCENE_DISTANCE , ::cppu::UnoType::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { OUString(UNO_NAME_3D_SCENE_FOCAL_LENGTH), SDRATTR_3DSCENE_FOCAL_LENGTH , ::cppu::UnoType::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { OUString(UNO_NAME_3D_SCENE_LIGHTCOLOR_1), SDRATTR_3DSCENE_LIGHTCOLOR_1 , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_SCENE_LIGHTCOLOR_2), SDRATTR_3DSCENE_LIGHTCOLOR_2 , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_SCENE_LIGHTCOLOR_3), SDRATTR_3DSCENE_LIGHTCOLOR_3 , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_SCENE_LIGHTCOLOR_4), SDRATTR_3DSCENE_LIGHTCOLOR_4 , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_SCENE_LIGHTCOLOR_5), SDRATTR_3DSCENE_LIGHTCOLOR_5 , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_SCENE_LIGHTCOLOR_6), SDRATTR_3DSCENE_LIGHTCOLOR_6 , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_SCENE_LIGHTCOLOR_7), SDRATTR_3DSCENE_LIGHTCOLOR_7 , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_SCENE_LIGHTCOLOR_8), SDRATTR_3DSCENE_LIGHTCOLOR_8 , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_SCENE_LIGHTDIRECTION_1), SDRATTR_3DSCENE_LIGHTDIRECTION_1 , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_SCENE_LIGHTDIRECTION_2), SDRATTR_3DSCENE_LIGHTDIRECTION_2 , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_SCENE_LIGHTDIRECTION_3), SDRATTR_3DSCENE_LIGHTDIRECTION_3 , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_SCENE_LIGHTDIRECTION_4), SDRATTR_3DSCENE_LIGHTDIRECTION_4 , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_SCENE_LIGHTDIRECTION_5), SDRATTR_3DSCENE_LIGHTDIRECTION_5 , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_SCENE_LIGHTDIRECTION_6), SDRATTR_3DSCENE_LIGHTDIRECTION_6 , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_SCENE_LIGHTDIRECTION_7), SDRATTR_3DSCENE_LIGHTDIRECTION_7 , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_SCENE_LIGHTDIRECTION_8), SDRATTR_3DSCENE_LIGHTDIRECTION_8 , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_SCENE_LIGHTON_1), SDRATTR_3DSCENE_LIGHTON_1 , cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_SCENE_LIGHTON_2), SDRATTR_3DSCENE_LIGHTON_2 , cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_SCENE_LIGHTON_3), SDRATTR_3DSCENE_LIGHTON_3 , cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_SCENE_LIGHTON_4), SDRATTR_3DSCENE_LIGHTON_4 , cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_SCENE_LIGHTON_5), SDRATTR_3DSCENE_LIGHTON_5 , cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_SCENE_LIGHTON_6), SDRATTR_3DSCENE_LIGHTON_6 , cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_SCENE_LIGHTON_7), SDRATTR_3DSCENE_LIGHTON_7 , cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_SCENE_LIGHTON_8), SDRATTR_3DSCENE_LIGHTON_8 , cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_SCENE_PERSPECTIVE), SDRATTR_3DSCENE_PERSPECTIVE , cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_SCENE_SHADOW_SLANT), SDRATTR_3DSCENE_SHADOW_SLANT , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_SCENE_SHADE_MODE), SDRATTR_3DSCENE_SHADE_MODE , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_SCENE_TWO_SIDED_LIGHTING),SDRATTR_3DSCENE_TWO_SIDED_LIGHTING, cppu::UnoType::get(), 0, 0}, + +#define SPECIAL_3DSCENEOBJECT_PROPERTIES \ + SPECIAL_3DSCENEOBJECT_PROPERTIES_DEFAULTS \ + { OUString(UNO_NAME_3D_TRANSFORM_MATRIX), OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_CAMERA_GEOMETRY), OWN_ATTR_3D_VALUE_CAMERA_GEOMETRY , ::cppu::UnoType::get(), 0, 0}, + +// #i28528# +// Added extra Item (Bool) for chart2 to be able to show reduced line geometry (SDRATTR_3DOBJ_REDUCED_LINE_GEOMETRY) +#define MISC_3D_OBJ_PROPERTIES \ + { OUString(UNO_NAME_3D_DOUBLE_SIDED) ,SDRATTR_3DOBJ_DOUBLE_SIDED , cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_MAT_COLOR) ,SDRATTR_3DOBJ_MAT_COLOR , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_MAT_EMISSION) ,SDRATTR_3DOBJ_MAT_EMISSION , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_MAT_SPECULAR) ,SDRATTR_3DOBJ_MAT_SPECULAR , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_MAT_SPECULAR_INTENSITY) ,SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_NORMALS_INVERT) ,SDRATTR_3DOBJ_NORMALS_INVERT , cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_NORMALS_KIND) ,SDRATTR_3DOBJ_NORMALS_KIND , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_SHADOW_3D) ,SDRATTR_3DOBJ_SHADOW_3D , cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_TEXTURE_FILTER) ,SDRATTR_3DOBJ_TEXTURE_FILTER , cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_TEXTURE_KIND) ,SDRATTR_3DOBJ_TEXTURE_KIND , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_TEXTURE_MODE) ,SDRATTR_3DOBJ_TEXTURE_MODE , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_TEXTURE_PROJ_X) ,SDRATTR_3DOBJ_TEXTURE_PROJ_X , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_TEXTURE_PROJ_Y) ,SDRATTR_3DOBJ_TEXTURE_PROJ_Y , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_REDUCED_LINE_GEOMETRY) ,SDRATTR_3DOBJ_REDUCED_LINE_GEOMETRY , cppu::UnoType::get(), 0, 0}, + +#define SPECIAL_3DCUBEOBJECT_PROPERTIES \ + { OUString(UNO_NAME_3D_TRANSFORM_MATRIX) ,OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_POS) ,OWN_ATTR_3D_VALUE_POSITION , cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_SIZE) ,OWN_ATTR_3D_VALUE_SIZE , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_POS_IS_CENTER) ,OWN_ATTR_3D_VALUE_POS_IS_CENTER , cppu::UnoType::get(), 0, 0}, + +#define SPECIAL_3DSPHEREOBJECT_PROPERTIES \ + { OUString(UNO_NAME_3D_TRANSFORM_MATRIX) ,OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_POS) ,OWN_ATTR_3D_VALUE_POSITION , cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_SIZE) ,OWN_ATTR_3D_VALUE_SIZE , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_HORZ_SEGS) ,SDRATTR_3DOBJ_HORZ_SEGS, ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_VERT_SEGS) ,SDRATTR_3DOBJ_VERT_SEGS, ::cppu::UnoType::get(), 0, 0}, + +// #107245# New 3D properties which are possible for lathe and extrude 3d objects +#define SPECIAL_3DLATHEANDEXTRUDEOBJ_PROPERTIES \ + { OUString(UNO_NAME_3D_SMOOTH_NORMALS) , SDRATTR_3DOBJ_SMOOTH_NORMALS, cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_SMOOTH_LIDS) , SDRATTR_3DOBJ_SMOOTH_LIDS, cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_CHARACTER_MODE) , SDRATTR_3DOBJ_CHARACTER_MODE, cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_CLOSE_FRONT) , SDRATTR_3DOBJ_CLOSE_FRONT, cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_CLOSE_BACK) , SDRATTR_3DOBJ_CLOSE_BACK, cppu::UnoType::get(), 0, 0}, + +#define SPECIAL_3DLATHEOBJECT_PROPERTIES \ + { OUString(UNO_NAME_3D_TRANSFORM_MATRIX) ,OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX,::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_POLYPOLYGON3D) ,OWN_ATTR_3D_VALUE_POLYPOLYGON3D ,::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_LATHE_END_ANGLE) ,SDRATTR_3DOBJ_END_ANGLE ,::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_HORZ_SEGS) ,SDRATTR_3DOBJ_HORZ_SEGS ,::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_PERCENT_DIAGONAL) ,SDRATTR_3DOBJ_PERCENT_DIAGONAL ,::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_VERT_SEGS) ,SDRATTR_3DOBJ_VERT_SEGS ,::cppu::UnoType::get(), 0, 0}, + +#define SPECIAL_3DEXTRUDEOBJECT_PROPERTIES \ + { OUString(UNO_NAME_3D_TRANSFORM_MATRIX) ,OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX,::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_POLYPOLYGON3D) ,OWN_ATTR_3D_VALUE_POLYPOLYGON3D ,::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_EXTRUDE_DEPTH) ,SDRATTR_3DOBJ_DEPTH ,::cppu::UnoType::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { OUString(UNO_NAME_3D_PERCENT_DIAGONAL) ,SDRATTR_3DOBJ_PERCENT_DIAGONAL ,::cppu::UnoType::get(), 0, 0}, + +#define SPECIAL_3DPOLYGONOBJECT_PROPERTIES \ + { OUString(UNO_NAME_3D_TRANSFORM_MATRIX) ,OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX, ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_POLYPOLYGON3D) ,OWN_ATTR_3D_VALUE_POLYPOLYGON3D , ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_NORMALSPOLYGON3D) ,OWN_ATTR_3D_VALUE_NORMALSPOLYGON3D, ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_TEXTUREPOLYGON3D) ,OWN_ATTR_3D_VALUE_TEXTUREPOLYGON3D, ::cppu::UnoType::get(), 0, 0}, \ + { OUString(UNO_NAME_3D_LINEONLY) ,OWN_ATTR_3D_VALUE_LINEONLY , cppu::UnoType::get(), 0, 0}, + +#define SPECIAL_3DBACKSCALE_PROPERTIES \ + { OUString(UNO_NAME_3D_BACKSCALE) ,SDRATTR_3DOBJ_BACKSCALE , ::cppu::UnoType::get(), 0, 0}, \ + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/unoshtxt.hxx b/include/svx/unoshtxt.hxx new file mode 100644 index 000000000..803b2996d --- /dev/null +++ b/include/svx/unoshtxt.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_SVX_UNOSHTXT_HXX +#define INCLUDED_SVX_UNOSHTXT_HXX + +#include +#include +#include + +namespace com::sun::star { + namespace uno { + class XInterface; + } + namespace accessibility { + struct TextSegment; + } +} + +class SvxTextForwarder; +class SdrObject; +class SdrModel; +class SdrView; +class OutputDevice; +class SvxTextEditSourceImpl; +class SdrText; + +class SVXCORE_DLLPUBLIC SvxTextEditSource final : public SvxEditSource, public SvxViewForwarder +{ +public: + SvxTextEditSource( SdrObject* pObj, SdrText* pText ); + + /** Since the views don't broadcast their dying, make sure that + this object gets destroyed if the view becomes invalid + + The window is necessary, since our views can display on multiple windows + */ + SvxTextEditSource( SdrObject& rObj, SdrText* pText, SdrView& rView, const OutputDevice& rViewWindow ); + SvxTextEditSource(const SvxTextEditSource&) = delete; + SvxTextEditSource& operator=(const SvxTextEditSource&) = delete; + virtual ~SvxTextEditSource() override; + + virtual std::unique_ptr Clone() const override; + virtual SvxTextForwarder* GetTextForwarder() override; + virtual SvxViewForwarder* GetViewForwarder() override; + virtual SvxEditViewForwarder* GetEditViewForwarder( bool bCreate = false ) override; + virtual void UpdateData() override; + + virtual void addRange( SvxUnoTextRangeBase* pNewRange ) override; + virtual void removeRange( SvxUnoTextRangeBase* pOldRange ) override; + virtual const SvxUnoTextRangeBaseVec& getRanges() const override; + + virtual SfxBroadcaster& GetBroadcaster() const override; + + void lock(); + void unlock(); + + // the SvxViewForwarder interface + virtual bool IsValid() const override; + virtual Point LogicToPixel( const Point&, const MapMode& ) const override; + virtual Point PixelToLogic( const Point&, const MapMode& ) const override; + + void UpdateOutliner(); + +private: + SVX_DLLPRIVATE SvxTextEditSource( SvxTextEditSourceImpl* pImpl ); + + rtl::Reference mpImpl; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/verttexttbxctrl.hxx b/include/svx/verttexttbxctrl.hxx new file mode 100644 index 000000000..6dc437ec3 --- /dev/null +++ b/include/svx/verttexttbxctrl.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_SVX_VERTTEXTTBXCTRL_HXX +#define INCLUDED_SVX_VERTTEXTTBXCTRL_HXX + +#include + +#include +#include + +#include + +//HACK to avoid duplicate ImplInheritanceHelper symbols with MSVC: +class SAL_DLLPUBLIC_TEMPLATE SvxVertCTLTextTbxCtrl_Base: + public cppu::ImplInheritanceHelper +{ + using ImplInheritanceHelper::ImplInheritanceHelper; +}; + +/* + control to remove/insert cjk settings dependent vertical text toolbox item + */ +class SvxVertCTLTextTbxCtrl : public SvxVertCTLTextTbxCtrl_Base +{ + bool m_bVisible; +public: + explicit SvxVertCTLTextTbxCtrl(const css::uno::Reference& rContext); + + virtual ~SvxVertCTLTextTbxCtrl() override; + + // XInitialization + virtual void SAL_CALL initialize(const css::uno::Sequence& rArguments) override; + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() override = 0; + virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; + + // XStatusListener + virtual void SAL_CALL statusChanged(const css::frame::FeatureStateEvent& rEvent) override; +}; + +class SvxCTLTextTbxCtrl final : public SvxVertCTLTextTbxCtrl +{ +public: + SvxCTLTextTbxCtrl(const css::uno::Reference& rContext); + + virtual OUString SAL_CALL getImplementationName() override; +}; + +class SvxVertTextTbxCtrl final : public SvxVertCTLTextTbxCtrl +{ +public: + SvxVertTextTbxCtrl(const css::uno::Reference& rContext); + + virtual OUString SAL_CALL getImplementationName() override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/view3d.hxx b/include/svx/view3d.hxx new file mode 100644 index 000000000..359b3aa31 --- /dev/null +++ b/include/svx/view3d.hxx @@ -0,0 +1,120 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_VIEW3D_HXX +#define INCLUDED_SVX_VIEW3D_HXX + +#include +#include +#include +#include +#include + +/* + * Forward declarations + */ + +class E3dObject; +class E3dScene; +class Impl3DMirrorConstructOverlay; + +/** + * Derived class of SdrView to edit 3D objects. + */ + +class SVXCORE_DLLPUBLIC E3dView : public SdrView +{ + E3dDefaultAttributes a3DDefaultAttr; + MouseEvent aMouseEvent; // The parameters of the last Events (Mouse, Keyboard) + + // Migrate selections + std::unique_ptr mpMirrorOverlay; + +protected: + void InitView(); + + void ImpCreate3DObject(E3dScene* pScene, SdrObject* pObj, bool bExtrude, double fDepth, basegfx::B2DHomMatrix const & rLatheMat); + void ImpCreateSingle3DObjectFlat(E3dScene* pScene, SdrObject* pObj, bool bExtrude, double fDepth, basegfx::B2DHomMatrix const & rLatheMat); + void ImpChangeSomeAttributesFor3DConversion(SdrObject* pObj); + void ImpChangeSomeAttributesFor3DConversion2(SdrObject* pObj); + + void InitScene(E3dScene* pScene, double fW, double fH, double fCamZ); + void ImpIsConvertTo3DPossible(SdrObject const * pObj, bool& rAny3D, bool& rGroupSelected) const; + void BreakSingle3DObj(E3dObject* pObj); + +public: + E3dView( + SdrModel& rSdrModel, + OutputDevice* pOut); + + virtual ~E3dView() override; + + // Output all marked Objects on the given OutputDevice. + virtual void DrawMarkedObj(OutputDevice& rOut) const override; + + // Access to the default attributes. + E3dDefaultAttributes& Get3DDefaultAttributes() { return a3DDefaultAttr; } + virtual bool BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrHdl* pHdl, short nMinMov = -3, SdrDragMethod* pForcedMeth = nullptr) override; + virtual void CheckPossibilities() override; + + // Get/Set Event + void SetMouseEvent(const MouseEvent& rNew) { aMouseEvent = rNew; } + const MouseEvent& GetMouseEvent() const { return aMouseEvent; } + + // Override getting the model, as we need to supply a Scene together with individual 3D Objects. + virtual std::unique_ptr CreateMarkedObjModel() const override; + + // On Paste: We need to insert the objects of the Scene, but not the Scene itself + using SdrView::Paste; + virtual bool Paste( + const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, SdrInsertFlags nOptions) override; + + // #83403# Service routine used from local Clone() and from SdrCreateView::EndCreateObj(...) + bool ImpCloneAll3DObjectsToDestScene(E3dScene const * pSrcScene, E3dScene* pDstScene, Point aOffset); + + bool IsConvertTo3DObjPossible() const; + void ConvertMarkedObjTo3D(bool bExtrude=true, const basegfx::B2DPoint& rPnt1 = basegfx::B2DPoint(0.0, 0.0), const basegfx::B2DPoint& rPnt2 = basegfx::B2DPoint(0.0, 1.0)); + + // Means to create all Extrudes in a certain depth order. + static void DoDepthArrange(E3dScene const * pScene, double fDepth); + void ConvertMarkedToPolyObj(); + E3dScene* SetCurrent3DObj(E3dObject* p3DObj); + void Start3DCreation(); + + // Migration of overlay + bool Is3DRotationCreationActive() const { return (nullptr != mpMirrorOverlay); } + + virtual void MovAction(const Point& rPnt) override; + void End3DCreation(bool bUseDefaultValuesForMirrorAxes=false); + void ResetCreationActive(); + + double GetDefaultCamPosZ(); + + double GetDefaultCamFocal(); + + bool IsBreak3DObjPossible() const; + void Break3DObj(); + + SfxItemSet Get3DAttributes() const; + void Set3DAttributes(const SfxItemSet& rAttr); +}; + +#endif // INCLUDED_SVX_VIEW3D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/viewlayoutitem.hxx b/include/svx/viewlayoutitem.hxx new file mode 100644 index 000000000..0a5b3ee43 --- /dev/null +++ b/include/svx/viewlayoutitem.hxx @@ -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 INCLUDED_SVX_VIEWLAYOUTITEM_HXX +#define INCLUDED_SVX_VIEWLAYOUTITEM_HXX + +#include +#include +#include + + +class SVX_DLLPUBLIC SvxViewLayoutItem final : public SfxUInt16Item +{ + bool mbBookMode; + +public: + static SfxPoolItem* CreateDefault(); + + SvxViewLayoutItem( sal_uInt16 nColumns = 0, bool bBookMode = false, sal_uInt16 nWhich = SID_ATTR_VIEWLAYOUT ); + SvxViewLayoutItem( const SvxViewLayoutItem& ); + virtual ~SvxViewLayoutItem() override; + + void SetBookMode( bool bNew ) {mbBookMode = bNew; } + bool IsBookMode() const {return mbBookMode; } + + // "purely virtual methods" from the SfxPoolItem + virtual bool operator==( const SfxPoolItem& ) const override; + virtual SvxViewLayoutItem* Clone( SfxItemPool *pPool = nullptr ) const override; + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; // empty + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; // empty +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/viewpt3d.hxx b/include/svx/viewpt3d.hxx new file mode 100644 index 000000000..5d7856bd9 --- /dev/null +++ b/include/svx/viewpt3d.hxx @@ -0,0 +1,95 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_VIEWPT3D_HXX +#define INCLUDED_SVX_VIEWPT3D_HXX + +#include +#include +#include +#include +#include + +// predefines +namespace basegfx { class B3DRange; } // end of namespace basegfx + +/************************************************************************* +|* +|* enums for projection +|* +\************************************************************************/ + +enum class ProjectionType { Parallel, Perspective }; + + +/************************************************************************* +|* +|* 3D viewport according to PHIGS +|* +\************************************************************************/ + +class SVXCORE_DLLPUBLIC Viewport3D +{ + protected: + basegfx::B3DHomMatrix aViewTf; // the real transformations matrix + basegfx::B3DPoint aVRP; // View Reference Point + basegfx::B3DVector aVPN; // View Plane Normal + basegfx::B3DVector aVUV; // View Up Vector + basegfx::B3DPoint aPRP; // Projection Reference Point(View-coordinates) + // up to now only the z-coordinate is considered + + ProjectionType eProjection; // kind of the projection + tools::Rectangle aDeviceRect; // position and size of the output area + + struct + { + double X, Y, W, H; // position and size of the view window + } aViewWin; // in view coordinates + + basegfx::B3DPoint aViewPoint; //observers position in world coordinates; + // is calculated by the transformation + bool bTfValid; // flag, if transformation is valid + + public: + Viewport3D(); + + void SetVRP(const basegfx::B3DPoint& rNewVRP); + void SetVPN(const basegfx::B3DVector& rNewVPN); + void SetVUV(const basegfx::B3DVector& rNewVUV); + void SetPRP(const basegfx::B3DPoint& rNewPRP); + + const basegfx::B3DPoint& GetVRP() const { return aVRP; } + const basegfx::B3DVector& GetVUV() const { return aVUV; } + + void SetProjection(ProjectionType ePrj) + { eProjection = ePrj; bTfValid = false; } + ProjectionType GetProjection() const { return eProjection; } + + void SetViewWindow(double fX, double fY, double fW, double fH); + + void SetDeviceWindow(const tools::Rectangle& rRect); + const tools::Rectangle& GetDeviceWindow() const { return aDeviceRect; } + + // returns observers position in world coordinates + const basegfx::B3DPoint& GetViewPoint(); +}; + +#endif // INCLUDED_SVX_VIEWPT3D_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/weldeditview.hxx b/include/svx/weldeditview.hxx new file mode 100644 index 000000000..4edda521b --- /dev/null +++ b/include/svx/weldeditview.hxx @@ -0,0 +1,87 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + */ + +#ifndef INCLUDED_SVX_WELDEDITVIEW_HXX +#define INCLUDED_SVX_WELDEDITVIEW_HXX + +#include +#include +#include +#include +#include +#include + +class WeldEditAccessible; + +class SVX_DLLPUBLIC WeldEditView : public weld::CustomWidgetController, public EditViewCallbacks +{ +public: + WeldEditView(); + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; + virtual int GetSurroundingText(OUString& rSurrounding) override; + virtual bool DeleteSurroundingText(const Selection& rRange) override; + + void SetText(const OUString& rStr) { m_xEditEngine->SetText(rStr); } + + OUString GetText() const { return m_xEditEngine->GetText(); } + + void SetModifyHdl(const Link& rLink) + { + m_xEditEngine->SetModifyHdl(rLink); + } + + EditEngine& GetEditEngine() { return *m_xEditEngine; } + + virtual ~WeldEditView() override; + +protected: + std::unique_ptr m_xEditEngine; + std::unique_ptr m_xEditView; + rtl::Reference m_xAccessible; + + virtual void makeEditEngine(); + + virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override; + virtual bool MouseMove(const MouseEvent& rMEvt) override; + virtual bool MouseButtonDown(const MouseEvent& rMEvt) override; + virtual bool MouseButtonUp(const MouseEvent& rMEvt) override; + virtual bool KeyInput(const KeyEvent& rKEvt) override; + virtual bool Command(const CommandEvent& rCEvt) override; + virtual void GetFocus() override; + virtual void LoseFocus() override; + virtual void Resize() override; + + virtual css::uno::Reference CreateAccessible() override; + + virtual void EditViewInvalidate(const tools::Rectangle& rRect) override { Invalidate(rRect); } + + virtual void EditViewSelectionChange() override { Invalidate(); } + + virtual OutputDevice& EditViewOutputDevice() const override + { + return GetDrawingArea()->get_ref_device(); + } + + virtual void EditViewInputContext(const InputContext& rInputContext) override + { + SetInputContext(rInputContext); + } + + virtual void EditViewCursorRect(const tools::Rectangle& rRect, int nExtTextInputWidth) override + { + OutputDevice& rRefDevice = EditViewOutputDevice(); + SetCursorRect(rRefDevice.LogicToPixel(rRect), + rRefDevice.LogicToPixel(Size(nExtTextInputWidth, 0)).Width()); + } +}; + +#endif // INCLUDED_SVX_WELDEDITVIEW_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xbitmap.hxx b/include/svx/xbitmap.hxx new file mode 100644 index 000000000..0fff0a5ce --- /dev/null +++ b/include/svx/xbitmap.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_SVX_XBITMAP_HXX +#define INCLUDED_SVX_XBITMAP_HXX + +#include +#include +#include +#include + +class SVXCORE_DLLPUBLIC XOBitmap +{ +private: + std::unique_ptr xGraphicObject; + std::unique_ptr pPixelArray; + Color aPixelColor; + Color aBckgrColor; + bool bGraphicDirty; + + const GraphicObject& GetGraphicObject() const; + + XOBitmap(const XOBitmap& rXBmp) = delete; + XOBitmap& operator=(const XOBitmap& rXOBitmap) = delete; + + +public: + XOBitmap( const BitmapEx& rBitmap ); + ~XOBitmap(); + + void Bitmap2Array(); + void Array2Bitmap(); + + void SetPixelColor( const Color& rColor ) { aPixelColor = rColor; bGraphicDirty = true; } + void SetBackgroundColor( const Color& rColor ) { aBckgrColor = rColor; bGraphicDirty = true; } + + BitmapEx GetBitmap() const; + const Color& GetBackgroundColor() const { return aBckgrColor; } +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xbtmpit.hxx b/include/svx/xbtmpit.hxx new file mode 100644 index 000000000..bfc67952c --- /dev/null +++ b/include/svx/xbtmpit.hxx @@ -0,0 +1,67 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_XBTMPIT_HXX +#define INCLUDED_SVX_XBTMPIT_HXX + +#include +#include +#include +#include + +class SdrModel; + + +class SVXCORE_DLLPUBLIC XFillBitmapItem : public NameOrIndex +{ +private: + GraphicObject maGraphicObject; + +public: + static SfxPoolItem* CreateDefault(); + XFillBitmapItem() : NameOrIndex(XATTR_FILLBITMAP, -1 ) {} + XFillBitmapItem(const OUString& rName, const GraphicObject& rGraphicObject); + XFillBitmapItem( const GraphicObject& rGraphicObject ); + XFillBitmapItem( const XFillBitmapItem& rItem ); + + virtual bool operator==( const SfxPoolItem& rItem ) const override; + // no idea why, but this item does not play nice with the sorting optimisation, get failures in sd_import_tests + virtual bool IsSortable() const override { return false; } + virtual XFillBitmapItem* Clone( SfxItemPool* pPool = nullptr ) const override; + + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + + const GraphicObject& GetGraphicObject() const { return maGraphicObject;} + bool isPattern() const; + + static bool CompareValueFunc( const NameOrIndex* p1, const NameOrIndex* p2 ); + std::unique_ptr checkForUniqueItem( SdrModel* pModel ) const; + + virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xcolit.hxx b/include/svx/xcolit.hxx new file mode 100644 index 000000000..12788d6fa --- /dev/null +++ b/include/svx/xcolit.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_SVX_XCOLIT_HXX +#define INCLUDED_SVX_XCOLIT_HXX + +#include +#include + +#include + +class XColorList; + + + +class SVXCORE_DLLPUBLIC XColorItem : public NameOrIndex +{ + Color aColor; + +public: + static SfxPoolItem* CreateDefault(); + XColorItem() {} + XColorItem(sal_uInt16 nWhich, sal_Int32 nIndex, const Color& rTheColor); + + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + XColorItem(sal_uInt16 nWhich, const Color& rTheColor); + XColorItem(sal_uInt16 nWhich, const OUString& rName, const Color& rTheColor); + XColorItem(const XColorItem& rItem); + + virtual bool operator==(const SfxPoolItem& rItem) const override; + virtual XColorItem* Clone(SfxItemPool* pPool = nullptr) const override; + + const Color& GetColorValue() const; + void SetColorValue(const Color& rNew) { aColor = rNew; Detach(); } +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xdash.hxx b/include/svx/xdash.hxx new file mode 100644 index 000000000..e1fca6b67 --- /dev/null +++ b/include/svx/xdash.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_SVX_XDASH_HXX +#define INCLUDED_SVX_XDASH_HXX + + + + +#include +#include + +#include + +class SVXCORE_DLLPUBLIC XDash final +{ + css::drawing::DashStyle eDash; + sal_uInt32 nDotLen; + sal_uInt16 nDots; + sal_uInt16 nDashes; + sal_uInt32 nDashLen; + sal_uInt32 nDistance; + +public: + XDash(css::drawing::DashStyle eDash = css::drawing::DashStyle_RECT, + sal_uInt16 nDots = 1, sal_uInt32 nDotLen = 20, + sal_uInt16 nDashes = 1, sal_uInt32 nDashLen = 20, sal_uInt32 nDistance = 20); + + bool operator==(const XDash& rDash) const; + + void SetDashStyle(css::drawing::DashStyle eNewStyle) { eDash = eNewStyle; } + void SetDots(sal_uInt16 nNewDots) { nDots = nNewDots; } + void SetDotLen(sal_uInt32 nNewDotLen) { nDotLen = nNewDotLen; } + void SetDashes(sal_uInt16 nNewDashes) { nDashes = nNewDashes; } + void SetDashLen(sal_uInt32 nNewDashLen) { nDashLen = nNewDashLen; } + void SetDistance(sal_uInt32 nNewDistance) { nDistance = nNewDistance; } + + css::drawing::DashStyle GetDashStyle() const { return eDash; } + sal_uInt16 GetDots() const { return nDots; } + sal_uInt32 GetDotLen() const { return nDotLen; } + sal_uInt16 GetDashes() const { return nDashes; } + sal_uInt32 GetDashLen() const { return nDashLen; } + sal_uInt32 GetDistance() const { return nDistance; } + + // XDash is translated into an array of doubles which describe the lengths of the + // dashes, dots and empty passages. It returns the complete length of the full DashDot + // sequence and fills the given vetor of doubles accordingly (also resizing, so deleting it). + double CreateDotDashArray(::std::vector< double >& rDotDashArray, double fLineWidth) const; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xdef.hxx b/include/svx/xdef.hxx new file mode 100644 index 000000000..e7740ee15 --- /dev/null +++ b/include/svx/xdef.hxx @@ -0,0 +1,149 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_XDEF_HXX +#define INCLUDED_SVX_XDEF_HXX + + +#include + +/************************************************************************* +|* +|* Adding an attribute: Copy line, above which you want to add something, +|* change the label and add it at the end of the following line, too +|* +\************************************************************************/ + +class SfxMetricItem; +class XFillAttrSetItem; +class XFillBackgroundItem; +class XFillBitmapItem; +class XFillBmpPosItem; +class XFillBmpPosOffsetXItem; +class XFillBmpPosOffsetYItem; +class XFillBmpSizeLogItem; +class XFillBmpSizeYItem; +class XFillBmpStretchItem; +class XFillBmpTileItem; +class XFillBmpTileOffsetXItem; +class XFillBmpTileOffsetYItem; +class XFillColorItem; +class XFillFloatTransparenceItem; +class XFillGradientItem; +class XFillHatchItem; +class XFillStyleItem; +class XFillTransparenceItem; +class XFormTextAdjustItem; +class XFormTextDistanceItem; +class XFormTextHideFormItem; +class XFormTextMirrorItem; +class XFormTextOutlineItem; +class XFormTextShadowColorItem; +class XFormTextShadowItem; +class XFormTextShadowTranspItem; +class XFormTextShadowXValItem; +class XFormTextShadowYValItem; +class XFormTextStartItem; +class XFormTextStyleItem; +class XGradientStepCountItem; +class XLineAttrSetItem; +class XLineCapItem; +class XLineColorItem; +class XLineDashItem; +class XLineEndCenterItem; +class XLineEndItem; +class XLineEndWidthItem; +class XLineJointItem; +class XLineStartCenterItem; +class XLineStartItem; +class XLineStartWidthItem; +class XLineStyleItem; +class XLineTransparenceItem; +class XLineWidthItem; +class XSecondaryFillColorItem; + +#define COL_DEFAULT_FONT ::Color(0xC9211E) // dark red 2 +#define COL_DEFAULT_FRAMELINE ::Color(0x2A6099) // blue +#define COL_DEFAULT_HIGHLIGHT ::Color(0xFFFF00) // yellow +#define COL_DEFAULT_SHAPE_FILLING ::Color(0x729fcf) // light blue 2 +#define COL_DEFAULT_SHAPE_STROKE ::Color(0x3465a4) // dark blue 1 + +constexpr sal_uInt16 XATTR_START = 1000; + +constexpr sal_uInt16 XATTR_LINE_FIRST (XATTR_START); /* V3: 1000 V2: 1000 */ +constexpr TypedWhichId XATTR_LINESTYLE (XATTR_LINE_FIRST); +constexpr TypedWhichId XATTR_LINEDASH (XATTR_LINE_FIRST + 1); /* V3: 1001 V2: 1001 */ +constexpr TypedWhichId XATTR_LINEWIDTH (XATTR_LINE_FIRST + 2); /* V3: 1002 V2: 1002 */ +constexpr TypedWhichId XATTR_LINECOLOR (XATTR_LINE_FIRST + 3); /* V3: 1003 V2: 1003 */ +constexpr TypedWhichId XATTR_LINESTART (XATTR_LINE_FIRST + 4); /* V3: 1004 V2: 1004 */ +constexpr TypedWhichId XATTR_LINEEND (XATTR_LINE_FIRST + 5); /* V3: 1005 V2: 1005 */ +constexpr TypedWhichId XATTR_LINESTARTWIDTH (XATTR_LINE_FIRST + 6); /* V3: 1006 V2: 1006 */ +constexpr TypedWhichId XATTR_LINEENDWIDTH (XATTR_LINE_FIRST + 7); /* V3: 1007 V2: 1007 */ +constexpr TypedWhichId XATTR_LINESTARTCENTER (XATTR_LINE_FIRST + 8); /* V3: 1008 V2: 1008 */ +constexpr TypedWhichId XATTR_LINEENDCENTER (XATTR_LINE_FIRST + 9); /* V3: 1009 V2: 1009 */ +constexpr TypedWhichId XATTR_LINETRANSPARENCE (XATTR_LINE_FIRST + 10); /* V3: 1010 V2: 1010 */ +constexpr TypedWhichId XATTR_LINEJOINT (XATTR_LINE_FIRST + 11); /* V3: 1011 V2: 1011 */ +constexpr TypedWhichId XATTR_LINECAP (XATTR_LINE_FIRST + 12); /* V3: 1012 */ +constexpr sal_uInt16 XATTR_LINE_LAST (XATTR_LINECAP); +constexpr TypedWhichId XATTRSET_LINE (XATTR_LINE_LAST + 1); /* V3: 1017 V2: 1017 */ + +constexpr sal_uInt16 XATTR_FILL_FIRST (XATTRSET_LINE + 1); /* V3: 1018 V2: 1018 */ +constexpr TypedWhichId XATTR_FILLSTYLE (XATTR_FILL_FIRST); +constexpr TypedWhichId XATTR_FILLCOLOR (XATTR_FILL_FIRST + 1); /* V3: 1019 V2: 1019 */ +constexpr TypedWhichId XATTR_FILLGRADIENT (XATTR_FILL_FIRST + 2); /* V3: 1020 V2: 1020 */ +constexpr TypedWhichId XATTR_FILLHATCH (XATTR_FILL_FIRST + 3); /* V3: 1021 V2: 1021 */ +constexpr TypedWhichId XATTR_FILLBITMAP (XATTR_FILL_FIRST + 4); /* V3: 1022 V2: 1022 */ +constexpr TypedWhichId XATTR_FILLTRANSPARENCE (XATTR_FILL_FIRST + 5); /* V3: 1023 V2: 1023 */ +constexpr TypedWhichId XATTR_GRADIENTSTEPCOUNT (XATTR_FILL_FIRST + 6); /* V3: 1024 V2: 1024 */ +constexpr TypedWhichId XATTR_FILLBMP_TILE (XATTR_FILL_FIRST + 7); /* V3: 1025 V2: 1025 */ +constexpr TypedWhichId XATTR_FILLBMP_POS (XATTR_FILL_FIRST + 8); /* V3: 1026 V2: 1026 */ +constexpr TypedWhichId XATTR_FILLBMP_SIZEX (XATTR_FILL_FIRST + 9); /* V3: 1027 V2: 1027 */ +constexpr TypedWhichId XATTR_FILLBMP_SIZEY (XATTR_FILL_FIRST + 10); /* V3: 1028 V2: 1028 */ +constexpr TypedWhichId XATTR_FILLFLOATTRANSPARENCE (XATTR_FILL_FIRST + 11); /* V3: 1029 V2: 1029 */ +constexpr TypedWhichId XATTR_SECONDARYFILLCOLOR (XATTR_FILL_FIRST + 12); /* V3: 1030 */ +constexpr TypedWhichId XATTR_FILLBMP_SIZELOG (XATTR_FILL_FIRST + 13); /* V3: 1031 */ +constexpr TypedWhichId XATTR_FILLBMP_TILEOFFSETX (XATTR_FILL_FIRST + 14); /* V3: 1032 */ +constexpr TypedWhichId XATTR_FILLBMP_TILEOFFSETY (XATTR_FILL_FIRST + 15); /* V3: 1033 */ +constexpr TypedWhichId XATTR_FILLBMP_STRETCH (XATTR_FILL_FIRST + 16); /* V3: 1034 */ +constexpr TypedWhichId XATTR_FILLBMP_POSOFFSETX (XATTR_FILL_FIRST + 17); /* V3: 1041 */ +constexpr TypedWhichId XATTR_FILLBMP_POSOFFSETY (XATTR_FILL_FIRST + 18); /* V3: 1042 */ +constexpr TypedWhichId XATTR_FILLBACKGROUND (XATTR_FILL_FIRST + 19); /* V3: 1043 */ +constexpr sal_uInt16 XATTR_FILL_LAST (XATTR_FILLBACKGROUND); +constexpr TypedWhichId XATTRSET_FILL (XATTR_FILL_LAST + 1); /* V3: 1047 V2: 1030 */ + +constexpr sal_uInt16 XATTR_TEXT_FIRST (XATTRSET_FILL + 1); +constexpr TypedWhichId XATTR_FORMTXTSTYLE (XATTR_TEXT_FIRST); /* V3: 1048 V2: 1031 */ +constexpr TypedWhichId XATTR_FORMTXTADJUST (XATTR_TEXT_FIRST + 1); /* V3: 1049 V2: 1032 */ +constexpr TypedWhichId XATTR_FORMTXTDISTANCE (XATTR_TEXT_FIRST + 2); /* V3: 1050 V2: 1033 */ +constexpr TypedWhichId XATTR_FORMTXTSTART (XATTR_TEXT_FIRST + 3); /* V3: 1051 V2: 1034 */ +constexpr TypedWhichId XATTR_FORMTXTMIRROR (XATTR_TEXT_FIRST + 4); /* V3: 1052 V2: 1035 */ +constexpr TypedWhichId XATTR_FORMTXTOUTLINE (XATTR_TEXT_FIRST + 5); /* V3: 1053 V2: 1036 */ +constexpr TypedWhichId XATTR_FORMTXTSHADOW (XATTR_TEXT_FIRST + 6); /* V3: 1054 V2: 1037 */ +constexpr TypedWhichId XATTR_FORMTXTSHDWCOLOR (XATTR_TEXT_FIRST + 7); /* V3: 1055 V2: 1038 */ +constexpr TypedWhichId XATTR_FORMTXTSHDWXVAL (XATTR_TEXT_FIRST + 8); /* V3: 1056 V2: 1039 */ +constexpr TypedWhichId XATTR_FORMTXTSHDWYVAL (XATTR_TEXT_FIRST + 9); /* V3: 1057 V2: 1040 */ +constexpr TypedWhichId XATTR_FORMTXTHIDEFORM (XATTR_TEXT_FIRST + 10); /* V3: 1059 V2: 1042 */ +constexpr TypedWhichId XATTR_FORMTXTSHDWTRANSP (XATTR_TEXT_FIRST + 11); /* V3: 1060 V2: 1043 */ +constexpr sal_uInt16 XATTR_TEXT_LAST (XATTR_FORMTXTSHDWTRANSP); + +constexpr sal_uInt16 XATTR_END = XATTR_TEXT_LAST; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xenum.hxx b/include/svx/xenum.hxx new file mode 100644 index 000000000..f3620bdfa --- /dev/null +++ b/include/svx/xenum.hxx @@ -0,0 +1,31 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_XENUM_HXX +#define INCLUDED_SVX_XENUM_HXX + + +enum class XFormTextStyle { Rotate, Upright, SlantX, SlantY, NONE }; +enum class XFormTextAdjust { Left, Right, AutoSize, Center }; +enum class XFormTextShadow { NONE, Normal, Slant }; + + +#endif // INCLUDED_SVX_XENUM_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xfillit0.hxx b/include/svx/xfillit0.hxx new file mode 100644 index 000000000..9f7cf9079 --- /dev/null +++ b/include/svx/xfillit0.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_SVX_XFILLIT0_HXX +#define INCLUDED_SVX_XFILLIT0_HXX + +#include + +#include +#include + + + + +class SVXCORE_DLLPUBLIC XFillStyleItem final : public SfxEnumItem +{ +public: + static SfxPoolItem* CreateDefault(); + + XFillStyleItem(css::drawing::FillStyle = css::drawing::FillStyle_SOLID); + + virtual XFillStyleItem* Clone(SfxItemPool* pPool = nullptr) const override; + + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + virtual sal_uInt16 GetValueCount() const override; + + void dumpAsXml(xmlTextWriterPtr pWriter) const override; + virtual boost::property_tree::ptree dumpAsJSON() const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xflasit.hxx b/include/svx/xflasit.hxx new file mode 100644 index 000000000..59a5c7e3d --- /dev/null +++ b/include/svx/xflasit.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_SVX_XFLASIT_HXX +#define INCLUDED_SVX_XFLASIT_HXX + +#include + +#include + +#include +#include + +// SetItem with all ItemSets of fill-attributes +class SVXCORE_DLLPUBLIC XFillAttrSetItem final : public SfxSetItem +{ +public: + XFillAttrSetItem(std::unique_ptr&& pItemSet ); + XFillAttrSetItem(SfxItemPool* pItemPool); + XFillAttrSetItem(const XFillAttrSetItem& rAttr); + XFillAttrSetItem(const XFillAttrSetItem& rAttr, + SfxItemPool* pItemPool); + virtual XFillAttrSetItem* Clone( SfxItemPool* pToPool = nullptr ) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xflbckit.hxx b/include/svx/xflbckit.hxx new file mode 100644 index 000000000..4033e6796 --- /dev/null +++ b/include/svx/xflbckit.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_SVX_XFLBCKIT_HXX +#define INCLUDED_SVX_XFLBCKIT_HXX + +#include +#include + +/************************************************************************* +|* +|* Item to enable background for filled objects +|* +\************************************************************************/ + +class SVXCORE_DLLPUBLIC XFillBackgroundItem final : public SfxBoolItem +{ +public: + XFillBackgroundItem( bool bFill = false ); + + SVX_DLLPRIVATE virtual XFillBackgroundItem* Clone( SfxItemPool* pPool = nullptr ) const override; + + SVX_DLLPRIVATE virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xflbmpit.hxx b/include/svx/xflbmpit.hxx new file mode 100644 index 000000000..ca7c739a7 --- /dev/null +++ b/include/svx/xflbmpit.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_SVX_XFLBMPIT_HXX +#define INCLUDED_SVX_XFLBMPIT_HXX + +#include +#include +#include + +class SVXCORE_DLLPUBLIC XFillBmpPosItem final : public SfxEnumItem +{ +public: + XFillBmpPosItem( RectPoint eRP = RectPoint::MM ); + + SVX_DLLPRIVATE virtual XFillBmpPosItem* Clone( SfxItemPool* pPool = nullptr ) const override; + + SVX_DLLPRIVATE virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + + SVX_DLLPRIVATE virtual sal_uInt16 GetValueCount() const override; + void dumpAsXml(xmlTextWriterPtr pWriter) const override; +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xflbmsli.hxx b/include/svx/xflbmsli.hxx new file mode 100644 index 000000000..9fb283bab --- /dev/null +++ b/include/svx/xflbmsli.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_SVX_XFLBMSLI_HXX +#define INCLUDED_SVX_XFLBMSLI_HXX + +#include +#include + +class SVXCORE_DLLPUBLIC XFillBmpSizeLogItem final : public SfxBoolItem +{ +public: + XFillBmpSizeLogItem( bool bLog = true ); + + SVX_DLLPRIVATE virtual XFillBmpSizeLogItem* Clone( SfxItemPool* pPool = nullptr ) const override; + + SVX_DLLPRIVATE virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xflbmsxy.hxx b/include/svx/xflbmsxy.hxx new file mode 100644 index 000000000..d5c9769a3 --- /dev/null +++ b/include/svx/xflbmsxy.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_SVX_XFLBMSXY_HXX +#define INCLUDED_SVX_XFLBMSXY_HXX + +#include +#include + +class SVXCORE_DLLPUBLIC XFillBmpSizeXItem final : public SfxMetricItem +{ +public: + XFillBmpSizeXItem( long nSizeX = 0 ); + + SVX_DLLPRIVATE virtual XFillBmpSizeXItem* Clone( SfxItemPool* pPool = nullptr ) const override; + + SVX_DLLPRIVATE virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + // This item records both metrical and percentage quotation (negative); + // We have to consider that. + SVX_DLLPRIVATE virtual bool HasMetrics() const override; +}; + +class SVXCORE_DLLPUBLIC XFillBmpSizeYItem final : public SfxMetricItem +{ +public: + XFillBmpSizeYItem( long nSizeY = 0 ); + + SVX_DLLPRIVATE virtual XFillBmpSizeYItem* Clone( SfxItemPool* pPool = nullptr ) const override; + + SVX_DLLPRIVATE virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + // This item records both metrical and percentage quotation (negative); + // We have to consider that. + SVX_DLLPRIVATE virtual bool HasMetrics() const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xflbmtit.hxx b/include/svx/xflbmtit.hxx new file mode 100644 index 000000000..ab92eca97 --- /dev/null +++ b/include/svx/xflbmtit.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_SVX_XFLBMTIT_HXX +#define INCLUDED_SVX_XFLBMTIT_HXX + +#include +#include + +class SVXCORE_DLLPUBLIC XFillBmpTileItem final : public SfxBoolItem +{ +public: + XFillBmpTileItem( bool bTile = true ); + + virtual XFillBmpTileItem* Clone( SfxItemPool* pPool = nullptr ) const override; + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + void dumpAsXml(xmlTextWriterPtr pWriter) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xflboxy.hxx b/include/svx/xflboxy.hxx new file mode 100644 index 000000000..54d354b52 --- /dev/null +++ b/include/svx/xflboxy.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_SVX_XFLBOXY_HXX +#define INCLUDED_SVX_XFLBOXY_HXX + +#include +#include + +class SVXCORE_DLLPUBLIC XFillBmpPosOffsetXItem final : public SfxUInt16Item +{ +public: + XFillBmpPosOffsetXItem( sal_uInt16 nOffPosX = 0 ); + + SVX_DLLPRIVATE virtual XFillBmpPosOffsetXItem* Clone( SfxItemPool* pPool = nullptr ) const override; + + SVX_DLLPRIVATE virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; +}; + +class SVXCORE_DLLPUBLIC XFillBmpPosOffsetYItem final : public SfxUInt16Item +{ +public: + XFillBmpPosOffsetYItem( sal_uInt16 nOffPosY = 0 ); + + SVX_DLLPRIVATE virtual XFillBmpPosOffsetYItem* Clone( SfxItemPool* pPool = nullptr ) const override; + + SVX_DLLPRIVATE virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xflbstit.hxx b/include/svx/xflbstit.hxx new file mode 100644 index 000000000..3d3f3b28e --- /dev/null +++ b/include/svx/xflbstit.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_SVX_XFLBSTIT_HXX +#define INCLUDED_SVX_XFLBSTIT_HXX + +#include +#include + +class SVXCORE_DLLPUBLIC XFillBmpStretchItem final : public SfxBoolItem +{ +public: + XFillBmpStretchItem( bool bStretch = true ); + + virtual XFillBmpStretchItem* Clone( SfxItemPool* pPool = nullptr ) const override; + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + void dumpAsXml(xmlTextWriterPtr pWriter) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xflbtoxy.hxx b/include/svx/xflbtoxy.hxx new file mode 100644 index 000000000..b561ab775 --- /dev/null +++ b/include/svx/xflbtoxy.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_SVX_XFLBTOXY_HXX +#define INCLUDED_SVX_XFLBTOXY_HXX + +#include +#include + +class SVXCORE_DLLPUBLIC XFillBmpTileOffsetXItem final : public SfxUInt16Item +{ +public: + XFillBmpTileOffsetXItem( sal_uInt16 nOffX = 0 ); + + SVX_DLLPRIVATE virtual XFillBmpTileOffsetXItem* Clone( SfxItemPool* pPool = nullptr ) const override; + + SVX_DLLPRIVATE virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; +}; + +class SVXCORE_DLLPUBLIC XFillBmpTileOffsetYItem final : public SfxUInt16Item +{ +public: + XFillBmpTileOffsetYItem( sal_uInt16 nOffX = 0 ); + + SVX_DLLPRIVATE virtual XFillBmpTileOffsetYItem* Clone( SfxItemPool* pPool = nullptr ) const override; + + SVX_DLLPRIVATE virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xflclit.hxx b/include/svx/xflclit.hxx new file mode 100644 index 000000000..df6b302d3 --- /dev/null +++ b/include/svx/xflclit.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_SVX_XFLCLIT_HXX +#define INCLUDED_SVX_XFLCLIT_HXX + +#include +#include + +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +// Fuellattribute +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + + + +class SVXCORE_DLLPUBLIC XFillColorItem final : public XColorItem +{ +public: + static SfxPoolItem* CreateDefault(); + XFillColorItem() {} + XFillColorItem(sal_Int32 nIndex, const Color& rTheColor); + XFillColorItem(const OUString& rName, const Color& rTheColor); + + virtual XFillColorItem* Clone(SfxItemPool* pPool = nullptr) const override; + + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + + void dumpAsXml(xmlTextWriterPtr pWriter) const override; + virtual boost::property_tree::ptree dumpAsJSON() const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xflftrit.hxx b/include/svx/xflftrit.hxx new file mode 100644 index 000000000..e33b57e0f --- /dev/null +++ b/include/svx/xflftrit.hxx @@ -0,0 +1,63 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_XFLFTRIT_HXX +#define INCLUDED_SVX_XFLFTRIT_HXX + +#include +#include +#include + + + + +class SVXCORE_DLLPUBLIC XFillFloatTransparenceItem : public XFillGradientItem +{ +private: + + bool bEnabled; + +public: + + static SfxPoolItem* CreateDefault(); + XFillFloatTransparenceItem(); + XFillFloatTransparenceItem(const OUString& rName, const XGradient& rGradient, bool bEnable = true ); + XFillFloatTransparenceItem( const XGradient& rTheGradient, bool bEnable = true ); + XFillFloatTransparenceItem( const XFillFloatTransparenceItem& rItem ); + + virtual bool operator==( const SfxPoolItem& rItem ) const override; + virtual XFillFloatTransparenceItem* Clone( SfxItemPool* pPool = nullptr ) const override; + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + virtual bool GetPresentation( SfxItemPresentation ePres, MapUnit eCoreMetric, + MapUnit ePresMetric, OUString &rText, const IntlWrapper& rIntlWrapper ) const override; + + bool IsEnabled() const { return bEnabled; } + void SetEnabled( bool bEnable ) { bEnabled = bEnable; } + + static bool CompareValueFunc( const NameOrIndex* p1, const NameOrIndex* p2 ); + std::unique_ptr checkForUniqueItem( SdrModel* pModel ) const; + + virtual boost::property_tree::ptree dumpAsJSON() const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xflgrit.hxx b/include/svx/xflgrit.hxx new file mode 100644 index 000000000..01268edd0 --- /dev/null +++ b/include/svx/xflgrit.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_SVX_XFLGRIT_HXX +#define INCLUDED_SVX_XFLGRIT_HXX + +#include +#include +#include +#include + +class SdrModel; + + + +class SVXCORE_DLLPUBLIC XFillGradientItem : public NameOrIndex +{ + XGradient aGradient; + +public: + static SfxPoolItem* CreateDefault(); + XFillGradientItem() : NameOrIndex(XATTR_FILLGRADIENT, -1) {} + XFillGradientItem(sal_Int32 nIndex, const XGradient& rTheGradient); + XFillGradientItem(const OUString& rName, const XGradient& rTheGradient, sal_uInt16 nWhich = XATTR_FILLGRADIENT); + XFillGradientItem(const XGradient& rTheGradient); + XFillGradientItem(const XFillGradientItem& rItem); + + virtual bool operator==(const SfxPoolItem& rItem) const override; + virtual XFillGradientItem* Clone(SfxItemPool* pPool = nullptr) const override; + + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + const XGradient& GetGradientValue() const; // GetValue -> GetGradientValue + void SetGradientValue(const XGradient& rNew) { aGradient = rNew; Detach(); } // SetValue -> SetGradientValue + + static bool CompareValueFunc( const NameOrIndex* p1, const NameOrIndex* p2 ); + std::unique_ptr checkForUniqueItem( SdrModel* pModel ) const; + + virtual boost::property_tree::ptree dumpAsJSON() const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xflhtit.hxx b/include/svx/xflhtit.hxx new file mode 100644 index 000000000..b3dcb2b04 --- /dev/null +++ b/include/svx/xflhtit.hxx @@ -0,0 +1,63 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_XFLHTIT_HXX +#define INCLUDED_SVX_XFLHTIT_HXX + +#include +#include +#include +#include + +class SdrModel; + + + +class SVXCORE_DLLPUBLIC XFillHatchItem : public NameOrIndex +{ + XHatch aHatch; + +public: + static SfxPoolItem* CreateDefault(); + XFillHatchItem() : NameOrIndex(XATTR_FILLHATCH, -1) {} + XFillHatchItem(const OUString& rName, const XHatch& rTheHatch); + XFillHatchItem(const XHatch& rTheHatch); + XFillHatchItem(const XFillHatchItem& rItem); + + virtual bool operator==(const SfxPoolItem& rItem) const override; + virtual XFillHatchItem* Clone(SfxItemPool* pPool = nullptr) const override; + + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + virtual bool HasMetrics() const override; + virtual void ScaleMetrics(long nMul, long nDiv) override; + + const XHatch& GetHatchValue() const { return aHatch;} // GetValue -> GetHatchValue + + static bool CompareValueFunc( const NameOrIndex* p1, const NameOrIndex* p2 ); + std::unique_ptr checkForUniqueItem( SdrModel* pModel ) const; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xfltrit.hxx b/include/svx/xfltrit.hxx new file mode 100644 index 000000000..55128b495 --- /dev/null +++ b/include/svx/xfltrit.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_SVX_XFLTRIT_HXX +#define INCLUDED_SVX_XFLTRIT_HXX + +#include +#include + +/************************************************************************* +|* +|* transparency-Item for contents (Solid) +|* +\************************************************************************/ + +class SVXCORE_DLLPUBLIC XFillTransparenceItem final : public SfxUInt16Item +{ +public: + XFillTransparenceItem(sal_uInt16 nFillTransparence = 0); + virtual XFillTransparenceItem* Clone(SfxItemPool* pPool = nullptr) const override; + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + void dumpAsXml(xmlTextWriterPtr pWriter) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xftadit.hxx b/include/svx/xftadit.hxx new file mode 100644 index 000000000..27773a49d --- /dev/null +++ b/include/svx/xftadit.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_SVX_XFTADIT_HXX +#define INCLUDED_SVX_XFTADIT_HXX + +#include +#include +#include + +/************************************************************************* +|* +|* FormText-AdjustItem +|* +\************************************************************************/ + +class SVXCORE_DLLPUBLIC XFormTextAdjustItem final : public SfxEnumItem +{ +public: + static SfxPoolItem* CreateDefault(); + + XFormTextAdjustItem(XFormTextAdjust = XFormTextAdjust::Center); + virtual XFormTextAdjustItem* Clone(SfxItemPool* pPool = nullptr) const override; + virtual sal_uInt16 GetValueCount() const override; + // #FontWork# + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xftdiit.hxx b/include/svx/xftdiit.hxx new file mode 100644 index 000000000..516d219a0 --- /dev/null +++ b/include/svx/xftdiit.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_SVX_XFTDIIT_HXX +#define INCLUDED_SVX_XFTDIIT_HXX + +#include +#include + +/************************************************************************* +|* +|* FormText-DistanceItem +|* +\************************************************************************/ + +class SVXCORE_DLLPUBLIC XFormTextDistanceItem final : public SfxMetricItem +{ +public: + static SfxPoolItem* CreateDefault(); + XFormTextDistanceItem(long nDist = 0); + virtual XFormTextDistanceItem* Clone(SfxItemPool* pPool = nullptr) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xftmrit.hxx b/include/svx/xftmrit.hxx new file mode 100644 index 000000000..3cac10212 --- /dev/null +++ b/include/svx/xftmrit.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_SVX_XFTMRIT_HXX +#define INCLUDED_SVX_XFTMRIT_HXX + +#include +#include + +/************************************************************************* +|* +|* FormText-MirrorItem +|* +\************************************************************************/ + +class SVXCORE_DLLPUBLIC XFormTextMirrorItem final : public SfxBoolItem +{ +public: + static SfxPoolItem* CreateDefault(); + XFormTextMirrorItem(bool bMirror = false); + virtual XFormTextMirrorItem* Clone(SfxItemPool* pPool = nullptr) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xftouit.hxx b/include/svx/xftouit.hxx new file mode 100644 index 000000000..2225e3552 --- /dev/null +++ b/include/svx/xftouit.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_SVX_XFTOUIT_HXX +#define INCLUDED_SVX_XFTOUIT_HXX + +#include +#include +#include + +/************************************************************************* +|* +|* FormText-OutlineItem +|* +\************************************************************************/ + +class SVXCORE_DLLPUBLIC XFormTextOutlineItem final : public SfxBoolItem +{ +public: + static SfxPoolItem* CreateDefault(); + + XFormTextOutlineItem(bool bOutline = false); + virtual XFormTextOutlineItem* Clone(SfxItemPool* pPool = nullptr) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xftshcit.hxx b/include/svx/xftshcit.hxx new file mode 100644 index 000000000..d0adcbf22 --- /dev/null +++ b/include/svx/xftshcit.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_SVX_XFTSHCIT_HXX +#define INCLUDED_SVX_XFTSHCIT_HXX + +#include +#include + +/************************************************************************* +|* +|* FormText-ShadowColorItem +|* +\************************************************************************/ + +class SVXCORE_DLLPUBLIC XFormTextShadowColorItem final : public XColorItem +{ +public: + static SfxPoolItem* CreateDefault(); + XFormTextShadowColorItem() {} + XFormTextShadowColorItem(const OUString& rName, const Color& rTheColor); + + virtual XFormTextShadowColorItem* Clone(SfxItemPool* pPool = nullptr) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xftshit.hxx b/include/svx/xftshit.hxx new file mode 100644 index 000000000..e951a6908 --- /dev/null +++ b/include/svx/xftshit.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_SVX_XFTSHIT_HXX +#define INCLUDED_SVX_XFTSHIT_HXX + +#include +#include +#include + +/************************************************************************* +|* +|* FormText-ShadowItem +|* +\************************************************************************/ + +class SVXCORE_DLLPUBLIC XFormTextShadowItem final : public SfxEnumItem +{ +public: + static SfxPoolItem* CreateDefault(); + + XFormTextShadowItem(XFormTextShadow = XFormTextShadow::NONE); + virtual XFormTextShadowItem* Clone(SfxItemPool* pPool = nullptr) const override; + virtual sal_uInt16 GetValueCount() const override; + // #FontWork# + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xftshxy.hxx b/include/svx/xftshxy.hxx new file mode 100644 index 000000000..1a3d7c19b --- /dev/null +++ b/include/svx/xftshxy.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_SVX_XFTSHXY_HXX +#define INCLUDED_SVX_XFTSHXY_HXX + +#include +#include + +/************************************************************************* +|* +|* FormText-ShadowXValItem +|* +\************************************************************************/ + +class SVXCORE_DLLPUBLIC XFormTextShadowXValItem final : public SfxMetricItem +{ +public: + static SfxPoolItem* CreateDefault(); + + XFormTextShadowXValItem(long nVal = 0); + virtual XFormTextShadowXValItem* Clone(SfxItemPool* pPool = nullptr) const override; +}; + +/************************************************************************* +|* +|* FormText-ShadowYValItem +|* +\************************************************************************/ + +class SVXCORE_DLLPUBLIC XFormTextShadowYValItem final : public SfxMetricItem +{ +public: + static SfxPoolItem* CreateDefault(); + XFormTextShadowYValItem(long nVal = 0); + virtual XFormTextShadowYValItem* Clone(SfxItemPool* pPool = nullptr) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xftstit.hxx b/include/svx/xftstit.hxx new file mode 100644 index 000000000..51e03e790 --- /dev/null +++ b/include/svx/xftstit.hxx @@ -0,0 +1,43 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_XFTSTIT_HXX +#define INCLUDED_SVX_XFTSTIT_HXX + +#include +#include + +/************************************************************************* +|* +|* FormText-StartPositionItem +|* +\************************************************************************/ + +class SVXCORE_DLLPUBLIC XFormTextStartItem final : public SfxMetricItem +{ +public: + static SfxPoolItem* CreateDefault(); + + XFormTextStartItem(long nStart = 0); + virtual XFormTextStartItem* Clone(SfxItemPool* pPool = nullptr) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xgrad.hxx b/include/svx/xgrad.hxx new file mode 100644 index 000000000..f8ef9dbe9 --- /dev/null +++ b/include/svx/xgrad.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_SVX_XGRAD_HXX +#define INCLUDED_SVX_XGRAD_HXX + +#include +#include +#include +#include + +class Gradient; + +class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC XGradient final +{ + css::awt::GradientStyle eStyle; + Color aStartColor; + Color aEndColor; + long nAngle; + sal_uInt16 nBorder; + sal_uInt16 nOfsX; + sal_uInt16 nOfsY; + sal_uInt16 nIntensStart; + sal_uInt16 nIntensEnd; + sal_uInt16 nStepCount; + + static std::string GradientStyleToString(css::awt::GradientStyle eStyle); + +public: + XGradient(); + XGradient( const Color& rStart, const Color& rEnd, + css::awt::GradientStyle eStyle = css::awt::GradientStyle_LINEAR, long nAngle = 0, + sal_uInt16 nXOfs = 50, sal_uInt16 nYOfs = 50, sal_uInt16 nBorder = 0, + sal_uInt16 nStartIntens = 100, sal_uInt16 nEndIntens = 100, + sal_uInt16 nSteps = 0 ); + + bool operator==(const XGradient& rGradient) const; + + void SetGradientStyle(css::awt::GradientStyle eNewStyle) { eStyle = eNewStyle; } + void SetStartColor(const Color& rColor) { aStartColor = rColor; } + void SetEndColor(const Color& rColor) { aEndColor = rColor; } + void SetAngle(long nNewAngle) { nAngle = nNewAngle; } + void SetBorder(sal_uInt16 nNewBorder) { nBorder = nNewBorder; } + void SetXOffset(sal_uInt16 nNewOffset) { nOfsX = nNewOffset; } + void SetYOffset(sal_uInt16 nNewOffset) { nOfsY = nNewOffset; } + void SetStartIntens(sal_uInt16 nNewIntens) { nIntensStart = nNewIntens; } + void SetEndIntens(sal_uInt16 nNewIntens) { nIntensEnd = nNewIntens; } + void SetSteps(sal_uInt16 nSteps) { nStepCount = nSteps; } + + css::awt::GradientStyle GetGradientStyle() const { return eStyle; } + const Color& GetStartColor() const { return aStartColor; } + const Color& GetEndColor() const { return aEndColor; } + long GetAngle() const { return nAngle; } + sal_uInt16 GetBorder() const { return nBorder; } + sal_uInt16 GetXOffset() const { return nOfsX; } + sal_uInt16 GetYOffset() const { return nOfsY; } + sal_uInt16 GetStartIntens() const { return nIntensStart; } + sal_uInt16 GetEndIntens() const { return nIntensEnd; } + sal_uInt16 GetSteps() const { return nStepCount; } + + boost::property_tree::ptree dumpAsJSON() const; + static XGradient fromJSON(const OUString& rJSON); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xgrscit.hxx b/include/svx/xgrscit.hxx new file mode 100644 index 000000000..92e0c099b --- /dev/null +++ b/include/svx/xgrscit.hxx @@ -0,0 +1,45 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_XGRSCIT_HXX +#define INCLUDED_SVX_XGRSCIT_HXX + +#include +#include + +/************************************************************************* +|* +|* Gradient step item for gradient fills +|* +\************************************************************************/ + +class SVXCORE_DLLPUBLIC XGradientStepCountItem final : public SfxUInt16Item +{ +public: + XGradientStepCountItem( sal_uInt16 nStepCount = 0 ); + virtual XGradientStepCountItem* Clone( SfxItemPool* pPool = nullptr ) const override; + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xhatch.hxx b/include/svx/xhatch.hxx new file mode 100644 index 000000000..79b5f624e --- /dev/null +++ b/include/svx/xhatch.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_SVX_XHATCH_HXX +#define INCLUDED_SVX_XHATCH_HXX + +#include +#include +#include + + + + +class SVXCORE_DLLPUBLIC XHatch final +{ + css::drawing::HatchStyle eStyle; + Color aColor; + long nDistance; + long nAngle; + +public: + XHatch() : eStyle(css::drawing::HatchStyle_SINGLE), nDistance(0), nAngle(0) {} + XHatch(const Color& rCol, css::drawing::HatchStyle eStyle = css::drawing::HatchStyle_SINGLE, + long nDistance = 20, long nAngle = 0); + + bool operator==(const XHatch& rHatch) const; + + void SetHatchStyle(css::drawing::HatchStyle eNewStyle) { eStyle = eNewStyle; } + void SetColor(const Color& rColor) { aColor = rColor; } + void SetDistance(long nNewDistance) { nDistance = nNewDistance; } + void SetAngle(long nNewAngle) { nAngle = nNewAngle; } + + css::drawing::HatchStyle GetHatchStyle() const { return eStyle; } + const Color& GetColor() const { return aColor; } + long GetDistance() const { return nDistance; } + long GetAngle() const { return nAngle; } +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xit.hxx b/include/svx/xit.hxx new file mode 100644 index 000000000..90c19c2f0 --- /dev/null +++ b/include/svx/xit.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_SVX_XIT_HXX +#define INCLUDED_SVX_XIT_HXX + +#include +#include +#include + +/************************************************************************/ + +class SfxItemPool; +class NameOrIndex; + +typedef bool (*SvxCompareValueFunc)( const NameOrIndex* p1, const NameOrIndex* p2 ); + + + +class SVXCORE_DLLPUBLIC NameOrIndex : public SfxStringItem +{ + sal_Int32 nPalIndex; + +protected: + void Detach() { nPalIndex = -1; } + +public: + NameOrIndex() { nPalIndex = -1; } + NameOrIndex(sal_uInt16 nWhich, sal_Int32 nIndex); + NameOrIndex(sal_uInt16 nWhich, const OUString& rName); + NameOrIndex(const NameOrIndex& rNameOrIndex); + + virtual bool operator==(const SfxPoolItem& rItem) const override; + virtual NameOrIndex* Clone(SfxItemPool* pPool = nullptr) const override; + + OUString const & GetName() const { return GetValue(); } + void SetName(const OUString& rName) { SetValue(rName); } + bool IsIndex() const { return (nPalIndex >= 0); } + + /** this static checks if the given NameOrIndex item has a unique name for its value. + The returned String is a unique name for an item with this value in both given pools. + Argument pPool2 can be null. + If returned string equals NameOrIndex->GetName(), the name was already unique. + */ + static OUString CheckNamedItem( const NameOrIndex* pCheckItem, const sal_uInt16 nWhich, const SfxItemPool* pPool1, SvxCompareValueFunc pCompareValueFunc, const char* pPrefixResId, const XPropertyListRef &pDefaults ); + + void dumpAsXml(xmlTextWriterPtr pWriter) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xlineit0.hxx b/include/svx/xlineit0.hxx new file mode 100644 index 000000000..ab8e26561 --- /dev/null +++ b/include/svx/xlineit0.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_SVX_XLINEIT0_HXX +#define INCLUDED_SVX_XLINEIT0_HXX + +#include + + +#include +#include + +class SVXCORE_DLLPUBLIC XLineStyleItem final : public SfxEnumItem +{ +public: + static SfxPoolItem* CreateDefault(); + XLineStyleItem(css::drawing::LineStyle = css::drawing::LineStyle_SOLID); + virtual XLineStyleItem* Clone(SfxItemPool* pPool = nullptr) const override; + + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + virtual sal_uInt16 GetValueCount() const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xlinjoit.hxx b/include/svx/xlinjoit.hxx new file mode 100644 index 000000000..b495ecf25 --- /dev/null +++ b/include/svx/xlinjoit.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_SVX_XLINJOIT_HXX +#define INCLUDED_SVX_XLINJOIT_HXX + +#include +#include +#include + + + + +class SVXCORE_DLLPUBLIC XLineJointItem final : public SfxEnumItem +{ +public: + static SfxPoolItem* CreateDefault(); + XLineJointItem( css::drawing::LineJoint eLineJoint = css::drawing::LineJoint_ROUND ); + + virtual XLineJointItem* Clone( SfxItemPool* pPool = nullptr ) const override; + + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + + virtual sal_uInt16 GetValueCount() const override; +}; + +#endif // INCLUDED_SVX_XLINJOIT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xlnasit.hxx b/include/svx/xlnasit.hxx new file mode 100644 index 000000000..206250f54 --- /dev/null +++ b/include/svx/xlnasit.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_SVX_XLNASIT_HXX +#define INCLUDED_SVX_XLNASIT_HXX + +#include + +#include + +#include +#include + +// SetItem with all ItemSets of line-attributes +class SVXCORE_DLLPUBLIC XLineAttrSetItem final : public SfxSetItem +{ +public: + XLineAttrSetItem(std::unique_ptr&& pItemSet ); + XLineAttrSetItem(SfxItemPool* pItemPool); + XLineAttrSetItem(const XLineAttrSetItem& rAttr); + XLineAttrSetItem(const XLineAttrSetItem& rAttr, + SfxItemPool* pItemPool); + virtual XLineAttrSetItem* Clone( SfxItemPool* pToPool = nullptr ) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xlncapit.hxx b/include/svx/xlncapit.hxx new file mode 100644 index 000000000..7311d0d06 --- /dev/null +++ b/include/svx/xlncapit.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_SVX_XLNCAPIT_HXX +#define INCLUDED_SVX_XLNCAPIT_HXX + +#include +#include +#include + + + + +class SVXCORE_DLLPUBLIC XLineCapItem final : public SfxEnumItem +{ +public: + static SfxPoolItem* CreateDefault(); + XLineCapItem(css::drawing::LineCap eLineCap = css::drawing::LineCap_BUTT); + + virtual XLineCapItem* Clone( SfxItemPool* pPool = nullptr ) const override; + + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + + css::drawing::LineCap GetValue() const; + virtual sal_uInt16 GetValueCount() const override; +}; + +#endif // INCLUDED_SVX_XLNCAPIT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xlnclit.hxx b/include/svx/xlnclit.hxx new file mode 100644 index 000000000..7de9bc8b6 --- /dev/null +++ b/include/svx/xlnclit.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_SVX_XLNCLIT_HXX +#define INCLUDED_SVX_XLNCLIT_HXX + +#include +#include + + + +class SVXCORE_DLLPUBLIC XLineColorItem final : public XColorItem +{ +public: + static SfxPoolItem* CreateDefault(); + XLineColorItem() {} + XLineColorItem(sal_Int32 nIndex, const Color& rTheColor); + XLineColorItem(const OUString& rName, const Color& rTheColor); + + virtual XLineColorItem* Clone(SfxItemPool* pPool = nullptr) const override; + + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xlndsit.hxx b/include/svx/xlndsit.hxx new file mode 100644 index 000000000..4998b1f03 --- /dev/null +++ b/include/svx/xlndsit.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_SVX_XLNDSIT_HXX +#define INCLUDED_SVX_XLNDSIT_HXX + +#include +#include + +#include +#include + +class SdrModel; + + + +class SVXCORE_DLLPUBLIC XLineDashItem : public NameOrIndex +{ + XDash aDash; + +public: + static SfxPoolItem* CreateDefault(); + XLineDashItem() : NameOrIndex(XATTR_LINEDASH, -1) {} + XLineDashItem(const OUString& rName, const XDash& rTheDash); + XLineDashItem(const XDash& rTheDash); + XLineDashItem(const XLineDashItem& rItem); + + virtual bool operator==(const SfxPoolItem& rItem) const override; + virtual XLineDashItem* Clone(SfxItemPool* pPool = nullptr) const override; + + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + virtual bool HasMetrics() const override; + virtual void ScaleMetrics(long nMul, long nDiv) override; + + const XDash& GetDashValue() const { return aDash;} + void SetDashValue(const XDash& rNew) { aDash = rNew; Detach(); } // SetValue -> SetDashValue + + static bool CompareValueFunc( const NameOrIndex* p1, const NameOrIndex* p2 ); + std::unique_ptr checkForUniqueItem( SdrModel* pModel ) const; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xlnedcit.hxx b/include/svx/xlnedcit.hxx new file mode 100644 index 000000000..6cb8cf402 --- /dev/null +++ b/include/svx/xlnedcit.hxx @@ -0,0 +1,45 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_XLNEDCIT_HXX +#define INCLUDED_SVX_XLNEDCIT_HXX + +#include +#include + + + +class SVXCORE_DLLPUBLIC XLineEndCenterItem : public SfxBoolItem +{ +public: + XLineEndCenterItem(bool bEndCenter = false); + virtual XLineEndCenterItem* Clone(SfxItemPool* pPool = nullptr) const override; + + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xlnedit.hxx b/include/svx/xlnedit.hxx new file mode 100644 index 000000000..9a43e14f3 --- /dev/null +++ b/include/svx/xlnedit.hxx @@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_XLNEDIT_HXX +#define INCLUDED_SVX_XLNEDIT_HXX + +#include +#include +#include + +class SdrModel; + + + +class SVXCORE_DLLPUBLIC XLineEndItem final : public NameOrIndex +{ + basegfx::B2DPolyPolygon maPolyPolygon; + +public: + static SfxPoolItem* CreateDefault(); + XLineEndItem(sal_Int32 nIndex = -1); + XLineEndItem(const OUString& rName, const basegfx::B2DPolyPolygon& rPolyPolygon); + XLineEndItem(const basegfx::B2DPolyPolygon& rPolyPolygon); + XLineEndItem(const XLineEndItem& rItem); + + virtual bool operator==(const SfxPoolItem& rItem) const override; + virtual XLineEndItem* Clone(SfxItemPool* pPool = nullptr) const override; + + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + + const basegfx::B2DPolyPolygon& GetLineEndValue() const { return maPolyPolygon;} + void SetLineEndValue(const basegfx::B2DPolyPolygon& rPolyPolygon) { maPolyPolygon = rPolyPolygon; Detach(); } + + std::unique_ptr checkForUniqueItem( SdrModel* pModel ) const; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xlnedwit.hxx b/include/svx/xlnedwit.hxx new file mode 100644 index 000000000..1e9ef4a2e --- /dev/null +++ b/include/svx/xlnedwit.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_SVX_XLNEDWIT_HXX +#define INCLUDED_SVX_XLNEDWIT_HXX + +#include +#include + +#define LINE_END_WIDTH_DEFAULT (200) + + + + +class SVXCORE_DLLPUBLIC XLineEndWidthItem final : public SfxMetricItem +{ +public: + XLineEndWidthItem(long nWidth = LINE_END_WIDTH_DEFAULT); + virtual XLineEndWidthItem* Clone(SfxItemPool* pPool = nullptr) const override; + + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xlnstcit.hxx b/include/svx/xlnstcit.hxx new file mode 100644 index 000000000..bde8c597d --- /dev/null +++ b/include/svx/xlnstcit.hxx @@ -0,0 +1,45 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_XLNSTCIT_HXX +#define INCLUDED_SVX_XLNSTCIT_HXX + +#include +#include + + + +class SVXCORE_DLLPUBLIC XLineStartCenterItem : public SfxBoolItem +{ +public: + XLineStartCenterItem(bool bStartCenter = false); + virtual XLineStartCenterItem* Clone(SfxItemPool* pPool = nullptr) const override; + + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xlnstit.hxx b/include/svx/xlnstit.hxx new file mode 100644 index 000000000..859fdcbe7 --- /dev/null +++ b/include/svx/xlnstit.hxx @@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_XLNSTIT_HXX +#define INCLUDED_SVX_XLNSTIT_HXX + +#include +#include +#include + +class SdrModel; + + + +class SVXCORE_DLLPUBLIC XLineStartItem final : public NameOrIndex +{ + basegfx::B2DPolyPolygon maPolyPolygon; + +public: + static SfxPoolItem* CreateDefault(); + XLineStartItem(sal_Int32 nIndex = -1); + XLineStartItem(const OUString& rName, const basegfx::B2DPolyPolygon& rPolyPolygon); + XLineStartItem(const basegfx::B2DPolyPolygon& rPolyPolygon); + XLineStartItem(const XLineStartItem& rItem); + + virtual bool operator==(const SfxPoolItem& rItem) const override; + virtual XLineStartItem* Clone(SfxItemPool* pPool = nullptr) const override; + + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + + const basegfx::B2DPolyPolygon& GetLineStartValue() const { return maPolyPolygon;} + void SetLineStartValue(const basegfx::B2DPolyPolygon& rPolyPolygon) { maPolyPolygon = rPolyPolygon; Detach(); } + + std::unique_ptr checkForUniqueItem( SdrModel* pModel ) const; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xlnstwit.hxx b/include/svx/xlnstwit.hxx new file mode 100644 index 000000000..3094c3297 --- /dev/null +++ b/include/svx/xlnstwit.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_SVX_XLNSTWIT_HXX +#define INCLUDED_SVX_XLNSTWIT_HXX + +#include +#include + +#define LINE_START_WIDTH_DEFAULT (200) + + + +class SVXCORE_DLLPUBLIC XLineStartWidthItem final : public SfxMetricItem +{ +public: + XLineStartWidthItem(long nWidth = LINE_START_WIDTH_DEFAULT); + virtual XLineStartWidthItem* Clone(SfxItemPool* pPool = nullptr) const override; + + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xlntrit.hxx b/include/svx/xlntrit.hxx new file mode 100644 index 000000000..c7eca5815 --- /dev/null +++ b/include/svx/xlntrit.hxx @@ -0,0 +1,45 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_XLNTRIT_HXX +#define INCLUDED_SVX_XLNTRIT_HXX + +#include +#include + +/************************************************************************* +|* +|* Transparency item for lines +|* +\************************************************************************/ + +class SVXCORE_DLLPUBLIC XLineTransparenceItem final : public SfxUInt16Item +{ +public: + XLineTransparenceItem(sal_uInt16 nLineTransparence = 0); + virtual XLineTransparenceItem* Clone(SfxItemPool* pPool = nullptr) const override; + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xlnwtit.hxx b/include/svx/xlnwtit.hxx new file mode 100644 index 000000000..65cd9ee8e --- /dev/null +++ b/include/svx/xlnwtit.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_SVX_XLNWTIT_HXX +#define INCLUDED_SVX_XLNWTIT_HXX + +#include +#include + + + +class SVXCORE_DLLPUBLIC XLineWidthItem final : public SfxMetricItem +{ +public: + static SfxPoolItem* CreateDefault(); + XLineWidthItem(long nWidth = 0); + virtual XLineWidthItem* Clone(SfxItemPool* pPool = nullptr) const override; + + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; + + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xmleohlp.hxx b/include/svx/xmleohlp.hxx new file mode 100644 index 000000000..ed64bd715 --- /dev/null +++ b/include/svx/xmleohlp.hxx @@ -0,0 +1,127 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_XMLEOHLP_HXX +#define INCLUDED_SVX_XMLEOHLP_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +enum class SvXMLEmbeddedObjectHelperMode +{ + Read, Write +}; + +namespace comphelper { class IEmbeddedHelper; } + +class SvGlobalName; +class OutputStorageWrapper_Impl; + + +class SVXCORE_DLLPUBLIC SvXMLEmbeddedObjectHelper final : + public cppu::WeakComponentImplHelper< css::document::XEmbeddedObjectResolver, css::container::XNameAccess > +{ + ::osl::Mutex maMutex; + + OUString maCurContainerStorageName; + + + css::uno::Reference < css::embed::XStorage > mxRootStorage; // package + ::comphelper::IEmbeddedHelper* mpDocPersist; + css::uno::Reference < css::embed::XStorage > mxContainerStorage; // container sub package for + css::uno::Reference < css::embed::XStorage > mxTempStorage; // package + // objects + SvXMLEmbeddedObjectHelperMode meCreateMode; + std::unique_ptr >> + mpStreamMap; + + SVX_DLLPRIVATE bool ImplGetStorageNames( + const OUString& rURLStr, + OUString& rContainerStorageName, + OUString& rObjectStorageName, + bool bInternalToExternal, + bool *pGraphicRepl=nullptr, + bool *pOasisFormat=nullptr ) const; + + SVX_DLLPRIVATE css::uno::Reference < css::embed::XStorage > const & ImplGetContainerStorage( + const OUString& rStorageName ); + + SVX_DLLPRIVATE void ImplReadObject( + const OUString& rContainerStorageName, + OUString& rObjName, + const SvGlobalName *pClassId, + SvStream* pTemp ); + + SVX_DLLPRIVATE OUString ImplInsertEmbeddedObjectURL( + const OUString& rURLStr ); + + SVX_DLLPRIVATE css::uno::Reference< css::io::XInputStream > ImplGetReplacementImage( + const css::uno::Reference< css::embed::XEmbeddedObject >& xObj ); + + SvXMLEmbeddedObjectHelper(); + virtual ~SvXMLEmbeddedObjectHelper() override; + void Init( const css::uno::Reference < css::embed::XStorage >&, + ::comphelper::IEmbeddedHelper& rDocPersist, + SvXMLEmbeddedObjectHelperMode eCreateMode ); + + virtual void SAL_CALL disposing() override; + +public: + SvXMLEmbeddedObjectHelper( + ::comphelper::IEmbeddedHelper& rDocPersist, + SvXMLEmbeddedObjectHelperMode eCreateMode ); + + static rtl::Reference Create( + const css::uno::Reference < css::embed::XStorage >&, + ::comphelper::IEmbeddedHelper& rDocPersist, + SvXMLEmbeddedObjectHelperMode eCreateMode ); + static rtl::Reference Create( + ::comphelper::IEmbeddedHelper& rDocPersist, + SvXMLEmbeddedObjectHelperMode eCreateMode ); + + // XEmbeddedObjectResolver + virtual OUString SAL_CALL resolveEmbeddedObjectURL( const OUString& aURL ) override; + + // XNameAccess + virtual css::uno::Any SAL_CALL getByName( const OUString& aName ) override; + virtual css::uno::Sequence< OUString > SAL_CALL getElementNames( ) override; + virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) override; + + // XNameAccess + virtual css::uno::Type SAL_CALL getElementType( ) override; + virtual sal_Bool SAL_CALL hasElements( ) override; + + + static void splitObjectURL(const OUString& aURLNoPar, + OUString& rContainerStorageName, + OUString& rObjectStorageName); +}; + +#endif // INCLUDED_SVX_XMLEOHLP_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xmlexchg.hxx b/include/svx/xmlexchg.hxx new file mode 100644 index 000000000..63ebd7581 --- /dev/null +++ b/include/svx/xmlexchg.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_SVX_XMLEXCHG_HXX +#define INCLUDED_SVX_XMLEXCHG_HXX + +#include +#include +#include + +namespace com { + namespace sun { + namespace star { + namespace beans { + class SAL_NO_VTABLE XPropertySet; + } + } + } +} + + +namespace svx +{ + + + //= OXFormsDescriptor + + + struct SVXCORE_DLLPUBLIC OXFormsDescriptor { + + OUString szName; + OUString szServiceName; + css::uno::Reference< css::beans::XPropertySet > xPropSet; + + OXFormsDescriptor() {} + OXFormsDescriptor( const OXFormsDescriptor &rhs ) { *this=rhs; } + OXFormsDescriptor &operator = ( const OXFormsDescriptor &rhs ) { + szName = rhs.szName; + szServiceName = rhs.szServiceName; + xPropSet = rhs.xPropSet; + return (*this); + } + }; + + + //= OXFormsTransferable + + class SVXCORE_DLLPUBLIC OXFormsTransferable final : public TransferableHelper { + + // TransferableHelper overridables + virtual void AddSupportedFormats() override; + virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) override; + + OXFormsDescriptor m_aDescriptor; + + public: + + /** construct the transferable + */ + OXFormsTransferable( const OXFormsDescriptor &rhs ); + + /** extracts an xform descriptor from the transferable given + */ + static const OXFormsDescriptor &extractDescriptor( const TransferableDataHelper& _rData ); + }; + + +} + + +#endif // INCLUDED_SVX_XMLEXCHG_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xmlgrhlp.hxx b/include/svx/xmlgrhlp.hxx new file mode 100644 index 000000000..37d8c63bd --- /dev/null +++ b/include/svx/xmlgrhlp.hxx @@ -0,0 +1,125 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_XMLGRHLP_HXX +#define INCLUDED_SVX_XMLGRHLP_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +enum class SvXMLGraphicHelperMode +{ + Read, Write +}; + +struct SvxGraphicHelperStream_Impl +{ + css::uno::Reference < css::embed::XStorage > xStorage; + css::uno::Reference < css::io::XStream > xStream; +}; + +class SVXCORE_DLLPUBLIC SvXMLGraphicHelper final : public cppu::WeakComponentImplHelper +{ +private: + typedef ::std::vector< css::uno::Reference< css::io::XOutputStream > > GraphicOutputStreamVector; + + ::osl::Mutex maMutex; + css::uno::Reference < css::embed::XStorage > mxRootStorage; + OUString maCurStorageName; + GraphicOutputStreamVector maGrfStms; + + std::unordered_map> maGraphicObjects; + std::unordered_map> maExportGraphics; + + SvXMLGraphicHelperMode meCreateMode; + OUString maOutputMimeType; + + SVX_DLLPRIVATE static bool ImplGetStreamNames( const OUString& rURLStr, + OUString& rPictureStorageName, + OUString& rPictureStreamName ); + SVX_DLLPRIVATE css::uno::Reference < css::embed::XStorage > + ImplGetGraphicStorage( const OUString& rPictureStorageName ); + SVX_DLLPRIVATE SvxGraphicHelperStream_Impl + ImplGetGraphicStream( const OUString& rPictureStorageName, + const OUString& rPictureStreamName ); + SVX_DLLPRIVATE static OUString ImplGetGraphicMimeType( const OUString& rFileName ); + SVX_DLLPRIVATE Graphic ImplReadGraphic( const OUString& rPictureStorageName, + const OUString& rPictureStreamName ); + + SvXMLGraphicHelper(); + virtual ~SvXMLGraphicHelper() override; + void Init( const css::uno::Reference < css::embed::XStorage >& xXMLStorage, + SvXMLGraphicHelperMode eCreateMode, + const OUString& rGraphicMimeType = OUString() ); + + virtual void SAL_CALL disposing() override; + + SVX_DLLPRIVATE OUString implSaveGraphic(css::uno::Reference const & rxGraphic, + OUString & rOutMimeType, OUString const & rRequestName); + +public: + SvXMLGraphicHelper( SvXMLGraphicHelperMode eCreateMode ); + + static rtl::Reference Create( const css::uno::Reference < css::embed::XStorage >& rXMLStorage, + SvXMLGraphicHelperMode eCreateMode ); + static rtl::Reference Create( SvXMLGraphicHelperMode eCreateMode, + const OUString& rMimeType = OUString() ); + +public: + + // XGraphicObjectResolver + virtual OUString SAL_CALL resolveGraphicObjectURL( const OUString& aURL ) override; + + // XGraphicStorageHandler + virtual css::uno::Reference SAL_CALL + loadGraphic(OUString const & aURL) override; + + virtual css::uno::Reference SAL_CALL + loadGraphicFromOutputStream(css::uno::Reference const & rxOutputStream) override; + + virtual OUString SAL_CALL + saveGraphic(css::uno::Reference const & rxGraphic) override; + + virtual OUString SAL_CALL + saveGraphicByName(css::uno::Reference const & rxGraphic, OUString & rOutSavedMimeType, OUString const & rRequestName) override; + + virtual css::uno::Reference SAL_CALL + createInputStream(css::uno::Reference const & rxGraphic) override; + + // XBinaryStreamResolver + virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getInputStream( const OUString& rURL ) override; + virtual css::uno::Reference< css::io::XOutputStream > SAL_CALL createOutputStream( ) override; + virtual OUString SAL_CALL resolveOutputStream( const css::uno::Reference< css::io::XOutputStream >& rxBinaryStream ) override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xmlsecctrl.hxx b/include/svx/xmlsecctrl.hxx new file mode 100644 index 000000000..5ba255a5e --- /dev/null +++ b/include/svx/xmlsecctrl.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 . + */ + +#pragma once + +#include +#include +#include + +class SvxSizeItem; + +class SVX_DLLPUBLIC XmlSecStatusBarControl final : public SfxStatusBarControl +{ +private: + struct XmlSecStatusBarControl_Impl; + + std::unique_ptr mpImpl; + +public: + SFX_DECL_STATUSBAR_CONTROL(); + + XmlSecStatusBarControl( sal_uInt16 _nSlotId, sal_uInt16 _nId, StatusBar& _rStb ); + virtual ~XmlSecStatusBarControl() override; + + virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) override; + virtual void Paint( const UserDrawEvent& rEvt ) override; + virtual void Command( const CommandEvent& rCEvt ) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xoutbmp.hxx b/include/svx/xoutbmp.hxx new file mode 100644 index 000000000..5b0d3f6e5 --- /dev/null +++ b/include/svx/xoutbmp.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_SVX_XOUTBMP_HXX +#define INCLUDED_SVX_XOUTBMP_HXX + +#include +#include +#include +#include +#include +#include +#include + + +enum class XOutFlags { + NONE = 0x00000000, + MirrorHorz = 0x00000001, + MirrorVert = 0x00000010, + DontAddExtension = 0x00000008, + DontExpandFilename = 0x00010000, + UseGifIfPossible = 0x00020000, + UseGifIfSensible = 0x00040000, + UseNativeIfPossible = 0x00080000, +}; +namespace o3tl { + template<> struct typed_flags : is_typed_flags {}; +} + +class GraphicFilter; +class VirtualDevice; +class INetURLObject; +namespace tools { + class Polygon; +} + +class SVXCORE_DLLPUBLIC XOutBitmap +{ +public: + + static GraphicFilter* pGrfFilter; + + static Graphic MirrorGraphic( const Graphic& rGraphic, const BmpMirrorFlags nMirrorFlags ); + static Animation MirrorAnimation( const Animation& rAnimation, bool bHMirr, bool bVMirr ); + static ErrCode WriteGraphic( const Graphic& rGraphic, OUString& rFileName, + const OUString& rFilterName, const XOutFlags nFlags, + const Size* pMtfSize_100TH_MM = nullptr, + const css::uno::Sequence< css::beans::PropertyValue >* pFilterData = nullptr); + static bool GraphicToBase64(const Graphic& rGraphic, OUString& rOUString, + bool bAddPrefix = true, + ConvertDataFormat aTargetFormat = ConvertDataFormat::Unknown); + + static ErrCode ExportGraphic( const Graphic& rGraphic, const INetURLObject& rURL, + GraphicFilter& rFilter, const sal_uInt16 nFormat, + const css::uno::Sequence< css::beans::PropertyValue >* pFilterData ); +}; + +#endif // INCLUDED_SVX_XOUTBMP_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xpoly.hxx b/include/svx/xpoly.hxx new file mode 100644 index 000000000..e872b205d --- /dev/null +++ b/include/svx/xpoly.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_SVX_XPOLY_HXX +#define INCLUDED_SVX_XPOLY_HXX + +#include +#include +#include +#include + +class Point; +namespace tools { class Rectangle; } +class SvStream; +namespace tools { + class Polygon; + class PolyPolygon; +} +class OutputDevice; + +#define XPOLYPOLY_APPEND 0xFFFF +#define XPOLY_APPEND 0xFFFF + + +// Class XPolygon has a point-array and a flag-array, which contains information about a particular point + +class ImpXPolygon; + +class SVXCORE_DLLPUBLIC XPolygon final +{ + o3tl::cow_wrapper< ImpXPolygon > pImpXPolygon; + + // auxiliary functions for Bezier conversion + void SubdivideBezier(sal_uInt16 nPos, bool bCalcFirst, double fT); + void GenBezArc(const Point& rCenter, long nRx, long nRy, + long nXHdl, long nYHdl, sal_uInt16 nStart, sal_uInt16 nEnd, + sal_uInt16 nQuad, sal_uInt16 nFirst); + static bool CheckAngles(sal_uInt16& nStart, sal_uInt16 nEnd, sal_uInt16& nA1, sal_uInt16& nA2); + +public: + XPolygon( sal_uInt16 nSize=16 ); + XPolygon( const XPolygon& ); + XPolygon( XPolygon&& ); + XPolygon( const tools::Polygon& rPoly ); + XPolygon( const tools::Rectangle& rRect, long nRx = 0, long nRy = 0 ); + XPolygon( const Point& rCenter, long nRx, long nRy, + sal_uInt16 nStartAngle = 0, sal_uInt16 nEndAngle = 3600, + bool bClose = true ); + + ~XPolygon(); + + sal_uInt16 GetSize() const; + + void SetPointCount( sal_uInt16 nPoints ); + sal_uInt16 GetPointCount() const; + + void Insert( sal_uInt16 nPos, const Point& rPt, PolyFlags eFlags ); + void Insert( sal_uInt16 nPos, const XPolygon& rXPoly ); + void Remove( sal_uInt16 nPos, sal_uInt16 nCount ); + void Move( long nHorzMove, long nVertMove ); + tools::Rectangle GetBoundRect() const; + + const Point& operator[]( sal_uInt16 nPos ) const; + Point& operator[]( sal_uInt16 nPos ); + XPolygon& operator=( const XPolygon& ); + XPolygon& operator=( XPolygon&& ); + bool operator==( const XPolygon& rXPoly ) const; + + PolyFlags GetFlags( sal_uInt16 nPos ) const; + void SetFlags( sal_uInt16 nPos, PolyFlags eFlags ); + bool IsControl(sal_uInt16 nPos) const; + bool IsSmooth(sal_uInt16 nPos) const; + + // distance between two points + double CalcDistance(sal_uInt16 nP1, sal_uInt16 nP2); + + // Bezier conversion + void CalcSmoothJoin(sal_uInt16 nCenter, sal_uInt16 nDrag, sal_uInt16 nPnt); + void CalcTangent(sal_uInt16 nCenter, sal_uInt16 nPrev, sal_uInt16 nNext); + void PointsToBezier(sal_uInt16 nFirst); + + // transformations + void Scale(double fSx, double fSy); + void Distort(const tools::Rectangle& rRefRect, const XPolygon& rDistortedRect); + + // #116512# convert to basegfx::B2DPolygon and return + basegfx::B2DPolygon getB2DPolygon() const; + + // #116512# constructor to convert from basegfx::B2DPolygon + // #i76339# made explicit + explicit XPolygon(const basegfx::B2DPolygon& rPolygon); +}; + +// Class XPolyPolygon; like PolyPolygon, composed of XPolygons instead of Polygons + +class ImpXPolyPolygon; + +class XPolyPolygon final +{ + o3tl::cow_wrapper< ImpXPolyPolygon > pImpXPolyPolygon; + +public: + XPolyPolygon(); + XPolyPolygon( const XPolyPolygon& ); + XPolyPolygon( XPolyPolygon&& ); + + ~XPolyPolygon(); + + void Insert( XPolygon&& rXPoly ); + void Insert( const XPolyPolygon& rXPoly ); + void Remove( sal_uInt16 nPos ); + const XPolygon& GetObject( sal_uInt16 nPos ) const; + + void Clear(); + sal_uInt16 Count() const; + + tools::Rectangle GetBoundRect() const; + + const XPolygon& operator[]( sal_uInt16 nPos ) const + { return GetObject( nPos ); } + XPolygon& operator[]( sal_uInt16 nPos ); + + XPolyPolygon& operator=( const XPolyPolygon& ); + XPolyPolygon& operator=( XPolyPolygon&& ); + + // transformations + void Distort(const tools::Rectangle& rRefRect, const XPolygon& rDistortedRect); + + // #116512# convert to basegfx::B2DPolyPolygon and return + basegfx::B2DPolyPolygon getB2DPolyPolygon() const; + + // #116512# constructor to convert from basegfx::B2DPolyPolygon + // #i76339# made explicit + explicit XPolyPolygon(const basegfx::B2DPolyPolygon& rPolyPolygon); +}; + +#endif // INCLUDED_SVX_XPOLY_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xpool.hxx b/include/svx/xpool.hxx new file mode 100644 index 000000000..a7ec8c67c --- /dev/null +++ b/include/svx/xpool.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_SVX_XPOOL_HXX +#define INCLUDED_SVX_XPOOL_HXX + +#include +#include +#include + +/************************************************************************* +|* +|* Klassendeklaration +|* +\************************************************************************/ + +class XOutdevItemPool : public SfxItemPool +{ +protected: + std::vector* mpLocalPoolDefaults; + std::unique_ptr mpLocalItemInfos; + +public: + XOutdevItemPool( SfxItemPool* pMaster); + XOutdevItemPool(const XOutdevItemPool& rPool); + + virtual SfxItemPool* Clone() const override; +protected: + virtual ~XOutdevItemPool() override; +}; + +#endif // INCLUDED_SVX_XPOOL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xsflclit.hxx b/include/svx/xsflclit.hxx new file mode 100644 index 000000000..f82f88d38 --- /dev/null +++ b/include/svx/xsflclit.hxx @@ -0,0 +1,40 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_XSFLCLIT_HXX +#define INCLUDED_SVX_XSFLCLIT_HXX + +#include + +class SVXCORE_DLLPUBLIC XSecondaryFillColorItem final : public XColorItem +{ +public: + XSecondaryFillColorItem(const OUString& rName, const Color& rTheColor); + + SVX_DLLPRIVATE virtual XSecondaryFillColorItem* Clone(SfxItemPool* pPool = nullptr) const override; + + SVX_DLLPRIVATE virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xtable.hxx b/include/svx/xtable.hxx new file mode 100644 index 000000000..db1f1a7e6 --- /dev/null +++ b/include/svx/xtable.hxx @@ -0,0 +1,404 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SVX_XTABLE_HXX +#define INCLUDED_SVX_XTABLE_HXX + +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +class SVXCORE_DLLPUBLIC XColorEntry final : public XPropertyEntry +{ +private: + Color aColor; + +public: + XColorEntry(const Color& rColor, const OUString& rName); + + const Color& GetColor() const + { + return aColor; + } +}; + +class SVXCORE_DLLPUBLIC XLineEndEntry final : public XPropertyEntry +{ +private: + basegfx::B2DPolyPolygon aB2DPolyPolygon; + +public: + XLineEndEntry(const basegfx::B2DPolyPolygon& rB2DPolyPolygon, const OUString& rName); + XLineEndEntry(const XLineEndEntry& rOther); + + const basegfx::B2DPolyPolygon& GetLineEnd() const + { + return aB2DPolyPolygon; + } +}; + +class SVXCORE_DLLPUBLIC XDashEntry final : public XPropertyEntry +{ +private: + XDash aDash; + +public: + XDashEntry(const XDash& rDash, const OUString& rName); + XDashEntry(const XDashEntry& rOther); + + const XDash& GetDash() const + { + return aDash; + } +}; + +class SVXCORE_DLLPUBLIC XHatchEntry final : public XPropertyEntry +{ +private: + XHatch aHatch; + +public: + XHatchEntry(const XHatch& rHatch, const OUString& rName); + XHatchEntry(const XHatchEntry& rOther); + + const XHatch& GetHatch() const + { + return aHatch; + } +}; + +class SVXCORE_DLLPUBLIC XGradientEntry final : public XPropertyEntry +{ +private: + XGradient aGradient; + +public: + XGradientEntry(const XGradient& rGradient, const OUString& rName); + XGradientEntry(const XGradientEntry& rOther); + + const XGradient& GetGradient() const + { + return aGradient; + } +}; + +class SVXCORE_DLLPUBLIC XBitmapEntry final : public XPropertyEntry +{ +private: + GraphicObject maGraphicObject; + +public: + XBitmapEntry(const GraphicObject& rGraphicObject, const OUString& rName); + XBitmapEntry(const XBitmapEntry& rOther); + + const GraphicObject& GetGraphicObject() const + { + return maGraphicObject; + } +}; + +enum class XPropertyListType { + Unknown = -1, + Color, + LineEnd, + Dash, + Hatch, + Gradient, + Bitmap, + Pattern, + LAST = Pattern +}; + +typedef rtl::Reference< class XPropertyList > XPropertyListRef; + +class XDashList ; typedef rtl::Reference< class XDashList > XDashListRef; +class XHatchList ; typedef rtl::Reference< class XHatchList > XHatchListRef; +class XColorList ; typedef rtl::Reference< class XColorList > XColorListRef; +class XBitmapList ; typedef rtl::Reference< class XBitmapList > XBitmapListRef; +class XPatternList ; typedef rtl::Reference< class XPatternList > XPatternListRef; +class XLineEndList ; typedef rtl::Reference< class XLineEndList > XLineEndListRef; +class XGradientList ; typedef rtl::Reference< class XGradientList > XGradientListRef; + +class SVXCORE_DLLPUBLIC XPropertyList : public cppu::OWeakObject +{ +protected: + XPropertyListType meType; + OUString maName; // not persistent + OUString maPath; + OUString maReferer; + + std::vector< std::unique_ptr > maList; + + bool mbListDirty; + bool mbEmbedInDocument; + + XPropertyList(XPropertyListType t, const OUString& rPath, const OUString& rReferer); + bool isValidIdx(long nIndex) const; + virtual BitmapEx CreateBitmapForUI(long nIndex) = 0; + +public: + XPropertyList(const XPropertyList&) = delete; + XPropertyList& operator=(const XPropertyList&) = delete; + virtual ~XPropertyList() override; + + XPropertyListType Type() const { return meType; } + long Count() const; + + void Insert(std::unique_ptr pEntry, long nIndex = std::numeric_limits::max()); + void Replace(std::unique_ptr pEntry, long nIndex); + void Remove(long nIndex); + + XPropertyEntry* Get(long nIndex) const; + long GetIndex(const OUString& rName) const; + BitmapEx GetUiBitmap(long nIndex) const; + + const OUString& GetName() const { return maName; } + void SetName(const OUString& rString); + + const OUString& GetPath() const { return maPath; } + void SetPath(const OUString& rString) { maPath = rString; } + + void SetDirty(bool bDirty) { mbListDirty = bDirty; } + + bool IsEmbedInDocument() const { return mbEmbedInDocument; } + + static OUString GetDefaultExt(XPropertyListType t); + OUString GetDefaultExt() const { return GetDefaultExt(meType); } + + virtual css::uno::Reference< css::container::XNameContainer > + createInstance() = 0; + bool Load(); + bool LoadFrom(const css::uno::Reference< + css::embed::XStorage > &xStorage, + const OUString &rURL, const OUString &rReferer); + bool Save(); + bool SaveTo (const css::uno::Reference< + css::embed::XStorage > &xStorage, + const OUString &rURL, + OUString *pOptName); + virtual bool Create() = 0; + + // Factory method for sub-classes + static XPropertyListRef CreatePropertyList(XPropertyListType t, + const OUString& rPath, + const OUString& rReferer); + // as above but initializes name as expected + static XPropertyListRef CreatePropertyListFromURL(XPropertyListType t, + const OUString & rUrl); + + // helper accessors + static inline XDashListRef AsDashList( + rtl::Reference const & plist); + static inline XHatchListRef AsHatchList( + rtl::Reference const & plist); + static inline XColorListRef AsColorList( + rtl::Reference const & plist); + static inline XBitmapListRef AsBitmapList( + rtl::Reference const & plist); + static inline XPatternListRef AsPatternList( + rtl::Reference const & plist); + static inline XLineEndListRef AsLineEndList( + rtl::Reference const & plist); + static inline XGradientListRef AsGradientList( + rtl::Reference const & plist); +}; + +class SVXCORE_DLLPUBLIC XColorList : public XPropertyList +{ +protected: + virtual BitmapEx CreateBitmapForUI(long nIndex) override; + +public: + XColorList(const OUString& rPath, const OUString& rReferer) + : XPropertyList(XPropertyListType::Color, rPath, rReferer) {} + + void Replace(long nIndex, std::unique_ptr pEntry); + XColorEntry* GetColor(long nIndex) const; + long GetIndexOfColor( const Color& rColor) const; + virtual css::uno::Reference< css::container::XNameContainer > createInstance() override; + virtual bool Create() override; + + static XColorListRef CreateStdColorList(); + static XColorListRef GetStdColorList(); // returns a singleton +}; + +class SVXCORE_DLLPUBLIC XLineEndList : public XPropertyList +{ +protected: + virtual BitmapEx CreateBitmapForUI(long nIndex) override; + +public: + XLineEndList(const OUString& rPath, const OUString& rReferer); + virtual ~XLineEndList() override; + + XLineEndEntry* GetLineEnd(long nIndex) const; + + virtual css::uno::Reference< css::container::XNameContainer > createInstance() override; + virtual bool Create() override; +}; + +class SVXCORE_DLLPUBLIC XDashList : public XPropertyList +{ +private: + BitmapEx maBitmapSolidLine; + OUString maStringSolidLine; + OUString maStringNoLine; + +protected: + static BitmapEx ImpCreateBitmapForXDash(const XDash* pDash); + virtual BitmapEx CreateBitmapForUI(long nIndex) override; + +public: + XDashList(const OUString& rPath, const OUString& rReferer); + virtual ~XDashList() override; + + void Replace(std::unique_ptr pEntry, long nIndex); + XDashEntry* GetDash(long nIndex) const; + + virtual css::uno::Reference< css::container::XNameContainer > createInstance() override; + virtual bool Create() override; + + // Special call to get a bitmap for the solid line representation. It + // creates a bitmap fitting in size and style to the ones you get by + // using GetUiBitmap for existing entries. + BitmapEx const & GetBitmapForUISolidLine() const; + + // Special calls to get the translated strings for the UI entry for no + // line style (XLINE_NONE) and solid line style (XLINE_SOLID) for dialogs + OUString const & GetStringForUiSolidLine() const; + OUString const & GetStringForUiNoLine() const; +}; + +class SVXCORE_DLLPUBLIC XHatchList : public XPropertyList +{ +private: + BitmapEx CreateBitmap(long nIndex, const Size& rSize) const; +protected: + virtual BitmapEx CreateBitmapForUI(long nIndex) override; +public: + XHatchList(const OUString& rPath, const OUString& rReferer); + virtual ~XHatchList() override; + + void Replace(std::unique_ptr pEntry, long nIndex); + XHatchEntry* GetHatch(long nIndex) const; + BitmapEx GetBitmapForPreview(long nIndex, const Size& rSize); + + virtual css::uno::Reference< css::container::XNameContainer > createInstance() override; + virtual bool Create() override; +}; + +class SVXCORE_DLLPUBLIC XGradientList : public XPropertyList +{ +private: + BitmapEx CreateBitmap(long nIndex, const Size& rSize) const; + +protected: + virtual BitmapEx CreateBitmapForUI(long nIndex) override; + +public: + XGradientList(const OUString& rPath, const OUString& rReferer); + virtual ~XGradientList() override; + + void Replace(std::unique_ptr pEntry, long nIndex); + XGradientEntry* GetGradient(long nIndex) const; + BitmapEx GetBitmapForPreview(long nIndex, const Size& rSize); + + virtual css::uno::Reference< css::container::XNameContainer > createInstance() override; + virtual bool Create() override; +}; + +class SVXCORE_DLLPUBLIC XBitmapList : public XPropertyList +{ +private: + BitmapEx CreateBitmap( long nIndex, const Size& rSize ) const; + +protected: + virtual BitmapEx CreateBitmapForUI(long nIndex) override; + +public: + XBitmapList(const OUString& rPath, const OUString& rReferer) + : XPropertyList(XPropertyListType::Bitmap, rPath, rReferer) {} + + XBitmapEntry* GetBitmap(long nIndex) const; + BitmapEx GetBitmapForPreview(long nIndex, const Size& rSize); + + virtual css::uno::Reference< css::container::XNameContainer > createInstance() override; + virtual bool Create() override; +}; + +class SVXCORE_DLLPUBLIC XPatternList : public XPropertyList +{ +private: + BitmapEx CreateBitmap( long nIndex, const Size& rSize ) const; + +protected: + virtual BitmapEx CreateBitmapForUI(long nIndex) override; + +public: + XPatternList(const OUString& rPath, const OUString& rReferer) + : XPropertyList(XPropertyListType::Pattern, rPath, rReferer) {} + + XBitmapEntry* GetBitmap(long nIndex) const; + BitmapEx GetBitmapForPreview(long nIndex, const Size& rSize); + + virtual css::uno::Reference< css::container::XNameContainer > createInstance() override; + virtual bool Create() override; +}; + +// FIXME: could add type checking too ... +inline XDashListRef XPropertyList::AsDashList( + rtl::Reference const & plist) +{ return XDashListRef( static_cast (plist.get()) ); } +inline XHatchListRef XPropertyList::AsHatchList( + rtl::Reference const & plist) +{ return XHatchListRef( static_cast (plist.get()) ); } +inline XColorListRef XPropertyList::AsColorList( + rtl::Reference const & plist) +{ return XColorListRef( static_cast (plist.get()) ); } +inline XBitmapListRef XPropertyList::AsBitmapList( + rtl::Reference const & plist) +{ return XBitmapListRef( static_cast (plist.get()) ); } +inline XPatternListRef XPropertyList::AsPatternList( + rtl::Reference const & plist) +{ return XPatternListRef( static_cast (plist.get()) ); } +inline XLineEndListRef XPropertyList::AsLineEndList( + rtl::Reference const & plist) +{ return XLineEndListRef( static_cast (plist.get()) ); } +inline XGradientListRef XPropertyList::AsGradientList( + rtl::Reference const & plist) +{ return XGradientListRef( static_cast (plist.get()) ); } + +#endif // INCLUDED_SVX_XTABLE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/xtextit0.hxx b/include/svx/xtextit0.hxx new file mode 100644 index 000000000..8d6db594d --- /dev/null +++ b/include/svx/xtextit0.hxx @@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_XTEXTIT0_HXX +#define INCLUDED_SVX_XTEXTIT0_HXX + +#include +#include +#include + +/************************************************************************* +|* +|* FormText-StyleItem +|* +\************************************************************************/ + +class SVXCORE_DLLPUBLIC XFormTextStyleItem final : public SfxEnumItem +{ +public: + static SfxPoolItem* CreateDefault(); + XFormTextStyleItem(XFormTextStyle = XFormTextStyle::NONE); + virtual XFormTextStyleItem* Clone(SfxItemPool* pPool = nullptr) const override; + virtual sal_uInt16 GetValueCount() const override; + // #FontWork# + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; +}; + +/************************************************************************* +|* +|* FormText-HideFormItem +|* +\************************************************************************/ + +class SVXCORE_DLLPUBLIC XFormTextHideFormItem final : public SfxBoolItem +{ +public: + static SfxPoolItem* CreateDefault(); + XFormTextHideFormItem(bool bHide = false); + virtual XFormTextHideFormItem* Clone(SfxItemPool* pPool = nullptr) const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/zoom_def.hxx b/include/svx/zoom_def.hxx new file mode 100644 index 000000000..e75dd9a27 --- /dev/null +++ b/include/svx/zoom_def.hxx @@ -0,0 +1,30 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#pragma once + +enum class ZoomButtonId +{ + NONE = 0x0000, + OPTIMAL = 0x0001, + PAGEWIDTH = 0x0002, + WHOLEPAGE = 0x0004, +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/zoomctrl.hxx b/include/svx/zoomctrl.hxx new file mode 100644 index 000000000..4508fcf3d --- /dev/null +++ b/include/svx/zoomctrl.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_SVX_ZOOMCTRL_HXX +#define INCLUDED_SVX_ZOOMCTRL_HXX + +#include +#include +#include +#include + +class SVX_DLLPUBLIC SvxZoomStatusBarControl : public SfxStatusBarControl +{ +private: + sal_uInt16 nZoom; + SvxZoomEnableFlags nValueSet; + +public: + virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, + const SfxPoolItem* pState ) override; + virtual void Paint( const UserDrawEvent& rEvt ) override; + virtual void Command( const CommandEvent& rCEvt ) override; + + SFX_DECL_STATUSBAR_CONTROL(); + + SvxZoomStatusBarControl( sal_uInt16 nSlotId, sal_uInt16 nId, StatusBar& rStb ); + +private: + void ImplUpdateItemText(); +}; + +class SVX_DLLPUBLIC SvxZoomPageStatusBarControl final : public SfxStatusBarControl +{ +private: + Image maImage; +public: + virtual void Paint( const UserDrawEvent& rEvt ) override; + virtual bool MouseButtonDown( const MouseEvent & rEvt ) override; + + SFX_DECL_STATUSBAR_CONTROL(); + + SvxZoomPageStatusBarControl(sal_uInt16 nSlotId, sal_uInt16 nId, StatusBar& rStb); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/zoomsliderctrl.hxx b/include/svx/zoomsliderctrl.hxx new file mode 100644 index 000000000..41e9e5abd --- /dev/null +++ b/include/svx/zoomsliderctrl.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_SVX_ZOOMSLIDERCTRL_HXX +#define INCLUDED_SVX_ZOOMSLIDERCTRL_HXX + +#include +#include +#include + +class SVX_DLLPUBLIC SvxZoomSliderControl final : public SfxStatusBarControl +{ +private: + + struct SvxZoomSliderControl_Impl; + std::unique_ptr mxImpl; + + sal_uInt16 Offset2Zoom( long nOffset ) const; + long Zoom2Offset( sal_uInt16 nZoom ) const; + + void repaintAndExecute(); + void forceRepaint() const; + +public: + + SFX_DECL_STATUSBAR_CONTROL(); + + SvxZoomSliderControl( sal_uInt16 _nSlotId, sal_uInt16 _nId, StatusBar& _rStb ); + virtual ~SvxZoomSliderControl() override; + + virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) override; + virtual void Paint( const UserDrawEvent& rEvt ) override; + virtual bool MouseButtonDown( const MouseEvent & ) override; + virtual bool MouseButtonUp( const MouseEvent & ) override; + virtual bool MouseMove( const MouseEvent & rEvt ) override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/zoomslideritem.hxx b/include/svx/zoomslideritem.hxx new file mode 100644 index 000000000..f257f1999 --- /dev/null +++ b/include/svx/zoomslideritem.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_SVX_ZOOMSLIDERITEM_HXX +#define INCLUDED_SVX_ZOOMSLIDERITEM_HXX + +#include +#include +#include +#include + + +class SVX_DLLPUBLIC SvxZoomSliderItem final : public SfxUInt16Item +{ + css::uno::Sequence < sal_Int32 > maValues; + sal_uInt16 mnMinZoom; + sal_uInt16 mnMaxZoom; + +public: + static SfxPoolItem* CreateDefault(); + + SvxZoomSliderItem( sal_uInt16 nCurrentZoom = 100, sal_uInt16 nMinZoom = 20, sal_uInt16 nMaxZoom = 600, sal_uInt16 nWhich = SID_ATTR_ZOOMSLIDER ); + + void AddSnappingPoint( sal_Int32 nNew ); + const css::uno::Sequence < sal_Int32 >& GetSnappingPoints() const { return maValues;} + sal_uInt16 GetMinZoom() const {return mnMinZoom;} + sal_uInt16 GetMaxZoom() const {return mnMaxZoom;} + + // "purely virtual methods" from the SfxPoolItem + virtual bool operator==( const SfxPoolItem& ) const override; + virtual SvxZoomSliderItem* Clone( SfxItemPool *pPool = nullptr ) const override; + virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; + virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3